"use strict";
/**
* @vue/shared v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function makeMap(str, expectsLowerCase) {
  const set2 = new Set(str.split(","));
  return expectsLowerCase ? (val2) => set2.has(val2.toLowerCase()) : (val2) => set2.has(val2);
}
const EMPTY_OBJ$1 = Object.freeze({});
const EMPTY_ARR = Object.freeze([]);
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 = Object.assign;
const remove = (arr, el) => {
  const i3 = arr.indexOf(el);
  if (i3 > -1) {
    arr.splice(i3, 1);
  }
};
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
const hasOwn$1 = (val2, key) => hasOwnProperty$1.call(val2, key);
const isArray$1 = Array.isArray;
const isMap$1 = (val2) => toTypeString$1(val2) === "[object Map]";
const isSet$1 = (val2) => toTypeString$1(val2) === "[object Set]";
const isFunction$1 = (val2) => typeof val2 === "function";
const isString = (val2) => typeof val2 === "string";
const isSymbol = (val2) => typeof val2 === "symbol";
const isObject$1 = (val2) => val2 !== null && typeof val2 === "object";
const isPromise = (val2) => {
  return (isObject$1(val2) || isFunction$1(val2)) && isFunction$1(val2.then) && isFunction$1(val2.catch);
};
const objectToString$1 = Object.prototype.toString;
const toTypeString$1 = (value) => objectToString$1.call(value);
const toRawType = (value) => {
  return toTypeString$1(value).slice(8, -1);
};
const isPlainObject$1 = (val2) => toTypeString$1(val2) === "[object Object]";
const isIntegerKey = (key) => isString(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 isBuiltInDirective = /* @__PURE__ */ makeMap(
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
);
const cacheStringFunction = (fn) => {
  const cache = /* @__PURE__ */ Object.create(null);
  return (str) => {
    const hit = cache[str];
    return hit || (cache[str] = fn(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 = cacheStringFunction((str) => {
  return str.charAt(0).toUpperCase() + str.slice(1);
});
const toHandlerKey = cacheStringFunction((str) => {
  const s3 = str ? `on${capitalize(str)}` : ``;
  return s3;
});
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
const invokeArrayFns$1 = (fns, arg) => {
  for (let i3 = 0; i3 < fns.length; i3++) {
    fns[i3](arg);
  }
};
const def$1 = (obj, key, value) => {
  Object.defineProperty(obj, key, {
    configurable: true,
    enumerable: false,
    value
  });
};
const looseToNumber = (val2) => {
  const n2 = parseFloat(val2);
  return isNaN(n2) ? val2 : n2;
};
const toNumber = (val2) => {
  const n2 = isString(val2) ? Number(val2) : NaN;
  return isNaN(n2) ? val2 : n2;
};
function normalizeStyle(value) {
  if (isArray$1(value)) {
    const res = {};
    for (let i3 = 0; i3 < value.length; i3++) {
      const item = value[i3];
      const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
      if (normalized) {
        for (const key in normalized) {
          res[key] = normalized[key];
        }
      }
    }
    return res;
  } else if (isString(value) || isObject$1(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(value)) {
    res = value;
  } else if (isArray$1(value)) {
    for (let i3 = 0; i3 < value.length; i3++) {
      const normalized = normalizeClass(value[i3]);
      if (normalized) {
        res += normalized + " ";
      }
    }
  } else if (isObject$1(value)) {
    for (const name in value) {
      if (value[name]) {
        res += name + " ";
      }
    }
  }
  return res.trim();
}
function normalizeProps(props) {
  if (!props)
    return null;
  let { class: klass, style } = props;
  if (klass && !isString(klass)) {
    props.class = normalizeClass(klass);
  }
  if (style) {
    props.style = normalizeStyle(style);
  }
  return props;
}
const toDisplayString = (val2) => {
  return isString(val2) ? val2 : val2 == null ? "" : isArray$1(val2) || isObject$1(val2) && (val2.toString === objectToString$1 || !isFunction$1(val2.toString)) ? JSON.stringify(val2, replacer, 2) : String(val2);
};
const replacer = (_key, val2) => {
  if (val2 && val2.__v_isRef) {
    return replacer(_key, val2.value);
  } else if (isMap$1(val2)) {
    return {
      [`Map(${val2.size})`]: [...val2.entries()].reduce(
        (entries, [key, val22], i3) => {
          entries[stringifySymbol(key, i3) + " =>"] = val22;
          return entries;
        },
        {}
      )
    };
  } else if (isSet$1(val2)) {
    return {
      [`Set(${val2.size})`]: [...val2.values()].map((v3) => stringifySymbol(v3))
    };
  } else if (isSymbol(val2)) {
    return stringifySymbol(val2);
  } else if (isObject$1(val2) && !isArray$1(val2) && !isPlainObject$1(val2)) {
    return String(val2);
  }
  return val2;
};
const stringifySymbol = (v3, i3 = "") => {
  var _a;
  return isSymbol(v3) ? `Symbol(${(_a = v3.description) != null ? _a : i3})` : v3;
};
const LOCALE_ZH_HANS = "zh-Hans";
const LOCALE_ZH_HANT = "zh-Hant";
const LOCALE_EN = "en";
const LOCALE_FR = "fr";
const LOCALE_ES = "es";
function include(str, parts) {
  return !!parts.find((part) => str.indexOf(part) !== -1);
}
function startsWith(str, parts) {
  return parts.find((part) => str.indexOf(part) === 0);
}
function normalizeLocale(locale, messages) {
  if (!locale) {
    return;
  }
  locale = locale.trim().replace(/_/g, "-");
  if (messages && messages[locale]) {
    return locale;
  }
  locale = locale.toLowerCase();
  if (locale === "chinese") {
    return LOCALE_ZH_HANS;
  }
  if (locale.indexOf("zh") === 0) {
    if (locale.indexOf("-hans") > -1) {
      return LOCALE_ZH_HANS;
    }
    if (locale.indexOf("-hant") > -1) {
      return LOCALE_ZH_HANT;
    }
    if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
      return LOCALE_ZH_HANT;
    }
    return LOCALE_ZH_HANS;
  }
  let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  if (messages && Object.keys(messages).length > 0) {
    locales = Object.keys(messages);
  }
  const lang = startsWith(locale, locales);
  if (lang) {
    return lang;
  }
}
const SLOT_DEFAULT_NAME = "d";
const ON_SHOW = "onShow";
const ON_HIDE = "onHide";
const ON_LAUNCH = "onLaunch";
const ON_ERROR = "onError";
const ON_THEME_CHANGE = "onThemeChange";
const ON_PAGE_NOT_FOUND = "onPageNotFound";
const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
const ON_EXIT = "onExit";
const ON_LOAD = "onLoad";
const ON_READY = "onReady";
const ON_UNLOAD = "onUnload";
const ON_INIT = "onInit";
const ON_SAVE_EXIT_STATE = "onSaveExitState";
const ON_RESIZE = "onResize";
const ON_BACK_PRESS = "onBackPress";
const ON_PAGE_SCROLL = "onPageScroll";
const ON_TAB_ITEM_TAP = "onTabItemTap";
const ON_REACH_BOTTOM = "onReachBottom";
const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
const ON_SHARE_TIMELINE = "onShareTimeline";
const ON_SHARE_CHAT = "onShareChat";
const ON_ADD_TO_FAVORITES = "onAddToFavorites";
const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
const VIRTUAL_HOST_STYLE = "virtualHostStyle";
const VIRTUAL_HOST_CLASS = "virtualHostClass";
const VIRTUAL_HOST_HIDDEN = "virtualHostHidden";
const VIRTUAL_HOST_ID = "virtualHostId";
function hasLeadingSlash(str) {
  return str.indexOf("/") === 0;
}
function addLeadingSlash(str) {
  return hasLeadingSlash(str) ? str : "/" + str;
}
const invokeArrayFns = (fns, arg) => {
  let ret;
  for (let i3 = 0; i3 < fns.length; i3++) {
    ret = fns[i3](arg);
  }
  return ret;
};
function once(fn, ctx = null) {
  let res;
  return (...args) => {
    if (fn) {
      res = fn.apply(ctx, args);
      fn = null;
    }
    return res;
  };
}
function getValueByDataPath(obj, path) {
  if (!isString(path)) {
    return;
  }
  path = path.replace(/\[(\d+)\]/g, ".$1");
  const parts = path.split(".");
  let key = parts[0];
  if (!obj) {
    obj = {};
  }
  if (parts.length === 1) {
    return obj[key];
  }
  return getValueByDataPath(obj[key], parts.slice(1).join("."));
}
function sortObject(obj) {
  let sortObj = {};
  if (isPlainObject$1(obj)) {
    Object.keys(obj).sort().forEach((key) => {
      const _key = key;
      sortObj[_key] = obj[_key];
    });
  }
  return !Object.keys(sortObj) ? obj : sortObj;
}
function dynamicSlotName(name) {
  return name === "default" ? SLOT_DEFAULT_NAME : name;
}
const customizeRE = /:/g;
function customizeEvent(str) {
  return camelize(str.replace(customizeRE, "-"));
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
  const res = obj ? Object.keys(obj).map((key) => {
    let val2 = obj[key];
    if (typeof val2 === void 0 || val2 === null) {
      val2 = "";
    } else if (isPlainObject$1(val2)) {
      val2 = JSON.stringify(val2);
    }
    return encodeStr(key) + "=" + encodeStr(val2);
  }).filter((x2) => x2.length > 0).join("&") : null;
  return res ? `?${res}` : "";
}
const PAGE_HOOKS = [
  ON_INIT,
  ON_LOAD,
  ON_SHOW,
  ON_HIDE,
  ON_UNLOAD,
  ON_BACK_PRESS,
  ON_PAGE_SCROLL,
  ON_TAB_ITEM_TAP,
  ON_REACH_BOTTOM,
  ON_PULL_DOWN_REFRESH,
  ON_SHARE_TIMELINE,
  ON_SHARE_APP_MESSAGE,
  ON_SHARE_CHAT,
  ON_ADD_TO_FAVORITES,
  ON_SAVE_EXIT_STATE,
  ON_NAVIGATION_BAR_BUTTON_TAP,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
];
function isRootHook(name) {
  return PAGE_HOOKS.indexOf(name) > -1;
}
const UniLifecycleHooks = [
  ON_SHOW,
  ON_HIDE,
  ON_LAUNCH,
  ON_ERROR,
  ON_THEME_CHANGE,
  ON_PAGE_NOT_FOUND,
  ON_UNHANDLE_REJECTION,
  ON_EXIT,
  ON_INIT,
  ON_LOAD,
  ON_READY,
  ON_UNLOAD,
  ON_RESIZE,
  ON_BACK_PRESS,
  ON_PAGE_SCROLL,
  ON_TAB_ITEM_TAP,
  ON_REACH_BOTTOM,
  ON_PULL_DOWN_REFRESH,
  ON_SHARE_TIMELINE,
  ON_ADD_TO_FAVORITES,
  ON_SHARE_APP_MESSAGE,
  ON_SHARE_CHAT,
  ON_SAVE_EXIT_STATE,
  ON_NAVIGATION_BAR_BUTTON_TAP,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
];
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  return {
    onPageScroll: 1,
    onShareAppMessage: 1 << 1,
    onShareTimeline: 1 << 2
  };
})();
function isUniLifecycleHook(name, value, checkType = true) {
  if (checkType && !isFunction$1(value)) {
    return false;
  }
  if (UniLifecycleHooks.indexOf(name) > -1) {
    return true;
  } else if (name.indexOf("on") === 0) {
    return true;
  }
  return false;
}
let vueApp;
const createVueAppHooks = [];
function onCreateVueApp(hook) {
  if (vueApp) {
    return hook(vueApp);
  }
  createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
  vueApp = app;
  createVueAppHooks.forEach((hook) => hook(app));
}
const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
  return createErrorHandler2(app);
});
const E$3 = function() {
};
E$3.prototype = {
  _id: 1,
  on: function(name, callback, ctx) {
    var e2 = this.e || (this.e = {});
    (e2[name] || (e2[name] = [])).push({
      fn: callback,
      ctx,
      _id: this._id
    });
    return this._id++;
  },
  once: function(name, callback, ctx) {
    var self2 = this;
    function listener() {
      self2.off(name, listener);
      callback.apply(ctx, arguments);
    }
    listener._ = callback;
    return this.on(name, listener, ctx);
  },
  emit: function(name) {
    var data = [].slice.call(arguments, 1);
    var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
    var i3 = 0;
    var len = evtArr.length;
    for (i3; i3 < len; i3++) {
      evtArr[i3].fn.apply(evtArr[i3].ctx, data);
    }
    return this;
  },
  off: function(name, event) {
    var e2 = this.e || (this.e = {});
    var evts = e2[name];
    var liveEvents = [];
    if (evts && event) {
      for (var i3 = evts.length - 1; i3 >= 0; i3--) {
        if (evts[i3].fn === event || evts[i3].fn._ === event || evts[i3]._id === event) {
          evts.splice(i3, 1);
          break;
        }
      }
      liveEvents = evts;
    }
    liveEvents.length ? e2[name] = liveEvents : delete e2[name];
    return this;
  }
};
var E$1$1 = E$3;
/**
* @dcloudio/uni-mp-vue v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function warn$2(msg, ...args) {
  console.warn(`[Vue warn] ${msg}`, ...args);
}
let activeEffectScope$1;
let EffectScope$1 = class EffectScope {
  constructor(detached = false) {
    this.detached = detached;
    this._active = true;
    this.effects = [];
    this.cleanups = [];
    this.parent = activeEffectScope$1;
    if (!detached && activeEffectScope$1) {
      this.index = (activeEffectScope$1.scopes || (activeEffectScope$1.scopes = [])).push(
        this
      ) - 1;
    }
  }
  get active() {
    return this._active;
  }
  run(fn) {
    if (this._active) {
      const currentEffectScope = activeEffectScope$1;
      try {
        activeEffectScope$1 = this;
        return fn();
      } finally {
        activeEffectScope$1 = currentEffectScope;
      }
    } else {
      warn$2(`cannot run an inactive effect scope.`);
    }
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  on() {
    activeEffectScope$1 = this;
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  off() {
    activeEffectScope$1 = this.parent;
  }
  stop(fromParent) {
    if (this._active) {
      let i3, l2;
      for (i3 = 0, l2 = this.effects.length; i3 < l2; i3++) {
        this.effects[i3].stop();
      }
      for (i3 = 0, l2 = this.cleanups.length; i3 < l2; i3++) {
        this.cleanups[i3]();
      }
      if (this.scopes) {
        for (i3 = 0, l2 = this.scopes.length; i3 < l2; i3++) {
          this.scopes[i3].stop(true);
        }
      }
      if (!this.detached && this.parent && !fromParent) {
        const last = this.parent.scopes.pop();
        if (last && last !== this) {
          this.parent.scopes[this.index] = last;
          last.index = this.index;
        }
      }
      this.parent = void 0;
      this._active = false;
    }
  }
};
function effectScope$1(detached) {
  return new EffectScope$1(detached);
}
function recordEffectScope$1(effect2, scope = activeEffectScope$1) {
  if (scope && scope.active) {
    scope.effects.push(effect2);
  }
}
function getCurrentScope$1() {
  return activeEffectScope$1;
}
function onScopeDispose$1(fn) {
  if (activeEffectScope$1) {
    activeEffectScope$1.cleanups.push(fn);
  } else {
    warn$2(
      `onScopeDispose() is called when there is no active effect scope to be associated with.`
    );
  }
}
let activeEffect;
class ReactiveEffect {
  constructor(fn, trigger2, scheduler, scope) {
    this.fn = fn;
    this.trigger = trigger2;
    this.scheduler = scheduler;
    this.active = true;
    this.deps = [];
    this._dirtyLevel = 4;
    this._trackId = 0;
    this._runnings = 0;
    this._shouldSchedule = false;
    this._depsLength = 0;
    recordEffectScope$1(this, scope);
  }
  get dirty() {
    if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
      this._dirtyLevel = 1;
      pauseTracking();
      for (let i3 = 0; i3 < this._depsLength; i3++) {
        const dep = this.deps[i3];
        if (dep.computed) {
          triggerComputed(dep.computed);
          if (this._dirtyLevel >= 4) {
            break;
          }
        }
      }
      if (this._dirtyLevel === 1) {
        this._dirtyLevel = 0;
      }
      resetTracking();
    }
    return this._dirtyLevel >= 4;
  }
  set dirty(v3) {
    this._dirtyLevel = v3 ? 4 : 0;
  }
  run() {
    this._dirtyLevel = 0;
    if (!this.active) {
      return this.fn();
    }
    let lastShouldTrack = shouldTrack;
    let lastEffect = activeEffect;
    try {
      shouldTrack = true;
      activeEffect = this;
      this._runnings++;
      preCleanupEffect(this);
      return this.fn();
    } finally {
      postCleanupEffect(this);
      this._runnings--;
      activeEffect = lastEffect;
      shouldTrack = lastShouldTrack;
    }
  }
  stop() {
    var _a;
    if (this.active) {
      preCleanupEffect(this);
      postCleanupEffect(this);
      (_a = this.onStop) == null ? void 0 : _a.call(this);
      this.active = false;
    }
  }
}
function triggerComputed(computed2) {
  return computed2.value;
}
function preCleanupEffect(effect2) {
  effect2._trackId++;
  effect2._depsLength = 0;
}
function postCleanupEffect(effect2) {
  if (effect2.deps.length > effect2._depsLength) {
    for (let i3 = effect2._depsLength; i3 < effect2.deps.length; i3++) {
      cleanupDepEffect(effect2.deps[i3], effect2);
    }
    effect2.deps.length = effect2._depsLength;
  }
}
function cleanupDepEffect(dep, effect2) {
  const trackId = dep.get(effect2);
  if (trackId !== void 0 && effect2._trackId !== trackId) {
    dep.delete(effect2);
    if (dep.size === 0) {
      dep.cleanup();
    }
  }
}
function effect(fn, options) {
  if (fn.effect instanceof ReactiveEffect) {
    fn = fn.effect.fn;
  }
  const _effect = new ReactiveEffect(fn, NOOP, () => {
    if (_effect.dirty) {
      _effect.run();
    }
  });
  if (options) {
    extend(_effect, options);
    if (options.scope)
      recordEffectScope$1(_effect, options.scope);
  }
  if (!options || !options.lazy) {
    _effect.run();
  }
  const runner = _effect.run.bind(_effect);
  runner.effect = _effect;
  return runner;
}
function stop(runner) {
  runner.effect.stop();
}
let shouldTrack = true;
let pauseScheduleStack = 0;
const trackStack = [];
function pauseTracking() {
  trackStack.push(shouldTrack);
  shouldTrack = false;
}
function resetTracking() {
  const last = trackStack.pop();
  shouldTrack = last === void 0 ? true : last;
}
function pauseScheduling() {
  pauseScheduleStack++;
}
function resetScheduling() {
  pauseScheduleStack--;
  while (!pauseScheduleStack && queueEffectSchedulers.length) {
    queueEffectSchedulers.shift()();
  }
}
function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  var _a;
  if (dep.get(effect2) !== effect2._trackId) {
    dep.set(effect2, effect2._trackId);
    const oldDep = effect2.deps[effect2._depsLength];
    if (oldDep !== dep) {
      if (oldDep) {
        cleanupDepEffect(oldDep, effect2);
      }
      effect2.deps[effect2._depsLength++] = dep;
    } else {
      effect2._depsLength++;
    }
    {
      (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
    }
  }
}
const queueEffectSchedulers = [];
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  var _a;
  pauseScheduling();
  for (const effect2 of dep.keys()) {
    let tracking;
    if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
      effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
      effect2._dirtyLevel = dirtyLevel;
    }
    if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
      {
        (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
      }
      effect2.trigger();
      if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
        effect2._shouldSchedule = false;
        if (effect2.scheduler) {
          queueEffectSchedulers.push(effect2.scheduler);
        }
      }
    }
  }
  resetScheduling();
}
const createDep = (cleanup, computed2) => {
  const dep = /* @__PURE__ */ new Map();
  dep.cleanup = cleanup;
  dep.computed = computed2;
  return dep;
};
const targetMap = /* @__PURE__ */ new WeakMap();
const ITERATE_KEY = Symbol("iterate");
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
function track(target, type, key) {
  if (shouldTrack && activeEffect) {
    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 = createDep(() => depsMap.delete(key)));
    }
    trackEffect(
      activeEffect,
      dep,
      {
        target,
        type,
        key
      }
    );
  }
}
function trigger(target, type, key, newValue, oldValue, oldTarget) {
  const depsMap = targetMap.get(target);
  if (!depsMap) {
    return;
  }
  let deps = [];
  if (type === "clear") {
    deps = [...depsMap.values()];
  } else if (key === "length" && isArray$1(target)) {
    const newLength = Number(newValue);
    depsMap.forEach((dep, key2) => {
      if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
        deps.push(dep);
      }
    });
  } else {
    if (key !== void 0) {
      deps.push(depsMap.get(key));
    }
    switch (type) {
      case "add":
        if (!isArray$1(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
          if (isMap$1(target)) {
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
          }
        } else if (isIntegerKey(key)) {
          deps.push(depsMap.get("length"));
        }
        break;
      case "delete":
        if (!isArray$1(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
          if (isMap$1(target)) {
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
          }
        }
        break;
      case "set":
        if (isMap$1(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
        }
        break;
    }
  }
  pauseScheduling();
  for (const dep of deps) {
    if (dep) {
      triggerEffects(
        dep,
        4,
        {
          target,
          type,
          key,
          newValue,
          oldValue,
          oldTarget
        }
      );
    }
  }
  resetScheduling();
}
function getDepFromReactive(object, key) {
  var _a;
  return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
}
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)
);
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
function createArrayInstrumentations() {
  const instrumentations = {};
  ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
    instrumentations[key] = function(...args) {
      const arr = toRaw$1(this);
      for (let i3 = 0, l2 = this.length; i3 < l2; i3++) {
        track(arr, "get", i3 + "");
      }
      const res = arr[key](...args);
      if (res === -1 || res === false) {
        return arr[key](...args.map(toRaw$1));
      } else {
        return res;
      }
    };
  });
  ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
    instrumentations[key] = function(...args) {
      pauseTracking();
      pauseScheduling();
      const res = toRaw$1(this)[key].apply(this, args);
      resetScheduling();
      resetTracking();
      return res;
    };
  });
  return instrumentations;
}
function hasOwnProperty(key) {
  const obj = toRaw$1(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) {
    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 reciever is a user proxy of the reactive proxy
      Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
        return target;
      }
      return;
    }
    const targetIsArray = isArray$1(target);
    if (!isReadonly2) {
      if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
        return Reflect.get(arrayInstrumentations, key, receiver);
      }
      if (key === "hasOwnProperty") {
        return hasOwnProperty;
      }
    }
    const res = Reflect.get(target, key, receiver);
    if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
      return res;
    }
    if (!isReadonly2) {
      track(target, "get", key);
    }
    if (isShallow2) {
      return res;
    }
    if (isRef$1(res)) {
      return targetIsArray && isIntegerKey(key) ? res : res.value;
    }
    if (isObject$1(res)) {
      return isReadonly2 ? readonly$1(res) : reactive$1(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$1(oldValue);
      if (!isShallow(value) && !isReadonly$1(value)) {
        oldValue = toRaw$1(oldValue);
        value = toRaw$1(value);
      }
      if (!isArray$1(target) && isRef$1(oldValue) && !isRef$1(value)) {
        if (isOldValueReadonly) {
          return false;
        } else {
          oldValue.value = value;
          return true;
        }
      }
    }
    const hadKey = isArray$1(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
    const result = Reflect.set(target, key, value, receiver);
    if (target === toRaw$1(receiver)) {
      if (!hadKey) {
        trigger(target, "add", key, value);
      } else if (hasChanged(value, oldValue)) {
        trigger(target, "set", key, value, oldValue);
      }
    }
    return result;
  }
  deleteProperty(target, key) {
    const hadKey = hasOwn$1(target, key);
    const oldValue = target[key];
    const result = Reflect.deleteProperty(target, key);
    if (result && hadKey) {
      trigger(target, "delete", key, void 0, oldValue);
    }
    return result;
  }
  has(target, key) {
    const result = Reflect.has(target, key);
    if (!isSymbol(key) || !builtInSymbols.has(key)) {
      track(target, "has", key);
    }
    return result;
  }
  ownKeys(target) {
    track(
      target,
      "iterate",
      isArray$1(target) ? "length" : ITERATE_KEY
    );
    return Reflect.ownKeys(target);
  }
}
class ReadonlyReactiveHandler extends BaseReactiveHandler {
  constructor(isShallow2 = false) {
    super(true, isShallow2);
  }
  set(target, key) {
    {
      warn$2(
        `Set operation on key "${String(key)}" failed: target is readonly.`,
        target
      );
    }
    return true;
  }
  deleteProperty(target, key) {
    {
      warn$2(
        `Delete operation on key "${String(key)}" failed: target is readonly.`,
        target
      );
    }
    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 = (v3) => Reflect.getPrototypeOf(v3);
function get$1(target, key, isReadonly2 = false, isShallow2 = false) {
  target = target["__v_raw"];
  const rawTarget = toRaw$1(target);
  const rawKey = toRaw$1(key);
  if (!isReadonly2) {
    if (hasChanged(key, rawKey)) {
      track(rawTarget, "get", key);
    }
    track(rawTarget, "get", rawKey);
  }
  const { has: has2 } = getProto(rawTarget);
  const wrap = isShallow2 ? toShallow : isReadonly2 ? 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);
  }
}
function has$1(key, isReadonly2 = false) {
  const target = this["__v_raw"];
  const rawTarget = toRaw$1(target);
  const rawKey = toRaw$1(key);
  if (!isReadonly2) {
    if (hasChanged(key, rawKey)) {
      track(rawTarget, "has", key);
    }
    track(rawTarget, "has", rawKey);
  }
  return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
}
function size(target, isReadonly2 = false) {
  target = target["__v_raw"];
  !isReadonly2 && track(toRaw$1(target), "iterate", ITERATE_KEY);
  return Reflect.get(target, "size", target);
}
function add(value) {
  value = toRaw$1(value);
  const target = toRaw$1(this);
  const proto = getProto(target);
  const hadKey = proto.has.call(target, value);
  if (!hadKey) {
    target.add(value);
    trigger(target, "add", value, value);
  }
  return this;
}
function set$1$1(key, value) {
  value = toRaw$1(value);
  const target = toRaw$1(this);
  const { has: has2, get: get2 } = getProto(target);
  let hadKey = has2.call(target, key);
  if (!hadKey) {
    key = toRaw$1(key);
    hadKey = has2.call(target, key);
  } else {
    checkIdentityKeys(target, has2, key);
  }
  const oldValue = get2.call(target, key);
  target.set(key, value);
  if (!hadKey) {
    trigger(target, "add", key, value);
  } else if (hasChanged(value, oldValue)) {
    trigger(target, "set", key, value, oldValue);
  }
  return this;
}
function deleteEntry(key) {
  const target = toRaw$1(this);
  const { has: has2, get: get2 } = getProto(target);
  let hadKey = has2.call(target, key);
  if (!hadKey) {
    key = toRaw$1(key);
    hadKey = has2.call(target, key);
  } else {
    checkIdentityKeys(target, has2, key);
  }
  const oldValue = get2 ? get2.call(target, key) : void 0;
  const result = target.delete(key);
  if (hadKey) {
    trigger(target, "delete", key, void 0, oldValue);
  }
  return result;
}
function clear() {
  const target = toRaw$1(this);
  const hadItems = target.size !== 0;
  const oldTarget = isMap$1(target) ? new Map(target) : new Set(target);
  const result = target.clear();
  if (hadItems) {
    trigger(target, "clear", void 0, void 0, oldTarget);
  }
  return result;
}
function createForEach(isReadonly2, isShallow2) {
  return function forEach(callback, thisArg) {
    const observed = this;
    const target = observed["__v_raw"];
    const rawTarget = toRaw$1(target);
    const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
    !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
    return target.forEach((value, key) => {
      return callback.call(thisArg, wrap(value), wrap(key), observed);
    });
  };
}
function createIterableMethod(method, isReadonly2, isShallow2) {
  return function(...args) {
    const target = this["__v_raw"];
    const rawTarget = toRaw$1(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) {
    {
      const key = args[0] ? `on key "${args[0]}" ` : ``;
      warn$2(
        `${capitalize(type)} operation ${key}failed: target is readonly.`,
        toRaw$1(this)
      );
    }
    return type === "delete" ? false : type === "clear" ? void 0 : this;
  };
}
function createInstrumentations() {
  const mutableInstrumentations2 = {
    get(key) {
      return get$1(this, key);
    },
    get size() {
      return size(this);
    },
    has: has$1,
    add,
    set: set$1$1,
    delete: deleteEntry,
    clear,
    forEach: createForEach(false, false)
  };
  const shallowInstrumentations2 = {
    get(key) {
      return get$1(this, key, false, true);
    },
    get size() {
      return size(this);
    },
    has: has$1,
    add,
    set: set$1$1,
    delete: deleteEntry,
    clear,
    forEach: createForEach(false, true)
  };
  const readonlyInstrumentations2 = {
    get(key) {
      return get$1(this, key, true);
    },
    get size() {
      return size(this, true);
    },
    has(key) {
      return has$1.call(this, key, true);
    },
    add: createReadonlyMethod("add"),
    set: createReadonlyMethod("set"),
    delete: createReadonlyMethod("delete"),
    clear: createReadonlyMethod("clear"),
    forEach: createForEach(true, false)
  };
  const shallowReadonlyInstrumentations2 = {
    get(key) {
      return get$1(this, key, true, true);
    },
    get size() {
      return size(this, true);
    },
    has(key) {
      return has$1.call(this, key, true);
    },
    add: createReadonlyMethod("add"),
    set: createReadonlyMethod("set"),
    delete: createReadonlyMethod("delete"),
    clear: createReadonlyMethod("clear"),
    forEach: createForEach(true, true)
  };
  const iteratorMethods = [
    "keys",
    "values",
    "entries",
    Symbol.iterator
  ];
  iteratorMethods.forEach((method) => {
    mutableInstrumentations2[method] = createIterableMethod(method, false, false);
    readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
    shallowInstrumentations2[method] = createIterableMethod(method, false, true);
    shallowReadonlyInstrumentations2[method] = createIterableMethod(
      method,
      true,
      true
    );
  });
  return [
    mutableInstrumentations2,
    readonlyInstrumentations2,
    shallowInstrumentations2,
    shallowReadonlyInstrumentations2
  ];
}
const [
  mutableInstrumentations,
  readonlyInstrumentations,
  shallowInstrumentations,
  shallowReadonlyInstrumentations
] = /* @__PURE__ */ createInstrumentations();
function createInstrumentationGetter(isReadonly2, shallow) {
  const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  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)
};
function checkIdentityKeys(target, has2, key) {
  const rawKey = toRaw$1(key);
  if (rawKey !== key && has2.call(target, rawKey)) {
    const type = toRawType(target);
    warn$2(
      `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
    );
  }
}
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$1(target) {
  if (isReadonly$1(target)) {
    return target;
  }
  return createReactiveObject(
    target,
    false,
    mutableHandlers,
    mutableCollectionHandlers,
    reactiveMap
  );
}
function shallowReactive$1(target) {
  return createReactiveObject(
    target,
    false,
    shallowReactiveHandlers,
    shallowCollectionHandlers,
    shallowReactiveMap
  );
}
function readonly$1(target) {
  return createReactiveObject(
    target,
    true,
    readonlyHandlers,
    readonlyCollectionHandlers,
    readonlyMap
  );
}
function shallowReadonly$1(target) {
  return createReactiveObject(
    target,
    true,
    shallowReadonlyHandlers,
    shallowReadonlyCollectionHandlers,
    shallowReadonlyMap
  );
}
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  if (!isObject$1(target)) {
    {
      warn$2(`value cannot be made reactive: ${String(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 proxy2 = new Proxy(
    target,
    targetType === 2 ? collectionHandlers : baseHandlers
  );
  proxyMap.set(target, proxy2);
  return proxy2;
}
function isReactive$1(value) {
  if (isReadonly$1(value)) {
    return isReactive$1(value["__v_raw"]);
  }
  return !!(value && value["__v_isReactive"]);
}
function isReadonly$1(value) {
  return !!(value && value["__v_isReadonly"]);
}
function isShallow(value) {
  return !!(value && value["__v_isShallow"]);
}
function isProxy(value) {
  return isReactive$1(value) || isReadonly$1(value);
}
function toRaw$1(observed) {
  const raw = observed && observed["__v_raw"];
  return raw ? toRaw$1(raw) : observed;
}
function markRaw$1(value) {
  if (Object.isExtensible(value)) {
    def$1(value, "__v_skip", true);
  }
  return value;
}
const toReactive = (value) => isObject$1(value) ? reactive$1(value) : value;
const toReadonly = (value) => isObject$1(value) ? readonly$1(value) : value;
const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided.  Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
class ComputedRefImpl {
  constructor(getter, _setter, isReadonly2, isSSR) {
    this.getter = getter;
    this._setter = _setter;
    this.dep = void 0;
    this.__v_isRef = true;
    this["__v_isReadonly"] = false;
    this.effect = new ReactiveEffect(
      () => getter(this._value),
      () => triggerRefValue(
        this,
        this.effect._dirtyLevel === 2 ? 2 : 3
      )
    );
    this.effect.computed = this;
    this.effect.active = this._cacheable = !isSSR;
    this["__v_isReadonly"] = isReadonly2;
  }
  get value() {
    const self2 = toRaw$1(this);
    if ((!self2._cacheable || self2.effect.dirty) && hasChanged(self2._value, self2._value = self2.effect.run())) {
      triggerRefValue(self2, 4);
    }
    trackRefValue(self2);
    if (self2.effect._dirtyLevel >= 2) {
      if (this._warnRecursive) {
        warn$2(COMPUTED_SIDE_EFFECT_WARN, `

getter: `, this.getter);
      }
      triggerRefValue(self2, 2);
    }
    return self2._value;
  }
  set value(newValue) {
    this._setter(newValue);
  }
  // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  get _dirty() {
    return this.effect.dirty;
  }
  set _dirty(v3) {
    this.effect.dirty = v3;
  }
  // #endregion
}
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  let getter;
  let setter;
  const onlyGetter = isFunction$1(getterOrOptions);
  if (onlyGetter) {
    getter = getterOrOptions;
    setter = () => {
      warn$2("Write operation failed: computed value is readonly");
    };
  } else {
    getter = getterOrOptions.get;
    setter = getterOrOptions.set;
  }
  const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  if (debugOptions && !isSSR) {
    cRef.effect.onTrack = debugOptions.onTrack;
    cRef.effect.onTrigger = debugOptions.onTrigger;
  }
  return cRef;
}
function trackRefValue(ref2) {
  var _a;
  if (shouldTrack && activeEffect) {
    ref2 = toRaw$1(ref2);
    trackEffect(
      activeEffect,
      (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
        () => ref2.dep = void 0,
        ref2 instanceof ComputedRefImpl ? ref2 : void 0
      ),
      {
        target: ref2,
        type: "get",
        key: "value"
      }
    );
  }
}
function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
  ref2 = toRaw$1(ref2);
  const dep = ref2.dep;
  if (dep) {
    triggerEffects(
      dep,
      dirtyLevel,
      {
        target: ref2,
        type: "set",
        key: "value",
        newValue: newVal
      }
    );
  }
}
function isRef$1(r22) {
  return !!(r22 && r22.__v_isRef === true);
}
function ref$1(value) {
  return createRef$1(value, false);
}
function shallowRef$1(value) {
  return createRef$1(value, true);
}
function createRef$1(rawValue, shallow) {
  if (isRef$1(rawValue)) {
    return rawValue;
  }
  return new RefImpl$1(rawValue, shallow);
}
let RefImpl$1 = class RefImpl {
  constructor(value, __v_isShallow) {
    this.__v_isShallow = __v_isShallow;
    this.dep = void 0;
    this.__v_isRef = true;
    this._rawValue = __v_isShallow ? value : toRaw$1(value);
    this._value = __v_isShallow ? value : toReactive(value);
  }
  get value() {
    trackRefValue(this);
    return this._value;
  }
  set value(newVal) {
    const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly$1(newVal);
    newVal = useDirectValue ? newVal : toRaw$1(newVal);
    if (hasChanged(newVal, this._rawValue)) {
      this._rawValue = newVal;
      this._value = useDirectValue ? newVal : toReactive(newVal);
      triggerRefValue(this, 4, newVal);
    }
  }
};
function triggerRef$1(ref2) {
  triggerRefValue(ref2, 4, ref2.value);
}
function unref$1(ref2) {
  return isRef$1(ref2) ? ref2.value : ref2;
}
function toValue(source) {
  return isFunction$1(source) ? source() : unref$1(source);
}
const shallowUnwrapHandlers = {
  get: (target, key, receiver) => unref$1(Reflect.get(target, key, receiver)),
  set: (target, key, value, receiver) => {
    const oldValue = target[key];
    if (isRef$1(oldValue) && !isRef$1(value)) {
      oldValue.value = value;
      return true;
    } else {
      return Reflect.set(target, key, value, receiver);
    }
  }
};
function proxyRefs$1(objectWithRefs) {
  return isReactive$1(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
}
class CustomRefImpl {
  constructor(factory) {
    this.dep = void 0;
    this.__v_isRef = true;
    const { get: get2, set: set2 } = factory(
      () => trackRefValue(this),
      () => triggerRefValue(this)
    );
    this._get = get2;
    this._set = set2;
  }
  get value() {
    return this._get();
  }
  set value(newVal) {
    this._set(newVal);
  }
}
function customRef$1(factory) {
  return new CustomRefImpl(factory);
}
function toRefs$1(object) {
  if (!isProxy(object)) {
    warn$2(`toRefs() expects a reactive object but received a plain one.`);
  }
  const ret = isArray$1(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;
  }
  get value() {
    const val2 = this._object[this._key];
    return val2 === void 0 ? this._defaultValue : val2;
  }
  set value(newVal) {
    this._object[this._key] = newVal;
  }
  get dep() {
    return getDepFromReactive(toRaw$1(this._object), this._key);
  }
}
class GetterRefImpl {
  constructor(_getter) {
    this._getter = _getter;
    this.__v_isRef = true;
    this.__v_isReadonly = true;
  }
  get value() {
    return this._getter();
  }
}
function toRef$1(source, key, defaultValue) {
  if (isRef$1(source)) {
    return source;
  } else if (isFunction$1(source)) {
    return new GetterRefImpl(source);
  } else if (isObject$1(source) && arguments.length > 1) {
    return propertyToRef(source, key, defaultValue);
  } else {
    return ref$1(source);
  }
}
function propertyToRef(source, key, defaultValue) {
  const val2 = source[key];
  return isRef$1(val2) ? val2 : new ObjectRefImpl(source, key, defaultValue);
}
const stack = [];
function pushWarningContext(vnode) {
  stack.push(vnode);
}
function popWarningContext() {
  stack.pop();
}
function warn$1$1(msg, ...args) {
  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,
      [
        msg + args.map((a2) => {
          var _a, _b;
          return (_b = (_a = a2.toString) == null ? void 0 : _a.call(a2)) != null ? _b : 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();
}
function getComponentTrace() {
  let currentVNode = stack[stack.length - 1];
  if (!currentVNode) {
    return [];
  }
  const normalizedStack = [];
  while (currentVNode) {
    const last = normalizedStack[0];
    if (last && last.vnode === currentVNode) {
      last.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, i3) => {
    logs.push(...i3 === 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 open = ` at <${formatComponentName(
    vnode.component,
    vnode.type,
    isRoot
  )}`;
  const close = `>` + postfix;
  return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
}
function formatProps(props) {
  const res = [];
  const keys = Object.keys(props);
  keys.slice(0, 3).forEach((key) => {
    res.push(...formatProp(key, props[key]));
  });
  if (keys.length > 3) {
    res.push(` ...`);
  }
  return res;
}
function formatProp(key, value, raw) {
  if (isString(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$1(value)) {
    value = formatProp(key, toRaw$1(value.value), true);
    return raw ? value : [`${key}=Ref<`, value, `>`];
  } else if (isFunction$1(value)) {
    return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  } else {
    value = toRaw$1(value);
    return raw ? value : [`${key}=`, value];
  }
}
const ErrorTypeStrings = {
  ["sp"]: "serverPrefetch hook",
  ["bc"]: "beforeCreate hook",
  ["c"]: "created hook",
  ["bm"]: "beforeMount hook",
  ["m"]: "mounted hook",
  ["bu"]: "beforeUpdate hook",
  ["u"]: "updated",
  ["bum"]: "beforeUnmount hook",
  ["um"]: "unmounted hook",
  ["a"]: "activated hook",
  ["da"]: "deactivated hook",
  ["ec"]: "errorCaptured hook",
  ["rtc"]: "renderTracked hook",
  ["rtg"]: "renderTriggered hook",
  [0]: "setup function",
  [1]: "render function",
  [2]: "watcher getter",
  [3]: "watcher callback",
  [4]: "watcher cleanup function",
  [5]: "native event handler",
  [6]: "component event handler",
  [7]: "vnode hook",
  [8]: "directive hook",
  [9]: "transition hook",
  [10]: "app errorHandler",
  [11]: "app warnHandler",
  [12]: "ref function",
  [13]: "async component loader",
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
};
function callWithErrorHandling(fn, instance, type, args) {
  try {
    return args ? fn(...args) : fn();
  } catch (err) {
    handleError(err, instance, type);
  }
}
function callWithAsyncErrorHandling(fn, instance, type, args) {
  if (isFunction$1(fn)) {
    const res = callWithErrorHandling(fn, instance, type, args);
    if (res && isPromise(res)) {
      res.catch((err) => {
        handleError(err, instance, type);
      });
    }
    return res;
  }
  const values = [];
  for (let i3 = 0; i3 < fn.length; i3++) {
    values.push(callWithAsyncErrorHandling(fn[i3], instance, type, args));
  }
  return values;
}
function handleError(err, instance, type, throwInDev = true) {
  const contextVNode = instance ? instance.vnode : null;
  if (instance) {
    let cur = instance.parent;
    const exposedInstance = instance.proxy;
    const errorInfo = ErrorTypeStrings[type] || type;
    while (cur) {
      const errorCapturedHooks = cur.ec;
      if (errorCapturedHooks) {
        for (let i3 = 0; i3 < errorCapturedHooks.length; i3++) {
          if (errorCapturedHooks[i3](err, exposedInstance, errorInfo) === false) {
            return;
          }
        }
      }
      cur = cur.parent;
    }
    const appErrorHandler = instance.appContext.config.errorHandler;
    if (appErrorHandler) {
      callWithErrorHandling(
        appErrorHandler,
        null,
        10,
        [err, exposedInstance, errorInfo]
      );
      return;
    }
  }
  logError$1(err, type, contextVNode, throwInDev);
}
function logError$1(err, type, contextVNode, throwInDev = true) {
  {
    const info = ErrorTypeStrings[type] || type;
    if (contextVNode) {
      pushWarningContext(contextVNode);
    }
    warn$1$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
    if (contextVNode) {
      popWarningContext();
    }
    if (throwInDev) {
      console.error(err);
    } else {
      console.error(err);
    }
  }
}
let isFlushing = false;
let isFlushPending = false;
const queue$1 = [];
let flushIndex = 0;
const pendingPostFlushCbs = [];
let activePostFlushCbs = null;
let postFlushIndex = 0;
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
let currentFlushPromise = null;
const RECURSION_LIMIT = 100;
function nextTick$1(fn) {
  const p22 = currentFlushPromise || resolvedPromise;
  return fn ? p22.then(this ? fn.bind(this) : fn) : p22;
}
function findInsertionIndex(id) {
  let start = flushIndex + 1;
  let end = queue$1.length;
  while (start < end) {
    const middle = start + end >>> 1;
    const middleJob = queue$1[middle];
    const middleJobId = getId(middleJob);
    if (middleJobId < id || middleJobId === id && middleJob.pre) {
      start = middle + 1;
    } else {
      end = middle;
    }
  }
  return start;
}
function queueJob(job) {
  if (!queue$1.length || !queue$1.includes(
    job,
    isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  )) {
    if (job.id == null) {
      queue$1.push(job);
    } else {
      queue$1.splice(findInsertionIndex(job.id), 0, job);
    }
    queueFlush();
  }
}
function queueFlush() {
  if (!isFlushing && !isFlushPending) {
    isFlushPending = true;
    currentFlushPromise = resolvedPromise.then(flushJobs);
  }
}
function hasQueueJob(job) {
  return queue$1.indexOf(job) > -1;
}
function invalidateJob(job) {
  const i3 = queue$1.indexOf(job);
  if (i3 > flushIndex) {
    queue$1.splice(i3, 1);
  }
}
function queuePostFlushCb(cb) {
  if (!isArray$1(cb)) {
    if (!activePostFlushCbs || !activePostFlushCbs.includes(
      cb,
      cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
    )) {
      pendingPostFlushCbs.push(cb);
    }
  } else {
    pendingPostFlushCbs.push(...cb);
  }
  queueFlush();
}
function flushPreFlushCbs(instance, seen, i3 = isFlushing ? flushIndex + 1 : 0) {
  {
    seen = seen || /* @__PURE__ */ new Map();
  }
  for (; i3 < queue$1.length; i3++) {
    const cb = queue$1[i3];
    if (cb && cb.pre) {
      if (checkRecursiveUpdates(seen, cb)) {
        continue;
      }
      queue$1.splice(i3, 1);
      i3--;
      cb();
    }
  }
}
function flushPostFlushCbs(seen) {
  if (pendingPostFlushCbs.length) {
    const deduped = [...new Set(pendingPostFlushCbs)].sort(
      (a2, b2) => getId(a2) - getId(b2)
    );
    pendingPostFlushCbs.length = 0;
    if (activePostFlushCbs) {
      activePostFlushCbs.push(...deduped);
      return;
    }
    activePostFlushCbs = deduped;
    {
      seen = seen || /* @__PURE__ */ new Map();
    }
    for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
      if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
        continue;
      }
      activePostFlushCbs[postFlushIndex]();
    }
    activePostFlushCbs = null;
    postFlushIndex = 0;
  }
}
const getId = (job) => job.id == null ? Infinity : job.id;
const comparator = (a2, b2) => {
  const diff2 = getId(a2) - getId(b2);
  if (diff2 === 0) {
    if (a2.pre && !b2.pre)
      return -1;
    if (b2.pre && !a2.pre)
      return 1;
  }
  return diff2;
};
function flushJobs(seen) {
  isFlushPending = false;
  isFlushing = true;
  {
    seen = seen || /* @__PURE__ */ new Map();
  }
  queue$1.sort(comparator);
  const check = (job) => checkRecursiveUpdates(seen, job);
  try {
    for (flushIndex = 0; flushIndex < queue$1.length; flushIndex++) {
      const job = queue$1[flushIndex];
      if (job && job.active !== false) {
        if (check(job)) {
          continue;
        }
        callWithErrorHandling(job, null, 14);
      }
    }
  } finally {
    flushIndex = 0;
    queue$1.length = 0;
    flushPostFlushCbs(seen);
    isFlushing = false;
    currentFlushPromise = null;
    if (queue$1.length || pendingPostFlushCbs.length) {
      flushJobs(seen);
    }
  }
}
function checkRecursiveUpdates(seen, fn) {
  if (!seen.has(fn)) {
    seen.set(fn, 1);
  } else {
    const count = seen.get(fn);
    if (count > RECURSION_LIMIT) {
      const instance = fn.ownerInstance;
      const componentName = instance && getComponentName(instance.type);
      handleError(
        `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
        null,
        10
      );
      return true;
    } else {
      seen.set(fn, count + 1);
    }
  }
}
let devtools;
let buffer = [];
let devtoolsNotInstalled = false;
function emit$1(event, ...args) {
  if (devtools) {
    devtools.emit(event, ...args);
  } else if (!devtoolsNotInstalled) {
    buffer.push({ event, args });
  }
}
function setDevtoolsHook(hook, target) {
  var _a, _b;
  devtools = hook;
  if (devtools) {
    devtools.enabled = true;
    buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
    buffer = [];
  } else if (
    // handle late devtools injection - only do this if we are in an actual
    // browser environment to avoid the timer handle stalling test runner exit
    // (#4815)
    typeof window !== "undefined" && // some envs mock window but not fully
    window.HTMLElement && // also exclude jsdom
    !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  ) {
    const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
    replay.push((newHook) => {
      setDevtoolsHook(newHook, target);
    });
    setTimeout(() => {
      if (!devtools) {
        target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
        devtoolsNotInstalled = true;
        buffer = [];
      }
    }, 3e3);
  } else {
    devtoolsNotInstalled = true;
    buffer = [];
  }
}
function devtoolsInitApp(app, version2) {
  emit$1("app:init", app, version2, {
    Fragment,
    Text,
    Comment,
    Static
  });
}
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:added"
  /* COMPONENT_ADDED */
);
const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:updated"
  /* COMPONENT_UPDATED */
);
const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:removed"
  /* COMPONENT_REMOVED */
);
const devtoolsComponentRemoved = (component) => {
  if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  !devtools.cleanupBuffer(component)) {
    _devtoolsComponentRemoved(component);
  }
};
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function createDevtoolsComponentHook(hook) {
  return (component) => {
    emit$1(
      hook,
      component.appContext.app,
      component.uid,
      // fixed by xxxxxx
      // 为 0 是 App，无 parent 是 Page 指向 App
      component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
      component
    );
  };
}
const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  "perf:start"
  /* PERFORMANCE_START */
);
const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  "perf:end"
  /* PERFORMANCE_END */
);
function createDevtoolsPerformanceHook(hook) {
  return (component, type, time) => {
    emit$1(hook, component.appContext.app, component.uid, component, type, time);
  };
}
function devtoolsComponentEmit(component, event, params) {
  emit$1(
    "component:emit",
    component.appContext.app,
    component,
    event,
    params
  );
}
function emit(instance, event, ...rawArgs) {
  if (instance.isUnmounted)
    return;
  const props = instance.vnode.props || EMPTY_OBJ$1;
  {
    const {
      emitsOptions,
      propsOptions: [propsOptions]
    } = instance;
    if (emitsOptions) {
      if (!(event in emitsOptions) && true) {
        if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
          warn$1$1(
            `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
          );
        }
      } else {
        const validator = emitsOptions[event];
        if (isFunction$1(validator)) {
          const isValid = validator(...rawArgs);
          if (!isValid) {
            warn$1$1(
              `Invalid event arguments: event validation failed for event "${event}".`
            );
          }
        }
      }
    }
  }
  let args = rawArgs;
  const isModelListener2 = event.startsWith("update:");
  const modelArg = isModelListener2 && event.slice(7);
  if (modelArg && modelArg in props) {
    const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
    const { number, trim } = props[modifiersKey] || EMPTY_OBJ$1;
    if (trim) {
      args = rawArgs.map((a2) => isString(a2) ? a2.trim() : a2);
    }
    if (number) {
      args = rawArgs.map(looseToNumber);
    }
  }
  {
    devtoolsComponentEmit(instance, event, args);
  }
  {
    const lowerCaseEvent = event.toLowerCase();
    if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
      warn$1$1(
        `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
          instance,
          instance.type
        )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
          event
        )}" instead of "${event}".`
      );
    }
  }
  let handlerName;
  let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  props[handlerName = toHandlerKey(camelize(event))];
  if (!handler && isModelListener2) {
    handler = props[handlerName = toHandlerKey(hyphenate(event))];
  }
  if (handler) {
    callWithAsyncErrorHandling(
      handler,
      instance,
      6,
      args
    );
  }
  const onceHandler = props[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 cache = appContext.emitsCache;
  const cached = cache.get(comp);
  if (cached !== void 0) {
    return cached;
  }
  const raw = comp.emits;
  let normalized = {};
  let hasExtends = false;
  if (!isFunction$1(comp)) {
    const extendEmits = (raw2) => {
      const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
      if (normalizedFromExtend) {
        hasExtends = true;
        extend(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$1(comp)) {
      cache.set(comp, null);
    }
    return null;
  }
  if (isArray$1(raw)) {
    raw.forEach((key) => normalized[key] = null);
  } else {
    extend(normalized, raw);
  }
  if (isObject$1(comp)) {
    cache.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);
}
let currentRenderingInstance = null;
function setCurrentRenderingInstance(instance) {
  const prev = currentRenderingInstance;
  currentRenderingInstance = instance;
  instance && instance.type.__scopeId || null;
  return prev;
}
const withScopeId = (_id) => withCtx;
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  if (!ctx)
    return fn;
  if (fn._n) {
    return fn;
  }
  const renderFnWithContext = (...args) => {
    if (renderFnWithContext._d)
      ;
    const prevInstance = setCurrentRenderingInstance(ctx);
    let res;
    try {
      res = fn(...args);
    } finally {
      setCurrentRenderingInstance(prevInstance);
      if (renderFnWithContext._d)
        ;
    }
    {
      devtoolsComponentUpdated(ctx);
    }
    return res;
  };
  renderFnWithContext._n = true;
  renderFnWithContext._c = true;
  renderFnWithContext._d = true;
  return renderFnWithContext;
}
const COMPONENTS = "components";
const DIRECTIVES = "directives";
function resolveComponent(name, maybeSelfReference) {
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
}
function resolveDirective(name) {
  return resolveAsset(DIRECTIVES, name);
}
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  const instance = currentRenderingInstance || currentInstance$1;
  if (instance) {
    const Component2 = instance.type;
    if (type === COMPONENTS) {
      const selfName = getComponentName(
        Component2,
        false
      );
      if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
        return Component2;
      }
    }
    const res = (
      // local registration
      // check instance[type] first which is resolved for options API
      resolve(instance[type] || Component2[type], name) || // global registration
      resolve(instance.appContext[type], name)
    );
    if (!res && maybeSelfReference) {
      return Component2;
    }
    if (warnMissing && !res) {
      const extra = type === COMPONENTS ? `
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
      warn$1$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
    }
    return res;
  } else {
    warn$1$1(
      `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
    );
  }
}
function resolve(registry, name) {
  return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
}
const ssrContextKey = Symbol.for("v-scx");
const useSSRContext = () => {
  {
    const ctx = inject$1(ssrContextKey);
    if (!ctx) {
      warn$1$1(
        `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
      );
    }
    return ctx;
  }
};
function watchEffect$1(effect2, options) {
  return doWatch(effect2, null, options);
}
function watchPostEffect$1(effect2, options) {
  return doWatch(
    effect2,
    null,
    extend({}, options, { flush: "post" })
  );
}
function watchSyncEffect$1(effect2, options) {
  return doWatch(
    effect2,
    null,
    extend({}, options, { flush: "sync" })
  );
}
const INITIAL_WATCHER_VALUE = {};
function watch$1(source, cb, options) {
  if (!isFunction$1(cb)) {
    warn$1$1(
      `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
    );
  }
  return doWatch(source, cb, options);
}
function doWatch(source, cb, {
  immediate,
  deep,
  flush,
  once: once2,
  onTrack,
  onTrigger
} = EMPTY_OBJ$1) {
  if (cb && once2) {
    const _cb = cb;
    cb = (...args) => {
      _cb(...args);
      unwatch();
    };
  }
  if (deep !== void 0 && typeof deep === "number") {
    warn$1$1(
      `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
    );
  }
  if (!cb) {
    if (immediate !== void 0) {
      warn$1$1(
        `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
    if (deep !== void 0) {
      warn$1$1(
        `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
    if (once2 !== void 0) {
      warn$1$1(
        `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
  }
  const warnInvalidSource = (s22) => {
    warn$1$1(
      `Invalid watch source: `,
      s22,
      `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
    );
  };
  const instance = currentInstance$1;
  const reactiveGetter = (source2) => deep === true ? source2 : (
    // for deep: false, only traverse root-level properties
    traverse$1(source2, deep === false ? 1 : void 0)
  );
  let getter;
  let forceTrigger = false;
  let isMultiSource = false;
  if (isRef$1(source)) {
    getter = () => source.value;
    forceTrigger = isShallow(source);
  } else if (isReactive$1(source)) {
    getter = () => reactiveGetter(source);
    forceTrigger = true;
  } else if (isArray$1(source)) {
    isMultiSource = true;
    forceTrigger = source.some((s22) => isReactive$1(s22) || isShallow(s22));
    getter = () => source.map((s22) => {
      if (isRef$1(s22)) {
        return s22.value;
      } else if (isReactive$1(s22)) {
        return reactiveGetter(s22);
      } else if (isFunction$1(s22)) {
        return callWithErrorHandling(s22, instance, 2);
      } else {
        warnInvalidSource(s22);
      }
    });
  } else if (isFunction$1(source)) {
    if (cb) {
      getter = () => callWithErrorHandling(source, instance, 2);
    } else {
      getter = () => {
        if (cleanup) {
          cleanup();
        }
        return callWithAsyncErrorHandling(
          source,
          instance,
          3,
          [onCleanup]
        );
      };
    }
  } else {
    getter = NOOP;
    warnInvalidSource(source);
  }
  if (cb && deep) {
    const baseGetter = getter;
    getter = () => traverse$1(baseGetter());
  }
  let cleanup;
  let onCleanup = (fn) => {
    cleanup = effect2.onStop = () => {
      callWithErrorHandling(fn, instance, 4);
      cleanup = effect2.onStop = void 0;
    };
  };
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  const job = () => {
    if (!effect2.active || !effect2.dirty) {
      return;
    }
    if (cb) {
      const newValue = effect2.run();
      if (deep || forceTrigger || (isMultiSource ? newValue.some((v3, i3) => hasChanged(v3, oldValue[i3])) : hasChanged(newValue, oldValue)) || false) {
        if (cleanup) {
          cleanup();
        }
        callWithAsyncErrorHandling(cb, instance, 3, [
          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,
          onCleanup
        ]);
        oldValue = newValue;
      }
    } else {
      effect2.run();
    }
  };
  job.allowRecurse = !!cb;
  let scheduler;
  if (flush === "sync") {
    scheduler = job;
  } else if (flush === "post") {
    scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
  } else {
    job.pre = true;
    if (instance)
      job.id = instance.uid;
    scheduler = () => queueJob(job);
  }
  const effect2 = new ReactiveEffect(getter, NOOP, scheduler);
  const scope = getCurrentScope$1();
  const unwatch = () => {
    effect2.stop();
    if (scope) {
      remove(scope.effects, effect2);
    }
  };
  {
    effect2.onTrack = onTrack;
    effect2.onTrigger = onTrigger;
  }
  if (cb) {
    if (immediate) {
      job();
    } else {
      oldValue = effect2.run();
    }
  } else if (flush === "post") {
    queuePostRenderEffect$1(
      effect2.run.bind(effect2),
      instance && instance.suspense
    );
  } else {
    effect2.run();
  }
  return unwatch;
}
function instanceWatch(source, value, options) {
  const publicThis = this.proxy;
  const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  let cb;
  if (isFunction$1(value)) {
    cb = value;
  } else {
    cb = value.handler;
    options = value;
  }
  const reset = setCurrentInstance$1(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 i3 = 0; i3 < segments.length && cur; i3++) {
      cur = cur[segments[i3]];
    }
    return cur;
  };
}
function traverse$1(value, depth, currentDepth = 0, seen) {
  if (!isObject$1(value) || value["__v_skip"]) {
    return value;
  }
  if (depth && depth > 0) {
    if (currentDepth >= depth) {
      return value;
    }
    currentDepth++;
  }
  seen = seen || /* @__PURE__ */ new Set();
  if (seen.has(value)) {
    return value;
  }
  seen.add(value);
  if (isRef$1(value)) {
    traverse$1(value.value, depth, currentDepth, seen);
  } else if (isArray$1(value)) {
    for (let i3 = 0; i3 < value.length; i3++) {
      traverse$1(value[i3], depth, currentDepth, seen);
    }
  } else if (isSet$1(value) || isMap$1(value)) {
    value.forEach((v3) => {
      traverse$1(v3, depth, currentDepth, seen);
    });
  } else if (isPlainObject$1(value)) {
    for (const key in value) {
      traverse$1(value[key], depth, currentDepth, seen);
    }
  }
  return value;
}
function validateDirectiveName(name) {
  if (isBuiltInDirective(name)) {
    warn$1$1("Do not use built-in directive ids as custom directive id: " + name);
  }
}
function withDirectives(vnode, directives) {
  if (currentRenderingInstance === null) {
    warn$1$1(`withDirectives can only be used inside render functions.`);
    return vnode;
  }
  const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
  const bindings = vnode.dirs || (vnode.dirs = []);
  for (let i3 = 0; i3 < directives.length; i3++) {
    let [dir, value, arg, modifiers = EMPTY_OBJ$1] = directives[i3];
    if (dir) {
      if (isFunction$1(dir)) {
        dir = {
          mounted: dir,
          updated: dir
        };
      }
      if (dir.deep) {
        traverse$1(value);
      }
      bindings.push({
        dir,
        instance,
        value,
        oldValue: void 0,
        arg,
        modifiers
      });
    }
  }
  return vnode;
}
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(render, hydrate) {
  return function createApp2(rootComponent, rootProps = null) {
    if (!isFunction$1(rootComponent)) {
      rootComponent = extend({}, rootComponent);
    }
    if (rootProps != null && !isObject$1(rootProps)) {
      warn$1$1(`root props passed to app.mount() must be an object.`);
      rootProps = null;
    }
    const context = createAppContext();
    const installedPlugins = /* @__PURE__ */ new WeakSet();
    const app = 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(v3) {
        {
          warn$1$1(
            `app.config cannot be replaced. Modify individual options instead.`
          );
        }
      },
      use(plugin2, ...options) {
        if (installedPlugins.has(plugin2)) {
          warn$1$1(`Plugin has already been applied to target app.`);
        } else if (plugin2 && isFunction$1(plugin2.install)) {
          installedPlugins.add(plugin2);
          plugin2.install(app, ...options);
        } else if (isFunction$1(plugin2)) {
          installedPlugins.add(plugin2);
          plugin2(app, ...options);
        } else {
          warn$1$1(
            `A plugin must either be a function or an object with an "install" function.`
          );
        }
        return app;
      },
      mixin(mixin2) {
        {
          if (!context.mixins.includes(mixin2)) {
            context.mixins.push(mixin2);
          } else {
            warn$1$1(
              "Mixin has already been applied to target app" + (mixin2.name ? `: ${mixin2.name}` : "")
            );
          }
        }
        return app;
      },
      component(name, component) {
        {
          validateComponentName(name, context.config);
        }
        if (!component) {
          return context.components[name];
        }
        if (context.components[name]) {
          warn$1$1(`Component "${name}" has already been registered in target app.`);
        }
        context.components[name] = component;
        return app;
      },
      directive(name, directive) {
        {
          validateDirectiveName(name);
        }
        if (!directive) {
          return context.directives[name];
        }
        if (context.directives[name]) {
          warn$1$1(`Directive "${name}" has already been registered in target app.`);
        }
        context.directives[name] = directive;
        return app;
      },
      // fixed by xxxxxx
      mount() {
      },
      // fixed by xxxxxx
      unmount() {
      },
      provide(key, value) {
        if (key in context.provides) {
          warn$1$1(
            `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
          );
        }
        context.provides[key] = value;
        return app;
      },
      runWithContext(fn) {
        const lastApp = currentApp;
        currentApp = app;
        try {
          return fn();
        } finally {
          currentApp = lastApp;
        }
      }
    };
    return app;
  };
}
let currentApp = null;
function provide$1(key, value) {
  if (!currentInstance$1) {
    {
      warn$1$1(`provide() can only be used inside setup().`);
    }
  } else {
    let provides = currentInstance$1.provides;
    const parentProvides = currentInstance$1.parent && currentInstance$1.parent.provides;
    if (parentProvides === provides) {
      provides = currentInstance$1.provides = Object.create(parentProvides);
    }
    provides[key] = value;
    if (currentInstance$1.type.mpType === "app") {
      currentInstance$1.appContext.app.provide(key, value);
    }
  }
}
function inject$1(key, defaultValue, treatDefaultAsFactory = false) {
  const instance = currentInstance$1 || currentRenderingInstance;
  if (instance || currentApp) {
    const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
    if (provides && key in provides) {
      return provides[key];
    } else if (arguments.length > 1) {
      return treatDefaultAsFactory && isFunction$1(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
    } else {
      warn$1$1(`injection "${String(key)}" not found.`);
    }
  } else {
    warn$1$1(`inject() can only be used inside setup() or functional components.`);
  }
}
function hasInjectionContext() {
  return !!(currentInstance$1 || currentRenderingInstance || currentApp);
}
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function defineComponent$1(options, extraOptions) {
  return isFunction$1(options) ? (
    // #8326: 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({ name: options.name }, extraOptions, { setup: options }))()
  ) : options;
}
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
function onActivated$1(hook, target) {
  registerKeepAliveHook(hook, "a", target);
}
function onDeactivated$1(hook, target) {
  registerKeepAliveHook(hook, "da", target);
}
function registerKeepAliveHook(hook, type, target = currentInstance$1) {
  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$1(() => {
    remove(keepAliveRoot[type], injected);
  }, target);
}
function injectHook(type, hook, target = currentInstance$1, prepend = false) {
  if (target) {
    if (isRootHook(type)) {
      target = target.root;
    }
    const hooks = target[type] || (target[type] = []);
    const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
      if (target.isUnmounted) {
        return;
      }
      pauseTracking();
      const reset = setCurrentInstance$1(target);
      const res = callWithAsyncErrorHandling(hook, target, type, args);
      reset();
      resetTracking();
      return res;
    });
    if (prepend) {
      hooks.unshift(wrappedHook);
    } else {
      hooks.push(wrappedHook);
    }
    return wrappedHook;
  } else {
    const apiName = toHandlerKey(
      (ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, "")
    );
    warn$1$1(
      `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`
    );
  }
}
const createHook$1 = (lifecycle) => (hook, target = currentInstance$1) => (
  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  (!exports.isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
);
const onBeforeMount$1 = createHook$1("bm");
const onMounted$1 = createHook$1("m");
const onBeforeUpdate$1 = createHook$1("bu");
const onUpdated$1 = createHook$1("u");
const onBeforeUnmount$1 = createHook$1("bum");
const onUnmounted$1 = createHook$1("um");
const onServerPrefetch$1 = createHook$1("sp");
const onRenderTriggered = createHook$1(
  "rtg"
);
const onRenderTracked = createHook$1(
  "rtc"
);
function onErrorCaptured$1(hook, target = currentInstance$1) {
  injectHook("ec", hook, target);
}
function toHandlers(obj, preserveCaseIfNecessary) {
  const ret = {};
  if (!isObject$1(obj)) {
    warn$1$1(`v-on with no argument expects an object value.`);
    return ret;
  }
  for (const key in obj) {
    ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  }
  return ret;
}
const getPublicInstance = (i3) => {
  if (!i3)
    return null;
  if (isStatefulComponent(i3))
    return getExposeProxy(i3) || i3.proxy;
  return getPublicInstance(i3.parent);
};
const publicPropertiesMap = (
  // Move PURE marker to new line to workaround compiler discarding it
  // due to type annotation
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
    $: (i3) => i3,
    // fixed by xxxxxx vue-i18n 在 dev 模式，访问了 $el，故模拟一个假的
    // $el: i => i.vnode.el,
    $el: (i3) => i3.__$el || (i3.__$el = {}),
    $data: (i3) => i3.data,
    $props: (i3) => shallowReadonly$1(i3.props),
    $attrs: (i3) => shallowReadonly$1(i3.attrs),
    $slots: (i3) => shallowReadonly$1(i3.slots),
    $refs: (i3) => shallowReadonly$1(i3.refs),
    $parent: (i3) => getPublicInstance(i3.parent),
    $root: (i3) => getPublicInstance(i3.root),
    $emit: (i3) => i3.emit,
    $options: (i3) => resolveMergedOptions(i3),
    $forceUpdate: (i3) => i3.f || (i3.f = () => {
      i3.effect.dirty = true;
      queueJob(i3.update);
    }),
    // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
    $watch: (i3) => instanceWatch.bind(i3)
  })
);
const isReservedPrefix = (key) => key === "_" || key === "$";
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ$1 && !state.__isScriptSetup && hasOwn$1(state, key);
const PublicInstanceProxyHandlers = {
  get({ _: instance }, key) {
    const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
    if (key === "__isVue") {
      return true;
    }
    let normalizedProps;
    if (key[0] !== "$") {
      const n2 = accessCache[key];
      if (n2 !== void 0) {
        switch (n2) {
          case 1:
            return setupState[key];
          case 2:
            return data[key];
          case 4:
            return ctx[key];
          case 3:
            return props[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 props[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, "get", key);
      } else if (key === "$slots") {
        track(instance, "get", key);
      }
      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 if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
    // to infinite warning loop
    key.indexOf("__v") !== 0)) {
      if (data !== EMPTY_OBJ$1 && isReservedPrefix(key[0]) && hasOwn$1(data, key)) {
        warn$1$1(
          `Property ${JSON.stringify(
            key
          )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
        );
      } else if (instance === currentRenderingInstance) {
        warn$1$1(
          `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
        );
      }
    }
  },
  set({ _: instance }, key, value) {
    const { data, setupState, ctx } = instance;
    if (hasSetupBinding(setupState, key)) {
      setupState[key] = value;
      return true;
    } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
      warn$1$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
      return false;
    } else if (data !== EMPTY_OBJ$1 && hasOwn$1(data, key)) {
      data[key] = value;
      return true;
    } else if (hasOwn$1(instance.props, key)) {
      warn$1$1(`Attempting to mutate prop "${key}". Props are readonly.`);
      return false;
    }
    if (key[0] === "$" && key.slice(1) in instance) {
      warn$1$1(
        `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
      );
      return false;
    } else {
      if (key in instance.appContext.config.globalProperties) {
        Object.defineProperty(ctx, key, {
          enumerable: true,
          configurable: true,
          value
        });
      } 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);
  }
};
{
  PublicInstanceProxyHandlers.ownKeys = (target) => {
    warn$1$1(
      `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
    );
    return Reflect.ownKeys(target);
  };
}
function createDevRenderContext(instance) {
  const target = {};
  Object.defineProperty(target, `_`, {
    configurable: true,
    enumerable: false,
    get: () => instance
  });
  Object.keys(publicPropertiesMap).forEach((key) => {
    Object.defineProperty(target, key, {
      configurable: true,
      enumerable: false,
      get: () => publicPropertiesMap[key](instance),
      // intercepted by the proxy so no need for implementation,
      // but needed to prevent set errors
      set: NOOP
    });
  });
  return target;
}
function exposePropsOnRenderContext(instance) {
  const {
    ctx,
    propsOptions: [propsOptions]
  } = instance;
  if (propsOptions) {
    Object.keys(propsOptions).forEach((key) => {
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => instance.props[key],
        set: NOOP
      });
    });
  }
}
function exposeSetupStateOnRenderContext(instance) {
  const { ctx, setupState } = instance;
  Object.keys(toRaw$1(setupState)).forEach((key) => {
    if (!setupState.__isScriptSetup) {
      if (isReservedPrefix(key[0])) {
        warn$1$1(
          `setup() return property ${JSON.stringify(
            key
          )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
        );
        return;
      }
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => setupState[key],
        set: NOOP
      });
    }
  });
}
const warnRuntimeUsage = (method) => warn$1$1(
  `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
);
function defineProps() {
  {
    warnRuntimeUsage(`defineProps`);
  }
  return null;
}
function defineEmits() {
  {
    warnRuntimeUsage(`defineEmits`);
  }
  return null;
}
function defineExpose(exposed) {
  {
    warnRuntimeUsage(`defineExpose`);
  }
}
function withDefaults(props, defaults2) {
  {
    warnRuntimeUsage(`withDefaults`);
  }
  return null;
}
function useSlots$1() {
  return getContext$1().slots;
}
function useAttrs$1() {
  return getContext$1().attrs;
}
function getContext$1() {
  const i3 = getCurrentInstance$1();
  if (!i3) {
    warn$1$1(`useContext() called without active instance.`);
  }
  return i3.setupContext || (i3.setupContext = createSetupContext(i3));
}
function normalizePropsOrEmits(props) {
  return isArray$1(props) ? props.reduce(
    (normalized, p22) => (normalized[p22] = null, normalized),
    {}
  ) : props;
}
function mergeDefaults(raw, defaults2) {
  const props = normalizePropsOrEmits(raw);
  for (const key in defaults2) {
    if (key.startsWith("__skip"))
      continue;
    let opt = props[key];
    if (opt) {
      if (isArray$1(opt) || isFunction$1(opt)) {
        opt = props[key] = { type: opt, default: defaults2[key] };
      } else {
        opt.default = defaults2[key];
      }
    } else if (opt === null) {
      opt = props[key] = { default: defaults2[key] };
    } else {
      warn$1$1(`props default key "${key}" has no corresponding declaration.`);
    }
    if (opt && defaults2[`__skip_${key}`]) {
      opt.skipFactory = true;
    }
  }
  return props;
}
function mergeModels(a2, b2) {
  if (!a2 || !b2)
    return a2 || b2;
  if (isArray$1(a2) && isArray$1(b2))
    return a2.concat(b2);
  return extend({}, normalizePropsOrEmits(a2), normalizePropsOrEmits(b2));
}
function createPropsRestProxy(props, excludedKeys) {
  const ret = {};
  for (const key in props) {
    if (!excludedKeys.includes(key)) {
      Object.defineProperty(ret, key, {
        enumerable: true,
        get: () => props[key]
      });
    }
  }
  return ret;
}
function withAsyncContext(getAwaitable) {
  const ctx = getCurrentInstance$1();
  if (!ctx) {
    warn$1$1(
      `withAsyncContext called without active current instance. This is likely a bug.`
    );
  }
  let awaitable = getAwaitable();
  unsetCurrentInstance();
  if (isPromise(awaitable)) {
    awaitable = awaitable.catch((e2) => {
      setCurrentInstance$1(ctx);
      throw e2;
    });
  }
  return [awaitable, () => setCurrentInstance$1(ctx)];
}
function createDuplicateChecker() {
  const cache = /* @__PURE__ */ Object.create(null);
  return (type, key) => {
    if (cache[key]) {
      warn$1$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
    } else {
      cache[key] = type;
    }
  };
}
let shouldCacheAccess = true;
function applyOptions$1(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,
    renderTracked,
    renderTriggered,
    errorCaptured,
    serverPrefetch,
    // public API
    expose,
    inheritAttrs,
    // assets
    components,
    directives,
    filters
  } = options;
  const checkDuplicateProperties = createDuplicateChecker();
  {
    const [propsOptions] = instance.propsOptions;
    if (propsOptions) {
      for (const key in propsOptions) {
        checkDuplicateProperties("Props", key);
      }
    }
  }
  function initInjections() {
    if (injectOptions) {
      resolveInjections(injectOptions, ctx, checkDuplicateProperties);
    }
  }
  {
    initInjections();
  }
  if (methods) {
    for (const key in methods) {
      const methodHandler = methods[key];
      if (isFunction$1(methodHandler)) {
        {
          Object.defineProperty(ctx, key, {
            value: methodHandler.bind(publicThis),
            configurable: true,
            enumerable: true,
            writable: true
          });
        }
        {
          checkDuplicateProperties("Methods", key);
        }
      } else {
        warn$1$1(
          `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
        );
      }
    }
  }
  if (dataOptions) {
    if (!isFunction$1(dataOptions)) {
      warn$1$1(
        `The data option must be a function. Plain object usage is no longer supported.`
      );
    }
    const data = dataOptions.call(publicThis, publicThis);
    if (isPromise(data)) {
      warn$1$1(
        `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
      );
    }
    if (!isObject$1(data)) {
      warn$1$1(`data() should return an object.`);
    } else {
      instance.data = reactive$1(data);
      {
        for (const key in data) {
          checkDuplicateProperties("Data", key);
          if (!isReservedPrefix(key[0])) {
            Object.defineProperty(ctx, key, {
              configurable: true,
              enumerable: true,
              get: () => data[key],
              set: NOOP
            });
          }
        }
      }
    }
  }
  shouldCacheAccess = true;
  if (computedOptions) {
    for (const key in computedOptions) {
      const opt = computedOptions[key];
      const get2 = isFunction$1(opt) ? opt.bind(publicThis, publicThis) : isFunction$1(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
      if (get2 === NOOP) {
        warn$1$1(`Computed property "${key}" has no getter.`);
      }
      const set2 = !isFunction$1(opt) && isFunction$1(opt.set) ? opt.set.bind(publicThis) : () => {
        warn$1$1(
          `Write operation failed: computed property "${key}" is readonly.`
        );
      };
      const c2 = computed$2({
        get: get2,
        set: set2
      });
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => c2.value,
        set: (v3) => c2.value = v3
      });
      {
        checkDuplicateProperties("Computed", key);
      }
    }
  }
  if (watchOptions) {
    for (const key in watchOptions) {
      createWatcher$1(watchOptions[key], ctx, publicThis, key);
    }
  }
  function initProvides() {
    if (provideOptions) {
      const provides = isFunction$1(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
      Reflect.ownKeys(provides).forEach((key) => {
        provide$1(key, provides[key]);
      });
    }
  }
  {
    initProvides();
  }
  {
    if (created) {
      callHook$1(created, instance, "c");
    }
  }
  function registerLifecycleHook(register, hook) {
    if (isArray$1(hook)) {
      hook.forEach((_hook) => register(_hook.bind(publicThis)));
    } else if (hook) {
      register(hook.bind(publicThis));
    }
  }
  registerLifecycleHook(onBeforeMount$1, beforeMount);
  registerLifecycleHook(onMounted$1, mounted);
  registerLifecycleHook(onBeforeUpdate$1, beforeUpdate);
  registerLifecycleHook(onUpdated$1, updated);
  registerLifecycleHook(onActivated$1, activated);
  registerLifecycleHook(onDeactivated$1, deactivated);
  registerLifecycleHook(onErrorCaptured$1, errorCaptured);
  registerLifecycleHook(onRenderTracked, renderTracked);
  registerLifecycleHook(onRenderTriggered, renderTriggered);
  registerLifecycleHook(onBeforeUnmount$1, beforeUnmount);
  registerLifecycleHook(onUnmounted$1, unmounted);
  registerLifecycleHook(onServerPrefetch$1, serverPrefetch);
  if (isArray$1(expose)) {
    if (expose.length) {
      const exposed = instance.exposed || (instance.exposed = {});
      expose.forEach((key) => {
        Object.defineProperty(exposed, key, {
          get: () => publicThis[key],
          set: (val2) => publicThis[key] = val2
        });
      });
    } else if (!instance.exposed) {
      instance.exposed = {};
    }
  }
  if (render && instance.render === NOOP) {
    instance.render = render;
  }
  if (inheritAttrs != null) {
    instance.inheritAttrs = inheritAttrs;
  }
  if (components)
    instance.components = components;
  if (directives)
    instance.directives = directives;
  if (instance.ctx.$onApplyOptions) {
    instance.ctx.$onApplyOptions(options, instance, publicThis);
  }
}
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  if (isArray$1(injectOptions)) {
    injectOptions = normalizeInject(injectOptions);
  }
  for (const key in injectOptions) {
    const opt = injectOptions[key];
    let injected;
    if (isObject$1(opt)) {
      if ("default" in opt) {
        injected = inject$1(
          opt.from || key,
          opt.default,
          true
        );
      } else {
        injected = inject$1(opt.from || key);
      }
    } else {
      injected = inject$1(opt);
    }
    if (isRef$1(injected)) {
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => injected.value,
        set: (v3) => injected.value = v3
      });
    } else {
      ctx[key] = injected;
    }
    {
      checkDuplicateProperties("Inject", key);
    }
  }
}
function callHook$1(hook, instance, type) {
  callWithAsyncErrorHandling(
    isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
    instance,
    type
  );
}
function createWatcher$1(raw, ctx, publicThis, key) {
  const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  if (isString(raw)) {
    const handler = ctx[raw];
    if (isFunction$1(handler)) {
      watch$1(getter, handler);
    } else {
      warn$1$1(`Invalid watch handler specified by key "${raw}"`, handler);
    }
  } else if (isFunction$1(raw)) {
    watch$1(getter, raw.bind(publicThis));
  } else if (isObject$1(raw)) {
    if (isArray$1(raw)) {
      raw.forEach((r22) => createWatcher$1(r22, ctx, publicThis, key));
    } else {
      const handler = isFunction$1(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
      if (isFunction$1(handler)) {
        watch$1(getter, handler, raw);
      } else {
        warn$1$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
      }
    }
  } else {
    warn$1$1(`Invalid watch option: "${key}"`, raw);
  }
}
function resolveMergedOptions(instance) {
  const base = instance.type;
  const { mixins, extends: extendsOptions } = base;
  const {
    mixins: globalMixins,
    optionsCache: cache,
    config: { optionMergeStrategies }
  } = instance.appContext;
  const cached = cache.get(base);
  let resolved;
  if (cached) {
    resolved = cached;
  } else if (!globalMixins.length && !mixins && !extendsOptions) {
    {
      resolved = base;
    }
  } else {
    resolved = {};
    if (globalMixins.length) {
      globalMixins.forEach(
        (m2) => mergeOptions(resolved, m2, optionMergeStrategies, true)
      );
    }
    mergeOptions(resolved, base, optionMergeStrategies);
  }
  if (isObject$1(base)) {
    cache.set(base, resolved);
  }
  return resolved;
}
function mergeOptions(to, from, strats, asMixin = false) {
  const { mixins, extends: extendsOptions } = from;
  if (extendsOptions) {
    mergeOptions(to, extendsOptions, strats, true);
  }
  if (mixins) {
    mixins.forEach(
      (m2) => mergeOptions(to, m2, strats, true)
    );
  }
  for (const key in from) {
    if (asMixin && key === "expose") {
      warn$1$1(
        `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
      );
    } 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$1,
  created: mergeAsArray$1,
  beforeMount: mergeAsArray$1,
  mounted: mergeAsArray$1,
  beforeUpdate: mergeAsArray$1,
  updated: mergeAsArray$1,
  beforeDestroy: mergeAsArray$1,
  beforeUnmount: mergeAsArray$1,
  destroyed: mergeAsArray$1,
  unmounted: mergeAsArray$1,
  activated: mergeAsArray$1,
  deactivated: mergeAsArray$1,
  errorCaptured: mergeAsArray$1,
  serverPrefetch: mergeAsArray$1,
  // 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(
      isFunction$1(to) ? to.call(this, this) : to,
      isFunction$1(from) ? from.call(this, this) : from
    );
  };
}
function mergeInject(to, from) {
  return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
}
function normalizeInject(raw) {
  if (isArray$1(raw)) {
    const res = {};
    for (let i3 = 0; i3 < raw.length; i3++) {
      res[raw[i3]] = raw[i3];
    }
    return res;
  }
  return raw;
}
function mergeAsArray$1(to, from) {
  return to ? [...new Set([].concat(to, from))] : from;
}
function mergeObjectOptions(to, from) {
  return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
}
function mergeEmitsOrPropsOptions(to, from) {
  if (to) {
    if (isArray$1(to) && isArray$1(from)) {
      return [.../* @__PURE__ */ new Set([...to, ...from])];
    }
    return extend(
      /* @__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(/* @__PURE__ */ Object.create(null), to);
  for (const key in from) {
    merged[key] = mergeAsArray$1(to[key], from[key]);
  }
  return merged;
}
function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  const props = {};
  const attrs = {};
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  setFullProps(instance, rawProps, props, attrs);
  for (const key in instance.propsOptions[0]) {
    if (!(key in props)) {
      props[key] = void 0;
    }
  }
  {
    validateProps(rawProps || {}, props, instance);
  }
  if (isStateful) {
    instance.props = isSSR ? props : shallowReactive$1(props);
  } else {
    if (!instance.type.props) {
      instance.props = attrs;
    } else {
      instance.props = props;
    }
  }
  instance.attrs = attrs;
}
function isInHmrContext(instance) {
}
function updateProps(instance, rawProps, rawPrevProps, optimized) {
  const {
    props,
    attrs,
    vnode: { patchFlag }
  } = instance;
  const rawCurrentProps = toRaw$1(props);
  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
    !isInHmrContext() && (optimized || patchFlag > 0) && !(patchFlag & 16)
  ) {
    if (patchFlag & 8) {
      const propsToUpdate = instance.vnode.dynamicProps;
      for (let i3 = 0; i3 < propsToUpdate.length; i3++) {
        let key = propsToUpdate[i3];
        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);
            props[camelizedKey] = resolvePropValue$1(
              options,
              rawCurrentProps,
              camelizedKey,
              value,
              instance,
              false
            );
          }
        } else {
          if (value !== attrs[key]) {
            attrs[key] = value;
            hasAttrsChanged = true;
          }
        }
      }
    }
  } else {
    if (setFullProps(instance, rawProps, props, 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)) {
            props[key] = resolvePropValue$1(
              options,
              rawCurrentProps,
              key,
              void 0,
              instance,
              true
            );
          }
        } else {
          delete props[key];
        }
      }
    }
    if (attrs !== rawCurrentProps) {
      for (const key in attrs) {
        if (!rawProps || !hasOwn$1(rawProps, key) && true) {
          delete attrs[key];
          hasAttrsChanged = true;
        }
      }
    }
  }
  if (hasAttrsChanged) {
    trigger(instance, "set", "$attrs");
  }
  {
    validateProps(rawProps || {}, props, instance);
  }
}
function setFullProps(instance, rawProps, props, 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)) {
          props[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$1(props);
    const castValues = rawCastValues || EMPTY_OBJ$1;
    for (let i3 = 0; i3 < needCastKeys.length; i3++) {
      const key = needCastKeys[i3];
      props[key] = resolvePropValue$1(
        options,
        rawCurrentProps,
        key,
        castValues[key],
        instance,
        !hasOwn$1(castValues, key)
      );
    }
  }
  return hasAttrsChanged;
}
function resolvePropValue$1(options, props, key, value, instance, isAbsent) {
  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$1(defaultValue)) {
        const { propsDefaults } = instance;
        if (key in propsDefaults) {
          value = propsDefaults[key];
        } else {
          const reset = setCurrentInstance$1(instance);
          value = propsDefaults[key] = defaultValue.call(
            null,
            props
          );
          reset();
        }
      } else {
        value = defaultValue;
      }
    }
    if (opt[
      0
      /* shouldCast */
    ]) {
      if (isAbsent && !hasDefault) {
        value = false;
      } else if (opt[
        1
        /* shouldCastTrue */
      ] && (value === "" || value === hyphenate(key))) {
        value = true;
      }
    }
  }
  return value;
}
function normalizePropsOptions(comp, appContext, asMixin = false) {
  const cache = appContext.propsCache;
  const cached = cache.get(comp);
  if (cached) {
    return cached;
  }
  const raw = comp.props;
  const normalized = {};
  const needCastKeys = [];
  let hasExtends = false;
  if (!isFunction$1(comp)) {
    const extendProps = (raw2) => {
      hasExtends = true;
      const [props, keys] = normalizePropsOptions(raw2, appContext, true);
      extend(normalized, props);
      if (keys)
        needCastKeys.push(...keys);
    };
    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$1(comp)) {
      cache.set(comp, EMPTY_ARR);
    }
    return EMPTY_ARR;
  }
  if (isArray$1(raw)) {
    for (let i3 = 0; i3 < raw.length; i3++) {
      if (!isString(raw[i3])) {
        warn$1$1(`props must be strings when using array syntax.`, raw[i3]);
      }
      const normalizedKey = camelize(raw[i3]);
      if (validatePropName(normalizedKey)) {
        normalized[normalizedKey] = EMPTY_OBJ$1;
      }
    }
  } else if (raw) {
    if (!isObject$1(raw)) {
      warn$1$1(`invalid props options`, raw);
    }
    for (const key in raw) {
      const normalizedKey = camelize(key);
      if (validatePropName(normalizedKey)) {
        const opt = raw[key];
        const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction$1(opt) ? { type: opt } : extend({}, opt);
        if (prop) {
          const booleanIndex = getTypeIndex(Boolean, prop.type);
          const stringIndex = getTypeIndex(String, prop.type);
          prop[
            0
            /* shouldCast */
          ] = booleanIndex > -1;
          prop[
            1
            /* shouldCastTrue */
          ] = stringIndex < 0 || booleanIndex < stringIndex;
          if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
            needCastKeys.push(normalizedKey);
          }
        }
      }
    }
  }
  const res = [normalized, needCastKeys];
  if (isObject$1(comp)) {
    cache.set(comp, res);
  }
  return res;
}
function validatePropName(key) {
  if (key[0] !== "$" && !isReservedProp(key)) {
    return true;
  } else {
    warn$1$1(`Invalid prop name: "${key}" is a reserved property.`);
  }
  return false;
}
function getType$1(ctor) {
  if (ctor === null) {
    return "null";
  }
  if (typeof ctor === "function") {
    return ctor.name || "";
  } else if (typeof ctor === "object") {
    const name = ctor.constructor && ctor.constructor.name;
    return name || "";
  }
  return "";
}
function isSameType(a2, b2) {
  return getType$1(a2) === getType$1(b2);
}
function getTypeIndex(type, expectedTypes) {
  if (isArray$1(expectedTypes)) {
    return expectedTypes.findIndex((t2) => isSameType(t2, type));
  } else if (isFunction$1(expectedTypes)) {
    return isSameType(expectedTypes, type) ? 0 : -1;
  }
  return -1;
}
function validateProps(rawProps, props, instance) {
  const resolvedValues = toRaw$1(props);
  const options = instance.propsOptions[0];
  for (const key in options) {
    let opt = options[key];
    if (opt == null)
      continue;
    validateProp$1(
      key,
      resolvedValues[key],
      opt,
      shallowReadonly$1(resolvedValues),
      !hasOwn$1(rawProps, key) && !hasOwn$1(rawProps, hyphenate(key))
    );
  }
}
function validateProp$1(name, value, prop, props, isAbsent) {
  const { type, required, validator, skipCheck } = prop;
  if (required && isAbsent) {
    warn$1$1('Missing required prop: "' + name + '"');
    return;
  }
  if (value == null && !required) {
    return;
  }
  if (type != null && type !== true && !skipCheck) {
    let isValid = false;
    const types = isArray$1(type) ? type : [type];
    const expectedTypes = [];
    for (let i3 = 0; i3 < types.length && !isValid; i3++) {
      const { valid, expectedType } = assertType$1(value, types[i3]);
      expectedTypes.push(expectedType || "");
      isValid = valid;
    }
    if (!isValid) {
      warn$1$1(getInvalidTypeMessage$1(name, value, expectedTypes));
      return;
    }
  }
  if (validator && !validator(value, props)) {
    warn$1$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  }
}
const isSimpleType$1 = /* @__PURE__ */ makeMap(
  "String,Number,Boolean,Function,Symbol,BigInt"
);
function assertType$1(value, type) {
  let valid;
  const expectedType = getType$1(type);
  if (isSimpleType$1(expectedType)) {
    const t2 = typeof value;
    valid = t2 === expectedType.toLowerCase();
    if (!valid && t2 === "object") {
      valid = value instanceof type;
    }
  } else if (expectedType === "Object") {
    valid = isObject$1(value);
  } else if (expectedType === "Array") {
    valid = isArray$1(value);
  } else if (expectedType === "null") {
    valid = value === null;
  } else {
    valid = value instanceof type;
  }
  return {
    valid,
    expectedType
  };
}
function getInvalidTypeMessage$1(name, value, expectedTypes) {
  if (expectedTypes.length === 0) {
    return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  }
  let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  const expectedType = expectedTypes[0];
  const receivedType = toRawType(value);
  const expectedValue = styleValue$1(value, expectedType);
  const receivedValue = styleValue$1(value, receivedType);
  if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
    message += ` with value ${expectedValue}`;
  }
  message += `, got ${receivedType} `;
  if (isExplicable$1(receivedType)) {
    message += `with value ${receivedValue}.`;
  }
  return message;
}
function styleValue$1(value, type) {
  if (type === "String") {
    return `"${value}"`;
  } else if (type === "Number") {
    return `${Number(value)}`;
  } else {
    return `${value}`;
  }
}
function isExplicable$1(type) {
  const explicitTypes = ["string", "number", "boolean"];
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
}
function isBoolean$1(...args) {
  return args.some((elem) => elem.toLowerCase() === "boolean");
}
let supported;
let perf;
function startMeasure(instance, type) {
  if (instance.appContext.config.performance && isSupported()) {
    perf.mark(`vue-${type}-${instance.uid}`);
  }
  {
    devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  }
}
function endMeasure(instance, type) {
  if (instance.appContext.config.performance && isSupported()) {
    const startTag = `vue-${type}-${instance.uid}`;
    const endTag = startTag + `:end`;
    perf.mark(endTag);
    perf.measure(
      `<${formatComponentName(instance, instance.type)}> ${type}`,
      startTag,
      endTag
    );
    perf.clearMarks(startTag);
    perf.clearMarks(endTag);
  }
  {
    devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  }
}
function isSupported() {
  if (supported !== void 0) {
    return supported;
  }
  if (typeof window !== "undefined" && window.performance) {
    supported = true;
    perf = window.performance;
  } else {
    supported = false;
  }
  return supported;
}
const queuePostRenderEffect$1 = queuePostFlushCb;
const Fragment = Symbol.for("v-fgt");
const Text = Symbol.for("v-txt");
const Comment = Symbol.for("v-cmt");
const Static = Symbol.for("v-stc");
function isVNode(value) {
  return value ? value.__v_isVNode === true : false;
}
const InternalObjectKey = `__vInternal`;
function guardReactiveProps(props) {
  if (!props)
    return null;
  return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
}
function mergeProps(...args) {
  const ret = {};
  for (let i3 = 0; i3 < args.length; i3++) {
    const toMerge = args[i3];
    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([ret.style, toMerge.style]);
      } else if (isOn(key)) {
        const existing = ret[key];
        const incoming = toMerge[key];
        if (incoming && existing !== incoming && !(isArray$1(existing) && existing.includes(incoming))) {
          ret[key] = existing ? [].concat(existing, incoming) : incoming;
        }
      } else if (key !== "") {
        ret[key] = toMerge[key];
      }
    }
  }
  return ret;
}
const emptyAppContext = createAppContext();
let uid = 0;
function createComponentInstance(vnode, parent, suspense) {
  const type = vnode.type;
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  const instance = {
    uid: uid++,
    vnode,
    type,
    parent,
    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
    scope: new EffectScope$1(
      true
      /* detached */
    ),
    render: null,
    proxy: null,
    exposed: null,
    exposeProxy: null,
    withProxy: null,
    provides: parent ? parent.provides : Object.create(appContext.provides),
    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,
    attrsProxy: null,
    slotsProxy: 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,
    // fixed by xxxxxx 用于存储uni-app的元素缓存
    $uniElements: /* @__PURE__ */ new Map(),
    $templateUniElementRefs: [],
    $templateUniElementStyles: {},
    $eS: {},
    $eA: {}
  };
  {
    instance.ctx = createDevRenderContext(instance);
  }
  instance.root = parent ? parent.root : instance;
  instance.emit = emit.bind(null, instance);
  if (vnode.ce) {
    vnode.ce(instance);
  }
  return instance;
}
let currentInstance$1 = null;
const getCurrentInstance$1 = () => currentInstance$1 || currentRenderingInstance;
let internalSetCurrentInstance;
let setInSSRSetupState;
{
  internalSetCurrentInstance = (i3) => {
    currentInstance$1 = i3;
  };
  setInSSRSetupState = (v3) => {
    exports.isInSSRComponentSetup = v3;
  };
}
const setCurrentInstance$1 = (instance) => {
  const prev = currentInstance$1;
  internalSetCurrentInstance(instance);
  instance.scope.on();
  return () => {
    instance.scope.off();
    internalSetCurrentInstance(prev);
  };
};
const unsetCurrentInstance = () => {
  currentInstance$1 && currentInstance$1.scope.off();
  internalSetCurrentInstance(null);
};
const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
function validateComponentName(name, { isNativeTag }) {
  if (isBuiltInTag(name) || isNativeTag(name)) {
    warn$1$1(
      "Do not use built-in or reserved HTML elements as component id: " + name
    );
  }
}
function isStatefulComponent(instance) {
  return instance.vnode.shapeFlag & 4;
}
exports.isInSSRComponentSetup = false;
function setupComponent(instance, isSSR = false) {
  isSSR && setInSSRSetupState(isSSR);
  const {
    props
    /*, children*/
  } = instance.vnode;
  const isStateful = isStatefulComponent(instance);
  initProps$1(instance, props, isStateful, isSSR);
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  isSSR && setInSSRSetupState(false);
  return setupResult;
}
function setupStatefulComponent(instance, isSSR) {
  const Component2 = instance.type;
  {
    if (Component2.name) {
      validateComponentName(Component2.name, instance.appContext.config);
    }
    if (Component2.components) {
      const names = Object.keys(Component2.components);
      for (let i3 = 0; i3 < names.length; i3++) {
        validateComponentName(names[i3], instance.appContext.config);
      }
    }
    if (Component2.directives) {
      const names = Object.keys(Component2.directives);
      for (let i3 = 0; i3 < names.length; i3++) {
        validateDirectiveName(names[i3]);
      }
    }
    if (Component2.compilerOptions && isRuntimeOnly()) {
      warn$1$1(
        `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
      );
    }
  }
  instance.accessCache = /* @__PURE__ */ Object.create(null);
  instance.proxy = markRaw$1(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  {
    exposePropsOnRenderContext(instance);
  }
  const { setup } = Component2;
  if (setup) {
    const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
    const reset = setCurrentInstance$1(instance);
    pauseTracking();
    const setupResult = callWithErrorHandling(
      setup,
      instance,
      0,
      [
        shallowReadonly$1(instance.props),
        setupContext
      ]
    );
    resetTracking();
    reset();
    if (isPromise(setupResult)) {
      setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
      {
        warn$1$1(
          `setup() returned a Promise, but the version of Vue you are using does not support it yet.`
        );
      }
    } else {
      handleSetupResult(instance, setupResult, isSSR);
    }
  } else {
    finishComponentSetup(instance, isSSR);
  }
}
function handleSetupResult(instance, setupResult, isSSR) {
  if (isFunction$1(setupResult)) {
    {
      instance.render = setupResult;
    }
  } else if (isObject$1(setupResult)) {
    if (isVNode(setupResult)) {
      warn$1$1(
        `setup() should not return VNodes directly - return a render function instead.`
      );
    }
    {
      instance.devtoolsRawSetupState = setupResult;
    }
    instance.setupState = proxyRefs$1(setupResult);
    {
      exposeSetupStateOnRenderContext(instance);
    }
  } else if (setupResult !== void 0) {
    warn$1$1(
      `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
    );
  }
  finishComponentSetup(instance, isSSR);
}
let compile;
const isRuntimeOnly = () => !compile;
function finishComponentSetup(instance, isSSR, skipOptions) {
  const Component2 = instance.type;
  if (!instance.render) {
    instance.render = Component2.render || NOOP;
  }
  {
    const reset = setCurrentInstance$1(instance);
    pauseTracking();
    try {
      applyOptions$1(instance);
    } finally {
      resetTracking();
      reset();
    }
  }
  if (!Component2.render && instance.render === NOOP && !isSSR) {
    if (Component2.template) {
      warn$1$1(
        `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
      );
    } else {
      warn$1$1(`Component is missing template or render function.`);
    }
  }
}
function getAttrsProxy(instance) {
  return instance.attrsProxy || (instance.attrsProxy = new Proxy(
    instance.attrs,
    {
      get(target, key) {
        track(instance, "get", "$attrs");
        return target[key];
      },
      set() {
        warn$1$1(`setupContext.attrs is readonly.`);
        return false;
      },
      deleteProperty() {
        warn$1$1(`setupContext.attrs is readonly.`);
        return false;
      }
    }
  ));
}
function getSlotsProxy(instance) {
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
    get(target, key) {
      track(instance, "get", "$slots");
      return target[key];
    }
  }));
}
function createSetupContext(instance) {
  const expose = (exposed) => {
    {
      if (instance.exposed) {
        warn$1$1(`expose() should be called only once per setup().`);
      }
      if (exposed != null) {
        let exposedType = typeof exposed;
        if (exposedType === "object") {
          if (isArray$1(exposed)) {
            exposedType = "array";
          } else if (isRef$1(exposed)) {
            exposedType = "ref";
          }
        }
        if (exposedType !== "object") {
          warn$1$1(
            `expose() should be passed a plain object, received ${exposedType}.`
          );
        }
      }
    }
    instance.exposed = exposed || {};
  };
  {
    return Object.freeze({
      get attrs() {
        return getAttrsProxy(instance);
      },
      get slots() {
        return getSlotsProxy(instance);
      },
      get emit() {
        return (event, ...args) => instance.emit(event, ...args);
      },
      expose
    });
  }
}
function getExposeProxy(instance) {
  if (instance.exposed) {
    return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs$1(markRaw$1(instance.exposed)), {
      get(target, key) {
        if (key in target) {
          return target[key];
        }
        return instance.proxy[key];
      },
      has(target, key) {
        return key in target || key in publicPropertiesMap;
      }
    }));
  }
}
const classifyRE = /(?:^|[-_])(\w)/g;
const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
function getComponentName(Component2, includeInferred = true) {
  return isFunction$1(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
}
function formatComponentName(instance, Component2, isRoot = false) {
  let name = getComponentName(Component2);
  if (!name && Component2.__file) {
    const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
    if (match) {
      name = match[1];
    }
  }
  if (!name && instance && instance.parent) {
    const inferFromRegistry = (registry) => {
      for (const key in registry) {
        if (registry[key] === Component2) {
          return key;
        }
      }
    };
    name = inferFromRegistry(
      instance.components || instance.parent.type.components
    ) || inferFromRegistry(instance.appContext.components);
  }
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
}
const computed$2 = (getterOrOptions, debugOptions) => {
  const c2 = computed$1(getterOrOptions, debugOptions, exports.isInSSRComponentSetup);
  {
    const i3 = getCurrentInstance$1();
    if (i3 && i3.appContext.config.warnRecursiveComputed) {
      c2._warnRecursive = true;
    }
  }
  return c2;
};
function useModel(props, name, options = EMPTY_OBJ$1) {
  const i3 = getCurrentInstance$1();
  if (!i3) {
    warn$1$1(`useModel() called without active instance.`);
    return ref$1();
  }
  if (!i3.propsOptions[0][name]) {
    warn$1$1(`useModel() called with prop "${name}" which is not declared.`);
    return ref$1();
  }
  const camelizedName = camelize(name);
  const hyphenatedName = hyphenate(name);
  const res = customRef$1((track2, trigger2) => {
    let localValue;
    watchSyncEffect$1(() => {
      const propValue = props[name];
      if (hasChanged(localValue, propValue)) {
        localValue = propValue;
        trigger2();
      }
    });
    return {
      get() {
        track2();
        return options.get ? options.get(localValue) : localValue;
      },
      set(value) {
        const rawProps = i3.vnode.props;
        if (!(rawProps && // check if parent has passed v-model
        (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
          localValue = value;
          trigger2();
        }
        i3.emit(`update:${name}`, options.set ? options.set(value) : value);
      }
    };
  });
  const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
  res[Symbol.iterator] = () => {
    let i22 = 0;
    return {
      next() {
        if (i22 < 2) {
          return { value: i22++ ? props[modifierKey] || {} : res, done: false };
        } else {
          return { done: true };
        }
      }
    };
  };
  return res;
}
const version$1 = "3.4.21";
const warn$3 = warn$1$1;
const resolveFilter = null;
function unwrapper(target) {
  return unref$1(target);
}
function defineAsyncComponent$1(source) {
  console.error("defineAsyncComponent is unsupported");
}
const ARRAYTYPE = "[object Array]";
const OBJECTTYPE = "[object Object]";
function diff(current, pre) {
  const result = {};
  syncKeys(current, pre);
  _diff(current, pre, "", result);
  return result;
}
function syncKeys(current, pre) {
  current = unwrapper(current);
  if (current === pre)
    return;
  const rootCurrentType = toTypeString$1(current);
  const rootPreType = toTypeString$1(pre);
  if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
    for (let key in pre) {
      const currentValue = current[key];
      if (currentValue === void 0) {
        current[key] = null;
      } else {
        syncKeys(currentValue, pre[key]);
      }
    }
  } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
    if (current.length >= pre.length) {
      pre.forEach((item, index2) => {
        syncKeys(current[index2], item);
      });
    }
  }
}
function _diff(current, pre, path, result) {
  current = unwrapper(current);
  if (current === pre)
    return;
  const rootCurrentType = toTypeString$1(current);
  const rootPreType = toTypeString$1(pre);
  if (rootCurrentType == OBJECTTYPE) {
    if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
      setResult(result, path, current);
    } else {
      for (let key in current) {
        const currentValue = unwrapper(current[key]);
        const preValue = pre[key];
        const currentType = toTypeString$1(currentValue);
        const preType = toTypeString$1(preValue);
        if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
          if (currentValue != preValue) {
            setResult(
              result,
              (path == "" ? "" : path + ".") + key,
              currentValue
            );
          }
        } else if (currentType == ARRAYTYPE) {
          if (preType != ARRAYTYPE) {
            setResult(
              result,
              (path == "" ? "" : path + ".") + key,
              currentValue
            );
          } else {
            if (currentValue.length < preValue.length) {
              setResult(
                result,
                (path == "" ? "" : path + ".") + key,
                currentValue
              );
            } else {
              currentValue.forEach((item, index2) => {
                _diff(
                  item,
                  preValue[index2],
                  (path == "" ? "" : path + ".") + key + "[" + index2 + "]",
                  result
                );
              });
            }
          }
        } else if (currentType == OBJECTTYPE) {
          if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
            setResult(
              result,
              (path == "" ? "" : path + ".") + key,
              currentValue
            );
          } else {
            for (let subKey in currentValue) {
              _diff(
                currentValue[subKey],
                preValue[subKey],
                (path == "" ? "" : path + ".") + key + "." + subKey,
                result
              );
            }
          }
        }
      }
    }
  } else if (rootCurrentType == ARRAYTYPE) {
    if (rootPreType != ARRAYTYPE) {
      setResult(result, path, current);
    } else {
      if (current.length < pre.length) {
        setResult(result, path, current);
      } else {
        current.forEach((item, index2) => {
          _diff(item, pre[index2], path + "[" + index2 + "]", result);
        });
      }
    }
  } else {
    setResult(result, path, current);
  }
}
function setResult(result, k2, v3) {
  result[k2] = v3;
}
function hasComponentEffect(instance) {
  return queue$1.includes(instance.update);
}
function flushCallbacks(instance) {
  const ctx = instance.ctx;
  const callbacks = ctx.__next_tick_callbacks;
  if (callbacks && callbacks.length) {
    const copies = callbacks.slice(0);
    callbacks.length = 0;
    for (let i3 = 0; i3 < copies.length; i3++) {
      copies[i3]();
    }
  }
}
function nextTick$2(instance, fn) {
  const ctx = instance.ctx;
  if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
    return nextTick$1(fn && fn.bind(instance.proxy));
  }
  let _resolve;
  if (!ctx.__next_tick_callbacks) {
    ctx.__next_tick_callbacks = [];
  }
  ctx.__next_tick_callbacks.push(() => {
    if (fn) {
      callWithErrorHandling(
        fn.bind(instance.proxy),
        instance,
        14
      );
    } else if (_resolve) {
      _resolve(instance.proxy);
    }
  });
  return new Promise((resolve2) => {
    _resolve = resolve2;
  });
}
function clone(src, seen) {
  src = unwrapper(src);
  const type = typeof src;
  if (type === "object" && src !== null) {
    let copy = seen.get(src);
    if (typeof copy !== "undefined") {
      return copy;
    }
    if (isArray$1(src)) {
      const len = src.length;
      copy = new Array(len);
      seen.set(src, copy);
      for (let i3 = 0; i3 < len; i3++) {
        copy[i3] = clone(src[i3], seen);
      }
    } else {
      copy = {};
      seen.set(src, copy);
      for (const name in src) {
        if (hasOwn$1(src, name)) {
          copy[name] = clone(src[name], seen);
        }
      }
    }
    return copy;
  }
  if (type !== "symbol") {
    return src;
  }
}
function deepCopy(src) {
  return clone(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
}
function getMPInstanceData(instance, keys) {
  const data = instance.data;
  const ret = /* @__PURE__ */ Object.create(null);
  keys.forEach((key) => {
    ret[key] = data[key];
  });
  return ret;
}
function patch(instance, data, oldData) {
  if (!data) {
    return;
  }
  data = deepCopy(data);
  data.$eS = instance.$eS || {};
  data.$eA = instance.$eA || {};
  const ctx = instance.ctx;
  const mpType = ctx.mpType;
  if (mpType === "page" || mpType === "component") {
    data.r0 = 1;
    const mpInstance = ctx.$scope;
    const keys = Object.keys(data);
    const diffData = diff(data, oldData || getMPInstanceData(mpInstance, keys));
    if (Object.keys(diffData).length) {
      ctx.__next_tick_pending = true;
      mpInstance.setData(diffData, () => {
        ctx.__next_tick_pending = false;
        flushCallbacks(instance);
      });
      flushPreFlushCbs();
    } else {
      flushCallbacks(instance);
    }
  }
}
function initAppConfig(appConfig) {
  appConfig.globalProperties.$nextTick = function $nextTick(fn) {
    return nextTick$2(this.$, fn);
  };
}
function onApplyOptions(options, instance, publicThis) {
  instance.appContext.config.globalProperties.$applyOptions(
    options,
    instance,
    publicThis
  );
  const computedOptions = options.computed;
  if (computedOptions) {
    const keys = Object.keys(computedOptions);
    if (keys.length) {
      const ctx = instance.ctx;
      if (!ctx.$computedKeys) {
        ctx.$computedKeys = [];
      }
      ctx.$computedKeys.push(...keys);
    }
  }
  delete instance.ctx.$onApplyOptions;
}
function setRef$1(instance, isUnmount = false) {
  const {
    setupState,
    $templateRefs,
    $templateUniElementRefs,
    ctx: { $scope, $mpPlatform }
  } = instance;
  if ($mpPlatform === "mp-alipay") {
    return;
  }
  if (!$scope || !$templateRefs && !$templateUniElementRefs) {
    return;
  }
  if (isUnmount) {
    $templateRefs && $templateRefs.forEach(
      (templateRef) => setTemplateRef(templateRef, null, setupState)
    );
    $templateUniElementRefs && $templateUniElementRefs.forEach(
      (templateRef) => setTemplateRef(templateRef, null, setupState)
    );
    return;
  }
  const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  const doSetByRefs = (refs) => {
    if (refs.length === 0) {
      return [];
    }
    const mpComponents = (
      // 字节小程序 selectAllComponents 可能返回 null
      // https://github.com/dcloudio/uni-app/issues/3954
      ($scope.selectAllComponents(".r") || []).concat(
        $scope.selectAllComponents(".r-i-f") || []
      )
    );
    return refs.filter((templateRef) => {
      const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
      if (check && refValue === null) {
        return true;
      }
      setTemplateRef(templateRef, refValue, setupState);
      return false;
    });
  };
  const doSet = () => {
    if ($templateRefs) {
      const refs = doSetByRefs($templateRefs);
      if (refs.length && instance.proxy && instance.proxy.$scope) {
        instance.proxy.$scope.setData({ r1: 1 }, () => {
          doSetByRefs(refs);
        });
      }
    }
  };
  if ($templateUniElementRefs && $templateUniElementRefs.length) {
    nextTick$2(instance, () => {
      $templateUniElementRefs.forEach((templateRef) => {
        if (isArray$1(templateRef.v)) {
          templateRef.v.forEach((v3) => {
            setTemplateRef(templateRef, v3, setupState);
          });
        } else {
          setTemplateRef(templateRef, templateRef.v, setupState);
        }
      });
    });
  }
  if ($scope._$setRef) {
    $scope._$setRef(doSet);
  } else {
    nextTick$2(instance, doSet);
  }
}
function toSkip(value) {
  if (isObject$1(value)) {
    markRaw$1(value);
  }
  return value;
}
function findComponentPublicInstance(mpComponents, id) {
  const mpInstance = mpComponents.find(
    (com) => com && (com.properties || com.props).uI === id
  );
  if (mpInstance) {
    const vm = mpInstance.$vm;
    if (vm) {
      return getExposeProxy(vm.$) || vm;
    }
    return toSkip(mpInstance);
  }
  return null;
}
function setTemplateRef({ r: r22, f: f2 }, refValue, setupState) {
  if (isFunction$1(r22)) {
    r22(refValue, {});
  } else {
    const _isString = isString(r22);
    const _isRef = isRef$1(r22);
    if (_isString || _isRef) {
      if (f2) {
        if (!_isRef) {
          return;
        }
        if (!isArray$1(r22.value)) {
          r22.value = [];
        }
        const existing = r22.value;
        if (existing.indexOf(refValue) === -1) {
          existing.push(refValue);
          if (!refValue) {
            return;
          }
          if (refValue.$) {
            onBeforeUnmount$1(() => remove(existing, refValue), refValue.$);
          }
        }
      } else if (_isString) {
        if (hasOwn$1(setupState, r22)) {
          setupState[r22] = refValue;
        }
      } else if (isRef$1(r22)) {
        r22.value = refValue;
      } else {
        warnRef(r22);
      }
    } else {
      warnRef(r22);
    }
  }
}
function warnRef(ref2) {
  warn$3("Invalid template ref type:", ref2, `(${typeof ref2})`);
}
const queuePostRenderEffect = queuePostFlushCb;
function mountComponent(initialVNode, options) {
  const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  {
    instance.ctx.$onApplyOptions = onApplyOptions;
    instance.ctx.$children = [];
  }
  if (options.mpType === "app") {
    instance.render = NOOP;
  }
  if (options.onBeforeSetup) {
    options.onBeforeSetup(instance, options);
  }
  {
    pushWarningContext(initialVNode);
    startMeasure(instance, `mount`);
  }
  {
    startMeasure(instance, `init`);
  }
  setupComponent(instance);
  {
    endMeasure(instance, `init`);
  }
  {
    if (options.parentComponent && instance.proxy) {
      options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
    }
  }
  setupRenderEffect(instance);
  {
    popWarningContext();
    endMeasure(instance, `mount`);
  }
  return instance.proxy;
}
const getFunctionalFallthrough = (attrs) => {
  let res;
  for (const key in attrs) {
    if (key === "class" || key === "style" || isOn(key)) {
      (res || (res = {}))[key] = attrs[key];
    }
  }
  return res;
};
function renderComponentRoot(instance) {
  const {
    type: Component2,
    vnode,
    proxy: proxy2,
    withProxy,
    props,
    propsOptions: [propsOptions],
    slots,
    attrs,
    emit: emit2,
    render,
    renderCache,
    data,
    setupState,
    ctx,
    uid: uid2,
    appContext: {
      app: {
        config: {
          globalProperties: { pruneComponentPropsCache: pruneComponentPropsCache2 }
        }
      }
    },
    inheritAttrs
  } = instance;
  instance.$uniElementIds = /* @__PURE__ */ new Map();
  instance.$templateRefs = [];
  instance.$templateUniElementRefs = [];
  instance.$templateUniElementStyles = {};
  instance.$ei = 0;
  pruneComponentPropsCache2(uid2);
  instance.__counter = instance.__counter === 0 ? 1 : 0;
  let result;
  const prev = setCurrentRenderingInstance(instance);
  try {
    if (vnode.shapeFlag & 4) {
      fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
      const proxyToUse = withProxy || proxy2;
      result = render.call(
        proxyToUse,
        proxyToUse,
        renderCache,
        props,
        setupState,
        data,
        ctx
      );
    } else {
      fallthroughAttrs(
        inheritAttrs,
        props,
        propsOptions,
        Component2.props ? attrs : getFunctionalFallthrough(attrs)
      );
      const render2 = Component2;
      result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
        props,
        null
        /* we know it doesn't need it */
      );
    }
  } catch (err) {
    handleError(err, instance, 1);
    result = false;
  }
  setRef$1(instance);
  setCurrentRenderingInstance(prev);
  return result;
}
function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  if (props && fallthroughAttrs2 && inheritAttrs !== false) {
    const keys = Object.keys(fallthroughAttrs2).filter(
      (key) => key !== "class" && key !== "style"
    );
    if (!keys.length) {
      return;
    }
    if (propsOptions && keys.some(isModelListener)) {
      keys.forEach((key) => {
        if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
          props[key] = fallthroughAttrs2[key];
        }
      });
    } else {
      keys.forEach((key) => props[key] = fallthroughAttrs2[key]);
    }
  }
}
const updateComponentPreRender = (instance) => {
  pauseTracking();
  flushPreFlushCbs();
  resetTracking();
};
function componentUpdateScopedSlotsFn() {
  const scopedSlotsData = this.$scopedSlotsData;
  if (!scopedSlotsData || scopedSlotsData.length === 0) {
    return;
  }
  const mpInstance = this.ctx.$scope;
  const oldData = mpInstance.data;
  const diffData = /* @__PURE__ */ Object.create(null);
  scopedSlotsData.forEach(({ path, index: index2, data }) => {
    const oldScopedSlotData = getValueByDataPath(oldData, path);
    const diffPath = isString(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
    if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
      diffData[diffPath] = data;
    } else {
      const diffScopedSlotData = diff(
        data,
        oldScopedSlotData[index2]
      );
      Object.keys(diffScopedSlotData).forEach((name) => {
        diffData[diffPath + "." + name] = diffScopedSlotData[name];
      });
    }
  });
  scopedSlotsData.length = 0;
  if (Object.keys(diffData).length) {
    mpInstance.setData(diffData);
  }
}
function toggleRecurse({ effect: effect2, update }, allowed) {
  effect2.allowRecurse = update.allowRecurse = allowed;
}
function setupRenderEffect(instance) {
  const updateScopedSlots = componentUpdateScopedSlotsFn.bind(
    instance
  );
  instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
  const componentUpdateFn = () => {
    if (!instance.isMounted) {
      onBeforeUnmount$1(() => {
        setRef$1(instance, true);
      }, instance);
      {
        startMeasure(instance, `patch`);
      }
      patch(instance, renderComponentRoot(instance));
      {
        endMeasure(instance, `patch`);
      }
      {
        devtoolsComponentAdded(instance);
      }
    } else {
      const { next, bu, u: u2 } = instance;
      {
        pushWarningContext(next || instance.vnode);
      }
      toggleRecurse(instance, false);
      updateComponentPreRender();
      if (bu) {
        invokeArrayFns$1(bu);
      }
      toggleRecurse(instance, true);
      {
        startMeasure(instance, `patch`);
      }
      patch(instance, renderComponentRoot(instance));
      {
        endMeasure(instance, `patch`);
      }
      if (u2) {
        queuePostRenderEffect(u2);
      }
      {
        devtoolsComponentUpdated(instance);
      }
      {
        popWarningContext();
      }
    }
  };
  const effect2 = instance.effect = new ReactiveEffect(
    componentUpdateFn,
    NOOP,
    () => queueJob(update),
    instance.scope
    // track it in component's effect scope
  );
  const update = instance.update = () => {
    if (effect2.dirty) {
      effect2.run();
    }
  };
  update.id = instance.uid;
  toggleRecurse(instance, true);
  {
    effect2.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
    effect2.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
    update.ownerInstance = instance;
  }
  {
    update();
  }
}
function unmountComponent(instance) {
  const { bum, scope, update, um } = instance;
  if (bum) {
    invokeArrayFns$1(bum);
  }
  {
    const parentInstance = instance.parent;
    if (parentInstance) {
      const $children = parentInstance.ctx.$children;
      const target = getExposeProxy(instance) || instance.proxy;
      const index2 = $children.indexOf(target);
      if (index2 > -1) {
        $children.splice(index2, 1);
      }
    }
  }
  scope.stop();
  if (update) {
    update.active = false;
  }
  if (um) {
    queuePostRenderEffect(um);
  }
  queuePostRenderEffect(() => {
    instance.isUnmounted = true;
  });
  {
    devtoolsComponentRemoved(instance);
  }
}
const oldCreateApp = createAppAPI();
function getTarget() {
  if (typeof window !== "undefined") {
    return window;
  }
  if (typeof globalThis !== "undefined") {
    return globalThis;
  }
  if (typeof global !== "undefined") {
    return global;
  }
  if (typeof my !== "undefined") {
    return my;
  }
}
function createVueApp(rootComponent, rootProps = null) {
  const target = getTarget();
  target.__VUE__ = true;
  {
    setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  }
  const app = oldCreateApp(rootComponent, rootProps);
  const appContext = app._context;
  initAppConfig(appContext.config);
  const createVNode2 = (initialVNode) => {
    initialVNode.appContext = appContext;
    initialVNode.shapeFlag = 6;
    return initialVNode;
  };
  const createComponent2 = function createComponent22(initialVNode, options) {
    return mountComponent(createVNode2(initialVNode), options);
  };
  const destroyComponent = function destroyComponent2(component) {
    return component && unmountComponent(component.$);
  };
  app.mount = function mount() {
    rootComponent.render = NOOP;
    const instance = mountComponent(
      createVNode2({ type: rootComponent }),
      {
        mpType: "app",
        mpInstance: null,
        parentComponent: null,
        slots: [],
        props: null
      }
    );
    app._instance = instance.$;
    {
      devtoolsInitApp(app, version$1);
    }
    instance.$app = app;
    instance.$createComponent = createComponent2;
    instance.$destroyComponent = destroyComponent;
    appContext.$appInstance = instance;
    return instance;
  };
  app.unmount = function unmount() {
    warn$3(`Cannot unmount an app.`);
  };
  return app;
}
function useCssModule$1(name = "$style") {
  {
    const instance = getCurrentInstance$1();
    if (!instance) {
      warn$3(`useCssModule must be called inside setup()`);
      return EMPTY_OBJ$1;
    }
    const modules = instance.type.__cssModules;
    if (!modules) {
      warn$3(`Current instance does not have CSS modules injected.`);
      return EMPTY_OBJ$1;
    }
    const mod = modules[name];
    if (!mod) {
      warn$3(`Current instance does not have CSS module named "${name}".`);
      return EMPTY_OBJ$1;
    }
    return mod;
  }
}
function useCssVars(getter) {
  const instance = getCurrentInstance$1();
  if (!instance) {
    warn$3(`useCssVars is called without current active component instance.`);
    return;
  }
  initCssVarsRender(instance, getter);
}
function initCssVarsRender(instance, getter) {
  instance.ctx.__cssVars = () => {
    const vars = getter(instance.proxy);
    const cssVars = {};
    for (const key in vars) {
      cssVars[`--${key}`] = vars[key];
    }
    return cssVars;
  };
}
function withModifiers() {
}
function createVNode() {
}
function injectLifecycleHook(name, hook, publicThis, instance) {
  if (isFunction$1(hook)) {
    injectHook(name, hook.bind(publicThis), instance);
  }
}
function initHooks$1(options, instance, publicThis) {
  const mpType = options.mpType || publicThis.$mpType;
  if (!mpType || mpType === "component") {
    return;
  }
  Object.keys(options).forEach((name) => {
    if (isUniLifecycleHook(name, options[name], false)) {
      const hooks = options[name];
      if (isArray$1(hooks)) {
        hooks.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
      } else {
        injectLifecycleHook(name, hooks, publicThis, instance);
      }
    }
  });
}
function applyOptions$2(options, instance, publicThis) {
  initHooks$1(options, instance, publicThis);
}
function set$2(target, key, val2) {
  return target[key] = val2;
}
function $callMethod(method, ...args) {
  const fn = this[method];
  if (fn) {
    return fn(...args);
  }
  console.error(`method ${method} not found`);
  return null;
}
function createErrorHandler(app) {
  const userErrorHandler = app.config.errorHandler;
  return function errorHandler(err, instance, info) {
    if (userErrorHandler) {
      userErrorHandler(err, instance, info);
    }
    const appInstance = app._instance;
    if (!appInstance || !appInstance.proxy) {
      throw err;
    }
    if (appInstance[ON_ERROR]) {
      {
        appInstance.proxy.$callHook(ON_ERROR, err);
      }
    } else {
      logError$1(err, info, instance ? instance.$.vnode : null, false);
    }
  };
}
function mergeAsArray(to, from) {
  return to ? [...new Set([].concat(to, from))] : from;
}
function initOptionMergeStrategies(optionMergeStrategies) {
  UniLifecycleHooks.forEach((name) => {
    optionMergeStrategies[name] = mergeAsArray;
  });
}
let realAtob;
const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
if (typeof atob !== "function") {
  realAtob = function(str) {
    str = String(str).replace(/[\t\n\f\r ]+/g, "");
    if (!b64re.test(str)) {
      throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
    }
    str += "==".slice(2 - (str.length & 3));
    var bitmap;
    var result = "";
    var r1;
    var r22;
    var i3 = 0;
    for (; i3 < str.length; ) {
      bitmap = b64.indexOf(str.charAt(i3++)) << 18 | b64.indexOf(str.charAt(i3++)) << 12 | (r1 = b64.indexOf(str.charAt(i3++))) << 6 | (r22 = b64.indexOf(str.charAt(i3++)));
      result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r22 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
    }
    return result;
  };
} else {
  realAtob = atob;
}
function b64DecodeUnicode(str) {
  return decodeURIComponent(realAtob(str).split("").map(function(c2) {
    return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
  }).join(""));
}
function getCurrentUserInfo() {
  const token = index.getStorageSync("uni_id_token") || "";
  const tokenArr = token.split(".");
  if (!token || tokenArr.length !== 3) {
    return {
      uid: null,
      role: [],
      permission: [],
      tokenExpired: 0
    };
  }
  let userInfo;
  try {
    userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  } catch (error) {
    throw new Error("获取当前用户信息出错，详细错误信息为：" + error.message);
  }
  userInfo.tokenExpired = userInfo.exp * 1e3;
  delete userInfo.exp;
  delete userInfo.iat;
  return userInfo;
}
function uniIdMixin(globalProperties) {
  globalProperties.uniIDHasRole = function(roleId) {
    const { role } = getCurrentUserInfo();
    return role.indexOf(roleId) > -1;
  };
  globalProperties.uniIDHasPermission = function(permissionId) {
    const { permission } = getCurrentUserInfo();
    return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  };
  globalProperties.uniIDTokenValid = function() {
    const { tokenExpired } = getCurrentUserInfo();
    return tokenExpired > Date.now();
  };
}
function initApp(app) {
  const appConfig = app.config;
  appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
  initOptionMergeStrategies(appConfig.optionMergeStrategies);
  const globalProperties = appConfig.globalProperties;
  {
    uniIdMixin(globalProperties);
  }
  {
    globalProperties.$set = set$2;
    globalProperties.$applyOptions = applyOptions$2;
    globalProperties.$callMethod = $callMethod;
  }
  {
    index.invokeCreateVueAppHook(app);
  }
}
const propsCaches = /* @__PURE__ */ Object.create(null);
function renderProps(props) {
  const { uid: uid2, __counter } = getCurrentInstance$1();
  const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  return uid2 + "," + propsId + "," + __counter;
}
function pruneComponentPropsCache(uid2) {
  delete propsCaches[uid2];
}
function findComponentPropsData(up) {
  if (!up) {
    return;
  }
  const [uid2, propsId] = up.split(",");
  if (!propsCaches[uid2]) {
    return;
  }
  return propsCaches[uid2][parseInt(propsId)];
}
var plugin = {
  install(app) {
    initApp(app);
    app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
    const oldMount = app.mount;
    app.mount = function mount(rootContainer) {
      const instance = oldMount.call(app, rootContainer);
      const createApp2 = getCreateApp();
      if (createApp2) {
        createApp2(instance);
      } else {
        if (typeof createMiniProgramApp !== "undefined") {
          createMiniProgramApp(instance);
        }
      }
      return instance;
    };
  }
};
function getCreateApp() {
  const method = "createApp";
  if (typeof global !== "undefined" && typeof global[method] !== "undefined") {
    return global[method];
  } else if (typeof my !== "undefined") {
    return my[method];
  }
}
function stringifyStyle(value) {
  if (isString(value)) {
    return value;
  }
  return stringify(normalizeStyle(value));
}
function stringify(styles) {
  let ret = "";
  if (!styles || isString(styles)) {
    return ret;
  }
  for (const key in styles) {
    ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  }
  return ret;
}
function vOn(value, key) {
  const instance = getCurrentInstance$1();
  const ctx = instance.ctx;
  const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq" || ctx.$mpPlatform === "mp-xhs") && (isString(key) || typeof key === "number") ? "_" + key : "";
  const name = "e" + instance.$ei++ + extraKey;
  const mpInstance = ctx.$scope;
  if (!value) {
    delete mpInstance[name];
    return name;
  }
  const existingInvoker = mpInstance[name];
  if (existingInvoker) {
    existingInvoker.value = value;
  } else {
    mpInstance[name] = createInvoker(value, instance);
  }
  return name;
}
function createInvoker(initialValue, instance) {
  const invoker = (e2) => {
    patchMPEvent(e2);
    let args = [e2];
    if (instance && instance.ctx.$getTriggerEventDetail) {
      if (typeof e2.detail === "number") {
        e2.detail = instance.ctx.$getTriggerEventDetail(e2.detail);
      }
    }
    if (e2.detail && e2.detail.__args__) {
      args = e2.detail.__args__;
    }
    const eventValue = invoker.value;
    const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
    const eventTarget = e2.target;
    const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
    if (bubbles.includes(e2.type) && !eventSync) {
      setTimeout(invoke);
    } else {
      const res = invoke();
      if (e2.type === "input" && (isArray$1(res) || isPromise(res))) {
        return;
      }
      return res;
    }
  };
  invoker.value = initialValue;
  return invoker;
}
const bubbles = [
  // touch事件暂不做延迟，否则在 Android 上会影响性能，比如一些拖拽跟手手势等
  // 'touchstart',
  // 'touchmove',
  // 'touchcancel',
  // 'touchend',
  "tap",
  "longpress",
  "longtap",
  "transitionend",
  "animationstart",
  "animationiteration",
  "animationend",
  "touchforcechange"
];
function patchMPEvent(event, instance) {
  if (event.type && event.target) {
    event.preventDefault = NOOP;
    event.stopPropagation = NOOP;
    event.stopImmediatePropagation = NOOP;
    if (!hasOwn$1(event, "detail")) {
      event.detail = {};
    }
    if (hasOwn$1(event, "markerId")) {
      event.detail = typeof event.detail === "object" ? event.detail : {};
      event.detail.markerId = event.markerId;
    }
    if (isPlainObject$1(event.detail) && hasOwn$1(event.detail, "checked") && !hasOwn$1(event.detail, "value")) {
      event.detail.value = event.detail.checked;
    }
    if (isPlainObject$1(event.detail)) {
      event.target = extend({}, event.target, event.detail);
    }
  }
}
function patchStopImmediatePropagation(e2, value) {
  if (isArray$1(value)) {
    const originalStop = e2.stopImmediatePropagation;
    e2.stopImmediatePropagation = () => {
      originalStop && originalStop.call(e2);
      e2._stopped = true;
    };
    return value.map((fn) => (e3) => !e3._stopped && fn(e3));
  } else {
    return value;
  }
}
function vFor(source, renderItem) {
  let ret;
  if (isArray$1(source) || isString(source)) {
    ret = new Array(source.length);
    for (let i3 = 0, l2 = source.length; i3 < l2; i3++) {
      ret[i3] = renderItem(source[i3], i3, i3);
    }
  } else if (typeof source === "number") {
    if (!Number.isInteger(source)) {
      warn$3(`The v-for range expect an integer value but got ${source}.`);
      return [];
    }
    ret = new Array(source);
    for (let i3 = 0; i3 < source; i3++) {
      ret[i3] = renderItem(i3 + 1, i3, i3);
    }
  } else if (isObject$1(source)) {
    if (source[Symbol.iterator]) {
      ret = Array.from(source, (item, i3) => renderItem(item, i3, i3));
    } else {
      const keys = Object.keys(source);
      ret = new Array(keys.length);
      for (let i3 = 0, l2 = keys.length; i3 < l2; i3++) {
        const key = keys[i3];
        ret[i3] = renderItem(source[key], key, i3);
      }
    }
  } else {
    ret = [];
  }
  return ret;
}
function renderSlot(name, props = {}, key) {
  const instance = getCurrentInstance$1();
  const { parent, isMounted, ctx: { $scope } } = instance;
  const vueIds = ($scope.properties || $scope.props).uI;
  if (!vueIds) {
    return;
  }
  if (!parent && !isMounted) {
    onMounted$1(() => {
      renderSlot(name, props, key);
    }, instance);
    return;
  }
  const invoker = findScopedSlotInvoker(vueIds, instance);
  if (invoker) {
    invoker(name, props, key);
  }
}
function findScopedSlotInvoker(vueId, instance) {
  let parent = instance.parent;
  while (parent) {
    const invokers = parent.$ssi;
    if (invokers && invokers[vueId]) {
      return invokers[vueId];
    }
    parent = parent.parent;
  }
}
function withScopedSlot(fn, { name, path, vueId }) {
  const instance = getCurrentInstance$1();
  fn.path = path;
  const scopedSlots = instance.$ssi || (instance.$ssi = {});
  const invoker = scopedSlots[vueId] || (scopedSlots[vueId] = createScopedSlotInvoker(instance));
  if (!invoker.slots[name]) {
    invoker.slots[name] = {
      fn
    };
  } else {
    invoker.slots[name].fn = fn;
  }
  return getValueByDataPath(instance.ctx.$scope.data, path);
}
function createScopedSlotInvoker(instance) {
  const invoker = (slotName, args, index2) => {
    const slot = invoker.slots[slotName];
    if (!slot) {
      return;
    }
    const hasIndex = typeof index2 !== "undefined";
    index2 = index2 || 0;
    const prevInstance = setCurrentRenderingInstance(instance);
    const data = slot.fn(args, slotName + (hasIndex ? "-" + index2 : ""), index2);
    const path = slot.fn.path;
    setCurrentRenderingInstance(prevInstance);
    (instance.$scopedSlotsData || (instance.$scopedSlotsData = [])).push({
      path,
      index: index2,
      data
    });
    instance.$updateScopedSlots();
  };
  invoker.slots = {};
  return invoker;
}
function dynamicSlot(names) {
  if (isString(names)) {
    return dynamicSlotName(names);
  }
  return names.map((name) => dynamicSlotName(name));
}
function setRef(ref2, id, opts = {}) {
  const { $templateRefs } = getCurrentInstance$1();
  $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
}
function withModelModifiers(fn, { number, trim }, isComponent = false) {
  if (isComponent) {
    return (...args) => {
      if (trim) {
        args = args.map((a2) => a2.trim());
      } else if (number) {
        args = args.map(toNumber);
      }
      return fn(...args);
    };
  }
  return (event) => {
    const value = event.detail.value;
    if (trim) {
      event.detail.value = value.trim();
    } else if (number) {
      event.detail.value = toNumber(value);
    }
    return fn(event);
  };
}
function hasIdProp(_ctx) {
  return _ctx.$.propsOptions && _ctx.$.propsOptions[0] && "id" in _ctx.$.propsOptions[0];
}
function getVirtualHostId(_ctx) {
  return _ctx.$scope.virtualHostId;
}
function hasVirtualHostId(_ctx) {
  return !!getVirtualHostId(_ctx);
}
function genIdWithVirtualHost(_ctx, idBinding) {
  if (!hasVirtualHostId(_ctx) || hasIdProp(_ctx)) {
    return idBinding;
  }
  return getVirtualHostId(_ctx);
}
function genUniElementId(_ctx, idBinding, genId) {
  return genIdWithVirtualHost(_ctx, idBinding) || genId || "";
}
function setupDevtoolsPlugin() {
}
const o$2 = (value, key) => vOn(value, key);
const f$2 = (source, renderItem) => vFor(source, renderItem);
const d$2 = (names) => dynamicSlot(names);
const r$3 = (name, props, key) => renderSlot(name, props, key);
const w$2 = (fn, options) => withScopedSlot(fn, options);
const s$3 = (value) => stringifyStyle(value);
const c$3 = (str) => camelize(str);
const e$2 = (target, ...sources) => extend(target, ...sources);
const h$3 = (str) => hyphenate(str);
const n$2 = (value) => normalizeClass(value);
const t$2 = (val2) => toDisplayString(val2);
const p$3 = (props) => renderProps(props);
const sr = (ref2, id, opts) => setRef(ref2, id, opts);
const m$2 = (fn, modifiers, isComponent = false) => withModelModifiers(fn, modifiers, isComponent);
const j$2 = (obj) => JSON.stringify(obj);
const gei = genUniElementId;
function createApp$2(rootComponent, rootProps = null) {
  rootComponent && (rootComponent.mpType = "app");
  return createVueApp(rootComponent, rootProps).use(plugin);
}
const createSSRApp = createApp$2;
const _Vue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  EMPTY_OBJ: EMPTY_OBJ$1,
  EffectScope: EffectScope$1,
  Fragment,
  ReactiveEffect,
  Text,
  c: c$3,
  callWithAsyncErrorHandling,
  callWithErrorHandling,
  camelize,
  computed: computed$2,
  createApp: createApp$2,
  createPropsRestProxy,
  createSSRApp,
  createVNode,
  createVueApp,
  customRef: customRef$1,
  d: d$2,
  defineAsyncComponent: defineAsyncComponent$1,
  defineComponent: defineComponent$1,
  defineEmits,
  defineExpose,
  defineProps,
  devtoolsComponentAdded,
  devtoolsComponentRemoved,
  devtoolsComponentUpdated,
  diff,
  e: e$2,
  effect,
  effectScope: effectScope$1,
  f: f$2,
  findComponentPropsData,
  gei,
  getCurrentInstance: getCurrentInstance$1,
  getCurrentScope: getCurrentScope$1,
  getExposeProxy,
  guardReactiveProps,
  h: h$3,
  hasInjectionContext,
  hasQueueJob,
  inject: inject$1,
  injectHook,
  invalidateJob,
  get isInSSRComponentSetup() {
    return exports.isInSSRComponentSetup;
  },
  isProxy,
  isReactive: isReactive$1,
  isReadonly: isReadonly$1,
  isRef: isRef$1,
  isShallow,
  j: j$2,
  logError: logError$1,
  m: m$2,
  markRaw: markRaw$1,
  mergeDefaults,
  mergeModels,
  mergeProps,
  n: n$2,
  nextTick: nextTick$1,
  normalizeClass,
  normalizeProps,
  normalizeStyle,
  o: o$2,
  onActivated: onActivated$1,
  onBeforeMount: onBeforeMount$1,
  onBeforeUnmount: onBeforeUnmount$1,
  onBeforeUpdate: onBeforeUpdate$1,
  onDeactivated: onDeactivated$1,
  onErrorCaptured: onErrorCaptured$1,
  onMounted: onMounted$1,
  onRenderTracked,
  onRenderTriggered,
  onScopeDispose: onScopeDispose$1,
  onServerPrefetch: onServerPrefetch$1,
  onUnmounted: onUnmounted$1,
  onUpdated: onUpdated$1,
  p: p$3,
  patch,
  provide: provide$1,
  proxyRefs: proxyRefs$1,
  pruneComponentPropsCache,
  queuePostFlushCb,
  r: r$3,
  reactive: reactive$1,
  readonly: readonly$1,
  ref: ref$1,
  resolveComponent,
  resolveDirective,
  resolveFilter,
  s: s$3,
  setCurrentRenderingInstance,
  setTemplateRef,
  setupDevtoolsPlugin,
  shallowReactive: shallowReactive$1,
  shallowReadonly: shallowReadonly$1,
  shallowRef: shallowRef$1,
  sr,
  stop,
  t: t$2,
  toDisplayString,
  toHandlerKey,
  toHandlers,
  toRaw: toRaw$1,
  toRef: toRef$1,
  toRefs: toRefs$1,
  toValue,
  triggerRef: triggerRef$1,
  unref: unref$1,
  updateProps,
  useAttrs: useAttrs$1,
  useCssModule: useCssModule$1,
  useCssVars,
  useModel,
  useSSRContext,
  useSlots: useSlots$1,
  version: version$1,
  w: w$2,
  warn: warn$3,
  watch: watch$1,
  watchEffect: watchEffect$1,
  watchPostEffect: watchPostEffect$1,
  watchSyncEffect: watchSyncEffect$1,
  withAsyncContext,
  withCtx,
  withDefaults,
  withDirectives,
  withModifiers,
  withScopeId
}, Symbol.toStringTag, { value: "Module" }));
function getLocaleLanguage$1() {
  var _a;
  let localeLanguage = "";
  {
    const appBaseInfo = ((_a = wx.getAppBaseInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
    const language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
    localeLanguage = normalizeLocale(language) || LOCALE_EN;
  }
  return localeLanguage;
}
function validateProtocolFail(name, msg) {
  console.warn(`${name}: ${msg}`);
}
function validateProtocol(name, data, protocol2, onFail) {
  if (!onFail) {
    onFail = validateProtocolFail;
  }
  for (const key in protocol2) {
    const errMsg = validateProp(key, data[key], protocol2[key], !hasOwn$1(data, key));
    if (isString(errMsg)) {
      onFail(name, errMsg);
    }
  }
}
function validateProtocols(name, args, protocol2, onFail) {
  if (!protocol2) {
    return;
  }
  if (!isArray$1(protocol2)) {
    return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol2, onFail);
  }
  const len = protocol2.length;
  const argsLen = args.length;
  for (let i3 = 0; i3 < len; i3++) {
    const opts = protocol2[i3];
    const data = /* @__PURE__ */ Object.create(null);
    if (argsLen > i3) {
      data[opts.name] = args[i3];
    }
    validateProtocol(name, data, { [opts.name]: opts }, onFail);
  }
}
function validateProp(name, value, prop, isAbsent) {
  if (!isPlainObject$1(prop)) {
    prop = { type: prop };
  }
  const { type, required, validator } = prop;
  if (required && isAbsent) {
    return 'Missing required args: "' + name + '"';
  }
  if (value == null && !required) {
    return;
  }
  if (type != null) {
    let isValid = false;
    const types = isArray$1(type) ? type : [type];
    const expectedTypes = [];
    for (let i3 = 0; i3 < types.length && !isValid; i3++) {
      const { valid, expectedType } = assertType(value, types[i3]);
      expectedTypes.push(expectedType || "");
      isValid = valid;
    }
    if (!isValid) {
      return getInvalidTypeMessage(name, value, expectedTypes);
    }
  }
  if (validator) {
    return validator(value);
  }
}
const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
function assertType(value, type) {
  let valid;
  const expectedType = getType(type);
  if (isSimpleType(expectedType)) {
    const t2 = typeof value;
    valid = t2 === expectedType.toLowerCase();
    if (!valid && t2 === "object") {
      valid = value instanceof type;
    }
  } else if (expectedType === "Object") {
    valid = isObject$1(value);
  } else if (expectedType === "Array") {
    valid = isArray$1(value);
  } else {
    {
      valid = value instanceof type;
    }
  }
  return {
    valid,
    expectedType
  };
}
function getInvalidTypeMessage(name, value, expectedTypes) {
  let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  const expectedType = expectedTypes[0];
  const receivedType = toRawType(value);
  const expectedValue = styleValue(value, expectedType);
  const receivedValue = styleValue(value, receivedType);
  if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
    message += ` with value ${expectedValue}`;
  }
  message += `, got ${receivedType} `;
  if (isExplicable(receivedType)) {
    message += `with value ${receivedValue}.`;
  }
  return message;
}
function getType(ctor) {
  const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  return match ? match[1] : "";
}
function styleValue(value, type) {
  if (type === "String") {
    return `"${value}"`;
  } else if (type === "Number") {
    return `${Number(value)}`;
  } else {
    return `${value}`;
  }
}
function isExplicable(type) {
  const explicitTypes = ["string", "number", "boolean"];
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
}
function isBoolean(...args) {
  return args.some((elem) => elem.toLowerCase() === "boolean");
}
function tryCatch(fn) {
  return function() {
    try {
      return fn.apply(fn, arguments);
    } catch (e2) {
      console.error(e2);
    }
  };
}
let invokeCallbackId = 1;
const invokeCallbacks = {};
function addInvokeCallback(id, name, callback, keepAlive = false) {
  invokeCallbacks[id] = {
    name,
    keepAlive,
    callback
  };
  return id;
}
function invokeCallback(id, res, extras) {
  if (typeof id === "number") {
    const opts = invokeCallbacks[id];
    if (opts) {
      if (!opts.keepAlive) {
        delete invokeCallbacks[id];
      }
      return opts.callback(res, extras);
    }
  }
  return res;
}
const API_SUCCESS = "success";
const API_FAIL = "fail";
const API_COMPLETE = "complete";
function getApiCallbacks(args) {
  const apiCallbacks = {};
  for (const name in args) {
    const fn = args[name];
    if (isFunction$1(fn)) {
      apiCallbacks[name] = tryCatch(fn);
      delete args[name];
    }
  }
  return apiCallbacks;
}
function normalizeErrMsg(errMsg, name) {
  if (!errMsg || errMsg.indexOf(":fail") === -1) {
    return name + ":ok";
  }
  return name + errMsg.substring(errMsg.indexOf(":fail"));
}
function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  if (!isPlainObject$1(args)) {
    args = {};
  }
  const { success, fail, complete } = getApiCallbacks(args);
  const hasSuccess = isFunction$1(success);
  const hasFail = isFunction$1(fail);
  const hasComplete = isFunction$1(complete);
  const callbackId = invokeCallbackId++;
  addInvokeCallback(callbackId, name, (res) => {
    res = res || {};
    res.errMsg = normalizeErrMsg(res.errMsg, name);
    isFunction$1(beforeAll) && beforeAll(res);
    if (res.errMsg === name + ":ok") {
      isFunction$1(beforeSuccess) && beforeSuccess(res, args);
      hasSuccess && success(res);
    } else {
      hasFail && fail(res);
    }
    hasComplete && complete(res);
  });
  return callbackId;
}
const HOOK_SUCCESS = "success";
const HOOK_FAIL = "fail";
const HOOK_COMPLETE = "complete";
const globalInterceptors = {};
const scopedInterceptors = {};
function wrapperHook(hook, params) {
  return function(data) {
    return hook(data, params) || data;
  };
}
function queue(hooks, data, params) {
  let promise = false;
  for (let i3 = 0; i3 < hooks.length; i3++) {
    const hook = hooks[i3];
    if (promise) {
      promise = Promise.resolve(wrapperHook(hook, params));
    } else {
      const res = hook(data, params);
      if (isPromise(res)) {
        promise = Promise.resolve(res);
      }
      if (res === false) {
        return {
          then() {
          },
          catch() {
          }
        };
      }
    }
  }
  return promise || {
    then(callback) {
      return callback(data);
    },
    catch() {
    }
  };
}
function wrapperOptions(interceptors2, options = {}) {
  [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
    const hooks = interceptors2[name];
    if (!isArray$1(hooks)) {
      return;
    }
    const oldCallback = options[name];
    options[name] = function callbackInterceptor(res) {
      queue(hooks, res, options).then((res2) => {
        return isFunction$1(oldCallback) && oldCallback(res2) || res2;
      });
    };
  });
  return options;
}
function wrapperReturnValue(method, returnValue) {
  const returnValueHooks = [];
  if (isArray$1(globalInterceptors.returnValue)) {
    returnValueHooks.push(...globalInterceptors.returnValue);
  }
  const interceptor = scopedInterceptors[method];
  if (interceptor && isArray$1(interceptor.returnValue)) {
    returnValueHooks.push(...interceptor.returnValue);
  }
  returnValueHooks.forEach((hook) => {
    returnValue = hook(returnValue) || returnValue;
  });
  return returnValue;
}
function getApiInterceptorHooks(method) {
  const interceptor = /* @__PURE__ */ Object.create(null);
  Object.keys(globalInterceptors).forEach((hook) => {
    if (hook !== "returnValue") {
      interceptor[hook] = globalInterceptors[hook].slice();
    }
  });
  const scopedInterceptor = scopedInterceptors[method];
  if (scopedInterceptor) {
    Object.keys(scopedInterceptor).forEach((hook) => {
      if (hook !== "returnValue") {
        interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
      }
    });
  }
  return interceptor;
}
function invokeApi(method, api, options, params) {
  const interceptor = getApiInterceptorHooks(method);
  if (interceptor && Object.keys(interceptor).length) {
    if (isArray$1(interceptor.invoke)) {
      const res = queue(interceptor.invoke, options);
      return res.then((options2) => {
        return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
      });
    } else {
      return api(wrapperOptions(interceptor, options), ...params);
    }
  }
  return api(options, ...params);
}
function hasCallback(args) {
  if (isPlainObject$1(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction$1(args[cb]))) {
    return true;
  }
  return false;
}
function handlePromise(promise) {
  return promise;
}
function promisify$1(name, fn) {
  return (args = {}, ...rest) => {
    if (hasCallback(args)) {
      return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
    }
    return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
      invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest);
    })));
  };
}
function formatApiArgs(args, options) {
  args[0];
  {
    return;
  }
}
function invokeSuccess(id, name, res) {
  const result = {
    errMsg: name + ":ok"
  };
  return invokeCallback(id, extend(res || {}, result));
}
function invokeFail(id, name, errMsg, errRes = {}) {
  const errMsgPrefix = name + ":fail";
  let apiErrMsg = "";
  if (!errMsg) {
    apiErrMsg = errMsgPrefix;
  } else if (errMsg.indexOf(errMsgPrefix) === 0) {
    apiErrMsg = errMsg;
  } else {
    apiErrMsg = errMsgPrefix + " " + errMsg;
  }
  {
    delete errRes.errCode;
  }
  let res = extend({ errMsg: apiErrMsg }, errRes);
  return invokeCallback(id, res);
}
function beforeInvokeApi(name, args, protocol2, options) {
  {
    validateProtocols(name, args, protocol2);
  }
  const errMsg = formatApiArgs(args);
  if (errMsg) {
    return errMsg;
  }
}
function parseErrMsg(errMsg) {
  if (!errMsg || isString(errMsg)) {
    return errMsg;
  }
  if (errMsg.stack) {
    if (typeof globalThis === "undefined" || !globalThis.harmonyChannel) {
      console.error(errMsg.message + "\n" + errMsg.stack);
    }
    return errMsg.message;
  }
  return errMsg;
}
function wrapperTaskApi(name, fn, protocol2, options) {
  return (args) => {
    const id = createAsyncApiCallback(name, args, options);
    const errMsg = beforeInvokeApi(name, [args], protocol2);
    if (errMsg) {
      return invokeFail(id, name, errMsg);
    }
    return fn(args, {
      resolve: (res) => invokeSuccess(id, name, res),
      reject: (errMsg2, errRes) => invokeFail(id, name, parseErrMsg(errMsg2), errRes)
    });
  };
}
function wrapperSyncApi(name, fn, protocol2, options) {
  return (...args) => {
    const errMsg = beforeInvokeApi(name, args, protocol2);
    if (errMsg) {
      throw new Error(errMsg);
    }
    return fn.apply(null, args);
  };
}
function wrapperAsyncApi(name, fn, protocol2, options) {
  return wrapperTaskApi(name, fn, protocol2, options);
}
function defineSyncApi(name, fn, protocol2, options) {
  return wrapperSyncApi(name, fn, protocol2);
}
function defineAsyncApi(name, fn, protocol2, options) {
  return promisify$1(name, wrapperAsyncApi(name, fn, protocol2, options));
}
const API_UPX2PX = "upx2px";
const Upx2pxProtocol = [
  {
    name: "upx",
    type: [Number, String],
    required: true
  }
];
const EPS = 1e-4;
const BASE_DEVICE_WIDTH = 750;
let isIOS = false;
let deviceWidth = 0;
let deviceDPR = 0;
function checkDeviceWidth() {
  var _a, _b;
  let windowWidth, pixelRatio, platform;
  {
    const windowInfo = ((_a = wx.getWindowInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
    const deviceInfo = ((_b = wx.getDeviceInfo) === null || _b === void 0 ? void 0 : _b.call(wx)) || wx.getSystemInfoSync();
    windowWidth = windowInfo.windowWidth;
    pixelRatio = windowInfo.pixelRatio;
    platform = deviceInfo.platform;
  }
  deviceWidth = windowWidth;
  deviceDPR = pixelRatio;
  isIOS = platform === "ios";
}
const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  if (deviceWidth === 0) {
    checkDeviceWidth();
  }
  number = Number(number);
  if (number === 0) {
    return 0;
  }
  let width = newDeviceWidth || deviceWidth;
  let result = number / BASE_DEVICE_WIDTH * width;
  if (result < 0) {
    result = -result;
  }
  result = Math.floor(result + EPS);
  if (result === 0) {
    if (deviceDPR === 1 || !isIOS) {
      result = 1;
    } else {
      result = 0.5;
    }
  }
  return number < 0 ? -result : result;
}, Upx2pxProtocol);
function __f__(type, filename, ...args) {
  if (filename) {
    args.push(filename);
  }
  console[type].apply(console, args);
}
const API_ADD_INTERCEPTOR = "addInterceptor";
const API_REMOVE_INTERCEPTOR = "removeInterceptor";
const AddInterceptorProtocol = [
  {
    name: "method",
    type: [String, Object],
    required: true
  }
];
const RemoveInterceptorProtocol = AddInterceptorProtocol;
function mergeInterceptorHook(interceptors2, interceptor) {
  Object.keys(interceptor).forEach((hook) => {
    if (isFunction$1(interceptor[hook])) {
      interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
    }
  });
}
function removeInterceptorHook(interceptors2, interceptor) {
  if (!interceptors2 || !interceptor) {
    return;
  }
  Object.keys(interceptor).forEach((name) => {
    const hooks = interceptors2[name];
    const hook = interceptor[name];
    if (isArray$1(hooks) && isFunction$1(hook)) {
      remove(hooks, hook);
    }
  });
}
function mergeHook(parentVal, childVal) {
  const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray$1(childVal) ? childVal : [childVal] : parentVal;
  return res ? dedupeHooks(res) : res;
}
function dedupeHooks(hooks) {
  const res = [];
  for (let i3 = 0; i3 < hooks.length; i3++) {
    if (res.indexOf(hooks[i3]) === -1) {
      res.push(hooks[i3]);
    }
  }
  return res;
}
const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  if (isString(method) && isPlainObject$1(interceptor)) {
    mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  } else if (isPlainObject$1(method)) {
    mergeInterceptorHook(globalInterceptors, method);
  }
}, AddInterceptorProtocol);
const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  if (isString(method)) {
    if (isPlainObject$1(interceptor)) {
      removeInterceptorHook(scopedInterceptors[method], interceptor);
    } else {
      delete scopedInterceptors[method];
    }
  } else if (isPlainObject$1(method)) {
    removeInterceptorHook(globalInterceptors, method);
  }
}, RemoveInterceptorProtocol);
const interceptors = {};
const API_ON = "$on";
const OnProtocol = [
  {
    name: "event",
    type: String,
    required: true
  },
  {
    name: "callback",
    type: Function,
    required: true
  }
];
const API_ONCE = "$once";
const OnceProtocol = OnProtocol;
const API_OFF = "$off";
const OffProtocol = [
  {
    name: "event",
    type: [String, Array]
  },
  {
    name: "callback",
    type: [Function, Number]
  }
];
const API_EMIT = "$emit";
const EmitProtocol = [
  {
    name: "event",
    type: String,
    required: true
  }
];
class EventBus {
  constructor() {
    this.$emitter = new E$1$1();
  }
  on(name, callback) {
    return this.$emitter.on(name, callback);
  }
  once(name, callback) {
    return this.$emitter.once(name, callback);
  }
  off(name, callback) {
    if (!name) {
      this.$emitter.e = {};
      return;
    }
    this.$emitter.off(name, callback);
  }
  emit(name, ...args) {
    this.$emitter.emit(name, ...args);
  }
}
const eventBus = new EventBus();
const $on = defineSyncApi(API_ON, (name, callback) => {
  eventBus.on(name, callback);
  return () => eventBus.off(name, callback);
}, OnProtocol);
const $once = defineSyncApi(API_ONCE, (name, callback) => {
  eventBus.once(name, callback);
  return () => eventBus.off(name, callback);
}, OnceProtocol);
const $off = defineSyncApi(API_OFF, (name, callback) => {
  if (!isArray$1(name))
    name = name ? [name] : [];
  name.forEach((n2) => {
    eventBus.off(n2, callback);
  });
}, OffProtocol);
const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  eventBus.emit(name, ...args);
}, EmitProtocol);
let cid;
let cidErrMsg;
let enabled;
function normalizePushMessage(message) {
  try {
    return JSON.parse(message);
  } catch (e2) {
  }
  return message;
}
function invokePushCallback(args) {
  if (args.type === "enabled") {
    enabled = true;
  } else if (args.type === "clientId") {
    cid = args.cid;
    cidErrMsg = args.errMsg;
    invokeGetPushCidCallbacks(cid, args.errMsg);
  } else if (args.type === "pushMsg") {
    const message = {
      type: "receive",
      data: normalizePushMessage(args.message)
    };
    for (let i3 = 0; i3 < onPushMessageCallbacks.length; i3++) {
      const callback = onPushMessageCallbacks[i3];
      callback(message);
      if (message.stopped) {
        break;
      }
    }
  } else if (args.type === "click") {
    onPushMessageCallbacks.forEach((callback) => {
      callback({
        type: "click",
        data: normalizePushMessage(args.message)
      });
    });
  }
}
const getPushCidCallbacks = [];
function invokeGetPushCidCallbacks(cid2, errMsg) {
  getPushCidCallbacks.forEach((callback) => {
    callback(cid2, errMsg);
  });
  getPushCidCallbacks.length = 0;
}
const API_GET_PUSH_CLIENT_ID = "getPushClientId";
const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_2, { resolve: resolve2, reject }) => {
  Promise.resolve().then(() => {
    if (typeof enabled === "undefined") {
      enabled = false;
      cid = "";
      cidErrMsg = "uniPush is not enabled";
    }
    getPushCidCallbacks.push((cid2, errMsg) => {
      if (cid2) {
        resolve2({ cid: cid2 });
      } else {
        reject(errMsg);
      }
    });
    if (typeof cid !== "undefined") {
      invokeGetPushCidCallbacks(cid, cidErrMsg);
    }
  });
});
const onPushMessageCallbacks = [];
const onPushMessage = (fn) => {
  if (onPushMessageCallbacks.indexOf(fn) === -1) {
    onPushMessageCallbacks.push(fn);
  }
};
const offPushMessage = (fn) => {
  if (!fn) {
    onPushMessageCallbacks.length = 0;
  } else {
    const index2 = onPushMessageCallbacks.indexOf(fn);
    if (index2 > -1) {
      onPushMessageCallbacks.splice(index2, 1);
    }
  }
};
const SYNC_API_RE = /^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/;
const CONTEXT_API_RE = /^create|Manager$/;
const CONTEXT_API_RE_EXC = ["createBLEConnection"];
const TASK_APIS = ["request", "downloadFile", "uploadFile", "connectSocket"];
const ASYNC_API = ["createBLEConnection"];
const CALLBACK_API_RE = /^on|^off/;
function isContextApi(name) {
  return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
}
function isSyncApi(name) {
  return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
}
function isCallbackApi(name) {
  return CALLBACK_API_RE.test(name) && name !== "onPush";
}
function isTaskApi(name) {
  return TASK_APIS.indexOf(name) !== -1;
}
function shouldPromise(name) {
  if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
    return false;
  }
  return true;
}
if (!Promise.prototype.finally) {
  Promise.prototype.finally = function(onfinally) {
    const promise = this.constructor;
    return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
      throw reason;
    }));
  };
}
function promisify(name, api) {
  if (!shouldPromise(name)) {
    return api;
  }
  if (!isFunction$1(api)) {
    return api;
  }
  return function promiseApi(options = {}, ...rest) {
    if (isFunction$1(options.success) || isFunction$1(options.fail) || isFunction$1(options.complete)) {
      return wrapperReturnValue(name, invokeApi(name, api, options, rest));
    }
    return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
      invokeApi(name, api, extend({}, options, {
        success: resolve2,
        fail: reject
      }), rest);
    })));
  };
}
const CALLBACKS = ["success", "fail", "cancel", "complete"];
function initWrapper(protocols2) {
  function processCallback(methodName, method, returnValue) {
    return function(res) {
      return method(processReturnValue(methodName, res, returnValue));
    };
  }
  function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
    if (isPlainObject$1(fromArgs)) {
      const toArgs = keepFromArgs === true ? fromArgs : {};
      if (isFunction$1(argsOption)) {
        argsOption = argsOption(fromArgs, toArgs) || {};
      }
      for (const key in fromArgs) {
        if (hasOwn$1(argsOption, key)) {
          let keyOption = argsOption[key];
          if (isFunction$1(keyOption)) {
            keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
          }
          if (!keyOption) {
            console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
          } else if (isString(keyOption)) {
            toArgs[keyOption] = fromArgs[key];
          } else if (isPlainObject$1(keyOption)) {
            toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
          }
        } else if (CALLBACKS.indexOf(key) !== -1) {
          const callback = fromArgs[key];
          if (isFunction$1(callback)) {
            toArgs[key] = processCallback(methodName, callback, returnValue);
          }
        } else {
          if (!keepFromArgs && !hasOwn$1(toArgs, key)) {
            toArgs[key] = fromArgs[key];
          }
        }
      }
      return toArgs;
    } else if (isFunction$1(fromArgs)) {
      if (isFunction$1(argsOption)) {
        argsOption(fromArgs, {});
      }
      fromArgs = processCallback(methodName, fromArgs, returnValue);
    }
    return fromArgs;
  }
  function processReturnValue(methodName, res, returnValue, keepReturnValue = false) {
    if (isFunction$1(protocols2.returnValue)) {
      res = protocols2.returnValue(methodName, res);
    }
    const realKeepReturnValue = keepReturnValue || false;
    return processArgs(methodName, res, returnValue, {}, realKeepReturnValue);
  }
  return function wrapper(methodName, method) {
    const hasProtocol = hasOwn$1(protocols2, methodName);
    if (!hasProtocol && typeof wx[methodName] !== "function") {
      return method;
    }
    const needWrapper = hasProtocol || isFunction$1(protocols2.returnValue) || isContextApi(methodName) || isTaskApi(methodName);
    const hasMethod = hasProtocol || isFunction$1(method);
    if (!hasProtocol && !method) {
      return function() {
        console.error(`微信小程序 暂不支持${methodName}`);
      };
    }
    if (!needWrapper || !hasMethod) {
      return method;
    }
    const protocol2 = protocols2[methodName];
    return function(arg1, arg2) {
      let options = protocol2 || {};
      if (isFunction$1(protocol2)) {
        options = protocol2(arg1);
      }
      arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
      const args = [arg1];
      if (typeof arg2 !== "undefined") {
        args.push(arg2);
      }
      const returnValue = wx[options.name || methodName].apply(wx, args);
      if (isContextApi(methodName) || isTaskApi(methodName)) {
        if (returnValue && !returnValue.__v_skip) {
          returnValue.__v_skip = true;
        }
      }
      if (isSyncApi(methodName)) {
        return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
      }
      return returnValue;
    };
  };
}
const getLocale = () => {
  const app = isFunction$1(getApp) && getApp({ allowDefault: true });
  if (app && app.$vm) {
    return app.$vm.$locale;
  }
  return getLocaleLanguage$1();
};
const setLocale = (locale) => {
  const app = isFunction$1(getApp) && getApp();
  if (!app) {
    return false;
  }
  const oldLocale = app.$vm.$locale;
  if (oldLocale !== locale) {
    app.$vm.$locale = locale;
    onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
    return true;
  }
  return false;
};
const onLocaleChangeCallbacks = [];
const onLocaleChange = (fn) => {
  if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
    onLocaleChangeCallbacks.push(fn);
  }
};
if (typeof global !== "undefined") {
  global.getLocale = getLocale;
}
const UUID_KEY = "__DC_STAT_UUID";
let deviceId;
function useDeviceId(global2 = wx) {
  return function addDeviceId(_2, toRes) {
    deviceId = deviceId || global2.getStorageSync(UUID_KEY);
    if (!deviceId) {
      deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
      wx.setStorage({
        key: UUID_KEY,
        data: deviceId
      });
    }
    toRes.deviceId = deviceId;
  };
}
function addSafeAreaInsets(fromRes, toRes) {
  if (fromRes.safeArea) {
    const safeArea = fromRes.safeArea;
    toRes.safeAreaInsets = {
      top: safeArea.top,
      left: safeArea.left,
      right: fromRes.windowWidth - safeArea.right,
      bottom: fromRes.screenHeight - safeArea.bottom
    };
  }
}
function getOSInfo(system, platform) {
  let osName = "";
  let osVersion = "";
  if (platform && false) {
    osName = platform;
    osVersion = system;
  } else {
    osName = system.split(" ")[0] || platform;
    osVersion = system.split(" ")[1] || "";
  }
  osName = osName.toLocaleLowerCase();
  switch (osName) {
    case "harmony":
    case "ohos":
    case "openharmony":
      osName = "harmonyos";
      break;
    case "iphone os":
      osName = "ios";
      break;
    case "mac":
    case "darwin":
      osName = "macos";
      break;
    case "windows_nt":
      osName = "windows";
      break;
  }
  return {
    osName,
    osVersion
  };
}
function populateParameters(fromRes, toRes) {
  const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  const { osName, osVersion } = getOSInfo(system, platform);
  let hostVersion = version2;
  let deviceType = getGetDeviceType(fromRes, model);
  let deviceBrand = getDeviceBrand(brand);
  let _hostName = getHostName(fromRes);
  let _deviceOrientation = deviceOrientation;
  let _devicePixelRatio = pixelRatio;
  let _SDKVersion = SDKVersion;
  const hostLanguage = (language || "").replace(/_/g, "-");
  const parameters = {
    appId: "__UNI__A6CDB98",
    appName: "tk-mini-program",
    appVersion: "1.0.0",
    appVersionCode: "100",
    appLanguage: getAppLanguage(hostLanguage),
    uniCompileVersion: "4.65",
    uniCompilerVersion: "4.65",
    uniRuntimeVersion: "4.65",
    uniPlatform: "mp-weixin",
    deviceBrand,
    deviceModel: model,
    deviceType,
    devicePixelRatio: _devicePixelRatio,
    deviceOrientation: _deviceOrientation,
    osName,
    osVersion,
    hostTheme: theme,
    hostVersion,
    hostLanguage,
    hostName: _hostName,
    hostSDKVersion: _SDKVersion,
    hostFontSizeSetting: fontSizeSetting,
    windowTop: 0,
    windowBottom: 0,
    // TODO
    osLanguage: void 0,
    osTheme: void 0,
    ua: void 0,
    hostPackageName: void 0,
    browserName: void 0,
    browserVersion: void 0,
    isUniAppX: false
  };
  extend(toRes, parameters);
}
function getGetDeviceType(fromRes, model) {
  let deviceType = fromRes.deviceType || "phone";
  {
    const deviceTypeMaps = {
      ipad: "pad",
      windows: "pc",
      mac: "pc"
    };
    const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
    const _model = model.toLocaleLowerCase();
    for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
      const _m = deviceTypeMapsKeys[index2];
      if (_model.indexOf(_m) !== -1) {
        deviceType = deviceTypeMaps[_m];
        break;
      }
    }
  }
  return deviceType;
}
function getDeviceBrand(brand) {
  let deviceBrand = brand;
  if (deviceBrand) {
    deviceBrand = deviceBrand.toLocaleLowerCase();
  }
  return deviceBrand;
}
function getAppLanguage(defaultLanguage) {
  return getLocale ? getLocale() : defaultLanguage;
}
function getHostName(fromRes) {
  const _platform = "WeChat";
  let _hostName = fromRes.hostName || _platform;
  {
    if (fromRes.environment) {
      _hostName = fromRes.environment;
    } else if (fromRes.host && fromRes.host.env) {
      _hostName = fromRes.host.env;
    }
  }
  return _hostName;
}
const getSystemInfo = {
  returnValue: (fromRes, toRes) => {
    addSafeAreaInsets(fromRes, toRes);
    useDeviceId()(fromRes, toRes);
    populateParameters(fromRes, toRes);
  }
};
const getSystemInfoSync = getSystemInfo;
const redirectTo = {};
const previewImage = {
  args(fromArgs, toArgs) {
    let currentIndex = parseInt(fromArgs.current);
    if (isNaN(currentIndex)) {
      return;
    }
    const urls = fromArgs.urls;
    if (!isArray$1(urls)) {
      return;
    }
    const len = urls.length;
    if (!len) {
      return;
    }
    if (currentIndex < 0) {
      currentIndex = 0;
    } else if (currentIndex >= len) {
      currentIndex = len - 1;
    }
    if (currentIndex > 0) {
      toArgs.current = urls[currentIndex];
      toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
    } else {
      toArgs.current = urls[0];
    }
    return {
      indicator: false,
      loop: false
    };
  }
};
const showActionSheet = {
  args(fromArgs, toArgs) {
    toArgs.alertText = fromArgs.title;
  }
};
const getDeviceInfo = {
  returnValue: (fromRes, toRes) => {
    const { brand, model, system = "", platform = "" } = fromRes;
    let deviceType = getGetDeviceType(fromRes, model);
    let deviceBrand = getDeviceBrand(brand);
    useDeviceId()(fromRes, toRes);
    const { osName, osVersion } = getOSInfo(system, platform);
    toRes = sortObject(extend(toRes, {
      deviceType,
      deviceBrand,
      deviceModel: model,
      osName,
      osVersion
    }));
  }
};
const getAppBaseInfo = {
  returnValue: (fromRes, toRes) => {
    const { version: version2, language, SDKVersion, theme } = fromRes;
    let _hostName = getHostName(fromRes);
    let hostLanguage = (language || "").replace(/_/g, "-");
    const parameters = {
      hostVersion: version2,
      hostLanguage,
      hostName: _hostName,
      hostSDKVersion: SDKVersion,
      hostTheme: theme,
      appId: "__UNI__A6CDB98",
      appName: "tk-mini-program",
      appVersion: "1.0.0",
      appVersionCode: "100",
      appLanguage: getAppLanguage(hostLanguage),
      isUniAppX: false,
      uniPlatform: "mp-weixin",
      uniCompileVersion: "4.65",
      uniCompilerVersion: "4.65",
      uniRuntimeVersion: "4.65"
    };
    extend(toRes, parameters);
  }
};
const getWindowInfo = {
  returnValue: (fromRes, toRes) => {
    addSafeAreaInsets(fromRes, toRes);
    toRes = sortObject(extend(toRes, {
      windowTop: 0,
      windowBottom: 0
    }));
  }
};
const getAppAuthorizeSetting = {
  returnValue: function(fromRes, toRes) {
    const { locationReducedAccuracy } = fromRes;
    toRes.locationAccuracy = "unsupported";
    if (locationReducedAccuracy === true) {
      toRes.locationAccuracy = "reduced";
    } else if (locationReducedAccuracy === false) {
      toRes.locationAccuracy = "full";
    }
  }
};
const onError = {
  args(fromArgs) {
    const app = getApp({ allowDefault: true }) || {};
    if (!app.$vm) {
      if (!wx.$onErrorHandlers) {
        wx.$onErrorHandlers = [];
      }
      wx.$onErrorHandlers.push(fromArgs);
    } else {
      injectHook(ON_ERROR, fromArgs, app.$vm.$);
    }
  }
};
const offError = {
  args(fromArgs) {
    const app = getApp({ allowDefault: true }) || {};
    if (!app.$vm) {
      if (!wx.$onErrorHandlers) {
        return;
      }
      const index2 = wx.$onErrorHandlers.findIndex((fn) => fn === fromArgs);
      if (index2 !== -1) {
        wx.$onErrorHandlers.splice(index2, 1);
      }
    } else if (fromArgs.__weh) {
      const onErrors = app.$vm.$[ON_ERROR];
      if (onErrors) {
        const index2 = onErrors.indexOf(fromArgs.__weh);
        if (index2 > -1) {
          onErrors.splice(index2, 1);
        }
      }
    }
  }
};
const onSocketOpen = {
  args() {
    if (wx.__uni_console__) {
      if (wx.__uni_console_warned__) {
        return;
      }
      wx.__uni_console_warned__ = true;
      console.warn(`开发模式下小程序日志回显会使用 socket 连接，为了避免冲突，建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)`);
    }
  }
};
const onSocketMessage = onSocketOpen;
const baseApis = {
  $on,
  $off,
  $once,
  $emit,
  upx2px,
  rpx2px: upx2px,
  interceptors,
  addInterceptor,
  removeInterceptor,
  onCreateVueApp,
  invokeCreateVueAppHook,
  getLocale,
  setLocale,
  onLocaleChange,
  getPushClientId,
  onPushMessage,
  offPushMessage,
  invokePushCallback,
  __f__
};
function initUni(api, protocols2, platform = wx) {
  const wrapper = initWrapper(protocols2);
  const UniProxyHandlers = {
    get(target, key) {
      if (hasOwn$1(target, key)) {
        return target[key];
      }
      if (hasOwn$1(api, key)) {
        return promisify(key, api[key]);
      }
      if (hasOwn$1(baseApis, key)) {
        return promisify(key, baseApis[key]);
      }
      return promisify(key, wrapper(key, platform[key]));
    }
  };
  return new Proxy({}, UniProxyHandlers);
}
function initGetProvider(providers) {
  return function getProvider2({ service, success, fail, complete }) {
    let res;
    if (providers[service]) {
      res = {
        errMsg: "getProvider:ok",
        service,
        provider: providers[service]
      };
      isFunction$1(success) && success(res);
    } else {
      res = {
        errMsg: "getProvider:fail:服务[" + service + "]不存在"
      };
      isFunction$1(fail) && fail(res);
    }
    isFunction$1(complete) && complete(res);
  };
}
const objectKeys = [
  "qy",
  "env",
  "error",
  "version",
  "lanDebug",
  "cloud",
  "serviceMarket",
  "router",
  "worklet",
  "__webpack_require_UNI_MP_PLUGIN__"
];
const singlePageDisableKey = ["lanDebug", "router", "worklet"];
const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null;
function isWxKey(key) {
  if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
    return false;
  }
  return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function";
}
function initWx() {
  const newWx = {};
  for (const key in wx) {
    if (isWxKey(key)) {
      newWx[key] = wx[key];
    }
  }
  if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") {
    globalThis.wx = newWx;
  }
  return newWx;
}
const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
const getProvider = initGetProvider({
  oauth: ["weixin"],
  share: ["weixin"],
  payment: ["wxpay"],
  push: ["weixin"]
});
function initComponentMocks(component) {
  const res = /* @__PURE__ */ Object.create(null);
  mocks$1.forEach((name) => {
    res[name] = component[name];
  });
  return res;
}
function createSelectorQuery() {
  const query = wx$2.createSelectorQuery();
  const oldIn = query.in;
  query.in = function newIn(component) {
    if (component.$scope) {
      return oldIn.call(this, component.$scope);
    }
    return oldIn.call(this, initComponentMocks(component));
  };
  return query;
}
const wx$2 = initWx();
if (!wx$2.canIUse("getAppBaseInfo")) {
  wx$2.getAppBaseInfo = wx$2.getSystemInfoSync;
}
if (!wx$2.canIUse("getWindowInfo")) {
  wx$2.getWindowInfo = wx$2.getSystemInfoSync;
}
if (!wx$2.canIUse("getDeviceInfo")) {
  wx$2.getDeviceInfo = wx$2.getSystemInfoSync;
}
let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo();
if (!baseInfo) {
  baseInfo = wx$2.getSystemInfoSync();
}
const host = baseInfo ? baseInfo.host : null;
const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage;
var shims = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  createSelectorQuery,
  getProvider,
  shareVideoMessage
});
const compressImage = {
  args(fromArgs, toArgs) {
    if (fromArgs.compressedHeight && !toArgs.compressHeight) {
      toArgs.compressHeight = fromArgs.compressedHeight;
    }
    if (fromArgs.compressedWidth && !toArgs.compressWidth) {
      toArgs.compressWidth = fromArgs.compressedWidth;
    }
  }
};
var protocols = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  compressImage,
  getAppAuthorizeSetting,
  getAppBaseInfo,
  getDeviceInfo,
  getSystemInfo,
  getSystemInfoSync,
  getWindowInfo,
  offError,
  onError,
  onSocketMessage,
  onSocketOpen,
  previewImage,
  redirectTo,
  showActionSheet
});
const wx$1 = initWx();
var index = initUni(shims, protocols, wx$1);
function initRuntimeSocket(hosts, port, id) {
  if (hosts == "" || port == "" || id == "")
    return Promise.resolve(null);
  return hosts.split(",").reduce((promise, host2) => {
    return promise.then((socket) => {
      if (socket != null)
        return Promise.resolve(socket);
      return tryConnectSocket(host2, port, id);
    });
  }, Promise.resolve(null));
}
const SOCKET_TIMEOUT = 500;
function tryConnectSocket(host2, port, id) {
  return new Promise((resolve2, reject) => {
    const socket = index.connectSocket({
      url: `ws://${host2}:${port}/${id}`,
      multiple: true,
      // 支付宝小程序 是否开启多实例
      fail() {
        resolve2(null);
      }
    });
    const timer = setTimeout(() => {
      socket.close({
        code: 1006,
        reason: "connect timeout"
      });
      resolve2(null);
    }, SOCKET_TIMEOUT);
    socket.onOpen((e2) => {
      clearTimeout(timer);
      resolve2(socket);
    });
    socket.onClose((e2) => {
      clearTimeout(timer);
      resolve2(null);
    });
    socket.onError((e2) => {
      clearTimeout(timer);
      resolve2(null);
    });
  });
}
const CONSOLE_TYPES = ["log", "warn", "error", "info", "debug"];
const originalConsole = /* @__PURE__ */ CONSOLE_TYPES.reduce((methods, type) => {
  methods[type] = console[type].bind(console);
  return methods;
}, {});
let sendError = null;
const errorQueue = /* @__PURE__ */ new Set();
const errorExtra = {};
function sendErrorMessages(errors) {
  if (sendError == null) {
    errors.forEach((error) => {
      errorQueue.add(error);
    });
    return;
  }
  const data = errors.map((err) => {
    if (typeof err === "string") {
      return err;
    }
    const isPromiseRejection = err && "promise" in err && "reason" in err;
    const prefix = isPromiseRejection ? "UnhandledPromiseRejection: " : "";
    if (isPromiseRejection) {
      err = err.reason;
    }
    if (err instanceof Error && err.stack) {
      if (err.message && !err.stack.includes(err.message)) {
        return `${prefix}${err.message}
${err.stack}`;
      }
      return `${prefix}${err.stack}`;
    }
    if (typeof err === "object" && err !== null) {
      try {
        return prefix + JSON.stringify(err);
      } catch (err2) {
        return prefix + String(err2);
      }
    }
    return prefix + String(err);
  }).filter(Boolean);
  if (data.length > 0) {
    sendError(JSON.stringify(Object.assign({
      type: "error",
      data
    }, errorExtra)));
  }
}
function setSendError(value, extra = {}) {
  sendError = value;
  Object.assign(errorExtra, extra);
  if (value != null && errorQueue.size > 0) {
    const errors = Array.from(errorQueue);
    errorQueue.clear();
    sendErrorMessages(errors);
  }
}
function initOnError() {
  function onError2(error) {
    try {
      if (typeof PromiseRejectionEvent !== "undefined" && error instanceof PromiseRejectionEvent && error.reason instanceof Error && error.reason.message && error.reason.message.includes(`Cannot create property 'errMsg' on string 'taskId`)) {
        return;
      }
      if (true) {
        originalConsole.error(error);
      }
      sendErrorMessages([error]);
    } catch (err) {
      originalConsole.error(err);
    }
  }
  if (typeof index.onError === "function") {
    index.onError(onError2);
  }
  if (typeof index.onUnhandledRejection === "function") {
    index.onUnhandledRejection(onError2);
  }
  return function offError2() {
    if (typeof index.offError === "function") {
      index.offError(onError2);
    }
    if (typeof index.offUnhandledRejection === "function") {
      index.offUnhandledRejection(onError2);
    }
  };
}
function formatMessage(type, args) {
  try {
    return {
      type,
      args: formatArgs(args)
    };
  } catch (e2) {
  }
  return {
    type,
    args: []
  };
}
function formatArgs(args) {
  return args.map((arg) => formatArg(arg));
}
function formatArg(arg, depth = 0) {
  if (depth >= 7) {
    return {
      type: "object",
      value: "[Maximum depth reached]"
    };
  }
  const type = typeof arg;
  switch (type) {
    case "string":
      return formatString(arg);
    case "number":
      return formatNumber(arg);
    case "boolean":
      return formatBoolean(arg);
    case "object":
      try {
        return formatObject(arg, depth);
      } catch (e2) {
        return {
          type: "object",
          value: {
            properties: []
          }
        };
      }
    case "undefined":
      return formatUndefined();
    case "function":
      return formatFunction(arg);
    case "symbol": {
      return formatSymbol(arg);
    }
    case "bigint":
      return formatBigInt(arg);
  }
}
function formatFunction(value) {
  return {
    type: "function",
    value: `function ${value.name}() {}`
  };
}
function formatUndefined() {
  return {
    type: "undefined"
  };
}
function formatBoolean(value) {
  return {
    type: "boolean",
    value: String(value)
  };
}
function formatNumber(value) {
  return {
    type: "number",
    value: String(value)
  };
}
function formatBigInt(value) {
  return {
    type: "bigint",
    value: String(value)
  };
}
function formatString(value) {
  return {
    type: "string",
    value
  };
}
function formatSymbol(value) {
  return {
    type: "symbol",
    value: value.description
  };
}
function formatObject(value, depth) {
  if (value === null) {
    return {
      type: "null"
    };
  }
  {
    if (isComponentPublicInstance(value)) {
      return formatComponentPublicInstance(value, depth);
    }
    if (isComponentInternalInstance(value)) {
      return formatComponentInternalInstance(value, depth);
    }
    if (isUniElement(value)) {
      return formatUniElement(value, depth);
    }
    if (isCSSStyleDeclaration(value)) {
      return formatCSSStyleDeclaration(value, depth);
    }
  }
  if (Array.isArray(value)) {
    return {
      type: "object",
      subType: "array",
      value: {
        properties: value.map((v3, i3) => formatArrayElement(v3, i3, depth + 1))
      }
    };
  }
  if (value instanceof Set) {
    return {
      type: "object",
      subType: "set",
      className: "Set",
      description: `Set(${value.size})`,
      value: {
        entries: Array.from(value).map((v3) => formatSetEntry(v3, depth + 1))
      }
    };
  }
  if (value instanceof Map) {
    return {
      type: "object",
      subType: "map",
      className: "Map",
      description: `Map(${value.size})`,
      value: {
        entries: Array.from(value.entries()).map((v3) => formatMapEntry(v3, depth + 1))
      }
    };
  }
  if (value instanceof Promise) {
    return {
      type: "object",
      subType: "promise",
      value: {
        properties: []
      }
    };
  }
  if (value instanceof RegExp) {
    return {
      type: "object",
      subType: "regexp",
      value: String(value),
      className: "Regexp"
    };
  }
  if (value instanceof Date) {
    return {
      type: "object",
      subType: "date",
      value: String(value),
      className: "Date"
    };
  }
  if (value instanceof Error) {
    return {
      type: "object",
      subType: "error",
      value: value.message || String(value),
      className: value.name || "Error"
    };
  }
  let className = void 0;
  {
    const constructor = value.constructor;
    if (constructor) {
      if (constructor.get$UTSMetadata$) {
        className = constructor.get$UTSMetadata$().name;
      }
    }
  }
  let entries = Object.entries(value);
  if (isHarmonyBuilderParams(value)) {
    entries = entries.filter(([key]) => key !== "modifier" && key !== "nodeContent");
  }
  return {
    type: "object",
    className,
    value: {
      properties: entries.map((entry) => formatObjectProperty(entry[0], entry[1], depth + 1))
    }
  };
}
function isHarmonyBuilderParams(value) {
  return value.modifier && value.modifier._attribute && value.nodeContent;
}
function isComponentPublicInstance(value) {
  return value.$ && isComponentInternalInstance(value.$);
}
function isComponentInternalInstance(value) {
  return value.type && value.uid != null && value.appContext;
}
function formatComponentPublicInstance(value, depth) {
  return {
    type: "object",
    className: "ComponentPublicInstance",
    value: {
      properties: Object.entries(value.$.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
    }
  };
}
function formatComponentInternalInstance(value, depth) {
  return {
    type: "object",
    className: "ComponentInternalInstance",
    value: {
      properties: Object.entries(value.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
    }
  };
}
function isUniElement(value) {
  return value.style && value.tagName != null && value.nodeName != null;
}
function formatUniElement(value, depth) {
  return {
    type: "object",
    // 非 x 没有 UniElement 的概念
    // className: 'UniElement',
    value: {
      properties: Object.entries(value).filter(([name]) => [
        "id",
        "tagName",
        "nodeName",
        "dataset",
        "offsetTop",
        "offsetLeft",
        "style"
      ].includes(name)).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
    }
  };
}
function isCSSStyleDeclaration(value) {
  return typeof value.getPropertyValue === "function" && typeof value.setProperty === "function" && value.$styles;
}
function formatCSSStyleDeclaration(style, depth) {
  return {
    type: "object",
    value: {
      properties: Object.entries(style.$styles).map(([name, value]) => formatObjectProperty(name, value, depth + 1))
    }
  };
}
function formatObjectProperty(name, value, depth) {
  const result = formatArg(value, depth);
  result.name = name;
  return result;
}
function formatArrayElement(value, index2, depth) {
  const result = formatArg(value, depth);
  result.name = `${index2}`;
  return result;
}
function formatSetEntry(value, depth) {
  return {
    value: formatArg(value, depth)
  };
}
function formatMapEntry(value, depth) {
  return {
    key: formatArg(value[0], depth),
    value: formatArg(value[1], depth)
  };
}
let sendConsole = null;
const messageQueue = [];
const messageExtra = {};
const EXCEPTION_BEGIN_MARK = "---BEGIN:EXCEPTION---";
const EXCEPTION_END_MARK = "---END:EXCEPTION---";
function sendConsoleMessages(messages) {
  if (sendConsole == null) {
    messageQueue.push(...messages);
    return;
  }
  sendConsole(JSON.stringify(Object.assign({
    type: "console",
    data: messages
  }, messageExtra)));
}
function setSendConsole(value, extra = {}) {
  sendConsole = value;
  Object.assign(messageExtra, extra);
  if (value != null && messageQueue.length > 0) {
    const messages = messageQueue.slice();
    messageQueue.length = 0;
    sendConsoleMessages(messages);
  }
}
const atFileRegex = /^\s*at\s+[\w/./-]+:\d+$/;
function rewriteConsole() {
  function wrapConsole(type) {
    return function(...args) {
      const originalArgs = [...args];
      if (originalArgs.length) {
        const maybeAtFile = originalArgs[originalArgs.length - 1];
        if (typeof maybeAtFile === "string" && atFileRegex.test(maybeAtFile)) {
          originalArgs.pop();
        }
      }
      {
        originalConsole[type](...originalArgs);
      }
      if (type === "error" && args.length === 1) {
        const arg = args[0];
        if (typeof arg === "string" && arg.startsWith(EXCEPTION_BEGIN_MARK)) {
          const startIndex = EXCEPTION_BEGIN_MARK.length;
          const endIndex = arg.length - EXCEPTION_END_MARK.length;
          sendErrorMessages([arg.slice(startIndex, endIndex)]);
          return;
        } else if (arg instanceof Error) {
          sendErrorMessages([arg]);
          return;
        }
      }
      sendConsoleMessages([formatMessage(type, args)]);
    };
  }
  if (isConsoleWritable()) {
    CONSOLE_TYPES.forEach((type) => {
      console[type] = wrapConsole(type);
    });
    return function restoreConsole() {
      CONSOLE_TYPES.forEach((type) => {
        console[type] = originalConsole[type];
      });
    };
  } else {
    {
      if (typeof index !== "undefined" && index.__f__) {
        const oldLog = index.__f__;
        if (oldLog) {
          index.__f__ = function(...args) {
            const [type, filename, ...rest] = args;
            oldLog(type, "", ...rest);
            sendConsoleMessages([formatMessage(type, [...rest, filename])]);
          };
          return function restoreConsole() {
            index.__f__ = oldLog;
          };
        }
      }
    }
  }
  return function restoreConsole() {
  };
}
function isConsoleWritable() {
  const value = console.log;
  const sym = Symbol();
  try {
    console.log = sym;
  } catch (ex) {
    return false;
  }
  const isWritable = console.log === sym;
  console.log = value;
  return isWritable;
}
function initRuntimeSocketService() {
  const hosts = "192.168.0.107,127.0.0.1";
  const port = "8090";
  const id = "mp-weixin_d28YCI";
  const lazy = typeof swan !== "undefined";
  let restoreError = lazy ? () => {
  } : initOnError();
  let restoreConsole = lazy ? () => {
  } : rewriteConsole();
  return Promise.resolve().then(() => {
    if (lazy) {
      restoreError = initOnError();
      restoreConsole = rewriteConsole();
    }
    return initRuntimeSocket(hosts, port, id).then((socket) => {
      if (!socket) {
        restoreError();
        restoreConsole();
        originalConsole.error(wrapError("开发模式下日志通道建立 socket 连接失败。"));
        {
          originalConsole.error(wrapError("小程序平台，请勾选不校验合法域名配置。"));
        }
        originalConsole.error(wrapError("如果是运行到真机，请确认手机与电脑处于同一网络。"));
        return false;
      }
      {
        initMiniProgramGlobalFlag();
      }
      socket.onClose(() => {
        {
          originalConsole.error(wrapError("开发模式下日志通道 socket 连接关闭，请在 HBuilderX 中重新运行。"));
        }
        restoreError();
        restoreConsole();
      });
      setSendConsole((data) => {
        socket.send({
          data
        });
      });
      setSendError((data) => {
        socket.send({
          data
        });
      });
      return true;
    });
  });
}
const ERROR_CHAR = "‌";
function wrapError(error) {
  return `${ERROR_CHAR}${error}${ERROR_CHAR}`;
}
function initMiniProgramGlobalFlag() {
  if (typeof wx$1 !== "undefined") {
    wx$1.__uni_console__ = true;
  } else if (typeof my !== "undefined") {
    my.__uni_console__ = true;
  } else if (typeof tt !== "undefined") {
    tt.__uni_console__ = true;
  } else if (typeof swan !== "undefined") {
    swan.__uni_console__ = true;
  } else if (typeof qq !== "undefined") {
    qq.__uni_console__ = true;
  } else if (typeof ks !== "undefined") {
    ks.__uni_console__ = true;
  } else if (typeof jd !== "undefined") {
    jd.__uni_console__ = true;
  } else if (typeof xhs !== "undefined") {
    xhs.__uni_console__ = true;
  } else if (typeof has !== "undefined") {
    has.__uni_console__ = true;
  } else if (typeof qa !== "undefined") {
    qa.__uni_console__ = true;
  }
}
initRuntimeSocketService();
const _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val2] of props) {
    target[key] = val2;
  }
  return target;
};
function initVueIds(vueIds, mpInstance) {
  if (!vueIds) {
    return;
  }
  const ids = vueIds.split(",");
  const len = ids.length;
  if (len === 1) {
    mpInstance._$vueId = ids[0];
  } else if (len === 2) {
    mpInstance._$vueId = ids[0];
    mpInstance._$vuePid = ids[1];
  }
}
const EXTRAS = ["externalClasses"];
function initExtraOptions(miniProgramComponentOptions, vueOptions) {
  EXTRAS.forEach((name) => {
    if (hasOwn$1(vueOptions, name)) {
      miniProgramComponentOptions[name] = vueOptions[name];
    }
  });
}
const WORKLET_RE = /_(.*)_worklet_factory_/;
function initWorkletMethods(mpMethods, vueMethods) {
  if (vueMethods) {
    Object.keys(vueMethods).forEach((name) => {
      const matches = name.match(WORKLET_RE);
      if (matches) {
        const workletName = matches[1];
        mpMethods[name] = vueMethods[name];
        mpMethods[workletName] = vueMethods[workletName];
      }
    });
  }
}
function initWxsCallMethods(methods, wxsCallMethods) {
  if (!isArray$1(wxsCallMethods)) {
    return;
  }
  wxsCallMethods.forEach((callMethod) => {
    methods[callMethod] = function(args) {
      return this.$vm[callMethod](args);
    };
  });
}
function selectAllComponents(mpInstance, selector, $refs) {
  const components = mpInstance.selectAllComponents(selector);
  components.forEach((component) => {
    const ref2 = component.properties.uR;
    $refs[ref2] = component.$vm || component;
  });
}
function initRefs(instance, mpInstance) {
  Object.defineProperty(instance, "refs", {
    get() {
      const $refs = {};
      selectAllComponents(mpInstance, ".r", $refs);
      const forComponents = mpInstance.selectAllComponents(".r-i-f");
      forComponents.forEach((component) => {
        const ref2 = component.properties.uR;
        if (!ref2) {
          return;
        }
        if (!$refs[ref2]) {
          $refs[ref2] = [];
        }
        $refs[ref2].push(component.$vm || component);
      });
      return $refs;
    }
  });
}
function findVmByVueId(instance, vuePid) {
  const $children = instance.$children;
  for (let i3 = $children.length - 1; i3 >= 0; i3--) {
    const childVm = $children[i3];
    if (childVm.$scope._$vueId === vuePid) {
      return childVm;
    }
  }
  let parentVm;
  for (let i3 = $children.length - 1; i3 >= 0; i3--) {
    parentVm = findVmByVueId($children[i3], vuePid);
    if (parentVm) {
      return parentVm;
    }
  }
}
function getLocaleLanguage() {
  var _a;
  let localeLanguage = "";
  {
    const appBaseInfo = ((_a = wx.getAppBaseInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
    const language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
    localeLanguage = normalizeLocale(language) || LOCALE_EN;
  }
  return localeLanguage;
}
const MP_METHODS = [
  "createSelectorQuery",
  "createIntersectionObserver",
  "selectAllComponents",
  "selectComponent"
];
function createEmitFn(oldEmit, ctx) {
  return function emit2(event, ...args) {
    const scope = ctx.$scope;
    if (scope && event) {
      const detail = { __args__: args };
      {
        scope.triggerEvent(event, detail);
      }
    }
    return oldEmit.apply(this, [event, ...args]);
  };
}
function initBaseInstance(instance, options) {
  const ctx = instance.ctx;
  ctx.mpType = options.mpType;
  ctx.$mpType = options.mpType;
  ctx.$mpPlatform = "mp-weixin";
  ctx.$scope = options.mpInstance;
  {
    Object.defineProperties(ctx, {
      // only id
      [VIRTUAL_HOST_ID]: {
        get() {
          const id = this.$scope.data[VIRTUAL_HOST_ID];
          return id === void 0 ? "" : id;
        }
      }
    });
  }
  ctx.$mp = {};
  {
    ctx._self = {};
  }
  instance.slots = {};
  if (isArray$1(options.slots) && options.slots.length) {
    options.slots.forEach((name) => {
      instance.slots[name] = true;
    });
    if (instance.slots[SLOT_DEFAULT_NAME]) {
      instance.slots.default = true;
    }
  }
  ctx.getOpenerEventChannel = function() {
    {
      return options.mpInstance.getOpenerEventChannel();
    }
  };
  ctx.$hasHook = hasHook;
  ctx.$callHook = callHook;
  instance.emit = createEmitFn(instance.emit, ctx);
}
function initComponentInstance(instance, options) {
  initBaseInstance(instance, options);
  const ctx = instance.ctx;
  MP_METHODS.forEach((method) => {
    ctx[method] = function(...args) {
      const mpInstance = ctx.$scope;
      if (mpInstance && mpInstance[method]) {
        return mpInstance[method].apply(mpInstance, args);
      }
    };
  });
}
function initMocks(instance, mpInstance, mocks2) {
  const ctx = instance.ctx;
  mocks2.forEach((mock) => {
    if (hasOwn$1(mpInstance, mock)) {
      instance[mock] = ctx[mock] = mpInstance[mock];
    }
  });
}
function hasHook(name) {
  const hooks = this.$[name];
  if (hooks && hooks.length) {
    return true;
  }
  return false;
}
function callHook(name, args) {
  if (name === "mounted") {
    callHook.call(this, "bm");
    this.$.isMounted = true;
    name = "m";
  }
  const hooks = this.$[name];
  return hooks && invokeArrayFns(hooks, args);
}
const PAGE_INIT_HOOKS = [
  ON_LOAD,
  ON_SHOW,
  ON_HIDE,
  ON_UNLOAD,
  ON_RESIZE,
  ON_TAB_ITEM_TAP,
  ON_REACH_BOTTOM,
  ON_PULL_DOWN_REFRESH,
  ON_ADD_TO_FAVORITES
  // 'onReady', // lifetimes.ready
  // 'onPageScroll', // 影响性能，开发者手动注册
  // 'onShareTimeline', // 右上角菜单，开发者手动注册
  // 'onShareAppMessage' // 右上角菜单，开发者手动注册
];
function findHooks(vueOptions, hooks = /* @__PURE__ */ new Set()) {
  if (vueOptions) {
    Object.keys(vueOptions).forEach((name) => {
      if (isUniLifecycleHook(name, vueOptions[name])) {
        hooks.add(name);
      }
    });
    {
      const { extends: extendsOptions, mixins } = vueOptions;
      if (mixins) {
        mixins.forEach((mixin2) => findHooks(mixin2, hooks));
      }
      if (extendsOptions) {
        findHooks(extendsOptions, hooks);
      }
    }
  }
  return hooks;
}
function initHook(mpOptions, hook, excludes) {
  if (excludes.indexOf(hook) === -1 && !hasOwn$1(mpOptions, hook)) {
    mpOptions[hook] = function(args) {
      return this.$vm && this.$vm.$callHook(hook, args);
    };
  }
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
  hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
  if (!runtimeHooks) {
    return;
  }
  const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  hooks.forEach((hook) => {
    if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
      initHook(mpOptions, hook, []);
    }
  });
}
const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
  const runtimeHooks = [];
  const app = isFunction$1(getApp) && getApp({ allowDefault: true });
  if (app && app.$vm && app.$vm.$) {
    const mixins = app.$vm.$.appContext.mixins;
    if (isArray$1(mixins)) {
      const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
      mixins.forEach((mixin2) => {
        hooks.forEach((hook) => {
          if (hasOwn$1(mixin2, hook) && !runtimeHooks.includes(hook)) {
            runtimeHooks.push(hook);
          }
        });
      });
    }
  }
  return runtimeHooks;
});
function initMixinRuntimeHooks(mpOptions) {
  initHooks(mpOptions, findMixinRuntimeHooks());
}
const HOOKS = [
  ON_SHOW,
  ON_HIDE,
  ON_ERROR,
  ON_THEME_CHANGE,
  ON_PAGE_NOT_FOUND,
  ON_UNHANDLE_REJECTION
];
function parseApp(instance, parseAppOptions) {
  const internalInstance = instance.$;
  const appOptions = {
    globalData: instance.$options && instance.$options.globalData || {},
    $vm: instance,
    // mp-alipay 组件 data 初始化比 onLaunch 早，提前挂载
    onLaunch(options) {
      this.$vm = instance;
      const ctx = internalInstance.ctx;
      if (this.$vm && ctx.$scope && ctx.$callHook) {
        return;
      }
      initBaseInstance(internalInstance, {
        mpType: "app",
        mpInstance: this,
        slots: []
      });
      ctx.globalData = this.globalData;
      instance.$callHook(ON_LAUNCH, options);
    }
  };
  const onErrorHandlers = wx.$onErrorHandlers;
  if (onErrorHandlers) {
    onErrorHandlers.forEach((fn) => {
      injectHook(ON_ERROR, fn, internalInstance);
    });
    onErrorHandlers.length = 0;
  }
  initLocale(instance);
  const vueOptions = instance.$.type;
  initHooks(appOptions, HOOKS);
  initUnknownHooks(appOptions, vueOptions);
  {
    const methods = vueOptions.methods;
    methods && extend(appOptions, methods);
  }
  return appOptions;
}
function initCreateApp(parseAppOptions) {
  return function createApp2(vm) {
    return App(parseApp(vm));
  };
}
function initCreateSubpackageApp(parseAppOptions) {
  return function createApp2(vm) {
    const appOptions = parseApp(vm);
    const app = isFunction$1(getApp) && getApp({
      allowDefault: true
    });
    if (!app)
      return;
    vm.$.ctx.$scope = app;
    const globalData = app.globalData;
    if (globalData) {
      Object.keys(appOptions.globalData).forEach((name) => {
        if (!hasOwn$1(globalData, name)) {
          globalData[name] = appOptions.globalData[name];
        }
      });
    }
    Object.keys(appOptions).forEach((name) => {
      if (!hasOwn$1(app, name)) {
        app[name] = appOptions[name];
      }
    });
    initAppLifecycle(appOptions, vm);
  };
}
function initAppLifecycle(appOptions, vm) {
  if (isFunction$1(appOptions.onLaunch)) {
    const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
    appOptions.onLaunch(args);
  }
  if (isFunction$1(appOptions.onShow) && wx.onAppShow) {
    wx.onAppShow((args) => {
      vm.$callHook("onShow", args);
    });
  }
  if (isFunction$1(appOptions.onHide) && wx.onAppHide) {
    wx.onAppHide((args) => {
      vm.$callHook("onHide", args);
    });
  }
}
function initLocale(appVm) {
  const locale = ref$1(getLocaleLanguage());
  Object.defineProperty(appVm, "$locale", {
    get() {
      return locale.value;
    },
    set(v3) {
      locale.value = v3;
    }
  });
}
const builtInProps = [
  // 百度小程序,快手小程序自定义组件不支持绑定动态事件，动态dataset，故通过props传递事件信息
  // event-opts
  "eO",
  // 组件 ref
  "uR",
  // 组件 ref-in-for
  "uRIF",
  // 组件 id
  "uI",
  // 组件类型 m: 小程序组件
  "uT",
  // 组件 props
  "uP",
  // 小程序不能直接定义 $slots 的 props，所以通过 vueSlots 转换到 $slots
  "uS"
];
function initDefaultProps(options, isBehavior = false) {
  const properties = {};
  if (!isBehavior) {
    let observerSlots = function(newVal) {
      const $slots = /* @__PURE__ */ Object.create(null);
      newVal && newVal.forEach((slotName) => {
        $slots[slotName] = true;
      });
      this.setData({
        $slots
      });
    };
    builtInProps.forEach((name) => {
      properties[name] = {
        type: null,
        value: ""
      };
    });
    properties.uS = {
      type: null,
      value: []
    };
    {
      properties.uS.observer = observerSlots;
    }
  }
  if (options.behaviors) {
    if (options.behaviors.includes("wx://form-field")) {
      if (!options.properties || !options.properties.name) {
        properties.name = {
          type: null,
          value: ""
        };
      }
      if (!options.properties || !options.properties.value) {
        properties.value = {
          type: null,
          value: ""
        };
      }
    }
  }
  return properties;
}
function initVirtualHostProps(options) {
  const properties = {};
  {
    if (options && options.virtualHost) {
      properties[VIRTUAL_HOST_STYLE] = {
        type: null,
        value: ""
      };
      properties[VIRTUAL_HOST_CLASS] = {
        type: null,
        value: ""
      };
      properties[VIRTUAL_HOST_HIDDEN] = {
        type: null,
        value: ""
      };
      properties[VIRTUAL_HOST_ID] = {
        type: null,
        value: ""
      };
    }
  }
  return properties;
}
function initProps(mpComponentOptions) {
  if (!mpComponentOptions.properties) {
    mpComponentOptions.properties = {};
  }
  extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
  if (isArray$1(type) && type.length === 1) {
    return type[0];
  }
  return type;
}
function normalizePropType(type, defaultValue) {
  const res = parsePropType(type);
  return PROP_TYPES.indexOf(res) !== -1 ? res : null;
}
function initPageProps({ properties }, rawProps) {
  if (isArray$1(rawProps)) {
    rawProps.forEach((key) => {
      properties[key] = {
        type: String,
        value: ""
      };
    });
  } else if (isPlainObject$1(rawProps)) {
    Object.keys(rawProps).forEach((key) => {
      const opts = rawProps[key];
      if (isPlainObject$1(opts)) {
        let value = opts.default;
        if (isFunction$1(value)) {
          value = value();
        }
        const type = opts.type;
        opts.type = normalizePropType(type);
        properties[key] = {
          type: opts.type,
          value
        };
      } else {
        properties[key] = {
          type: normalizePropType(opts)
        };
      }
    });
  }
}
function findPropsData(properties, isPage2) {
  return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(resolvePropValue(properties.uP))) || {};
}
function findPagePropsData(properties) {
  const propsData = {};
  if (isPlainObject$1(properties)) {
    Object.keys(properties).forEach((name) => {
      if (builtInProps.indexOf(name) === -1) {
        propsData[name] = resolvePropValue(properties[name]);
      }
    });
  }
  return propsData;
}
function initFormField(vm) {
  const vueOptions = vm.$options;
  if (isArray$1(vueOptions.behaviors) && vueOptions.behaviors.includes("uni://form-field")) {
    vm.$watch("modelValue", () => {
      vm.$scope && vm.$scope.setData({
        name: vm.name,
        value: vm.modelValue
      });
    }, {
      immediate: true
    });
  }
}
function resolvePropValue(prop) {
  return prop;
}
function initData(_2) {
  return {};
}
function initPropsObserver(componentOptions) {
  const observe2 = function observe22() {
    const up = this.properties.uP;
    if (!up) {
      return;
    }
    if (this.$vm) {
      updateComponentProps(resolvePropValue(up), this.$vm.$);
    } else if (resolvePropValue(this.properties.uT) === "m") {
      updateMiniProgramComponentProperties(resolvePropValue(up), this);
    }
  };
  {
    if (!componentOptions.observers) {
      componentOptions.observers = {};
    }
    componentOptions.observers.uP = observe2;
  }
}
function updateMiniProgramComponentProperties(up, mpInstance) {
  const prevProps = mpInstance.properties;
  const nextProps = findComponentPropsData(up) || {};
  if (hasPropsChanged(prevProps, nextProps, false)) {
    mpInstance.setData(nextProps);
  }
}
function updateComponentProps(up, instance) {
  const prevProps = toRaw$1(instance.props);
  const nextProps = findComponentPropsData(up) || {};
  if (hasPropsChanged(prevProps, nextProps)) {
    updateProps(instance, nextProps, prevProps, false);
    if (hasQueueJob(instance.update)) {
      invalidateJob(instance.update);
    }
    {
      instance.update();
    }
  }
}
function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  const nextKeys = Object.keys(nextProps);
  if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
    return true;
  }
  for (let i3 = 0; i3 < nextKeys.length; i3++) {
    const key = nextKeys[i3];
    if (nextProps[key] !== prevProps[key]) {
      return true;
    }
  }
  return false;
}
function initBehaviors(vueOptions) {
  const vueBehaviors = vueOptions.behaviors;
  let vueProps = vueOptions.props;
  if (!vueProps) {
    vueOptions.props = vueProps = [];
  }
  const behaviors = [];
  if (isArray$1(vueBehaviors)) {
    vueBehaviors.forEach((behavior) => {
      behaviors.push(behavior.replace("uni://", "wx://"));
      if (behavior === "uni://form-field") {
        if (isArray$1(vueProps)) {
          vueProps.push("name");
          vueProps.push("modelValue");
        } else {
          vueProps.name = {
            type: String,
            default: ""
          };
          vueProps.modelValue = {
            type: [String, Number, Boolean, Array, Object, Date],
            default: ""
          };
        }
      }
    });
  }
  return behaviors;
}
function applyOptions(componentOptions, vueOptions) {
  componentOptions.data = initData();
  componentOptions.behaviors = initBehaviors(vueOptions);
}
function parseComponent(vueOptions, { parse, mocks: mocks2, isPage: isPage2, isPageInProject, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
  vueOptions = vueOptions.default || vueOptions;
  const options = {
    multipleSlots: true,
    // styleIsolation: 'apply-shared',
    addGlobalClass: true,
    pureDataPattern: /^uP$/
  };
  if (isArray$1(vueOptions.mixins)) {
    vueOptions.mixins.forEach((item) => {
      if (isObject$1(item.options)) {
        extend(options, item.options);
      }
    });
  }
  if (vueOptions.options) {
    extend(options, vueOptions.options);
  }
  const mpComponentOptions = {
    options,
    lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
    pageLifetimes: {
      show() {
        this.$vm && this.$vm.$callHook("onPageShow");
      },
      hide() {
        this.$vm && this.$vm.$callHook("onPageHide");
      },
      resize(size2) {
        this.$vm && this.$vm.$callHook("onPageResize", size2);
      }
    },
    methods: {
      __l: handleLink2
    }
  };
  {
    applyOptions(mpComponentOptions, vueOptions);
  }
  initProps(mpComponentOptions);
  initPropsObserver(mpComponentOptions);
  initExtraOptions(mpComponentOptions, vueOptions);
  initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  {
    initWorkletMethods(mpComponentOptions.methods, vueOptions.methods);
  }
  if (parse) {
    parse(mpComponentOptions, { handleLink: handleLink2 });
  }
  return mpComponentOptions;
}
function initCreateComponent(parseOptions2) {
  return function createComponent2(vueComponentOptions) {
    return Component(parseComponent(vueComponentOptions, parseOptions2));
  };
}
let $createComponentFn;
let $destroyComponentFn;
function getAppVm() {
  return getApp().$vm;
}
function $createComponent(initialVNode, options) {
  if (!$createComponentFn) {
    $createComponentFn = getAppVm().$createComponent;
  }
  const proxy2 = $createComponentFn(initialVNode, options);
  return getExposeProxy(proxy2.$) || proxy2;
}
function $destroyComponent(instance) {
  if (!$destroyComponentFn) {
    $destroyComponentFn = getAppVm().$destroyComponent;
  }
  return $destroyComponentFn(instance);
}
function parsePage(vueOptions, parseOptions2) {
  const { parse, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
  const miniProgramPageOptions = parseComponent(vueOptions, {
    mocks: mocks2,
    isPage: isPage2,
    isPageInProject: true,
    initRelation: initRelation2,
    handleLink: handleLink2,
    initLifetimes: initLifetimes2
  });
  initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
  const methods = miniProgramPageOptions.methods;
  methods.onLoad = function(query) {
    {
      this.options = query;
    }
    this.$page = {
      fullPath: addLeadingSlash(this.route + stringifyQuery(query))
    };
    return this.$vm && this.$vm.$callHook(ON_LOAD, query);
  };
  initHooks(methods, PAGE_INIT_HOOKS);
  {
    initUnknownHooks(methods, vueOptions);
  }
  initRuntimeHooks(methods, vueOptions.__runtimeHooks);
  initMixinRuntimeHooks(methods);
  parse && parse(miniProgramPageOptions, { handleLink: handleLink2 });
  return miniProgramPageOptions;
}
function initCreatePage(parseOptions2) {
  return function createPage2(vuePageOptions) {
    return Component(parsePage(vuePageOptions, parseOptions2));
  };
}
function initCreatePluginApp(parseAppOptions) {
  return function createApp2(vm) {
    initAppLifecycle(parseApp(vm), vm);
  };
}
const MPPage = Page;
const MPComponent = Component;
function initTriggerEvent(mpInstance) {
  const oldTriggerEvent = mpInstance.triggerEvent;
  const newTriggerEvent = function(event, ...args) {
    return oldTriggerEvent.apply(mpInstance, [
      customizeEvent(event),
      ...args
    ]);
  };
  try {
    mpInstance.triggerEvent = newTriggerEvent;
  } catch (error) {
    mpInstance._triggerEvent = newTriggerEvent;
  }
}
function initMiniProgramHook(name, options, isComponent) {
  const oldHook = options[name];
  if (!oldHook) {
    options[name] = function() {
      initTriggerEvent(this);
    };
  } else {
    options[name] = function(...args) {
      initTriggerEvent(this);
      return oldHook.apply(this, args);
    };
  }
}
Page = function(options) {
  initMiniProgramHook(ON_LOAD, options);
  return MPPage(options);
};
Component = function(options) {
  initMiniProgramHook("created", options);
  const isVueComponent = options.properties && options.properties.uP;
  if (!isVueComponent) {
    initProps(options);
    initPropsObserver(options);
  }
  return MPComponent(options);
};
function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
  return {
    attached() {
      let properties = this.properties;
      initVueIds(properties.uI, this);
      const relationOptions = {
        vuePid: this._$vuePid
      };
      initRelation2(this, relationOptions);
      const mpInstance = this;
      const isMiniProgramPage = isPage2(mpInstance);
      let propsData = properties;
      this.$vm = $createComponent({
        type: vueOptions,
        props: findPropsData(propsData, isMiniProgramPage)
      }, {
        mpType: isMiniProgramPage ? "page" : "component",
        mpInstance,
        slots: properties.uS || {},
        // vueSlots
        parentComponent: relationOptions.parent && relationOptions.parent.$,
        onBeforeSetup(instance, options) {
          initRefs(instance, mpInstance);
          initMocks(instance, mpInstance, mocks2);
          initComponentInstance(instance, options);
        }
      });
      if (!isMiniProgramPage) {
        initFormField(this.$vm);
      }
    },
    ready() {
      if (this.$vm) {
        {
          this.$vm.$callHook("mounted");
          this.$vm.$callHook(ON_READY);
        }
      }
    },
    detached() {
      if (this.$vm) {
        pruneComponentPropsCache(this.$vm.$.uid);
        $destroyComponent(this.$vm);
      }
    }
  };
}
const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
function isPage(mpInstance) {
  return !!mpInstance.route;
}
function initRelation(mpInstance, detail) {
  mpInstance.triggerEvent("__l", detail);
}
function handleLink(event) {
  const detail = event.detail || event.value;
  const vuePid = detail.vuePid;
  let parentVm;
  if (vuePid) {
    parentVm = findVmByVueId(this.$vm, vuePid);
  }
  if (!parentVm) {
    parentVm = this.$vm;
  }
  detail.parent = parentVm;
}
var parseOptions = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  handleLink,
  initLifetimes,
  initRelation,
  isPage,
  mocks
});
const createApp$1 = initCreateApp();
const createPage = initCreatePage(parseOptions);
const createComponent = initCreateComponent(parseOptions);
const createPluginApp = initCreatePluginApp();
const createSubpackageApp = initCreateSubpackageApp();
{
  wx.createApp = global.createApp = createApp$1;
  wx.createPage = createPage;
  wx.createComponent = createComponent;
  wx.createPluginApp = global.createPluginApp = createPluginApp;
  wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
}
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 chat = { exports: {} };
(function(module2, exports2) {
  !function(e2, t2) {
    module2.exports = t2();
  }(commonjsGlobal, function() {
    function l2(e3, t3) {
      (null == t3 || t3 > e3.length) && (t3 = e3.length);
      for (var n3 = 0, o3 = Array(t3); n3 < t3; n3++)
        o3[n3] = e3[n3];
      return o3;
    }
    function b2(e3) {
      if (Array.isArray(e3))
        return e3;
    }
    function i3(e3, t3, n3) {
      t3 = x2(t3);
      var o3 = e3, t3 = V2() ? Reflect.construct(t3, n3 || [], x2(e3).constructor) : t3.apply(e3, n3);
      if (!t3 || "object" != typeof t3 && "function" != typeof t3) {
        if (void 0 !== t3)
          throw new TypeError("Derived constructors may only return object or undefined");
        if (void 0 === (t3 = o3))
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
      return t3;
    }
    function p3(e3, t3) {
      if (!(e3 instanceof t3))
        throw new TypeError("Cannot call a class as a function");
    }
    function w2(e3, t3) {
      for (var n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        o3.enumerable = o3.enumerable || false, o3.configurable = true, "value" in o3 && (o3.writable = true), Object.defineProperty(e3, J2(o3.key), o3);
      }
    }
    function e2(e3, t3, n3) {
      return t3 && w2(e3.prototype, t3), n3 && w2(e3, n3), Object.defineProperty(e3, "prototype", { writable: false }), e3;
    }
    function F2(e3, t3) {
      var n3, o3, i4, s4, a3 = "undefined" != typeof Symbol && e3[Symbol.iterator] || e3["@@iterator"];
      if (a3)
        return i4 = !(o3 = true), { s: function() {
          a3 = a3.call(e3);
        }, n: function() {
          var e4 = a3.next();
          return o3 = e4.done, e4;
        }, e: function(e4) {
          i4 = true, n3 = e4;
        }, f: function() {
          try {
            o3 || null == a3.return || a3.return();
          } finally {
            if (i4)
              throw n3;
          }
        } };
      if (Array.isArray(e3) || (a3 = X2(e3)) || t3 && e3 && "number" == typeof e3.length)
        return a3 && (e3 = a3), s4 = 0, { s: t3 = function() {
        }, n: function() {
          return s4 >= e3.length ? { done: true } : { done: false, value: e3[s4++] };
        }, e: function(e4) {
          throw e4;
        }, f: t3 };
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    function q2(e3, t3, n3) {
      return (t3 = J2(t3)) in e3 ? Object.defineProperty(e3, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e3[t3] = n3, e3;
    }
    function x2(e3) {
      return (x2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e4) {
        return e4.__proto__ || Object.getPrototypeOf(e4);
      })(e3);
    }
    function t2(e3, t3) {
      if ("function" != typeof t3 && null !== t3)
        throw new TypeError("Super expression must either be null or a function");
      e3.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e3, writable: true, configurable: true } }), Object.defineProperty(e3, "prototype", { writable: false }), t3 && Y2(e3, t3);
    }
    function V2() {
      try {
        var e3 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
      } catch (e4) {
      }
      return (V2 = function() {
        return !!e3;
      })();
    }
    function B2(e3) {
      if ("undefined" != typeof Symbol && null != e3[Symbol.iterator] || null != e3["@@iterator"])
        return Array.from(e3);
    }
    function H2() {
      throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    function K2(t3, e3) {
      var n3, o3 = Object.keys(t3);
      return Object.getOwnPropertySymbols && (n3 = Object.getOwnPropertySymbols(t3), e3 && (n3 = n3.filter(function(e4) {
        return Object.getOwnPropertyDescriptor(t3, e4).enumerable;
      })), o3.push.apply(o3, n3)), o3;
    }
    function y2(t3) {
      for (var e3 = 1; e3 < arguments.length; e3++) {
        var n3 = null != arguments[e3] ? arguments[e3] : {};
        e3 % 2 ? K2(Object(n3), true).forEach(function(e4) {
          q2(t3, e4, n3[e4]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t3, Object.getOwnPropertyDescriptors(n3)) : K2(Object(n3)).forEach(function(e4) {
          Object.defineProperty(t3, e4, Object.getOwnPropertyDescriptor(n3, e4));
        });
      }
      return t3;
    }
    function W2(e3, t3) {
      if (null == e3)
        return {};
      var n3, o3 = function(e4, t4) {
        if (null == e4)
          return {};
        var n4, o4 = {};
        for (n4 in e4)
          if ({}.hasOwnProperty.call(e4, n4)) {
            if (0 <= t4.indexOf(n4))
              continue;
            o4[n4] = e4[n4];
          }
        return o4;
      }(e3, t3);
      if (Object.getOwnPropertySymbols)
        for (var i4 = Object.getOwnPropertySymbols(e3), s4 = 0; s4 < i4.length; s4++)
          n3 = i4[s4], 0 <= t3.indexOf(n3) || {}.propertyIsEnumerable.call(e3, n3) && (o3[n3] = e3[n3]);
      return o3;
    }
    function Y2(e3, t3) {
      return (Y2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e4, t4) {
        return e4.__proto__ = t4, e4;
      })(e3, t3);
    }
    function j2(e3, t3) {
      return b2(e3) || function(e4, t4) {
        var n3 = null == e4 ? null : "undefined" != typeof Symbol && e4[Symbol.iterator] || e4["@@iterator"];
        if (null != n3) {
          var o3, i4, s4, a3, r4 = [], c3 = true, u3 = false;
          try {
            if (s4 = (n3 = n3.call(e4)).next, 0 === t4) {
              if (Object(n3) !== n3)
                return;
              c3 = false;
            } else
              for (; !(c3 = (o3 = s4.call(n3)).done) && (r4.push(o3.value), r4.length !== t4); c3 = true)
                ;
          } catch (e5) {
            u3 = true, i4 = e5;
          } finally {
            try {
              if (!c3 && null != n3.return && (a3 = n3.return(), Object(a3) !== a3))
                return;
            } finally {
              if (u3)
                throw i4;
            }
          }
          return r4;
        }
      }(e3, t3) || X2(e3, t3) || H2();
    }
    function d2(e3) {
      return function(e4) {
        if (Array.isArray(e4))
          return l2(e4);
      }(e3) || B2(e3) || X2(e3) || function() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }();
    }
    function J2(e3) {
      e3 = function(e4) {
        if ("object" != typeof e4 || !e4)
          return e4;
        var t3 = e4[Symbol.toPrimitive];
        if (void 0 === t3)
          return String(e4);
        t3 = t3.call(e4, "string");
        if ("object" != typeof t3)
          return t3;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }(e3);
      return "symbol" == typeof e3 ? e3 : e3 + "";
    }
    function z2(e3) {
      return (z2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
        return typeof e4;
      } : function(e4) {
        return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
      })(e3);
    }
    function X2(e3, t3) {
      var n3;
      if (e3)
        return "string" == typeof e3 ? l2(e3, t3) : "Map" === (n3 = "Object" === (n3 = {}.toString.call(e3).slice(8, -1)) && e3.constructor ? e3.constructor.name : n3) || "Set" === n3 ? Array.from(e3) : "Arguments" === n3 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n3) ? l2(e3, t3) : void 0;
    }
    function Z2(e3) {
      var n3 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
      return function(e4) {
        if (null === e4 || !function(t4) {
          try {
            return -1 !== Function.toString.call(t4).indexOf("[native code]");
          } catch (e5) {
            return "function" == typeof t4;
          }
        }(e4))
          return e4;
        if ("function" != typeof e4)
          throw new TypeError("Super expression must either be null or a function");
        if (void 0 !== n3) {
          if (n3.has(e4))
            return n3.get(e4);
          n3.set(e4, t3);
        }
        function t3() {
          return function(e5, t4, n4) {
            var o3;
            return V2() ? Reflect.construct.apply(null, arguments) : ((o3 = [null]).push.apply(o3, t4), t4 = new (e5.bind.apply(e5, o3))(), n4 && Y2(t4, n4.prototype), t4);
          }(e4, arguments, x2(this).constructor);
        }
        return t3.prototype = Object.create(e4.prototype, { constructor: { value: t3, enumerable: false, writable: true, configurable: true } }), Y2(t3, e4);
      }(e3);
    }
    var h2 = { SDK_READY: "sdkStateReady", SDK_NOT_READY: "sdkStateNotReady", SDK_DESTROY: "sdkDestroy", MESSAGE_RECEIVED: "onMessageReceived", ROOM_CUSTOM_DATA_RECEIVED: "onRoomCustomDataReceived", MESSAGE_MODIFIED: "onMessageModified", MESSAGE_REVOKED: "onMessageRevoked", MESSAGE_READ_BY_PEER: "onMessageReadByPeer", MESSAGE_READ_RECEIPT_RECEIVED: "onMessageReadReceiptReceived", MESSAGE_EXTENSIONS_UPDATED: "onMessageExtensionsUpdated", MESSAGE_EXTENSIONS_DELETED: "onMessageExtensionsDeleted", MESSAGE_REACTIONS_UPDATED: "onMessageReactionsUpdated", CONVERSATION_LIST_UPDATED: "onConversationListUpdated", TOTAL_UNREAD_MESSAGE_COUNT_UPDATED: "onTotalUnreadMessageCountUpdated", CONVERSATION_GROUP_LIST_UPDATED: "onConversationGroupListUpdated", CONVERSATION_IN_GROUP_UPDATED: "onConversationInGroupUpdated", GROUP_LIST_UPDATED: "onGroupListUpdated", GROUP_ATTRIBUTES_UPDATED: "groupAttributesUpdated", GROUP_COUNTER_UPDATED: "onGroupCounterUpdated", TOPIC_CREATED: "onTopicCreated", TOPIC_DELETED: "onTopicDeleted", TOPIC_UPDATED: "onTopicUpdated", PROFILE_UPDATED: "onProfileUpdated", USER_STATUS_UPDATED: "onUserStatusUpdated", BLACKLIST_UPDATED: "blacklistUpdated", FRIEND_LIST_UPDATED: "onFriendListUpdated", FRIEND_GROUP_LIST_UPDATED: "onFriendGroupListUpdated", FRIEND_APPLICATION_LIST_UPDATED: "onFriendApplicationListUpdated", MY_FOLLOWERS_LIST_UPDATED: "onMyFollowersListUpdated", MY_FOLLOWING_LIST_UPDATED: "onMyFollowingListUpdated", MUTUAL_FOLLOWERS_LIST_UPDATED: "onMutualFollowersListUpdated", KICKED_OUT: "kickedOut", ERROR: "error", NET_STATE_CHANGE: "netStateChange", ALL_RECEIVE_MESSAGE_OPT_UPDATED: "onAllReceiveMessageOptUpdated" }, R2 = { MSG_TEXT: "TIMTextElem", MSG_IMAGE: "TIMImageElem", MSG_SOUND: "TIMSoundElem", MSG_AUDIO: "TIMSoundElem", MSG_FILE: "TIMFileElem", MSG_FACE: "TIMFaceElem", MSG_VIDEO: "TIMVideoFileElem", MSG_GEO: "TIMLocationElem", MSG_LOCATION: "TIMLocationElem", MSG_GRP_TIP: "TIMGroupTipElem", MSG_GRP_SYS_NOTICE: "TIMGroupSystemNoticeElem", MSG_CUSTOM: "TIMCustomElem", MSG_MERGER: "TIMRelayElem", MSG_PRIORITY_HIGH: "High", MSG_PRIORITY_NORMAL: "Normal", MSG_PRIORITY_LOW: "Low", MSG_PRIORITY_LOWEST: "Lowest", CONV_C2C: "C2C", CONV_GROUP: "GROUP", CONV_TOPIC: "TOPIC", CONV_SYSTEM: "@TIM#SYSTEM", CONV_AT_ME: 1, CONV_AT_ALL: 2, CONV_AT_ALL_AT_ME: 3, CONV_MARK_TYPE_STAR: 1, CONV_MARK_TYPE_UNREAD: 2, CONV_MARK_TYPE_FOLD: 4, CONV_MARK_TYPE_HIDE: 8, GRP_PRIVATE: "Private", GRP_WORK: "Private", GRP_PUBLIC: "Public", GRP_CHATROOM: "ChatRoom", GRP_MEETING: "ChatRoom", GRP_AVCHATROOM: "AVChatRoom", GRP_COMMUNITY: "Community", GRP_ROOM: "Room", GRP_LIVE: "Live", GRP_MBR_ROLE_OWNER: "Owner", GRP_MBR_ROLE_ADMIN: "Admin", GRP_MBR_ROLE_MEMBER: "Member", GRP_MBR_ROLE_CUSTOM: "Custom", GRP_TIP_MBR_JOIN: 1, GRP_TIP_MBR_QUIT: 2, GRP_TIP_MBR_KICKED_OUT: 3, GRP_TIP_MBR_SET_ADMIN: 4, GRP_TIP_MBR_CANCELED_ADMIN: 5, GRP_TIP_GRP_PROFILE_UPDATED: 6, GRP_TIP_MBR_PROFILE_UPDATED: 7, GRP_TIP_BAN_AVCHATROOM_MEMBER: 10, GRP_TIP_UNBAN_AVCHATROOM_MEMBER: 11, MSG_REMIND_ACPT_AND_NOTE: "AcceptAndNotify", MSG_REMIND_ACPT_NOT_NOTE: "AcceptNotNotify", MSG_REMIND_DISCARD: "Discard", RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT: "AcceptNotNotifyExceptAt", NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT: "AcceptNotNotifyExceptAt", NOT_RECEIVE_MSG_EXCEPT_AT: "NotReceiveMsgExceptAt", GENDER_UNKNOWN: "Gender_Type_Unknown", GENDER_FEMALE: "Gender_Type_Female", GENDER_MALE: "Gender_Type_Male", KICKED_OUT_MULT_ACCOUNT: "multipleAccount", KICKED_OUT_MULT_DEVICE: "multipleDevice", KICKED_OUT_USERSIG_EXPIRED: "userSigExpired", KICKED_OUT_REST_API: "REST_API_Kick", ALLOW_TYPE_ALLOW_ANY: "AllowType_Type_AllowAny", ALLOW_TYPE_NEED_CONFIRM: "AllowType_Type_NeedConfirm", ALLOW_TYPE_DENY_ANY: "AllowType_Type_DenyAny", FORBID_TYPE_NONE: "AdminForbid_Type_None", FORBID_TYPE_SEND_OUT: "AdminForbid_Type_SendOut", JOIN_OPTIONS_FREE_ACCESS: "FreeAccess", JOIN_OPTIONS_NEED_PERMISSION: "NeedPermission", JOIN_OPTIONS_DISABLE_APPLY: "DisableApply", JOIN_STATUS_SUCCESS: "JoinedSuccess", JOIN_STATUS_ALREADY_IN_GROUP: "AlreadyInGroup", JOIN_STATUS_WAIT_APPROVAL: "WaitAdminApproval", INVITE_OPTIONS_DISABLE_INVITE: "DisableInvite", INVITE_OPTIONS_NEED_PERMISSION: "NeedPermission", INVITE_OPTIONS_FREE_ACCESS: "FreeAccess", GRP_PROFILE_OWNER_ID: "ownerID", GRP_PROFILE_CREATE_TIME: "createTime", GRP_PROFILE_LAST_INFO_TIME: "lastInfoTime", GRP_PROFILE_MEMBER_NUM: "memberNum", GRP_PROFILE_MAX_MEMBER_NUM: "maxMemberNum", GRP_PROFILE_JOIN_OPTION: "joinOption", GRP_PROFILE_INVITE_OPTION: "inviteOption", GRP_PROFILE_INTRODUCTION: "introduction", GRP_PROFILE_NOTIFICATION: "notification", GRP_PROFILE_MUTE_ALL_MBRS: "muteAllMembers", SNS_ADD_TYPE_SINGLE: "Add_Type_Single", SNS_ADD_TYPE_BOTH: "Add_Type_Both", SNS_DELETE_TYPE_SINGLE: "Delete_Type_Single", SNS_DELETE_TYPE_BOTH: "Delete_Type_Both", SNS_APPLICATION_TYPE_BOTH: "Pendency_Type_Both", SNS_APPLICATION_SENT_TO_ME: "Pendency_Type_ComeIn", SNS_APPLICATION_SENT_BY_ME: "Pendency_Type_SendOut", SNS_APPLICATION_AGREE: "Response_Action_Agree", SNS_APPLICATION_AGREE_AND_ADD: "Response_Action_AgreeAndAdd", SNS_CHECK_TYPE_BOTH: "CheckResult_Type_Both", SNS_CHECK_TYPE_SINGLE: "CheckResult_Type_Single", SNS_TYPE_NO_RELATION: "CheckResult_Type_NoRelation", SNS_TYPE_A_WITH_B: "CheckResult_Type_AWithB", SNS_TYPE_B_WITH_A: "CheckResult_Type_BWithA", SNS_TYPE_BOTH_WAY: "CheckResult_Type_BothWay", NET_STATE_CONNECTED: "connected", NET_STATE_CONNECTING: "connecting", NET_STATE_DISCONNECTED: "disconnected", MSG_AT_ALL: "__kImSDK_MesssageAtALL__", READ_ALL_C2C_MSG: "readAllC2CMessage", READ_ALL_GROUP_MSG: "readAllGroupMessage", READ_ALL_MSG: "readAllMessage", USER_STATUS_UNKNOWN: 0, USER_STATUS_ONLINE: 1, USER_STATUS_OFFLINE: 2, USER_STATUS_UNLOGINED: 3, IOS_OFFLINE_PUSH_NO_SOUND: "push.no_sound", IOS_OFFLINE_PUSH_DEFAULT_SOUND: "default" }, _2 = { NEW_INVITATION_RECEIVED: "newInvitationReceived", INVITEE_ACCEPTED: "ts_invitee_accepted", INVITEE_REJECTED: "ts_invitee_rejected", INVITATION_CANCELLED: "ts_invitation_cancelled", INVITATION_TIMEOUT: "ts_invitation_timeout", INVITATION_MODIFIED: "ts_invitation_modified", ACTION_TYPE_UNKNOWN: 0, ACTION_TYPE_INVITE: 1, ACTION_TYPE_CANCEL_INVITE: 2, ACTION_TYPE_ACCEPT_INVITE: 3, ACTION_TYPE_REJECT_INVITE: 4, ACTION_TYPE_INVITE_TIMEOUT: 5 }, Q2 = e2(function e3() {
      p3(this, e3), this.cache = [], this.options = null;
    }, [{ key: "use", value: function(e3) {
      if ("function" != typeof e3)
        throw "middleware must be a function";
      return this.cache.push(e3), this;
    } }, { key: "next", value: function(e3) {
      if (this.middlewares && 0 < this.middlewares.length)
        return this.middlewares.shift().call(this, this.options, this.next.bind(this));
    } }, { key: "run", value: function(e3) {
      return this.middlewares = this.cache.map(function(e4) {
        return e4;
      }), this.options = e3, this.next();
    } }]), $2 = e2(function e3() {
      var t3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0, n3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0;
      p3(this, e3), this.high = t3, this.low = n3;
    }, [{ key: "equal", value: function(e3) {
      return null !== e3 && this.low === e3.low && this.high === e3.high;
    } }, { key: "toString", value: function() {
      var e3 = Number(this.high).toString(16), t3 = Number(this.low).toString(16);
      if (t3.length < 8)
        for (var n3 = 8 - t3.length; n3; )
          t3 = "0" + t3, n3--;
      return e3 + t3;
    } }]), ee2 = { TEST: { CHINA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, OVERSEA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, SINGAPORE: { DEFAULT: "wss://wsssgp-dev.im.qcloud.com" }, KOREA: { DEFAULT: "wss://wsskr-dev.im.qcloud.com" }, GERMANY: { DEFAULT: "wss://wssger-dev.im.qcloud.com" }, IND: { DEFAULT: "wss://wssind-dev.im.qcloud.com" }, JPN: { DEFAULT: "wss://wssjpn-dev.im.qcloud.com" }, USA: { DEFAULT: "wss://wssusa-dev.im.qcloud.com" }, INDONESIA: { DEFAULT: "wss://wssidn-dev.im.qcloud.com" } }, PRODUCTION: { CHINA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", IPV6: "wss://wssv6.im.qcloud.com", BACKUP: "wss://wss.tim.qq.com", BACKUP_WEB: "wss://*w4c.my-cpaas.com", STAT: "https://events.im.qcloud.com", ANYCAST: "wss://162.14.13.203" }, OVERSEA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", IPV6: "wss://wssv6.im.qcloud.com", BACKUP: "wss://wss.my-imcloud.com", BACKUP_WEB: "wss://*w4c.my-cpaas.com", STAT: "https://api.my-imcloud.com" }, SINGAPORE: { DEFAULT0: "wss://*w4s.my-imcloud.com", DEFAULT: "wss://wsssgp.im.qcloud.com", IPV6: "wss://wsssgpv6.im.qcloud.com", BACKUP: "wss://wsssgp.my-imcloud.com", BACKUP_WEB: "wss://*w4s.my-cpaas.com", STAT: "https://apisgp.my-imcloud.com", ANYCAST: "wss://162.14.19.159" }, KOREA: { DEFAULT0: "wss://*w4k.my-imcloud.com", DEFAULT: "wss://wsskr.im.qcloud.com", IPV6: "wss://wsskrv6.im.qcloud.com", BACKUP: "wss://wsskr.my-imcloud.com", BACKUP_WEB: "wss://*w4k.my-cpaas.com", STAT: "https://apikr.my-imcloud.com", ANYCAST: "wss://162.14.13.104" }, GERMANY: { DEFAULT0: "wss://*w4g.my-imcloud.com", DEFAULT: "wss://wssger.im.qcloud.com", IPV6: "wss://wssgerv6.im.qcloud.com", BACKUP: "wss://wssger.my-imcloud.com", BACKUP_WEB: "wss://*w4g.my-cpaas.com", STAT: "https://apiger.my-imcloud.com", ANYCAST: "wss://162.14.3.17" }, IND: { DEFAULT0: "wss://*w4i.my-imcloud.com", DEFAULT: "wss://wssind.my-imcloud.com", IPV6: "wss://wssindv6.im.qcloud.com", BACKUP: "wss://wssind.im.qcloud.com", BACKUP_WEB: "wss://*w4i.my-cpaas.com", STAT: "https://apiind.my-imcloud.com", ANYCAST: "wss://162.14.19.46" }, JPN: { DEFAULT0: "wss://*w4j.my-imcloud.com", DEFAULT: "wss://wssjpn.im.qcloud.com", IPV6: "wss://wssjpnv6.im.qcloud.com", BACKUP: "wss://wssjpn.my-imcloud.com", BACKUP_WEB: "wss://*w4j.my-cpaas.com", STAT: "https://apijpn.my-imcloud.com" }, USA: { DEFAULT0: "wss://*w4u.my-imcloud.com", DEFAULT: "wss://wssusa.im.qcloud.com", IPV6: "wss://wssusav6.im.qcloud.com", BACKUP: "wss://wssusa.my-imcloud.com", BACKUP_WEB: "wss://*w4u.my-cpaas.com", STAT: "https://apiusa.my-imcloud.com", ANYCAST: "wss://162.14.10.42" }, INDONESIA: { DEFAULT0: "wss://*w4y.my-imcloud.com", DEFAULT: "wss://wssidn.im.qcloud.com", IPV6: "wss://wssidnv6.im.qcloud.com", BACKUP: "wss://wssidn.my-imcloud.com", BACKUP_WEB: "wss://*w4y.my-cpaas.com", STAT: "https://apiidn.my-imcloud.com", ANYCAST: "wss://43.129.34.169" } } }, te2 = { ANDROID: 2, IOS: 3, MAC: 4, WEB: 7, WX_MP: 8, QQ_MP: 9, TT_MP: 10, BAIDU_MP: 11, ALI_MP: 12, IPAD: 13, UNI_NATIVE_APP: 15, DONUT_NATIVE_APP: 19, NS_NATIVE_APP: 20, RN_NATIVE_APP: 21 }, ne2 = "1.7.3", oe2 = 537048168, se2 = "CHINA", s3 = { HOST: { CURRENT: { DEFAULT: "wss://wss.im.qcloud.com", STAT: "https://events.im.qcloud.com" }, setCurrent: function() {
      this.CURRENT = ee2.PRODUCTION[0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : se2];
    } }, NAME: { OPEN_IM: "openim", OPEN_IM_MSG_EXT: "openim_msg_ext_http_svc", GRP: "group_open_http_svc", GRP_AV: "group_open_avchatroom_http_svc", GRP_COMMUNITY: "million_group_open_http_svc", GRP_ATTR: "group_open_attr_http_svc", FD: "sns", PROFILE: "profile", RECENT_CONTACT: "recentcontact", PIC: "openpic", BIG_GRP_NO_AUTH: "group_open_http_noauth_svc", BIG_GRP_POLLING: "group_open_long_polling_http_svc", BIG_GRP_POLLING_NO_AUTH: "group_open_long_polling_http_noauth_svc", IM_OPEN_STAT: "imopenstat", WEB_IM: "webim", IM_COS_SIGN: "im_cos_sign_svr", CUSTOM_UPLOAD: "im_cos_msg", HEARTBEAT: "heartbeat", IM_OPEN_PUSH: "im_open_push", IM_OPEN_STATUS: "im_open_status", IM_LONG_MSG: "im_long_msg", IM_CONFIG_MANAGER: "im_sdk_config_mgr", STAT_SERVICE: "StatSvc", OVERLOAD_PUSH: "OverLoadPush", IM_MSG_AUDIT_MGR: "im_msg_audit_mgr", TUIROOM_SVR: "tui_room_svr", IM_OPEN_TRANSLATE: "im_open_translate", IM_OPEN_SPEECH: "im_open_speech", MSG_SEARCH: "message_search", GRP_SEARCH: "group_search", GRP_MEMBER_SEARCH: "group_member_search", USER_SEARCH: "user_search", FOLLOW: "follow", OFFLINE_PUSH_REPORT: "offline_push_report", IM_MSG_LOGIC: "im_msg_db_logic" } }, g2 = { SEARCH_GRP_SNS: new $2(0, Math.pow(2, 1)).toString(), AV_HISTORY_MSG: new $2(0, Math.pow(2, 2)).toString(), GRP_COMMUNITY: new $2(0, Math.pow(2, 3)).toString(), MSG_TO_SPECIFIED_GRP_MBR: new $2(0, Math.pow(2, 4)).toString(), AV_MBR_LIST: new $2(0, Math.pow(2, 6)).toString(), USER_STATUS: new $2(0, Math.pow(2, 7)).toString(), CONV_MARK: new $2(0, Math.pow(2, 9)).toString(), CONV_GROUP: new $2(0, Math.pow(2, 10)).toString(), AV_BAN_MBR: new $2(0, Math.pow(2, 11)).toString(), MSG_EXT: new $2(0, Math.pow(2, 13)).toString(), GRP_COUNTER: new $2(0, Math.pow(2, 15)).toString(), PLUGIN_TRANSLATE: new $2(Math.pow(2, 6)).toString(), PLUGIN_VOICE_TO_TEXT: new $2(Math.pow(2, 7)).toString(), PLUGIN_CS: new $2(Math.pow(2, 8)).toString(), PLUGIN_PUSH: new $2(Math.pow(2, 9)).toString(), PLUGIN_BOT: new $2(Math.pow(2, 10)).toString(), MSG_REACTION: new $2(Math.pow(2, 16)).toString(), FOLLOW: new $2(Math.pow(2, 20)).toString() }, ae2 = "group_profile", re2 = ["Type", "Name", "Introduction", "Notification", "FaceUrl", "Owner_Account", "CreateTime", "InfoSeq", "LastInfoTime", "LastMsgTime", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "NextMsgSeq", "ShutUpAllMember", "InviteJoinOption"], ce2 = ["Role", "JoinTime", "MsgSeq", "MsgFlag"];
    s3.HOST.setCurrent(se2);
    for (var ue2, le2 = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), de2 = le2 && "function" == typeof wx$1.createGamePortal, pe2 = "undefined" != typeof qq && "function" == typeof qq.getSystemInfoSync && Boolean(qq.getSystemInfoSync().fontSizeSetting), _e2 = "undefined" != typeof tt && "function" == typeof tt.getSystemInfoSync && Boolean(tt.getSystemInfoSync().fontSizeSetting), he2 = "undefined" != typeof swan && "function" == typeof swan.getSystemInfoSync && Boolean(swan.getSystemInfoSync().fontSizeSetting), ge2 = "undefined" != typeof my && "function" == typeof my.getSystemInfoSync && Boolean(my.getSystemInfoSync().fontSizeSetting), n2 = "undefined" != typeof jd && "function" == typeof jd.getSystemInfoSync, fe2 = "undefined" != typeof index && "undefined" == typeof window && "function" == typeof index.requireNativePlugin, o2 = le2 && "object" === z2(wx$1.miniapp), me2 = "undefined" != typeof index, v3 = le2 || pe2 || _e2 || he2 || ge2 || fe2 || n2, a2 = "undefined" == typeof window && !v3 && "undefined" != typeof commonjsGlobal && void 0 !== commonjsGlobal.NativeScriptGlobals, ve2 = "undefined" != typeof commonjsGlobal && (void 0 !== commonjsGlobal.nativeModuleProxy || void 0 !== commonjsGlobal.ReactNative), Ie2 = "undefined" != typeof index ? !v3 : "undefined" != typeof window && !v3 && !ve2, I2 = pe2 ? qq : _e2 ? tt : he2 ? swan : ge2 ? my : le2 ? wx$1 : fe2 ? index : n2 ? jd : {}, Me2 = Ie2 && window && window.navigator && window.navigator.userAgent || "", ye2 = (n2 = "WEB", /(micromessenger|webbrowser)/i.test(Me2) ? n2 = "WEB" : pe2 ? n2 = "QQ_MP" : _e2 ? n2 = "TT_MP" : he2 ? n2 = "BAIDU_MP" : ge2 ? n2 = "ALI_MP" : le2 ? n2 = o2 ? "DONUT_NATIVE_APP" : "WX_MP" : fe2 ? n2 = "UNI_NATIVE_APP" : a2 ? n2 = "NS_NATIVE_APP" : ve2 && (n2 = "RN_NATIVE_APP"), te2[n2]), o2 = /iPad/i.test(Me2), a2 = /iPhone/i.test(Me2) && !o2, n2 = /iPod/i.test(Me2), Ce2 = a2 || o2 || n2, Te2 = (a2 = Me2.match(/OS (\d+)_/i)) && a2[1] ? a2[1] : null, De2 = /Android/i.test(Me2), Ee2 = (o2 = Me2.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i)) ? (n2 = o2[1] && parseFloat(o2[1]), a2 = o2[2] && parseFloat(o2[2]), n2 && a2 ? parseFloat(o2[1] + "." + o2[2]) : n2 || null) : null, a2 = /Edge/i.test(Me2), o2 = !a2 && /Chrome/i.test(Me2), Le2 = /MSIE/.test(Me2) || -1 < Me2.indexOf("Trident") && -1 < Me2.indexOf("rv:11.0"), Se2 = n2 = !(n2 = (n2 = /MSIE\s(\d+)\.\d/.exec(Me2)) && parseFloat(n2[1])) && /Trident\/7.0/i.test(Me2) && /rv:11.0/.test(Me2) ? 11 : n2, n2 = /Safari/i.test(Me2) && !o2 && !De2 && !a2, ke2 = /Windows/i.test(Me2), Re2 = /MAC OS X/i.test(Me2), Ae2 = Ie2 && "undefined" != typeof Worker && !Le2, Oe2 = De2 || Ce2, Ne2 = Ie2 && void 0 !== window.tencent_cloud_im_csig_flutter_for_web_25F_cy, Ge2 = "undefined" != typeof window && void 0 !== window.navigator && (o2 = window.navigator.standalone, !(!Ce2 || o2 || n2)), Pe2 = "undefined" != typeof console ? console : "undefined" != typeof commonjsGlobal && commonjsGlobal.console ? commonjsGlobal.console : "undefined" != typeof window && window.console ? window.console : {}, Ue2 = function() {
    }, be2 = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "group", "groupCollapsed", "groupEnd", "info", "log", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"], we2 = be2.length; we2--; )
      ue2 = be2[we2], console[ue2] || (Pe2[ue2] = Ue2);
    function Fe2() {
      var e3 = /* @__PURE__ */ new Date();
      return e3.setTime(He2()), e3;
    }
    function qe2() {
      Be2 = 0;
    }
    function xe2() {
      return Math.floor(He2() / 1e3);
    }
    var Ve2 = Pe2, Be2 = 0, He2 = function() {
      return (/* @__PURE__ */ new Date()).getTime() + Be2;
    }, Ke2 = 0;
    function We2() {
      return Zt2() ? "%c Chat %c" : "Chat";
    }
    function Ye2() {
      var e3 = Fe2();
      return e3.toLocaleTimeString("en-US", { hour12: false }) + "." + function(e4) {
        var t3;
        switch (e4.toString().length) {
          case 1:
            t3 = "00" + e4;
            break;
          case 2:
            t3 = "0" + e4;
            break;
          default:
            t3 = e4;
        }
        return t3;
      }(e3.getMilliseconds());
    }
    var M2 = { arguments2String: function(e3) {
      var t3 = "";
      if (1 === e3.length)
        t3 = e3[0];
      else
        for (var n3 = 0, o3 = e3.length; n3 < o3; n3++) {
          if (Mt2(e3[n3]))
            try {
              t3 += yt2(e3[n3]) ? JSON.stringify(e3[n3], ["message", "code"]) : JSON.stringify(e3[n3]);
            } catch (e4) {
              t3 += e4 ? e4.message : "";
              break;
            }
          else
            t3 += e3[n3];
          t3 += " ";
        }
      return t3;
    }, _exec: function(e3, t3) {
      Zt2() ? Ve2[e3](We2(), "background:#0abf5b; padding:1px; border-radius:3px; color: #fff", "background:transparent", Ye2(), t3) : Ve2[e3]("".concat(We2(), " ").concat(Ye2(), " ").concat(t3));
    }, d: function() {
      var e3;
      Ke2 <= -1 && (e3 = this.arguments2String(arguments), this._exec("debug", e3));
    }, l: function() {
      var e3;
      Ke2 <= 0 && (e3 = this.arguments2String(arguments), this._exec("log", e3));
    }, log: function() {
      var e3;
      Ke2 <= 0 && (e3 = this.arguments2String(arguments), this._exec("log", e3));
    }, i: function() {
      var e3;
      Ke2 <= 1 && (e3 = this.arguments2String(arguments), this._exec("info", e3));
    }, w: function() {
      var e3;
      Ke2 <= 2 && (e3 = this.arguments2String(arguments), this._exec("warn", e3));
    }, e: function() {
      var e3;
      Ke2 <= 3 && (e3 = this.arguments2String(arguments), this._exec("error", e3));
    }, setLevel: function(e3) {
      e3 < 4 && this._exec("log", "set level from " + Ke2 + " to " + e3), Ke2 = e3;
    }, getLevel: function() {
      return Ke2;
    } }, je2 = { JPG: 1, JPEG: 1, GIF: 2, PNG: 3, BMP: 4, UNKNOWN: 255 }, a2 = "Tag_Profile_IM_", f2 = { NICK: "".concat(a2, "Nick"), GENDER: "".concat(a2, "Gender"), BIRTHDAY: "".concat(a2, "BirthDay"), LOCATION: "".concat(a2, "Location"), SELFSIGNATURE: "".concat(a2, "SelfSignature"), ALLOWTYPE: "".concat(a2, "AllowType"), LANGUAGE: "".concat(a2, "Language"), AVATAR: "".concat(a2, "Image"), MESSAGESETTINGS: "".concat(a2, "MsgSettings"), ADMINFORBIDTYPE: "".concat(a2, "AdminForbidType"), LEVEL: "".concat(a2, "Level"), ROLE: "".concat(a2, "Role") }, Je2 = { GROUP: "".concat("Tag_SNS_IM_", "Group"), REMARK: "".concat("Tag_SNS_IM_", "Remark"), ADDSOURCE: "".concat("Tag_SNS_IM_", "AddSource"), ADDWORDING: "".concat("Tag_SNS_IM_", "Wording"), ADDTIME: "".concat("Tag_SNS_IM_", "AddTime") }, o2 = "Gender_Type_", ze2 = { UNKNOWN: "".concat(o2, "Unknown"), FEMALE: "".concat(o2, "Female"), MALE: "".concat(o2, "Male") }, Xe2 = { NONE: "".concat("AdminForbid_Type_", "None"), SEND_OUT: "".concat("AdminForbid_Type_", "SendOut") }, Ze2 = { NEED_CONFIRM: "".concat("AllowType_Type_", "NeedConfirm"), ALLOW_ANY: "".concat("AllowType_Type_", "AllowAny"), DENY_ANY: "".concat("AllowType_Type_", "DenyAny") }, Qe2 = "JoinedSuccess", $e2 = "WaitAdminApproval", et2 = "@TOPIC#_", nt2 = Object.prototype.hasOwnProperty;
    function S2(e3) {
      if (null == e3)
        return true;
      if ("boolean" == typeof e3)
        return false;
      if ("number" == typeof e3)
        return 0 === e3;
      if ("string" == typeof e3)
        return 0 === e3.length;
      if ("function" == typeof e3)
        return 0 === e3.length;
      if (Array.isArray(e3))
        return 0 === e3.length;
      if (e3 instanceof Error)
        return "" === e3.message;
      if (m2(e3)) {
        for (var t3 in e3)
          if (nt2.call(e3, t3))
            return false;
        return true;
      }
      return !!(ot2(e3) || it2(e3) || st2(e3)) && 0 === e3.size;
    }
    function ot2(e3) {
      return "map" === Ct2(e3);
    }
    function it2(e3) {
      return "set" === Ct2(e3);
    }
    function st2(e3) {
      return "file" === Ct2(e3);
    }
    function A2(e3) {
      return null !== e3 && ("number" == typeof e3 && !isNaN(+e3) || "object" === z2(e3) && e3.constructor === Number);
    }
    function at2(e3) {
      return null !== e3 && "object" === z2(e3);
    }
    function m2(e3) {
      if ("object" === z2(e3) && null !== e3) {
        if (null === (e3 = Object.getPrototypeOf(e3)))
          return 1;
        for (var t3 = e3; null !== Object.getPrototypeOf(t3); )
          t3 = Object.getPrototypeOf(t3);
        return e3 === t3;
      }
    }
    function O2(e3) {
      return "function" == typeof Array.isArray ? Array.isArray(e3) : "array" === Ct2(e3);
    }
    function rt2(e3) {
      return O2(e3) && 0 < e3.length;
    }
    function ct2(e3) {
      return "function" == typeof e3;
    }
    function ut2(e3) {
      return "filelist" === Ct2(e3);
    }
    function lt2(e3) {
      return "string" == typeof e3 && (e3 = e3[0], !/[^a-zA-Z0-9]/.test(e3));
    }
    function dt2(e3, t3, n3, o3) {
      if (!Mt2(e3) || !Mt2(t3))
        return 0;
      for (var i4, s4 = 0, a3 = Object.keys(t3), r4 = 0, c3 = a3.length; r4 < c3; r4++)
        if (i4 = a3[r4], !(N3(t3[i4]) || n3 && n3.includes(i4)))
          if (Mt2(e3[i4]) && Mt2(t3[i4]))
            s4 += dt2(e3[i4], t3[i4], n3, o3);
          else {
            if (o3 && o3.includes(t3[i4]))
              continue;
            e3[i4] !== t3[i4] && (e3[i4] = t3[i4], s4 += 1);
          }
      return s4;
    }
    function pt2(e3, t3) {
      var n3, o3 = /* @__PURE__ */ new Map(), i4 = F2(e3.entries());
      try {
        for (i4.s(); !(n3 = i4.n()).done; ) {
          var s4 = j2(n3.value, 2), a3 = s4[0], r4 = s4[1];
          r4 && o3.set(a3, t3 ? JSON.stringify(r4) : JSON.parse(JSON.stringify(r4)));
        }
      } catch (e4) {
        i4.e(e4);
      } finally {
        i4.f();
      }
      return o3;
    }
    function _t2(e3) {
      if (0 === e3.length)
        return 0;
      for (var t3 = 0, n3 = 0, o3 = "undefined" != typeof document && void 0 !== document.characterSet ? document.characterSet : "UTF-8"; void 0 !== e3[t3]; )
        n3 += e3[t3++].charCodeAt[t3] <= 255 ? 1 : false === o3 ? 3 : 2;
      return n3;
    }
    function ht2(e3) {
      return e3 = e3 || 99999999, Math.round(Math.random() * e3);
    }
    function gt2() {
      for (var e3 = "", t3 = 32; 0 < t3; --t3)
        e3 += Tt2[Math.floor(Math.random() * Dt2)];
      return e3;
    }
    function ft2(e3, t3) {
      for (var n3 in e3)
        if (e3[n3] === t3)
          return 1;
    }
    function mt2(e3) {
      return -1 === e3.indexOf("http://") || -1 === e3.indexOf("https://") ? "https://" + e3 : e3.replace(/https|http/, "https");
    }
    function vt2(e3) {
      if (0 === Object.getOwnPropertyNames(e3).length)
        return /* @__PURE__ */ Object.create(null);
      var t3, n3, o3 = Array.isArray(e3) ? [] : /* @__PURE__ */ Object.create(null);
      for (n3 in e3)
        null !== e3[n3] ? void 0 !== e3[n3] ? (t3 = z2(e3[n3]), 0 <= ["string", "number", "function", "boolean"].indexOf(t3) ? o3[n3] = e3[n3] : o3[n3] = vt2(e3[n3])) : o3[n3] = void 0 : o3[n3] = null;
      return o3;
    }
    var It2 = ["url"], C2 = function(e3) {
      return "string" == typeof e3;
    }, N3 = function(e3) {
      return void 0 === e3;
    }, Mt2 = function(e3) {
      return O2(e3) || at2(e3);
    }, yt2 = function(e3) {
      return e3 instanceof Error;
    }, Ct2 = function(e3) {
      return Object.prototype.toString.call(e3).match(/^\[object (.*)\]$/)[1].toLowerCase();
    }, Tt2 = (Date.now || (Date.now = function() {
      return (/* @__PURE__ */ new Date()).getTime();
    }), "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), Dt2 = Tt2.length, Et2 = {};
    function Lt2(o3, e3) {
      var i4;
      return !(!O2(o3) || !O2(e3)) && (i4 = false, e3.forEach(function(e4) {
        var t3 = e4.key, e4 = e4.value, n3 = o3.find(function(e5) {
          return e5.key === t3;
        });
        n3 ? n3.value !== e4 && (n3.value = e4, i4 = true) : (o3.push({ key: t3, value: e4 }), i4 = true);
      }), i4);
    }
    function St2(e3) {
      return S2(e3) ? [] : e3.filter(function(e4) {
        return true === e4.isModified;
      });
    }
    function kt2(e3) {
      if (m2(e3) && m2(e3.webhookInfo)) {
        var t3 = [];
        if (e3.webhookInfo.disableCloudMessagePreHook && t3.push("ForbidBeforeSendMsgCallback"), e3.webhookInfo.disableCloudMessagePostHook && t3.push("ForbidAfterSendMsgCallback"), 0 !== t3.length)
          return t3;
      }
    }
    function Rt2(e3) {
      return S2(e3) ? [] : e3.filter(function(e4) {
        return false === e4.isModified;
      });
    }
    function At2(e3) {
      return e3 === R2.GRP_AVCHATROOM;
    }
    function Ot2(e3) {
      var t3 = e3.type, e3 = e3.groupID;
      return t3 === R2.GRP_COMMUNITY || "".concat(e3).startsWith("@TGS#_") && !"".concat(e3).includes(et2);
    }
    function Nt2(e3) {
      return "".concat(e3).startsWith("@TGS#_") && "".concat(e3).includes(et2);
    }
    function Gt2(e3) {
      return C2(e3) && e3.slice(0, 3) === R2.CONV_C2C;
    }
    function Pt2(e3) {
      return C2(e3) && e3.slice(0, 5) === R2.CONV_GROUP;
    }
    function Ut2(e3) {
      return C2(e3) && e3 === R2.CONV_SYSTEM;
    }
    function bt2(t3, n3) {
      var o3 = {};
      return Object.keys(t3).forEach(function(e3) {
        o3[e3] = n3(t3[e3], e3);
      }), o3;
    }
    function wt2(o3) {
      return ve2 ? Promise.resolve({ width: 0, height: 0 }) : v3 ? new Promise(function(t3, e3) {
        I2.getImageInfo({ src: o3, success: function(e4) {
          t3({ width: e4.width, height: e4.height });
        }, fail: function() {
          t3({ width: 0, height: 0 });
        } });
      }) : Le2 && 9 === Se2 ? Promise.resolve({ width: 0, height: 0 }) : new Promise(function(e3, t3) {
        var n3 = new Image();
        n3.onload = function() {
          e3({ width: this.width, height: this.height }), n3 = null;
        }, n3.onerror = function() {
          e3({ width: 0, height: 0 }), n3 = null;
        }, n3.src = o3;
      });
    }
    function Ft2() {
      function e3() {
        return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
      }
      return "".concat(e3() + e3()).concat(e3()).concat(e3()).concat(e3()).concat(e3()).concat(e3()).concat(e3());
    }
    function qt2() {
      var e3 = De2 ? "android" : Ce2 ? "ios" : ke2 ? "windows" : Re2 ? "mac" : "unknown";
      if (v3)
        try {
          var t3 = I2.getSystemInfoSync().platform;
          void 0 !== t3 && (e3 = t3);
        } catch (e4) {
        }
      return e3;
    }
    function xt2(e3, t3) {
      e3 = e3.split("."), t3 = t3.split(".");
      for (var n3 = Math.max(e3.length, t3.length); e3.length < n3; )
        e3.push("0");
      for (; t3.length < n3; )
        t3.push("0");
      for (var o3 = 0; o3 < n3; o3++) {
        var i4 = parseInt(e3[o3]), s4 = parseInt(t3[o3]);
        if (s4 < i4)
          return 1;
        if (i4 < s4)
          return -1;
      }
      return 0;
    }
    function Vt2(e3) {
      var t3 = e3.originUrl, t3 = void 0 === t3 ? void 0 : t3, n3 = e3.originWidth, o3 = e3.originHeight, e3 = e3.min, e3 = void 0 === e3 ? 198 : e3, n3 = parseInt(n3), o3 = parseInt(o3), i4 = { url: void 0, width: 0, height: 0 };
      return (n3 <= o3 ? n3 : o3) <= e3 ? (i4.url = t3, i4.width = n3, i4.height = o3) : (o3 <= n3 ? (i4.width = Math.ceil(n3 * e3 / o3), i4.height = e3) : (i4.width = e3, i4.height = Math.ceil(o3 * e3 / n3)), o3 = t3 && -1 < t3.indexOf("?") ? "".concat(t3, "&") : "".concat(t3, "?"), i4.url = "".concat(o3, 198 === e3 ? "imageView2/3/w/198/h/198" : "imageView2/3/w/720/h/720")), N3(t3) ? W2(i4, It2) : i4;
    }
    function Bt2(e3) {
      var t3 = e3[2];
      e3[2] = e3[1], e3[1] = t3;
      for (var n3 = 0; n3 < e3.length; n3++)
        e3[n3].setType(n3);
    }
    function Ht2(e3) {
      e3 = e3.servcmd;
      return e3.slice(e3.indexOf(".") + 1);
    }
    function Kt2(e3, t3) {
      return Math.round(Number(e3) * Math.pow(10, t3)) / Math.pow(10, t3);
    }
    function Wt2(e3, t3) {
      return e3.includes(t3);
    }
    function Yt2(e3, t3) {
      return e3.includes(t3);
    }
    function jt2(e3) {
      return e3.split(et2)[0];
    }
    function Jt2(e3, t3, n3) {
      if (N3(t3))
        return "";
      switch (e3) {
        case R2.MSG_TEXT:
          return t3.text;
        case R2.MSG_IMAGE:
          return n3 ? "[Image]" : "[图片]";
        case R2.MSG_LOCATION:
          return n3 ? "[Location]" : "[位置]";
        case R2.MSG_AUDIO:
          return n3 ? "[Voice]" : "[语音]";
        case R2.MSG_VIDEO:
          return n3 ? "[Video]" : "[视频]";
        case R2.MSG_FILE:
          return n3 ? "[File]" : "[文件]";
        case R2.MSG_CUSTOM:
          return n3 ? "[Custom Messages]" : "[自定义消息]";
        case R2.MSG_GRP_TIP:
          return n3 ? "[Group Notification]" : "[群提示消息]";
        case R2.MSG_GRP_SYS_NOTICE:
          return n3 ? "[Group System Message]" : "[群系统通知]";
        case R2.MSG_FACE:
          return n3 ? "[Animated Sticker]" : "[动画表情]";
        case R2.MSG_MERGER:
          return n3 ? "[Chat Record]" : "[聊天记录]";
        default:
          return "";
      }
    }
    function zt(e3) {
      return e3 === R2.MSG_TEXT || e3 === R2.MSG_CUSTOM || e3 === R2.MSG_LOCATION || e3 === R2.MSG_FACE;
    }
    function Xt2(e3) {
      var t3 = [];
      if (C2(e3)) {
        var n3 = e3.length;
        if (0 !== n3)
          for (var o3 = n3 - 1; 0 <= o3; o3--)
            "1" === e3[o3] && t3.push(Math.pow(2, n3 - o3 - 1));
      }
      return t3;
    }
    function Zt2() {
      return !Le2 && !v3;
    }
    function Qt2(e3) {
      return "the length of userIDList cannot exceed ".concat(e3);
    }
    function $t2(e3) {
      var t3;
      if (O2(e3) && 0 !== e3.length)
        return t3 = 0, e3.forEach(function(e4) {
          t3 += e4;
        }), t3.toFixed(0);
    }
    function en(e3) {
      var t3;
      if (O2(e3) && 0 !== e3.length)
        return t3 = 0, e3.forEach(function(e4) {
          t3 += e4;
        }), (t3 / e3.length).toFixed(0);
    }
    function tn(e3, t3, n3) {
      var t3 = !(1 < arguments.length && void 0 !== t3) || t3, n3 = !(2 < arguments.length && void 0 !== n3) || n3, o3 = Date.now();
      return t3 ? n3 ? "".concat(o3 - e3, " ms") : "".concat(Math.round((o3 - e3) / 1e3), " s") : n3 ? o3 - e3 : Math.round((o3 - e3) / 1e3);
    }
    function nn(e3) {
      return e3 && 1 < e3 ? true : false;
    }
    function on(e3, t3, n3, o3) {
      var i4, s4, a3;
      return void 0 === t3 || (i4 = true, t3.required && S2(e3) && (M2.e("[".concat(n3, '] Missing required params: "').concat(o3, '".')), i4 = false), S2(e3) || (s4 = Ct2(e3)) === (a3 = t3.type.toLowerCase()) || "asyncfunction" === s4 && "function" === a3 || (M2.e("[".concat(n3, '] Invalid params: type check failed for "').concat(o3, '". Expected ').concat(t3.type, ".")), i4 = false), t3.validator && !t3.validator(e3, n3, o3) && (M2.e("[".concat(n3, '] Invalid params: custom validator check failed for "').concat(o3, '".')), i4 = false), i4);
    }
    function sn(e3) {
      return !(!e3 || !(Gt2(e3) || Pt2(e3) || Ut2(e3)) && ((e3 = u2("InvalidConversationID", e3)) && M2.w(e3), 1));
    }
    function r3(e3) {
      "" !== e3.desc && "" !== u2("API_REFER") && M2.w("[".concat(e3.api, "] | ").concat(e3.paramName, " | ").concat(e3.desc, ", ").concat(u2("API_REFER")).concat(e3.api));
    }
    function an() {
      return u2("StringRequiredLog");
    }
    function rn(e3) {
      return u2("NonEmptyStringRequiredLog", e3);
    }
    function cn() {
      return u2("NumberRequiredLog");
    }
    function un() {
      return u2("UndefinedNotAllowedLog");
    }
    function ln() {
      return u2("FileRequiredLog");
    }
    function dn() {
      return u2("FunctionRequiredLog");
    }
    function pn() {
      return u2("ArrayRequiredLog");
    }
    function _n() {
      return u2("NonEmptyArrayLog");
    }
    function hn() {
      return u2("CallbackMissingLog");
    }
    function gn() {
      return u2("PositiveIntegerRequiredLog");
    }
    function fn(e3, t3) {
      return u2("StringNotLongerThanLog", e3, t3);
    }
    function mn(e3, t3) {
      return u2("NumberGreaterThanLog", e3, t3);
    }
    function vn(e3, t3) {
      return u2("NumberGreaterOrEqualLog", e3, t3);
    }
    function In(e3) {
      return u2("KeyValueStringRequiredLog", e3);
    }
    function Mn() {
      return u2("PlainObjectRequiredLog");
    }
    function yn() {
      return u2("NonEmptyContentRequiredLog");
    }
    function Cn() {
      return u2("FileNotSelectedLog");
    }
    function Tn() {
      return u2("MessageInstanceRequiredLog");
    }
    function Dn() {
      return u2("NonAnonymousFunctionLog");
    }
    function En() {
      return u2("MessageExtensionNotAvailableLog");
    }
    function Ln() {
      return u2("MessageReactionRequiredLog");
    }
    function Sn(e3, t3) {
      return u2("ContainsUnsupportedTypeLog", e3, t3);
    }
    function kn(e3, t3, n3, o3) {
      var i4 = o3.allowUndefined, s4 = o3.allowEmpty, o3 = o3.maxLength;
      return N3(e3) ? !!i4 || (r3({ api: t3, paramName: n3, desc: un() }), false) : O2(e3) ? !(0 === e3.length && (r3({ api: t3, paramName: n3, desc: _n() }), !s4) || o3 && e3.length > o3 && (r3({ api: t3, paramName: n3, desc: u2("MaximumArrayLengthLog", n3, o3) }), 1)) : (r3({ api: t3, paramName: n3, desc: pn() }), false);
    }
    function Rn(e3, t3, n3, o3) {
      var i4 = o3.allowUndefined, s4 = o3.min, o3 = o3.max;
      return N3(e3) ? !!i4 || (r3({ api: t3, paramName: n3, desc: un() }), false) : A2(e3) ? A2(s4) && e3 < s4 ? (r3({ api: t3, paramName: n3, desc: 0 === s4 ? vn(n3, s4) : mn(n3, s4 - 1) }), false) : !(A2(o3) && o3 < e3 && (r3({ api: t3, paramName: n3, desc: u2("MaximumNumberLog", n3, o3) }), 1)) : (r3({ api: t3, paramName: n3, desc: cn() }), false);
    }
    function T2(e3) {
      return { code: 0, data: e3 || {} };
    }
    function D2(e3) {
      return Promise.resolve(T2(e3));
    }
    function E2(e3) {
      var t3, n3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1];
      return e3 instanceof L2 ? (n3 && null !== Vn && Vn.emit(h2.ERROR, e3), Promise.reject(e3)) : e3 instanceof Error ? (t3 = new L2({ code: k2.UNCAUGHT_ERROR }), n3 && null !== Vn && Vn.emit(h2.ERROR, t3), Promise.reject(t3)) : N3(e3) || N3(e3.code) ? Promise.reject(new L2({ code: k2.UNCAUGHT_ERROR })) : (t3 = new L2(e3), n3 && null !== Vn && Vn.emit(h2.ERROR, t3), Promise.reject(t3));
    }
    var An = "unSend", On = "success", Nn = "fail", Gn = "notStart", Pn = "pending", Un = "resolved", bn = "rejected", n2 = { type: "String", required: true }, a2 = { type: "Array", required: true }, o2 = { type: "Object", required: true }, wn = { type: "Boolean", required: true }, c2 = { type: "number", required: true }, Fn = { keywordListForMsg: { type: "Array", required: false, validator: function(e3, t3, n3) {
      return kn(e3, t3, n3, { allowUndefined: true, allowEmpty: true, maxLength: 5 });
    } }, keywordListExceptMsg: { type: "Array", required: true, validator: function(e3, t3, n3) {
      return kn(e3, t3, n3, { allowUndefined: false, allowEmpty: false, maxLength: 5 });
    } }, keywordListMatchType: { type: "String", required: false, validator: function(e3, t3, n3) {
      return !e3 || "or" === e3 || "and" === e3 || r3({ api: t3, paramName: n3, desc: "".concat(e3, " is invalid match type") });
    } }, cursor: { type: "String", required: false }, count: { type: "Number", required: false, validator: function(e3, t3, n3) {
      return Rn(e3, t3, n3, { allowUndefined: true, min: 1, max: 100 });
    } }, groupTypeList: { type: "Array", required: false, validator: function(e3, t3, n3) {
      var o3;
      return !e3 || !(!kn(e3, t3, n3, { allowUndefined: true, allowEmpty: true }) || (o3 = [R2.GRP_PUBLIC, R2.GRP_COMMUNITY, R2.GRP_WORK, R2.GRP_MEETING], 0 < e3.filter(function(e4) {
        return -1 === o3.indexOf(e4);
      }).length && (r3({ api: t3, paramName: n3, desc: Sn(n3, "group") }), 1)));
    } } }, u2 = null, qn = { hookGetAPITips: function(e3) {
      u2 = e3;
    }, login: { userID: n2, userSig: n2 }, addToBlacklist: { userIDList: a2 }, removeFromBlacklist: { userIDList: a2 }, on: [{ name: "eventName", type: "String", validator: function(e3, t3, n3) {
      return "string" == typeof e3 && 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: rn(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e3, t3, n3) {
      return "function" != typeof e3 ? (r3({ api: t3, paramName: n3, desc: dn() }), false) : ("" === e3.name && r3({ api: t3, paramName: n3, desc: Dn() }), true);
    } }], once: [{ name: "eventName", type: "String", validator: function(e3, t3, n3) {
      return "string" == typeof e3 && 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: rn(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e3, t3, n3) {
      return "function" != typeof e3 ? (r3({ api: t3, paramName: n3, desc: dn() }), false) : ("" === e3.name && r3({ api: t3, paramName: n3, desc: Dn() }), true);
    } }], off: [{ name: "eventName", type: "String", validator: function(e3, t3, n3) {
      return "string" == typeof e3 && 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: rn(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e3, t3, n3) {
      return "function" != typeof e3 ? (r3({ api: t3, paramName: n3, desc: dn() }), false) : ("" === e3.name && r3({ api: t3, paramName: n3, desc: Dn() }), true);
    } }], sendMessage: [y2({ name: "message" }, o2)], setMessageExtensions: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return e3.status === On && true === e3.isSupportExtension || (r3({ api: t3, paramName: n3, desc: En() }), false);
    } }), y2({ name: "extensions" }, a2)], getMessageExtensions: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return e3.status === On && true === e3.isSupportExtension || (r3({ api: t3, paramName: n3, desc: En() }), false);
    } })], deleteMessageExtensions: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return e3.status === On && true === e3.isSupportExtension || (r3({ api: t3, paramName: n3, desc: En() }), false);
    } })], addMessageReaction: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return e3.status === On || (r3({ api: t3, paramName: n3, desc: Ln() }), false);
    } }), y2({ name: "reactionID" }, n2)], removeMessageReaction: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return e3.status === On || (r3({ api: t3, paramName: n3, desc: Ln() }), false);
    } }), y2({ name: "reactionID" }, n2)], getMessageReactions: { messageList: y2({}, a2) }, getAllUserListOfMessageReaction: { message: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return e3.status === On || (r3({ api: t3, paramName: n3, desc: Ln() }), false);
    } }), reactionID: y2({}, n2), nextSeq: { type: "Number" }, count: { type: "Number" } }, getMessageList: { conversationID: y2(y2({}, n2), {}, { validator: sn }), nextReqMessageID: { type: "String" }, count: { type: "Number", validator: function(e3, t3, n3) {
      return !(!N3(e3) && !/^[1-9][0-9]*$/.test(e3) && (r3({ api: t3, paramName: n3, desc: gn() }), 1));
    } } }, getMessageListHopping: { conversationID: y2(y2({}, n2), {}, { validator: sn }), sequence: { type: "Number" }, time: { type: "Number" }, direction: { type: "Number", validator: function(e3, t3, n3) {
      return !(!N3(e3) && 0 !== e3 && 1 !== e3 && (r3({ api: t3, paramName: n3, desc: u2("0Or1RequiredLog") }), 1));
    } }, count: { type: "Number", validator: function(e3, t3, n3) {
      return !(!N3(e3) && !/^[1-9][0-9]*$/.test(e3) && (r3({ api: t3, paramName: n3, desc: gn }), 1));
    } } }, setMessageRead: { conversationID: y2(y2({}, n2), {}, { validator: sn }) }, setAllMessageRead: { scope: { type: "String", required: false, validator: function(e3, t3, n3) {
      return !e3 || -1 !== [R2.READ_ALL_C2C_MSG, R2.READ_ALL_GROUP_MSG, R2.READ_ALL_MSG].indexOf(e3) || (r3({ api: t3, paramName: n3, desc: u2("ValidScopeRequired") }), false);
    } } }, getConversationProfile: [y2(y2({ name: "conversationID" }, n2), {}, { validator: sn })], clearHistoryMessage: [y2(y2({ name: "conversationID" }, n2), {}, { validator: sn })], pinConversation: { conversationID: y2(y2({}, n2), {}, { validator: sn }), isPinned: y2({}, wn) }, setConversationDraft: { conversationID: y2(y2({}, n2), {}, { validator: sn }), draftText: { type: "String", validator: function(e3, t3, n3) {
      return !!C2(e3) || (r3({ api: t3, paramName: n3, desc: an() }), false);
    } } }, setConversationCustomData: { conversationIDList: y2({}, a2), customData: { type: "String", validator: function(e3, t3, n3) {
      return C2(e3) ? !(256 < e3.length && (r3({ api: t3, paramName: n3, desc: fn(n3, 256) }), 1)) : (r3({ api: t3, paramName: n3, desc: an() }), false);
    } } }, markConversation: { conversationIDList: y2({}, a2), markType: { type: "number", validator: function(e3, t3, n3) {
      return A2(e3) ? e3 <= 0 ? (r3({ api: t3, paramName: n3, desc: mn(n3, 0) }), false) : !(e3 >= Math.pow(2, 64) && (r3({ api: t3, paramName: n3, desc: u2("NumberLessThanLog", n3, "Math.pow(2,64)") }), 1)) : (r3({ api: t3, paramName: n3, desc: cn() }), false);
    } }, enableMark: y2({}, wn) }, createConversationGroup: { conversationIDList: y2({}, a2), groupName: y2(y2({}, n2), {}, { validator: function(e3, t3, n3) {
      return !(!e3 || 32 < e3.length && (r3({ api: t3, paramName: n3, desc: fn(n3, 32) }), 1));
    } }) }, deleteConversationGroup: [y2({ name: "groupName" }, n2)], renameConversationGroup: { oldName: y2({}, n2), newName: y2(y2({}, n2), {}, { validator: function(e3, t3, n3) {
      return !(!e3 || 32 < e3.length && (r3({ api: t3, paramName: n3, desc: fn(n3, 32) }), 1));
    } }) }, addConversationsToGroup: { conversationIDList: y2({}, a2), groupName: y2({}, n2) }, deleteConversationsFromGroup: { conversationIDList: y2({}, a2), groupName: y2({}, n2) }, getGroupList: { groupProfileFilter: { type: "Array" } }, getGroupProfile: { groupID: n2, groupCustomFieldFilter: { type: "Array" }, memberCustomFieldFilter: { type: "Array" } }, getGroupProfileAdvance: { groupIDList: a2 }, createGroup: { name: n2 }, joinGroup: { groupID: n2, type: { type: "String" }, applyMessage: { type: "String" } }, quitGroup: [y2({ name: "groupID" }, n2)], handleApplication: { message: o2, handleAction: n2, handleMessage: { type: "String" } }, changeGroupOwner: { groupID: n2, newOwnerID: n2 }, updateGroupProfile: { groupID: n2, muteAllMembers: { type: "Boolean" } }, dismissGroup: [y2({ name: "groupID" }, n2)], searchGroupByID: [y2({ name: "groupID" }, n2)], getGroupOnlineMemberCount: [y2({ name: "groupID" }, n2)], initGroupAttributes: { groupID: n2, groupAttributes: y2(y2({}, o2), {}, { validator: function(t3, n3, o3) {
      var i4 = true;
      return Object.keys(t3).forEach(function(e3) {
        if (!C2(t3[e3]))
          return r3({ api: n3, paramName: o3, desc: In("value") }), i4 = false;
      }), i4;
    } }) }, setGroupAttributes: { groupID: n2, groupAttributes: y2(y2({}, o2), {}, { validator: function(t3, n3, o3) {
      var i4 = true;
      return Object.keys(t3).forEach(function(e3) {
        if (!C2(t3[e3]))
          return r3({ api: n3, paramName: o3, desc: In("value") }), i4 = false;
      }), i4;
    } }) }, deleteGroupAttributes: { groupID: n2, keyList: { type: "Array", validator: function(e3, t3, n3) {
      var o3;
      return N3(e3) || !O2(e3) ? (r3({ api: t3, paramName: n3, desc: pn() }), false) : !!S2(e3) || (o3 = true, e3.forEach(function(e4) {
        if (!C2(e4))
          return r3({ api: t3, paramName: n3, desc: u2("StringArrayRequiredLog") }), o3 = false;
      }), o3);
    } } }, getGroupAttributes: { groupID: n2, keyList: { type: "Array", validator: function(e3, t3, n3) {
      var o3;
      return N3(e3) || !O2(e3) ? (r3({ api: t3, paramName: n3, desc: pn() }), false) : !!S2(e3) || (o3 = true, e3.forEach(function(e4) {
        if (!C2(e4))
          return r3({ api: t3, paramName: n3, desc: In("key") }), o3 = false;
      }), o3);
    } } }, setGroupCounters: { groupID: n2, counters: o2 }, increaseGroupCounter: { groupID: n2, key: n2, value: c2 }, decreaseGroupCounter: { groupID: n2, key: n2, value: c2 }, getGroupCounters: { groupID: n2 }, getGroupMemberList: { groupID: n2, count: { type: "Number" } }, getGroupMemberProfile: { groupID: n2, userIDList: a2, memberCustomFieldFilter: { type: "Array" } }, addGroupMember: { groupID: n2, userIDList: a2 }, setGroupMemberRole: { groupID: n2, userID: n2, role: n2 }, setGroupMemberMuteTime: { groupID: n2, userID: n2, muteTime: { type: "Number", validator: function(e3) {
      return 0 <= e3;
    } } }, setGroupMemberNameCard: { groupID: n2, userID: { type: "String" }, nameCard: { type: "String", validator: function(e3, t3, n3) {
      return C2(e3) ? (e3.length, true) : (r3({ api: t3, paramName: n3, desc: an() }), false);
    } } }, setGroupMemberCustomField: { groupID: n2, userID: { type: "String" }, memberCustomField: a2 }, deleteGroupMember: { groupID: n2 }, markGroupMemberList: { groupID: n2, markType: { type: "number", validator: function(e3, t3, n3) {
      return A2(e3) ? !(e3 < 1e3 && (r3({ api: t3, paramName: n3, desc: vn(n3, 1e3) }), 1)) : (r3({ api: t3, paramName: n3, desc: cn() }), false);
    } }, userIDList: y2({}, a2), enableMark: y2({}, wn) }, createTextMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return m2(e3) ? C2(e3.text) ? 0 !== e3.text.length || (r3({ api: t3, paramName: "payload.text", desc: yn() }), false) : (r3({ api: t3, paramName: "payload.text", desc: an() }), false) : (r3({ api: t3, paramName: n3, desc: Mn() }), false);
    } }) }, createTextAtMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return m2(e3) ? C2(e3.text) ? 0 === e3.text.length ? (r3({ api: t3, paramName: "payload.text", desc: yn() }), false) : !(e3.atUserList && !O2(e3.atUserList) && (r3({ api: t3, paramName: "payload.atUserList", desc: pn() }), 1)) : (r3({ api: t3, paramName: "payload.text", desc: an() }), false) : (r3({ api: t3, paramName: n3, desc: Mn() }), false);
    } }) }, createCustomMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return m2(e3) ? e3.data && !C2(e3.data) ? (r3({ api: t3, paramName: "payload.data", desc: an() }), false) : e3.description && !C2(e3.description) ? (r3({ api: t3, paramName: "payload.description", desc: an() }), false) : !(e3.extension && !C2(e3.extension) && (r3({ api: t3, paramName: "payload.extension", desc: an() }), 1)) : (r3({ api: t3, paramName: "payload", desc: Mn() }), false);
    } }) }, createImageMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      if (!m2(e3))
        return r3({ api: t3, paramName: n3, desc: Mn() }), false;
      if (N3(e3.file))
        return r3({ api: t3, paramName: "payload.file", desc: un() }), false;
      if (Ie2) {
        if (!(e3.file instanceof HTMLInputElement || st2(e3.file)))
          return m2(e3.file) && "undefined" != typeof index ? 0 !== e3.file.tempFilePaths.length && 0 !== e3.file.tempFiles.length || (r3({ api: t3, paramName: "payload.file", desc: Cn() }), false) : (r3({ api: t3, paramName: "payload.file", desc: ln() }), false);
        if (e3.file instanceof HTMLInputElement && 0 === e3.file.files.length)
          return r3({ api: t3, paramName: "payload.file", desc: Cn() }), false;
      }
      return true;
    }, onProgress: { type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: hn() }), true;
    } } }) }, createAudioMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return !!m2(e3) || (r3({ api: t3, paramName: n3, desc: Mn() }), false);
    } }), onProgress: { type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: hn() }), true;
    } } }, createVideoMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      if (!m2(e3))
        return r3({ api: t3, paramName: n3, desc: Mn() }), false;
      if (N3(e3.file))
        return r3({ api: t3, paramName: "payload.file", desc: un() }), false;
      if (Ie2) {
        if (!(e3.file instanceof HTMLInputElement || st2(e3.file)))
          return m2(e3.file) && "undefined" != typeof index ? !!st2(e3.file.tempFile) || (r3({ api: t3, paramName: "payload.file", desc: Cn() }), false) : (r3({ api: t3, paramName: "payload.file", desc: ln() }), false);
        if (e3.file instanceof HTMLInputElement && 0 === e3.file.files.length)
          return r3({ api: t3, paramName: "payload.file", desc: Cn() }), false;
      }
      return true;
    } }), onProgress: { type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: hn() }), true;
    } } }, createFaceMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return m2(e3) ? A2(e3.index) ? !!C2(e3.data) || (r3({ api: t3, paramName: "payload.data", desc: an() }), false) : (r3({ api: t3, paramName: "payload.index", desc: cn() }), false) : (r3({ api: t3, paramName: n3, desc: Mn() }), false);
    } }) }, createFileMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      if (!m2(e3))
        return r3({ api: t3, paramName: n3, desc: Mn() }), false;
      if (N3(e3.file))
        return r3({ api: t3, paramName: "payload.file", desc: un() }), false;
      if (Ie2) {
        if (!(e3.file instanceof HTMLInputElement || st2(e3.file)))
          return m2(e3.file) && "undefined" != typeof index ? 0 !== e3.file.tempFilePaths.length && 0 !== e3.file.tempFiles.length || (r3({ api: t3, paramName: "payload.file", desc: Cn() }), false) : (r3({ api: t3, paramName: "payload.file", desc: ln() }), false);
        if (e3.file instanceof HTMLInputElement && 0 === e3.file.files.length)
          return r3({ api: t3, paramName: "payload.file", desc: Cn() }), false;
      }
      return true;
    } }), onProgress: { type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: hn() }), true;
    } } }, createLocationMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return m2(e3) ? C2(e3.description) ? A2(e3.longitude) ? !!A2(e3.latitude) || (r3({ api: t3, paramName: "payload.latitude", desc: cn() }), false) : (r3({ api: t3, paramName: "payload.longitude", desc: cn() }), false) : (r3({ api: t3, paramName: "payload.description", desc: an() }), false) : (r3({ api: t3, paramName: n3, desc: Mn() }), false);
    } }) }, createMergerMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      var o3;
      return S2(e3.messageList) ? (r3({ api: t3, paramName: "payload.messageList", desc: _n() }), false) : S2(e3.compatibleText) ? (r3({ api: t3, paramName: "payload.compatibleText", desc: rn("compatibleText") }), false) : (o3 = false, e3.messageList.forEach(function(e4) {
        e4.status === Nn && (o3 = true);
      }), !o3 || (r3({ api: t3, paramName: "payload.messageList", desc: u2("MergeFailedMessageLog") }), false));
    } }) }, revokeMessage: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return S2(e3) ? (r3({ api: t3, paramName: n3, desc: Tn() }), false) : e3.conversationType === R2.CONV_SYSTEM ? (r3({ api: t3, paramName: n3, desc: u2("MessageCanBeRevokedDesc") }), false) : true !== e3.isRevoked || (r3({ api: t3, paramName: n3, desc: u2("MessageRevokedLog") }), false);
    } })], deleteMessage: [y2(y2({ name: "messageList" }, a2), {}, { validator: function(e3, t3, n3) {
      return !S2(e3) || (r3({ api: t3, paramName: n3, desc: _n() }), false);
    } })], translateText: { sourceTextList: a2, sourceLanguage: n2, targetLanguage: n2 }, convertVoiceToText: { message: y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return S2(e3) ? (r3({ api: t3, paramName: n3, desc: Tn() }), false) : e3.type === R2.MSG_AUDIO && e3.status === On || (r3({ api: t3, paramName: n3, desc: u2("AudioMessageRequiredLog") }), false);
    } }) }, modifyMessage: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return S2(e3) ? (r3({ api: t3, paramName: n3, desc: Tn() }), false) : e3.conversationType === R2.CONV_SYSTEM ? (r3({ api: t3, paramName: n3, desc: u2("MessageCanBeModifiedLog") }), false) : true !== e3._onlineOnlyFlag || (r3({ api: t3, paramName: n3, desc: u2("OnlineMessageNotSupportLog") }), false);
    } })], searchCloudMessages: { keywordList: Fn.keywordListForMsg, keywordListMatchType: Fn.keywordListMatchType, cursor: Fn.cursor, senderUserIDList: { type: "Array", required: false, validator: function(e3, t3, n3) {
      return kn(e3, t3, n3, { allowUndefined: true, allowEmpty: true, maxLength: 5 });
    } }, messageTypeList: { type: "Array", required: false, validator: function(e3, t3, n3) {
      var o3;
      return !e3 || !(!kn(e3, t3, n3, { allowUndefined: true, allowEmpty: true }) || (o3 = [R2.MSG_TEXT, R2.MSG_IMAGE, R2.MSG_AUDIO, R2.MSG_FILE, R2.MSG_VIDEO, R2.MSG_LOCATION, R2.MSG_CUSTOM, R2.MSG_MERGER], 0 < e3.filter(function(e4) {
        return -1 === o3.indexOf(e4);
      }).length && (r3({ api: t3, paramName: n3, desc: Sn(n3, "message") }), 1)));
    } }, conversationID: { type: "String", required: false, validator: function(e3) {
      return !e3 || sn(e3);
    } }, timePosition: { type: "number", required: false, validator: function(e3, t3, n3) {
      return Rn(e3, t3, n3, { allowUndefined: true, min: 0 });
    } }, timePeriod: { type: "number", required: false, validator: function(e3, t3, n3) {
      return Rn(e3, t3, n3, { allowUndefined: true, min: 0 });
    } } }, searchCloudUsers: { keywordList: Fn.keywordListExceptMsg, keywordListMatchType: Fn.keywordListMatchType, cursor: Fn.cursor, count: Fn.count, miniBirthday: { type: "Number", required: false, validator: function(e3, t3, n3) {
      return Rn(e3, t3, n3, { allowUndefined: true, min: 0 });
    } }, maxBirthday: { type: "Number", required: false, validator: function(e3, t3, n3) {
      return Rn(e3, t3, n3, { allowUndefined: true, min: 0 });
    } }, gender: { type: "String", required: false, validator: function(e3, t3, n3) {
      return !e3 || e3 === R2.GENDER_FEMALE || e3 === R2.GENDER_MALE || r3({ api: t3, paramName: n3, desc: "".concat(e3, " is invalid match type") });
    } } }, searchCloudGroups: { keywordList: Fn.keywordListExceptMsg, keywordListMatchType: Fn.keywordListMatchType, cursor: Fn.cursor, count: Fn.count, groupTypeList: Fn.groupTypeList }, searchCloudGroupMembers: { keywordList: Fn.keywordListExceptMsg, keywordListMatchType: Fn.keywordListMatchType, cursor: Fn.cursor, count: Fn.count, groupTypeList: Fn.groupTypeList, groupIDList: { type: "Array", required: false, validator: function(e3, t3, n3) {
      return kn(e3, t3, n3, { allowUndefined: true, allowEmpty: true });
    } } }, getUserProfile: { userIDList: { type: "Array", validator: function(e3, t3, n3) {
      return O2(e3) ? (0 === e3.length && r3({ api: t3, paramName: n3, desc: _n() }), true) : (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } } }, updateMyProfile: { profileCustomField: { type: "Array", validator: function(e3, t3, n3) {
      return !!N3(e3) || !!O2(e3) || (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } } }, setSelfStatus: { customStatus: { type: "String", validator: function(e3, t3, n3) {
      return !!C2(e3) || (r3({ api: t3, paramName: n3, desc: an() }), false);
    } } }, getUserStatus: { userIDList: { type: "Array", validator: function(e3, t3, n3) {
      return O2(e3) ? 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: _n() }), false) : (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } } }, subscribeUserStatus: { userIDList: { type: "Array", validator: function(e3, t3, n3) {
      return O2(e3) ? 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: _n() }), false) : (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } } }, unsubscribeUserStatus: { userIDList: { type: "Array", validator: function(e3, t3, n3) {
      return !e3 || !!O2(e3) || (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } } }, addFriend: { to: n2, source: { type: "String", required: true, validator: function(e3, t3, n3) {
      return !(!e3 || (e3.startsWith("AddSource_Type_") ? 8 < e3.replace("AddSource_Type_", "").length && (r3({ api: t3, paramName: n3, desc: fn("keyword", 8) }), 1) : (r3({ api: t3, paramName: n3, desc: u2("SourcePrefixLog") }), 1)));
    } }, remark: { type: "String", required: false, validator: function(e3, t3, n3) {
      return !(C2(e3) && 96 < e3.length && (r3({ api: t3, paramName: n3, desc: fn(n3, 96) }), 1));
    } } }, deleteFriend: { userIDList: a2 }, checkFriend: { userIDList: a2 }, getFriendProfile: { userIDList: a2 }, updateFriend: { userID: n2, remark: { type: "String", required: false, validator: function(e3, t3, n3) {
      return !(C2(e3) && 96 < e3.length && (r3({ api: t3, paramName: n3, desc: fn(n3, 96) }), 1));
    } }, friendCustomField: { type: "Array", required: false, validator: function(e3, t3, n3) {
      var o3;
      return !e3 || (O2(e3) ? (o3 = true, e3.forEach(function(e4) {
        return C2(e4.key) && -1 !== e4.key.indexOf("Tag_SNS_Custom") ? C2(e4.value) ? 8 < e4.key.replace("Tag_SNS_Custom_", "").length ? (r3({ api: t3, paramName: n3, desc: fn("keyword", 8) }), o3 = false) : void 0 : (r3({ api: t3, paramName: n3, desc: In("value") }), o3 = false) : (r3({ api: t3, paramName: n3, desc: u2("FriendCustomFieldPrefixLog") }), o3 = false);
      }), o3) : (r3({ api: t3, paramName: n3, desc: pn() }), false));
    } } }, acceptFriendApplication: { userID: n2 }, refuseFriendApplication: { userID: n2 }, deleteFriendApplication: { userID: n2 }, createFriendGroup: { name: n2 }, deleteFriendGroup: { name: n2 }, addToFriendGroup: { name: n2, userIDList: a2 }, removeFromFriendGroup: { name: n2, userIDList: a2 }, renameFriendGroup: { oldName: n2, newName: n2 }, sendMessageReadReceipt: [{ name: "messageList", type: "Array", validator: function(e3, t3, n3) {
      return O2(e3) ? 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: _n() }), false) : (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } }], getMessageReadReceiptList: [{ name: "messageList", type: "Array", validator: function(e3, t3, n3) {
      return O2(e3) ? 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: _n() }), false) : (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } }], createTopicInCommunity: { groupID: n2, topicName: n2 }, deleteTopicFromCommunity: { groupID: n2, topicIDList: { type: "Array", validator: function(e3, t3, n3) {
      return !e3 || !!O2(e3) || (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } } }, updateTopicProfile: { groupID: n2, topicID: n2 }, getTopicList: { groupID: n2, topicIDList: { type: "Array", validator: function(e3, t3, n3) {
      return !e3 || !!O2(e3) || (r3({ api: t3, paramName: n3, desc: pn() }), false);
    } } }, followUser: [y2({ name: "userIDList" }, a2)], unfollowUser: [y2({ name: "userIDList" }, a2)], getMyFollowingList: [y2(y2({ name: "startIndex" }, n2), {}, { required: false })], getMyFollowersList: [y2(y2({ name: "startIndex" }, n2), {}, { required: false })], getMutualFollowersList: [y2(y2({ name: "startIndex" }, n2), {}, { required: false })], getUserFollowInfo: [y2(y2({ name: "userIDList" }, a2), {}, { required: false })], checkFollowType: [y2({ name: "userIDList" }, a2)], addSignalingListener: [{ name: "eventName", type: "String", validator: function(e3, t3, n3) {
      return "string" == typeof e3 && 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: rn(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e3, t3, n3) {
      return "function" != typeof e3 ? (r3({ api: t3, paramName: n3, desc: dn() }), false) : ("" === e3.name && r3({ api: t3, paramName: n3, desc: Dn() }), true);
    } }], removeSignalingListener: [{ name: "eventName", type: "String", validator: function(e3, t3, n3) {
      return "string" == typeof e3 && 0 !== e3.length || (r3({ api: t3, paramName: n3, desc: rn(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e3, t3, n3) {
      return "function" != typeof e3 ? (r3({ api: t3, paramName: n3, desc: dn() }), false) : ("" === e3.name && r3({ api: t3, paramName: n3, desc: Dn() }), true);
    } }], invite: { userID: n2 }, inviteSync: [y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return m2(e3) ? !!C2(e3.userID) || (r3({ api: t3, paramName: "options.userID", desc: an() }), false) : (r3({ api: t3, paramName: "options", desc: Mn() }), false);
    } }), { name: "successCb", type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: dn() }), true;
    } }, { name: "errorCb", type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: dn() }), true;
    } }], inviteInGroup: { groupID: n2, inviteeList: a2 }, inviteInGroupSync: [y2(y2({}, o2), {}, { validator: function(e3, t3, n3) {
      return m2(e3) ? C2(e3.groupID) ? !!O2(e3.inviteeList) || (r3({ api: t3, paramName: "options.inviteeList", desc: pn() }), false) : (r3({ api: t3, paramName: "options.groupID", desc: an() }), false) : (r3({ api: t3, paramName: "options", desc: Mn() }), false);
    } }), { name: "successCb", type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: dn() }), true;
    } }, { name: "errorCb", type: "Function", required: false, validator: function(e3, t3, n3) {
      return N3(e3) && r3({ api: t3, paramName: n3, desc: dn() }), true;
    } }], accept: { inviteID: n2 }, reject: { inviteID: n2 }, getSignalingInfo: [y2(y2({ name: "message" }, o2), {}, { validator: function(e3, t3, n3) {
      return !S2(e3) || (r3({ api: t3, paramName: n3, desc: Tn() }), false);
    } })], modifyInvitation: { inviteID: n2, data: n2 } }, xn = { login: 1, logout: 1, getLoginUser: 1, getServerTime: 1, on: 1, once: 1, off: 1, setLogLevel: 1, registerPlugin: 1, destroy: 1, isReady: 1, createTextMessage: 1, createTextAtMessage: 1, createImageMessage: 1, createAudioMessage: 1, createVideoMessage: 1, createCustomMessage: 1, createFaceMessage: 1, createFileMessage: 1, createLocationMessage: 1, createMergerMessage: 1, downloadMergerMessage: 1, createForwardMessage: 1, sendMessage: 1, resendMessage: 1, revokeMessage: 1, deleteMessage: 1, translateText: 1, convertVoiceToText: 1, modifyMessage: 1, sendMessageReadReceipt: 1, getGroupMessageReadMemberList: 1, getMessageReadReceiptList: 1, setMessageExtensions: 1, getMessageExtensions: 1, deleteMessageExtensions: 1, addMessageReaction: 1, removeMessageReaction: 1, getMessageReactions: 1, getAllUserListOfMessageReaction: 1, getMessageList: 1, findMessage: 1, getMessageListHopping: 1, setMessageRead: 1, setAllMessageRead: 1, getConversationList: 1, getConversationProfile: 1, deleteConversation: 1, setConversationDraft: 1, pinConversation: 1, getTotalUnreadMessageCount: 1, setConversationCustomData: 1, markConversation: 1, createConversationGroup: 1, getConversationGroupList: 1, deleteConversationGroup: 1, renameConversationGroup: 1, addConversationsToGroup: 1, deleteConversationsFromGroup: 1, clearHistoryMessage: 1, setMessageRemindType: 1, setAllReceiveMessageOpt: 1, getAllReceiveMessageOpt: 1, getGroupList: 1, getGroupProfile: 1, createGroup: 1, joinGroup: 1, updateGroupProfile: 1, quitGroup: 1, dismissGroup: 1, changeGroupOwner: 1, searchGroupByID: 1, getGroupApplicationList: 1, handleGroupApplication: 1, initGroupAttributes: 1, setGroupAttributes: 1, deleteGroupAttributes: 1, getGroupAttributes: 1, setGroupCounters: 1, increaseGroupCounter: 1, decreaseGroupCounter: 1, getGroupCounters: 1, getJoinedCommunityList: 1, createTopicInCommunity: 1, deleteTopicFromCommunity: 1, updateTopicProfile: 1, getTopicList: 1, getGroupMemberProfile: 1, getGroupMemberList: 1, addGroupMember: 1, deleteGroupMember: 1, setGroupMemberNameCard: 1, setGroupMemberMuteTime: 1, setGroupMemberRole: 1, setGroupMemberCustomField: 1, getGroupOnlineMemberCount: 1, markGroupMemberList: 1, getMyProfile: 1, getUserProfile: 1, updateMyProfile: 1, setSelfStatus: 1, getUserStatus: 1, subscribeUserStatus: 1, unsubscribeUserStatus: 1, getBlacklist: 1, addToBlacklist: 1, removeFromBlacklist: 1, searchCloudMessages: 1, searchCloudUsers: 1, searchCloudGroups: 1, searchCloudGroupMembers: 1, getFriendList: 1, addFriend: 1, deleteFriend: 1, checkFriend: 1, updateFriend: 1, getFriendProfile: 1, getFriendApplicationList: 1, refuseFriendApplication: 1, deleteFriendApplication: 1, acceptFriendApplication: 1, setFriendApplicationRead: 1, getFriendGroupList: 1, createFriendGroup: 1, renameFriendGroup: 1, deleteFriendGroup: 1, addToFriendGroup: 1, removeFromFriendGroup: 1, followUser: 1, unfollowUser: 1, getMyFollowingList: 1, getMyFollowersList: 1, getMutualFollowersList: 1, getUserFollowInfo: 1, checkFollowType: 1, callExperimentalAPI: 1, addSignalingListener: 1, removeSignalingListener: 1, invite: 1, inviteSync: 1, inviteInGroup: 1, inviteInGroupSync: 1, cancel: 1, accept: 1, reject: 1, getSignalingInfo: 1, modifyInvitation: 1 }, L2 = (t2(io, Z2(Error)), e2(io)), k2 = { NO_SDKAPPID: 2e3, NO_ACCOUNT_TYPE: 2001, NO_IDENTIFIER: 2002, NO_USERSIG: 2003, NO_TINYID: 2022, NO_A2KEY: 2023, USER_NOT_LOGGED_IN: 2024, REPEAT_LOGIN: 2025, COS_UNDETECTED: 2040, COS_GET_SIG_FAIL: 2041, MSG_SEND_FAIL: 2100, MSG_SEND_FAIL_NOT_IN_AV: 2101, MSG_INSTANCE_REQUIRED: 2105, MSG_INVALID_CONV_TYPE: 2106, MSG_F_IS_EMPTY: 2108, MSG_ONPROGRESS_ERR: 2109, MSG_REVOKE_FAIL: 2110, MSG_DELETE_FAIL: 2111, MSG_UNREAD_ALL_FAIL: 2112, READ_RECEIPT_MSG_LIST_EMPTY: 2114, MSG_SEND_GRP_WITH_TOPIC_FAIL: 2115, CANNOT_DELETE_GRP_SYSTEM_NOTICE: 2116, TRANSLATE_TEXT_FAIL: 2117, VOICE_TO_TEXT_FAIL: 2118, UNSUPPORTED_VOICE_FORMAT: 2119, MSG_I_SELECT_F_FIRST: 2251, MSG_I_TYPES_LIMIT: 2252, MSG_I_SIZE_LIMIT: 2253, MSG_A_UPLOAD_FAIL: 2300, MSG_A_SIZE_LIMIT: 2301, MSG_V_UPLOAD_FAIL: 2350, MSG_V_SIZE_LIMIT: 2351, MSG_V_TYPES_LIMIT: 2352, MSG_F_UPLOAD_FAIL: 2400, MSG_F_SELECT_F_FIRST: 2401, MSG_F_SIZE_LIMIT: 2402, MSG_F_URL_IS_EMPTY: 2403, MSG_MERGER_TYPE_INVALID: 2450, MSG_MERGER_KEY_INVALID: 2451, MSG_MERGER_DOWNLOAD_FAIL: 2452, MSG_FORWARD_TYPE_INVALID: 2453, MSG_FORWARD_INVALID_ELEMENTS: 2454, MSG_MODIFY_CONFLICT: 2480, MSG_MODIFY_DISABLED_IN_AV: 2481, CONV_NOT_FOUND: 2500, USER_OR_GRP_NOT_FOUND: 2501, CONV_UN_RECORDED_TYPE: 2502, INVALID_CONV_ID: 2503, ILLEGAL_GRP_TYPE: 2600, ILLEGAL_GRP_ID: 2602, CANNOT_FIND_GRP: 2603, CANNOT_CHANGE_OWNER_IN_AV: 2620, CANNOT_CHANGE_OWNER_TO_SELF: 2621, MEMBER_NOT_IN_GRP: 2623, JOIN_GRP_FAIL: 2660, CANNOT_ADD_MEMBER_IN_AV: 2661, CANNOT_JOIN_NON_AV_WITHOUT_LOGIN: 2662, NOT_OWNER: 2681, INVALID_MEMBER_ROLE: 2683, CANNOT_SET_SELF_MEMBER_ROLE: 2684, CANNOT_MUTE_SELF: 2685, BAN_DURATION_INVALID: 2686, OPERATION_NOT_SUPPORTED_IN_AV: 2687, NOT_MY_FRIEND: 2700, ALREADY_MY_FRIEND: 2701, FRIEND_GRP_EXISTED: 2710, FRIEND_GRP_NOT_EXIST: 2711, FRIEND_APPLICATION_NOT_EXIST: 2716, UPDATE_PROFILE_INVALID_PARAM: 2721, UPDATE_PROFILE_NO_KEY: 2722, CANNOT_ADD_SELF_TO_BLACKLIST: 2742, NETWORK_ERROR: 2800, NETWORK_TIMEOUT: 2801, NO_NETWORK: 2805, UNCAUGHT_ERROR: 2903, INVALID_OPERATION: 2905, INVALID_TRTC_CMD: 2995, OVER_FREQUENCY_LIMIT: 2996, NO_PROTOCOL: 2997, NO_MODULE: 2998, SDK_IS_NOT_READY: 2999, LOGGING_IN: 3e3, LOGIN_FAILED: 3001, KICKED_OUT_MULT_DEVICE: 3002, KICKED_OUT_MULT_ACCOUNT: 3003, KICKED_OUT_USERSIG_EXPIRED: 3004, LOGGED_OUT: 3005, KICKED_OUT_REST_API: 3006, ILLEGAL_TOPIC_ID: 3021, NO_USE: 3122, PROFANITY_FOUND: 3123, OPTIONS_IS_EMPTY: 3153, MSG_A2KEY_EXPIRED: 20002, ACCOUNT_A2KEY_EXPIRED: 70001, HELLO_ANSWER_KICKED_OUT: 1002, OPEN_SERVICE_OVERLOAD_ERROR: 60022, SIGNALING_INVALID_INVITE_ID: 8010, SIGNALING_NO_PERMISSION: 8011, SIGNALING_ALREADY_EXISTS: 8012, INVALID_CANCEL_MESSAGE: 8020 }, Vn = null, c2 = e2(function e3(t3) {
      p3(this, e3), this._m = t3, this._n = "";
    }, [{ key: "isLoggedIn", value: function() {
      return this._m.get(12).isLoggedIn();
    } }, { key: "isOversea", value: function() {
      return this._m.get(12).isOversea();
    } }, { key: "isPrivateNetWork", value: function() {
      var e3 = this._m.get(12);
      return e3.isPrivateNetWork() && !e3.getFileDownloadProxy();
    } }, { key: "getFileDownloadProxy", value: function() {
      return this._m.get(12).getFileDownloadProxy();
    } }, { key: "getDownloadFileAuthKey", value: function() {
      return this._m.get(12).getDownloadFileAuthKey();
    } }, { key: "getMyUserID", value: function() {
      return this._m.get(12).getUserID();
    } }, { key: "getMyTinyID", value: function() {
      return this._m.get(12).getTinyID();
    } }, { key: "getSDKAppID", value: function() {
      return this._m.get(12).getSDKAppID();
    } }, { key: "isIntl", value: function() {
      return this._m.get(12).isIntl();
    } }, { key: "isUsingChatCore", value: function() {
      return this._m.get(12).isUsingChatCore();
    } }, { key: "isDevMode", value: function() {
      return this._m.get(12).isDevMode();
    } }, { key: "get", value: function(e3) {
      return this._m.get(e3);
    } }, { key: "getPlatform", value: function() {
      return ye2;
    } }, { key: "getCloudConfig", value: function(e3) {
      return this._m.get(23).getCloudConfig(e3);
    } }, { key: "emitOEvt", value: function(e3, t3) {
      this._m.getOEmitInst().emit(e3, t3);
    } }, { key: "emitIEvt", value: function(e3, t3) {
      this._m.getIEmitInst().emit(e3, t3);
    } }, { key: "getIEmitInst", value: function() {
      return this._m.getIEmitInst();
    } }, { key: "req", value: function(e3) {
      return this._m.get(20).req(e3);
    } }, { key: "canIUse", value: function(e3) {
      return this._m.get(27).canIUse(e3);
    } }, { key: "getErrMsg", value: function(e3, t3, n3) {
      return this._m.getErrMsg(e3, t3, n3);
    } }, { key: "warn", value: function(e3, t3, n3) {
      e3 = this.getErrMsg(e3, t3, n3);
      e3 && M2.w(e3);
    } }, { key: "noUse", value: function(e3) {
      var t3 = k2.NO_USE;
      return E2({ code: t3, message: this.getErrMsg(t3, e3) });
    } }]), G2 = { LOGIN: "wslogin", LOGOUT: "wslogout", HELLO: "wshello", KICK_OTHER: "KickOther", SYNC_UNREAD_MSG: "getmsg", SEND_C2C_MSG: "sendmsg", SEND_GRP_MSG: "send_group_msg", GET_USER_PROFILE: "portrait_get_all", UPDATE_MY_PROFILE: "portrait_set", GET_BL: "black_list_get", ADD_TO_BL: "black_list_add", RM_FROM_BL: "black_list_delete", GET_FD_LIST: "friend_get", GET_FD_PROFILE: "friend_get_specified", CHECK_FD: "friend_check", DEL_FD: "friend_delete", ADD_FD: "friend_add", UPDATE_FD: "friend_update", RESPOND_FD_APPLICATION: "friend_response", GET_FD_APPLICATION_LIST: "pendency_get", DEL_FD_APPLICATION: "pendency_delete", REFUSE_FD_APPLICATION: "pendency_refuse", REPORT_FD_APPLICATION: "pendency_report", GET_FD_GRP_LIST: "group_get", CREATE_FD_GRP: "group_add", DEL_FD_GRP: "group_delete", UPDATE_FD_GRP: "group_update", REVOKE_C2C_MSG: "msgwithdraw", SET_C2C_MSG_READ: "msgreaded", SET_C2C_PEER_MUTE_NOTIFICATIONS: "set_c2c_peer_mute_notifications", GET_C2C_PEER_MUTE_NOTIFICATIONS: "get_c2c_peer_mute_notifications", GET_C2C_ROAMING_MSG: "getroammsg", GET_C2C_PEER_READ_TIME: "get_peer_read_time", DEL_C2C_MSG: "delete_c2c_msg_ramble", MODIFY_C2C_MSG: "modify_c2c_msg", MODIFY_C2C_MSG_EXT: "set_key_values", GET_C2C_MSG_EXT: "get_key_values", ADD_C2C_MSG_REACTION: "reaction_add", RM_C2C_MSG_REACTION: "reaction_del", GET_C2C_MSG_REACTIONS: "reaction_multi_stat", GET_C2C_MSG_REACTION_USER_LIST: "reaction_iterate", PAGING_GET_CONV_LIST: "page_get", DEL_CONV: "batch_delete", CLEAR_HISTORY_MSG: "clear_msg", PIN_CONV: "top", DEL_GROUP_AT_TIPS: "deletemsg", SET_CONV_CUSTOM_DATA: "set_conv_custom_data", MARK_CONV: "mark_contact", CREATE_CONV_GRP: "create_contact_group", DEL_CONV_GRP: "del_contact_group", RENAME_CONV_GRP: "update_contact_group", ADD_CONV_TO_GRP: "add_conv_to_group", DEL_CONV_FROM_GRP: "del_conv_from_group", GET_CONV_GRP_LIST: "get_contact_group", SEARCH_CONV_GRP_MARK: "search_contact_group", GET_GRP_LIST: "get_joined_group_list", GET_GRP_PROFILE: "get_group_self_member_info", CREATE_GRP: "create_group", DISMISS_GRP: "destroy_group", UPDATE_GRP_PROFILE: "modify_group_base_info", APPLY_JOIN_GRP: "apply_join_group", APPLY_JOIN_GRP_NOAUTH: "apply_join_group_noauth", QUIT_GRP: "quit_group", SEARCH_GRP: "get_group_public_info", CHANGE_GRP_OWNER: "change_group_owner", HANDLE_GRP_APPLICATION: "handle_apply_join_group", HANDLE_INVITE_JOIN_GRP: "handle_invite_join_permission_group", HANDLE_GRP_INVITATION: "handle_invite_join_group", REVOKE_GRP_MSG: "group_msg_recall", SET_GRP_MSG_READ: "msg_read_report", SET_ALL_MSG_READ: "read_all_unread_msg", GET_GRP_ROAMING_MSG: "group_msg_get", GET_READ_RECEIPT: "get_group_msg_receipt", SEND_READ_RECEIPT: "group_msg_receipt", SEND_C2C_READ_RECEIPT: "c2c_msg_read_receipt", GET_READ_RECEIPT_DETAIL: "get_group_msg_receipt_detail", GET_GRP_RECEIPTS_BY_USERS: "get_group_msg_receipts_by_users", GET_GRP_PENDENCY: "get_pendency", DEL_GRP_SYSTEM_NOTICE: "deletemsg", AV_POLLING: "get_msg", AV_NOAUTH_POLLING: "get_msg_noauth", GET_ONLINE_MBR_NUM: "get_online_member_num", DEL_GRP_MSG: "delete_group_ramble_msg_by_seq", MODIFY_GRP_MSG: "modify_group_msg", SET_GRP_ATTR: "set_group_attr", MODIFY_GRP_ATTR: "modify_group_attr", DEL_GRP_ATTR: "delete_group_attr", CLEAR_GRP_ATTR: "clear_group_attr", GET_GRP_ATTR: "get_group_attr", MODIFY_GRP_MSG_EXT: "group_set_key_values", GET_GRP_MSG_EXT: "group_get_key_values", GET_GRP_NOTIFY: "batch_get_group_notify", UPDATE_GRP_COUNTER: "update_group_counter", GET_GRP_COUNTER: "get_group_counter", ADD_GRP_MSG_REACTION: "group_reaction_add", RM_GRP_MSG_REACTION: "group_reaction_del", GET_GRP_MSG_REACTIONS: "group_reaction_multi_stat", GET_GRP_MSG_REACTION_USER_LIST: "group_reaction_iterate", GET_GRP_MBR_LIST: "get_group_member_info", GET_AV_MBR_LIST: "get_members", GET_GRP_MBR_PROFILE: "get_specified_group_member_info", ADD_GRP_MBR: "add_group_member", DEL_GRP_MBR: "delete_group_member", BAN_AV_MBR: "ban_group_member", MODIFY_GRP_MBR_INFO: "modify_group_member_info", MARK_AV_MBR_INFO: "modify_user_info", COS_SIGN: "cos", COS_PRE_SIG: "pre_sig", SIMPLE_COS_PRE_SIG: "simple_sig", GET_IMAGE_INFO: "get_imageinfo", GET_IP: "get_final_ip", VIDEO_COVER: "video_cover", SSO_STAT: "tim_web_report_v2", PING: "alive", MSG_PUSH: "msg_push", CS: "query", GRP_CS: "query_grp", MBR_CS: "query_grp_member", USER_CS: "query_user", MULTI_MSG_PUSH: "multi_msg_push_ws", MSG_PUSH_ACK: "ws_msg_push_ack", STATUS_FORCE_OFFLINE: "stat_forceoffline", UPLOAD_MERGER_MSG: "save_relay_json_msg", DOWNLOAD_MERGER_MSG: "get_relay_json_msg", FETCH_CLOUD_CTRL_CONFIG: "fetch_config", PUSHED_CLOUD_CTRL_CONFIG: "push_configv2", FETCH_COMMERCIAL_CONFIG: "fetch_imsdk_purchase_bitsv2", PUSHED_COMMERCIAL_CONFIG: "push_imsdk_purchase_bitsv2", OVERLOAD_NOTIFY: "notify2", CREATE_TOPIC: "create_topic", DEL_TOPIC: "destroy_topic", UPDATE_TOPIC_PROFILE: "modify_topic", GET_TOPIC_LIST: "get_topic", SET_SELF_STATUS: "ws_set_custom_status", GET_USER_STATUS: "ws_get_user_status", SUB_USER_STATUS: "ws_status_subscribe", UNSUB_USER_STATUS: "ws_status_unsubscribe", STAT_BACKGROUND: "ws_stat_background", STAT_FOREGROUND: "ws_stat_foreground", SET_TOKEN: "ws_stat_settoken", PUSH_REPORT: "uniapp_sdk_report", GET_PROFANITY_LIST: "get_local_words", TRANSLATE_TEXT: "ws_batch_trans_text", VOICE_TO_TEXT: "ws_sentence_recognition", FOLLOW: "follow_add", UNFOLLOW: "follow_delete", GET_FOLLOW: "follow_get", GET_FOLLOW_INFO: "follow_get_info", CHECK_FOLLOW_TYPE: "follow_check", SET_ALL_RECEIVE_MSG_OPT: "ws_set_do_not_disturb", GET_ALL_RECEIVE_MSG_OPT: "ws_get_do_not_disturb" }, Bn = "networkRTT", Hn = "messageE2EDelay", Kn = "sendMessageC2C", Wn = "sendMessageGroup", Yn = "sendMessageGroupAV", jn = "sendMessageRichMedia", Jn = "cosUpload", zn = "messageReceivedGroup", Xn = "messageReceivedGroupAVPush", Zn = "messageReceivedGroupAVPull", Qn = q2(q2(q2(q2(q2(q2(q2(q2(q2(q2({}, Bn, 2), Hn, 3), Kn, 4), Wn, 5), Yn, 6), jn, 7), zn, 8), Xn, 9), Zn, 10), Jn, 11), $n = { info: 4, warning: 5, error: 6 }, eo = { wifi: 1, "2g": 2, "3g": 3, "4g": 4, "5g": 5, unknown: 6, none: 7, online: 8 }, to = { login: 4, plugin_search: 16, plugin_translate: 16, plugin_voice_to_text: 16, plugin_cs: 16, plugin_push: 16, plugin_bot: 16, plugin_emoji_reaction: 16, tui_key_features: 16 }, P2 = e2(oo, [{ key: "updateTimeStamp", value: function() {
      this.timestamp = He2();
    } }, { key: "start", value: function(e3) {
      return this._startts = e3, this;
    } }, { key: "end", value: function() {
      var e3, t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0];
      this._sentFlag || (this._netMonitorModule && (e3 = this._netMonitorModule.getNetworkType(), this.setNetworkType(e3)), e3 = He2(), 0 === this.costTime && (this.costTime = e3 - this._startts), this.setMoreMessage("startts:".concat(this._startts, " endts:").concat(e3)), n3 ? (this._sentFlag = true, this._eventStatModule && this._eventStatModule.pushIn(this)) : setTimeout(function() {
        t3._sentFlag = true, t3._eventStatModule && t3._eventStatModule.pushIn(t3);
      }, 0));
    } }, { key: "setError", value: function(e3) {
      var t3;
      return e3 instanceof Error ? this._sentFlag || (t3 = true, (t3 = this._netMonitorModule ? this._netMonitorModule.isOnline() : t3) ? (e3.code && this.setCode(e3.code), e3.message && this.setMoreMessage(e3.message)) : this.setCode(k2.NO_NETWORK), this.setLevel("error")) : M2.w("".concat(this._n, ".setError value not instanceof Error, please check!")), this;
    } }, { key: "setCode", value: function(e3) {
      return N3(e3) || this._sentFlag || ("ECONNABORTED" === e3 && (this.code = 103), A2(e3) ? this.code = e3 : M2.w("".concat(this._n, ".setCode value not a number, please check!"), e3, z2(e3))), this;
    } }, { key: "setMessage", value: function(e3) {
      return N3(e3) || this._sentFlag || (A2(e3) && (this.message = e3.toString()), C2(e3) && (this.message = e3)), this;
    } }, { key: "setCostTime", value: function(e3) {
      return this.costTime = e3, this;
    } }, { key: "setLevel", value: function(e3) {
      return N3(e3) || this._sentFlag || (this.level = $n[e3]), this;
    } }, { key: "setMoreMessage", value: function(e3) {
      return S2(this.moreMessage) ? this.moreMessage = "".concat(e3) : this.moreMessage += " ".concat(e3), this;
    } }, { key: "setNetworkType", value: function(e3) {
      return N3(e3) ? M2.w("".concat(this._n, ".setNetworkType value is undefined, please check!")) : (e3 = eo[e3.toLowerCase()], N3(e3) || (this.networkType = e3)), this;
    } }, { key: "getStartTs", value: function() {
      return this._startts;
    } }, { key: "setUIPlatform", value: function(e3) {
      return this.uiPlatform = e3, this;
    } }, { key: "setExtension", value: function(e3) {
      return this.extension = e3, this;
    } }, { key: "setEventType", value: function(e3) {
      return this.eventType = e3, this;
    } }], [{ key: "bindEventStatModule", value: function(e3) {
      oo.prototype._eventStatModule = e3;
    } }, { key: "bindNetMonitorModule", value: function(e3) {
      oo.prototype._netMonitorModule = e3;
    } }]), no = e2(function e3(t3) {
      p3(this, e3), this.type = R2.MSG_TEXT, this.content = { text: t3.text || "" };
    }, [{ key: "setText", value: function(e3) {
      this.content.text = e3;
    } }, { key: "sendable", value: function() {
      return 0 !== this.content.text.length;
    } }]);
    function oo(e3) {
      p3(this, oo), this._n = "SSOLogData", this.eventType = to[e3] || 0, this.timestamp = 0, this.networkType = 8, this.code = 0, this.message = "", this.moreMessage = "", this.extension = e3, this.costTime = 0, this.duplicate = false, this.level = 4, this.uiPlatform = void 0, this._sentFlag = false, this._startts = He2();
    }
    function io(e3) {
      p3(this, io), t3 = i3(this, io);
      var t3, n3 = e3.code, o3 = e3.message, e3 = e3.data;
      return t3.code = n3, o3 ? t3.message = o3 : t3._getErrMsg && (t3.message = t3._getErrMsg(t3.code)), t3.data = e3 || {}, t3;
    }
    function so(e3, t3, n3, o3) {
      var i4, o3 = 3 < arguments.length && void 0 !== o3 ? o3 : [];
      return e3 && (i4 = e3, t3 && (e3.startsWith("http://") ? i4 = e3.replace(/^http:\/\/[^/]+/, t3) : e3.startsWith("https://") && (i4 = e3.replace(/^https:\/\/[^/]+/, t3))), n3 && -1 === i4.indexOf("authKey=") && co(i4, o3) ? (-1 < i4.indexOf("?") ? "".concat(i4, "&authKey=") : "".concat(i4, "?authKey=")).concat(n3) : i4);
    }
    function ao(e3, t3, n3) {
      var o3 = 2 < arguments.length && void 0 !== n3 ? n3 : [], n3 = t3[0].content || t3[0].payload;
      return e3 === R2.MSG_IMAGE ? n3.imageInfoArray.forEach(function(e4) {
        co(e4.imageUrl, o3) && (e4.imageUrl = ro(e4.imageUrl));
      }) : e3 === R2.MSG_VIDEO ? (co(n3.snapshotUrl, o3) && (n3.snapshotUrl = ro(n3.snapshotUrl), n3.thumbUrl = ro(n3.thumbUrl)), co(n3.remoteVideoUrl, o3) && (n3.remoteVideoUrl = ro(n3.remoteVideoUrl))) : e3 === R2.MSG_AUDIO ? co(n3.remoteAudioUrl, o3) && (n3.remoteAudioUrl = ro(n3.remoteAudioUrl)) : e3 === R2.MSG_FILE ? co(n3.fileUrl, o3) && (n3.fileUrl = ro(n3.fileUrl)) : e3 === R2.MSG_MERGER && (e3 = (n3 = t3[0].content || t3[0].payload).downloadKey, n3 = void 0 === (n3 = n3.messageList) ? [] : n3, S2(void 0 === e3 ? "" : e3)) && n3.forEach(function(e4) {
        ao(e4.messageBody[0].type, e4.messageBody, o3);
      }), t3;
    }
    function ro(e3) {
      if (!e3)
        return e3;
      if (-1 === e3.indexOf("authKey="))
        return e3;
      for (var e3 = e3.split("?"), t3 = e3[1].split("&"), n3 = 0, o3 = 0; o3 < t3.length; o3++)
        if (-1 < t3[o3].indexOf("authKey=")) {
          n3 = o3;
          break;
        }
      return t3.splice(n3, 1), 0 < t3.length ? "".concat(e3[0], "?").concat(t3.join("&")) : e3[0];
    }
    function co(e3, t3) {
      var n3 = false;
      if (e3) {
        var e3 = e3.match(/:\/\/([0-9]?\.)?(.[^/:]+)/), o3 = e3 && e3[2] || "";
        if (o3.includes("rich-dev"))
          return 1;
        for (var i4 = 0; i4 < t3.length; i4++)
          if (o3.endsWith(t3[i4])) {
            n3 = true;
            break;
          }
      }
      return n3;
    }
    var uo = e2(function e3(t3, n3, o3, i4) {
      p3(this, e3), this._imageMemoryURL = "", this._fileDownloadProxy = n3, this._authKey = o3, this._fileDNList = i4, v3 || ve2 ? this.createImageDataASURL(t3.file) : this.createImageDataASURLInWeb(t3.file), this._initImageInfoModel(), this.type = R2.MSG_IMAGE, this._percent = 0, this.content = { imageFormat: t3.imageFormat || je2.UNKNOWN, uuid: t3.uuid, imageInfoArray: [] }, this.initImageInfoArray(t3.imageInfoArray), this._autoFixUrl();
    }, [{ key: "_initImageInfoModel", value: function() {
      var t3 = this;
      this._ImageInfoModel = function(e3) {
        this.instanceID = ht2(9999999), this.sizeType = e3.type || 0, this.type = 0, this.size = e3.size || 0, this.width = e3.width || 0, this.height = e3.height || 0, this.imageUrl = e3.imageUrl || e3.url || "", this.url = so(e3.url || t3._imageMemoryURL, t3._fileDownloadProxy, t3._authKey, t3._fileDNList);
      }, this._ImageInfoModel.prototype = { setSizeType: function(e3) {
        this.sizeType = e3;
      }, setType: function(e3) {
        this.type = e3;
      }, setImageUrl: function(e3) {
        e3 && (this.imageUrl = so(e3, t3._fileDownloadProxy, t3._authKey, t3._fileDNList));
      }, getImageUrl: function() {
        return this.imageUrl;
      } };
    } }, { key: "initImageInfoArray", value: function(e3) {
      for (var t3, n3 = 0, o3 = null; n3 <= 2; )
        t3 = N3(e3) || N3(e3[n3]) ? { type: 0, size: 0, width: 0, height: 0, url: "" } : e3[n3], (o3 = new this._ImageInfoModel(t3)).setSizeType(n3 + 1), o3.setType(n3), this.addImageInfo(o3), n3++;
      this.updateAccessSideImageInfoArray();
    } }, { key: "updateImageInfoArray", value: function(e3) {
      for (var t3, n3 = this.content.imageInfoArray.length, o3 = 0; o3 < n3; o3++)
        t3 = this.content.imageInfoArray[o3], e3[o3].size && (t3.size = e3[o3].size), e3[o3].url && t3.setImageUrl(e3[o3].url), e3[o3].width && (t3.width = e3[o3].width), e3[o3].height && (t3.height = e3[o3].height);
    } }, { key: "_autoFixUrl", value: function() {
      for (var e3 = this.content.imageInfoArray.length, t3 = "", n3 = "", o3 = ["http", "https"], i4 = null, s4 = 0; s4 < e3; s4++)
        this.content.imageInfoArray[s4].url && "" !== (i4 = this.content.imageInfoArray[s4]).imageUrl && (n3 = i4.imageUrl.slice(0, i4.imageUrl.indexOf("://") + 1), t3 = i4.imageUrl.slice(i4.imageUrl.indexOf("://") + 1), o3.indexOf(n3) < 0 && (n3 = "https:"), this.content.imageInfoArray[s4].setImageUrl([n3, t3].join("")));
    } }, { key: "updatePercent", value: function(e3) {
      this._percent = e3, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateImageFormat", value: function(e3) {
      this.content.imageFormat = je2[e3.toUpperCase()] || je2.UNKNOWN;
    } }, { key: "createImageDataASURLInWeb", value: function(e3) {
      void 0 !== e3 && 0 < e3.files.length && (this._imageMemoryURL = window.URL.createObjectURL(e3.files[0]));
    } }, { key: "createImageDataASURL", value: function(e3) {
      e3 && e3.url && (this._imageMemoryURL = e3.url);
    } }, { key: "replaceImageInfo", value: function(e3, t3) {
      this.content.imageInfoArray[t3] instanceof this._ImageInfoModel || (this.content.imageInfoArray[t3] = e3);
    } }, { key: "addImageInfo", value: function(e3) {
      3 <= this.content.imageInfoArray.length || this.content.imageInfoArray.push(e3);
    } }, { key: "updateAccessSideImageInfoArray", value: function() {
      var e3 = this.content.imageInfoArray, t3 = e3[0], n3 = t3.width, n3 = void 0 === n3 ? 0 : n3, t3 = t3.height, t3 = void 0 === t3 ? 0 : t3;
      0 !== n3 && 0 !== t3 && (Bt2(e3), Object.assign(e3[2], Vt2({ originWidth: n3, originHeight: t3, min: 720 })));
    } }, { key: "sendable", value: function() {
      return 0 !== this.content.imageInfoArray.length && "" !== this.content.imageInfoArray[0].imageUrl && 0 !== this.content.imageInfoArray[0].size;
    } }]), lo = e2(function e3(t3) {
      p3(this, e3), this.type = R2.MSG_FACE, this.content = t3 || null;
    }, [{ key: "sendable", value: function() {
      return null !== this.content;
    } }]), po = e2(function e3(t3, n3, o3, i4) {
      p3(this, e3), this.type = R2.MSG_AUDIO, this._percent = 0, this._fileDownloadProxy = n3, this._authKey = o3, this._fileDNList = i4, this.content = { downloadFlag: 2, second: t3.second, size: t3.size, url: so(t3.url, this._fileDownloadProxy, this._authKey, this._fileDNList), remoteAudioUrl: so(t3.url || "", this._fileDownloadProxy, this._authKey, this._fileDNList), uuid: t3.uuid };
    }, [{ key: "updatePercent", value: function(e3) {
      this._percent = e3, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateAudioUrl", value: function(e3) {
      this.content.remoteAudioUrl = so(e3, this._fileDownloadProxy, this._authKey, this._fileDNList);
    } }, { key: "sendable", value: function() {
      return "" !== this.content.remoteAudioUrl;
    } }]), _o = { from: true, groupID: true, groupName: true, to: true }, ho = e2(function e3(t3) {
      p3(this, e3), this.type = R2.MSG_GRP_TIP, this.content = {}, this._initContent(t3);
    }, [{ key: "_initContent", value: function(t3) {
      var n3 = this;
      Object.keys(t3).forEach(function(e3) {
        switch (e3) {
          case "remarkInfo":
            break;
          case "groupProfile":
            n3.content.groupProfile = {}, n3._initGroupProfile(t3[e3]);
            break;
          case "operatorInfo":
            n3.content.operatorInfo = {}, n3._initOperatorInfo(t3[e3]);
            break;
          case "memberInfoList":
          case "msgMemberInfo":
            n3._updateMemberList(t3[e3]);
            break;
          case "memberExtraInfo":
          case "onlineMemberInfo":
            break;
          case "memberNum":
            n3.content[e3] = t3[e3], n3.content.memberCount = t3[e3];
            break;
          case "newGroupProfile":
            n3.content.newGroupProfile = {}, n3._initNewGroupProfile(t3[e3]);
            break;
          default:
            n3.content[e3] = t3[e3];
        }
      }), this.content.userIDList || (this.content.userIDList = [this.content.operatorID]);
    } }, { key: "_initGroupProfile", value: function(e3) {
      for (var t3 = Object.keys(e3), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        _o[o3] && (this.content.groupProfile[o3] = e3[o3]);
      }
    } }, { key: "_initOperatorInfo", value: function(e3) {
      for (var t3 = Object.keys(e3), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        this.content.operatorInfo[o3] = e3[o3];
      }
    } }, { key: "_updateMemberList", value: function(e3) {
      S2(this.content.memberList) ? this.content.memberList = e3 : this.content.memberList.forEach(function(t3) {
        e3.forEach(function(e4) {
          t3.userID === e4.userID && Object.assign(t3, e4);
        });
      });
    } }, { key: "_initNewGroupProfile", value: function(e3) {
      for (var t3 = Object.keys(e3), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        this.content.newGroupProfile[o3] = "muteAllMembers" !== o3 ? e3[o3] : 1 === e3[o3];
      }
    } }]), go = { from: true, groupID: true, groupName: true, to: true, groupType: true }, fo = e2(function e3(t3) {
      p3(this, e3), this.type = R2.MSG_GRP_SYS_NOTICE, this.content = {}, this._initContent(t3);
    }, [{ key: "_initContent", value: function(t3) {
      var n3 = this;
      Object.keys(t3).forEach(function(e3) {
        switch (e3) {
          case "memberInfoList":
            break;
          case "remarkInfo":
            n3.content.handleMessage = t3[e3];
            break;
          case "groupProfile":
            n3.content.groupProfile = {}, n3._initGroupProfile(t3[e3]);
            break;
          default:
            n3.content[e3] = t3[e3];
        }
      });
    } }, { key: "_initGroupProfile", value: function(e3) {
      for (var t3 = Object.keys(e3), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        go[o3] && ("groupName" === o3 ? this.content.groupProfile.name = e3[o3] : this.content.groupProfile[o3] = e3[o3]);
      }
    } }]), mo = e2(function e3(t3, n3, o3, i4) {
      p3(this, e3), this.type = R2.MSG_FILE, this._percent = 0;
      var s4 = this._getFileInfo(t3);
      this.content = { downloadFlag: 2, fileUrl: so(t3.url || t3.fileUrl, n3, o3, i4) || "", uuid: t3.uuid, fileName: s4.name || "", fileSize: s4.size || 0 };
    }, [{ key: "_getFileInfo", value: function(e3) {
      var t3, n3;
      return N3(e3.fileName) || N3(e3.fileSize) ? (t3 = e3.file.files[0], fe2 && (t3.path && -1 !== t3.path.indexOf(".") && (n3 = t3.path.slice(t3.path.lastIndexOf(".") + 1).toLowerCase(), t3.type = n3, t3.name || (t3.name = "".concat(ht2(999999), ".").concat(n3))), t3.name || (t3.type = "", t3.name = t3.path.slice(t3.path.lastIndexOf("/") + 1).toLowerCase()), t3.suffix && (t3.type = t3.suffix), t3.url || (t3.url = t3.path)), { size: t3.size, name: t3.name }) : { size: e3.fileSize, name: e3.fileName };
    } }, { key: "updatePercent", value: function(e3) {
      this._percent = e3, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateFileUrl", value: function(e3) {
      this.content.fileUrl = e3;
    } }, { key: "sendable", value: function() {
      return "" !== this.content.fileUrl && "" !== this.content.fileName && 0 !== this.content.fileSize;
    } }]), vo = e2(function e3(t3) {
      p3(this, e3), this.type = R2.MSG_CUSTOM, this.content = { data: t3.data || "", description: t3.description || "", extension: t3.extension || "" };
    }, [{ key: "setData", value: function(e3) {
      return this.content.data = e3, this;
    } }, { key: "setDescription", value: function(e3) {
      return this.content.description = e3, this;
    } }, { key: "setExtension", value: function(e3) {
      return this.content.extension = e3, this;
    } }, { key: "sendable", value: function() {
      return 0 !== this.content.data.length || 0 !== this.content.description.length || 0 !== this.content.extension.length;
    } }]), Io = e2(function e3(t3, n3, o3, i4) {
      p3(this, e3), this.type = R2.MSG_VIDEO, this._percent = 0, this._fileDownloadProxy = n3, this._authKey = o3, this._fileDNList = i4, this.content = { remoteVideoUrl: so(t3.remoteVideoUrl || t3.videoUrl || "", this._fileDownloadProxy, this._authKey, this._fileDNList), videoFormat: t3.videoFormat, videoSecond: parseInt(t3.videoSecond, 10), videoSize: t3.videoSize, videoUrl: so(t3.videoUrl, this._fileDownloadProxy, this._authKey, this._fileDNList), videoDownloadFlag: 2, videoUUID: t3.videoUUID, thumbUUID: t3.thumbUUID, thumbFormat: t3.thumbFormat, thumbWidth: t3.thumbWidth, snapshotWidth: t3.thumbWidth, thumbHeight: t3.thumbHeight, snapshotHeight: t3.thumbHeight, thumbSize: t3.thumbSize, snapshotSize: t3.thumbSize, thumbDownloadFlag: 2, thumbUrl: so(t3.thumbUrl, this._fileDownloadProxy, this._authKey, this._fileDNList), snapshotUrl: so(t3.thumbUrl, this._fileDownloadProxy, this._authKey, this._fileDNList) };
    }, [{ key: "updatePercent", value: function(e3) {
      this._percent = e3, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateVideoUrl", value: function(e3) {
      e3 && (this.content.remoteVideoUrl = so(e3, this._fileDownloadProxy, this._authKey, this._fileDNList));
    } }, { key: "updateSnapshotInfo", value: function(e3) {
      var t3 = e3.snapshotUrl, n3 = e3.snapshotWidth, e3 = e3.snapshotHeight;
      S2(t3) || (this.content.thumbUrl = this.content.snapshotUrl = t3), S2(n3) || (this.content.thumbWidth = this.content.snapshotWidth = Number(n3)), S2(e3) || (this.content.thumbHeight = this.content.snapshotHeight = Number(e3));
    } }, { key: "sendable", value: function() {
      return "" !== this.content.remoteVideoUrl;
    } }]), Mo = e2(function e3(t3) {
      p3(this, e3), this.type = R2.MSG_LOCATION;
      var n3 = t3.description, o3 = t3.longitude, t3 = t3.latitude;
      this.content = { description: n3, longitude: o3, latitude: t3 };
    }, [{ key: "sendable", value: function() {
      return true;
    } }]), yo = e2(function e3(t3, n3, o3, i4) {
      var s4, a3;
      p3(this, e3), this.from = t3.from, this.messageSender = t3.from, this.time = t3.time, this.messageSequence = t3.sequence, this.clientSequence = t3.clientSequence || t3.sequence, this.messageRandom = t3.random, this.cloudCustomData = t3.cloudCustomData || "", this.clientTime = t3.clientTime || void 0, t3.ID ? (this.ID = t3.ID || "", this.nick = t3.nick || "", this.avatar = t3.avatar || "", t3.messageBody ? this.messageBody = JSON.parse(JSON.stringify(t3.messageBody)) : this.messageBody = [{ type: t3.type, payload: t3.payload }], t3.conversationType ? t3.conversationType.startsWith(R2.CONV_C2C) ? this.receiverUserID = t3.to : t3.conversationType.startsWith(R2.CONV_GROUP) && (this.receiverGroupID = t3.to) : t3.receiverGroupID ? this.receiverGroupID = t3.receiverGroupID : t3.receiverUserID && (this.receiverUserID = t3.receiverUserID), this.messageReceiver = t3.to || t3.messageReceiver) : (this.nick = t3.nick || "", this.avatar = t3.avatar || "", this.messageBody = [], s4 = t3.elements[0].type, a3 = t3.elements[0].content, this._patchRichMediaPayload(s4, a3), this._updateRichMediaDownloadUrl(s4, a3, n3, o3, i4), s4 === R2.MSG_MERGER ? this.messageBody.push({ type: s4, payload: new Co(a3, n3, o3, i4).content }) : this.messageBody.push({ type: s4, payload: a3 }), t3.groupID && (this.receiverGroupID = t3.groupID, this.messageReceiver = t3.groupID), t3.to && (this.receiverUserID = t3.to, this.messageReceiver = t3.to), this.ID = "".concat(t3.tinyID, "-").concat(t3.clientTime, "-").concat(t3.random));
    }, [{ key: "_patchRichMediaPayload", value: function(e3, t3) {
      e3 === R2.MSG_IMAGE ? t3.imageInfoArray.forEach(function(e4) {
        !e4.imageUrl && e4.url && (e4.imageUrl = e4.url, e4.sizeType = e4.type, 1 === e4.type ? e4.type = 0 : 3 === e4.type && (e4.type = 1));
      }) : e3 === R2.MSG_VIDEO ? !t3.remoteVideoUrl && t3.videoUrl && (t3.remoteVideoUrl = t3.videoUrl) : e3 === R2.MSG_AUDIO ? !t3.remoteAudioUrl && t3.url && (t3.remoteAudioUrl = t3.url) : e3 === R2.MSG_FILE && !t3.fileUrl && t3.url && (t3.fileUrl = t3.url, t3.url = void 0);
    } }, { key: "_updateRichMediaDownloadUrl", value: function(e3, t3, n3, o3, i4) {
      (n3 || o3) && (e3 === R2.MSG_IMAGE ? t3.imageInfoArray.forEach(function(e4) {
        e4.imageUrl = so(e4.imageUrl, n3, o3, i4), e4.url = so(e4.url, n3, o3, i4);
      }) : e3 === R2.MSG_VIDEO ? (t3.remoteVideoUrl = so(t3.remoteVideoUrl, n3, o3, i4), t3.videoUrl = so(t3.videoUrl, n3, o3, i4), t3.thumbUrl = so(t3.thumbUrl, n3, o3, i4), t3.snapshotUrl = so(t3.thumbUrl, n3, o3, i4), t3.snapshotHeight = t3.thumbHeight, t3.snapshotWidth = t3.thumbWidth) : e3 === R2.MSG_AUDIO ? (t3.remoteAudioUrl = so(t3.remoteAudioUrl, n3, o3, i4), t3.url = so(t3.url, n3, o3, i4)) : e3 === R2.MSG_FILE && (t3.fileUrl = so(t3.fileUrl, n3, o3, i4)));
    } }]), Co = e2(function e3(t3, n3, o3, i4) {
      var s4, a3, r4, c3, u3, l3, d3;
      p3(this, e3), this.type = R2.MSG_MERGER, this.content = { downloadKey: "", pbDownloadKey: "", messageList: [], title: "", abstractList: [], compatibleText: "", version: 0, layersOverLimit: false }, t3.downloadKey ? (a3 = t3.downloadKey, r4 = t3.pbDownloadKey, c3 = t3.title, u3 = t3.abstractList, l3 = t3.compatibleText, s4 = t3.version, this.content.downloadKey = a3, this.content.pbDownloadKey = r4, this.content.title = c3, this.content.abstractList = u3, this.content.compatibleText = l3, this.content.version = s4 || 0) : S2(t3.messageList) ? 1 === t3.layersOverLimit && (this.content.layersOverLimit = true) : (a3 = t3.messageList, r4 = t3.title, c3 = t3.abstractList, u3 = t3.compatibleText, l3 = t3.version, d3 = [], a3.forEach(function(e4) {
        S2(e4) || (e4 = new yo(e4, n3, o3, i4), d3.push(e4));
      }), this.content.messageList = d3, this.content.title = r4, this.content.abstractList = c3, this.content.compatibleText = u3, this.content.version = l3 || 0);
    }, [{ key: "sendable", value: function() {
      return !S2(this.content.messageList) || !S2(this.content.downloadKey);
    } }]), To = { 1: R2.MSG_PRIORITY_HIGH, 2: R2.MSG_PRIORITY_NORMAL, 3: R2.MSG_PRIORITY_LOW, 4: R2.MSG_PRIORITY_LOWEST }, Do = e2(function e3(t3) {
      p3(this, e3), this.ID = "", this.conversationID = t3.conversationID || null, this.conversationType = t3.conversationType || R2.CONV_C2C, this.conversationSubType = t3.conversationSubType, this.time = t3.time || Math.ceil(Date.now() / 1e3), this.sequence = t3.sequence || 0, this.clientSequence = t3.clientSequence || t3.sequence || 0, this.random = t3.random || 0 === t3.random ? t3.random : ht2(), this.priority = this._computePriority(t3.priority), this.nick = t3.nick || "", this.avatar = t3.avatar || "", this.isPeerRead = false, this.nameCard = "", this.hasRiskContent = nn(t3.checkResult), this._elements = [], this.isPlaceMessage = t3.isPlaceMessage || 0, this.isRevoked = 2 === t3.isPlaceMessage || 8 === t3.msgFlagBits, this.from = t3.from || null, this.to = t3.to || null, this.flow = "", this.isSystemMessage = t3.isSystemMessage || false, this.protocol = t3.protocol || "JSON", this.isResend = false, this.isRead = false, this.status = t3.status || On, this._onlineOnlyFlag = false, this._groupAtInfoList = [], this._relayFlag = false, this.atUserList = [], this.cloudCustomData = t3.cloudCustomData || "", this.isDeleted = false, this.isModified = !!t3.messageVersion, this._isExcludedFromUnreadCount = !(!t3.messageControlInfo || 1 !== t3.messageControlInfo.excludedFromUnreadCount), this._isExcludedFromLastMessage = !(!t3.messageControlInfo || 1 !== t3.messageControlInfo.excludedFromLastMessage), this.clientTime = t3.clientTime || xe2() || 0, this.senderTinyID = t3.senderTinyID || t3.tinyID || "", this.readReceiptInfo = t3.readReceiptInfo || { readCount: void 0, unreadCount: void 0, isPeerRead: void 0, timestamp: 0 }, this.needReadReceipt = true === t3.needReadReceipt || 1 === t3.needReadReceipt, this.version = t3.messageVersion || 0, this.isBroadcastMessage = t3.isBroadcastMessage || false, this._receiverList = t3.receiverList || void 0, this.isSupportExtension = true === t3.isSupportExtension || 1 === t3.isSupportExtension, this._cmConfigID = t3.customModerationConfigurationID, this.revoker = t3.revokerInfo && t3.revokerInfo.revoker || "", this.revokerInfo = t3.revokerInfo || { userID: "", nick: "", avatar: "" }, this.revokeReason = t3.revokeReason || "", this.reInitialize(t3.currentUser), this.extractGroupInfo(t3.groupProfile || null), this.handleGroupAtInfo(t3), this.initC2CReadReceiptInfo(t3);
    }, [{ key: "elements", get: function() {
      return this._elements;
    } }, { key: "getElements", value: function() {
      return this._elements;
    } }, { key: "extractGroupInfo", value: function(e3) {
      null !== e3 && (C2(e3.nick) && (this.nick = e3.nick), C2(e3.avatar) && (this.avatar = e3.avatar), e3 = e3.messageFromAccountExtraInformation, m2(e3)) && C2(e3.nameCard) && (this.nameCard = e3.nameCard);
    } }, { key: "handleGroupAtInfo", value: function(e3) {
      var t3 = this;
      e3.payload && e3.payload.atUserList && e3.payload.atUserList.forEach(function(e4) {
        e4 !== R2.MSG_AT_ALL ? (t3._groupAtInfoList.push({ groupAtAllFlag: 0, groupAtUserID: e4 }), t3.atUserList.push(e4)) : (t3._groupAtInfoList.push({ groupAtAllFlag: 1 }), t3.atUserList.push(R2.MSG_AT_ALL));
      }), O2(e3.groupAtInfo) && e3.groupAtInfo.forEach(function(e4) {
        0 === e4.groupAtAllFlag ? t3.atUserList.push(e4.groupAtUserID) : 1 === e4.groupAtAllFlag && t3.atUserList.push(R2.MSG_AT_ALL);
      });
    } }, { key: "getGroupAtInfoList", value: function() {
      return this._groupAtInfoList;
    } }, { key: "_initProxy", value: function() {
      this._elements[0] && (this.payload = this._elements[0].content, this.type = this._elements[0].type);
    } }, { key: "reInitialize", value: function(e3) {
      e3 && (this.status = this.from ? On : An, !this.from) && (this.from = e3), this._initFlow(e3), this._initSequence(e3), this._concatConversationID(e3), this.generateMessageID();
    } }, { key: "isSendable", value: function() {
      return 0 !== this._elements.length && (true === this._relayFlag || "function" == typeof this._elements[0].sendable && this._elements[0].sendable());
    } }, { key: "_initTo", value: function(e3) {
      this.conversationType === R2.CONV_GROUP && (this.to = e3.groupID);
    } }, { key: "_initSequence", value: function(e3) {
      var t3, n3, o3;
      0 === this.clientSequence && e3 && (this.clientSequence = !!(e3 = e3) && (void 0 === Et2[e3] && (o3 = /* @__PURE__ */ new Date(), t3 = "3".concat(o3.getHours()).slice(-2), n3 = "0".concat(o3.getMinutes()).slice(-2), o3 = "0".concat(o3.getSeconds()).slice(-2), Et2[e3] = parseInt([t3, n3, o3, "0001"].join("")), o3 = n3 = t3 = null, M2.l("autoIncrementIndex start index:".concat(Et2[e3]))), Et2[e3]++)), 0 === this.sequence && this.conversationType === R2.CONV_C2C && (this.sequence = this.clientSequence);
    } }, { key: "generateMessageID", value: function() {
      this.from === R2.CONV_SYSTEM && (this.senderTinyID = "144115198244471703"), this.ID = "".concat(this.senderTinyID, "-").concat(this.clientTime, "-").concat(this.random);
    } }, { key: "_initFlow", value: function(e3) {
      "" !== e3 && (e3 === this.from ? (this.flow = "out", this.isRead = true) : this.flow = "in");
    } }, { key: "_concatConversationID", value: function(e3) {
      var t3 = this.to, n3 = this.conversationType;
      n3 !== R2.CONV_SYSTEM ? (e3 = n3 === R2.CONV_C2C ? e3 === this.from ? t3 : this.from : this.to, this.conversationID = e3 ? "".concat(n3).concat(e3) : null) : this.conversationID = R2.CONV_SYSTEM;
    } }, { key: "isElement", value: function(e3) {
      return e3 instanceof no || e3 instanceof uo || e3 instanceof lo || e3 instanceof po || e3 instanceof mo || e3 instanceof Io || e3 instanceof ho || e3 instanceof fo || e3 instanceof vo || e3 instanceof Mo || e3 instanceof Co;
    } }, { key: "setElement", value: function(e3, t3, n3, o3) {
      var i4 = this;
      if (this.isElement(e3))
        this._elements = [e3];
      else {
        var s4 = function(e4) {
          if (e4.type && e4.content)
            switch (e4.type) {
              case R2.MSG_TEXT:
                i4.setTextElement(e4.content);
                break;
              case R2.MSG_IMAGE:
                i4.setImageElement(e4.content, t3, n3, o3);
                break;
              case R2.MSG_AUDIO:
                i4.setAudioElement(e4.content, t3, n3, o3);
                break;
              case R2.MSG_FILE:
                i4.setFileElement(e4.content, t3, n3, o3);
                break;
              case R2.MSG_VIDEO:
                i4.setVideoElement(e4.content, t3, n3, o3);
                break;
              case R2.MSG_CUSTOM:
                i4.setCustomElement(e4.content);
                break;
              case R2.MSG_LOCATION:
                i4.setLocationElement(e4.content);
                break;
              case R2.MSG_GRP_TIP:
                i4.setGroupTipElement(e4.content);
                break;
              case R2.MSG_GRP_SYS_NOTICE:
                i4.setGroupSystemNoticeElement(e4.content);
                break;
              case R2.MSG_FACE:
                i4.setFaceElement(e4.content);
                break;
              case R2.MSG_MERGER:
                i4.setMergerElement(e4.content, t3, n3, o3);
            }
        };
        if (O2(e3))
          for (var a3 = 0; a3 < e3.length; a3++)
            s4(e3[a3]);
        else
          s4(e3);
      }
      this._initProxy();
    } }, { key: "clearElement", value: function() {
      this._elements.length = 0;
    } }, { key: "setTextElement", value: function(e3) {
      e3 = "string" == typeof e3 ? e3 : e3.text, e3 = new no({ text: e3 });
      this._elements.push(e3);
    } }, { key: "setImageElement", value: function(e3, t3, n3, o3) {
      e3 = new uo(e3, t3, n3, o3);
      this._elements.push(e3);
    } }, { key: "setAudioElement", value: function(e3, t3, n3, o3) {
      e3 = new po(e3, t3, n3, o3);
      this._elements.push(e3);
    } }, { key: "setFileElement", value: function(e3, t3, n3, o3) {
      e3 = new mo(e3, t3, n3, o3);
      this._elements.push(e3);
    } }, { key: "setVideoElement", value: function(e3, t3, n3, o3) {
      e3 = new Io(e3, t3, n3, o3);
      this._elements.push(e3);
    } }, { key: "setLocationElement", value: function(e3) {
      e3 = new Mo(e3);
      this._elements.push(e3);
    } }, { key: "setCustomElement", value: function(e3) {
      e3 = new vo(e3);
      this._elements.push(e3);
    } }, { key: "setGroupTipElement", value: function(e3) {
      var t3, n3 = {}, o3 = e3.operationType;
      S2(e3.memberInfoList) ? e3.operatorInfo && (n3 = e3.operatorInfo) : o3 !== R2.GRP_TIP_MBR_JOIN && o3 !== R2.GRP_TIP_MBR_KICKED_OUT && o3 !== R2.GRP_TIP_MBR_SET_ADMIN && o3 !== R2.GRP_TIP_MBR_CANCELED_ADMIN || (n3 = e3.memberInfoList[0]), S2(e3.memberExtraInfo) || (t3 = e3.memberExtraInfo.reason, e3.msgMemberInfo.forEach(function(e4) {
        e4.reason = t3;
      }));
      o3 = n3.nick, n3 = n3.avatar, C2(o3) && (this.nick = o3), C2(n3) && (this.avatar = n3), o3 = new ho(e3);
      this._elements.push(o3);
    } }, { key: "setGroupSystemNoticeElement", value: function(e3) {
      e3 = new fo(e3);
      this._elements.push(e3);
    } }, { key: "setFaceElement", value: function(e3) {
      e3 = new lo(e3);
      this._elements.push(e3);
    } }, { key: "setMergerElement", value: function(e3, t3, n3, o3) {
      e3 = new Co(e3, t3, n3, o3);
      this._elements.push(e3);
    } }, { key: "setIsRead", value: function(e3) {
      this.isRead = e3;
    } }, { key: "setRelayFlag", value: function(e3) {
      this._relayFlag = e3;
    } }, { key: "_computePriority", value: function(e3) {
      if (!N3(e3)) {
        if (C2(e3) && -1 !== Object.values(To).indexOf(e3))
          return e3;
        if (A2(e3)) {
          e3 = "" + e3;
          if (-1 !== Object.keys(To).indexOf(e3))
            return To[e3];
        }
      }
      return R2.MSG_PRIORITY_NORMAL;
    } }, { key: "setNickAndAvatar", value: function(e3) {
      var t3 = e3.nick, e3 = e3.avatar;
      C2(t3) && (this.nick = t3), C2(e3) && (this.avatar = e3);
    } }, { key: "setNameCard", value: function(e3) {
      C2(e3) && (this.nameCard = e3);
    } }, { key: "initC2CReadReceiptInfo", value: function(e3) {
      var t3 = e3.readReceiptSentByPeer, e3 = e3.timestamp, e3 = void 0 === e3 ? 0 : e3;
      this.conversationType === R2.CONV_C2C && true === this.needReadReceipt && (this.readReceiptInfo.isPeerRead = 1 === (void 0 === t3 ? void 0 : t3), this.readReceiptInfo.timestamp = e3);
    } }]), Eo = ["sound", "FCMChannelID"];
    function Lo(e3) {
      if (m2(e3))
        return { pushFlag: true === e3.disablePush ? 1 : 0, title: e3.title || "", desc: e3.description || "", ext: e3.extension || "", apnsInfo: (n3 = void 0 === (n3 = (t3 = e3).apnsInfo) ? {} : n3, o3 = t3.ignoreIOSBadge, t3 = t3.disableVoipPush, o3 = true === n3.ignoreIOSBadge || true === (void 0 !== o3 && o3) ? 1 : 0, i4 = void 0, N3(t3) || (i4 = false === t3 ? 1 : 0), N3(n3.disableVoipPush) || (i4 = false === n3.disableVoipPush ? 1 : 0), y2(y2({}, n3), {}, { badgeMode: o3, isVoipPush: i4 })), androidInfo: (n3 = void 0 === (n3 = (t3 = e3).androidInfo) ? {} : n3, t3 = t3.androidOPPOChannelID, t3 = n3.OPPOChannelID || (void 0 === t3 ? "" : t3), o3 = void 0 === (o3 = n3.sound) ? "" : o3, i4 = void 0 === (i4 = n3.FCMChannelID) ? "" : i4, y2(y2({}, W2(n3, Eo)), {}, { Sound: -1 === (o3 = (n3 = o3).lastIndexOf(".")) ? n3 : n3.slice(0, o3), OPPOChannelID: t3, GoogleChannelID: i4 })) };
      var t3, n3, o3, i4;
    }
    t2(Ro, c2);
    var So = e2(Ro, [{ key: "onNewMessage", value: function(e3) {
      var t3 = e3.dataList, n3 = e3.isInstantMessage, o3 = e3.C2CRemainingUnreadList, i4 = e3.C2CPairUnreadList, e3 = e3.isSyncingEnded, t3 = (n3 || M2.l("".concat(this._n, ".onNewMessage C2CPairUnreadList:"), i4, "C2CRemainingUnreadList:", o3), this._assembly({ dataList: t3, C2CRemainingUnreadList: o3, C2CPairUnreadList: i4, isInstantMessage: n3 })), o3 = t3.conversationOptionsList, i4 = t3.messageList, t3 = t3.isUnreadC2CMessage, s4 = St2(i4), s4 = (0 < s4.length && this.emitOEvt(h2.MESSAGE_MODIFIED, s4), this.get(11).onNewMessage({ conversationOptionsList: o3, isInstantMessage: n3, isUnreadC2CMessage: t3, isSyncingEnded: e3 }), Rt2(i4));
      n3 && 0 < s4.length && this.emitOEvt(h2.MESSAGE_RECEIVED, s4), i4.length = 0;
    } }, { key: "_assembly", value: function(e3) {
      for (var t3 = e3.dataList, n3 = e3.C2CRemainingUnreadList, o3 = e3.C2CPairUnreadList, i4 = e3.isInstantMessage, s4 = null, a3 = [], r4 = [], c3 = {}, u3 = this.get(26), l3 = false, d3 = this.get(11), p4 = this.get(4), e3 = this.get(17), _3 = this.getFileDownloadProxy(), h3 = this.getDownloadFileAuthKey(), g3 = e3.getFileDNList(), f3 = 0, m3 = t3.length; f3 < m3; f3++)
        if (this._isC2CNotice(t3[f3]))
          this._noticeFromUnreadDBList.push(t3[f3].eventArray[0].c2CNotifyMsgArray[0]);
        else {
          var v4 = t3[f3], I3 = (v4.currentUser = this.getMyUserID(), v4.conversationType = R2.CONV_C2C, v4.isSystemMessage = !!v4.isSystemMessage, (N3(v4.nick) || N3(v4.avatar)) && (l3 = true), (s4 = new Do(v4)).setElement(v4.elements, _3, h3, g3), s4.setNickAndAvatar({ nick: v4.nick, avatar: v4.avatar }), s4.conversationID);
          if (i4) {
            if (this._msgFromUnreadDBMap.get(s4.ID))
              continue;
            var M3, y3, C3 = false, T3 = (s4.from !== this.getMyUserID() ? (y3 = d3.getLatestMessageSentByPeer(I3)) && (M3 = y3.nick, y3 = y3.avatar, l3 ? s4.setNickAndAvatar({ nick: M3, avatar: y3 }) : M3 === s4.nick && y3 === s4.avatar || (C3 = true)) : (M3 = d3.getLatestMessageSentByMe(I3)) && (y3 = M3.nick, T3 = M3.avatar, y3 === s4.nick && T3 === s4.avatar || (d3.modifyMessageSentByMe({ conversationID: I3, latestNick: s4.nick, latestAvatar: s4.avatar }), p4.mockOnNickAvatarModified(s4.nick, s4.avatar))), 1 === t3[f3].isModified);
            if (d3.isMessageSentByCurrentInstance(s4) ? s4.isModified = T3 : T3 = false, 0 === v4.msgLifeTime)
              s4._onlineOnlyFlag = true, d3.isMessageSentByCurrentInstance(s4) || r4.push(s4);
            else {
              if (!d3.pushIntoMessageList(r4, s4, T3))
                continue;
              C3 && (d3.modifyMessageSentByPeer({ conversationID: I3, latestNick: s4.nick, latestAvatar: s4.avatar }), d3.updateUserProfileSpecifiedKey({ conversationID: I3, nick: s4.nick, avatar: s4.avatar }));
            }
            i4 && 0 < s4.clientTime && u3.addMessageDelay(s4.clientTime);
          } else
            this._msgFromUnreadDBMap.set(s4.ID, s4);
          if (0 !== v4.msgLifeTime) {
            if (false === s4._onlineOnlyFlag) {
              C3 = d3.getLastMessageTime(I3);
              if (A2(C3) && s4.time < C3)
                continue;
              i4 && (N3(c3[I3]) ? (v4 = 0, "in" !== s4.flow || s4._isExcludedFromUnreadCount || (v4 = 1), c3[I3] = a3.push({ conversationID: I3, unreadCount: v4, type: s4.conversationType, subType: s4.conversationSubType, lastMessage: s4._isExcludedFromLastMessage ? "" : s4 }) - 1) : (v4 = c3[I3], a3[v4].type = s4.conversationType, a3[v4].subType = s4.conversationSubType, a3[v4].lastMessage = s4._isExcludedFromLastMessage ? "" : s4, "in" !== s4.flow || s4._isExcludedFromUnreadCount || a3[v4].unreadCount++));
            }
          } else
            s4._onlineOnlyFlag = true;
        }
      this._handleNoticeFromUnreadDB();
      var D3 = false;
      if (O2(o3) && 0 < o3.length)
        for (var E3 = 0, L3 = o3.length; E3 < L3; E3++)
          !function(t4) {
            if (o3[t4].from === R2.CONV_SYSTEM)
              return;
            D3 = true;
            var e4 = a3.find(function(e5) {
              return e5.conversationID === "".concat(R2.CONV_C2C).concat(o3[t4].from);
            });
            e4 ? e4.unreadCount = o3[t4].unreadCount : a3.push({ conversationID: "".concat(R2.CONV_C2C).concat(o3[t4].from), unreadCount: o3[t4].unreadCount, type: R2.CONV_C2C });
          }(E3);
      if (O2(n3))
        for (var S3 = 0, k3 = n3.length; S3 < k3; S3++)
          !function(t4) {
            a3.find(function(e4) {
              return e4.conversationID === "".concat(R2.CONV_C2C).concat(n3[t4].from);
            }) || a3.push({ conversationID: "".concat(R2.CONV_C2C).concat(n3[t4].from), type: R2.CONV_C2C, lastMsgTime: n3[t4].lastMsgTime });
          }(S3);
      return { conversationOptionsList: a3, messageList: r4, isUnreadC2CMessage: D3 };
    } }, { key: "getMessageListFromUnreadDB", value: function() {
      return d2(this._msgFromUnreadDBMap.values());
    } }, { key: "_isC2CNotice", value: function(e3) {
      e3 = e3.eventArray;
      return !(!O2(e3) || 10 !== e3[0].event);
    } }, { key: "_handleNoticeFromUnreadDB", value: function() {
      var t3, e3 = this._noticeFromUnreadDBList.length;
      0 !== e3 && (M2.l("".concat(this._n, "._handleNoticeFromUnreadDB count:").concat(e3)), t3 = [], this._noticeFromUnreadDBList.forEach(function(e4) {
        e4.hasOwnProperty("c2cMessageRevokedNotify") && t3.push(e4);
      }), this.onMsgRevoked({ dataList: t3 }), this._noticeFromUnreadDBList.length = 0, t3.length = 0);
    } }, { key: "onMsgRevoked", value: function(e3, t3) {
      var s4, a3 = this, r4 = this.get(11), c3 = [];
      e3.dataList.forEach(function(e4) {
        e4.c2cMessageRevokedNotify && (e4 = e4.c2cMessageRevokedNotify.revokedInfos, N3(e4) || e4.forEach(function(e5) {
          var t4 = a3.getMyUserID() === e5.from ? "".concat(R2.CONV_C2C).concat(e5.to) : "".concat(R2.CONV_C2C).concat(e5.from);
          s4 = r4.revoke(t4, e5.sequence, e5.random);
          var n3, o3 = e5.revokerInfo && e5.revokerInfo.revoker, i4 = e5.revokerInfo && e5.revokerInfo.reason || "";
          s4 ? n3 = s4 : (n3 = { conversationID: t4, sequence: e5.sequence }, e5.tinyID && e5.clientTime && e5.random && (n3.ID = "".concat(e5.tinyID, "-").concat(e5.clientTime, "-").concat(e5.random)), e5.time && (n3.time = e5.time)), n3 && (n3.revoker = o3, n3.revokeReason = i4, n3.revokerInfo = { userID: o3, nick: "", avatar: "" }, c3.push(n3));
        }));
      }), 0 !== c3.length && (M2.l("".concat(this._n, ".onMsgRevoked count:").concat(c3.length, " updateUnreadCount:").concat(t3)), r4.onMessageRevoked(c3, t3), r4.updateRevokerInfo(c3).then(function(e4) {
        a3.emitOEvt(h2.MESSAGE_REVOKED, e4);
      }));
    } }, { key: "onMsgReadReceipt", value: function(e3) {
      var i4 = this;
      e3.dataList.forEach(function(e4) {
        var o3;
        S2(e4.c2cMessageReadReceipt) || (o3 = e4.c2cMessageReadReceipt.to, e4.c2cMessageReadReceipt.uinPairReadArray.forEach(function(e5) {
          var e5 = e5.peerReadTime, t3 = (M2.l("".concat(i4._n, ".onMsgReadReceipt to:").concat(o3, " peerReadTime:").concat(e5)), "".concat(R2.CONV_C2C).concat(o3)), n3 = i4.get(11);
          n3.recordPeerReadTime(t3, e5), n3.updateMsgIsPeerReadProp(t3, e5);
        }));
      });
    } }, { key: "onMsgReadNotice", value: function(e3) {
      var o3 = this;
      e3.dataList.forEach(function(e4) {
        var n3;
        S2(e4.c2cMessageReadNotice) || (n3 = o3.get(11), e4.c2cMessageReadNotice.uinPairReadArray.forEach(function(e5) {
          var t3 = e5.from, e5 = e5.peerReadTime, t3 = (M2.l("".concat(o3._n, ".onMsgReadNotice from:").concat(t3, " lastReadTime:").concat(e5)), "".concat(R2.CONV_C2C).concat(t3));
          n3.updateIsReadAfterReadReport({ conversationID: t3, lastMessageTime: e5 }), n3.updateUnreadCount(t3);
        }));
      });
    } }, { key: "onMsgModified", value: function(e3) {
      M2.l("".concat(this._n, ".onMsgModified options:"), e3);
      var t3 = this.get(11);
      e3.dataList.forEach(function(e4) {
        t3.onMessageModified(y2(y2({}, e4), {}, { conversationType: R2.CONV_C2C }));
      });
    } }, { key: "onReadReceiptList", value: function(e3) {
      M2.l("".concat(this._n, ".onReadReceiptList options:"), e3), this.get(11).updateReadReceiptInfo(e3.dataList);
    } }, { key: "sendMessage", value: function(e3, t3) {
      e3 = this._createC2CMessagePack(e3, t3);
      return this.req(e3);
    } }, { key: "_createC2CMessagePack", value: function(e3, t3) {
      var n3 = null, o3 = (t3 && (t3.offlinePushInfo && (n3 = t3.offlinePushInfo), true === t3.onlineUserOnly) && (n3 ? n3.disablePush = true : n3 = { disablePush: true }), ""), i4 = (C2(e3.cloudCustomData) && 0 < e3.cloudCustomData.length && (o3 = e3.cloudCustomData), []), s4 = (m2(t3) && m2(t3.messageControlInfo) && (s4 = (r4 = t3.messageControlInfo).excludedFromUnreadCount, a3 = r4.excludedFromLastMessage, r4 = r4.excludedFromContentModeration, true === s4 && i4.push("NoUnread"), true === a3 && i4.push("NoLastMsg"), true === r4) && i4.push("NoMsgCheck"), this.isOnlineMessage(e3, t3) ? 0 : void 0), a3 = JSON.parse(JSON.stringify(e3.getElements())), r4 = this.get(17).getFileDNList();
      return { P: G2.SEND_C2C_MSG, data: { fromAccount: this.getMyUserID(), toAccount: e3.to, msgBody: ao(e3.type, a3, r4), cloudCustomData: o3, msgSeq: e3.sequence, msgRandom: e3.random, msgLifeTime: s4, nick: e3.nick, avatar: e3.avatar, offlinePushInfo: Lo(n3), messageControlInfo: 0 !== s4 ? i4 : void 0, clientTime: e3.clientTime, needReadReceipt: true === e3.needReadReceipt ? 1 : 0, isSupportExtension: true === e3.isSupportExtension ? 1 : 0, isRelayMessage: true === e3._relayFlag ? 1 : 0, cmConfigID: e3._cmConfigID, forbidCallbackControl: kt2(t3) } };
    } }, { key: "isOnlineMessage", value: function(e3, t3) {
      return !(!t3 || true !== t3.onlineUserOnly);
    } }, { key: "revokeMessage", value: function(e3) {
      return this.req({ P: G2.REVOKE_C2C_MSG, data: { msgInfo: { fromAccount: e3.from, toAccount: e3.to, msgSeq: e3.sequence, msgRandom: e3.random, msgTimeStamp: e3.time } } });
    } }, { key: "deleteMessage", value: function(e3) {
      var t3 = e3.to, e3 = e3.keyList;
      return M2.l("".concat(this._n, ".deleteMessage toAccount:").concat(t3, " count:").concat(e3.length)), this.req({ P: G2.DEL_C2C_MSG, data: { fromAccount: this.getMyUserID(), to: t3, keyList: e3 } });
    } }, { key: "modifyRemoteMessage", value: function(e3) {
      var t3 = e3.from, n3 = e3.to, o3 = e3.version, o3 = void 0 === o3 ? 0 : o3, i4 = e3.sequence, s4 = e3.random, a3 = e3.time, r4 = e3.payload, c3 = e3.type, u3 = e3.cloudCustomData, e3 = e3._elements, l3 = void 0;
      return zt(c3) && (1 < e3.length && e3.splice(0, 1, { type: c3, content: r4 }), l3 = e3), this.req({ P: G2.MODIFY_C2C_MSG, data: { from: t3, to: n3, version: o3, sequence: i4, random: s4, time: a3, elements: l3, cloudCustomData: u3 } });
    } }, { key: "setMessageRead", value: function(e3) {
      var t3 = this, n3 = e3.conversationID, o3 = e3.lastMessageTime, i4 = "".concat(this._n, ".").concat("setMessageRead"), e3 = "convID:".concat(n3, " lastMessageTime:").concat(o3), s4 = (M2.l("".concat(i4, " ").concat(e3)), A2(o3) || this.warn("DoNotModifyLastTime"), new P2("setMessageRead"));
      return s4.setMessage(e3), this.req({ P: G2.SET_C2C_MSG_READ, data: { C2CMsgReaded: { cookie: "", C2CMsgReadedItem: [{ toAccount: n3.replace("C2C", ""), lastMessageTime: o3, receipt: 1 }] } } }).then(function() {
        s4.end(), M2.l("".concat(i4, " ok"));
        var e4 = t3.get(11);
        return e4.updateIsReadAfterReadReport({ conversationID: n3, lastMessageTime: o3 }), e4.updateUnreadCount(n3), T2();
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.l("".concat(i4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "getRoamingMessage", value: function(e3) {
      var a3 = this, r4 = "".concat(this._n, ".").concat("getRoamingMessage"), t3 = e3.peerAccount, c3 = e3.conversationID, n3 = e3.count, o3 = e3.lastMessageTime, e3 = e3.messageKey, u3 = "peerAccount:".concat(t3, " count:").concat(n3 || 15, " lastMessageTime:").concat(o3 || 0, " messageKey:").concat(e3), l3 = (M2.l("".concat(r4, " ").concat(u3)), new P2("getRoamingMessage"));
      return this.req({ P: G2.GET_C2C_ROAMING_MSG, data: { peerAccount: t3, count: n3 || 15, lastMessageTime: o3 || 0, messageKey: e3 } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.complete, n4 = e4.messageList, o4 = e4.messageKey, e4 = e4.lastMessageTime, i4 = (N3(n4) ? M2.l("".concat(r4, " ok. complete:").concat(t4, " but messageList is undefined!")) : M2.l("".concat(r4, " ok. complete:").concat(t4, " count:").concat(n4.length)), l3.setMessage("".concat(u3, " complete:").concat(t4, " length:").concat(n4.length)).end(), a3.get(11)), t4 = 1 === t4, s4 = (t4 && i4.setCompleted(c3), []), n4 = i4.onRoamingMessage(n4, c3, true, s4), o4 = (i4.modifyMessageList(c3), i4.updateIsRead(c3), i4.updateRoamingMsgKeyAndTime(c3, o4, e4), i4.getPeerReadTime(c3)), o4 = (M2.l("".concat(r4, " update isPeerRead property. convID:").concat(c3, " peerReadTime:").concat(o4)), o4 ? i4.updateMsgIsPeerReadProp(c3, o4) : (e4 = c3.replace(R2.CONV_C2C, ""), a3.getRemotePeerReadTime([e4]).then(function() {
          i4.updateMsgIsPeerReadProp(c3, i4.getPeerReadTime(c3));
        })), "");
        return 0 < n4.length ? o4 = n4[0].ID : (e4 = i4.getLocalOldestMessage(c3)) && (o4 = e4.ID), M2.l("".concat(r4, " nextReqID:").concat(o4, " storedMsgCount:").concat(n4.length)), { nextReqID: o4, storedMessageList: n4, assembledMessageList: s4, isPullingCompleted: t4 };
      }).catch(function(e4) {
        return l3.setMessage(u3).setError(e4).end(), M2.w("".concat(r4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "getRoamingMessagesHopping", value: function(e3) {
      var s4 = this, a3 = "".concat(this._n, ".").concat("getRoamingMessagesHopping"), t3 = e3.peerAccount, n3 = e3.time, n3 = void 0 === n3 ? 0 : n3, o3 = e3.count, r4 = e3.direction, c3 = "".concat(R2.CONV_C2C).concat(t3), u3 = "peerAccount:".concat(t3, " count:").concat(o3, " time:").concat(n3, " direction:").concat(r4), l3 = (M2.l("".concat(a3, " ").concat(u3)), new P2("getRoamingMessagesHopping"));
      return this.req({ P: G2.GET_C2C_ROAMING_MSG, data: { peerAccount: t3, count: o3 + 1, lastMessageTime: n3, direction: r4 } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.complete, n4 = e4.messageList, n4 = void 0 === n4 ? [] : n4, e4 = e4.lastMessageTime, o4 = "complete:".concat(t4, " count:").concat(n4.length), i4 = (M2.l("".concat(a3, " ok. ").concat(o4)), l3.setMessage("".concat(u3, " ").concat(o4)).end(), 1 !== t4 && (1 === r4 ? n4.pop() : n4.shift()), s4.get(11)), o4 = i4.onRoamingMessage(n4, c3, false), n4 = (s4._modifyMessageList(c3, o4), s4._computeResult({ complete: t4, lastMessageTime: e4, resultList: o4 })), t4 = (i4.storeHoppingMessageList(n4.messageList), i4.getPeerReadTime(c3));
        return M2.l("".concat(a3, " update isPeerRead property. convID:").concat(c3, " peerReadTime:").concat(t4)), t4 ? i4.updateMsgIsPeerReadProp(c3, t4) : (e4 = c3.replace(R2.CONV_C2C, ""), s4.getRemotePeerReadTime([e4]).then(function() {
          i4.updateMsgIsPeerReadProp(c3, i4.getPeerReadTime(c3));
        })), T2(n4);
      }).catch(function(e4) {
        return l3.setMessage(u3).setError(e4).end(), M2.w("".concat(a3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_computeResult", value: function(e3) {
      var t3 = e3.complete, t3 = void 0 === t3 ? 0 : t3, n3 = e3.lastMessageTime, e3 = e3.resultList, e3 = { messageList: d2(void 0 === e3 ? [] : e3), isCompleted: false, nextMessageTime: "" };
      return 1 === t3 ? e3.isCompleted = true : e3.nextMessageTime = n3, e3;
    } }, { key: "_modifyMessageList", value: function(e3, t3) {
      e3 = this.get(11).getLocalConversation(e3);
      if (e3)
        for (var n3 = e3.userProfile.nick, o3 = e3.userProfile.avatar, e3 = this.get(4).getNickAndAvatarByUserID(this.getMyUserID()), i4 = e3.nick, s4 = e3.avatar, a3 = t3.length - 1; 0 <= a3; a3--) {
          var r4 = t3[a3];
          "in" === r4.flow && (r4.nick !== n3 && r4.setNickAndAvatar({ nick: n3 }), r4.avatar !== o3) && r4.setNickAndAvatar({ avatar: o3 }), "out" === r4.flow && (r4.nick !== i4 && r4.setNickAndAvatar({ nick: i4 }), r4.avatar !== s4) && r4.setNickAndAvatar({ avatar: s4 });
        }
    } }, { key: "getRemotePeerReadTime", value: function(s4) {
      var a3, r4 = this, c3 = "".concat(this._n, ".").concat("getRemotePeerReadTime");
      return S2(s4) ? Promise.resolve() : (a3 = new P2("getRemotePeerReadTime"), M2.l("".concat(c3, " userIDList:").concat(s4)), this.req({ P: G2.GET_C2C_PEER_READ_TIME, data: { userIDList: s4 } }).then(function(e3) {
        var t3 = e3.data.peerReadTimeList;
        M2.l("".concat(c3, " ok. peerReadTimeList:").concat(t3));
        for (var n3 = "", o3 = r4.get(11), i4 = 0; i4 < s4.length; i4++)
          n3 += "".concat(s4[i4], "-").concat(t3[i4], " "), 0 < t3[i4] && o3.recordPeerReadTime("".concat(R2.CONV_C2C).concat(s4[i4]), t3[i4]);
        a3.setMessage(n3).end();
      }).catch(function(e3) {
        a3.setError(e3).end(), M2.w("".concat(c3, " failed. error:"), e3);
      }));
    } }, { key: "sendReadReceipt", value: function(e3) {
      var t3, n3 = e3[0].conversationID.replace(R2.CONV_C2C, ""), o3 = new P2("sendReadReceipt"), i4 = (o3.setMessage("peerAccount:".concat(n3)), this.getMyUserID()), e3 = e3.filter(function(e4) {
        return e4.from !== i4 && true === e4.needReadReceipt;
      }).map(function(e4) {
        return { fromAccount: e4.from, toAccount: e4.to, sequence: e4.sequence, random: e4.random, time: e4.time, clientTime: e4.clientTime };
      });
      return 0 === e3.length ? E2({ code: k2.READ_RECEIPT_MSG_LIST_EMPTY }) : (t3 = "".concat(this._n, ".").concat("sendReadReceipt"), M2.l("".concat(t3, ". peerAccount:").concat(n3, " length:").concat(e3.length)), this.req({ P: G2.SEND_C2C_READ_RECEIPT, data: { peerAccount: n3, messageInfoList: e3 } }).then(function(e4) {
        return o3.end(), M2.l("".concat(t3, " ok")), T2();
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.w("".concat(t3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "getReadReceiptList", value: function(e3) {
      var t3 = e3[0].conversationID.replace(R2.CONV_C2C, "");
      return M2.l("".concat(this._n, ".getReadReceiptList peerAccount:").concat(t3, " msgCount:").concat(e3.length)), D2({ messageList: e3 });
    } }, { key: "getMessageExtensions", value: function(e3, t3) {
      return M2.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t3)), this.req({ P: G2.GET_C2C_MSG_EXT, data: { from: e3.from, to: e3.to, messageKey: this.getMessageKey(e3), startSequence: t3 } });
    } }, { key: "modifyMsgExts", value: function(e3, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1;
      return M2.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n3)), this.req({ P: G2.MODIFY_C2C_MSG_EXT, data: { from: e3.from, to: e3.to, messageKey: this.getMessageKey(e3), extensionList: t3, operateType: n3 } });
    } }, { key: "getMessageKey", value: function(e3) {
      var t3 = e3.clientSequence, n3 = e3.random, e3 = e3.time;
      return "".concat(t3, "_").concat(n3, "_").concat(e3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._msgFromUnreadDBMap.clear(), this._noticeFromUnreadDBList.length = 0;
    } }]), U2 = { A2KEY_AND_TINYID_UPDATED: "_inner".concat(1), CLOUD_CONFIG: "_inner".concat(2), PROFILE_UPDATED: "_inner".concat(3), CONV_SYNC_COMPLETED: "_inner".concat(4), C2C_UNREAD_HANDLE_COMPLETED: "_inner".concat(5) }, ko = e2(function e3(t3) {
      p3(this, e3), this._convM = t3, this._map = /* @__PURE__ */ new Map(), this._n = "MsgListHandler", this._latestMsgSentByPeerMap = /* @__PURE__ */ new Map(), this._latestMsgSentByMeMap = /* @__PURE__ */ new Map(), this._hoppingMsgMap = /* @__PURE__ */ new Map(), this.TOPIC_MSG_LIMIT = 1e3, this._convM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e3 = this._convM.getCloudConfig("topic_msg_limit");
      N3(e3) || (this.TOPIC_MSG_LIMIT = Number(e3)), M2.l("".concat(this._n, "._onCloudConfig topicMsgLimit:").concat(this.TOPIC_MSG_LIMIT));
    } }, { key: "onCheckTimer", value: function(e3) {
      if (e3 % 20 == 0 && 0 < this._map.size) {
        var t3, n3 = F2(this._map);
        try {
          for (n3.s(); !(t3 = n3.n()).done; ) {
            var o3 = j2(t3.value, 2), i4 = o3[0], s4 = o3[1];
            i4.includes(et2) && s4.size >= this.TOPIC_MSG_LIMIT && this._convM.clearMemMsg(i4, true);
          }
        } catch (e4) {
          n3.e(e4);
        } finally {
          n3.f();
        }
      }
    } }, { key: "pushIn", value: function(e3) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1], n3 = e3.conversationID, o3 = true, i4 = (this._map.has(n3) || this._map.set(n3, /* @__PURE__ */ new Map()), this._getUniqueIDOfMsg(e3));
      if (this._map.get(n3).has(i4)) {
        var s4 = this._map.get(n3).get(i4);
        if (!t3 || true === s4.isModified)
          return false;
      }
      return this._map.get(n3).set(i4, e3), this._setLatestMsgSentByPeer(n3, e3), this._setLatestMsgSentByMe(n3, e3), o3;
    } }, { key: "unshift", value: function(e3, t3) {
      var n3;
      if (O2(e3) ? 0 < e3.length && (n3 = e3[0].conversationID, this._unshiftMultipleMsgs(e3, t3)) : (n3 = e3.conversationID, this._unshiftSingleMsg(e3, t3)), n3) {
        var o3 = Array.from(this._map.get(n3).values()), e3 = o3.length;
        if (0 !== e3) {
          for (var i4 = e3 - 1; 0 <= i4; i4--)
            if ("out" === o3[i4].flow) {
              this._setLatestMsgSentByMe(n3, o3[i4]);
              break;
            }
          if (n3.startsWith(R2.CONV_C2C)) {
            for (var s4 = e3 - 1; 0 <= s4; s4--)
              if ("in" === o3[s4].flow) {
                this._setLatestMsgSentByPeer(n3, o3[s4]);
                break;
              }
          }
        }
      }
    } }, { key: "_unshiftSingleMsg", value: function(e3, t3) {
      var n3, o3, i4 = e3.conversationID, s4 = this._getUniqueIDOfMsg(e3);
      this._map.has(i4) ? (n3 = this._map.get(i4), o3 = Array.from(n3), n3.has(s4) || (o3.unshift([s4, e3]), this._map.set(i4, new Map(o3)), t3.push(e3))) : (this._map.set(i4, /* @__PURE__ */ new Map()), this._map.get(i4).set(s4, e3), t3.push(e3));
    } }, { key: "_unshiftMultipleMsgs", value: function(e3, t3) {
      for (var n3 = e3.length, o3 = [], i4 = e3[0].conversationID, s4 = this._map.get(i4), a3 = this._map.has(i4) ? Array.from(s4) : [], r4 = 0; r4 < n3; r4++) {
        var c3 = this._getUniqueIDOfMsg(e3[r4]);
        s4 && s4.has(c3) || (o3.push([c3, e3[r4]]), t3.push(e3[r4]));
      }
      this._map.set(i4, new Map(o3.concat(a3)));
    } }, { key: "remove", value: function(e3) {
      var t3 = e3.conversationID, e3 = this._getUniqueIDOfMsg(e3);
      this._map.has(t3) && this._map.get(t3).delete(e3);
    } }, { key: "revoke", value: function(e3, t3, n3) {
      var o3;
      return this._map.has(e3) ? (o3 = this._map.get(e3), this._updateMsgIsRevoked(o3, t3, n3)) : this._hoppingMsgMap.has(e3) ? (o3 = this._hoppingMsgMap.get(e3), this._updateMsgIsRevoked(o3, t3, n3)) : null;
    } }, { key: "_updateMsgIsRevoked", value: function(e3, t3, n3) {
      var o3, i4 = F2(e3);
      try {
        for (i4.s(); !(o3 = i4.n()).done; ) {
          var s4 = j2(o3.value, 2)[1];
          if (s4.sequence === t3 && (N3(n3) || s4.random === n3))
            return s4.isRevoked || (s4.isRevoked = true), s4;
        }
      } catch (e4) {
        i4.e(e4);
      } finally {
        i4.f();
      }
    } }, { key: "removeByConvID", value: function(e3) {
      var t3 = this._map.has(e3);
      M2.l("".concat(this._n, ".removeByConvID convID:").concat(e3, " has:").concat(t3)), t3 && (this._map.delete(e3), this._latestMsgSentByPeerMap.delete(e3), this._latestMsgSentByMeMap.delete(e3));
    } }, { key: "findMessage", value: function(e3) {
      return this._findMsg(e3, this._map) || this._findMsg(e3, this._hoppingMsgMap);
    } }, { key: "_findMsg", value: function(e3, t3) {
      var n3, o3 = null, i4 = F2(t3);
      try {
        for (i4.s(); !(n3 = i4.n()).done; )
          for (var s4 = d2(j2(n3.value, 2)[1].values()), a3 = s4.length, r4 = 0; r4 < a3; r4++)
            if (s4[r4].ID === e3) {
              o3 = s4[r4];
              break;
            }
      } catch (e4) {
        i4.e(e4);
      } finally {
        i4.f();
      }
      return o3;
    } }, { key: "updateMsgIsPeerReadProp", value: function(e3, t3) {
      var n3, o3 = [];
      return this._map.has(e3) ? (n3 = this._map.get(e3), o3 = this._updateMsgIsPeerReadProp(n3, t3)) : this._hoppingMsgMap.has(e3) && (n3 = this._hoppingMsgMap.get(e3), o3 = this._updateMsgIsPeerReadProp(n3, t3)), M2.l("".concat(this._n, ".updateMsgIsPeerReadProp convID:").concat(e3, " peerReadTime:").concat(t3, " count:").concat(o3.length)), o3;
    } }, { key: "_updateMsgIsPeerReadProp", value: function(e3, t3) {
      var n3, o3 = [], i4 = F2(e3);
      try {
        for (i4.s(); !(n3 = i4.n()).done; ) {
          var s4 = j2(n3.value, 2)[1];
          s4.time <= t3 && !s4.isPeerRead && "out" === s4.flow && (s4.isPeerRead = true, o3.push(s4));
        }
      } catch (e4) {
        i4.e(e4);
      } finally {
        i4.f();
      }
      return o3;
    } }, { key: "updateMsgIsModifiedProp", value: function(e3) {
      var t3 = e3.conversationID;
      this._map.has(t3) && (e3 = this._getUniqueIDOfMsg(e3), t3 = this._map.get(t3).get(e3)) && (t3.isModified = true);
    } }, { key: "hasLocalMsgList", value: function(e3) {
      return this._map.has(e3);
    } }, { key: "getLocalMsgList", value: function(e3) {
      return this.hasLocalMsgList(e3) ? d2(this._map.get(e3).values()) : [];
    } }, { key: "getLocalMaxSeq", value: function(e3) {
      return this.hasLocalMsgList(e3) ? (e3 = d2(this._map.get(e3).values()).map(function(e4) {
        return e4.sequence;
      }), Math.max.apply(Math, d2(e3))) : 0;
    } }, { key: "getLocalMaxTime", value: function(e3) {
      return this.hasLocalMsgList(e3) ? (e3 = d2(this._map.get(e3).values()).map(function(e4) {
        return e4.time;
      }), Math.max.apply(Math, d2(e3))) : 0;
    } }, { key: "hasLocalMsg", value: function(e3, t3) {
      for (var n3 = false, o3 = this.getLocalMsgList(e3), i4 = o3.length, s4 = 0; s4 < i4; s4++)
        o3[s4].ID === t3 && (n3 = true);
      return n3;
    } }, { key: "getLocalMsg", value: function(e3, t3) {
      for (var n3 = null, o3 = this.getLocalMsgList(e3), i4 = o3.length, s4 = 0; s4 < i4; s4++)
        if (o3[s4].ID === t3) {
          n3 = o3[s4];
          break;
        }
      return n3;
    } }, { key: "getLocalLastMsg", value: function(e3) {
      for (var t3 = this.getLocalMsgList(e3), n3 = void 0, o3 = t3.length - 1; 0 <= o3; o3--)
        if (t3[o3].status === On) {
          n3 = t3[o3];
          break;
        }
      return n3;
    } }, { key: "getLocalSecondLastMsg", value: function(e3) {
      e3 = this.getLocalMsgList(e3);
      return e3[e3.length - 2];
    } }, { key: "getLocalOldestMsg", value: function(e3) {
      return this.getLocalMsgList(e3)[0];
    } }, { key: "_setLatestMsgSentByPeer", value: function(e3, t3) {
      e3.startsWith(R2.CONV_C2C) && "in" === t3.flow && this._latestMsgSentByPeerMap.set(e3, t3);
    } }, { key: "_setLatestMsgSentByMe", value: function(e3, t3) {
      "out" === t3.flow && this._latestMsgSentByMeMap.set(e3, t3);
    } }, { key: "getLatestMsgSentByPeer", value: function(e3) {
      return this._latestMsgSentByPeerMap.get(e3);
    } }, { key: "getLatestMsgSentByMe", value: function(e3) {
      return this._latestMsgSentByMeMap.get(e3);
    } }, { key: "modifyMsgSentByPeer", value: function(e3) {
      var t3 = e3.conversationID, n3 = e3.latestNick, o3 = e3.latestAvatar, e3 = this._map.get(t3);
      if (!S2(e3)) {
        var i4 = Array.from(e3.values()), e3 = i4.length;
        if (0 !== e3) {
          for (var s4 = null, a3 = 0, r4 = false, c3 = e3 - 1; 0 <= c3; c3--)
            "in" === i4[c3].flow && ((s4 = i4[c3]).nick !== n3 && (s4.setNickAndAvatar({ nick: n3 }), r4 = true), s4.avatar !== o3 && (s4.setNickAndAvatar({ avatar: o3 }), r4 = true), r4) && (a3 += 1);
          M2.l("".concat(this._n, ".modifyMsgSentByPeer convID:").concat(t3, " count:").concat(a3));
        }
      }
    } }, { key: "modifyMsgSentByMe", value: function(e3) {
      var t3 = e3.conversationID, n3 = e3.latestNick, o3 = e3.latestAvatar, e3 = this._map.get(t3);
      if (!S2(e3)) {
        var i4 = Array.from(e3.values()), e3 = i4.length;
        if (0 !== e3) {
          for (var s4 = null, a3 = 0, r4 = false, c3 = e3 - 1; 0 <= c3; c3--)
            "out" === i4[c3].flow && ((s4 = i4[c3]).nick !== n3 && (s4.setNickAndAvatar({ nick: n3 }), r4 = true), s4.avatar !== o3 && (s4.setNickAndAvatar({ avatar: o3 }), r4 = true), r4) && (a3 += 1);
          M2.l("".concat(this._n, ".modifyMsgSentByMe convID:").concat(t3, " count:").concat(a3));
        }
      }
    } }, { key: "getTopicConvIDList", value: function(t3) {
      return d2(this._map.keys()).filter(function(e3) {
        return e3.startsWith("".concat(R2.CONV_GROUP).concat(t3));
      });
    } }, { key: "onMsgModified", value: function(e3, t3) {
      var n3, o3, i4, s4;
      return (this._map.has(e3) || this._hoppingMsgMap.has(e3)) && (n3 = "".concat(this._n, ".onMsgModified"), i4 = this._getUniqueIDOfMsg(t3), s4 = !!(o3 = this._getTargetMsg(e3, i4)), M2.l("".concat(n3, " convID:").concat(e3, " uniqueID:").concat(i4, " has:").concat(s4)), s4) ? (e3 = t3.messageVersion, i4 = t3.elements, s4 = t3.cloudCustomData, t3 = t3.checkResult, M2.l("".concat(n3, " localVersion:").concat(o3.version, " remoteVersion:").concat(e3)), o3.version < e3 ? (o3.version = e3, o3._elements = JSON.parse(JSON.stringify(i4)), o3.payload = o3._elements[0].content, o3.type = o3._elements[0].type, o3.cloudCustomData = s4, o3.isModified = true, o3.hasRiskContent = nn(t3), { isUpdated: true, message: o3 }) : { isUpdated: false, message: o3 }) : { isUpdated: false, message: null };
    } }, { key: "_getUniqueIDOfMsg", value: function(e3) {
      var t3 = e3.from, n3 = e3.to, o3 = e3.random, i4 = e3.sequence, e3 = e3.time;
      return "".concat(t3, "-").concat(n3, "-").concat(o3, "-").concat(i4, "-").concat(e3);
    } }, { key: "_getTargetMsg", value: function(e3, t3) {
      if (this._map.has(e3))
        return this._map.get(e3).get(t3);
      var n3 = void 0;
      if (this._hoppingMsgMap.has(e3)) {
        for (var o3 = d2(this._hoppingMsgMap.get(e3).values()), i4 = 0; i4 < o3.length; i4++)
          if (this._getUniqueIDOfMsg(o3[i4]) === t3) {
            n3 = o3[i4];
            break;
          }
      }
      return n3;
    } }, { key: "storeHoppingMsgList", value: function(e3) {
      if (0 !== e3.length) {
        var t3 = e3[0].conversationID, n3 = e3.length;
        this._hoppingMsgMap.has(t3) || this._hoppingMsgMap.set(t3, /* @__PURE__ */ new Map());
        for (var o3 = this._hoppingMsgMap.get(t3), i4 = 0; i4 < n3; i4++) {
          var s4 = e3[i4];
          o3.has(s4.ID) || o3.set(s4.ID, s4);
        }
      }
    } }, { key: "getHoppingMsg", value: function(e3, t3) {
      if (this._hoppingMsgMap.has(e3))
        return this._hoppingMsgMap.get(e3).get(t3);
    } }, { key: "reset", value: function() {
      this._map.clear(), this._latestMsgSentByPeerMap.clear(), this._latestMsgSentByMeMap.clear(), this._hoppingMsgMap.clear();
    } }]);
    function Ro(e3) {
      return p3(this, Ro), (e3 = i3(this, Ro, [e3]))._n = "C2CModule", e3._msgFromUnreadDBMap = /* @__PURE__ */ new Map(), e3._noticeFromUnreadDBList = [], e3;
    }
    function Ao(e3) {
      this.mixin(e3);
    }
    Ao.mixin = function(e3) {
      e3 = e3.prototype || e3;
      e3._isReady = false, e3.ready = function(e4) {
        if (e4)
          return this._isReady ? void (1 < arguments.length && void 0 !== arguments[1] && arguments[1] ? e4.call(this) : setTimeout(e4, 1)) : (this._readyQueue = this._readyQueue || [], void this._readyQueue.push(e4));
      }, e3.triggerReady = function() {
        var t3 = this;
        this._isReady = true, setTimeout(function() {
          var e4 = t3._readyQueue;
          t3._readyQueue = [], e4 && 0 < e4.length && e4.forEach(function(e5) {
            e5.call(this);
          }, t3);
        }, 1);
      }, e3.resetReady = function() {
        this._isReady = false, this._readyQueue = [];
      }, e3.isReady = function() {
        return this._isReady;
      };
    };
    function Oo(e3, t3, n3) {
      return N3(e3) ? { lastTime: 0, lastSequence: 0, fromAccount: "", messageForShow: "", payload: null, type: "", isRevoked: false, cloudCustomData: "", onlineOnlyFlag: false, nick: "", nameCard: "", version: 0, isPeerRead: false, revoker: null } : n3 && e3.ID || e3 instanceof Do ? { lastTime: e3.time || 0, lastSequence: e3.sequence || 0, fromAccount: e3.from || "", messageForShow: Jt2(e3.type, e3.payload, t3), payload: e3.payload || null, type: e3.type || null, isRevoked: e3.isRevoked || false, cloudCustomData: e3.cloudCustomData || "", onlineOnlyFlag: e3._onlineOnlyFlag || false, nick: e3.nick || "", nameCard: e3.nameCard || "", version: e3.version || 0, isPeerRead: e3.isPeerRead || false, revoker: e3.revoker || null } : y2(y2({}, e3), {}, { messageForShow: Jt2(e3.type, e3.payload, t3) });
    }
    function No(e3, t3) {
      return S2(e3) ? { lastTime: 0, lastSequence: 0, fromAccount: "", payload: null, type: "", messageForShow: "", nick: "", avatar: "", version: 0, cloudCustomData: "", isRevoked: false, revoker: null } : { lastTime: e3.time || 0, lastSequence: e3.sequence || 0, fromAccount: e3.from || "", payload: e3.payload || null, type: e3.type || "", messageForShow: Jt2(e3.type, e3.payload, t3), nick: e3.nick || "", avatar: e3.avatar || "", version: e3.version || 0, cloudCustomData: e3.cloudCustomData || "", isRevoked: e3.isRevoked || false, revoker: e3.revoker || null };
    }
    function Go(e3) {
      var t3 = String(e3).replace(/[=]+$/, ""), n3 = "";
      if (t3.length % 4 == 1)
        return "";
      for (var o3, i4, s4 = 0, a3 = 0; i4 = t3.charAt(a3++); ~i4 && (o3 = s4 % 4 ? 64 * o3 + i4 : i4, s4++ % 4) && (n3 += String.fromCharCode(255 & o3 >> (-2 * s4 & 6))))
        i4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i4);
      try {
        return decodeURIComponent(escape(n3));
      } catch (e4) {
        return "";
      }
    }
    var Po = ["jpg", "jpeg", "gif", "png", "bmp", "image", "webp"], Uo = ["mp4", "quicktime", "mov"], bo = e2(function e3(t3) {
      var n3 = this;
      p3(this, e3), S2(t3) || (this.userID = t3.userID || "", this.nick = t3.nick || "", this.gender = t3.gender || "", this.birthday = t3.birthday || 0, this.location = t3.location || "", this.selfSignature = t3.selfSignature || "", this.allowType = t3.allowType || R2.ALLOW_TYPE_ALLOW_ANY, this.language = t3.language || 0, this.avatar = t3.avatar || "", this.messageSettings = t3.messageSettings || 0, this.adminForbidType = t3.adminForbidType || R2.FORBID_TYPE_NONE, this.level = t3.level || 0, this.role = t3.role || 0, this.lastUpdatedTime = 0, this.profileCustomField = [], S2(t3.profileCustomField)) || t3.profileCustomField.forEach(function(e4) {
        n3.profileCustomField.push({ key: e4.key, value: e4.value });
      });
    }, [{ key: "validate", value: function(e3) {
      var t3, n3 = true, o3 = "";
      if (S2(e3))
        return { valid: false, tips: "empty options" };
      if (e3.profileCustomField)
        for (var i4 = e3.profileCustomField.length, s4 = null, a3 = 0; a3 < i4; a3++) {
          if (s4 = e3.profileCustomField[a3], !C2(s4.key) || -1 === s4.key.indexOf("Tag_Profile_Custom"))
            return { valid: false, tips: "The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom" };
          if (!C2(s4.value))
            return { valid: false, tips: "The type of values of the custom profile key-value pairs (which is profileCustomField) must be String" };
        }
      for (t3 in e3)
        if (Object.prototype.hasOwnProperty.call(e3, t3)) {
          if ("profileCustomField" === t3)
            continue;
          if (S2(e3[t3]) && !C2(e3[t3]) && !A2(e3[t3])) {
            o3 = "key:" + t3 + ", invalid value:" + e3[t3], n3 = false;
            continue;
          }
          switch (t3) {
            case "nick":
              C2(e3[t3]) || (n3 = !(o3 = "nick must be a string")), 500 < _t2(e3[t3]) && (o3 = "nick name limited: must less than or equal to ".concat(500, " bytes, current size: ").concat(_t2(e3[t3]), " bytes"), n3 = false);
              break;
            case "gender":
              ft2(ze2, e3.gender) || (o3 = "key:gender, invalid value:" + e3.gender, n3 = false);
              break;
            case "birthday":
              A2(e3.birthday) || (n3 = !(o3 = "birthday must be a number"));
              break;
            case "location":
              C2(e3.location) || (n3 = !(o3 = "location must be a string"));
              break;
            case "selfSignature":
              C2(e3.selfSignature) || (n3 = !(o3 = "selfSignature must be a string"));
              break;
            case "allowType":
              ft2(Ze2, e3.allowType) || (o3 = "key:allowType, invalid value:" + e3.allowType, n3 = false);
              break;
            case "language":
              A2(e3.language) || (n3 = !(o3 = "language must be a number"));
              break;
            case "avatar":
              C2(e3.avatar) || (n3 = !(o3 = "avatar must be a string"));
              break;
            case "messageSettings":
              0 !== e3.messageSettings && 1 !== e3.messageSettings && (n3 = !(o3 = "messageSettings must be 0 or 1"));
              break;
            case "adminForbidType":
              ft2(Xe2, e3.adminForbidType) || (o3 = "key:adminForbidType, invalid value:" + e3.adminForbidType, n3 = false);
              break;
            case "level":
              A2(e3.level) || (n3 = !(o3 = "level must be a number"));
              break;
            case "role":
              A2(e3.role) || (n3 = !(o3 = "role must be a number"));
              break;
            default:
              o3 = "unknown key:" + t3 + "  " + e3[t3], n3 = false;
          }
        }
      return { valid: n3, tips: o3 };
    } }]), wo = e2(function e3(t3) {
      p3(this, e3), this.MAX_LENGTH = t3, this.map = /* @__PURE__ */ new Map();
    }, [{ key: "set", value: function(e3) {
      var t3;
      this.map.size >= this.MAX_LENGTH && (t3 = this.map.entries().next().value[0], this.map.delete(t3)), this.map.set(e3, 1);
    } }, { key: "has", value: function(e3) {
      return this.map.has(e3);
    } }, { key: "delete", value: function(e3) {
      this.has(e3) && this.map.delete(e3);
    } }, { key: "reset", value: function() {
      this.map.clear();
    } }]), Fo = ["groupID", "name", "avatar", "type", "introduction", "notification", "ownerID", "selfInfo", "createTime", "infoSequence", "lastInfoTime", "lastMessage", "nextMessageSeq", "memberNum", "maxMemberNum", "memberList", "joinOption", "groupCustomField", "muteAllMembers", "isSupportTopic", "inviteOption", "_lastRevokedTime"], qo = e2(function e3(t3) {
      p3(this, e3), this.groupID = "", this.name = "", this.avatar = "", this.type = "", this.introduction = "", this.notification = "", this.ownerID = "", this.createTime = "", this.infoSequence = "", this.lastInfoTime = "", this.selfInfo = { messageRemindType: "", joinTime: "", nameCard: "", role: "", userID: "", memberCustomField: void 0, readedSequence: 0, excludedUnreadSequenceList: void 0 }, this.lastMessage = { lastTime: "", lastSequence: "", fromAccount: "", messageForShow: "" }, this.nextMessageSeq = "", this.memberNum = "", this.memberCount = "", this.maxMemberNum = "", this.maxMemberCount = "", this.joinOption = "", this.inviteOption = "", this.groupCustomField = [], this.muteAllMembers = false, this.isSupportTopic = false, this._lastRevokedTime = 0, this._initGroup(t3);
    }, [{ key: "memberNum", get: function() {
      return this.memberCount;
    }, set: function(e3) {
    } }, { key: "maxMemberNum", get: function() {
      return this.maxMemberCount;
    }, set: function(e3) {
    } }, { key: "_initGroup", value: function(e3) {
      for (var t3 in e3)
        Fo.indexOf(t3) < 0 || ("selfInfo" !== t3 ? ("memberNum" === t3 && (this.memberCount = e3[t3]), "maxMemberNum" === t3 && (this.maxMemberCount = e3[t3]), "isSupportTopic" !== t3 ? this[t3] = e3[t3] : this.isSupportTopic = 1 === e3[t3]) : this.updateSelfInfo(e3[t3]));
    } }, { key: "updateGroup", value: function(e3) {
      var t3 = this, e3 = (e3.appid = void 0, e3.grossTopicNextMsgSeq = void 0, e3.selfInfo && (e3.selfInfo.grossTopicReadSeq = void 0), JSON.parse(JSON.stringify(e3)));
      e3.lastMsgTime && (this.lastMessage.lastTime = e3.lastMsgTime), N3(e3.muteAllMembers) || ("On" === e3.muteAllMembers ? e3.muteAllMembers = true : e3.muteAllMembers = false), e3.groupCustomField && Lt2(this.groupCustomField, e3.groupCustomField), N3(e3.memberNum) || (this.memberCount = e3.memberNum), N3(e3.maxMemberNum) || (this.maxMemberCount = e3.maxMemberNum), N3(e3.isSupportTopic) || (this.isSupportTopic = A2(e3.isSupportTopic) ? 1 === e3.isSupportTopic : e3.isSupportTopic), dt2(this, e3, ["members", "errorCode", "lastMsgTime", "groupCustomField", "memberNum", "maxMemberNum", "isSupportTopic"]), O2(e3.members) && 0 < e3.members.length && e3.members.forEach(function(e4) {
        e4.userID === t3.selfInfo.userID && dt2(t3.selfInfo, e4, ["sequence"]);
      });
    } }, { key: "updateSelfInfo", value: function(e3) {
      e3 = { nameCard: e3.nameCard, joinTime: e3.joinTime, role: e3.role, messageRemindType: e3.messageRemindType, readedSequence: e3.readedSequence, excludedUnreadSequenceList: e3.excludedUnreadSequenceList };
      dt2(this.selfInfo, y2({}, e3), [], ["", null, void 0, 0, NaN]);
    } }, { key: "setSelfNameCard", value: function(e3) {
      this.selfInfo.nameCard = e3;
    } }]), xo = e2(function e3(t3, n3) {
      var o3 = 2 < arguments.length && void 0 !== arguments[2] && arguments[2];
      p3(this, e3), this.conversationID = t3.conversationID || "", this.unreadCount = t3.unreadCount || 0, this.type = t3.type || "", this.lastMessage = Oo(t3.lastMessage, n3, o3), t3.lastMsgTime && (this.lastMessage.lastTime = t3.lastMsgTime), this._isInfoCompleted = false, this.peerReadTime = t3.peerReadTime || 0, this.groupAtInfoList = [], this.remark = "", this.isPinned = t3.isPinned || false, this.messageRemindType = t3.messageRemindType, this.markList = t3.markList || [], this.customData = t3.customData || "", this.conversationGroupList = t3.conversationGroupList || [], this.draftText = t3.draftText || "", this._initProfile(t3), this.subType = this.groupProfile ? this.groupProfile.type : "";
    }, [{ key: "toAccount", get: function() {
      return this.conversationID.startsWith(R2.CONV_C2C) ? this.conversationID.replace(R2.CONV_C2C, "") : this.conversationID.startsWith(R2.CONV_GROUP) ? this.conversationID.replace(R2.CONV_GROUP, "") : "";
    } }, { key: "_initProfile", value: function(t3) {
      var n3 = this;
      Object.keys(t3).forEach(function(e3) {
        switch (e3) {
          case "userProfile":
            n3.userProfile = t3.userProfile;
            break;
          case "groupProfile":
            n3.groupProfile = t3.groupProfile;
        }
      }), N3(this.userProfile) && this.type === R2.CONV_C2C ? this.userProfile = new bo({ userID: t3.conversationID.replace("C2C", "") }) : N3(this.groupProfile) && this.type === R2.CONV_GROUP && (this.groupProfile = new qo({ groupID: t3.conversationID.replace("GROUP", "") }));
    } }, { key: "updateUnreadCount", value: function(e3) {
      var t3 = e3.nextUnreadCount, n3 = e3.isFromGetConversations, e3 = e3.isUnreadC2CMessage;
      N3(t3) || (At2(this.subType) ? this.unreadCount = 0 : n3 && this.type === R2.CONV_GROUP || n3 && this.type === R2.CONV_TOPIC || e3 && this.type === R2.CONV_C2C ? this.unreadCount = t3 : this.unreadCount = this.unreadCount + t3);
    } }, { key: "updateLastMessage", value: function(e3) {
      this.lastMessage = Oo(e3);
    } }, { key: "updateGroupAtInfoList", value: function(e3) {
      var t3;
      this._isNeedMergeGroupAtInfo(e3) || (-1 !== (t3 = (b2(t3 = e3.groupAtType) || B2(t3) || X2(t3) || H2()).slice(0)).indexOf(R2.CONV_AT_ME) && -1 !== t3.indexOf(R2.CONV_AT_ALL) && (t3 = [R2.CONV_AT_ALL_AT_ME]), t3 = { from: e3.from, groupID: e3.groupID, topicID: e3.topicID, messageSequence: e3.sequence, atTypeArray: t3, __random: e3.__random, __sequence: e3.__sequence }, this.groupAtInfoList.push(t3));
    } }, { key: "_isNeedMergeGroupAtInfo", value: function(t3) {
      var n3, e3 = t3.groupID, o3 = t3.sequence;
      return !!Ot2({ groupID: e3 }) && (n3 = false, this.groupAtInfoList.forEach(function(e4) {
        e4.messageSequence === o3 && (-1 < e4.atTypeArray.indexOf(R2.CONV_AT_ME) && -1 < t3.groupAtType.indexOf(R2.CONV_AT_ALL) && (e4.atTypeArray = [R2.CONV_AT_ALL_AT_ME]), -1 < e4.atTypeArray.indexOf(R2.CONV_AT_ALL) && -1 < t3.groupAtType.indexOf(R2.CONV_AT_ME) && (e4.atTypeArray = [R2.CONV_AT_ALL_AT_ME], e4.__random = t3.__random, e4.__sequence = t3.__sequence), n3 = true);
      }), n3);
    } }, { key: "clearGroupAtInfoList", value: function() {
      this.groupAtInfoList.length = 0;
    } }, { key: "reduceUnreadCount", value: function() {
      return 1 <= this.unreadCount && (--this.unreadCount, true);
    } }, { key: "isLastMessageRevoked", value: function(e3) {
      var t3 = e3.sequence, e3 = e3.time;
      return this.type === R2.CONV_C2C && t3 === this.lastMessage.lastSequence && e3 === this.lastMessage.lastTime || this.type === R2.CONV_GROUP && t3 === this.lastMessage.lastSequence;
    } }, { key: "setLastMessageRevoked", value: function(e3) {
      this.lastMessage.isRevoked = e3;
    } }, { key: "setLastMessageRevoker", value: function(e3) {
      this.lastMessage.revoker = e3;
    } }, { key: "setDraftText", value: function(e3) {
      this.draftText = e3;
    } }]), Vo = q2(q2(q2({}, R2.MSG_REMIND_ACPT_AND_NOTE, 0), R2.MSG_REMIND_DISCARD, 1), R2.MSG_REMIND_ACPT_NOT_NOTE, 2), Bo = e2(function e3(t3) {
      p3(this, e3), this._convM = t3, this._n = "MsgRemindHandler";
    }, [{ key: "onAllRcvMsgOptNotify", value: function(e3) {
      e3 = this._handleResult(e3);
      this._convM.emitOEvt(h2.ALL_RECEIVE_MESSAGE_OPT_UPDATED, e3);
    } }, { key: "getC2CMsgRemindType", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".getC2CMsgRemindType");
      return this._convM.req({ P: G2.GET_C2C_PEER_MUTE_NOTIFICATIONS, data: { toAccount: this._convM.getMyUserID(), userIDList: t3 } }).then(function(e3) {
        M2.l("".concat(o3, " ok. userIDList:").concat(t3));
        e3 = e3.data.muteFlagList;
        n3._convM.onC2CMsgRemindTypeFetched(e3);
      }).catch(function(e3) {
        M2.e("".concat(o3, " failed. error:"), e3);
      });
    } }, { key: "set", value: function(e3) {
      return e3.groupID ? this._setGroupMsgRemindType(e3) : O2(e3.userIDList) ? this._setC2CMsgRemindType(e3) : void 0;
    } }, { key: "_setGroupMsgRemindType", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("_setGroupMsgRemindType"), e3 = t3.groupID, i4 = t3.messageRemindType, s4 = "groupID:".concat(e3, " messageRemindType:").concat(i4), a3 = new P2("_setGroupMsgRemindType"), r4 = (a3.setMessage(s4), this._get(7));
      return r4 ? r4.modifyGroupMemberInfo({ groupID: e3, messageRemindType: i4, userID: this._convM.getMyUserID() }).then(function() {
        a3.end(), M2.l("".concat(o3, " ok. ").concat(s4));
        var e4 = n3.onGroupMsgRemindTypeUpdated(t3);
        return n3._convM.onTotalUnreadCountUpdate(), T2(e4);
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      }) : E2({ code: k2.NO_MODULE });
    } }, { key: "onGroupMsgRemindTypeUpdated", value: function(e3) {
      var t3, n3, o3 = e3.groupID, e3 = e3.messageRemindType, i4 = (M2.l("".concat(this._n, ".onGroupMsgRemindTypeUpdated groupID:").concat(o3, " messageRemindType:").concat(e3)), this._get(7).getLocalGroupProfile(o3));
      return i4 && (i4.selfInfo.messageRemindType = e3), Nt2(o3) ? (t3 = jt2(n3 = o3), (n3 = this._get(10).getLocalTopic(t3, n3)) && n3.updateSelfInfo({ messageRemindType: e3 }) && this._convM.emitOEvt(h2.TOPIC_UPDATED, { groupID: t3, topic: n3 }), { topic: n3 }) : (this._convM.patchMsgRemindType({ ID: o3, isC2CConversation: false, messageRemindType: e3 }) && this._emitConvUpdate(), { group: i4 });
    } }, { key: "_setC2CMsgRemindType", value: function(e3) {
      var i4 = this, s4 = "".concat(this._n, ".").concat("_setC2CMsgRemindType"), t3 = e3.userIDList, a3 = e3.messageRemindType, r4 = t3.slice(0, 30), e3 = Vo[a3] || 0, c3 = "userIDList:".concat(r4, " messageRemindType:").concat(a3), u3 = new P2("_setC2CMsgRemindType");
      return u3.setMessage(c3), this._convM.req({ P: G2.SET_C2C_PEER_MUTE_NOTIFICATIONS, data: { userIDList: r4, muteFlag: e3 } }).then(function(e4) {
        u3.end();
        var e4 = e4.data.errorList, t4 = [], n3 = [], e4 = (O2(e4) && e4.forEach(function(e5) {
          t4.push(e5.userID), n3.push({ userID: e5.userID, code: e5.errorCode });
        }), r4.filter(function(e5) {
          return -1 === t4.indexOf(e5);
        })), o3 = (M2.l("".concat(s4, " ok. ").concat(c3, " successUserIDList:").concat(e4, " failureUserIDList:").concat(JSON.stringify(n3))), 0);
        return e4.forEach(function(e5) {
          i4._convM.patchMsgRemindType({ ID: e5, isC2CConversation: true, messageRemindType: a3 }) && (o3 += 1);
        }), 1 <= o3 && i4._emitConvUpdate(), r4.length = t4.length = 0, i4._convM.onTotalUnreadCountUpdate(), D2({ successUserIDList: e4.map(function(e5) {
          return { userID: e5 };
        }), failureUserIDList: n3 });
      }).catch(function(e4) {
        return u3.setError(e4).end(), M2.e("".concat(s4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_get", value: function(e3) {
      return this._convM.get(e3);
    } }, { key: "_emitConvUpdate", value: function() {
      this._convM.emitConvUpdate(true, false);
    } }, { key: "setAllRcvMsgOpt", value: function(e3) {
      var t3 = "".concat(this._n, ".").concat("setAllRcvMsgOpt"), n3 = e3.messageRemindType, n3 = void 0 === n3 ? R2.MSG_REMIND_ACPT_NOT_NOTE : n3, o3 = e3.isRepeated, o3 = void 0 === o3 || o3, i4 = this._calcStartAndEndTime(e3), s4 = i4.startTime, s4 = void 0 === s4 ? 0 : s4, i4 = i4.endTime, i4 = void 0 === i4 ? 0 : i4, e3 = JSON.stringify(e3), a3 = new P2("setAllRcvMsgOpt");
      return a3.setMessage(e3), M2.l("".concat(t3, " options:").concat(e3)), this._convM.req({ P: G2.SET_ALL_RECEIVE_MSG_OPT, data: { messageRemindType: Vo[n3], startTime: s4, endTime: i4, isRepeated: o3 ? 1 : 0 } }).then(function(e4) {
        return a3.end(), M2.l("".concat(t3, " ok.")), T2(e4);
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_calcStartAndEndTime", value: function(e3) {
      var t3 = e3.startHour, t3 = void 0 === t3 ? 0 : t3, n3 = e3.startMinute, n3 = void 0 === n3 ? 0 : n3, o3 = e3.startSecond, o3 = void 0 === o3 ? 0 : o3, i4 = e3.duration, i4 = void 0 === i4 ? 0 : i4, e3 = e3.isRepeated, e3 = void 0 === e3 || e3, s4 = /* @__PURE__ */ new Date(), a3 = s4.getFullYear(), r4 = s4.getMonth(), s4 = s4.getDate(), a3 = Math.round(new Date(a3, r4, s4, t3, n3, o3).getTime() / 1e3);
      return { startTime: a3, endTime: e3 && 86400 <= i4 ? a3 + 86400 : a3 + i4 };
    } }, { key: "getAllRcvMsgOpt", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("getAllRcvMsgOpt"), o3 = new P2("getAllRcvMsgOpt");
      return this._convM.req({ P: G2.GET_ALL_RECEIVE_MSG_OPT, data: { toAccount: this._convM.getMyUserID() } }).then(function(e3) {
        e3 = e3.data, o3.setMessage(JSON.stringify(e3)).end(), M2.l("".concat(n3, " ok. data:").concat(JSON.stringify(e3))), e3 = t3._handleResult(e3);
        return T2(e3);
      }).catch(function(e3) {
        return o3.setError(e3).end(), M2.e("".concat(n3, " failed. error:"), e3), E2(e3);
      });
    } }, { key: "_handleResult", value: function(e3) {
      var t3 = e3.messageRemindType, n3 = e3.startTime, o3 = e3.endTime, e3 = e3.isRepeated, i4 = R2.MSG_REMIND_ACPT_AND_NOTE;
      return 1 === t3 && (i4 = R2.MSG_REMIND_DISCARD), { messageRemindType: i4 = 2 === t3 ? R2.MSG_REMIND_ACPT_NOT_NOTE : i4, startTime: n3, endTime: o3, isRepeated: 1 === e3 };
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }]), Ho = e2(function e3(t3) {
      p3(this, e3), this._convM = t3, this._n = "ConvGroupHandler", this._convGroupMap = /* @__PURE__ */ new Map(), this._startIndex = 0, this._pagingStatus = Gn;
    }, [{ key: "setConvCustomData", value: function(e3) {
      var i4 = this, s4 = "".concat(this._n, ".").concat("setConvCustomData"), t3 = e3.conversationIDList, a3 = e3.customData, r4 = (M2.l("".concat(s4, " options:"), e3), new P2("setConvCustomData")), n3 = (r4.setMessage(JSON.stringify(e3)), { fromAccount: this._getMyUserID(), itemList: [] }), c3 = [], u3 = [];
      return t3.forEach(function(e4) {
        var t4;
        return i4._hasLocalConv(e4) ? Gt2(e4) || Pt2(e4) ? (t4 = { operationType: 2, contactItem: void 0, customMark: a3 }, Gt2(e4) ? t4.contactItem = { type: 1, toAccount: e4.replace(R2.CONV_C2C, "") } : Pt2(e4) && (t4.contactItem = { type: 2, groupID: e4.replace(R2.CONV_GROUP, "") }), void n3.itemList.push(t4)) : (i4._onConvIDInvalid(u3, e4), true) : (i4._onConvNotFound(u3, e4), true);
      }), u3.length === t3.length ? D2({ successConversationIDList: c3, failureConversationIDList: u3 }) : this._convM.req({ P: G2.SET_CONV_CUSTOM_DATA, data: n3 }).then(function(e4) {
        r4.end(), M2.l("".concat(s4, " ok"));
        var t4, n4, o3, e4 = e4.data.resultItem;
        return O2(e4) && (o3 = false, e4.forEach(function(e5) {
          t4 = i4._concatConvID(e5.contactItem), 0 === e5.resultCode ? (c3.push(t4), (n4 = i4._getLocalConv(t4)) && n4.customData !== a3 && (n4.customData = a3, o3 = true)) : u3.push({ conversationID: t4, code: e5.resultCode, message: e5.resultInfo });
        }), true === o3) && i4._emitConvUpdate(), T2({ successConversationIDList: c3, failureConversationIDList: u3 });
      }).catch(function(e4) {
        return r4.setError(e4).end(), M2.e("".concat(s4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "markConv", value: function(e3) {
      var t3, n3, s4, a3, r4, o3, i4, c3, u3, l3, d3 = this;
      return this._convM.canIUse(g2.CONV_MARK) ? (t3 = "".concat(this._n, ".").concat("markConv"), n3 = e3.conversationIDList, s4 = e3.markType, a3 = e3.enableMark, M2.l("".concat(t3, " options:"), e3), r4 = new P2("markConv"), o3 = void r4.setMessage(JSON.stringify(e3)), i4 = void 0, e3 = this._getFlagBit(s4), true === a3 ? i4 = [e3] : o3 = [e3], c3 = { fromAccount: this._getMyUserID(), itemList: [] }, u3 = [], l3 = [], n3.forEach(function(e4) {
        var t4;
        return d3._hasLocalConv(e4) ? Gt2(e4) || Pt2(e4) ? (t4 = { operationType: 1, contactItem: void 0, clearMark: o3, setMark: i4 }, Gt2(e4) ? t4.contactItem = { type: 1, toAccount: e4.replace(R2.CONV_C2C, "") } : Pt2(e4) && (t4.contactItem = { type: 2, groupID: e4.replace(R2.CONV_GROUP, "") }), void c3.itemList.push(t4)) : (d3._onConvIDInvalid(l3, e4), true) : (d3._onConvNotFound(l3, e4), true);
      }), l3.length === n3.length ? D2({ successConversationIDList: u3, failureConversationIDList: l3 }) : this._convM.req({ P: G2.MARK_CONV, data: c3 }).then(function(e4) {
        r4.end(), M2.l("".concat(t3, " ok"));
        var n4, o4, i5, e4 = e4.data.resultItem;
        return O2(e4) && (i5 = false, e4.forEach(function(e5) {
          var t4;
          n4 = d3._concatConvID(e5.contactItem), 0 === e5.resultCode ? (u3.push(n4), (o4 = d3._getLocalConv(n4)) && (t4 = o4.markList.indexOf(s4), true === a3 ? -1 === t4 && (o4.markList.push(s4), i5 = true) : -1 !== t4 && (o4.markList.splice(t4, 1), i5 = true))) : l3.push({ conversationID: n4, code: e5.resultCode, message: e5.resultInfo });
        }), true === i5) && d3._emitConvUpdate(), T2({ successConversationIDList: u3, failureConversationIDList: l3 });
      }).catch(function(e4) {
        return r4.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this._convM.noUse("markConv");
    } }, { key: "getLocalConvGroupList", value: function() {
      var e3 = this;
      return M2.l("".concat(this._n, ".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)), this._pagingStatus === bn ? this.getRemoteConvGroupList().then(function() {
        return T2(d2(e3._convGroupMap.values()));
      }) : D2(d2(this._convGroupMap.values()));
    } }, { key: "searchConvGroupAndMark", value: function(e3, t3) {
      var n3 = this, o3 = "".concat(this._n, ".searchConvGroupAndMark"), i4 = [];
      return e3.forEach(function(e4) {
        1 === t3 ? i4.push({ type: 1, toAccount: e4 }) : 2 === t3 && i4.push({ type: 2, groupID: e4 });
      }), M2.l("".concat(o3, " type:").concat(t3, " list:"), e3), this._convM.req({ P: G2.SEARCH_CONV_GRP_MARK, data: { fromAccount: this._getMyUserID(), contactItem: i4 } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.contactItem, e4 = e4.groupItem;
        M2.l("".concat(o3, " ok. contactItem:"), t4, "groupItem:", e4), n3._fillConvGroupMap(e4), n3._handleContactItem(t4), n3._emitConvUpdate();
      }).catch(function(e4) {
        M2.w("".concat(o3, " failed. error:"), e4);
      });
    } }, { key: "_fillConvGroupMap", value: function(e3) {
      var n3 = this;
      O2(e3) && e3.forEach(function(e4) {
        var t3 = e4.convGroupID, e4 = e4.groupName;
        n3._convGroupMap.set(t3, e4);
      });
    } }, { key: "_handleContactItem", value: function(e3) {
      var s4, a3 = this;
      O2(e3) && e3.forEach(function(e4) {
        var t3 = [], n3 = e4.standardMark, o3 = e4.customData, i4 = e4.convGroupIDList;
        O2(i4) && i4.forEach(function(e5) {
          a3._convGroupMap.has(e5) && t3.push(a3._convGroupMap.get(e5));
        }), s4 = a3._concatConvID(e4), (s4 = a3._getLocalConv(s4)) && (s4.markList = Xt2(n3), s4.customData = o3 || "", s4.conversationGroupList = [].concat(t3));
      });
    } }, { key: "getRemoteConvGroupList", value: function() {
      var i4 = this, s4 = "".concat(this._n, ".getRemoteConvGroupList");
      return this._pagingStatus = Pn, this._convM.req({ P: G2.GET_CONV_GRP_LIST, data: { fromAccount: this._getMyUserID(), startIndex: this._startIndex } }).then(function(e3) {
        var e3 = e3.data, t3 = e3.completeFlag, n3 = e3.contactItem, o3 = e3.nextStartIndex, o3 = void 0 === o3 ? 0 : o3, e3 = e3.groupItem;
        if (i4._startIndex = o3, M2.l("".concat(s4, " completeFlag:").concat(t3, " nextStartIndex:").concat(o3, ", groupItem:"), e3, "contactItem:", n3), i4._fillConvGroupMap(e3), i4._handleContactItem(n3), 0 === t3)
          return i4.getRemoteConvGroupList();
        1 === t3 && (i4._pagingStatus = Un, i4._emitConvUpdate(), i4._emitConvGroupListUpdate());
      }).catch(function(e3) {
        i4._pagingStatus = bn, M2.w("".concat(s4, " failed. error:"), e3);
      });
    } }, { key: "createConvGroup", value: function(e3) {
      var s4, a3, r4, t3, c3, u3, l3 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (s4 = "".concat(this._n, ".").concat("createConvGroup"), M2.l("".concat(s4, " options:"), e3), (a3 = new P2("createConvGroup")).setMessage(JSON.stringify(e3)), r4 = e3.groupName, e3 = e3.conversationIDList, t3 = { fromAccount: this._getMyUserID(), itemList: [{ groupName: r4, contactItem: [] }] }, c3 = [], u3 = [], e3.forEach(function(e4) {
        return l3._hasLocalConv(e4) ? Gt2(e4) || Pt2(e4) ? void (Gt2(e4) ? t3.itemList[0].contactItem.push({ type: 1, toAccount: e4.replace(R2.CONV_C2C, "") }) : Pt2(e4) && t3.itemList[0].contactItem.push({ type: 2, groupID: e4.replace(R2.CONV_GROUP, "") })) : (l3._onConvIDInvalid(u3, e4), true) : (l3._onConvNotFound(u3, e4), true);
      }), u3.length === e3.length ? D2({ successConversationIDList: c3, failureConversationIDList: u3 }) : this._convM.req({ P: G2.CREATE_CONV_GRP, data: t3 }).then(function(e4) {
        a3.end(), M2.l("".concat(s4, " ok"));
        var t4, n3, o3, e4 = e4.data.groupResultItem[0], i4 = e4.groupItem, e4 = e4.resultItem;
        return m2(i4) && (l3._convGroupMap.set(i4.convGroupID, i4.groupName), l3._emitConvGroupListUpdate()), O2(e4) && (o3 = false, e4.forEach(function(e5) {
          t4 = l3._concatConvID(e5.contactItem), 0 === e5.resultCode ? (c3.push(t4), (n3 = l3._getLocalConv(t4)) && -1 === n3.conversationGroupList.indexOf(r4) && (n3.conversationGroupList.push(r4), o3 = true)) : u3.push({ conversationID: t4, code: e5.resultCode, message: e5.resultInfo });
        }), true === o3) && (l3._emitConvUpdate(), l3._emitConvGroupListUpdate()), T2({ successConversationIDList: c3, failureConversationIDList: u3 });
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(s4, " failed. error:"), e4), E2(e4);
      })) : this._convM.noUse("createConvGroup");
    } }, { key: "deleteConvGroup", value: function(n3) {
      var o3, i4, s4 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (o3 = "".concat(this._n, ".").concat("deleteConvGroup"), M2.l("".concat(o3, " groupName:").concat(n3)), (i4 = new P2("deleteConvGroup")).setMessage(n3), this._convM.req({ P: G2.DEL_CONV_GRP, data: { fromAccount: this._getMyUserID(), groupName: [n3] } }).then(function(e3) {
        i4.end(), M2.l("".concat(o3, " ok"));
        var t3, e3 = e3.data.groupItem;
        O2(e3) && (t3 = false, e3.forEach(function(e4) {
          s4._convGroupMap.has(e4.convGroupID) && (s4._convGroupMap.delete(e4.convGroupID), t3 = true);
        }), true === t3) && s4._emitConvGroupListUpdate(), s4._eraseFromConversationGroupList([n3]);
      }).catch(function(e3) {
        return i4.setError(e3).end(), M2.e("".concat(o3, " failed. error:"), e3), E2(e3);
      })) : this._convM.noUse("deleteConvGroup");
    } }, { key: "renameConvGroup", value: function(e3) {
      var i4, s4, a3, r4, c3 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (i4 = "".concat(this._n, ".").concat("renameConvGroup"), M2.l("".concat(i4, " options:"), e3), (s4 = new P2("renameConvGroup")).setMessage(JSON.stringify(e3)), a3 = e3.oldName, r4 = e3.newName, this._convM.req({ P: G2.RENAME_CONV_GRP, data: { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 1, oldName: a3, newName: r4 } } }).then(function(e4) {
        s4.end(), M2.l("".concat(i4, " ok"));
        e4 = e4.data.updateGroupResult.convGroupID;
        c3._convGroupMap.set(e4, r4), c3._emitConvGroupListUpdate();
        var t3, n3, e4 = c3._convM.getLocalConvList(), o3 = false;
        e4.forEach(function(e5) {
          t3 = e5.conversationGroupList, -1 !== (n3 = t3.indexOf(a3)) && (t3.splice(n3, 1, r4), o3 = true);
        }), true === o3 && c3._emitConvUpdate();
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : this._convM.noUse("renameConvGroup");
    } }, { key: "addConvsToGroup", value: function(e3) {
      var i4, s4, t3, a3, n3, r4, c3, u3 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (i4 = "".concat(this._n, ".").concat("addConvsToGroup"), M2.l("".concat(i4, " options:"), e3), (s4 = new P2("addConvsToGroup")).setMessage(JSON.stringify(e3)), t3 = e3.conversationIDList, a3 = e3.groupName, n3 = { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 2, groupName: a3, updateItem: [] } }, r4 = [], c3 = [], t3.forEach(function(e4) {
        return u3._hasLocalConv(e4) ? Gt2(e4) || Pt2(e4) ? void (Gt2(e4) ? n3.updateGroup.updateItem.push({ operationType: 1, contactItem: { type: 1, toAccount: e4.replace(R2.CONV_C2C, "") } }) : Pt2(e4) && n3.updateGroup.updateItem.push({ operationType: 1, contactItem: { type: 2, groupID: e4.replace(R2.CONV_GROUP, "") } })) : (u3._onConvIDInvalid(c3, e4), true) : (u3._onConvNotFound(c3, e4), true);
      }), c3.length === t3.length ? D2({ successConversationIDList: r4, failureConversationIDList: c3 }) : this._convM.req({ P: G2.ADD_CONV_TO_GRP, data: n3 }).then(function(e4) {
        s4.end(), M2.l("".concat(i4, " ok"));
        var t4, n4, o3, e4 = e4.data.updateGroupResult.contactResultItem;
        return O2(e4) && (o3 = false, e4.forEach(function(e5) {
          t4 = u3._concatConvID(e5.contactItem), 0 === e5.resultCode ? (n4 = u3._getLocalConv(t4)) && -1 === n4.conversationGroupList.indexOf(a3) && (n4.conversationGroupList.push(a3), r4.push(t4), o3 = true) : c3.push({ conversationID: t4, code: e5.resultCode, message: e5.resultInfo });
        }), true === o3) && (u3._emitConvUpdate(), u3._emitConvInGroupUpdate(a3)), T2({ successConversationIDList: r4, failureConversationIDList: c3 });
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : this._convM.noUse("addConvsToGroup");
    } }, { key: "deleteConvsFromGroup", value: function(e3) {
      var t3, s4, n3, a3, o3, r4, c3, u3 = this, i4 = "deleteConvsFromGroup";
      return this._convM.canIUse(g2.CONV_GROUP) ? (t3 = "".concat(this._n, ".").concat(i4), M2.l("".concat(t3, " options:"), e3), (s4 = new P2(i4)).setMessage(JSON.stringify(e3)), n3 = e3.conversationIDList, a3 = e3.groupName, o3 = { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 2, groupName: a3, updateItem: [] } }, r4 = [], c3 = [], n3.forEach(function(e4) {
        return u3._hasLocalConv(e4) ? Gt2(e4) || Pt2(e4) ? void (Gt2(e4) ? o3.updateGroup.updateItem.push({ operationType: 2, contactItem: { type: 1, toAccount: e4.replace(R2.CONV_C2C, "") } }) : Pt2(e4) && o3.updateGroup.updateItem.push({ operationType: 2, contactItem: { type: 2, groupID: e4.replace(R2.CONV_GROUP, "") } })) : (u3._onConvIDInvalid(c3, e4), true) : (u3._onConvNotFound(c3, e4), true);
      }), c3.length === n3.length ? D2({ successConversationIDList: r4, failureConversationIDList: c3 }) : this._convM.req({ P: G2.DEL_CONV_FROM_GRP, data: o3 }).then(function(e4) {
        s4.end(), M2.l("".concat(t3, " ok"));
        var n4, o4, i5, e4 = e4.data.updateGroupResult.contactResultItem;
        return O2(e4) && (i5 = false, e4.forEach(function(e5) {
          var t4;
          n4 = u3._concatConvID(e5.contactItem), 0 === e5.resultCode ? (o4 = u3._getLocalConv(n4)) && -1 !== (t4 = o4.conversationGroupList.indexOf(a3)) && (o4.conversationGroupList.splice(t4, 1), r4.push(n4), i5 = true) : c3.push({ conversationID: n4, code: e5.resultCode, message: e5.resultInfo });
        }), true === i5) && (u3._emitConvUpdate(), u3._emitConvInGroupUpdate(a3)), T2({ successConversationIDList: r4, failureConversationIDList: c3 });
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this._convM.noUse(i4);
    } }, { key: "onConvMarkUpdated", value: function(e3) {
      var i4, s4, a3 = this;
      S2(e3) || (M2.l("".concat(this._n, ".onConvMarkUpdated markItemList:"), e3), s4 = false, e3.forEach(function(e4) {
        var t3 = e4.recentContactItem, n3 = e4.optType, o3 = e4.standardMark, e4 = e4.customMark;
        i4 = a3._concatConvID(t3), (i4 = a3._getLocalConv(i4)) && (1 === n3 ? s4 = a3._diffStandardMark(i4, o3) : 2 === n3 ? s4 = a3._diffCustomMark(i4, e4) : 3 === n3 && (t3 = a3._diffStandardMark(i4, o3), n3 = a3._diffCustomMark(i4, e4), s4 = t3 || n3));
      }), true === s4 && this._emitConvUpdate());
    } }, { key: "_diffStandardMark", value: function(e3, t3) {
      var t3 = Xt2(t3), n3 = false;
      return true !== function(e4, t4) {
        if (e4 !== t4) {
          if (!e4 || !t4)
            return false;
          if (e4.length !== t4.length)
            return false;
          for (var n4 = 0, o3 = e4.length; n4 < o3; n4++)
            if (e4[n4] !== t4[n4])
              return false;
        }
        return true;
      }(e3.markList, t3) && (e3.markList = t3, n3 = true), n3;
    } }, { key: "_diffCustomMark", value: function(e3, t3) {
      var n3 = false;
      return e3.customData !== t3 && void 0 !== t3 && (e3.customData = t3, n3 = true), n3;
    } }, { key: "onConvGroupCreated", value: function(e3) {
      var s4 = this, a3 = (M2.l("".concat(this._n, ".onConvGroupCreated resultList:"), e3), false), r4 = false;
      O2(e3) && (e3.forEach(function(e4) {
        var t3 = e4.msgGroupItem, n3 = t3.groupID, o3 = t3.groupName;
        s4._convGroupMap.get(n3) !== o3 && (s4._convGroupMap.set(n3, o3), r4 = true);
        var i4, t3 = e4.msgRecentContactItem;
        O2(t3) && t3.forEach(function(e5) {
          i4 = s4._concatConvID(e5), (i4 = s4._getLocalConv(i4)) && -1 === i4.conversationGroupList.indexOf(o3) && (i4.conversationGroupList.push(o3), a3 = true);
        });
      }), true === a3 && this._emitConvUpdate(), true === r4) && this._emitConvGroupListUpdate();
    } }, { key: "onConvGroupDeleted", value: function(e3) {
      var n3, o3 = this, i4 = (M2.l("".concat(this._n, ".onConvGroupDeleted groupItemList:"), e3), []);
      O2(e3) && (n3 = false, e3.forEach(function(e4) {
        var t3 = e4.groupID, e4 = e4.groupName;
        o3._convGroupMap.has(t3) && (o3._convGroupMap.delete(t3), n3 = true, i4.push(e4));
      }), true === n3) && this._emitConvGroupListUpdate(), this._eraseFromConversationGroupList(i4);
    } }, { key: "_eraseFromConversationGroupList", value: function(t3) {
      S2(t3) || (this._convM.getLocalConvList().forEach(function(e3) {
        e3.conversationGroupList = e3.conversationGroupList.filter(function(e4) {
          return !t3.includes(e4);
        });
      }), this._emitConvUpdate());
    } }, { key: "onConvGroupNameUpdated", value: function(e3) {
      M2.l("".concat(this._n, ".onConvGroupNameUpdated options:"), e3);
      var t3, n3, o3, i4 = e3.groupID, s4 = e3.groupName, a3 = e3.oldGroupName;
      this._convGroupMap.get(i4) !== s4 && (this._convGroupMap.set(i4, s4), this._emitConvGroupListUpdate(), e3 = this._convM.getLocalConvList(), o3 = false, e3.forEach(function(e4) {
        t3 = e4.conversationGroupList, -1 !== (n3 = t3.indexOf(a3)) && (t3.splice(n3, 1, s4), o3 = true);
      }), true === o3) && this._emitConvUpdate();
    } }, { key: "onConvInGroupUpdated", value: function(e3) {
      var n3, o3, i4, s4 = this, a3 = (M2.l("".concat(this._n, ".onConvInGroupUpdated options:"), e3), e3.oldGroupName), e3 = e3.recentContactUpdateGroupItem;
      O2(e3) && (i4 = false, e3.forEach(function(e4) {
        var t3 = e4.contactOptType, e4 = e4.recentContactItem;
        n3 = s4._concatConvID(e4), (n3 = s4._getLocalConv(n3)) && (o3 = n3.conversationGroupList.indexOf(a3), 1 === t3 ? -1 === o3 && (n3.conversationGroupList.push(a3), i4 = true) : 2 === t3 && -1 !== o3 && (n3.conversationGroupList.splice(o3, 1), i4 = true));
      }), true === i4) && (this._emitConvUpdate(), this._emitConvInGroupUpdate(a3));
    } }, { key: "onConvAddedToOrDeletedFromGroup", value: function(e3) {
      var n3, o3, i4 = this, t3 = (M2.l("".concat(this._n, ".onConvAddedToOrDeletedFromGroup options:"), e3), e3.msgRecentContactItem), e3 = e3.msgRecentContactUpdateContactItem, t3 = this._concatConvID(t3), s4 = this._getLocalConv(t3);
      s4 && O2(e3) && (o3 = false, e3.forEach(function(e4) {
        var t4 = e4.groupOptType, e4 = e4.recentContactGroupItem.groupName;
        n3 = s4.conversationGroupList.indexOf(e4), 1 === t4 ? -1 === n3 && (s4.conversationGroupList.push(e4), o3 = true) : 2 === t4 && -1 !== n3 && (s4.conversationGroupList.splice(n3, 1), o3 = true), true === o3 && i4._emitConvInGroupUpdate(e4);
      }), true === o3) && this._emitConvUpdate();
    } }, { key: "onConvGroupListSynced", value: function(e3) {
      O2(e3) && 0 !== e3.length && (M2.l("".concat(this._n, ".onConvGroupListSynced groupItem:"), e3), this._fillConvGroupMap(e3));
    } }, { key: "getConvGroupListByID", value: function(e3) {
      var t3, n3 = this;
      if (!S2(e3))
        return t3 = [], e3.forEach(function(e4) {
          n3._convGroupMap.has(e4) && t3.push(n3._convGroupMap.get(e4));
        }), t3;
    } }, { key: "_onConvNotFound", value: function(e3, t3) {
      e3.push({ conversationID: t3, code: k2.CONV_NOT_FOUND, message: this._convM.getErrMsg(k2.CONV_NOT_FOUND) });
    } }, { key: "_onConvIDInvalid", value: function(e3, t3) {
      e3.push({ conversationID: t3, code: k2.INVALID_CONV_ID, message: this._convM.getErrMsg(k2.INVALID_CONV_ID) });
    } }, { key: "_getFlagBit", value: function(e3) {
      for (var t3 = e3.toString(2), n3 = t3.length, o3 = n3 - 1; 0 <= o3; o3--)
        if ("1" === t3[o3])
          return n3 - o3 - 1;
    } }, { key: "_concatConvID", value: function(e3) {
      var t3, n3 = e3.type, o3 = e3.to, i4 = e3.groupID, e3 = e3.userID;
      return 1 === n3 ? N3(e3) ? N3(o3) || (t3 = "".concat(R2.CONV_C2C).concat(o3)) : t3 = "".concat(R2.CONV_C2C).concat(e3) : 2 === n3 && (t3 = "".concat(R2.CONV_GROUP).concat(i4)), t3;
    } }, { key: "_getMyUserID", value: function() {
      return this._convM.getMyUserID();
    } }, { key: "_getLocalConv", value: function(e3) {
      return this._convM.getLocalConversation(e3);
    } }, { key: "_hasLocalConv", value: function(e3) {
      return this._convM.hasLocalConversation(e3);
    } }, { key: "_emitConvUpdate", value: function() {
      this._convM.emitConvUpdate(true, false);
    } }, { key: "_emitConvGroupListUpdate", value: function() {
      this._convM.emitOEvt(h2.CONVERSATION_GROUP_LIST_UPDATED, d2(this._convGroupMap.values()));
    } }, { key: "_emitConvInGroupUpdate", value: function(t3) {
      var e3 = { groupName: t3, conversationList: [] }, n3 = this._convM.getLocalConvList();
      e3.conversationList = n3.filter(function(e4) {
        return e4.conversationGroupList.includes(t3);
      }), this._convM.emitOEvt(h2.CONVERSATION_IN_GROUP_UPDATED, e3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._convGroupMap.clear(), this._startIndex = 0, this._pagingStatus = Gn;
    } }]), Ko = (t2(Ii, c2), e2(Ii, [{ key: "_initListeners", value: function() {
      var e3 = this.getIEmitInst();
      e3.on(U2.A2KEY_AND_TINYID_UPDATED, this._init, this), e3.on(U2.PROFILE_UPDATED, this._onProfileUpdated, this), e3.on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    } }, { key: "_init", value: function() {
      var e3 = this, t3 = (M2.l("".concat(this._n, "._init")), this.get(13).getItem("conversationMap")), n3 = this.isIntl(), o3 = this.isUsingChatCore();
      if (t3) {
        for (var i4 = t3.length, s4 = 0; s4 < i4; s4++) {
          var a3 = t3[s4];
          if (a3) {
            if (this._isNonExistentAccount(a3.conversationID))
              continue;
            if (a3.groupProfile && At2(a3.groupProfile.type))
              continue;
          }
          this._convMap.set(a3.conversationID, new xo(t3[s4], n3, o3));
        }
        this.emitConvUpdate(true, false);
      }
      this.ready(function() {
        0 < e3._tmpGroupList.length && (e3.updateConvGroupProfile(e3._tmpGroupList), e3._tmpGroupList.length = 0);
      }), this.syncConvList();
    } }, { key: "_isNonExistentAccount", value: function(e3) {
      var t3;
      return "@TLS#ERROR" === (t3 = e3.startsWith(R2.CONV_C2C) ? e3.replace(R2.CONV_C2C, "") : t3) || "@TLS#NOT_FOUND" === t3;
    } }, { key: "onCheckTimer", value: function(e3) {
      this.isLoggedIn() && this._msgListHandler.onCheckTimer(e3);
    } }, { key: "onMessageSent", value: function(e3) {
      this._onSendOrRcvMsg({ conversationOptionsList: e3.conversationOptionsList, isInstantMessage: true });
    } }, { key: "onNewMessage", value: function(e3) {
      this._onSendOrRcvMsg(e3);
    } }, { key: "_onSendOrRcvMsg", value: function(e3) {
      var t3 = this, n3 = e3.conversationOptionsList, o3 = e3.isInstantMessage, o3 = void 0 === o3 || o3, i4 = e3.isUnreadC2CMessage, i4 = void 0 !== i4 && i4, s4 = e3.updateUnreadCount, s4 = void 0 === s4 || s4, a3 = e3.isSyncingEnded, a3 = void 0 !== a3 && a3;
      this._isReady ? 0 !== n3.length ? (true === o3 && this._checkNewConv(n3), this._updateLocalConvList({ conversationOptionsList: n3, isInstantMessage: o3, isUnreadC2CMessage: i4, isFromGetConversations: false, updateUnreadCount: s4 }), o3 || (this._convIDFromUnreadDBMap = new Map([].concat(d2(this._convIDFromUnreadDBMap), d2(n3.map(function(e4) {
        return [e4.conversationID, 1];
      })))), this._diffAndDeleteConv(), a3 && this.emitIEvt(U2.C2C_UNREAD_HANDLE_COMPLETED)), 0 < n3.filter(function(e4) {
        return !t3._isConvNeedShow(e4.conversationID);
      }).length || this.emitConvUpdate()) : a3 && this.emitIEvt(U2.C2C_UNREAD_HANDLE_COMPLETED) : this.ready(function() {
        t3._onSendOrRcvMsg(e3);
      });
    } }, { key: "updateConvGroupProfile", value: function(e3) {
      var n3, o3 = this;
      O2(e3) && 0 === e3.length || (0 !== this._convMap.size ? (n3 = false, e3.forEach(function(e4) {
        var t3 = "".concat(R2.CONV_GROUP).concat(e4.groupID);
        o3._convMap.has(t3) && (n3 = true, (t3 = o3._convMap.get(t3)).groupProfile = JSON.parse(JSON.stringify(e4)), t3.lastMessage.lastSequence < e4.nextMessageSeq && (t3.lastMessage.lastSequence = e4.nextMessageSeq - 1), t3.subType || (t3.subType = e4.type));
      }), n3 && this.emitConvUpdate(true, false)) : this._tmpGroupList = e3);
    } }, { key: "onMessageRevoked", value: function(e3, t3) {
      var n3, o3, i4, s4 = this;
      0 !== e3.length && (n3 = null, o3 = false, i4 = [], e3.forEach(function(e4) {
        (n3 = s4._convMap.get(e4.conversationID)) && (t3 && n3.reduceUnreadCount() && (o3 = n3.type !== R2.CONV_TOPIC), n3.type === R2.CONV_TOPIC ? i4.push(e4) : n3.isLastMessageRevoked({ sequence: e4.sequence, time: e4.time }) && (n3.setLastMessageRevoked(true), n3.setLastMessageRevoker(e4.revoker), o3 = true));
      }), this.get(10).onMessageRevoked(i4), o3) && this.emitConvUpdate(true, false);
    } }, { key: "updateRevokerInfo", value: function(u3) {
      for (var e3 = /* @__PURE__ */ new Set(), t3 = 0; t3 < u3.length; t3++) {
        var n3 = u3[t3].revoker;
        e3.add(n3);
      }
      var o3 = d2(e3), i4 = this.get(4);
      return new Promise(function(c3) {
        i4.getUserProfile({ userIDList: o3 }).then(function(e4) {
          e4 = e4.data;
          if (!O2(e4) || 0 === e4.length)
            return c3(u3);
          var t4, n4 = {}, o4 = F2(e4);
          try {
            for (o4.s(); !(t4 = o4.n()).done; ) {
              var i5 = t4.value, s4 = i5.userID, a3 = i5.nick, r4 = i5.avatar;
              n4[s4] = { nick: a3, avatar: r4 };
            }
          } catch (e5) {
            o4.e(e5);
          } finally {
            o4.f();
          }
          u3.forEach(function(e5) {
            var t5 = e5.revoker;
            n4[t5] && (e5.revokerInfo.nick = n4[t5].nick || "", e5.revokerInfo.avatar = n4[t5].avatar || "");
          }), c3(u3);
        }).catch(function() {
          c3(u3);
        });
      });
    } }, { key: "isLastMessageRevoked", value: function(e3) {
      var t3 = false, n3 = e3.conversationID, o3 = e3.sequence, i4 = e3.time, s4 = this._convMap.get(n3);
      return s4 && (t3 = s4.type === R2.CONV_TOPIC ? this.get(10).isLastMessageRevoked({ topicID: n3.replace(R2.CONV_GROUP, ""), sequence: o3 }) : s4.isLastMessageRevoked({ sequence: o3, time: i4 })), M2.l("".concat(this._n, ".isLastMessageRevoked options:"), e3, "ret:".concat(t3)), t3;
    } }, { key: "onMessageDeleted", value: function(e3) {
      var t3 = this;
      if (0 !== e3.length) {
        var n3 = null;
        e3.forEach(function(e4) {
          (n3 = t3._msgListHandler.getLocalMsg(e4.conversationID, e4.ID)) && (n3.isDeleted = true), e4 !== n3 && (e4.isDeleted = true);
        });
        for (var e3 = e3[0].conversationID, o3 = this._msgListHandler.getLocalMsgList(e3), i4 = {}, s4 = o3.length - 1; 0 <= s4; s4--)
          if (!o3[s4].isDeleted) {
            i4 = o3[s4];
            break;
          }
        var a3, r4 = this._convMap.get(e3);
        r4 && (a3 = false, r4.lastMessage.lastSequence === i4.sequence && r4.lastMessage.lastTime === i4.time || (S2(i4) && (i4 = void 0), r4.updateLastMessage(i4), r4.type !== R2.CONV_TOPIC && (a3 = true), M2.l("".concat(this._n, ".onMessageDeleted. update convID:").concat(e3, " with lastMessage:"), r4.lastMessage)), e3.startsWith(R2.CONV_C2C) && this.updateUnreadCount(e3), a3) && this.emitConvUpdate(true, false);
      }
    } }, { key: "onMessageModified", value: function(e3) {
      var t3 = "".concat(this._n, ".onMessageModified"), n3 = e3.conversationType, o3 = e3.from, i4 = e3.to, s4 = e3.time, a3 = e3.sequence, r4 = e3.elements, c3 = e3.cloudCustomData, u3 = e3.messageVersion, l3 = this.getMyUserID(), d3 = "".concat(n3).concat(i4), l3 = (i4 === l3 && n3 === R2.CONV_C2C && (d3 = "".concat(n3).concat(o3)), this._msgListHandler.onMsgModified(d3, e3)), n3 = l3.isUpdated, l3 = l3.message, p4 = (true === n3 && this.emitOEvt(h2.MESSAGE_MODIFIED, [l3]), this._isTopicConv(d3));
      return null === l3 ? M2.l("".concat(t3, " message is null! options:"), e3) : M2.l("".concat(t3, " isUpdated:").concat(n3, " isTopicMessage:").concat(p4, " from:").concat(o3, " to:").concat(i4, " sequence:").concat(l3.sequence, " time:").concat(l3.time)), p4 ? this.get(10).onMessageModified(e3) : (n3 = this._convMap.get(d3)) && (o3 = n3.lastMessage) && o3.lastTime === s4 && o3.lastSequence === a3 && o3.version !== u3 && (M2.l("".concat(t3, " convID:").concat(d3, " lastMessage updated")), o3.type = r4[0].type, o3.payload = r4[0].content, o3.messageForShow = Jt2(o3.type, o3.payload, this.isIntl()), o3.cloudCustomData = c3, o3.version = u3, this.emitConvUpdate(true, false)), l3;
    } }, { key: "onNewGroupAtTips", value: function(e3) {
      var t3 = this, e3 = e3.dataList, n3 = null;
      e3.forEach(function(e4) {
        e4.groupAtTips ? n3 = e4.groupAtTips : e4.elements ? n3 = y2(y2({}, e4.elements), {}, { sync: true }) : e4.groupAtType && (n3 = y2(y2({}, e4), {}, { sync: true })), n3.__random = e4.random, n3.__sequence = e4.clientSequence, t3._tmpGroupAtTipsList.push(n3);
      }), M2.l("".concat(this._n, ".onNewGroupAtTips isReady:").concat(this._isReady), this._tmpGroupAtTipsList), this._isReady && this._handleGroupAtTipsList();
    } }, { key: "_handleGroupAtTipsList", value: function() {
      var s4, a3 = this;
      0 !== this._tmpGroupAtTipsList.length && (s4 = false, this._tmpGroupAtTipsList.forEach(function(e3) {
        var t3 = e3.groupID, n3 = e3.from, o3 = e3.topicID, o3 = void 0 === o3 ? void 0 : o3, i4 = e3.sync, i4 = void 0 !== i4 && i4;
        n3 !== a3.getMyUserID() && (N3(o3) ? (n3 = a3._convMap.get("".concat(R2.CONV_GROUP).concat(t3))) && (n3.updateGroupAtInfoList(e3), s4 = true) : ((t3 = a3._convMap.get("".concat(R2.CONV_GROUP).concat(o3))) && (t3.updateGroupAtInfoList(e3), a3.get(10).onAtInfoUpdated({ topicID: o3, groupAtInfoList: t3.groupAtInfoList })), S2(t3) && i4 && (a3.updateTopicConversation([{ conversationID: "".concat(R2.CONV_GROUP).concat(o3), type: R2.CONV_TOPIC }]), a3._convMap.get("".concat(R2.CONV_GROUP).concat(o3)).updateGroupAtInfoList(e3))));
      }), s4 && this.emitConvUpdate(true, false), this._tmpGroupAtTipsList.length = 0);
    } }, { key: "_checkNewConv", value: function(e3) {
      var t3 = this, n3 = [], o3 = [];
      e3.forEach(function(e4) {
        t3._convMap.has(e4.conversationID) || (e4.type === R2.CONV_C2C ? n3.push(e4.conversationID.replace(R2.CONV_C2C, "")) : e4.type === R2.CONV_GROUP && o3.push(e4.conversationID.replace(R2.CONV_GROUP, "")));
      }), 0 < n3.length && (this._onNewC2CConv(n3), n3 = null), 0 < o3.length && (this._onNewGroupConv(o3), o3 = null);
    } }, { key: "_onNewC2CConv", value: function(e3) {
      var t3 = this.get(6);
      return Promise.all([t3.getRemotePeerReadTime(e3), this._msgRemindHandler.getC2CMsgRemindType(e3), this._convGroupHandler.searchConvGroupAndMark(e3, 1)]);
    } }, { key: "_onNewGroupConv", value: function(e3) {
      var t3 = this.get(7);
      return t3 ? Promise.all([t3.getMsgRemindType(e3), this._convGroupHandler.searchConvGroupAndMark(e3, 2)]) : Promise.resolve();
    } }, { key: "_setStorageConvList", value: function() {
      var e3 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t3 = this.getLocalConvList().filter(function(e4) {
        return e4.type === R2.CONV_C2C || e4.type === R2.CONV_GROUP && e4.lastMessage.type !== R2.MSG_GRP_TIP;
      }).slice(0, 20).map(function(e4) {
        return { conversationID: e4.conversationID, type: e4.type, subType: e4.subType, lastMessage: e4.lastMessage, groupProfile: e4.groupProfile, userProfile: e4.userProfile };
      });
      this.get(13).setItem("conversationMap", t3, e3);
    } }, { key: "emitConvUpdate", value: function() {
      var e3 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n3 = this.getLocalConvList();
      t3 && (t3 = this.get(7)) && t3.updateGroupLastMessage(n3), e3 && (this.get(12).isPartialUpdatedConvs() ? (this._diffConvMap(this._convMapForDiff, this._convMap), 0 < this._partialUpdatedConvMap.size && (this.emitOEvt(h2.CONVERSATION_LIST_UPDATED), this.onTotalUnreadCountUpdate(), this._convMapForDiff.clear(), this._convMapForDiff = pt2(this._convMap, true)), 0 === this._convMapForDiff.size && (this._convMapForDiff = pt2(this._convMap, true))) : (this.emitOEvt(h2.CONVERSATION_LIST_UPDATED), this.onTotalUnreadCountUpdate()));
    } }, { key: "_diffConvMap", value: function(e3, t3) {
      var n3, o3 = F2(t3);
      try {
        for (o3.s(); !(n3 = o3.n()).done; ) {
          var i4 = j2(n3.value, 2), s4 = i4[0], a3 = i4[1];
          e3.has(s4) && JSON.stringify(a3) === e3.get(s4) || this._partialUpdatedConvMap.set(s4, a3);
        }
      } catch (e4) {
        o3.e(e4);
      } finally {
        o3.f();
      }
    } }, { key: "getPartialUpdatedConvs", value: function() {
      var e3 = d2(pt2(this._partialUpdatedConvMap, false).values());
      return this._partialUpdatedConvMap.clear(), e3;
    } }, { key: "getLocalConvList", value: function() {
      var t3 = this;
      return d2(this._convMap.values()).filter(function(e3) {
        return t3._isConvNeedShow(e3.conversationID);
      });
    } }, { key: "getLocalConversation", value: function(e3) {
      return this._convMap.get(e3);
    } }, { key: "hasLocalConversation", value: function(e3) {
      return this._convMap.has(e3);
    } }, { key: "getLocalOldestMessage", value: function(e3) {
      return this._msgListHandler.getLocalOldestMsg(e3);
    } }, { key: "syncConvList", value: function() {
      var o3 = this, e3 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], i4 = "syncConvList", s4 = new P2(i4);
      return this._pagingStatus === Gn && this._convMap.clear(), this._pagingGetConvList(e3).then(function(e4) {
        var t3 = en(o3._pagingGetCostList), n3 = $t2(o3._pagingGetCostList), n3 = (o3._pagingGetCostList.length = 0, o3._pagingStatus = Un, o3._diffAndDeleteConv(), o3.emitConvUpdate(true, false), o3._setStorageConvList(), o3._handleC2CPeerReadTime(), o3.emitIEvt(U2.CONV_SYNC_COMPLETED), "count:".concat(o3._convMap.size, " sum:").concat(n3, " avg:").concat(t3));
        return M2.l("".concat(o3._n, ".").concat(i4, ". ").concat(n3)), s4.setMessage(n3).end(), e4;
      }).catch(function(e4) {
        return o3._pagingStatus = bn, s4.setMessage(o3._pagingTs).setError(e4).end(), E2(e4);
      });
    } }, { key: "_diffAndDeleteConv", value: function() {
      var n3, o3 = this;
      this._isSyncCompleted() && (n3 = [], this._convMap.forEach(function(e3, t3) {
        !o3._pagingConvIDMap.has(t3) && o3._convIDFromUnreadDBMap.has(t3) && (o3._convMap.delete(t3), n3.push(t3));
      }), M2.l("".concat(this._n, "._diffAndDeleteConv list:").concat(n3)), n3 = null);
    } }, { key: "_pagingGetConvList", value: function() {
      var r4 = this, e3 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], c3 = "".concat(this._n, "._pagingGetConvList"), u3 = (M2.l("".concat(c3, " incrementalPullFlag:").concat(e3, " ts:").concat(this._pagingTs, " startIdx:").concat(this._pagingStartIdx) + " pinnedTs:".concat(this._pagingPinnedTs, " pinnedStartIdx:").concat(this._pagingPinnedStartIdx)), Date.now());
      return this._pagingStatus = Pn, this.req({ P: G2.PAGING_GET_CONV_LIST, data: { fromAccount: this.getMyUserID(), timeStamp: e3 ? this._pagingTs : 0, startIndex: e3 ? this._pagingStartIdx : 0, pinnedTimeStamp: e3 ? this._pagingPinnedTs : 0, pinnedStartIndex: e3 ? this._pagingPinnedStartIdx : 0, orderType: 1 } }).then(function(e4) {
        var e4 = e4.data, t3 = e4.completeFlag, n3 = e4.conversations, n3 = void 0 === n3 ? [] : n3, o3 = e4.timeStamp, i4 = e4.startIndex, s4 = e4.pinnedTimeStamp, a3 = e4.pinnedStartIndex, e4 = e4.groupItem;
        if (r4._pagingGetCostList.push(tn(u3, false)), M2.l("".concat(c3, " ok. completeFlag:").concat(t3, " count:").concat(n3.length, " cost:").concat(tn(u3))), r4._convGroupHandler.onConvGroupListSynced(e4), 0 < n3.length && (e4 = r4._getConvOptions(n3), r4._pagingConvIDMap = new Map([].concat(d2(r4._pagingConvIDMap), d2(e4.map(function(e5) {
          return [e5.conversationID, 1];
        })))), r4._updateLocalConvList({ conversationOptionsList: e4, isFromGetConversations: true, updateUnreadCount: true }), r4.isLoggedIn()) && r4.emitConvUpdate(), !r4._isReady) {
          if (!r4.isLoggedIn())
            return D2();
          r4.triggerReady();
        }
        return r4._pagingTs = o3, r4._pagingStartIdx = i4, r4._pagingPinnedTs = s4, r4._pagingPinnedStartIdx = a3, 1 !== t3 ? r4._pagingGetConvList() : (r4._handleGroupAtTipsList(), r4._convGroupHandler.getRemoteConvGroupList(), D2());
      }).catch(function(e4) {
        throw !r4.isLoggedIn() || r4._isReady || (M2.w("".concat(c3, " failed. error:"), e4), r4.triggerReady()), e4;
      });
    } }, { key: "_updateLocalConvList", value: function(e3) {
      var t3 = e3.isFromGetConversations, n3 = Date.now(), e3 = this._getTmpConvListMapping(e3).newConvList;
      this._convMap = new Map(this._sortConvList(d2(this._convMap))), t3 || this._updateUserOrGroupProfile(e3), M2.l("".concat(this._n, "._updateLocalConvList cost:").concat(tn(n3)));
    } }, { key: "_getTmpConvListMapping", value: function(e3) {
      for (var t3 = e3.conversationOptionsList, n3 = e3.isFromGetConversations, o3 = e3.isInstantMessage, i4 = e3.isUnreadC2CMessage, s4 = void 0 !== i4 && i4, a3 = e3.updateUnreadCount, r4 = [], c3 = [], u3 = this.get(7), l3 = this.get(8), d3 = this.isIntl(), p4 = this.isUsingChatCore(), _3 = 0, h3 = t3.length; _3 < h3; _3++) {
        var g3 = new xo(t3[_3], d3, p4), f3 = g3.conversationID, m3 = g3.type;
        if (!this._isNonExistentAccount(f3)) {
          if (this._convMap.has(f3)) {
            var v4 = this._convMap.get(f3);
            if (n3 && m3 !== R2.CONV_TOPIC) {
              this._convMap.set(f3, g3), m3 === R2.CONV_C2C ? g3.unreadCount = v4.unreadCount : m3 === R2.CONV_GROUP && (g3.groupProfile = JSON.parse(JSON.stringify(v4.groupProfile)));
              continue;
            }
            var I3 = ["unreadCount", "allowType", "adminForbidType", "payload"], M3 = (false === o3 && I3.push("lastMessage"), "boolean" == typeof o3 && I3.push("isPinned"), t3[_3].lastMessage), y3 = !N3(M3);
            y3 || t3[_3].type === R2.CONV_TOPIC || this._onLastMsgNotExist(t3[_3]), N3(o3) && y3 && null === v4.lastMessage.payload && (v4.lastMessage.payload = M3.payload), S2(v4.lastMessage.revoker) || (v4.lastMessage.revoker = null), dt2(v4, g3, I3, [null, void 0, "", 0, NaN]), true === a3 && v4.updateUnreadCount({ nextUnreadCount: g3.unreadCount, isFromGetConversations: n3, isUnreadC2CMessage: s4 }), o3 && y3 && (M3.payload && (v4.lastMessage.payload = M3.payload), v4.type === R2.CONV_GROUP) && (v4.lastMessage.nameCard = M3.nameCard, v4.lastMessage.nick = M3.nick), y3 && v4.lastMessage.cloudCustomData !== M3.cloudCustomData && (v4.lastMessage.cloudCustomData = M3.cloudCustomData || "");
          } else
            m3 === R2.CONV_GROUP && u3 ? (I3 = g3.groupProfile.groupID, (y3 = u3.getLocalGroupProfile(I3)) && (g3.groupProfile = y3, true === a3) && g3.updateUnreadCount({ nextUnreadCount: 0 })) : m3 === R2.CONV_C2C && (v4 = f3.replace(R2.CONV_C2C, ""), l3) && l3.isMyFriend(v4) && (g3.remark = l3.getFriendRemark(v4)), r4.push(g3), this._convMap.set(f3, g3);
          this._convMap.get(f3).type === R2.CONV_TOPIC && c3.push(this._convMap.get(f3));
        }
      }
      for (var C3 = this.get(10), T3 = 0, D3 = c3.length; T3 < D3; T3++) {
        var E3 = c3[T3], L3 = E3.conversationID, E3 = E3.groupAtInfoList;
        S2(E3) || C3.onAtInfoUpdated({ topicID: L3.replace(R2.CONV_GROUP, ""), groupAtInfoList: E3 });
      }
      return { newConvList: r4 };
    } }, { key: "_onLastMsgNotExist", value: function(e3) {
      new P2("lastMsgNotExist").setMessage(JSON.stringify(e3)).end();
    } }, { key: "_sortConvList", value: function(e3) {
      var t3 = [], n3 = [], o3 = [], i4 = [];
      return e3.forEach(function(e4) {
        (true === e4[1].isPinned ? S2(e4[1].lastMessage.lastTime) ? n3 : t3 : S2(e4[1].lastMessage.lastTime) ? i4 : o3).push(e4);
      }), t3.sort(function(e4, t4) {
        return t4[1].lastMessage.lastTime - e4[1].lastMessage.lastTime;
      }).concat(n3).concat(o3.sort(function(e4, t4) {
        return t4[1].lastMessage.lastTime - e4[1].lastMessage.lastTime;
      })).concat(i4);
    } }, { key: "_sortConvListAndEmitEvent", value: function() {
      this._convMap = new Map(this._sortConvList(d2(this._convMap))), this.emitConvUpdate(true, false);
    } }, { key: "_updateUserOrGroupProfile", value: function(e3) {
      var n3, o3, t3, i4, s4 = this;
      0 !== e3.length && (n3 = [], o3 = [], t3 = this.get(4), i4 = this.get(7), e3.forEach(function(e4) {
        var t4;
        e4.type === R2.CONV_C2C ? n3.push(e4.toAccount) : e4.type === R2.CONV_GROUP && (t4 = e4.toAccount, i4.hasLocalGroup(t4) ? e4.groupProfile = i4.getLocalGroupProfile(t4) : o3.push(t4));
      }), M2.l("".concat(this._n, "._updateUserOrGroupProfile userIDList:").concat(n3, " groupIDList:").concat(o3)), 0 < n3.length && t3.getUserProfile({ userIDList: n3 }).then(function(e4) {
        e4 = e4.data;
        O2(e4) ? e4.forEach(function(e5) {
          s4._doUpdateUserProfile("".concat(R2.CONV_C2C).concat(e5.userID), e5);
        }) : s4._doUpdateUserProfile("".concat(R2.CONV_C2C).concat(e4.userID), e4);
      }), 0 < o3.length) && i4.getGroupProfileAdvance({ groupIDList: o3, responseFilter: { groupBaseInfoFilter: ["Type", "Name", "FaceUrl"] } }).then(function(e4) {
        var e4 = e4.data.successGroupList, n4 = false;
        e4.forEach(function(e5) {
          var t4 = "".concat(R2.CONV_GROUP).concat(e5.groupID);
          s4._convMap.has(t4) && (t4 = s4._convMap.get(t4), dt2(t4.groupProfile, e5, [], [null, void 0, "", 0, NaN]), !t4.subType && e5.type && (t4.subType = e5.type), n4 = true);
        }), n4 && s4.emitConvUpdate();
      });
    } }, { key: "_doUpdateUserProfile", value: function(e3, t3) {
      this.hasLocalConversation(e3) && (this.getLocalConversation(e3).userProfile = t3, this.emitConvUpdate());
    } }, { key: "_getConvOptions", value: function(e3) {
      var n3 = this, o3 = [], e3 = e3.filter(function(e4) {
        var t3 = e4.type, e4 = e4.userID;
        return 1 === t3 && !n3._isNonExistentAccount(e4) || 2 === t3;
      }), i4 = this.getMyUserID(), e3 = e3.map(function(e4) {
        var t3;
        return N3(e4.lastMsg) && (e4.lastMsg = { elements: [] }), 1 === e4.type ? (t3 = { userID: e4.userID, nick: e4.peerNick, avatar: e4.peerAvatar }, o3.push(t3), { conversationID: "".concat(R2.CONV_C2C).concat(e4.userID), type: R2.CONV_C2C, lastMessage: { lastTime: e4.time, lastSequence: e4.sequence, fromAccount: e4.lastC2CMsgFromAccount, type: e4.lastMsg.elements[0] ? e4.lastMsg.elements[0].type : null, payload: e4.lastMsg.elements[0] ? n3._amendLayersOverLimitProp(e4.lastMsg.elements[0].content, e4.lastMsg.elements[0].type) : null, cloudCustomData: e4.lastMsg.cloudCustomData || "", isRevoked: 8 === e4.lastMessageFlag, onlineOnlyFlag: false, nick: "", nameCard: "", version: 0, isPeerRead: e4.lastC2CMsgFromAccount === i4 && e4.time <= e4.c2cPeerReadTime, revoker: e4.lastMsg.revokerInfo ? e4.lastMsg.revokerInfo.revoker : null }, unreadCount: 0, userProfile: new bo(t3), peerReadTime: e4.c2cPeerReadTime, isPinned: 1 === e4.isPinned, customData: e4.customMark || "", markList: Xt2(e4.standardMark), conversationGroupList: n3._convGroupHandler.getConvGroupListByID(e4.contactGroupId), remark: e4.friendRemark || "", messageRemindType: n3._transMsgRemindType(e4.messageRemindType) }) : { conversationID: "".concat(R2.CONV_GROUP).concat(e4.groupID), type: R2.CONV_GROUP, lastMessage: y2(y2({ lastTime: e4.time, lastSequence: e4.sequence, fromAccount: e4.msgGroupFromAccount }, n3._patchTypeAndPayload(e4)), {}, { cloudCustomData: e4.lastMsg.cloudCustomData || "", isRevoked: 2 === e4.lastMessageFlag, onlineOnlyFlag: false, nick: e4.senderNick || "", nameCard: e4.senderNameCard || "", revoker: e4.lastMsg.revokerInfo ? e4.lastMsg.revokerInfo.revoker : null }), groupProfile: new qo({ groupID: e4.groupID, name: e4.groupNick, avatar: e4.groupImage, type: e4.groupType, nextMessageSeq: e4.nextMessageSeq }), unreadCount: n3._computeGroupUnreadCount(e4), peerReadTime: 0, isPinned: 1 === e4.isPinned, version: 0, customData: e4.customMark || "", markList: Xt2(e4.standardMark), conversationGroupList: n3._convGroupHandler.getConvGroupListByID(e4.contactGroupId), messageRemindType: n3._transMsgRemindType(e4.messageRemindType) };
      });
      return 0 < o3.length && this.get(4).onConvProfileUpdated(o3), e3;
    } }, { key: "_transMsgRemindType", value: function(e3) {
      var t3 = "";
      return 0 === e3 ? t3 = R2.MSG_REMIND_ACPT_AND_NOTE : 1 === e3 ? t3 = R2.MSG_REMIND_DISCARD : 2 === e3 ? t3 = R2.MSG_REMIND_ACPT_NOT_NOTE : 3 === e3 && (t3 = R2.NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT), t3;
    } }, { key: "_computeGroupUnreadCount", value: function(e3) {
      var t3 = e3.unreadCount, e3 = e3.noUnreadCount, t3 = (void 0 === t3 ? 0 : t3) - (void 0 === e3 ? 0 : e3);
      return 0 < t3 ? t3 : 0;
    } }, { key: "_patchTypeAndPayload", value: function(e3) {
      var e3 = e3.lastMsg, t3 = e3.event, n3 = e3.elements, n3 = void 0 === n3 ? [] : n3, e3 = e3.groupTips, e3 = void 0 === e3 ? {} : e3;
      return N3(void 0 === t3 ? void 0 : t3) || S2(e3) ? { type: n3[0] ? n3[0].type : null, payload: n3[0] ? this._amendLayersOverLimitProp(n3[0].content, n3[0].type) : null } : ((t3 = new Do(e3)).setElement({ type: R2.MSG_GRP_TIP, content: y2(y2({}, e3.elements), {}, { groupProfile: e3.groupProfile }) }), n3 = JSON.parse(JSON.stringify(t3.payload)), t3 = null, { type: R2.MSG_GRP_TIP, payload: n3 });
    } }, { key: "_amendLayersOverLimitProp", value: function(e3, t3) {
      var n3 = this.getFileDownloadProxy(), o3 = this.getDownloadFileAuthKey(), i4 = this.get(17).getFileDNList(), s4 = e3.layersOverLimit, a3 = null;
      return t3 === R2.MSG_IMAGE && (a3 = new uo(e3, n3, o3, i4)), t3 === R2.MSG_VIDEO && (a3 = new Io(e3, n3, o3, i4)), t3 === R2.MSG_SOUND && (a3 = new po(e3, n3, o3, i4)), t3 === R2.MSG_FILE && ((a3 = new mo(e3, n3, o3, i4)).content.url = void 0), 0 === s4 ? e3.layersOverLimit = false : 1 === s4 && (e3.layersOverLimit = true), a3 && Object.assign(e3, a3.content), e3;
    } }, { key: "getLocalMessageList", value: function(e3) {
      return this._msgListHandler.getLocalMsgList(e3);
    } }, { key: "deleteLocalMessage", value: function(e3) {
      e3 instanceof Do && this._msgListHandler.remove(e3);
    } }, { key: "onConvDeleted", value: function(e3) {
      O2(e3) && (e3 = e3.map(function(e4) {
        var t3 = e4.type, n3 = e4.userID, e4 = e4.groupID;
        return 1 === t3 ? "".concat(R2.CONV_C2C).concat(n3) : 2 === t3 ? "".concat(R2.CONV_GROUP).concat(e4) : void 0;
      }), M2.l("".concat(this._n, ".onConvDeleted convIDList:").concat(e3)), this.deleteLocalConvList(e3));
    } }, { key: "onConvPinnedStatus", value: function(e3, i4) {
      var s4, a3 = this;
      O2(e3) && (s4 = false, e3.forEach(function(e4) {
        var t3, n3 = e4.type, o3 = e4.userID, e4 = e4.groupID;
        1 === n3 ? t3 = a3.getLocalConversation("".concat(R2.CONV_C2C).concat(o3)) : 2 === n3 && (t3 = a3.getLocalConversation("".concat(R2.CONV_GROUP).concat(e4))), t3 && (M2.l("".concat(a3._n, ".onConvPinnedStatus convID:").concat(t3.conversationID, " localPinned:").concat(t3.isPinned, " remotePinned:").concat(i4)), i4 ? t3.isPinned || (t3.isPinned = true, s4 = true) : t3.isPinned && (t3.isPinned = false, s4 = true));
      }), s4) && this._sortConvListAndEmitEvent();
    } }, { key: "getMessageList", value: function(e3) {
      var r4 = this, c3 = e3.conversationID, t3 = e3.nextReqMessageID, e3 = e3.count, u3 = "".concat(this._n, ".getMessageList"), n3 = this.getLocalConversation(c3), o3 = "";
      if (n3 && n3.groupProfile && (o3 = n3.groupProfile.type), At2(o3))
        return M2.l("".concat(u3, " not available in ").concat(o3, ". convID:").concat(c3)), D2({ messageList: [], nextReqMessageID: "", isCompleted: true });
      (N3(e3) || 15 < e3) && (e3 = 15), t3 || this._isMeInCommunity(c3) || this.clearMemMsg(c3);
      var l3 = this._computeRemainingCount({ conversationID: c3, nextReqMessageID: t3 }), n3 = this._completedMap.has(c3);
      if (M2.l("".concat(u3, " convID:").concat(c3, " isEverCleared:").concat(this._isEverCleared(c3), " nextReqMessageID:").concat(t3) + " remainingCount:".concat(l3, " count:").concat(e3, " isCompleted:").concat(n3)), this._needGetHistory({ conversationID: c3, remainingCount: l3, count: e3 }))
        return this.getHistoryMessages({ conversationID: c3, nextReqMessageID: t3, count: 20 }).then(function(e4) {
          var t4 = e4.nextReqID, n4 = e4.storedMessageList, o4 = e4.assembledMessageList, e4 = e4.isPullingCompleted, i4 = r4._completedMap.has(c3), s4 = n4, a3 = (0 < l3 && (s4 = r4._msgListHandler.getLocalMsgList(c3).slice(0, n4.length + l3)), { nextReqMessageID: void 0, messageList: void 0, isCompleted: void 0 }), n4 = (r4._isEverCleared(c3) ? (a3.nextReqMessageID = t4, a3.messageList = o4, a3.isCompleted = e4) : (a3.nextReqMessageID = i4 ? "" : t4, a3.messageList = s4, a3.isCompleted = i4), a3.messageList.filter(function(e5) {
            return e5.isRevoked;
          }) || []), o4 = a3.messageList.map(function(e5) {
            return e5.sequence;
          });
          return M2.l("".concat(u3, " ret.nextReqMessageID:").concat(a3.nextReqMessageID, " ret.isCompleted:").concat(a3.isCompleted, " sequenceList:"), o4), O2(n4) && 0 !== n4.length ? r4.updateRevokerInfo(n4).then(function(e5) {
            return e5.forEach(function(t5) {
              var n5 = t5.revokerInfo;
              a3.messageList = a3.messageList.map(function(e6) {
                return e6.ID === t5.ID && n5 && (e6.revokeReason = n5.reason || "", e6.revokerInfo = { userID: n5.revoker || e6.revoker, nick: n5.nick, avatar: n5.avatar }), e6;
              });
            }), T2(a3);
          }) : T2(a3);
        });
      this.modifyMessageList(c3);
      o3 = this._getMsgListFromMem({ conversationID: c3, nextReqMessageID: t3, count: e3 });
      return D2(o3);
    } }, { key: "_isEverCleared", value: function(e3) {
      return this._everClearedMap.has(e3);
    } }, { key: "_getMsgListFromMem", value: function(e3) {
      var t3 = e3.conversationID, n3 = e3.nextReqMessageID, e3 = e3.count, o3 = "".concat(this._n, "._getMsgListFromMem"), i4 = this._msgListHandler.getLocalMsgList(t3), s4 = i4.length, a3 = Gt2(t3), r4 = 0, c3 = { isCompleted: false, nextReqMessageID: "", messageList: [] }, e3 = (n3 ? (r4 = a3 ? i4.findIndex(function(e4) {
        return e4.ID === n3;
      }) : i4.findIndex(function(e4) {
        return e4.sequence + "" === n3;
      })) > e3 ? (c3.messageList = i4.slice(r4 - e3, r4), c3.nextReqMessageID = a3 ? i4[r4 - e3].ID : i4[r4 - e3].sequence + "") : (c3.messageList = i4.slice(0, r4), c3.isCompleted = true) : e3 < s4 ? (c3.messageList = i4.slice(r4 = s4 - e3, s4), c3.nextReqMessageID = a3 ? i4[r4].ID : i4[r4].sequence + "") : (c3.messageList = i4.slice(0, s4), c3.isCompleted = true), c3.messageList.map(function(e4) {
        return e4.sequence;
      }));
      return M2.l("".concat(o3, " convID:").concat(t3) + " ret.nextReqMessageID:".concat(c3.nextReqMessageID, " ret.isCompleted:").concat(c3.isCompleted, " sequenceList:").concat(e3)), c3;
    } }, { key: "getMessageListHopping", value: function(e3) {
      var t3, n3, o3 = e3.conversationID, i4 = e3.sequence, s4 = e3.time, a3 = e3.count, e3 = e3.direction, e3 = void 0 === e3 ? 0 : e3;
      return (N3(a3) || 15 < a3) && (a3 = 15), o3.startsWith(R2.CONV_C2C) ? (t3 = this.get(6), n3 = o3.replace(R2.CONV_C2C, ""), t3.getRoamingMessagesHopping({ peerAccount: n3, time: s4, count: a3, direction: e3 })) : o3.startsWith(R2.CONV_GROUP) ? (t3 = this.get(7), n3 = o3.replace(R2.CONV_GROUP, ""), t3.getRoamingMessagesHopping({ groupID: n3, sequence: i4, count: a3, direction: e3 })) : void 0;
    } }, { key: "_computeRemainingCount", value: function(e3) {
      var t3, n3 = e3.conversationID, o3 = e3.nextReqMessageID, e3 = this._msgListHandler.getLocalMsgList(n3), i4 = e3.length;
      return M2.l("".concat(this._n, "._computeRemainingCount convID:").concat(n3, " nextReqMessageID:").concat(o3, " length:").concat(i4)), o3 ? (t3 = 0, Gt2(n3) ? t3 = e3.findIndex(function(e4) {
        return e4.ID === o3;
      }) : Pt2(n3) && (t3 = -1 !== o3.indexOf("-") ? e3.findIndex(function(e4) {
        return e4.ID === o3;
      }) : e3.findIndex(function(e4) {
        return e4.sequence + "" === o3;
      })), -1 === t3 ? 0 : t3) : i4;
    } }, { key: "_needGetHistory", value: function(e3) {
      var t3 = e3.conversationID, n3 = e3.remainingCount, e3 = e3.count, o3 = this.getLocalConversation(t3), i4 = "";
      return o3 && o3.groupProfile && (i4 = o3.groupProfile.type), !(Ut2(t3) || At2(i4) || !this._isEverCleared(t3) && (o3 = n3 <= e3 && !this._completedMap.has(t3), M2.l("".concat(this._n, "._needGetHistory convID:").concat(t3, " ret:").concat(o3)), !o3));
    } }, { key: "_isTopicConv", value: function(e3) {
      e3 = e3.replace(R2.CONV_GROUP, "");
      return Nt2(e3);
    } }, { key: "getHistoryMessages", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4 = e3.conversationID, c3 = e3.count, e3 = e3.nextReqMessageID;
      return r4 === R2.CONV_SYSTEM ? D2() : (c3 = 20 < c3 ? 20 : 15, t3 = null, Gt2(r4) ? (a3 = 0, n3 = "", o3 = false, s4 = this._roamingMsgKeyAndTimeMap.has(r4), e3 && (o3 = true, s4 ? (a3 = this._roamingMsgKeyAndTimeMap.get(r4).lastMessageTime, n3 = this._roamingMsgKeyAndTimeMap.get(r4).messageKey) : (i4 = this._msgListHandler.findMessage(e3)) && (a3 = i4.time, M2.l("".concat(this._n, ".getHistoryMessages convID:").concat(r4, " isRelayInfoExisted:").concat(s4, " lastMessageTime:").concat(a3)))), (t3 = this.get(6)).getRoamingMessage({ conversationID: r4, peerAccount: r4.replace(R2.CONV_C2C, ""), count: c3, lastMessageTime: o3 ? a3 : 0, messageKey: o3 ? n3 : "" })) : Pt2(r4) ? (t3 = this.get(7)) ? (i4 = r4.replace(R2.CONV_GROUP, ""), s4 = null, this._convMap.has(r4) && !Nt2(i4) && (s4 = this._convMap.get(r4).lastMessage), a3 = 0, e3 ? a3 = Number(e3) : s4 && (a3 = s4.lastSequence), t3.getRoamingMessage({ conversationID: r4, groupID: i4, count: c3, sequence: a3 })) : E2({ code: k2.NO_MODULE }) : D2());
    } }, { key: "patchConvLastMessage", value: function(e3) {
      var t3, n3, o3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1], i4 = this.getLocalConversation(e3);
      i4 && (t3 = (n3 = i4.lastMessage).messageForShow, n3 = n3.payload, S2(t3) || S2(n3) || o3) && 0 !== (t3 = this._msgListHandler.getLocalMsgList(e3)).length && (n3 = t3[t3.length - 1], M2.l("".concat(this._n, ".patchConvLastMessage bForceUpdate:").concat(o3, " convID:").concat(e3, " payload:"), n3.payload), i4.updateLastMessage(n3));
    } }, { key: "onRoamingMessage", value: function() {
      for (var e3, t3, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : [], o3 = 1 < arguments.length ? arguments[1] : void 0, i4 = !(2 < arguments.length && void 0 !== arguments[2]) || arguments[2], s4 = 3 < arguments.length ? arguments[3] : void 0, a3 = o3.startsWith(R2.CONV_C2C) ? R2.CONV_C2C : R2.CONV_GROUP, r4 = null, c3 = [], o3 = [], u3 = 0, l3 = n3.length, d3 = a3 === R2.CONV_GROUP, p4 = this.getFileDownloadProxy(), _3 = this.getDownloadFileAuthKey(), h3 = O2(s4), g3 = this.get(17).getFileDNList(), f3 = function() {
        d3 ? --u3 : ++u3;
      }, m3 = function() {
        return d3 ? l3 <= u3 : u3 < l3;
      }, u3 = d3 ? n3.length - 1 : 0, l3 = d3 ? 0 : n3.length; m3(); f3())
        1 !== n3[u3].isPlaceMessage && ((r4 = new Do(n3[u3])).to = n3[u3].to, a3 !== R2.CONV_GROUP || N3(n3[u3].topicID) || (r4.to = n3[u3].topicID), r4.isSystemMessage = !!n3[u3].isSystemMessage, r4.conversationType = a3, e3 = 4 === n3[u3].event ? { type: R2.MSG_GRP_TIP, content: y2(y2({}, n3[u3].elements), {}, { groupProfile: n3[u3].groupProfile }) } : n3[u3].elements, d3 || r4.setNickAndAvatar({ nick: n3[u3].nick, avatar: n3[u3].avatar }), S2(e3) ? ((t3 = new P2("emptyMessageBody")).setMessage("from:".concat(r4.from, " to:").concat(r4.to, " sequence:").concat(r4.sequence, " event:").concat(n3[u3].event)), t3.setLevel("warning").end()) : (r4.setElement(e3, p4, _3, g3), r4.reInitialize(this.getMyUserID()), c3.push(r4), h3 && s4.push(r4)));
      return f3 = m3 = null, i4 ? (this._msgListHandler.unshift(c3, o3), c3 = null, o3) : c3;
    } }, { key: "findMessage", value: function(e3) {
      return this._msgListHandler.findMessage(e3);
    } }, { key: "_isMeInCommunity", value: function(e3) {
      var t3 = true;
      return this._isTopicConv(e3) && (e3 = jt2(e3.replace(R2.CONV_GROUP, "")), this.get(7).hasLocalGroup(e3) || (t3 = false, M2.l("".concat(this._n, "._isMeInCommunity groupID:").concat(e3, " ret:").concat(t3)))), t3;
    } }, { key: "deleteTopicRoamingInfo", value: function(e3) {
      var t3 = this;
      Ot2({ groupID: e3 }) && this._msgListHandler.getTopicConvIDList(e3).forEach(function(e4) {
        t3.clearMemMsg(e4);
      });
    } }, { key: "deleteGroupRoamingInfo", value: function(e3) {
      e3 = "".concat(R2.CONV_GROUP).concat(e3);
      0 < this._msgListHandler.getLocalMsgList(e3).length && this.clearMemMsg(e3);
    } }, { key: "setMessageRead", value: function(e3) {
      var t3 = e3.conversationID, n3 = this.getLocalConversation(t3), e3 = "".concat(this._n, ".setMessageRead");
      if (M2.l("".concat(e3, " convID:").concat(t3, " unreadCount:").concat(n3 ? n3.unreadCount : 0)), !n3)
        return D2();
      if (n3.type !== R2.CONV_GROUP && n3.type !== R2.CONV_TOPIC || S2(n3.groupAtInfoList) || this.deleteGroupAtTips(t3), 0 === n3.unreadCount)
        return D2();
      var o3 = this._msgListHandler.getLocalLastMsg(t3), i4 = n3.lastMessage.lastTime, s4 = this._msgListHandler.getLocalMaxTime(t3), s4 = (i4 < s4 && (M2.l("".concat(e3, " update lastMessageTime from ").concat(i4, " to ").concat(s4)), i4 = s4), this._msgListHandler.getLocalMaxSeq(t3)), a3 = n3.lastMessage.lastSequence, r4 = (a3 < s4 && (M2.l("".concat(e3, " update lastMessageSeq from ").concat(a3, " to ").concat(s4)), a3 = s4), n3.type === R2.CONV_TOPIC && N3(o3) && (e3 = this.get(10), o3 = jt2(s4 = t3.replace(R2.CONV_GROUP, "")), e3 = e3.getLocalTopic(o3, s4)) && (a3 = e3.nextMessageSeq - 1), null);
      switch (n3.type) {
        case R2.CONV_C2C:
          return (r4 = this.get(6)) ? r4.setMessageRead({ conversationID: t3, lastMessageTime: i4 }) : E2({ code: k2.NO_MODULE });
        case R2.CONV_GROUP:
        case R2.CONV_TOPIC:
          return (r4 = this.get(7)) ? r4.setMessageRead({ conversationID: t3, lastMessageSeq: a3 }) : E2({ code: k2.NO_MODULE });
        case R2.CONV_SYSTEM:
          return n3.unreadCount = 0, this.emitConvUpdate(true, false), D2();
        default:
          return D2();
      }
    } }, { key: "setAllMessageRead", value: function() {
      var t3, n3 = this, o3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, e3 = "setAllMessageRead", i4 = "".concat(this._n, ".").concat(e3), s4 = (o3.scope || (o3.scope = R2.READ_ALL_MSG), M2.l("".concat(i4, " options:"), o3), this._createSetAllMessageReadPack(o3));
      return 0 === s4.readAllC2CMessage && 0 === s4.groupMessageReadInfoList.length ? D2() : (t3 = new P2(e3), this.req({ P: G2.SET_ALL_MSG_READ, data: s4 }).then(function(e4) {
        e4 = e4.data, e4 = n3._handleAllMsgRead(e4);
        return t3.setMessage("scope:".concat(o3.scope, " failureGroups:").concat(JSON.stringify(e4))).end(), D2();
      }).catch(function(e4) {
        return t3.setError(e4).end(), M2.w("".concat(i4, " failed. error:"), e4), E2({ code: e4 && e4.code ? e4.code : k2.MSG_UNREAD_ALL_FAIL, message: e4 && e4.message ? e4.message : void 0 });
      }));
    } }, { key: "setConvCustomData", value: function(e3) {
      return this._convGroupHandler.setConvCustomData(e3);
    } }, { key: "markConv", value: function(e3) {
      return this._convGroupHandler.markConv(e3);
    } }, { key: "getConvGroupList", value: function() {
      return this._convGroupHandler.getLocalConvGroupList();
    } }, { key: "createConvGroup", value: function(e3) {
      return this._convGroupHandler.createConvGroup(e3);
    } }, { key: "deleteConvGroup", value: function(e3) {
      return this._convGroupHandler.deleteConvGroup(e3);
    } }, { key: "renameConvGroup", value: function(e3) {
      return this._convGroupHandler.renameConvGroup(e3);
    } }, { key: "addConvsToGroup", value: function(e3) {
      return this._convGroupHandler.addConvsToGroup(e3);
    } }, { key: "deleteConvsFromGroup", value: function(e3) {
      return this._convGroupHandler.deleteConvsFromGroup(e3);
    } }, { key: "onConvMarkUpdated", value: function(e3) {
      this._convGroupHandler.onConvMarkUpdated(e3);
    } }, { key: "onConvGroupCreated", value: function(e3) {
      this._convGroupHandler.onConvGroupCreated(e3);
    } }, { key: "onConvGroupDeleted", value: function(e3) {
      this._convGroupHandler.onConvGroupDeleted(e3);
    } }, { key: "onConvGroupNameUpdated", value: function(e3) {
      this._convGroupHandler.onConvGroupNameUpdated(e3);
    } }, { key: "onConvInGroupUpdated", value: function(e3) {
      this._convGroupHandler.onConvInGroupUpdated(e3);
    } }, { key: "onConvAddedToOrDeletedFromGroup", value: function(e3) {
      this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e3);
    } }, { key: "_getConvLastMessageSeq", value: function(e3) {
      var t3 = this._msgListHandler.getLocalLastMsg(e3.conversationID), e3 = e3.lastMessage.lastSequence;
      return e3 = t3 && e3 < t3.sequence ? t3.sequence : e3;
    } }, { key: "_getConvLastMessageTime", value: function(e3) {
      var t3 = this._msgListHandler.getLocalLastMsg(e3.conversationID), e3 = e3.lastMessage.lastTime;
      return e3 = t3 && e3 < t3.time ? t3.time : e3;
    } }, { key: "_createSetAllMessageReadPack", value: function(e3) {
      var t3, n3 = { readAllC2CMessage: 0, groupMessageReadInfoList: [] }, o3 = e3.scope, i4 = F2(this._convMap);
      try {
        for (i4.s(); !(t3 = i4.n()).done; ) {
          var s4, a3 = j2(t3.value, 2)[1];
          if (0 < a3.unreadCount)
            if (a3.type === R2.CONV_C2C && 0 === n3.readAllC2CMessage) {
              if (o3 === R2.READ_ALL_MSG)
                n3.readAllC2CMessage = 1;
              else if (o3 === R2.READ_ALL_C2C_MSG) {
                n3.readAllC2CMessage = 1;
                break;
              }
            } else
              a3.type !== R2.CONV_GROUP || o3 !== R2.READ_ALL_GROUP_MSG && o3 !== R2.READ_ALL_MSG || (s4 = this._getConvLastMessageSeq(a3), n3.groupMessageReadInfoList.push({ groupID: a3.groupProfile.groupID, messageSequence: s4 }));
        }
      } catch (e4) {
        i4.e(e4);
      } finally {
        i4.f();
      }
      return n3;
    } }, { key: "onPushedAllMessageRead", value: function(e3) {
      this._handleAllMsgRead(e3);
    } }, { key: "_handleAllMsgRead", value: function(e3) {
      var t3 = e3.groupMessageReadInfoList, e3 = e3.readAllC2CMessage, t3 = this._parseGroupReadInfo(t3);
      return 1 <= this._updateAllConvUnreadCount({ readAllC2CMessage: e3 }) && this.emitConvUpdate(true, false), t3;
    } }, { key: "_parseGroupReadInfo", value: function(e3) {
      var t3 = [];
      if (e3 && e3.length)
        for (var n3 = 0, o3 = e3.length; n3 < o3; n3++) {
          var i4 = e3[n3], s4 = i4.groupID, a3 = i4.sequence, r4 = i4.retCode, i4 = i4.lastMessageSeq;
          N3(r4) ? this._remoteGroupReadSeqMap.set(s4, i4) : (this._remoteGroupReadSeqMap.set(s4, a3), 0 !== r4 && t3.push("".concat(s4, "-").concat(a3, "-").concat(r4)));
        }
      return t3;
    } }, { key: "_updateAllConvUnreadCount", value: function(e3) {
      var t3, n3 = e3.readAllC2CMessage, o3 = 0, i4 = F2(this._convMap);
      try {
        for (i4.s(); !(t3 = i4.n()).done; ) {
          var s4, a3, r4, c3, u3 = j2(t3.value, 2), l3 = u3[0], d3 = u3[1];
          1 <= d3.unreadCount && (1 === n3 && d3.type === R2.CONV_C2C ? (s4 = this._getConvLastMessageTime(d3), this.updateIsReadAfterReadReport({ conversationID: l3, lastMessageTime: s4 })) : d3.type === R2.CONV_GROUP && (a3 = l3.replace(R2.CONV_GROUP, ""), this._remoteGroupReadSeqMap.has(a3)) && (r4 = this._remoteGroupReadSeqMap.get(a3), c3 = this._getConvLastMessageSeq(d3), this.updateIsReadAfterReadReport({ conversationID: l3, remoteReadSequence: r4 }), r4 <= c3) && this._remoteGroupReadSeqMap.delete(a3), this.updateUnreadCount(l3, false)) && (o3 += 1);
        }
      } catch (e4) {
        i4.e(e4);
      } finally {
        i4.f();
      }
      return o3;
    } }, { key: "isRemoteRead", value: function(e3) {
      var t3, n3 = e3.conversationID, e3 = e3.sequence, o3 = n3.replace(R2.CONV_GROUP, ""), i4 = false;
      return this._remoteGroupReadSeqMap.has(o3) && (e3 <= (t3 = this._remoteGroupReadSeqMap.get(o3)) && (i4 = true, M2.l("".concat(this._n, ".isRemoteRead convID:").concat(n3, " msgSeq:").concat(e3, " remoteReadSeq:").concat(t3))), t3 + 10 <= e3) && this._remoteGroupReadSeqMap.delete(o3), i4;
    } }, { key: "updateIsReadAfterReadReport", value: function(e3) {
      var t3 = e3.conversationID, n3 = e3.lastMessageSeq, o3 = e3.lastMessageTime, i4 = this._msgListHandler.getLocalMsgList(t3);
      if (0 !== i4.length) {
        for (var s4, a3 = i4.length - 1; 0 <= a3; a3--)
          if (s4 = i4[a3], !(o3 && s4.time > o3 || n3 && s4.sequence > n3)) {
            if ("in" === s4.flow && s4.isRead)
              break;
            s4.setIsRead(true);
          }
      }
    } }, { key: "updateUnreadCount", value: function(e3) {
      var t3, n3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], o3 = false, i4 = this.getLocalConversation(e3), s4 = this._msgListHandler.getLocalMsgList(e3);
      if (i4)
        return (t3 = i4.unreadCount) !== (s4 = s4.filter(function(e4) {
          return !e4.isRead && !e4._onlineOnlyFlag && !e4.isDeleted;
        }).length) && (i4.unreadCount = s4, o3 = true, M2.l("".concat(this._n, ".updateUnreadCount from ").concat(t3, " to ").concat(s4, ", convID:").concat(e3)), true === n3) && this.emitConvUpdate(true, false), o3 && i4.type === R2.CONV_TOPIC && (t3 = i4.unreadCount, s4 = this.get(10), n3 = e3.replace(R2.CONV_GROUP, ""), s4.onUnreadCountUpdatedFromConv(n3, t3)), o3;
    } }, { key: "clearGroupAtInfoList", value: function(e3) {
      var t3, n3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], o3 = this.getLocalConversation(e3);
      o3 && 0 < o3.groupAtInfoList.length && (o3.clearGroupAtInfoList(), M2.l("".concat(this._n, ".clearGroupAtInfoList convID:").concat(e3)), o3.type === R2.CONV_TOPIC && (o3 = o3.groupAtInfoList, t3 = this.get(10), e3 = e3.replace(R2.CONV_GROUP, ""), t3.onAtInfoUpdated({ topicID: e3, groupAtInfoList: o3 })), true === n3) && this.emitConvUpdate(true, false);
    } }, { key: "updateReadReceiptInfo", value: function(e3) {
      var s4, a3, o3, r4 = this, t3 = e3.userID, i4 = void 0 === t3 ? void 0 : t3, t3 = e3.groupID, c3 = void 0 === t3 ? void 0 : t3, t3 = e3.readReceiptList, e3 = e3.timestamp, u3 = void 0 === e3 ? 0 : e3;
      S2(t3) || (s4 = [], N3(i4) ? N3(c3) || (a3 = "".concat(R2.CONV_GROUP).concat(c3), t3.forEach(function(e4) {
        var t4 = e4.tinyID, n3 = e4.clientTime, o4 = e4.random, i5 = e4.readCount, e4 = e4.unreadCount, t4 = "".concat(t4, "-").concat(n3, "-").concat(o4), n3 = r4._msgListHandler.getLocalMsg(a3, t4) || r4._msgListHandler.getHoppingMsg(a3, t4), o4 = { groupID: c3, messageID: t4, readCount: 0, unreadCount: 0 };
        n3 && (A2(i5) && (n3.readReceiptInfo.readCount = i5, o4.readCount = i5), A2(e4) && (n3.readReceiptInfo.unreadCount = e4, o4.unreadCount = e4), s4.push(o4));
      })) : (o3 = "".concat(R2.CONV_C2C).concat(i4), t3.forEach(function(e4) {
        var t4 = e4.tinyID, n3 = e4.clientTime, e4 = e4.random, t4 = "".concat(t4, "-").concat(n3, "-").concat(e4), n3 = r4._msgListHandler.getLocalMsg(o3, t4) || r4._msgListHandler.getHoppingMsg(o3, t4);
        n3 && !n3.readReceiptInfo.isPeerRead && (n3.readReceiptInfo.isPeerRead = true, n3.readReceiptInfo.timestamp = u3, s4.push({ userID: i4, messageID: t4, isPeerRead: true, timestamp: u3 }));
      })), 0 < s4.length && this.emitOEvt(h2.MESSAGE_READ_RECEIPT_RECEIVED, s4));
    } }, { key: "updateIsRead", value: function(e3) {
      var t3 = this.getLocalConversation(e3), n3 = this.getLocalMessageList(e3);
      if (t3 && 0 !== n3.length && !Ut2(t3.type)) {
        for (var o3 = [], i4 = 0, s4 = n3.length; i4 < s4; i4++)
          "in" !== n3[i4].flow ? "out" !== n3[i4].flow || n3[i4].isRead || n3[i4].setIsRead(true) : o3.push(n3[i4]);
        var a3 = 0;
        a3 = t3.type === R2.CONV_C2C ? (e3 = o3.slice(-t3.unreadCount).filter(function(e4) {
          return e4.isRevoked;
        }).length, o3.length - t3.unreadCount - e3) : o3.length - t3.unreadCount;
        for (var r4 = 0; r4 < a3 && !o3[r4].isRead; r4++)
          o3[r4].setIsRead(true);
      }
    } }, { key: "deleteGroupAtTips", value: function(e3) {
      var t3, n3, o3, i4 = this, s4 = "".concat(this._n, ".deleteGroupAtTips"), a3 = (M2.l("".concat(s4)), this._convMap.get(e3));
      return !a3 || 0 === (t3 = a3.groupAtInfoList).length ? Promise.resolve() : (a3 = void 0, e3.startsWith(R2.CONV_GROUP) && (a3 = e3.replace(R2.CONV_GROUP, "")), n3 = d2(t3), (Ot2({ groupID: a3 }) || Nt2(a3)) && 0 === (n3 = t3.filter(function(e4) {
        return !e4.atTypeArray.includes(R2.CONV_AT_ALL);
      })).length ? (this.clearGroupAtInfoList(e3, false), Promise.resolve()) : (o3 = this.getMyUserID(), this.req({ P: G2.DEL_GROUP_AT_TIPS, data: { messageListToDelete: n3.map(function(e4) {
        return { from: e4.from, to: o3, messageSeq: e4.__sequence, messageRandom: e4.__random, groupID: N3(e4.topicID) ? e4.groupID : e4.topicID };
      }) } }).then(function() {
        return M2.l("".concat(s4, " ok. count:").concat(t3.length)), i4.clearGroupAtInfoList(e3, false), Promise.resolve();
      }).catch(function(e4) {
        return M2.e("".concat(s4, " failed. error:"), e4), E2(e4);
      })));
    } }, { key: "appendToMessageList", value: function(e3) {
      return this._msgListHandler.pushIn(e3);
    } }, { key: "setMessageRandom", value: function(e3) {
      this._sll.set(e3.random);
    } }, { key: "deleteMessageRandom", value: function(e3) {
      this._sll.delete(e3.random);
    } }, { key: "pushIntoMessageList", value: function(e3, t3, n3) {
      return !(!this._msgListHandler.pushIn(t3, n3) || this._sll.has(t3.random) && !n3 || (e3.push(t3), 0));
    } }, { key: "revoke", value: function(e3, t3, n3) {
      return this._msgListHandler.revoke(e3, t3, n3);
    } }, { key: "getPeerReadTime", value: function(e3) {
      return this._peerReadTimeMap.get(e3);
    } }, { key: "recordPeerReadTime", value: function(e3, t3) {
      (!this._peerReadTimeMap.has(e3) || this._peerReadTimeMap.get(e3) < t3) && this._peerReadTimeMap.set(e3, t3);
    } }, { key: "updateMsgIsPeerReadProp", value: function(e3, t3) {
      var n3;
      e3.startsWith(R2.CONV_C2C) && 0 < t3 && (0 < (n3 = this._msgListHandler.updateMsgIsPeerReadProp(e3, t3)).length && this.emitOEvt(h2.MESSAGE_READ_BY_PEER, n3), this._convMap.has(e3)) && !S2(n3 = this._convMap.get(e3).lastMessage) && n3.fromAccount === this.getMyUserID() && n3.lastTime <= t3 && !n3.isPeerRead && (n3.isPeerRead = true, this.emitConvUpdate(true, false));
    } }, { key: "updateMsgIsModifiedProp", value: function(e3) {
      this._msgListHandler.updateMsgIsModifiedProp(e3);
    } }, { key: "setCompleted", value: function(e3) {
      M2.l("".concat(this._n, ".setCompleted convID:").concat(e3)), this._completedMap.set(e3, true);
    } }, { key: "updateRoamingMsgKeyAndTime", value: function(e3, t3, n3) {
      this._roamingMsgKeyAndTimeMap.set(e3, { messageKey: t3, lastMessageTime: n3 });
    } }, { key: "getConvList", value: function(t3) {
      var n3, o3 = this, i4 = "".concat(this._n, ".").concat("getConvList"), e3 = "pagingStatus:".concat(this._pagingStatus, ", local conversation count:").concat(this._convMap.size, ", options:").concat(JSON.stringify(t3));
      return M2.l("".concat(i4, ". ").concat(e3)), this._pagingStatus === bn ? ((n3 = new P2("getConvList")).setMessage(e3), this.syncConvList().then(function() {
        n3.end();
        var e4 = o3._getConvList(t3);
        return T2({ conversationList: e4, isSyncCompleted: o3._isSyncCompleted() });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : (e3 = this._getConvList(t3), M2.l("".concat(i4, ". returned conversation count:").concat(e3.length)), D2({ conversationList: e3, isSyncCompleted: this._isSyncCompleted() }));
    } }, { key: "_getConvList", value: function(t3) {
      var n3, o3, i4, s4, a3, r4 = this;
      return N3(t3) ? this.getLocalConvList() : O2(t3) ? 0 === t3.length ? [] : this.getLocalConvList().filter(function(e3) {
        return t3.includes(e3.conversationID);
      }) : m2(t3) ? (n3 = t3.type, o3 = t3.markType, i4 = t3.groupName, s4 = t3.hasUnreadCount, a3 = t3.hasGroupAtInfo, this.getLocalConvList().filter(function(e3) {
        return r4._filterType(e3, n3) && r4._filterMarkType(e3, o3) && r4._filterGroupName(e3, i4) && r4._filterUnreadCount(e3, s4) && r4._filterGroupAtInfo(e3, a3);
      })) : [];
    } }, { key: "_filterType", value: function(e3, t3) {
      return t3 !== R2.CONV_C2C && t3 !== R2.CONV_GROUP || e3.type === t3;
    } }, { key: "_filterGroupName", value: function(e3, t3) {
      return !C2(t3) || ("" === t3 ? 0 === e3.conversationGroupList.length : e3.conversationGroupList.includes(t3));
    } }, { key: "_filterMarkType", value: function(e3, t3) {
      return !A2(t3) || (0 === t3 ? 0 === e3.markList.length : e3.markList.includes(t3));
    } }, { key: "_filterUnreadCount", value: function(e3, t3) {
      var n3 = true;
      return true === t3 ? n3 = 1 <= e3.unreadCount : false === t3 && (n3 = 0 === e3.unreadCount), n3;
    } }, { key: "_filterGroupAtInfo", value: function(e3, t3) {
      var n3 = true;
      return true === t3 ? n3 = 1 <= e3.groupAtInfoList.length : false === t3 && (n3 = 0 === e3.groupAtInfoList.length), n3;
    } }, { key: "_handleC2CPeerReadTime", value: function() {
      var e3, t3 = F2(this._convMap);
      try {
        for (t3.s(); !(e3 = t3.n()).done; ) {
          var n3 = j2(e3.value, 2), o3 = n3[0], i4 = n3[1];
          i4.type === R2.CONV_C2C && this.recordPeerReadTime(o3, i4.peerReadTime);
        }
      } catch (e4) {
        t3.e(e4);
      } finally {
        t3.f();
      }
    } }, { key: "_isPagingGetGroupListCompleted", value: function() {
      var e3 = this.get(7);
      return !e3 || e3.isPagingGetCompleted();
    } }, { key: "_getLocalGroupCount", value: function() {
      var e3 = this.get(7);
      return e3 ? e3.getLocalGroupList().length : 0;
    } }, { key: "_hasLocalGroup", value: function(e3) {
      var t3 = this.get(7);
      return !!t3 && t3.hasLocalGroup(e3.replace(R2.CONV_GROUP, ""));
    } }, { key: "getConversationProfile", value: function(o3) {
      var i4, s4 = this, a3 = false;
      if (this._convMap.has(o3) ? i4 = this._convMap.get(o3) : (i4 = new xo({ conversationID: o3, type: Gt2(o3) ? R2.CONV_C2C : R2.CONV_GROUP }, this.isIntl(), this.isUsingChatCore()), a3 = true), i4._isInfoCompleted || i4.type === R2.CONV_SYSTEM)
        return D2({ conversation: i4 });
      if (Pt2(o3)) {
        if (!this.get(7))
          return E2({ code: k2.NO_MODULE });
        if (!this._hasLocalGroup(o3))
          return D2({ conversation: i4 });
      }
      var r4 = "".concat(this._n, ".").concat("getConversationProfile"), c3 = new P2("getConversationProfile");
      return M2.l("".concat(r4, ". convID:").concat(o3, " remark:").concat(i4.remark, " lastMessage:"), i4.lastMessage), this._getUserOrGroupProfile(i4).then(function(e3) {
        c3.setMessage("convID:".concat(o3, " unreadCount:").concat(e3.data.conversation.unreadCount)).end();
        var t3, n3 = s4.get(8);
        if (n3 && i4.type === R2.CONV_C2C && (t3 = o3.replace(R2.CONV_C2C, ""), n3.isMyFriend(t3)) && (n3 = n3.getFriendRemark(t3), i4.remark !== n3) && (i4.remark = n3, M2.l("".concat(r4, ". convID:").concat(o3, " patch remark:").concat(i4.remark))), M2.l("".concat(r4, " ok. isNewConv:").concat(a3, " convID:").concat(o3)), a3) {
          if (i4.type === R2.CONV_C2C)
            return s4._onNewC2CConv([o3.replace(R2.CONV_C2C, "")]).then(function() {
              return D2({ conversation: i4 });
            });
          if (i4.type === R2.CONV_GROUP)
            return s4._onNewGroupConv([o3.replace(R2.CONV_GROUP, "")]).then(function() {
              return D2({ conversation: i4 });
            });
        }
        return e3;
      }).catch(function(e3) {
        return c3.setError(e3).setMessage("convID:".concat(o3)).end(), M2.e("".concat(r4, " failed. error:"), e3), E2(e3);
      });
    } }, { key: "_getUserOrGroupProfile", value: function(t3) {
      var n3 = this;
      return t3.type === R2.CONV_C2C ? this.get(4).getUserProfile({ userIDList: [t3.toAccount] }).then(function(e3) {
        e3 = e3.data;
        return 0 === e3.length ? E2({ code: k2.USER_OR_GRP_NOT_FOUND }) : (t3.userProfile = e3[0], t3._isInfoCompleted = true, n3._insertConvAfterTopmost(t3), D2({ conversation: t3 }));
      }) : this.get(7).getGroupProfile({ groupID: t3.toAccount }).then(function(e3) {
        return t3.groupProfile = e3.data.group, t3._isInfoCompleted = true, n3._insertConvAfterTopmost(t3), D2({ conversation: t3 });
      });
    } }, { key: "_insertConvAfterTopmost", value: function(e3) {
      var t3, n3;
      e3 instanceof xo && !this._convMap.has(e3.conversationID) && (n3 = (t3 = d2(this._convMap)).findIndex(function(e4) {
        return false === e4[1].isPinned;
      }), t3.splice(n3, 0, [e3.conversationID, e3]), this._convMap = new Map(t3), this._setStorageConvList(), this.emitConvUpdate(true, false));
    } }, { key: "_onProfileUpdated", value: function(e3) {
      var n3 = this;
      e3.data.forEach(function(e4) {
        var t3 = e4.userID;
        t3 === n3.getMyUserID() ? n3._onMyProfileModified({ latestNick: e4.nick, latestAvatar: e4.avatar }) : (t3 = n3._convMap.get("".concat(R2.CONV_C2C).concat(t3))) && (t3.userProfile = e4);
      });
    } }, { key: "_onCloudConfig", value: function(e3) {
      "0" === this.getCloudConfig("pull_on_invite") && (this._bPullOnInvite = false), M2.l("".concat(this._n, "._onCloudConfig bPullOnInvite:").concat(this._bPullOnInvite));
    } }, { key: "disableMsgPullOnInvite", value: function() {
      this._bPullOnInvite = false;
    } }, { key: "_isSyncCompleted", value: function() {
      return this._pagingStatus === Un;
    } }, { key: "_errorLog", value: function(e3, t3, n3, o3) {
      var i4 = new Error("Params validate failed."), s4 = "".concat(this.getErrMsg("API_REFER")).concat(e3);
      throw M2.w("[".concat(e3, "] | ").concat(t3, " | ").concat(this.getErrMsg(n3, o3), ", ").concat(s4)), M2.e("[".concat(e3, "] Invalid ").concat(t3, ": type check failed for ").concat(t3, ".")), i4;
    } }, { key: "_isValidConvID", value: function(e3) {
      return Gt2(e3) || Pt2(e3) || Ut2(e3);
    } }, { key: "deleteConversation", value: function(e3) {
      var t3 = this, n3 = "deleteConversation";
      return C2(e3) || at2(e3) || this._errorLog(n3, "options", "StringOrObjectRequiredLog"), C2(e3) ? (this._isValidConvID(e3) || this._errorLog(n3, "options", "InvalidConversationID", e3), M2.l("".concat(this._n, ".").concat(n3, " convID:").concat(e3)), this.deleteConvList({ conversationIDList: [e3], flag: 1 })) : (O2(e3.conversationIDList) || this._errorLog(n3, "conversationIDList", "ArrayRequiredLog"), 0 === e3.conversationIDList.length && this._errorLog(n3, "conversationIDList", "NonEmptyArrayLog"), e3.conversationIDList.forEach(function(e4) {
        t3._isValidConvID(e4) || t3._errorLog(n3, "conversationIDList", "InvalidConversationID", e4);
      }), "clearHistoryMessage" in e3 && "boolean" != typeof e3.clearHistoryMessage && this._errorLog(n3, "clearHistoryMessage", "BooleanRequiredLog"), 100 < e3.conversationIDList.length && (e3.conversationIDList = e3.conversationIDList.slice(0, 100)), this.deleteConvList(e3));
    } }, { key: "deleteConvList", value: function(e3) {
      var t3 = e3.conversationIDList, t3 = void 0 === t3 ? [] : t3, n3 = e3.clearHistoryMessage, n3 = void 0 === n3 || n3, e3 = e3.flag, o3 = void 0 === e3 ? 0 : e3, i4 = "".concat(this._n, ".").concat("deleteConvList"), e3 = "convIDList:".concat(t3, " clearHistoryMessage:").concat(n3), s4 = (M2.l("".concat(i4, " ").concat(e3)), new P2("deleteConvList"));
      return s4.setMessage(e3), Promise.all([this.rmLocalOnlyConvList(t3), this.rmLocalAndRemoteConvList(t3, n3)]).then(function(e4) {
        s4.end();
        e4 = [].concat(d2(e4[0]), d2(e4[1]));
        return 0 === e4.length ? E2(new L2({ code: k2.CONV_NOT_FOUND })) : (M2.l("".concat(i4, " ok")), D2(1 === o3 ? { conversationID: e4[0] } : { conversationIDList: e4 }));
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "rmLocalOnlyConvList", value: function(e3) {
      var n3 = this;
      return e3.filter(function(e4) {
        var t3;
        return !!n3._convMap.has(e4) && ((t3 = n3.getLocalConversation(e4).type) !== R2.CONV_GROUP || n3._hasLocalGroup(e4) ? t3 === R2.CONV_SYSTEM && (n3.get(7).deleteGroupSystemNotice({ messageList: n3._msgListHandler.getLocalMsgList(e4) }), n3.deleteLocalConv(e4), true) : (n3.deleteLocalConv(e4), true));
      });
    } }, { key: "rmLocalAndRemoteConvList", value: function(e3, t3) {
      var n3 = this, o3 = { fromAccount: this.getMyUserID(), conversationList: [], clearHistoryMessage: t3 ? 1 : 0 };
      return e3.forEach(function(e4) {
        var t4;
        n3._convMap.has(e4) && ((t4 = n3.getLocalConversation(e4).type) === R2.CONV_C2C ? o3.conversationList.push({ toAccount: e4.replace(t4, ""), type: 1 }) : t4 === R2.CONV_GROUP && n3._hasLocalGroup(e4) && o3.conversationList.push({ toGroupID: e4.replace(t4, ""), type: 2 }));
      }), 0 === o3.conversationList.length ? [] : this.req({ P: G2.DEL_CONV, data: o3 }).then(function(e4) {
        var t4 = [];
        return 0 < e4.data.resultList.length && e4.data.resultList.map(function(e5) {
          0 === e5.code && (e5 = 1 === e5.type ? "".concat(R2.CONV_C2C).concat(e5.to) : "".concat(R2.CONV_GROUP).concat(e5.groupID), t4.push(e5));
        }), n3.deleteLocalConvList(t4), t4;
      });
    } }, { key: "setConvDraft", value: function(e3) {
      var t3 = e3.conversationID, e3 = e3.draftText, n3 = "".concat(this._n, ".").concat("setConvDraft");
      return M2.l("".concat(n3, " convID:").concat(t3, " draftText:").concat(e3)), this._convMap.has(t3) ? ((n3 = this._convMap.get(t3)).setDraftText(e3), this.emitConvUpdate(), D2({ code: 0, conversation: n3 })) : E2({ code: k2.CONV_NOT_FOUND });
    } }, { key: "clearHistoryMessage", value: function(t3) {
      var n3 = this, e3 = { fromAccount: this.getMyUserID(), toAccount: void 0, type: void 0, toGroupID: void 0 };
      if (!this._convMap.has(t3))
        return E2({ code: k2.CONV_NOT_FOUND });
      var o3 = this._convMap.get(t3).type;
      if (o3 === R2.CONV_C2C)
        e3.type = 1, e3.toAccount = t3.replace(R2.CONV_C2C, "");
      else {
        if (o3 !== R2.CONV_GROUP)
          return o3 === R2.CONV_SYSTEM ? (this.get(7).deleteGroupSystemNotice({ messageList: this._msgListHandler.getLocalMsgList(t3) }), D2({ conversationID: t3 })) : E2({ code: k2.CONV_UN_RECORDED_TYPE });
        e3.type = 2, e3.toGroupID = t3.replace(R2.CONV_GROUP, "");
      }
      var i4 = "".concat(this._n, ".").concat("clearHistoryMessage"), s4 = new P2("clearHistoryMessage");
      return s4.setMessage("convID:".concat(t3)), M2.l("".concat(i4, ". convID:").concat(t3)), this.setMessageRead({ conversationID: t3 }).then(function() {
        return n3.req({ P: G2.CLEAR_HISTORY_MSG, data: e3 });
      }).then(function() {
        s4.end(), M2.l("".concat(i4, " ok")), n3.clearMemMsg(t3);
        var e4 = n3.getLocalConversation(t3);
        return e4 && (e4.updateLastMessage(), n3._sortConvListAndEmitEvent()), D2({ conversationID: t3 });
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "pinConversation", value: function(e3) {
      var t3, n3, o3, i4 = this, s4 = e3.conversationID, a3 = e3.isPinned, r4 = this.getLocalConversation(s4);
      return r4 && r4.isPinned === a3 ? D2({ conversationID: s4 }) : Ut2(s4) ? (r4 && (r4.isPinned = a3), this._sortConvListAndEmitEvent(), D2({ conversationID: s4 })) : (e3 = null, Gt2(s4) ? e3 = { type: 1, toAccount: s4.replace(R2.CONV_C2C, "") } : Pt2(s4) && (e3 = { type: 2, groupID: s4.replace(R2.CONV_GROUP, "") }), null === e3 ? E2({ code: k2.INVALID_CONV_ID }) : (t3 = "".concat(this._n, ".").concat("pinConversation"), n3 = "convID:".concat(s4, " isPinned:").concat(a3), (o3 = new P2("pinConversation")).setMessage(n3), M2.l("".concat(t3, ". ").concat(n3)), this.req({ P: G2.PIN_CONV, data: { fromAccount: this.getMyUserID(), operationType: true === a3 ? 1 : 2, itemList: [e3] } }).then(function() {
        return o3.end(), M2.l("".concat(t3, " ok")), r4 ? r4.isPinned !== a3 && (r4.isPinned = a3) : i4._convMap.set(s4, new xo({ conversationID: s4, type: Gt2(s4) ? R2.CONV_C2C : R2.CONV_GROUP, isPinned: a3 }, i4.isIntl(), i4.isUsingChatCore())), i4._sortConvListAndEmitEvent(), T2({ conversationID: s4 });
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })));
    } }, { key: "setMessageRemindType", value: function(e3) {
      return this._msgRemindHandler.set(e3);
    } }, { key: "patchMsgRemindType", value: function(e3) {
      var t3 = e3.ID, n3 = e3.isC2CConversation, o3 = e3.messageRemindType, i4 = false, n3 = this.getLocalConversation("".concat(n3 ? R2.CONV_C2C : R2.CONV_GROUP).concat(t3));
      return n3 && n3.messageRemindType !== o3 && (n3.messageRemindType = o3, i4 = true), M2.l("".concat(this._n, ".patchMsgRemindType options:"), e3, "ret:".concat(i4)), i4;
    } }, { key: "onC2CMsgRemindTypeFetched", value: function(e3) {
      var n3, o3 = this;
      O2(e3) && 0 < e3.length && (n3 = 0, e3.forEach(function(e4) {
        var t3 = e4.userID, e4 = e4.muteFlag, e4 = o3._transMsgRemindType(e4);
        true === o3.patchMsgRemindType({ ID: t3, isC2CConversation: true, messageRemindType: e4 }) && (n3 += 1);
      }), M2.l("".concat(this._n, ".onC2CMsgRemindTypeFetched updateCount:").concat(n3)), 1 <= n3) && this.emitConvUpdate(true, false);
    } }, { key: "onC2CMsgRemindTypeSynced", value: function(e3) {
      var n3 = this, o3 = "".concat(this._n, ".onC2CMsgRemindTypeSynced");
      e3.dataList.forEach(function(e4) {
        var t3;
        S2(e4.muteNotificationsSync) || (t3 = (e4 = e4.muteNotificationsSync).to, e4 = e4.muteFlag, e4 = n3._transMsgRemindType(e4), n3.patchMsgRemindType({ ID: t3, isC2CConversation: !(t3 = 0), messageRemindType: e4 }) && (t3 += 1), M2.l("".concat(o3, " updateCount:").concat(t3)), 1 <= t3 && n3.emitConvUpdate(true, false));
      });
    } }, { key: "onGroupMsgRemindTypeUpdated", value: function(e3) {
      this._msgRemindHandler.onGroupMsgRemindTypeUpdated(e3);
    } }, { key: "deleteLocalConv", value: function(e3) {
      var t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n3 = this._convMap.has(e3);
      M2.l("".concat(this._n, ".deleteLocalConv convID:").concat(e3, " has:").concat(n3)), n3 && (this._convMap.delete(e3), this._convMapForDiff.delete(e3), this.clearMemMsg(e3), this._setStorageConvList(true), t3) && (n3 = !this._isTopicConv(e3), this.emitConvUpdate(n3, false));
    } }, { key: "pullMsgOnInvite", value: function(e3) {
      var t3, n3, o3, i4, s4, a3 = this.get(7);
      a3 && (t3 = "".concat(this._n, ".pullMsgOnInvite"), M2.l("".concat(t3, " flag:").concat(this._bPullOnInvite)), this._bPullOnInvite) && (s4 = this.getLocalLastMessage(e3), n3 = this.getLocalSecondLastMessage(e3), i4 = o3 = 1, s4 && (o3 = s4.sequence), n3 && (i4 = n3.sequence), s4 = a3.getGroupRemoteLastSeq(e3.replace(R2.CONV_GROUP, "")), M2.l("".concat(t3, " convID:").concat(e3, " localLastSeq:").concat(o3, " localSecondLastSeq:").concat(i4, " remoteLastSeq:").concat(s4)), this.clearMemMsg(e3), 1 < o3 - i4 ? this._recursiveGetMsgList([], e3, false, o3, i4) : 1 < s4 - o3 && this._recursiveGetMsgList([], e3, true, s4, o3));
    } }, { key: "_recursiveGetMsgList", value: function(i4, s4, a3, r4, c3, e3) {
      var u3 = this;
      this.getMessageList({ conversationID: s4, nextReqMessageID: e3 }).then(function(e4) {
        var e4 = e4.data, t3 = e4.messageList, n3 = e4.isCompleted, e4 = e4.nextReqMessageID, o3 = t3.filter(function(e5) {
          return a3 ? e5.sequence > c3 && e5.sequence <= r4 : e5.sequence > c3 && e5.sequence < r4;
        });
        i4.unshift.apply(i4, d2(o3)), !n3 && 0 < t3.length && t3[0].sequence > c3 && i4.length < 60 ? u3._recursiveGetMsgList(i4, s4, a3, r4, c3, e4) : u3._emitMsgReceived(s4, i4);
      });
    } }, { key: "_emitMsgReceived", value: function(e3, t3) {
      var n3, o3, i4 = this;
      0 < t3.length && (t3 = t3.filter(function(t4, e4, n4) {
        return e4 === n4.findIndex(function(e5) {
          return e5.sequence === t4.sequence;
        });
      }), n3 = this.hasLocalConversation(e3), o3 = t3.map(function(e4) {
        return e4.sequence;
      }), M2.l("".concat(this._n, "._emitMsgReceived convID:").concat(e3, " has:").concat(n3, " count:").concat(o3.length, " sequenceList:"), o3), this.emitOEvt(h2.MESSAGE_RECEIVED, t3), n3 ? this.patchConvLastMessage(e3, true) : this.getConversationProfile(e3).then(function() {
        i4.patchConvLastMessage(e3, true);
      }));
    } }, { key: "deleteLocalConvList", value: function(e3) {
      var t3 = this, n3 = false;
      e3.forEach(function(e4) {
        t3._convMap.has(e4) && (t3.deleteLocalConv(e4, false), n3 = true);
      }), M2.l("".concat(this._n, ".deleteLocalConvList convID:").concat(e3, " isConvIDExisted:").concat(n3)), n3 && this.emitConvUpdate(true, false);
    } }, { key: "isMessageSentByCurrentInstance", value: function(e3) {
      return !(!this._msgListHandler.hasLocalMsg(e3.conversationID, e3.ID) && !this._sll.has(e3.random));
    } }, { key: "modifyMessageList", value: function(e3) {
      var t3, n3;
      e3.startsWith(R2.CONV_C2C) && this._convMap.has(e3) && (n3 = this._convMap.get(e3), t3 = Date.now(), this._msgListHandler.modifyMsgSentByPeer({ conversationID: e3, latestNick: n3.userProfile.nick, latestAvatar: n3.userProfile.avatar }), n3 = this.get(4).getNickAndAvatarByUserID(this.getMyUserID()), this._msgListHandler.modifyMsgSentByMe({ conversationID: e3, latestNick: n3.nick, latestAvatar: n3.avatar }), M2.l("".concat(this._n, ".modifyMessageList convID:").concat(e3, " cost:").concat(tn(t3))));
    } }, { key: "updateUserProfileSpecifiedKey", value: function(e3) {
      M2.l("".concat(this._n, ".updateUserProfileSpecifiedKey options:"), e3);
      var t3 = e3.conversationID, n3 = e3.nick, e3 = e3.avatar;
      this._convMap.has(t3) && (t3 = this._convMap.get(t3).userProfile, C2(n3) && t3.nick !== n3 && (t3.nick = n3), C2(e3) && t3.avatar !== e3 && (t3.avatar = e3), this.emitConvUpdate(true, false));
    } }, { key: "_onMyProfileModified", value: function(t3) {
      var n3 = this, e3 = this.getLocalConvList(), o3 = Date.now();
      e3.forEach(function(e4) {
        n3.modifyMessageSentByMe(y2({ conversationID: e4.conversationID }, t3));
      }), M2.l("".concat(this._n, "._onMyProfileModified. modify all messages sent by me, cost:").concat(tn(o3)));
    } }, { key: "modifyMessageSentByMe", value: function(e3) {
      this._msgListHandler.modifyMsgSentByMe(e3);
    } }, { key: "getLatestMessageSentByMe", value: function(e3) {
      return this._msgListHandler.getLatestMsgSentByMe(e3);
    } }, { key: "modifyMessageSentByPeer", value: function(e3) {
      this._msgListHandler.modifyMsgSentByPeer(e3);
    } }, { key: "getLatestMessageSentByPeer", value: function(e3) {
      return this._msgListHandler.getLatestMsgSentByPeer(e3);
    } }, { key: "pushIntoNoticeResult", value: function(e3, t3) {
      return !(!this._msgListHandler.pushIn(t3) || this._sll.has(t3.random) || (e3.push(t3), 0));
    } }, { key: "getLocalLastMessage", value: function(e3) {
      return this._msgListHandler.getLocalLastMsg(e3);
    } }, { key: "getLocalSecondLastMessage", value: function(e3) {
      return this._msgListHandler.getLocalSecondLastMsg(e3);
    } }, { key: "checkAndPatchRemark", value: function() {
      var e3, n3, o3 = this.get(8);
      0 !== this._convMap.size && o3 && 0 !== (e3 = d2(this._convMap.values()).filter(function(e4) {
        return e4.type === R2.CONV_C2C;
      })).length && (n3 = 0, e3.forEach(function(e4) {
        var t3 = e4.conversationID.replace(R2.CONV_C2C, "");
        o3.isMyFriend(t3) && (t3 = o3.getFriendRemark(t3), e4.remark !== t3) && (e4.remark = t3, n3 += 1);
      }), M2.l("".concat(this._n, ".checkAndPatchRemark. c2cConvCount:").concat(e3.length, " patchedCount:").concat(n3)), 0 < n3) && this.emitConvUpdate(true, false);
    } }, { key: "updateTopicConversation", value: function(e3) {
      this._updateLocalConvList({ conversationOptionsList: e3, isFromGetConversations: true, updateUnreadCount: true });
    } }, { key: "sendReadReceipt", value: function(e3) {
      var t3 = e3[0], n3 = null;
      return t3.conversationType === R2.CONV_C2C ? n3 = this._m.get(6) : t3.conversationType === R2.CONV_GROUP && (n3 = this._m.get(7)), n3 ? n3.sendReadReceipt(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getReadReceiptList", value: function(e3) {
      var t3 = e3[0], n3 = null;
      return t3.conversationType === R2.CONV_C2C ? n3 = this._m.get(6) : t3.conversationType === R2.CONV_GROUP && (n3 = this._m.get(7)), n3 ? n3.getReadReceiptList(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getLastMessageTime", value: function(e3) {
      e3 = this.getLocalConversation(e3);
      return e3 ? e3.lastMessage.lastTime : 0;
    } }, { key: "getTotalUnreadCount", value: function() {
      var e3 = this.getLocalConvList(), t3 = 0;
      return e3.forEach(function(e4) {
        e4.type === R2.CONV_SYSTEM || "" !== e4.messageRemindType && e4.messageRemindType !== R2.MSG_REMIND_ACPT_AND_NOTE || (t3 += e4.unreadCount);
      }), t3;
    } }, { key: "onTotalUnreadCountUpdate", value: function() {
      var e3 = this.getTotalUnreadCount();
      this._convTotalUnreadCount !== e3 && (M2.l("".concat(this._n, ".onTotalUnreadCountUpdate from ").concat(this._convTotalUnreadCount, " to ").concat(e3)), this._convTotalUnreadCount = e3, this.emitOEvt(h2.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED));
    } }, { key: "_isConvNeedShow", value: function(e3) {
      var t3, n3, e3 = this.getLocalConversation(e3);
      return !(!N3(e3) && (t3 = e3.type === R2.CONV_TOPIC, n3 = e3.type === R2.CONV_GROUP && e3.groupProfile.type === R2.GRP_ROOM, e3 = e3.type === R2.CONV_GROUP && e3.groupProfile.type === R2.GRP_LIVE, t3 || n3 || e3));
    } }, { key: "setAllRcvMsgOpt", value: function(e3) {
      return this._msgRemindHandler.setAllRcvMsgOpt(e3);
    } }, { key: "getAllRcvMsgOpt", value: function() {
      return this._msgRemindHandler.getAllRcvMsgOpt();
    } }, { key: "onAllRcvMsgOptNotify", value: function(e3) {
      this._msgRemindHandler.onAllRcvMsgOptNotify(e3);
    } }, { key: "clearUnreadCount", value: function(e3) {
      e3 = this.getLocalConversation(e3);
      e3 && 0 < e3.unreadCount && (e3.unreadCount = 0, this.emitConvUpdate(true, false));
    } }, { key: "storeHoppingMessageList", value: function(e3) {
      this._msgListHandler.storeHoppingMsgList(e3);
    } }, { key: "clearMemMsg", value: function(e3) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1];
      M2.l("".concat(this._n, ".clearMemMsg convID:").concat(e3, " isOverLimit:").concat(t3)), this._msgListHandler.removeByConvID(e3), this._completedMap.delete(e3), this._roamingMsgKeyAndTimeMap.delete(e3), this._everClearedMap.set(e3, 1);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._setStorageConvList(true), this._pagingStatus = Gn, this._msgListHandler.reset(), this._msgRemindHandler.reset(), this._roamingMsgKeyAndTimeMap.clear(), this._sll.reset(), this._peerReadTimeMap.clear(), this._completedMap.clear(), this._convMap.clear(), this._pagingTs = 0, this._pagingStartIdx = 0, this._pagingPinnedTs = 0, this._pagingPinnedStartIdx = 0, this._remoteGroupReadSeqMap.clear(), this._convTotalUnreadCount = 0, this._pagingGetCostList.length = 0, this._pagingConvIDMap.clear(), this._convIDFromUnreadDBMap.clear(), this._pagingGetCostList.length = 0, this._convMapForDiff.clear(), this._partialUpdatedConvMap.clear(), this._everClearedMap.clear(), this._bPullOnInvite = true, this._convGroupHandler.reset(), this.resetReady();
    } }])), Wo = e2(function e3(t3) {
      p3(this, e3), this._grpM = t3, this._n = "GroupTipsHandler", this._cachedGroupTipsMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4;
    }, [{ key: "onCheckTimer", value: function(e3) {
      e3 % 1 == 0 && 0 < this._cachedGroupTipsMap.size && this._check();
    } }, { key: "_check", value: function() {
      var i4 = this;
      this._cachedGroupTipsMap.forEach(function(e3, t3) {
        var n3 = i4._checkCountMap.get(t3), o3 = i4._grpM.hasLocalGroup(t3);
        M2.l("".concat(i4._n, "._check groupID:").concat(t3, " hasLocalGroup:").concat(o3, " checkCount:").concat(n3)), o3 ? (i4._notifyCachedGroupTips(t3), i4._checkCountMap.delete(t3), i4._grpM.deleteUnjoinedAVChatRoom(t3)) : n3 >= i4.MAX_CHECK_COUNT ? (i4._deleteCachedGroupTips(t3), i4._checkCountMap.delete(t3)) : i4._checkCountMap.set(t3, ++n3);
      });
    } }, { key: "onNewGroupTips", value: function(e3) {
      M2.l("".concat(this._n, ".onNewGroupTips options:").concat(JSON.stringify(e3.dataList)));
      var e3 = this._assembly(e3), t3 = e3.eventDataList, n3 = e3.result, e3 = e3.AVChatRoomMessageList;
      0 < e3.length && this._grpM.onAVChatRoomMessage(e3), 0 < n3.length && (this._grpM.emitOEvt(h2.MESSAGE_RECEIVED, n3), this._handleTips(n3)), 0 < t3.length && (this._grpM.updateNextMessageSeq(t3), this._grpM.get(11).onNewMessage({ conversationOptionsList: t3, isInstantMessage: true }));
    } }, { key: "_assembly", value: function(e3) {
      for (var t3 = e3.event, n3 = e3.dataList, o3 = null, i4 = [], s4 = [], a3 = {}, r4 = [], c3 = 0, u3 = n3.length; c3 < u3; c3++) {
        var l3 = vt2(n3[c3]);
        if (6 === t3) {
          if (this._grpM.isGroupAttributesUpdatedNotice(l3))
            continue;
          if (this._grpM.isGroupCountersNotice(l3))
            continue;
        }
        var d3 = l3.groupProfile, p4 = d3.groupID, _3 = d3.communityType, _3 = void 0 === _3 ? 0 : _3, h3 = d3.topicID, h3 = void 0 === h3 ? void 0 : h3, g3 = d3.invisible, d3 = d3.groupType, d3 = void 0 === d3 ? void 0 : d3, f3 = void 0, m3 = this._grpM.isMessageFromTopic(_3, h3), v4 = (m3 && (f3 = R2.CONV_TOPIC, l3.to = h3), this._grpM.hasLocalGroup(p4));
        if (v4 || !this._grpM.isUnjoinedAVChatRoom(p4))
          if (v4 || m3)
            if (this._grpM.isMessageFromOrToAVChatroom(p4))
              l3.event = t3, r4.push(l3);
            else if (l3.currentUser = this._grpM.getMyUserID(), l3.conversationType = R2.CONV_GROUP, (o3 = new Do(l3)).setElement({ type: R2.MSG_GRP_TIP, content: y2(y2({}, l3.elements), {}, { groupProfile: l3.groupProfile }) }), o3.isSystemMessage = false, 1 !== g3) {
              var v4 = this._grpM.get(11), m3 = o3, g3 = m3.conversationID, m3 = m3.sequence;
              if (6 === t3)
                o3._onlineOnlyFlag = true, s4.push(o3);
              else if (!v4.pushIntoNoticeResult(s4, o3))
                continue;
              this._grpM.isMessageFromCommunityOfTopic(_3, h3) || 6 === t3 && v4.getLocalConversation(g3) || (6 !== t3 && this._qualityStat(o3), _3 = v4.isRemoteRead({ conversationID: g3, sequence: m3 }), N3(a3[g3]) ? (h3 = 0, "in" !== o3.flow || o3._isExcludedFromUnreadCount || o3._onlineOnlyFlag || _3 || (h3 = 1), a3[g3] = i4.push({ conversationID: g3, unreadCount: h3, type: N3(f3) ? o3.conversationType : f3, subType: o3.conversationSubType, lastMessage: o3._isExcludedFromLastMessage ? "" : o3 }) - 1) : (i4[v4 = a3[g3]].type = o3.conversationType, i4[v4].subType = o3.conversationSubType, i4[v4].lastMessage = o3._isExcludedFromLastMessage ? "" : o3, "in" !== o3.flow || o3._isExcludedFromUnreadCount || o3._onlineOnlyFlag || _3 || i4[v4].unreadCount++));
            } else
              this._qualityStat(o3);
          else
            this._cacheAndCompare({ groupID: p4, event: t3, item: l3, groupType: d3 });
      }
      return { eventDataList: i4, result: s4, AVChatRoomMessageList: r4 };
    } }, { key: "_qualityStat", value: function(e3) {
      this._grpM.get(26).addMessageSequence({ key: zn, message: e3 });
    } }, { key: "_handleTips", value: function(e3) {
      var t3 = this;
      e3.forEach(function(e4) {
        switch (e4.payload.operationType) {
          case 1:
            t3._onNewMemberComeIn(e4);
            break;
          case 2:
            t3._onMemberQuit(e4);
            break;
          case 3:
            t3._onMemberKickedOut(e4);
            break;
          case 4:
            t3._onMemberSetAdmin(e4);
            break;
          case 5:
            t3._onMemberCancelledAdmin(e4);
            break;
          case 6:
            t3._onGroupProfileModified(e4);
            break;
          case 7:
            t3._onMemberInfoModified(e4);
            break;
          case 8:
            t3._onTopicProfileUpdated(e4);
            break;
          default:
            M2.w("".concat(t3._n, "._handleTips unknown operationType:").concat(e4.payload.operationType));
        }
      });
    } }, { key: "_onNewMemberComeIn", value: function(e3) {
      var e3 = e3.payload, t3 = e3.memberNum, e3 = e3.groupProfile.groupID, e3 = this._grpM.getLocalGroupProfile(e3);
      e3 && A2(t3) && e3.memberCount !== t3 && (e3.memberCount = t3, this._updateConvGroupProfile(e3));
    } }, { key: "_onMemberQuit", value: function(e3) {
      var t3 = e3.payload, n3 = t3.memberNum, t3 = t3.groupProfile.groupID, o3 = this._grpM.getLocalGroupProfile(t3);
      o3 && A2(n3) && o3.memberCount !== n3 && (o3.memberCount = n3, this._updateConvGroupProfile(o3)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(t3, e3.payload.userIDList);
    } }, { key: "_onMemberKickedOut", value: function(e3) {
      var t3 = e3.payload, n3 = t3.memberNum, t3 = t3.groupProfile.groupID, o3 = this._grpM.getLocalGroupProfile(t3);
      o3 && A2(n3) && o3.memberCount !== n3 && (o3.memberCount = n3, this._updateConvGroupProfile(o3)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(t3, e3.payload.userIDList);
    } }, { key: "_updateConvGroupProfile", value: function(e3) {
      this._grpM.get(11).updateConvGroupProfile([e3]);
    } }, { key: "_onMemberSetAdmin", value: function(e3) {
      var t3 = e3.payload.groupProfile.groupID, e3 = e3.payload.userIDList, n3 = this._grpM.getGroupMemberHandler();
      e3.forEach(function(e4) {
        e4 = n3.getLocalGroupMemberInfo(t3, e4);
        e4 && e4.updateRole(R2.GRP_MBR_ROLE_ADMIN);
      });
    } }, { key: "_onMemberCancelledAdmin", value: function(e3) {
      var t3 = e3.payload.groupProfile.groupID, e3 = e3.payload.userIDList, n3 = this._grpM.getGroupMemberHandler();
      e3.forEach(function(e4) {
        e4 = n3.getLocalGroupMemberInfo(t3, e4);
        e4 && e4.updateRole(R2.GRP_MBR_ROLE_MEMBER);
      });
    } }, { key: "_onGroupProfileModified", value: function(e3) {
      var t3 = this, e3 = e3.payload, n3 = e3.newGroupProfile, o3 = e3.groupProfile, i4 = e3.operatorInfo, e3 = o3.groupID, s4 = this._grpM.getLocalGroupProfile(e3), o3 = (Object.keys(n3).forEach(function(e4) {
        switch (e4) {
          case "ownerID":
            t3._ownerChanged(s4, n3);
            break;
          case "groupName":
            s4.name = n3[e4];
            break;
          default:
            s4[e4] = n3[e4];
        }
      }), N3(i4) || Object.keys(i4).forEach(function(e4) {
        var t4;
        "nameCard" === e4 ? s4.updateSelfInfo({ nameCard: i4[e4] }) : "role" === e4 && (t4 = "", 400 === i4[e4] ? t4 = R2.GRP_MBR_ROLE_OWNER : 300 === i4[e4] ? t4 = R2.GRP_MBR_ROLE_ADMIN : 200 === i4[e4] && (t4 = R2.GRP_MBR_ROLE_MEMBER), s4.updateSelfInfo({ role: t4 }));
      }), !s4.isSupportTopic);
      this._grpM.emitGroupListUpdate(true, o3);
    } }, { key: "_ownerChanged", value: function(e3, t3) {
      var e3 = e3.groupID, n3 = this._grpM.getLocalGroupProfile(e3), o3 = this._grpM.getMyUserID();
      o3 === t3.ownerID && (n3.updateGroup({ selfInfo: { role: R2.GRP_MBR_ROLE_OWNER } }), n3 = (t3 = this._grpM.getGroupMemberHandler()).getLocalGroupMemberInfo(e3, o3), o3 = this._grpM.getLocalGroupProfile(e3).ownerID, t3 = t3.getLocalGroupMemberInfo(e3, o3), n3 && n3.updateRole(R2.GRP_MBR_ROLE_OWNER), t3) && t3.updateRole(R2.GRP_MBR_ROLE_MEMBER);
    } }, { key: "_onMemberInfoModified", value: function(e3) {
      var t3 = e3.to, n3 = e3.payload, o3 = n3.groupProfile, n3 = n3.memberList, i4 = o3.groupID, s4 = (Nt2(t3) && this._updateTopicMuteTime(e3), this._grpM.getGroupMemberHandler());
      n3.forEach(function(e4) {
        var t4 = s4.getLocalGroupMemberInfo(i4, e4.userID);
        t4 && A2(e4.muteTime) && t4.updateMuteUntil(e4.muteTime);
      });
    } }, { key: "_updateTopicMuteTime", value: function(e3) {
      var t3 = e3.to, e3 = e3.payload, n3 = e3.groupProfile, e3 = e3.memberList, o3 = void 0 === e3 ? [] : e3, e3 = this._grpM.get(10), n3 = n3.groupID, i4 = e3.getLocalTopic(n3, t3);
      if (i4) {
        for (var s4 = false, a3 = 0; a3 < o3.length; a3++) {
          var r4 = o3[a3];
          if (r4.userID === this._grpM.getMyUserID() && 0 <= r4.muteTime) {
            i4.updateSelfInfo({ muteTime: r4.muteTime }), s4 = true;
            break;
          }
        }
        s4 && this._grpM.emitOEvt(h2.TOPIC_UPDATED, { groupID: n3, topic: i4 });
      }
    } }, { key: "_onTopicProfileUpdated", value: function(e3) {
      var t3 = e3.payload, n3 = t3.groupProfile.groupID, t3 = t3.newTopicInfo;
      this._grpM.get(10).onTopicProfileUpdated(y2({ groupID: n3, topicID: e3.to }, t3));
    } }, { key: "_cacheGroupTips", value: function(e3, t3) {
      this._cachedGroupTipsMap.has(e3) || this._cachedGroupTipsMap.set(e3, []), this._cachedGroupTipsMap.get(e3).push(t3);
    } }, { key: "_deleteCachedGroupTips", value: function(e3) {
      this._cachedGroupTipsMap.has(e3) && this._cachedGroupTipsMap.delete(e3);
    } }, { key: "_notifyCachedGroupTips", value: function(e3, t3) {
      var n3 = this, o3 = this._cachedGroupTipsMap.get(e3) || [];
      M2.l("".concat(this._n, "._notifyCachedGroupTips groupID:").concat(e3, " groupType:").concat(t3, " count:").concat(o3.length)), o3.forEach(function(e4) {
        n3.onNewGroupTips(e4);
      }), this._deleteCachedGroupTips(e3);
    } }, { key: "_cacheAndCompare", value: function(e3) {
      var t3 = e3.groupID, n3 = e3.event, o3 = e3.item, e3 = e3.groupType, n3 = (M2.l("".concat(this._n, "._cacheAndCompare groupID:").concat(t3, " groupType:").concat(e3)), this._cacheGroupTips(t3, { event: n3, dataList: [o3] }), { groupID: t3, type: e3 });
      e3 === R2.GRP_AVCHATROOM ? this._grpM.hasLocalGroup(t3) ? this._notifyCachedGroupTips(t3, e3) : this._grpM.setUnjoinedAVChatRoom(t3) : (this._grpM.updateGroupMap([n3]), this._notifyCachedGroupTips(t3, e3)), this._checkCountMap.has(t3) || this._checkCountMap.set(t3, 0);
    } }, { key: "reset", value: function() {
      this._cachedGroupTipsMap.clear(), this._checkCountMap.clear();
    } }]), Yo = e2(function e3(t3) {
      p3(this, e3), this._grpM = t3, this._n = "CommonGroupHandler", this.tempConversationList = null, this._cachedGroupMessageMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4, this.PAGING_GRP_COUNT_LIMIT = 200, this._pagingStatus = Gn, this._pagingGetCostList = [], t3.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, this.syncGroupList, this);
    }, [{ key: "onCheckTimer", value: function(e3) {
      e3 % 1 == 0 && 0 < this._cachedGroupMessageMap.size && this._check();
    } }, { key: "_check", value: function() {
      var i4 = this;
      this._cachedGroupMessageMap.forEach(function(e3, t3) {
        var n3 = i4._checkCountMap.get(t3), o3 = i4._grpM.hasLocalGroup(t3);
        M2.l("".concat(i4._n, "._check groupID:").concat(t3, " hasLocalGroup:").concat(o3, " checkCount:").concat(n3)), o3 ? (i4._notifyCachedGroupMessage(t3), i4._checkCountMap.delete(t3), i4._grpM.deleteUnjoinedAVChatRoom(t3)) : n3 >= i4.MAX_CHECK_COUNT ? (i4._deleteCachedGroupMessage(t3), i4._checkCountMap.delete(t3)) : i4._checkCountMap.set(t3, ++n3);
      });
    } }, { key: "updateLastMsg", value: function(e3) {
      var t3 = "".concat(this._n, ".updateLastMsg");
      if (0 !== this._grpM.getGroupMap().size) {
        for (var n3, o3, i4, s4, a3 = false, r4 = e3.length, c3 = 0; c3 < r4; c3++)
          (n3 = e3[c3]).type === R2.CONV_GROUP && 0 !== n3.lastMessage.lastSequence && null !== n3.lastMessage.payload && (o3 = n3.conversationID.split(/^GROUP/)[1], o3 = this._grpM.getLocalGroupProfile(o3)) && (i4 = o3.lastMessage, s4 = n3.lastMessage, JSON.stringify(i4) !== JSON.stringify(s4)) && (o3.lastMessage = y2({}, n3.lastMessage), a3 = true);
        M2.l("".concat(t3, " convCount:").concat(r4, " groupCount:").concat(this._grpM.getLocalGroupList().length, " isUpdated:").concat(a3)), a3 && (this._grpM.sortLocalGroupList(), this._grpM.emitGroupListUpdate(true, false));
      } else
        this.tempConversationList = e3;
    } }, { key: "onNewMessage", value: function(e3) {
      var t3 = this._assembly(e3), n3 = t3.conversationOptionsList, o3 = t3.messageList, t3 = t3.AVChatRoomMessageList, t3 = (0 < t3.length && this._grpM.onAVChatRoomMessage(t3), St2(o3)), t3 = (0 < t3.length && this._grpM.emitOEvt(h2.MESSAGE_MODIFIED, t3), 0 < n3.length && (this._grpM.get(11).onNewMessage({ conversationOptionsList: n3, isInstantMessage: false !== e3.isInstantMessage, updateUnreadCount: false !== e3.updateUnreadCount }), this._grpM.updateNextMessageSeq(n3)), Rt2(o3));
      0 < t3.length && this._grpM.emitOEvt(h2.MESSAGE_RECEIVED, t3), o3.length = 0;
    } }, { key: "_assembly", value: function(e3) {
      var t3 = e3.dataList, n3 = e3.event, o3 = e3.isInstantMessage, i4 = null, s4 = [], a3 = [], r4 = [], c3 = {}, u3 = this._grpM.getFileDownloadProxy(), l3 = this._grpM.getDownloadFileAuthKey(), d3 = this._grpM.get(17).getFileDNList(), p4 = t3.length;
      1 < p4 && t3.sort(function(e4, t4) {
        return e4.sequence - t4.sequence;
      });
      for (var _3 = this._grpM.get(11), h3 = this._grpM.get(4), g3 = 0; g3 < p4; g3++) {
        var f3, m3 = vt2(t3[g3]), v4 = m3.groupProfile, I3 = v4.groupID, M3 = v4.communityType, M3 = void 0 === M3 ? 0 : M3, y3 = v4.topicID, y3 = void 0 === y3 ? void 0 : y3, C3 = v4.invisible, v4 = v4.groupType, v4 = void 0 === v4 ? void 0 : v4, T3 = void 0, D3 = this._grpM.isMessageFromTopic(M3, y3), E3 = (D3 && (T3 = R2.CONV_TOPIC, m3.to = y3), this._grpM.hasLocalGroup(I3));
        !E3 && this._grpM.isUnjoinedAVChatRoom(I3) || (E3 || D3 ? this._grpM.isMessageFromOrToAVChatroom(I3) ? (m3.event = n3, r4.push(m3)) : (m3.currentUser = this._grpM.getMyUserID(), m3.conversationType = R2.CONV_GROUP, m3.isSystemMessage = !!m3.isSystemMessage, (i4 = new Do(m3)).setElement(m3.elements, u3, l3, d3), 1 !== C3 ? (E3 = 1 === t3[g3].isModified, _3.isMessageSentByCurrentInstance(i4) ? i4.isModified = E3 : E3 = false, 1 === m3.onlineOnlyFlag ? (i4._onlineOnlyFlag = true, _3.isMessageSentByCurrentInstance(i4) || a3.push(i4)) : this._grpM.isMessageFromCommunityOfTopic(M3, y3) ? a3.push(i4) : (i4.from === this._grpM.getMyUserID() && (D3 = _3.getLatestMessageSentByMe(i4.conversationID)) && (C3 = D3.nick, M3 = D3.avatar, C3 === i4.nick && M3 === i4.avatar || (_3.modifyMessageSentByMe({ conversationID: f3, latestNick: i4.nick, latestAvatar: i4.avatar }), h3.mockOnNickAvatarModified(i4.nick, i4.avatar))), _3.pushIntoMessageList(a3, i4, E3) && (this._qualityStat(o3, i4), f3 = (y3 = i4).conversationID, D3 = y3.sequence, C3 = _3.isRemoteRead({ conversationID: f3, sequence: D3 }), N3(c3[f3]) ? (M3 = 0, "in" !== i4.flow || i4._isExcludedFromUnreadCount || C3 || (M3 = 1), c3[f3] = s4.push({ conversationID: f3, unreadCount: M3, type: N3(T3) ? i4.conversationType : T3, subType: i4.conversationSubType, lastMessage: i4._isExcludedFromLastMessage ? "" : i4 }) - 1) : (s4[E3 = c3[f3]].type = N3(T3) ? i4.conversationType : T3, s4[E3].subType = i4.conversationSubType, s4[E3].lastMessage = i4._isExcludedFromLastMessage ? "" : i4, "in" !== i4.flow || i4._isExcludedFromUnreadCount || C3 || s4[E3].unreadCount++)))) : this._qualityStat(o3, i4)) : this._cacheAndCompare({ groupID: I3, event: n3, item: m3, groupType: v4 }));
      }
      return { conversationOptionsList: s4, messageList: a3, AVChatRoomMessageList: r4 };
    } }, { key: "_qualityStat", value: function(e3, t3) {
      var n3 = this._grpM.get(26);
      n3.addMessageSequence({ key: zn, message: t3 }), e3 && 0 < t3.clientTime && n3.addMessageDelay(t3.clientTime);
    } }, { key: "onMsgRevoked", value: function(e3, t3) {
      var n3 = this, u3 = this._grpM.get(11), l3 = [], d3 = [];
      e3.dataList.forEach(function(e4) {
        var t4 = e4.elements.revokedInfos, a3 = e4.revokerInfo, r4 = e4.groupProfile, c3 = false;
        r4 && (c3 = Ot2({ groupID: r4.groupID }) || !S2(r4.topicID)), N3(t4) || t4.forEach(function(e5) {
          var t5, n4 = S2(e5.topicID) ? "GROUP".concat(e5.groupID) : "GROUP".concat(e5.topicID), o3 = u3.getLocalConversation(n4), i4 = e5.revokerInfo && e5.revokerInfo.revoker || a3 && a3.revoker, s4 = a3 && a3.reason || "";
          o3 && At2(o3.type) ? t5 = { conversationID: n4, sequence: e5.sequence, ID: "".concat(e5.tinyID, "-").concat(e5.clientTime, "-").concat(e5.random) } : (o3 = u3.revoke(n4, e5.sequence, e5.random)) ? t5 = o3 : (t5 = { conversationID: n4, sequence: e5.sequence }, e5.tinyID && e5.clientTime && e5.random && (t5.ID = "".concat(e5.tinyID, "-").concat(e5.clientTime, "-").concat(e5.random)), e5.time && (t5.time = e5.time)), t5 && (t5.revoker = i4, t5.revokeReason = s4, t5.revokerInfo = { userID: i4, nick: "", avatar: "" }, (c3 ? (t5.revokerInfo.nick = r4.nick, t5.revokerInfo.avatar = r4.avatar, l3) : d3).push(t5));
        });
      }), 0 === d3.length && 0 === l3.length || (u3.onMessageRevoked([].concat(l3, d3), t3), 0 < l3.length && this._grpM.emitOEvt(h2.MESSAGE_REVOKED, l3), 0 < d3.length && u3.updateRevokerInfo(d3).then(function(e4) {
        n3._grpM.emitOEvt(h2.MESSAGE_REVOKED, e4);
      }));
    } }, { key: "_groupListTreeShaking", value: function(e3) {
      for (var n3 = new Map(d2(this._grpM.getGroupMap())), t3 = 0, o3 = e3.length; t3 < o3; t3++)
        n3.delete(e3[t3].groupID);
      this._grpM.hasJoinedAVChatRoom() && this._grpM.getJoinedAVChatRoom().forEach(function(e4) {
        n3.delete(e4);
      }), this._grpM.getGroupMap().forEach(function(e4, t4) {
        e4.isSupportTopic && n3.delete(t4);
      });
      for (var i4 = d2(n3.keys()), s4 = 0, a3 = i4.length; s4 < a3; s4++)
        this._grpM.deleteGroup(i4[s4]);
    } }, { key: "syncGroupList", value: function() {
      var o3, i4, s4 = this, e3 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t3 = (this._pagingStatus === Gn && this._grpM.clearGroupMap(), d2(re2)), n3 = this.PAGING_GRP_COUNT_LIMIT, a3 = [];
      return true === e3 ? this._pagingGetGroupListWithTopic({ limit: n3, offset: 0, groupBaseInfoFilter: t3, groupList: a3 }) : (e3 = "syncGroupList", o3 = "".concat(this._n, ".").concat(e3), i4 = new P2(e3), this._pagingGetGroupList({ limit: n3, offset: 0, groupBaseInfoFilter: t3, groupList: a3 }).then(function() {
        var e4 = en(s4._pagingGetCostList), t4 = $t2(s4._pagingGetCostList), n4 = (s4._pagingGetCostList.length = 0, s4._pagingStatus = Un, s4._groupListTreeShaking(a3), s4._grpM.updateGroupMap(a3), s4._grpM.getLocalGroupList().length), n4 = "count:".concat(n4, " sum:").concat(t4, " avg:").concat(e4);
        return M2.l("".concat(o3, " ok. ").concat(n4)), i4.setMessage(n4).end(), s4.tempConversationList && (s4.updateLastMsg(s4.tempConversationList), s4.tempConversationList = null), s4._grpM.emitGroupListUpdate(true, true), T2({ groupList: s4._grpM.getLocalGroupList() });
      }).catch(function(e4) {
        return s4._pagingStatus = bn, i4.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "getGroupList", value: function() {
      var e3, t3 = this, n3 = "".concat(this._n, ".").concat("getGroupList");
      return M2.l("".concat(n3, " pagingStatus:").concat(this._pagingStatus)), this._pagingStatus === bn || this._pagingStatus === Gn ? this.syncGroupList().then(function() {
        var e4 = t3._grpM.getLocalGroupList();
        return T2({ groupList: e4, isSyncCompleted: t3.isPagingGetCompleted() });
      }).catch(function(e4) {
        return M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      }) : (e3 = this._grpM.getLocalGroupList(), M2.l("".concat(n3, ". returned group count:").concat(e3.length)), D2({ groupList: e3, isSyncCompleted: this.isPagingGetCompleted() }));
    } }, { key: "isPagingGetCompleted", value: function() {
      return this._pagingStatus === Un;
    } }, { key: "_pagingGetGroupList", value: function(e3) {
      var o3 = this, i4 = "".concat(this._n, ".").concat("_pagingGetGroupList"), t3 = e3.isCommunityRelay, s4 = void 0 !== t3 && t3, a3 = e3.limit, r4 = e3.offset, c3 = e3.groupBaseInfoFilter, u3 = e3.groupList, t3 = void 0, l3 = (s4 && (t3 = R2.GRP_COMMUNITY, c3.push("AtInfoList")), Date.now());
      return this._grpM.req({ P: G2.GET_GRP_LIST, data: { type: t3, memberAccount: this._grpM.getMyUserID(), limit: a3, offset: r4, responseFilter: { groupBaseInfoFilter: c3, selfInfoFilter: ["Role", "JoinTime", "MsgFlag", "MsgSeq"] } } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.groups, t4 = void 0 === t4 ? [] : t4, e4 = e4.totalCount, t4 = (u3.push.apply(u3, d2(t4)), o3._handleGroupAtInfoWithoutTopic(s4, t4), r4 + a3), n3 = !(t4 < e4), e4 = "offset:".concat(r4, " limit:").concat(a3, " total:").concat(e4, " isCompleted:").concat(n3, " ") + "current:".concat(u3.length, " isCommunityRelay:").concat(s4);
        return o3._pagingGetCostList.push(tn(l3, false)), M2.l("".concat(i4, " ok. ").concat(e4, " cost:").concat(tn(l3))), s4 || n3 ? !s4 && n3 ? (M2.l("".concat(i4, " start to get community list")), r4 = 0, o3._pagingGetGroupList({ limit: a3, offset: r4, groupBaseInfoFilter: c3, groupList: u3, isCommunityRelay: true })) : s4 && !n3 ? (r4 = t4, o3._pagingGetGroupList({ limit: a3, offset: r4, groupBaseInfoFilter: c3, groupList: u3, isCommunityRelay: true })) : T2({ groupList: u3 }) : (r4 = t4, o3._pagingGetGroupList({ limit: a3, offset: r4, groupBaseInfoFilter: c3, groupList: u3 }));
      }).catch(function(e4) {
        return 10018 === e4.code ? (M2.w("".concat(o3.logPrefix, " response size exceeds the limit, request count:").concat(a3)), a3 = 50, o3._pagingGetGroupList({ limit: a3, offset: r4, groupBaseInfoFilter: c3, groupList: u3, isCommunityRelay: s4 })) : s4 ? (11e3 === e4.code && M2.l("".concat(i4, " ok. community unavailable")), D2({ groupList: u3 })) : E2(e4);
      });
    } }, { key: "_pagingGetGroupListWithTopic", value: function(e3) {
      var o3 = this, i4 = "".concat(this._n, "._pagingGetGroupListWithTopic"), s4 = e3.limit, a3 = e3.offset, r4 = e3.groupBaseInfoFilter, c3 = e3.groupList, u3 = Date.now();
      return this._grpM.req({ P: G2.GET_GRP_LIST, data: { type: R2.GRP_COMMUNITY, memberAccount: this._grpM.getMyUserID(), limit: s4, offset: a3, responseFilter: { groupBaseInfoFilter: r4, selfInfoFilter: d2(ce2) }, isSupportTopic: 1, needAppDefineData: 1 } }).then(function(e4) {
        var e4 = e4.data, t3 = e4.groups, e4 = e4.totalCount, t3 = (c3.push.apply(c3, d2(void 0 === t3 ? [] : t3)), a3 + s4), n3 = !(t3 < e4);
        if (M2.l("".concat(i4, " ok. offset:").concat(a3, " limit:").concat(s4, " totalCount:").concat(e4, " isCompleted:").concat(n3, " currentCount:").concat(c3.length, " cost:").concat(tn(u3))), !n3)
          return a3 = t3, o3._pagingGetGroupListWithTopic({ limit: s4, offset: a3, groupBaseInfoFilter: r4, groupList: c3 });
        o3._grpM.updateGroupMap(c3), o3._grpM.emitGroupListUpdate(true, false);
        e4 = o3._grpM.getLocalGroupList().filter(function(e5) {
          return true === e5.isSupportTopic;
        });
        return T2({ groupList: e4 });
      }).catch(function(e4) {
        return 10018 === e4.code ? (M2.w("".concat(o3.logPrefix, " response size exceeds the limit, request count:").concat(s4)), s4 = 50, o3._pagingGetGroupListWithTopic({ limit: s4, offset: a3, groupBaseInfoFilter: r4, groupList: c3 })) : E2(e4);
      });
    } }, { key: "_cacheGroupMessage", value: function(e3, t3) {
      this._cachedGroupMessageMap.has(e3) || this._cachedGroupMessageMap.set(e3, []), this._cachedGroupMessageMap.get(e3).push(t3);
    } }, { key: "_deleteCachedGroupMessage", value: function(e3) {
      this._cachedGroupMessageMap.has(e3) && this._cachedGroupMessageMap.delete(e3);
    } }, { key: "_notifyCachedGroupMessage", value: function(e3, t3) {
      var n3 = this, o3 = this._cachedGroupMessageMap.get(e3) || [];
      M2.l("".concat(this._n, "._notifyCachedGroupMessage groupID:").concat(e3, " groupType:").concat(t3, " count:").concat(o3.length)), o3.forEach(function(e4) {
        n3.onNewMessage(e4);
      }), this._deleteCachedGroupMessage(e3);
    } }, { key: "_cacheAndCompare", value: function(e3) {
      var t3 = e3.groupID, n3 = e3.event, o3 = e3.item, e3 = e3.groupType, n3 = (M2.l("".concat(this._n, "._cacheAndCompare groupID:").concat(t3, " groupType:").concat(e3)), this._cacheGroupMessage(t3, { event: n3, dataList: [o3] }), { groupID: t3, type: e3 });
      e3 === R2.GRP_AVCHATROOM ? this._grpM.hasLocalGroup(t3) ? this._notifyCachedGroupMessage(t3, e3) : this._grpM.setUnjoinedAVChatRoom(t3) : (this._grpM.updateGroupMap([n3]), this._notifyCachedGroupMessage(t3, e3)), this._checkCountMap.has(t3) || this._checkCountMap.set(t3, 0);
    } }, { key: "_handleGroupAtInfoWithoutTopic", value: function(e3, t3) {
      var o3 = this;
      e3 && 0 !== t3.length && t3.forEach(function(e4) {
        var t4 = e4.groupID, e4 = e4.groupAtInfoList, n3 = [];
        N3(e4) || (e4.forEach(function(e5) {
          n3.push(y2(y2({}, e5), {}, { groupID: t4 }));
        }), o3._grpM.get(11).onNewGroupAtTips({ dataList: n3 }));
      });
    } }, { key: "setPagingGroupCount", value: function(e3) {
      N3(e3) || (this.PAGING_GRP_COUNT_LIMIT = parseInt(e3, 10));
    } }, { key: "reset", value: function() {
      this.PAGING_GRP_COUNT_LIMIT = 200, this._cachedGroupMessageMap.clear(), this._checkCountMap.clear(), this._pagingStatus = Gn, this._pagingGetCostList = [];
    } }]), jo = e2(function e3(t3) {
      p3(this, e3), this._grpM = t3, this._n = "GroupAttributesHandler", this._groupAttributesMap = /* @__PURE__ */ new Map(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e3 = this._grpM.getCloudConfig("grp_attr_cache_time");
      N3(e3) || (this.CACHE_EXPIRE_TIME = Number(e3));
    } }, { key: "updateLocalMainSequenceOnReconnected", value: function() {
      this._groupAttributesMap.forEach(function(e3) {
        e3.localMainSequence = 0;
      });
    } }, { key: "isGroupAttributesUpdatedNotice", value: function(e3) {
      var t3 = e3.to, e3 = e3.elements.newGroupProfile, n3 = !N3(e3) && !S2(e3.groupAttributeOption);
      return n3 && this._onGroupAttributesUpdated({ groupID: t3, groupAttributeOption: e3.groupAttributeOption }), n3;
    } }, { key: "_onGroupAttributesUpdated", value: function(e3) {
      var t3, n3 = this, o3 = e3.groupID, e3 = e3.groupAttributeOption, i4 = e3.mainSequence, s4 = e3.isWithChangedAttributeInfo, a3 = e3.groupAttributeList, a3 = void 0 === a3 ? [] : a3, e3 = e3.operationType;
      M2.l("".concat(this._n, ".onGroupAttributesUpdated. ") + "groupID:".concat(o3, " isWithChangedAttributeInfo:").concat(s4, " operationType:").concat(e3)), N3(e3) || (this._groupAttributesCopy = this._getCachedAttributes({ groupID: o3 }), 0 != (t3 = i4 - this._getLocalGroupAttributes(o3).localMainSequence) && (1 === s4 && 1 == t3 ? (this._refreshCachedGroupAttributes({ groupID: o3, remoteMainSequence: i4, groupAttributeList: a3, operationType: e3 }), this._emitGroupAttributesUpdated(o3)) : this._hasLocalGroupAttributes(o3) && (s4 = this._getLocalGroupAttributes(o3).avChatRoomKey, this._getGroupAttributes({ groupID: o3, avChatRoomKey: s4 }).then(function() {
        n3._emitGroupAttributesUpdated(o3);
      }))));
    } }, { key: "initGroupAttributesCache", value: function(e3) {
      var t3 = e3.groupID, e3 = e3.avChatRoomKey, e3 = void 0 === e3 ? void 0 : e3;
      this._groupAttributesMap.set(t3, { lastUpdateTime: 0, localMainSequence: 0, remoteMainSequence: 0, attributes: /* @__PURE__ */ new Map(), avChatRoomKey: e3 }), M2.l("".concat(this._n, ".initGroupAttributesCache groupID:").concat(t3, " avChatRoomKey:").concat(e3));
    } }, { key: "initGroupAttributes", value: function(e3) {
      var n3 = this, o3 = e3.groupID, i4 = e3.groupAttributes, e3 = this._getLocalGroupAttributes(o3), t3 = e3.remoteMainSequence, e3 = e3.avChatRoomKey, s4 = new P2("initGroupAttributes");
      return s4.setMessage("groupID:".concat(o3, " avChatRoomKey:").concat(e3, " mainSequence:").concat(t3)), this._grpM.req({ P: G2.SET_GRP_ATTR, data: { groupID: o3, avChatRoomKey: e3, mainSequence: t3, groupAttributeList: this._transformGroupAttributes(i4) } }).then(function(e4) {
        M2.l("".concat(n3._n, ".").concat("initGroupAttributes", " ok. groupID:").concat(o3));
        var e4 = e4.data, t4 = e4.mainSequence, e4 = d2(e4.groupAttributeList);
        return e4.forEach(function(e5) {
          e5.value = i4[e5.key];
        }), n3._groupAttributesCopy = n3._getCachedAttributes({ groupID: o3 }), n3._refreshCachedGroupAttributes({ groupID: o3, remoteMainSequence: t4, groupAttributeList: e4, operationType: 1 }), n3._emitGroupAttributesUpdated(o3), s4.end(), T2({ groupAttributes: i4 });
      }).catch(function(e4) {
        return s4.setError(e4).end(), E2(e4);
      });
    } }, { key: "setGroupAttributes", value: function(e3) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("setGroupAttributes"), i4 = e3.groupID, s4 = e3.groupAttributes, e3 = this._getLocalGroupAttributes(i4), t3 = e3.remoteMainSequence, a3 = e3.avChatRoomKey, r4 = e3.attributes, e3 = this._transformGroupAttributes(s4), c3 = (e3.forEach(function(e4) {
        var t4 = e4.key;
        e4.sequence = 0, r4.has(t4) && (e4.sequence = r4.get(t4).sequence);
      }), new P2("setGroupAttributes"));
      return c3.setMessage("groupID:".concat(i4, " groupAttributes:").concat(JSON.stringify(s4))), M2.l("".concat(o3, ". groupID:").concat(i4, " mainSequence:").concat(t3)), this._grpM.req({ P: G2.MODIFY_GRP_ATTR, data: { groupID: i4, avChatRoomKey: a3, mainSequence: t3, groupAttributeList: e3 } }).then(function(e4) {
        M2.l("".concat(o3, " ok."));
        var e4 = e4.data, t4 = e4.mainSequence, e4 = d2(e4.groupAttributeList);
        return e4.forEach(function(e5) {
          e5.value = s4[e5.key];
        }), n3._groupAttributesCopy = n3._getCachedAttributes({ groupID: i4 }), n3._refreshCachedGroupAttributes({ groupID: i4, remoteMainSequence: t4, groupAttributeList: e4, operationType: 2 }), n3._emitGroupAttributesUpdated(i4), c3.end(), T2({ groupAttributes: s4 });
      }).catch(function(e4) {
        return c3.setError(e4).end(), E2(e4);
      });
    } }, { key: "deleteGroupAttributes", value: function(e3) {
      var t3 = this, n3 = e3.groupID, e3 = e3.keyList, e3 = void 0 === e3 ? [] : e3, o3 = this._getLocalGroupAttributes(n3), i4 = o3.remoteMainSequence, s4 = o3.avChatRoomKey, a3 = o3.attributes, r4 = d2(a3.keys()), o3 = G2.CLEAR_GRP_ATTR, c3 = 3, s4 = { groupID: n3, avChatRoomKey: s4, mainSequence: i4 }, u3 = [], l3 = (0 < e3.length && (r4 = [], o3 = G2.DEL_GRP_ATTR, c3 = 4, e3.forEach(function(e4) {
        var t4 = 0;
        a3.has(e4) && (t4 = a3.get(e4).sequence, r4.push(e4)), u3.push({ key: e4, sequence: t4 });
      }), s4.groupAttributeList = u3), new P2("deleteGroupAttributes"));
      return l3.setMessage("groupID:".concat(n3, " mainSequence:").concat(i4, " keyList:").concat(e3, " proto:").concat(o3)), this._grpM.req({ P: o3, data: s4 }).then(function(e4) {
        M2.l("".concat(t3._n, ".").concat("deleteGroupAttributes", " ok. groupID:").concat(n3));
        e4 = e4.data.mainSequence;
        return t3._groupAttributesCopy = t3._getCachedAttributes({ groupID: n3 }), t3._refreshCachedGroupAttributes({ groupID: n3, remoteMainSequence: e4, groupAttributeList: u3, operationType: c3 }), t3._emitGroupAttributesUpdated(n3), l3.end(), T2({ keyList: r4 });
      }).catch(function(e4) {
        return l3.setError(e4).end(), E2(e4);
      });
    } }, { key: "getGroupAttributes", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("getGroupAttributes"), i4 = t3.groupID, e3 = this._getLocalGroupAttributes(i4), s4 = e3.avChatRoomKey, a3 = e3.lastUpdateTime, r4 = e3.localMainSequence, e3 = e3.remoteMainSequence, c3 = new P2("getGroupAttributes");
      if (c3.setMessage("groupID:".concat(i4, " localMainSequence:").concat(r4, " remoteMainSequence:").concat(e3, " keyList:").concat(t3.keyList)), Date.now() - a3 >= this.CACHE_EXPIRE_TIME || r4 < e3)
        return this._getGroupAttributes({ groupID: i4, avChatRoomKey: s4 }).then(function(e4) {
          c3.setMoreMessage("get attributes from remote. count:".concat(e4.length)).end(), M2.l("".concat(o3, " from remote. groupID:").concat(i4));
          e4 = n3._getCachedAttributes(t3);
          return T2({ groupAttributes: e4 });
        }).catch(function(e4) {
          return c3.setError(e4).end(), E2(e4);
        });
      c3.setMoreMessage("get attributes from cache").end(), M2.l("".concat(o3, " from cache. groupID:").concat(i4));
      a3 = this._getCachedAttributes(t3);
      return D2({ groupAttributes: a3 });
    } }, { key: "_getGroupAttributes", value: function(o3) {
      var i4 = this, e3 = 0;
      return N3(o3.avChatRoomKey) || (e3 = 1), this._grpM.req({ P: G2.GET_GRP_ATTR, data: y2(y2({}, o3), {}, { groupType: e3 }) }).then(function(e4) {
        M2.l("".concat(i4._n, "._getGroupAttributes ok. groupID:").concat(o3.groupID));
        var e4 = e4.data, t3 = e4.mainSequence, e4 = e4.groupAttributeList, n3 = d2(e4);
        return N3(t3) || i4._refreshCachedGroupAttributes({ groupID: o3.groupID, remoteMainSequence: t3, groupAttributeList: n3, operationType: 5 }), e4;
      }).catch(function(e4) {
        return E2(e4);
      });
    } }, { key: "_refreshCachedGroupAttributes", value: function(e3) {
      var t3 = e3.groupID, n3 = e3.remoteMainSequence, o3 = e3.groupAttributeList, e3 = e3.operationType;
      if (this._hasLocalGroupAttributes(t3)) {
        var i4 = this._getLocalGroupAttributes(t3), s4 = i4.localMainSequence;
        if (5 === e3 || n3 - s4 == 1)
          i4.remoteMainSequence = n3, i4.localMainSequence = n3, i4.lastUpdateTime = Date.now(), this._updateCachedAttributes({ groupAttributes: i4, groupAttributeList: o3, operationType: e3 });
        else {
          if (s4 === n3)
            return;
          i4.remoteMainSequence = n3;
        }
        this._groupAttributesMap.set(t3, i4);
        o3 = "operationType:".concat(e3, " localMainSequence:").concat(s4, " remoteMainSequence:").concat(n3);
        M2.l("".concat(this._n, "._refreshCachedGroupAttributes. ").concat(o3));
      }
    } }, { key: "_getCachedAttributes", value: function(e3) {
      var t3 = e3.groupID, e3 = e3.keyList, e3 = void 0 === e3 ? [] : e3, n3 = {};
      if (this._hasLocalGroupAttributes(t3)) {
        var o3 = this._getLocalGroupAttributes(t3).attributes;
        if (0 < e3.length)
          e3.forEach(function(e4) {
            o3.has(e4) && (n3[e4] = o3.get(e4).value);
          });
        else {
          var i4, s4 = F2(o3.keys());
          try {
            for (s4.s(); !(i4 = s4.n()).done; ) {
              var a3 = i4.value;
              n3[a3] = o3.get(a3).value;
            }
          } catch (e4) {
            s4.e(e4);
          } finally {
            s4.f();
          }
        }
      }
      return n3;
    } }, { key: "_updateCachedAttributes", value: function(e3) {
      var o3 = e3.groupAttributes, t3 = e3.groupAttributeList, e3 = e3.operationType;
      3 !== e3 ? 4 !== e3 ? (1 === e3 && o3.attributes.clear(), t3.forEach(function(e4) {
        var t4 = e4.key, n3 = e4.value, e4 = e4.sequence;
        o3.attributes.set(t4, { value: n3, sequence: e4 });
      })) : t3.forEach(function(e4) {
        o3.attributes.delete(e4.key);
      }) : o3.attributes.clear();
    } }, { key: "_hasLocalGroupAttributes", value: function(e3) {
      return this._groupAttributesMap.has(e3);
    } }, { key: "_getLocalGroupAttributes", value: function(e3) {
      return this._hasLocalGroupAttributes(e3) || this.initGroupAttributesCache({ groupID: e3 }), this._groupAttributesMap.get(e3);
    } }, { key: "_transformGroupAttributes", value: function(t3) {
      var n3 = [];
      return Object.keys(t3).forEach(function(e3) {
        n3.push({ key: e3, value: t3[e3] });
      }), n3;
    } }, { key: "_emitGroupAttributesUpdated", value: function(e3) {
      var t3 = this._getCachedAttributes({ groupID: e3 }), n3 = this._computeAttrChangedInfo(t3), o3 = n3.updatedKeyList, n3 = n3.deletedKeyList;
      M2.l("".concat(this._n, "._emitGroupAttributesUpdated update:").concat(o3.length, ", delete:").concat(n3.length)), 0 === o3.length && 0 === n3.length || this._grpM.emitOEvt(h2.GROUP_ATTRIBUTES_UPDATED, { groupID: e3, groupAttributes: t3, updatedKeyList: o3, deletedKeyList: n3 });
    } }, { key: "_computeAttrChangedInfo", value: function(t3) {
      var n3 = this, o3 = [], i4 = [];
      return Object.keys(t3).forEach(function(e3) {
        t3[e3] !== n3._groupAttributesCopy[e3] && o3.push(e3);
      }), Object.keys(this._groupAttributesCopy).forEach(function(e3) {
        N3(t3[e3]) && i4.push(e3);
      }), this._groupAttributesCopy = {}, { updatedKeyList: o3, deletedKeyList: i4 };
    } }, { key: "deleteLocalGroupAttributes", value: function(e3) {
      this._hasLocalGroupAttributes(e3) && this._groupAttributesMap.delete(e3);
    } }, { key: "reset", value: function() {
      this._groupAttributesMap.clear(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4;
    } }]), Jo = e2(function e3(t3) {
      p3(this, e3), this._grpM = t3, this._n = "GroupCountersHandler", this._groupCountersMap = /* @__PURE__ */ new Map(), this.EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e3 = this._grpM.getCloudConfig("grp_counter_expire_time");
      N3(e3) || (this.EXPIRE_TIME = Number(e3));
    } }, { key: "isGroupCountersNotice", value: function(e3) {
      var t3 = e3.to, e3 = e3.elements.groupCounterInfo, n3 = false;
      return S2(e3) || (this._onGroupCountersUpdated({ groupID: t3, groupCounterInfo: e3 }), n3 = true), n3;
    } }, { key: "_onGroupCountersUpdated", value: function(e3) {
      var o3 = this, i4 = e3.groupID;
      e3.groupCounterInfo.forEach(function(e4) {
        var t3 = e4.type, n3 = e4.groupCounterSeq, e4 = e4.counterList, e4 = void 0 === e4 ? [] : e4;
        0 !== t3 && 2 !== t3 || (o3._updateLocalGroupCounters({ groupID: i4, groupCounterSeq: n3, counterList: e4 }), e4.forEach(function(e5) {
          o3._grpM.emitOEvt(h2.GROUP_COUNTER_UPDATED, { groupID: i4, key: e5.key, value: e5.value });
        })), 1 === t3 && o3._deleteLocalGroupCounters({ groupID: i4, groupCounterSeq: n3, counterList: e4 });
      }), M2.l("".concat(this._n, "._onGroupCountersUpdated groupID:").concat(i4));
    } }, { key: "initGroupCountersCache", value: function(e3) {
      var t3 = e3.groupID, e3 = e3.avChatRoomKey;
      this._groupCountersMap.set(t3, { lastUpdateTime: 0, groupCounterSeq: 0, counters: /* @__PURE__ */ new Map(), avChatRoomKey: e3 }), M2.l("".concat(this._n, ".initGroupCountersCache groupID:").concat(t3, " avChatRoomKey:").concat(e3));
    } }, { key: "setGroupCounters", value: function(e3) {
      var t3, n3, o3, i4, s4;
      return this._grpM.canIUse(g2.GRP_COUNTER) ? (t3 = "".concat(this._n, ".").concat("setGroupCounters"), n3 = e3.groupID, e3 = e3.counters, e3 = this._convertObjectToList(e3), o3 = this._getLocalGroupCounters(n3).avChatRoomKey, i4 = "groupID:".concat(n3, " count:").concat(e3.length), (s4 = new P2("setGroupCounters")).setMessage("".concat(i4)), M2.l("".concat(t3, ". ").concat(i4)), this._updateGroupCounters({ groupID: n3, counterList: e3, avChatRoomKey: o3, mode: "Set" }).then(function(e4) {
        return s4.end(), M2.l("".concat(t3, " ok.")), T2({ counters: e4 });
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this._grpM.noUse("setGroupCounters");
    } }, { key: "increaseGroupCounter", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4 = "increaseGroupCounter";
      return this._grpM.canIUse(g2.GRP_COUNTER) ? (t3 = "".concat(this._n, ".").concat(r4), n3 = e3.groupID, o3 = e3.key, e3 = e3.value, i4 = this._getLocalGroupCounters(n3).avChatRoomKey, s4 = "groupID:".concat(n3, " key:").concat(o3, " value:").concat(e3), (a3 = new P2(r4)).setMessage("".concat(s4)), M2.l("".concat(t3, ". ").concat(s4)), this._updateGroupCounters({ groupID: n3, counterList: [{ key: o3, value: e3 }], avChatRoomKey: i4, mode: "Increase" }).then(function(e4) {
        return a3.end(), M2.l("".concat(t3, " ok.")), T2({ counters: e4 });
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this._grpM.noUse(r4);
    } }, { key: "decreaseGroupCounter", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4 = "decreaseGroupCounter";
      return this._grpM.canIUse(g2.GRP_COUNTER) ? (t3 = "".concat(this._n, ".").concat(r4), n3 = e3.groupID, o3 = e3.key, e3 = e3.value, i4 = this._getLocalGroupCounters(n3).avChatRoomKey, s4 = "groupID:".concat(n3, " key:").concat(o3, " value:").concat(e3), (a3 = new P2(r4)).setMessage("".concat(s4)), M2.l("".concat(t3, ". ").concat(s4)), this._updateGroupCounters({ groupID: n3, counterList: [{ key: o3, value: e3 }], avChatRoomKey: i4, mode: "Decrease" }).then(function(e4) {
        return a3.end(), M2.l("".concat(t3, " ok.")), T2({ counters: e4 });
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this._grpM.noUse(r4);
    } }, { key: "getGroupCounters", value: function(e3) {
      var t3 = this;
      if (!this._grpM.canIUse(g2.GRP_COUNTER))
        return this._grpM.noUse("getGroupCounters");
      var n3 = "".concat(this._n, ".").concat("getGroupCounters"), o3 = e3.groupID, e3 = e3.keyList, i4 = void 0 === e3 ? [] : e3, e3 = this._getLocalGroupCounters(o3), s4 = e3.avChatRoomKey, e3 = e3.lastUpdateTime, a3 = new P2("getGroupCounters");
      if (a3.setMessage("groupID:".concat(o3)), Date.now() - e3 >= this.EXPIRE_TIME)
        return this._getRemoteGroupCounters({ groupID: o3, avChatRoomKey: s4 }).then(function(e4) {
          a3.setMoreMessage("from remote. count:".concat(e4.length)).end(), M2.l("".concat(n3, " from remote. groupID:").concat(o3));
          e4 = t3._getLocalCounters(o3, i4);
          return T2({ counters: e4 });
        }).catch(function(e4) {
          return a3.setError(e4).end(), E2(e4);
        });
      a3.setMoreMessage("from cache").end(), M2.l("".concat(n3, " from cache. groupID:").concat(o3));
      e3 = this._getLocalCounters(o3, i4);
      return D2({ counters: e3 });
    } }, { key: "_getRemoteGroupCounters", value: function(n3) {
      var o3 = this;
      return this._grpM.req({ P: G2.GET_GRP_COUNTER, data: y2({}, n3) }).then(function(e3) {
        var e3 = e3.data, t3 = e3.counterList, t3 = void 0 === t3 ? [] : t3, e3 = e3.groupCounterSeq;
        return o3._updateLocalGroupCounters({ groupID: n3.groupID, counterList: t3, groupCounterSeq: e3 }), M2.l("".concat(o3._n, "._getRemoteGroupCounters ok. groupID:").concat(n3.groupID)), t3;
      }).catch(function(e3) {
        return E2(e3);
      });
    } }, { key: "_convertObjectToList", value: function(t3) {
      var n3 = [];
      return Object.keys(t3).forEach(function(e3) {
        n3.push({ key: e3, value: t3[e3] });
      }), n3;
    } }, { key: "_updateGroupCounters", value: function(e3) {
      var t3 = "".concat(this._n, "._updateGroupCounters"), n3 = e3.groupID, o3 = e3.avChatRoomKey, i4 = e3.mode;
      return M2.l("".concat(t3, ". groupID:").concat(n3, " avChatRoomKey:").concat(o3, " mode:").concat(i4)), this._grpM.req({ P: G2.UPDATE_GRP_COUNTER, data: y2({}, e3) }).then(function(e4) {
        M2.l("".concat(t3, " ok."));
        var e4 = e4.data.counterList, n4 = {};
        return (void 0 === e4 ? [] : e4).forEach(function(e5) {
          var t4 = e5.key, e5 = e5.value;
          n4[t4] = e5;
        }), n4;
      }).catch(function(e4) {
        return E2(e4);
      });
    } }, { key: "_hasLocalGroupCounters", value: function(e3) {
      return this._groupCountersMap.has(e3);
    } }, { key: "_getLocalGroupCounters", value: function(e3) {
      return this._hasLocalGroupCounters(e3) || this.initGroupCountersCache({ groupID: e3 }), this._groupCountersMap.get(e3);
    } }, { key: "_updateLocalGroupCounters", value: function(e3) {
      var n3, t3, o3, i4 = e3.groupID, s4 = e3.counterList, s4 = void 0 === s4 ? [] : s4, e3 = e3.groupCounterSeq;
      this._hasLocalGroupCounters(i4) && (o3 = this._getLocalGroupCounters(i4), n3 = o3.counters, t3 = o3.avChatRoomKey, o3 = o3.groupCounterSeq, 0 < e3 && e3 < o3 || (s4.forEach(function(e4) {
        var t4 = e4.key, e4 = e4.value;
        n3.set(t4, e4);
      }), this._groupCountersMap.set(i4, { lastUpdateTime: Date.now(), groupCounterSeq: e3, counters: n3, avChatRoomKey: t3 })));
    } }, { key: "_deleteLocalGroupCounters", value: function(e3) {
      var t3, n3, o3 = e3.groupID, i4 = e3.counterList, i4 = void 0 === i4 ? [] : i4, e3 = e3.groupCounterSeq;
      this._hasLocalGroupCounters(o3) && (n3 = this._getLocalGroupCounters(o3), t3 = n3.counters, n3 = n3.avChatRoomKey, i4.forEach(function(e4) {
        t3.delete(e4.key);
      }), this._groupCountersMap.set(o3, { lastUpdateTime: Date.now(), groupCounterSeq: e3, counters: t3, avChatRoomKey: n3 }));
    } }, { key: "_getLocalCounters", value: function(e3, t3) {
      var n3 = {};
      if (this._hasLocalGroupCounters(e3)) {
        var o3 = this._getLocalGroupCounters(e3).counters;
        if (0 < t3.length)
          t3.forEach(function(e4) {
            o3.has(e4) && (n3[e4] = o3.get(e4));
          });
        else {
          var i4, s4 = F2(o3.keys());
          try {
            for (s4.s(); !(i4 = s4.n()).done; ) {
              var a3 = i4.value;
              n3[a3] = o3.get(a3);
            }
          } catch (e4) {
            s4.e(e4);
          } finally {
            s4.f();
          }
        }
      }
      return n3;
    } }, { key: "reset", value: function() {
      this._groupCountersMap.clear(), this.EXPIRE_TIME = 3e4;
    } }]), zo = e2(function e3(t3) {
      p3(this, e3);
      var n3 = t3.manager, o3 = t3.groupID, i4 = t3.onInit, s4 = t3.onSuccess, t3 = t3.onFail;
      this._n = "Polling", this._manager = n3, this._grpM = n3._grpM, this._onInit = i4, this._onSuccess = s4, this._onFail = t3, this._groupID = o3, this._timeoutID = -1, this._isRunning = false, this._proto = G2.AV_POLLING;
    }, [{ key: "start", value: function() {
      var e3 = this._grpM.isLoggedIn();
      e3 || (this._proto = G2.AV_NOAUTH_POLLING), M2.l("".concat(this._n, ".start pollingInterval:").concat(this._manager.getPollingInterval(), " isLoggedIn:").concat(e3)), this._isRunning = true, this._request();
    } }, { key: "isRunning", value: function() {
      return this._isRunning;
    } }, { key: "_request", value: function() {
      var t3 = this, e3 = this._onInit(this._groupID);
      this._grpM.req({ P: this._proto, data: e3 }).then(function(e4) {
        t3._onSuccess(t3._groupID, e4), t3.isRunning() && (-1 < t3._timeoutID && clearTimeout(t3._timeoutID), t3._timeoutID = setTimeout(t3._request.bind(t3), t3._manager.getPollingInterval()));
      }).catch(function(e4) {
        t3._onFail(t3._groupID, e4), t3.isRunning() && (-1 < t3._timeoutID && clearTimeout(t3._timeoutID), t3._timeoutID = setTimeout(t3._request.bind(t3), t3._manager.MAX_POLLING_INTERVAL));
      });
    } }, { key: "stop", value: function() {
      M2.l("".concat(this._n, ".stop")), -1 < this._timeoutID && (clearTimeout(this._timeoutID), this._timeoutID = -1), this._isRunning = false;
    } }, { key: "getPollingTimerID", value: function() {
      return this._timeoutID;
    } }]), Xo = { 3: true, 4: true, 5: true, 6: true, 17: true, 20: true, 21: true, 100: true }, Zo = e2(function e3(t3) {
      p3(this, e3), this._grpM = t3, this._n = "AVChatRoomHandler", this._joinedGroupMap = /* @__PURE__ */ new Map(), this._pollingRequestInfoMap = /* @__PURE__ */ new Map(), this._pollingInstanceMap = /* @__PURE__ */ new Map(), this._seqSll = new wo(200), this._IDSll = new wo(100), this._reportMessageStackedCount = 0, this._onlineMemberCountMap = /* @__PURE__ */ new Map(), this.DEFAULT_EXPIRE_TIME = 60, this.DEFAULT_POLLING_INTERVAL = 300, this.MAX_POLLING_INTERVAL = 2e3, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0, this._startBroadcastSeq = 1, this._broadcastMessageIDMap = /* @__PURE__ */ new Map(), this.DEFAULT_POLLING_SIMPLIFIED_MSG = 0;
    }, [{ key: "hasJoinedAVChatRoom", value: function() {
      var e3 = [];
      return 0 < (e3 = 0 < this._joinedGroupMap.size ? d2(this._joinedGroupMap.values()).filter(function(e4) {
        return e4.type === R2.GRP_AVCHATROOM;
      }) : e3).length;
    } }, { key: "getJoinedLiveList", value: function() {
      var e3 = [];
      return e3 = 0 < this._joinedGroupMap.size ? d2(this._joinedGroupMap.values()).filter(function(e4) {
        return e4.type === R2.GRP_LIVE;
      }) : e3;
    } }, { key: "checkJoinedAVChatRoomByID", value: function(e3) {
      return this._joinedGroupMap.has(e3);
    } }, { key: "getJoinedAVChatRoom", value: function() {
      return 0 < this._joinedGroupMap.size ? d2(this._joinedGroupMap.keys()) : [];
    } }, { key: "_updatedata", value: function(e3) {
      var t3 = this._pollingRequestInfoMap.get(e3);
      return e3 === d2(this._pollingInstanceMap.keys())[0] ? y2(y2({}, t3), {}, { startBroadcastSeq: this._startBroadcastSeq, simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG }) : y2(y2({}, t3), {}, { simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG });
    } }, { key: "_handleSuccess", value: function(e3, t3) {
      var n3, o3 = t3.data, i4 = o3.key, s4 = o3.nextSeq, a3 = o3.rspMsgList, r4 = o3.errorCode, c3 = o3.nextBroadcastSeq, o3 = o3.broadcastMessageList;
      0 !== r4 ? (r4 = this._pollingRequestInfoMap.get(e3), n3 = new P2("longPollingAVError"), r4 = r4 ? "".concat(r4.key, "-").concat(r4.startSeq) : "requestInfo is undefined", n3.setMessage("".concat(e3, "-").concat(r4, "-").concat(t3.errorInfo)).setCode(t3.errorCode).end(true)) : this.checkJoinedAVChatRoomByID(e3) && (C2(i4) && A2(s4) && this._pollingRequestInfoMap.set(e3, { key: i4, startSeq: s4 }), A2(c3) && c3 > this._startBroadcastSeq && (this._startBroadcastSeq = c3), O2(a3) && 0 < a3.length ? (a3.forEach(function(e4) {
        e4.to = e4.groupID;
      }), this.onMessage(a3, e3)) : (this._pollingNoMessageCount += 1, this._pollingNoMessageCount === this.DEFAULT_POLLING_NO_MESSAGE_COUNT && (this._pollingInterval = this.DEFAULT_POLLING_INTERVAL + this.DEFAULT_POLLING_INTERVAL_PLUS)), this._onBroadcastMessage(o3));
    } }, { key: "_handleFailure", value: function(e3, t3) {
    } }, { key: "onMessage", value: function(e3, t3) {
      if (O2(e3) && 0 !== e3.length) {
        var n3 = "".concat(this._n, ".onMessage"), o3 = (t3 && (n3 += " groupID:".concat(t3)), 0 !== this._pollingNoMessageCount && (this._pollingNoMessageCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL), null), i4 = [], s4 = this._get(11), a3 = this._get(26), r4 = e3.length, c3 = (1 < r4 && e3.sort(function(e4, t4) {
          return e4.sequence - t4.sequence;
        }), this._get(12).isUnlimitedAVChatRoom()), u3 = false;
        M2.getLevel() <= 0 && (t3 = e3.map(function(e4) {
          return e4.sequence;
        }), M2.l("".concat(n3, " count:").concat(t3.length, " sequenceList:").concat(t3)), t3.length = 0);
        for (var l3 = 0; l3 < r4; l3++) {
          var d3 = this.restoreMessageFromSimplified(e3[l3]);
          if (Xo[d3.event]) {
            if (6 === d3.event) {
              if (this._grpM.isGroupAttributesUpdatedNotice(d3))
                continue;
              if (this._grpM.isGroupCountersNotice(d3))
                continue;
            }
            if (20 !== d3.event)
              if (21 !== d3.event)
                if (100 !== d3.event) {
                  var o3 = this.packMessage(d3, d3.event), p4 = 1 === d3.isModified, u3 = 1 === d3.isHistoryMessage;
                  if (!c3) {
                    if (this._seqSll.has(o3.sequence))
                      continue;
                    this._seqSll.set(o3.sequence);
                  }
                  var _3 = this._IDSll.has(o3.ID);
                  _3 ? M2.w("".concat(n3, " ID:").concat(o3.ID, " has:").concat(_3)) : (this._IDSll.set(o3.ID), _3 = false, !u3 && this._isMessageSentByCurrentInstance(o3) ? p4 && (_3 = true, o3.isModified = p4, s4.updateMsgIsModifiedProp(o3)) : _3 = true, _3 && (o3.conversationType === R2.CONV_SYSTEM && 5 === o3.payload.operationType && this._onGroupDismissed(o3.payload.groupProfile.groupID), u3 || o3.conversationType === R2.CONV_SYSTEM || (p4 = o3.conversationID.replace(R2.CONV_GROUP, ""), this._pollingInstanceMap.has(p4) ? this._grpM.isLoggedIn() && a3.addMessageSequence({ key: Zn, message: o3 }) : (o3.type !== R2.MSG_GRP_TIP && 0 < o3.clientTime && a3.addMessageDelay(o3.clientTime), a3.addMessageSequence({ key: Xn, message: o3 }))), i4.push(o3)));
                } else
                  this.onRoomCustomData(d3);
              else
                this._get(34).onMessageReactionNotify({ event: 21, dataList: d3.elements.messageReactionNotifyList });
            else
              this.handleMessageRevokedNotice(d3);
          } else
            M2.w("".concat(n3, ". unknown event:").concat(d3.event));
        }
        0 !== i4.length && (0 < (t3 = St2(i4)).length && this._grpM.emitOEvt(h2.MESSAGE_MODIFIED, t3), u3 || 0 < (t3 = this.packConversationOption(i4)).length && s4.onNewMessage({ conversationOptionsList: t3, isInstantMessage: true }), this._checkMessageStacked(i4), 0 < (t3 = Rt2(i4)).length && this._grpM.emitOEvt(h2.MESSAGE_RECEIVED, t3), i4.length = 0);
      }
    } }, { key: "handleMessageRevokedNotice", value: function(e3) {
      var t3 = this, i4 = e3.groupID, n3 = e3.elements.revokeMsgList, s4 = e3.revokerInfo, a3 = [];
      n3.forEach(function(e4) {
        var t4 = e4.tinyID, n4 = e4.clientTime, o3 = e4.random, e4 = e4.sequence, t4 = { conversationID: "".concat(R2.CONV_GROUP).concat(i4), ID: "".concat(t4, "-").concat(n4, "-").concat(o3), revoker: s4.revoker, revokeReason: s4.reason || "", revokerInfo: { userID: s4.revoker, nick: "", avatar: "" }, sequence: e4 };
        a3.push(t4);
      }), 0 !== a3.length && this._get(11).updateRevokerInfo(a3).then(function(e4) {
        t3._grpM.emitOEvt(h2.MESSAGE_REVOKED, e4);
      });
    } }, { key: "isBroadcastOrNormal", value: function(e3) {
      return 3 === e3 || 17 === e3;
    } }, { key: "isGroupTip", value: function(e3) {
      return 4 === e3 || 6 === e3;
    } }, { key: "isGroupSystemNotice", value: function(e3) {
      return 5 === e3;
    } }, { key: "restoreGroupTipElements", value: function() {
      var e3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t3 = e3.operatorInfo, t3 = void 0 === t3 ? {} : t3, n3 = e3.operatorID, o3 = e3.userIDList, o3 = void 0 === o3 ? [] : o3, i4 = e3.operationType, i4 = (A2(e3.groupJoinType) || 1 !== i4 && 2 !== i4 || (e3.groupJoinType = 2 === i4 ? 0 : 1), t3.userID), s4 = t3.avatar, t3 = t3.nick, n3 = (e3.operatorInfo = { userID: void 0 === i4 ? n3 : i4, avatar: void 0 === s4 ? "" : s4, nick: void 0 === t3 ? "" : t3 }, o3.map(function(e4) {
        return { userID: e4 };
      }));
      return e3.memberInfoList = e3.memberInfoList || n3, e3;
    } }, { key: "restoreMessageFromSimplified", value: function(n3) {
      var e3, t3, o3, i4 = n3.event;
      return this.isBroadcastOrNormal(i4) && (n3.cloudCustomData = n3.cloudCustomData || "", n3.elements = n3.elements.map(function(e4) {
        var t4;
        return e4.type === R2.MSG_CUSTOM && (t4 = e4.content, e4.content = y2({ data: "", description: "", extension: "" }, void 0 === t4 ? {} : t4)), e4;
      })), (this.isGroupTip(i4) || this.isGroupSystemNotice(i4)) && (n3.from = n3.from || "@TIM#SYSTEM"), this.isGroupTip(i4) && (n3.elements = this.restoreGroupTipElements(n3.elements), t3 = (o3 = void 0 === (o3 = n3.elements) ? {} : o3).operationType, e3 = o3.operatorInfo, 1 === t3) && (t3 = [{ userID: (void 0 === e3 ? {} : e3).userID }], o3.memberInfoList = o3.memberInfoList || t3), this.isGroupSystemNotice(i4) && (o3 = (e3 = n3.elements).memberInfoList, t3 = e3.operatorInfo, n3.elements.memberInfoList = y2({ userID: n3.elements.operatorID, avatar: "", nick: "" }, o3 = o3 || (void 0 === t3 ? {} : t3)), n3.elements = y2({ authentication: "", remarkInfo: "", messageKey: 1e3 * n3.time }, n3.elements), i4 = Object.keys(n3.elements).filter(function(e4) {
        return "operatorInfo" !== e4;
      }).reduce(function(e4, t4) {
        return y2(y2({}, e4), {}, q2({}, t4, n3.elements[t4]));
      }, {}), n3.elements = i4), n3;
    } }, { key: "_onGroupDismissed", value: function(e3) {
      M2.l("".concat(this._n, "._onGroupDismissed groupID:").concat(e3)), this._grpM.deleteLocalGroupAndConversation(e3), this.reset(e3);
    } }, { key: "_checkMessageStacked", value: function(e3) {
      var t3 = "MessageStacked", e3 = e3.length;
      100 <= e3 && (this._grpM.warn(t3, e3), this._reportMessageStackedCount < 5) && (new P2(t3).setMessage("count:".concat(e3, " groupID:").concat(d2(this._joinedGroupMap.keys()))).setLevel("warning").end(), this._reportMessageStackedCount += 1);
    } }, { key: "_isMessageSentByCurrentInstance", value: function(e3) {
      return !!this._get(11).isMessageSentByCurrentInstance(e3);
    } }, { key: "packMessage", value: function(e3, t3) {
      e3.currentUser = this._grpM.getMyUserID(), e3.conversationType = 5 === t3 ? R2.CONV_SYSTEM : R2.CONV_GROUP, e3.isSystemMessage = !!e3.isSystemMessage;
      var n3 = new Do(e3), e3 = this.packElements(e3, t3), t3 = this._grpM.getFileDownloadProxy(), o3 = this._grpM.getDownloadFileAuthKey(), i4 = this._get(17).getFileDNList();
      return n3.setElement(e3, t3, o3, i4), n3;
    } }, { key: "packElements", value: function(e3, t3) {
      return 4 === t3 || 6 === t3 ? (this._updateMemberCountByGroupTips(e3), { type: R2.MSG_GRP_TIP, content: y2(y2({}, e3.elements), {}, { groupProfile: e3.groupProfile }) }) : 5 === t3 ? { type: R2.MSG_GRP_SYS_NOTICE, content: y2(y2({}, e3.elements), {}, { groupProfile: y2(y2({}, e3.groupProfile), {}, { groupID: e3.groupID }) }) } : e3.elements;
    } }, { key: "packConversationOption", value: function(e3) {
      for (var t3 = /* @__PURE__ */ new Map(), n3 = 0; n3 < e3.length; n3++) {
        var o3, i4 = e3[n3], s4 = i4.conversationID;
        t3.has(s4) ? "in" === ((o3 = t3.get(s4)).lastMessage = i4).flow && o3.unreadCount++ : t3.set(s4, { conversationID: i4.conversationID, unreadCount: "out" === i4.flow ? 0 : 1, type: i4.conversationType, subType: i4.conversationSubType, lastMessage: i4 });
      }
      return d2(t3.values());
    } }, { key: "_updateMemberCountByGroupTips", value: function(e3) {
      var t3, n3, o3, i4 = e3.groupProfile.groupID, e3 = e3.elements.onlineMemberInfo, e3 = void 0 === e3 ? void 0 : e3;
      S2(e3) || (t3 = void 0 === (t3 = e3.onlineMemberNum) ? 0 : t3, e3 = void 0 === (e3 = e3.expireTime) ? this.DEFAULT_EXPIRE_TIME : e3, n3 = this._onlineMemberCountMap.get(i4) || {}, o3 = Date.now(), S2(n3) ? Object.assign(n3, { lastReqTime: 0, lastSyncTime: 0, latestUpdateTime: o3, memberCount: t3, expireTime: e3 }) : (n3.latestUpdateTime = o3, n3.memberCount = t3), this._onlineMemberCountMap.set(i4, n3));
    } }, { key: "_onBroadcastMessage", value: function(e3) {
      if (!S2(e3)) {
        for (var t3 = [], n3 = e3.length, o3 = null, i4 = 0; i4 < n3; i4++) {
          var s4 = this.restoreMessageFromSimplified(e3[i4]);
          Xo[s4.event] ? ((o3 = this.packMessage(s4, s4.event)).isBroadcastMessage = true, this._broadcastMessageIDMap.has(o3.ID) || (t3.push(o3), this._broadcastMessageIDMap.set(o3.ID, 1))) : M2.w("".concat(this._n, "._onBroadcastMessage unknown event:").concat(s4.event));
        }
        0 < t3.length && this._grpM.emitOEvt(h2.MESSAGE_RECEIVED, t3);
      }
    } }, { key: "start", value: function(e3) {
      var t3;
      this._pollingInstanceMap.has(e3) ? (t3 = this._pollingInstanceMap.get(e3)).isRunning() || t3.start() : ((t3 = new zo({ manager: this, groupID: e3, onInit: this._updatedata.bind(this), onSuccess: this._handleSuccess.bind(this), onFail: this._handleFailure.bind(this) })).start(), this._pollingInstanceMap.set(e3, t3), M2.l("".concat(this._n, ".start groupID:").concat(e3)));
    } }, { key: "handleJoinResult", value: function(o3) {
      var i4 = this;
      return this._preCheck(o3.group).then(function() {
        var e3 = o3.longPollingKey, t3 = o3.group, n3 = t3.groupID;
        return i4._joinedGroupMap.set(n3, t3), i4._grpM.updateGroupMap([t3]), i4._grpM.deleteUnjoinedAVChatRoom(n3), i4._grpM.emitGroupListUpdate(true, false), N3(e3) ? D2({ status: Qe2, group: t3 }) : Promise.resolve();
      });
    } }, { key: "startRunLoop", value: function(i4) {
      var s4 = this;
      return this.handleJoinResult(i4).then(function() {
        var e3 = i4.longPollingKey, t3 = i4.group, n3 = i4.startSeq, o3 = t3.groupID;
        return s4._pollingRequestInfoMap.set(o3, { key: e3, startSeq: void 0 === n3 ? 0 : n3 }), s4.start(o3), s4._grpM.isLoggedIn() ? D2({ status: Qe2, group: t3 }) : D2({ status: Qe2 });
      });
    } }, { key: "_preCheck", value: function(e3) {
      if (!this._get(12).isUnlimitedAVChatRoom() && this.hasJoinedAVChatRoom() && e3.type !== R2.GRP_LIVE) {
        var e3 = j2(this._joinedGroupMap.entries().next().value, 2), t3 = e3[0], e3 = e3[1];
        if (this._grpM.isLoggedIn() && e3.selfInfo.role !== R2.GRP_MBR_ROLE_OWNER && e3.ownerID !== this._grpM.getMyUserID())
          return this._grpM.quitGroup(t3);
        this._grpM.deleteLocalGroupAndConversation(t3), this.reset(t3);
      }
      return Promise.resolve();
    } }, { key: "joinWithoutAuth", value: function(e3) {
      var n3 = this, o3 = e3.groupID, i4 = "".concat(this._n, ".").concat("joinWithoutAuth"), s4 = new P2("joinWithoutAuth");
      return this._grpM.req({ P: G2.APPLY_JOIN_GRP_NOAUTH, data: e3 }).then(function(e4) {
        e4 = e4.data.longPollingKey;
        if (s4.setMessage("groupID:".concat(o3, " longPollingKey:").concat(e4)).end(true), N3(e4))
          return E2({ code: k2.CANNOT_JOIN_NON_AV_WITHOUT_LOGIN });
        M2.l("".concat(i4, " ok. groupID:").concat(o3)), n3._get(11).setCompleted("".concat(R2.CONV_GROUP).concat(o3));
        var t3 = new qo({ groupID: o3 });
        return n3.startRunLoop({ group: t3, longPollingKey: e4 }), T2({ status: Qe2 });
      }).catch(function(e4) {
        return M2.e("".concat(i4, " failed. groupID:").concat(o3, " error:"), e4), s4.setError(e4).setMessage("groupID:".concat(o3)).end(true), E2(e4);
      }).finally(function() {
        n3._grpM.get(14).reportAtOnce();
      });
    } }, { key: "getGroupOnlineMemberCount", value: function(e3) {
      var t3 = this._onlineMemberCountMap.get(e3) || {}, n3 = Date.now();
      return S2(t3) || n3 - t3.lastSyncTime > 1e3 * t3.expireTime && 1e4 < n3 - t3.latestUpdateTime && 3e3 < n3 - t3.lastReqTime ? (t3.lastReqTime = n3, this._onlineMemberCountMap.set(e3, t3), this._getGroupOnlineMemberCount(e3).then(function(e4) {
        return T2({ memberCount: e4.memberCount });
      }).catch(function(e4) {
        return E2(e4);
      })) : D2({ memberCount: t3.memberCount });
    } }, { key: "_getGroupOnlineMemberCount", value: function(i4) {
      var s4 = this, a3 = "".concat(this._n, ".").concat("_getGroupOnlineMemberCount"), t3 = new P2("_getGroupOnlineMemberCount");
      return this._grpM.requestOnlineCount(i4).then(function(e3) {
        var t4 = s4._onlineMemberCountMap.get(i4) || {}, e3 = e3.data, n3 = e3.memberCount, n3 = void 0 === n3 ? 0 : n3, e3 = e3.expireTime, e3 = void 0 === e3 ? s4.DEFAULT_EXPIRE_TIME : e3, o3 = (M2.l("".concat(a3, " ok. groupID:").concat(i4, " memberCount:").concat(n3, " expireTime:").concat(e3)), Date.now());
        return S2(t4) && (t4.lastReqTime = o3), s4._onlineMemberCountMap.set(i4, Object.assign(t4, { lastSyncTime: o3, latestUpdateTime: o3, memberCount: n3, expireTime: e3 })), { memberCount: n3 };
      }).catch(function(e3) {
        return M2.w("".concat(a3, " failed. error:"), e3), t3.setCode(e3.code).setMessage("groupID:".concat(i4, " error:").concat(JSON.stringify(e3))).end(), Promise.reject(e3);
      });
    } }, { key: "_get", value: function(e3) {
      return this._grpM.get(e3);
    } }, { key: "setPollingInterval", value: function(e3) {
      N3(e3) || (A2(e3) ? this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = e3 : this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = parseInt(e3, 10));
    } }, { key: "setPollingIntervalPlus", value: function(e3) {
      N3(e3) || (A2(e3) ? this.DEFAULT_POLLING_INTERVAL_PLUS = e3 : this.DEFAULT_POLLING_INTERVAL_PLUS = parseInt(e3, 10));
    } }, { key: "setPollingNoMessageCount", value: function(e3) {
      N3(e3) || (A2(e3) ? this.DEFAULT_POLLING_NO_MESSAGE_COUNT = e3 : this.DEFAULT_POLLING_NO_MESSAGE_COUNT = parseInt(e3, 10));
    } }, { key: "setPollingSimplifiedMessage", value: function(e3) {
      N3(e3) || "0" !== e3 && "1" !== e3 || (this.DEFAULT_POLLING_SIMPLIFIED_MSG = parseInt(e3, 10));
    } }, { key: "getPollingInterval", value: function() {
      return this._pollingInterval;
    } }, { key: "onAVChatRoomMemberBanned", value: function(e3) {
      e3 = e3.payload.groupProfile.groupID;
      M2.l("".concat(this._n, ".onAVChatRoomMemberBanned groupID:").concat(e3)), this._grpM.deleteLocalGroupAndConversation(e3), this.reset(e3);
    } }, { key: "restartPolling", value: function() {
      M2.l("".concat(this._n, ".restartPolling count:").concat(this._pollingInstanceMap.size));
      var e3, t3 = F2(this._pollingInstanceMap.values());
      try {
        for (t3.s(); !(e3 = t3.n()).done; ) {
          var n3 = e3.value;
          n3.stop(), n3.start();
        }
      } catch (e4) {
        t3.e(e4);
      } finally {
        t3.f();
      }
    } }, { key: "getPollingTimerID", value: function(e3) {
      var t3;
      return this._pollingInstanceMap.has(e3) ? (t3 = this._pollingInstanceMap.get(e3).getPollingTimerID(), M2.l("".concat(this._n, ".getPollingTimerID groupID:").concat(e3, " timerID:").concat(t3)), t3) : -1;
    } }, { key: "hasPollingInstance", value: function(e3) {
      return this._pollingInstanceMap.has(e3);
    } }, { key: "onRoomCustomData", value: function(e3) {
      var t3 = e3.groupID, n3 = e3.sequence, o3 = e3.time, e3 = e3.elements, e3 = e3 && e3.content;
      this._get(30).onRoomCustomDataReceived(e3), M2.l("".concat(this._n, ".onRoomCustomData groupID:").concat(t3, " sequence:").concat(n3, " time:").concat(o3, " data:").concat(e3));
    } }, { key: "reset", value: function(e3) {
      if (e3) {
        M2.l("".concat(this._n, ".reset groupID:").concat(e3));
        var t3 = this._pollingInstanceMap.get(e3);
        t3 && t3.stop(), this._pollingInstanceMap.delete(e3), this._joinedGroupMap.delete(e3), this._pollingRequestInfoMap.delete(e3), this._onlineMemberCountMap.delete(e3);
      } else {
        M2.l("".concat(this._n, ".reset all"));
        var n3, o3 = F2(this._pollingInstanceMap.values());
        try {
          for (o3.s(); !(n3 = o3.n()).done; )
            n3.value.stop();
        } catch (e4) {
          o3.e(e4);
        } finally {
          o3.f();
        }
        this._pollingInstanceMap.clear(), this._joinedGroupMap.clear(), this._pollingRequestInfoMap.clear(), this._onlineMemberCountMap.clear(), this._broadcastMessageIDMap.clear();
      }
      this._seqSll.reset(), this._IDSll.reset(), this._reportMessageStackedCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = 300, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0;
    } }]), Qo = e2(function e3(t3) {
      p3(this, e3), this.userID = "", this.avatar = "", this.nick = "", this.role = "", this.joinTime = "", this.lastSendMsgTime = "", this.nameCard = "", this.muteUntil = 0, this.memberCustomField = [], this.isOnline = false, this.updateMember(t3);
    }, [{ key: "updateMember", value: function(e3) {
      N3(e3.onlineStatus) || (this.isOnline = "Online" === e3.onlineStatus);
      var t3 = [null, void 0, "", 0, NaN];
      e3.memberCustomField && Lt2(this.memberCustomField, e3.memberCustomField), dt2(this, e3, ["memberCustomField", "marks", "onlineStatus"], t3);
    } }, { key: "updateRole", value: function(e3) {
      ["Owner", "Admin", "Member"].indexOf(e3) < 0 || (this.role = e3);
    } }, { key: "updateMuteUntil", value: function(e3) {
      N3(e3) || (this.muteUntil = Math.floor((Date.now() + 1e3 * e3) / 1e3));
    } }, { key: "updateNameCard", value: function(e3) {
      N3(e3) || (this.nameCard = e3);
    } }, { key: "updateMemberCustomField", value: function(e3) {
      e3 && Lt2(this.memberCustomField, e3);
    } }]), $o = e2(function e3(t3) {
      p3(this, e3), this._grpM = t3, this._n = "GroupMemberHandler", this.groupMemberListMap = /* @__PURE__ */ new Map(), this.DEFAULT_MEMBER_INFO_FILTER = ["Role", "JoinTime", "NameCard", "ShutUpUntil", "OnlineStatus"], this._grpM.getIEmitInst().on(U2.PROFILE_UPDATED, this._onProfileUpdated, this);
    }, [{ key: "_onProfileUpdated", value: function(e3) {
      for (var n3 = this, o3 = e3.data, i4 = 0; i4 < o3.length; i4++)
        !function() {
          var t3 = o3[i4];
          n3.groupMemberListMap.forEach(function(e4) {
            e4.has(t3.userID) && e4.get(t3.userID).updateMember({ nick: t3.nick, avatar: t3.avatar });
          });
        }();
    } }, { key: "deleteGroupMemberList", value: function(e3) {
      this.groupMemberListMap.delete(e3);
    } }, { key: "getGroupMemberList", value: function(e3) {
      var t3, o3 = this, i4 = e3.groupID, n3 = e3.role, n3 = void 0 === n3 ? void 0 : n3, s4 = e3.offset, a3 = void 0 === s4 ? 0 : s4, s4 = e3.count, r4 = void 0 === s4 ? 15 : s4, s4 = e3.filter, e3 = void 0 === s4 ? void 0 : s4, c3 = "".concat(this._n, ".").concat("getGroupMemberList"), s4 = this._grpM.hasLocalGroup(i4);
      if (M2.l("".concat(c3, " groupID:").concat(i4, " role:").concat(n3, " offset:").concat(a3, " count:").concat(r4, " hasLocalGroup:").concat(s4)), !s4)
        return D2({ memberList: [], offset: 0 });
      if (this._grpM.getLocalGroupProfile(i4).type === R2.GRP_AVCHATROOM) {
        if (this._grpM.canIUse(g2.AV_MBR_LIST))
          return this._getAVChatRoomMemberList({ groupID: i4, offset: a3, filter: e3 });
        this._grpM.warn("LiveOnlineMember");
      }
      n3 !== R2.GRP_MBR_ROLE_ADMIN && n3 !== R2.GRP_MBR_ROLE_OWNER && n3 !== R2.GRP_MBR_ROLE_MEMBER || (t3 = n3);
      var u3 = new P2("getGroupMemberList"), l3 = 0, s4 = { groupID: i4, limit: 100 < r4 ? 100 : r4, memberRoleFilter: t3 ? [t3] : void 0, memberInfoFilter: this.DEFAULT_MEMBER_INFO_FILTER }, d3 = (Ot2({ groupID: i4 }) ? s4.next = "".concat(a3) : l3 = (s4.offset = a3) + r4, []);
      return this._grpM.req({ P: G2.GET_GRP_MBR_LIST, data: s4 }).then(function(e4) {
        var e4 = e4.data, t4 = e4.members, n4 = e4.memberNum, e4 = e4.next, e4 = void 0 === e4 ? void 0 : e4;
        return N3(e4) || (l3 = S2(e4) ? 0 : e4), O2(t4) && 0 !== t4.length ? (o3._grpM.hasLocalGroup(i4) && (o3._grpM.getLocalGroupProfile(i4).memberNum = n4), d3 = o3._updateLocalGroupMemberMap(i4, t4), o3._grpM.get(4).getUserProfile({ userIDList: t4.map(function(e5) {
          return e5.userID;
        }), tagList: [f2.NICK, f2.AVATAR] })) : (l3 = 0, Promise.resolve([]));
      }).then(function(e4) {
        var e4 = e4.data;
        return O2(e4) && 0 !== e4.length ? (e4 = e4.map(function(e5) {
          return { userID: e5.userID, nick: e5.nick, avatar: e5.avatar };
        }), o3._updateLocalGroupMemberMap(i4, e4), d3.length < r4 && (l3 = 0), u3.setMessage("groupID:".concat(i4, " offset:").concat(a3, " count:").concat(r4)).end(), M2.l("".concat(c3, " ok.")), T2({ memberList: d3, offset: l3 })) : D2({ memberList: [], offset: l3 });
      }).catch(function(e4) {
        return u3.setError(e4).end(), M2.e("".concat(c3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_getAVChatRoomMemberList", value: function(e3) {
      var n3 = this, o3 = e3.groupID, t3 = e3.offset, e3 = e3.filter, i4 = "".concat(this._n, ".").concat("_getAVChatRoomMemberList"), s4 = new P2("_getAVChatRoomMemberList");
      return s4.setMessage("groupID:".concat(o3, " offset:").concat(t3, " filter:").concat(e3)), this._grpM.req({ P: G2.GET_AV_MBR_LIST, data: { groupID: o3, offset: t3, filter: e3 } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.memberList, t4 = void 0 === t4 ? [] : t4, e4 = e4.offset, e4 = void 0 === e4 ? 0 : e4, t4 = (s4.end(), M2.l("".concat(i4, " ok. member count:").concat(t4.length, ", next request timestamp:").concat(e4)), t4.map(function(e5) {
          return y2(y2({}, e5), {}, { onlineStatus: "Online" });
        })), t4 = n3._updateLocalGroupMemberMap(o3, t4);
        return T2({ memberList: t4, offset: e4 });
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "getGroupMemberProfile", value: function(e3) {
      var t3, n3 = this, o3 = "getGroupMemberProfile", i4 = "".concat(this._n, ".").concat(o3), s4 = "groupID:".concat(e3.groupID), a3 = (5 < e3.userIDList.length ? s4 += " userIDList.length:".concat(e3.userIDList.length) : s4 += " userIDList:".concat(e3.userIDList), M2.l("".concat(i4, " ").concat(s4)), 50 < e3.userIDList.length && (e3.userIDList = e3.userIDList.slice(0, 50)), e3.groupID), r4 = e3.userIDList, i4 = this._grpM.getLocalGroupProfile(a3);
      return i4 && At2(i4.type) ? E2({ code: i4 = k2.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(i4, o3) }) : ((t3 = new P2(o3)).setMessage(s4), this._getGroupMemberProfileAdvance(y2(y2({}, e3), {}, { userIDList: r4 })).then(function(e4) {
        e4 = e4.data.members;
        return O2(e4) && 0 !== e4.length ? (n3._updateLocalGroupMemberMap(a3, e4), n3._grpM.get(4).getUserProfile({ userIDList: e4.map(function(e5) {
          return e5.userID;
        }), tagList: [f2.NICK, f2.AVATAR] })) : D2([]);
      }).then(function(e4) {
        e4 = e4.data.map(function(e5) {
          return { userID: e5.userID, nick: e5.nick, avatar: e5.avatar };
        }), n3._updateLocalGroupMemberMap(a3, e4), e4 = r4.filter(function(e5) {
          return n3.hasLocalGroupMember(a3, e5);
        }).map(function(e5) {
          return n3.getLocalGroupMemberInfo(a3, e5);
        });
        return t3.end(), T2({ memberList: e4 });
      }));
    } }, { key: "addGroupMember", value: function(s4) {
      var a3 = this, r4 = "".concat(this._n, ".").concat("addGroupMember"), e3 = s4.groupID, c3 = this._grpM.getLocalGroupProfile(e3), t3 = c3.type, u3 = new P2("addGroupMember");
      return u3.setMessage("groupID:".concat(e3, " groupType:").concat(t3)), At2(t3) ? (t3 = new L2({ code: k2.CANNOT_ADD_MEMBER_IN_AV }), u3.setError(t3).end(), E2(t3)) : (s4.userIDList = s4.userIDList.map(function(e4) {
        return { userID: e4 };
      }), M2.l("".concat(r4, " groupID:").concat(e3)), this._grpM.req({ P: G2.ADD_GRP_MBR, data: s4 }).then(function(e4) {
        var e4 = e4.data.members, t4 = (M2.l("".concat(r4, " ok")), e4.filter(function(e5) {
          return 1 === e5.result;
        }).map(function(e5) {
          return e5.userID;
        })), n3 = e4.filter(function(e5) {
          return 0 === e5.result;
        }).map(function(e5) {
          return e5.userID;
        }), o3 = e4.filter(function(e5) {
          return 2 === e5.result;
        }).map(function(e5) {
          return e5.userID;
        }), e4 = e4.filter(function(e5) {
          return 4 === e5.result;
        }).map(function(e5) {
          return e5.userID;
        }), i4 = "groupID:".concat(s4.groupID, ", ") + "successUserIDList:".concat(t4, ", ") + "failureUserIDList:".concat(n3, ", ") + "existedUserIDList:".concat(o3, ", ") + "overLimitUserIDList:".concat(e4);
        return u3.setMoreMessage(i4).end(), 0 === t4.length ? T2({ successUserIDList: t4, failureUserIDList: n3, existedUserIDList: o3, overLimitUserIDList: e4 }) : (a3._updateConvGroupProfile(c3), T2({ successUserIDList: t4, failureUserIDList: n3, existedUserIDList: o3, overLimitUserIDList: e4, group: c3 }));
      }).catch(function(e4) {
        return u3.setError(e4).end(), M2.e("".concat(r4, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "deleteGroupMember", value: function(e3) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("deleteGroupMember"), s4 = e3.groupID, a3 = e3.userIDList, r4 = this._grpM.getLocalGroupProfile(s4);
      return N3(r4) ? E2({ code: k2.CANNOT_FIND_GRP }) : At2(r4.type) ? this._grpM.canIUse(g2.AV_BAN_MBR) ? this._banAVChatRoomMember(e3) : this._grpM.noUse("deleteGroupMember") : (t3 = "groupID:".concat(s4, " ").concat(5 < a3.length ? "userIDList.length:".concat(a3.length) : "userIDList:".concat(a3)), M2.l("".concat(i4, " groupID:").concat(s4, " userIDList:"), a3), (n3 = new P2("deleteGroupMember")).setMessage(t3), this._grpM.req({ P: G2.DEL_GRP_MBR, data: e3 }).then(function() {
        return n3.end(), M2.l("".concat(i4, " ok")), o3._updateConvGroupProfile(r4), o3.deleteLocalGroupMembers(s4, a3), T2({ group: r4, userIDList: a3 });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "_updateConvGroupProfile", value: function(e3) {
      this._grpM.get(11).updateConvGroupProfile([e3]);
    } }, { key: "_banAVChatRoomMember", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_banAVChatRoomMember"), o3 = e3.groupID, i4 = e3.userIDList, s4 = "groupID:".concat(o3, " ").concat(5 < i4.length ? "userIDList.length:".concat(i4.length) : "userIDList:".concat(i4)), a3 = new P2("_banAVChatRoomMember"), r4 = (a3.setMessage(s4), M2.l("".concat(n3, " groupID:").concat(o3, " userIDList:"), i4), this._grpM.getLocalGroupProfile(o3));
      return N3(e3.duration) || 0 === e3.duration ? E2({ code: k2.BAN_DURATION_INVALID }) : this._grpM.req({ P: G2.BAN_AV_MBR, data: e3 }).then(function() {
        return a3.end(), M2.l("".concat(n3, " ok")), t3.deleteLocalGroupMembers(o3, i4), T2({ group: r4, userIDList: i4 });
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "setGroupMemberMuteTime", value: function(e3) {
      var t3, n3, o3 = this, i4 = e3.groupID, s4 = e3.userID, e3 = e3.muteTime, a3 = "".concat(this._n, ".").concat("setGroupMemberMuteTime");
      return s4 === this._grpM.getMyUserID() ? E2({ code: k2.CANNOT_MUTE_SELF }) : (t3 = "groupID:".concat(i4, " userID:").concat(s4, " muteTime:").concat(e3), M2.l("".concat(a3, " ").concat(t3)), (n3 = new P2("setGroupMemberMuteTime")).setMessage(t3), this.modifyGroupMemberInfo({ groupID: i4, userID: s4, muteTime: e3 }).then(function(e4) {
        n3.end(), M2.l("".concat(a3, " ok"));
        var t4 = o3._grpM.getLocalGroupProfile(i4);
        return T2({ group: t4, member: e4 });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.e("".concat(a3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "setGroupMemberRole", value: function(e3) {
      var t3, n3, o3 = "".concat(this._n, ".").concat("setGroupMemberRole"), i4 = e3.groupID, s4 = e3.userID, e3 = e3.role, a3 = "groupID:".concat(i4, " userID:").concat(s4, " role:").concat(e3), r4 = this._grpM.getLocalGroupProfile(i4);
      return r4 && r4.selfInfo.role !== R2.GRP_MBR_ROLE_OWNER ? E2({ code: k2.NOT_OWNER }) : (t3 = [R2.GRP_MBR_ROLE_ADMIN, R2.GRP_MBR_ROLE_MEMBER], Ot2({ groupID: i4 }) && t3.push(R2.GRP_MBR_ROLE_CUSTOM), t3.indexOf(e3) < 0 ? E2({ code: k2.INVALID_MEMBER_ROLE }) : s4 === this._grpM.getMyUserID() ? E2({ code: k2.CANNOT_SET_SELF_MEMBER_ROLE }) : ((n3 = new P2("setGroupMemberRole")).setMessage(a3), M2.l("".concat(o3, " ").concat(a3)), this.modifyGroupMemberInfo({ groupID: i4, userID: s4, role: e3 }).then(function(e4) {
        return n3.end(), M2.l("".concat(o3, " ok")), T2({ group: r4, member: e4 });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      })));
    } }, { key: "_filterProfanity", value: function(e3, t3) {
      var n3, o3 = this._grpM.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e3], "group_member_profile")).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e3] = o3, true));
    } }, { key: "setGroupMemberNameCard", value: function(e3) {
      var n3, o3, i4, t3, s4, a3 = this, r4 = "setGroupMemberNameCard", c3 = "".concat(this._n, ".").concat(r4);
      return e3.nameCard && false === this._filterProfanity("nameCard", e3) ? E2({ code: k2.PROFANITY_FOUND }) : (n3 = e3.groupID, t3 = e3.userID, o3 = void 0 === t3 ? this._grpM.getMyUserID() : t3, i4 = e3.nameCard, t3 = "groupID:".concat(n3, " userID:").concat(o3, " nameCard:").concat(i4), M2.l("".concat(c3, " ").concat(t3)), (e3 = this._grpM.getLocalGroupProfile(n3)) && At2(e3.type) ? E2({ code: e3 = k2.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(e3, r4) }) : ((s4 = new P2(r4)).setMessage(t3), this.modifyGroupMemberInfo({ groupID: n3, userID: o3, nameCard: i4 }).then(function(e4) {
        M2.l("".concat(c3, " ok")), s4.end();
        var t4 = a3._grpM.getLocalGroupProfile(n3);
        return o3 === a3._grpM.getMyUserID() && t4 && t4.setSelfNameCard(i4), T2({ group: t4, member: e4 });
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(c3, " failed. error:"), e4), E2(e4);
      })));
    } }, { key: "setGroupMemberCustomField", value: function(e3) {
      var n3, o3 = this, t3 = "setGroupMemberCustomField", i4 = "".concat(this._n, ".").concat(t3), s4 = e3.groupID, a3 = e3.userID, a3 = void 0 === a3 ? this._grpM.getMyUserID() : a3, e3 = e3.memberCustomField, r4 = "groupID:".concat(s4, " userID:").concat(a3, " memberCustomField:").concat(JSON.stringify(e3)), c3 = (M2.l("".concat(i4, " ").concat(r4)), this._grpM.getLocalGroupProfile(s4));
      return c3 && At2(c3.type) ? E2({ code: c3 = k2.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(c3, t3) }) : ((n3 = new P2(t3)).setMessage(r4), this.modifyGroupMemberInfo({ groupID: s4, userID: a3, memberCustomField: e3 }).then(function(e4) {
        n3.end(), M2.l("".concat(i4, " ok"));
        var t4 = o3._grpM.getLocalGroupProfile(s4);
        return T2({ group: t4, member: e4 });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "modifyGroupMemberInfo", value: function(t3) {
      var n3 = this, o3 = t3.groupID, i4 = t3.userID, e3 = void 0;
      return Nt2(o3) && (o3 = jt2(e3 = o3)), this._grpM.req({ P: G2.MODIFY_GRP_MBR_INFO, data: y2(y2({}, t3), {}, { groupID: o3, topicID: e3 }) }).then(function() {
        var e4;
        return n3.hasLocalGroupMember(o3, i4) ? (e4 = n3.getLocalGroupMemberInfo(o3, i4), N3(t3.muteTime) || e4.updateMuteUntil(t3.muteTime), N3(t3.role) || e4.updateRole(t3.role), N3(t3.nameCard) || e4.updateNameCard(t3.nameCard), N3(t3.memberCustomField) || e4.updateMemberCustomField(t3.memberCustomField), e4) : (e4 = n3._grpM.getLocalGroupProfile(o3)) && !At2(e4.type) ? n3.getGroupMemberProfile({ groupID: o3, userIDList: [i4] }).then(function(e5) {
          return j2(e5.data.memberList, 1)[0];
        }) : void 0;
      });
    } }, { key: "markGroupMemberList", value: function(e3) {
      var o3 = "".concat(this._n, ".").concat("markGroupMemberList"), t3 = e3.groupID, n3 = e3.markType, i4 = e3.enableMark, e3 = e3.userIDList, s4 = void 0 === e3 ? [] : e3, e3 = "groupID:".concat(t3, " markType:").concat(n3, " enableMark:").concat(i4, " userIDList count:").concat(s4.length), a3 = (M2.l("".concat(o3, " ").concat(e3)), 2), r4 = [], i4 = (true === i4 && (a3 = 1), d2(s4)), c3 = (500 < s4.length && (i4 = s4.slice(0, 500), M2.w("".concat(o3, " ").concat(Qt2(500)))), i4.forEach(function(e4) {
        r4.push({ userID: e4, markType: [n3] });
      }), i4 = null, new P2("markGroupMemberList"));
      return c3.setMessage(e3), this._grpM.req({ P: G2.MARK_AV_MBR_INFO, data: { groupID: t3, operationType: a3, memberList: r4 } }).then(function(e4) {
        var e4 = e4.data.memberList, e4 = void 0 === e4 ? [] : e4, t4 = [], n4 = [], e4 = (e4.length === s4.length ? t4.push.apply(t4, d2(s4)) : (e4.forEach(function(e5) {
          t4.push(e5.userID);
        }), s4.forEach(function(e5) {
          t4.includes(e5) || n4.push(e5);
        })), "success count:".concat(t4.length, " fail count:").concat(n4.length));
        return c3.setMessage(e4).end(), M2.l("".concat(o3, " ok. ").concat(e4)), T2({ successUserIDList: t4, failureUserIDList: n4 });
      }).catch(function(e4) {
        return c3.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_getGroupMemberProfileAdvance", value: function(e3) {
      return this._grpM.req({ P: G2.GET_GRP_MBR_PROFILE, data: y2(y2({}, e3), {}, { memberInfoFilter: e3.memberInfoFilter || this.DEFAULT_MEMBER_INFO_FILTER }) });
    } }, { key: "_updateLocalGroupMemberMap", value: function(t3, e3) {
      var n3 = this;
      return O2(e3) && 0 !== e3.length ? e3.map(function(e4) {
        return n3.hasLocalGroupMember(t3, e4.userID) ? n3.getLocalGroupMemberInfo(t3, e4.userID).updateMember(e4) : n3.setLocalGroupMember(t3, new Qo(e4)), n3.getLocalGroupMemberInfo(t3, e4.userID);
      }) : [];
    } }, { key: "deleteLocalGroupMembers", value: function(e3, t3) {
      var n3 = this.groupMemberListMap.get(e3);
      n3 && t3.forEach(function(e4) {
        n3.delete(e4);
      });
    } }, { key: "getLocalGroupMemberInfo", value: function(e3, t3) {
      return this.groupMemberListMap.has(e3) ? this.groupMemberListMap.get(e3).get(t3) : null;
    } }, { key: "setLocalGroupMember", value: function(e3, t3) {
      this.groupMemberListMap.has(e3) ? this.groupMemberListMap.get(e3).set(t3.userID, t3) : (t3 = (/* @__PURE__ */ new Map()).set(t3.userID, t3), this.groupMemberListMap.set(e3, t3));
    } }, { key: "getLocalGroupMemberList", value: function(e3) {
      return this.groupMemberListMap.get(e3);
    } }, { key: "hasLocalGroupMember", value: function(e3, t3) {
      return this.groupMemberListMap.has(e3) && this.groupMemberListMap.get(e3).has(t3);
    } }, { key: "hasLocalGroupMemberMap", value: function(e3) {
      return this.groupMemberListMap.has(e3);
    } }, { key: "reset", value: function() {
      this.groupMemberListMap.clear();
    } }]), ei = [17, 18, 20], ti = e2(function e3(t3) {
      p3(this, e3), this._grpM = t3, this._n = "GroupSystemNoticeHandler", this.pendencyMap = /* @__PURE__ */ new Map();
    }, [{ key: "onNewGroupSystemNotice", value: function(e3) {
      var t3 = e3.dataList, n3 = e3.isSyncingEnded, e3 = e3.isInstantMessage, t3 = (M2.d("".concat(this._n, ".onReceiveSystemNotice count:").concat(t3.length)), this._assembly({ notifiesList: t3, isInstantMessage: e3 })), o3 = t3.eventDataList, t3 = t3.result;
      0 < o3.length && (this._grpM.get(11).onNewMessage({ conversationOptionsList: o3, isInstantMessage: e3 }), this._onReceivedGroupSystemNotice({ result: t3, isInstantMessage: e3 })), e3 ? 0 < t3.length && this._grpM.emitOEvt(h2.MESSAGE_RECEIVED, t3) : true === n3 && this._clearGroupSystemNotice();
    } }, { key: "_assembly", value: function(e3) {
      for (var t3 = e3.notifiesList, n3 = e3.isInstantMessage, o3 = null, i4 = t3.length, s4 = 0, a3 = [], r4 = { conversationID: R2.CONV_SYSTEM, unreadCount: 0, type: R2.CONV_SYSTEM, subType: null, lastMessage: null }, s4 = 0; s4 < i4; s4++) {
        var c3 = t3[s4], u3 = c3.groupProfile, l3 = u3.communityType, u3 = u3.topicID, u3 = void 0 === u3 ? void 0 : u3, d3 = c3.elements, p4 = d3.topicIDList, p4 = void 0 === p4 ? void 0 : p4, d3 = d3.operationType;
        if (!(2 !== (void 0 === l3 ? 0 : l3) || S2(u3) && S2(p4))) {
          if (ei.includes(d3)) {
            this._handleTopicSystemNotice(c3);
            continue;
          }
          S2(u3) || (c3.to = u3);
        }
        15 !== c3.elements.operationType && (c3.currentUser = this._grpM.getMyUserID(), c3.conversationType = R2.CONV_SYSTEM, c3.conversationID = R2.CONV_SYSTEM, (o3 = new Do(c3)).setElement({ type: R2.MSG_GRP_SYS_NOTICE, content: y2(y2({}, c3.elements), {}, { groupProfile: y2({}, c3.groupProfile) }) }), o3.isSystemMessage = true, (1 === o3.sequence && 1 === o3.random || 2 === o3.sequence && 2 === o3.random) && (o3.sequence = ht2(), o3.random = ht2(), o3.generateMessageID(), M2.l("".concat(this._n, "._assembly regenerate ID:").concat(o3.ID))), this._grpM.get(11).pushIntoNoticeResult(a3, o3)) && (n3 ? r4.unreadCount++ : o3.setIsRead(true), r4.subType = o3.conversationSubType);
      }
      return r4.lastMessage = a3[a3.length - 1], { eventDataList: 0 < a3.length ? [r4] : [], result: a3 };
    } }, { key: "_clearGroupSystemNotice", value: function() {
      var s4 = this;
      this._getPendencyList().then(function(e3) {
        e3.forEach(function(e4) {
          s4.pendencyMap.set("".concat(e4.from, "_").concat(e4.groupID, "_").concat(e4.to), e4);
        });
        var e3 = s4._grpM.get(11).getLocalMessageList(R2.CONV_SYSTEM), i4 = [];
        e3.forEach(function(e4) {
          var t3 = e4.payload, n3 = t3.operatorID, o3 = t3.operationType, t3 = t3.groupProfile;
          1 === o3 && (o3 = "".concat(n3, "_").concat(t3.groupID, "_").concat(t3.to), n3 = s4.pendencyMap.get(o3)) && A2(n3.handled) && 0 !== n3.handled && i4.push(e4);
        }), s4.deleteGroupSystemNotice({ messageList: i4 });
      });
    } }, { key: "deleteGroupSystemNotice", value: function(e3) {
      var n3 = this, o3 = "".concat(this._n, ".deleteGroupSystemNotice");
      return O2(e3.messageList) && 0 !== e3.messageList.length ? (M2.l("".concat(o3, " ") + e3.messageList.map(function(e4) {
        return e4.ID;
      })), this._grpM.req({ P: G2.DEL_GRP_SYSTEM_NOTICE, data: { messageListToDelete: e3.messageList.map(function(e4) {
        return { from: R2.CONV_SYSTEM, messageSeq: e4.clientSequence, messageRandom: e4.random };
      }) } }).then(function() {
        M2.l("".concat(o3, " ok"));
        var t3 = n3._grpM.get(11);
        return e3.messageList.forEach(function(e4) {
          t3.deleteLocalMessage(e4);
        }), T2();
      }).catch(function(e4) {
        return M2.e("".concat(o3, " error:"), e4), E2(e4);
      })) : D2();
    } }, { key: "_getPendencyList", value: function() {
      var n3 = this, e3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t3 = e3.type, o3 = e3.startTime, e3 = e3.limit;
      return this._grpM.req({ P: G2.GET_GRP_PENDENCY, data: { type: void 0 === t3 ? void 0 : t3, startTime: void 0 === o3 ? 0 : o3, limit: void 0 === e3 ? 20 : e3, handleAccount: this._grpM.getMyUserID() } }).then(function(e4) {
        var t4 = e4.data.pendencyList;
        return 0 !== e4.data.nextStartTime ? n3._getPendencyList({ startTime: e4.data.nextStartTime }).then(function(e5) {
          return [].concat(d2(t4), d2(e5));
        }) : t4;
      });
    } }, { key: "getGroupApplicationList", value: function() {
      var n3 = this;
      return this._getPendencyList().then(function(t3) {
        return n3._getPendencyList({ type: R2.GRP_COMMUNITY }).then(function(e3) {
          return t3.push.apply(t3, d2(e3)), n3._handlePendencyResult(t3);
        }).catch(function(e3) {
          return n3._handlePendencyResult(t3);
        });
      });
    } }, { key: "_handlePendencyResult", value: function(e3) {
      var t3 = this, n3 = [];
      return e3.forEach(function(e4) {
        t3.pendencyMap.set("".concat(e4.from, "_").concat(e4.groupID, "_").concat(e4.to), e4), 0 === e4.handled && n3.push({ applicant: e4.from, applicantNick: e4.fromUserNickName, groupName: e4.groupName, groupID: e4.groupID, authentication: e4.authentication, messageKey: e4.time, applicationType: e4.applicationType, userID: e4.userID, note: e4.note });
      }), D2({ applicationList: n3 });
    } }, { key: "_onReceivedGroupSystemNotice", value: function(e3) {
      var t3 = this, n3 = e3.result;
      e3.isInstantMessage && n3.forEach(function(e4) {
        switch (e4.payload.operationType) {
          case 1:
            break;
          case 2:
            t3._onApplyJoinGroup(e4);
            break;
          case 3:
            break;
          case 4:
            t3._onMemberKicked(e4);
            break;
          case 5:
            t3._onGroupDismissed(e4);
            break;
          case 6:
            break;
          case 7:
            t3._onInviteGroup(e4);
            break;
          case 8:
            t3._onQuitGroup(e4);
            break;
          case 9:
            t3._onSetManager(e4);
            break;
          case 10:
            t3._onDeleteManager(e4);
            break;
          case 11:
          case 12:
          case 15:
            break;
          case 20:
            t3._onMessageRemindTypeSynced(e4);
            break;
          case 21:
            t3._grpM.onAVChatRoomMemberBanned(e4);
        }
      });
    } }, { key: "_onApplyJoinGroup", value: function(e3) {
      var t3 = this, e3 = e3.payload.groupProfile, n3 = e3.groupID, e3 = e3.groupType, o3 = this._grpM.hasLocalGroup(n3);
      M2.l("".concat(this._n, "._onApplyJoinGroup groupID:").concat(n3, " groupType:").concat(e3, " hasGroup:").concat(o3)), o3 || At2(e3) || this._grpM.getGroupProfile({ groupID: n3 }).then(function(e4) {
        var e4 = e4.data.group;
        e4 && (t3._grpM.updateGroupMap([e4]), e4 = !e4.isSupportTopic, t3._grpM.emitGroupListUpdate(true, e4));
      });
    } }, { key: "_onMemberKicked", value: function(e3) {
      e3 = e3.payload.groupProfile.groupID;
      this._grpM.hasLocalGroup(e3) && this._grpM.deleteLocalGroupAndConversation(e3);
    } }, { key: "_onGroupDismissed", value: function(e3) {
      var e3 = e3.payload.groupProfile.groupID, t3 = (this._grpM.hasLocalGroup(e3) && this._grpM.deleteLocalGroupAndConversation(e3), this._grpM._AVChatRoomHandler);
      t3 && t3.checkJoinedAVChatRoomByID(e3) && t3.reset(e3);
    } }, { key: "_onInviteGroup", value: function(e3) {
      var t3 = this, n3 = e3.payload.groupProfile.groupID, e3 = this._grpM.hasLocalGroup(n3);
      M2.l("".concat(this._n, "._onInviteGroup groupID:").concat(n3, " hasGroup:").concat(e3)), this._grpM.getGroupProfile({ groupID: n3 }).then(function() {
        t3._grpM.emitGroupListUpdate(), t3._grpM.get(11).pullMsgOnInvite("".concat(R2.CONV_GROUP).concat(n3));
      });
    } }, { key: "_onQuitGroup", value: function(e3) {
      var e3 = e3.payload.groupProfile, t3 = e3.groupID, e3 = e3.groupType, n3 = this._grpM.hasLocalGroup(t3);
      M2.l("".concat(this._n, "._onQuitGroup groupID:").concat(t3, " groupType:").concat(e3, " hasGroup:").concat(n3)), n3 && this._grpM.deleteLocalGroupAndConversation(t3);
    } }, { key: "_onSetManager", value: function(e3) {
      var e3 = e3.payload.groupProfile, t3 = e3.to, e3 = e3.groupID, e3 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e3, t3);
      e3 && e3.updateRole(R2.GRP_MBR_ROLE_ADMIN);
    } }, { key: "_onDeleteManager", value: function(e3) {
      var e3 = e3.payload.groupProfile, t3 = e3.to, e3 = e3.groupID, e3 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e3, t3);
      e3 && e3.updateRole(R2.GRP_MBR_ROLE_MEMBER);
    } }, { key: "_onMessageRemindTypeSynced", value: function(e3) {
      var t3 = e3.payload.groupProfile.groupID, e3 = e3.payload.messageRemindType;
      this._grpM.get(11).onGroupMsgRemindTypeUpdated({ groupID: t3, messageRemindType: e3 });
    } }, { key: "_handleTopicSystemNotice", value: function(e3) {
      var t3 = e3.groupProfile, n3 = t3.groupID, t3 = t3.topicID, e3 = e3.elements, o3 = e3.operationType, i4 = e3.topicIDList, e3 = e3.messageRemindType, s4 = this._grpM.get(10);
      17 === o3 ? s4.onTopicCreated({ groupID: n3, topicID: t3 }) : 18 === o3 ? s4.onTopicDeleted({ groupID: n3, topicIDList: i4 }) : 20 === o3 && s4.onMessageRemindTypeUpdated({ groupID: n3, topicID: t3, messageRemindType: e3 });
    } }, { key: "reset", value: function() {
      this.pendencyMap.clear();
    } }]), ni = ["relayFlag"], oi = (t2(vi, c2), e2(vi, [{ key: "_onCloudConfig", value: function() {
      var e3 = this.getCloudConfig("polling_interval"), t3 = this.getCloudConfig("polling_interval_plus"), n3 = this.getCloudConfig("polling_no_msg_count"), o3 = this.getCloudConfig("polling_simplified_msg"), i4 = this.getCloudConfig("paging_grp_count");
      M2.l("".concat(this._n, "._onCloudConfig pollingInterval:").concat(e3) + " pollingIntervalPlus:".concat(t3, " pollingNoMessageCount:").concat(n3) + " pollingSimplifiedMessage:".concat(o3, " pagingGroupCount:").concat(i4)), this._AVChatRoomHandler.setPollingInterval(e3), this._AVChatRoomHandler.setPollingIntervalPlus(t3), this._AVChatRoomHandler.setPollingNoMessageCount(n3), this._AVChatRoomHandler.setPollingSimplifiedMessage(o3), this._commonGroupHandler.setPagingGroupCount(i4);
    } }, { key: "onCheckTimer", value: function(e3) {
      this.isLoggedIn() && (this._commonGroupHandler.onCheckTimer(e3), this._groupTipsHandler.onCheckTimer(e3));
    } }, { key: "guardForAVChatRoom", value: function(t3) {
      var n3, o3 = this;
      return t3.conversationType !== R2.CONV_GROUP || (n3 = Nt2(t3.to) ? jt2(t3.to) : t3.to, this.hasLocalGroup(n3)) ? D2() : this.getGroupProfile({ groupID: n3 }).then(function(e3) {
        var e3 = e3.data.group.type;
        return M2.l("".concat(o3._n, ".guardForAVChatRoom. groupID:").concat(n3, " type:").concat(e3)), e3 === R2.GRP_AVCHATROOM ? E2(new L2({ code: e3 = k2.MSG_SEND_FAIL_NOT_IN_AV, message: o3.getErrMsg(e3, t3.from, n3), data: { message: t3 } })) : D2();
      });
    } }, { key: "checkJoinedAVChatRoomByID", value: function(e3) {
      return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e3);
    } }, { key: "onNewMessage", value: function(e3) {
      this._commonGroupHandler.onNewMessage(e3);
    } }, { key: "updateNextMessageSeq", value: function(e3) {
      var n3, o3 = this;
      O2(e3) && (n3 = this.get(10), e3.forEach(function(e4) {
        var t3 = e4.conversationID.replace(R2.CONV_GROUP, "");
        Nt2(t3) && n3.updateUnreadCountAndLastMsg(t3, e4.lastMessage), o3.groupMap.has(t3) && (o3.groupMap.get(t3).nextMessageSeq = e4.lastMessage.sequence + 1);
      }));
    } }, { key: "onNewGroupTips", value: function(e3) {
      this._groupTipsHandler.onNewGroupTips(e3);
    } }, { key: "onMsgRevoked", value: function(e3) {
      this._commonGroupHandler.onMsgRevoked(e3, !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1]);
    } }, { key: "onNewGroupSystemNotice", value: function(e3) {
      this._groupSystemNoticeHandler.onNewGroupSystemNotice(e3);
    } }, { key: "onMsgReadNotice", value: function(e3) {
      var s4 = this;
      e3.dataList.forEach(function(e4) {
        var i4, e4 = e4.elements.groupMessageReadNotice;
        N3(e4) || (i4 = s4.get(11), e4.forEach(function(e5) {
          var t3 = e5.groupID, n3 = e5.topicID, n3 = void 0 === n3 ? void 0 : n3, e5 = e5.lastMessageSeq, t3 = (M2.l("".concat(s4._n, ".onMsgReadNotice groupID:").concat(t3, " lastMessageSeq:").concat(e5)), "".concat(R2.CONV_GROUP).concat(t3)), o3 = true;
          S2(n3) || (t3 = "".concat(R2.CONV_GROUP).concat(n3), o3 = false), i4.updateIsReadAfterReadReport({ conversationID: t3, lastMessageSeq: e5 }), i4.updateUnreadCount(t3, o3), i4.clearGroupAtInfoList(t3, o3);
        }));
      });
    } }, { key: "onReadReceiptList", value: function(e3) {
      var o3 = this;
      M2.l("".concat(this._n, ".onReadReceiptList options:"), e3), e3.dataList.forEach(function(e4) {
        var t3 = e4.groupProfile, e4 = e4.elements, t3 = t3.groupID, n3 = o3.get(11), e4 = e4.readReceiptList;
        n3.updateReadReceiptInfo({ groupID: t3, readReceiptList: e4 });
      });
    } }, { key: "onMsgModified", value: function(e3) {
      M2.l("".concat(this._n, ".onMsgModified options:"), e3);
      var t3 = this.get(11);
      e3.dataList.forEach(function(e4) {
        t3.onMessageModified(y2(y2({}, e4), {}, { conversationType: R2.CONV_GROUP, to: e4.topicID || e4.groupID }));
      });
    } }, { key: "deleteGroupSystemNotice", value: function(e3) {
      this._groupSystemNoticeHandler.deleteGroupSystemNotice(e3);
    } }, { key: "initGroupMap", value: function(e3) {
      this.groupMap.set(e3.groupID, new qo(e3));
    } }, { key: "clearGroupMap", value: function() {
      this.groupMap.clear();
    } }, { key: "deleteGroup", value: function(e3) {
      this.groupMap.delete(e3);
    } }, { key: "updateGroupMap", value: function(e3) {
      var t3, n3 = this, o3 = this.get(11);
      e3.forEach(function(e4) {
        t3 = e4.groupID, n3.groupMap.has(t3) ? n3.groupMap.get(t3).updateGroup(e4) : (n3.groupMap.set(t3, new qo(e4)), o3.deleteGroupRoamingInfo(t3));
      });
      var i4, s4 = this.getMyUserID(), a3 = F2(this.groupMap);
      try {
        for (a3.s(); !(i4 = a3.n()).done; ) {
          var r4 = j2(i4.value, 2)[1];
          r4.selfInfo.userID = s4, "Owner" === r4.selfInfo.role && (r4.ownerID = s4);
        }
      } catch (e4) {
        a3.e(e4);
      } finally {
        a3.f();
      }
    } }, { key: "getGroupMap", value: function() {
      return this.groupMap;
    } }, { key: "getLocalGroupList", value: function() {
      return d2(this.groupMap.values()).filter(function(e3) {
        return e3.type !== R2.GRP_ROOM && e3.type !== R2.GRP_LIVE;
      });
    } }, { key: "getLocalGroupProfile", value: function(e3) {
      return this.groupMap.get(e3);
    } }, { key: "sortLocalGroupList", value: function() {
      var e3 = d2(this.groupMap).filter(function(e4) {
        e4 = j2(e4, 2);
        return e4[0], !S2(e4[1].lastMessage);
      });
      e3.sort(function(e4, t3) {
        return t3[1].lastMessage.lastTime - e4[1].lastMessage.lastTime;
      }), this.groupMap = new Map(d2(e3));
    } }, { key: "updateGroupLastMessage", value: function(e3) {
      this._commonGroupHandler.updateLastMsg(e3);
    } }, { key: "emitGroupListUpdate", value: function() {
      var e3 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n3 = this.getLocalGroupList();
      e3 && this.emitOEvt(h2.GROUP_LIST_UPDATED), t3 && (e3 = JSON.parse(JSON.stringify(n3)), this.get(11).updateConvGroupProfile(e3));
    } }, { key: "getMyNameCardByGroupID", value: function(e3) {
      e3 = this.getLocalGroupProfile(e3);
      return e3 ? e3.selfInfo.nameCard : "";
    } }, { key: "isPagingGetCompleted", value: function() {
      return this._commonGroupHandler.isPagingGetCompleted();
    } }, { key: "getMsgRemindType", value: function(e3) {
      var n3 = this;
      return !O2(e3) || 0 === e3.length || 0 === (e3 = e3.filter(function(e4) {
        return !At2(n3.getLocalGroupProfile(e4).type);
      })).length ? Promise.resolve() : (M2.l("".concat(this._n, ".getMsgRemindType groupIDList:").concat(e3)), this.getGroupProfileAdvance({ groupIDList: e3, responseFilter: { memberInfoFilter: ["MsgFlag"] } }).then(function(e4) {
        var e4 = e4.data.successGroupList, t3 = n3.get(11);
        e4.forEach(function(e5) {
          t3.onGroupMsgRemindTypeUpdated({ groupID: e5.groupID, messageRemindType: O2(e5.members) ? e5.members[0].messageRemindType : "" });
        });
      }));
    } }, { key: "getGroupList", value: function() {
      return this._commonGroupHandler.getGroupList();
    } }, { key: "syncCommunityWithTopic", value: function() {
      return this._commonGroupHandler.syncGroupList(true);
    } }, { key: "getGroupProfile", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("getGroupProfile"), i4 = new P2("getGroupProfile"), s4 = t3.groupID, e3 = t3.groupCustomFieldFilter, e3 = (M2.l("".concat(o3, " groupID:").concat(s4)), { groupIDList: [s4], responseFilter: { groupBaseInfoFilter: d2(re2), groupCustomFieldFilter: e3, memberInfoFilter: [].concat(d2(ce2), ["NameCard"]) } });
      return this.getGroupProfileAdvance(e3).then(function(e4) {
        var e4 = e4.data, t4 = e4.successGroupList, e4 = e4.failureGroupList;
        return M2.l("".concat(o3, " ok")), 0 < e4.length ? E2(e4[0]) : ((e4 = At2(t4[0].type) && !n3.hasLocalGroup(s4) ? new qo(t4[0]) : (n3.updateGroupMap(t4), n3.getLocalGroupProfile(s4))).isSupportTopic || n3.get(11).updateConvGroupProfile([e4]), i4.setMessage("groupID:".concat(s4, " type:").concat(e4.type, " muteAllMembers:").concat(e4.muteAllMembers, " ownerID:").concat(e4.ownerID)).end(), T2({ group: e4 }));
      }).catch(function(e4) {
        return i4.setError(e4).setMessage("groupID:".concat(t3.groupID)).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "getGroupProfileAdvance", value: function(e3) {
      var t3, n3 = "".concat(this._n, ".getGroupProfileAdvance"), o3 = e3.groupIDList, i4 = (O2(o3) && 50 < o3.length && (this.warn("GetGroupProfileLimit"), o3.length = 50), []), s4 = [], o3 = (o3.forEach(function(e4) {
        (Ot2({ groupID: e4 }) ? s4 : i4).push(e4);
      }), []);
      return 0 < i4.length && (t3 = this._getGroupProfileAdvance(y2(y2({}, e3), {}, { groupIDList: i4 })), o3.push(t3)), 0 < s4.length && (t3 = this._getGroupProfileAdvance(y2(y2({}, e3), {}, { groupIDList: s4, relayFlag: 0 < i4.length })), o3.push(t3)), Promise.all(o3).then(function(e4) {
        var t4 = [], n4 = [];
        return e4.forEach(function(e5) {
          t4.push.apply(t4, d2(e5.successGroupList)), n4.push.apply(n4, d2(e5.failureGroupList));
        }), T2({ successGroupList: t4, failureGroupList: n4 });
      }).catch(function(e4) {
        return M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_getGroupProfileAdvance", value: function(t3) {
      var n3 = this, e3 = t3.relayFlag, o3 = void 0 !== e3 && e3, i4 = W2(t3, ni);
      return this.req({ P: G2.GET_GRP_PROFILE, data: i4 }).then(function(e4) {
        M2.l("".concat(n3._n, "._getGroupProfileAdvance ok. options:"), i4);
        e4 = e4.data.groups;
        return { successGroupList: e4.filter(function(e5) {
          return N3(e5.errorCode) || 0 === e5.errorCode;
        }), failureGroupList: e4.filter(function(e5) {
          return e5.errorCode && 0 !== e5.errorCode;
        }).map(function(e5) {
          return new L2({ code: e5.errorCode, message: e5.errorInfo, data: { groupID: e5.groupID } });
        }) };
      }).catch(function(e4) {
        return o3 && Ot2({ groupID: t3.groupIDList[0] }) ? { successGroupList: [], failureGroupList: [] } : E2(e4);
      });
    } }, { key: "createGroup", value: function(a3) {
      var r4 = this, e3 = [R2.GRP_PUBLIC, R2.GRP_WORK, R2.GRP_MEETING, R2.GRP_AVCHATROOM, R2.GRP_COMMUNITY], c3 = "".concat(this._n, ".").concat("createGroup"), t3 = a3.type, n3 = a3.groupID;
      if (a3.name && false === this._filterProfanity("name", a3))
        return E2({ code: k2.PROFANITY_FOUND });
      if (a3.introduction && false === this._filterProfanity("introduction", a3))
        return E2({ code: k2.PROFANITY_FOUND });
      if (a3.notification && false === this._filterProfanity("notification", a3))
        return E2({ code: k2.PROFANITY_FOUND });
      if (!e3.includes(t3))
        return E2({ code: k2.ILLEGAL_GRP_TYPE });
      if (!Ot2({ type: t3 })) {
        if (!S2(n3) && Ot2({ groupID: n3 }))
          return E2({ code: k2.ILLEGAL_GRP_ID });
        a3.isSupportTopic = void 0;
      }
      if (At2(t3) && !N3(a3.memberList) && 0 < a3.memberList.length && (a3.memberList = void 0), this._canIUseJoinOption(t3) || N3(a3.joinOption) || (a3.joinOption = void 0), Ot2({ type: t3 })) {
        if (!S2(n3) && !Ot2({ groupID: n3 }))
          return E2({ code: k2.ILLEGAL_GRP_ID });
        a3.isSupportTopic = true === a3.isSupportTopic ? 1 : 0;
      }
      var u3 = new P2("createGroup"), l3 = (M2.l("".concat(c3, " options:"), a3), null), d3 = [];
      return this.req({ P: G2.CREATE_GRP, data: y2(y2({}, a3), {}, { ownerID: this.getMyUserID(), webPushFlag: 1 }) }).then(function(e4) {
        var t4, n4, o3, e4 = e4.data, i4 = e4.groupID, e4 = e4.overLimitUserIDList, s4 = void 0 === e4 ? [] : e4, e4 = (l3 = i4, d3 = s4, "groupType:".concat(a3.type, " groupID:").concat(i4, " overLimitUserIDList:").concat(s4));
        return u3.setMessage(e4).end(), M2.l("".concat(c3, " ok. ").concat(e4)), a3.type === R2.GRP_AVCHATROOM || a3.type === R2.GRP_COMMUNITY && 1 === a3.isSupportTopic || (S2(a3.memberList) || S2(s4) || (a3.memberList = a3.memberList.filter(function(e5) {
          return -1 === s4.indexOf(e5.userID);
        })), r4.updateGroupMap([y2(y2({}, a3), {}, { groupID: i4 })]), e4 = r4.get(2), o3 = "", t4 = 0, a3.type === R2.GRP_COMMUNITY ? (o3 = r4.isIntl() ? "Create Community" : "创建社群", t4 = 1) : o3 = r4.isIntl() ? "Create Group" : "创建群组", n4 = r4.get(4).getMyNick(), o3 = e4.createCustomMessage({ to: i4, conversationType: R2.CONV_GROUP, payload: { data: JSON.stringify({ businessID: "group_create", content: o3, cmd: t4, opUser: n4 || r4.getMyUserID(), version: 4 }) } }), e4.sendMessageInstance(o3), r4.emitGroupListUpdate()), r4.getGroupProfile({ groupID: i4 });
      }).then(function(e4) {
        var e4 = e4.data.group, t4 = e4.selfInfo, n4 = t4.nameCard, t4 = t4.joinTime;
        return e4.updateSelfInfo({ nameCard: n4, joinTime: t4, messageRemindType: R2.MSG_REMIND_ACPT_AND_NOTE, role: R2.GRP_MBR_ROLE_OWNER }), T2({ group: e4, overLimitUserIDList: d3 });
      }).catch(function(e4) {
        var t4;
        return u3.setMessage("groupType:".concat(a3.type)).setError(e4).end(), 10010 === e4.code || 10007 === e4.code ? (r4._silentlyGetGroupProfile(e4.code, l3), r4.updateGroupMap([y2(y2({}, a3), {}, { groupID: l3 })]), (t4 = r4.getLocalGroupProfile(l3)).selfInfo.role = R2.GRP_MBR_ROLE_OWNER, T2({ group: t4, overLimitUserIDList: d3 })) : (M2.e("".concat(c3, " failed. error:"), e4), E2(e4));
      });
    } }, { key: "dismissGroup", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("dismissGroup"), o3 = "groupID:".concat(e3), i4 = new P2("dismissGroup");
      return i4.setMessage(o3), M2.l("".concat(n3, " ").concat(o3)), this.req({ P: G2.DISMISS_GRP, data: { groupID: e3 } }).then(function() {
        return i4.end(), M2.l("".concat(n3, " ok")), t3.deleteLocalGroupAndConversation(e3), t3.checkJoinedAVChatRoomByID(e3) && t3._AVChatRoomHandler.reset(e3), t3._groupAttributesHandler.deleteLocalGroupAttributes(e3), T2({ groupID: e3 });
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "updateGroupProfile", value: function(e3) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("updateGroupProfile");
      return this.hasLocalGroup(e3.groupID) && (t3 = this.getLocalGroupProfile(e3.groupID).type, this._canIUseJoinOption(t3) || N3(e3.joinOption) || (M2.w("".concat(i4, " joinOption is unavailable for Work/Meeting/AVChatRoom")), e3.joinOption = void 0)), N3(e3.muteAllMembers) || (e3.muteAllMembers ? e3.muteAllMembers = "On" : e3.muteAllMembers = "Off"), e3.name && false === this._filterProfanity("name", e3) || e3.introduction && false === this._filterProfanity("introduction", e3) || e3.notification && false === this._filterProfanity("notification", e3) ? E2({ code: k2.PROFANITY_FOUND }) : ((n3 = new P2("updateGroupProfile")).setMessage(JSON.stringify(e3)), M2.l("".concat(i4, " groupID:").concat(e3.groupID)), this.req({ P: G2.UPDATE_GRP_PROFILE, data: e3 }).then(function() {
        return n3.end(), M2.l("".concat(i4, " ok")), o3.hasLocalGroup(e3.groupID) && o3.groupMap.get(e3.groupID).updateGroup(e3), T2({ group: o3.groupMap.get(e3.groupID) });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.l("".concat(i4, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "_filterProfanity", value: function(e3, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e3], ae2)).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e3] = o3, true));
    } }, { key: "joinGroup", value: function(t3) {
      var n3, o3 = this, i4 = t3.groupID, s4 = "".concat(this._n, ".joinGroup");
      return this.deleteUnjoinedAVChatRoom(i4), this.hasLocalGroup(i4) ? this.isLoggedIn() ? (n3 = new P2("applyJoinGroup"), this.getGroupProfile({ groupID: i4 }).then(function() {
        return n3.setMessage("groupID:".concat(i4, " joinedStatus:").concat(R2.JOIN_STATUS_ALREADY_IN_GROUP)).end(), D2({ status: R2.JOIN_STATUS_ALREADY_IN_GROUP });
      }).catch(function(e3) {
        return n3.setMessage("groupID:".concat(i4, " unjoined")).end(), M2.w("".concat(s4, " ").concat(i4, " was unjoined, now join!")), o3.groupMap.delete(i4), o3.applyJoinGroup(t3);
      })) : D2({ status: R2.JOIN_STATUS_ALREADY_IN_GROUP }) : (M2.l("".concat(s4, " groupID:").concat(i4)), this.isLoggedIn() ? this.applyJoinGroup(t3) : this._AVChatRoomHandler.joinWithoutAuth(t3));
    } }, { key: "applyJoinGroup", value: function(e3) {
      var c3, u3, l3 = this, d3 = "".concat(this._n, ".").concat("applyJoinGroup"), p4 = e3.groupID;
      return S2(e3.applyMessage) || false !== this._filterProfanity("applyMessage", e3) ? (c3 = new P2("applyJoinGroup"), e3 = y2({}, e3), (u3 = this.canIUse(g2.AV_HISTORY_MSG)) && (e3.historyMessageFlag = 1), this.get(11).deleteTopicRoamingInfo(p4), this.req({ P: G2.APPLY_JOIN_GRP, data: e3 }).then(function(e4) {
        var e4 = e4.data, t3 = e4.joinedStatus, n3 = e4.longPollingKey, o3 = e4.startSeq, i4 = e4.avChatRoomFlag, s4 = e4.avChatRoomKey, a3 = e4.messageList, e4 = "groupID:".concat(p4, " joinedStatus:").concat(t3, " longPollingKey:").concat(n3, " startSeq:").concat(o3) + " avChatRoomFlag:".concat(i4, " canGetAVChatRoomHistoryMsg:").concat(u3, ",") + " historyMsgCount:".concat(S2(a3) ? 0 : a3.length);
        switch (c3.setMessage(e4).end(), M2.l("".concat(d3, " ok. ").concat(e4)), t3) {
          case $e2:
            return T2({ status: $e2 });
          case Qe2:
            return l3.getGroupProfile({ groupID: p4 }).then(function(e5) {
              e5 = e5.data.group;
              return l3._handleJoinResult({ group: e5, avChatRoomFlag: i4, longPollingKey: n3, startSeq: o3, avChatRoomKey: s4, messageList: a3 });
            }).catch(function(e5) {
              var t4;
              return 10010 === e5.code || 10007 === e5.code ? (l3._silentlyGetGroupProfile(e5.code, p4), t4 = new qo({ groupID: p4 }), l3.updateGroupMap([t4]), l3._handleJoinResult({ group: t4, avChatRoomFlag: i4, longPollingKey: n3, startSeq: o3, avChatRoomKey: s4, messageList: a3 })) : (M2.e("".concat(d3, " failed. error:"), e5), E2(e5));
            });
          default:
            var r4 = new L2({ code: k2.JOIN_GRP_FAIL });
            return M2.e("".concat(d3, " failed. error:"), r4), E2(r4);
        }
      }).catch(function(e4) {
        return c3.setMessage("groupID:".concat(p4)).setError(e4).end(), M2.e("".concat(d3, " failed. error:"), e4), E2(e4);
      })) : E2({ code: k2.PROFANITY_FOUND });
    } }, { key: "_handleJoinResult", value: function(e3) {
      var t3 = this, n3 = e3.group, o3 = e3.avChatRoomFlag, i4 = e3.longPollingKey, s4 = e3.startSeq, a3 = e3.avChatRoomKey, r4 = e3.messageList, c3 = n3.groupID;
      return 1 === o3 ? (this.get(11).setCompleted("".concat(R2.CONV_GROUP).concat(c3)), this._groupAttributesHandler.initGroupAttributesCache({ groupID: c3, avChatRoomKey: a3 }), this._groupCountersHandler.initGroupCountersCache({ groupID: c3, avChatRoomKey: a3 }), (e3 = N3(i4) ? this._AVChatRoomHandler.handleJoinResult({ group: n3 }) : this._AVChatRoomHandler.startRunLoop({ group: n3, longPollingKey: i4, startSeq: s4 })).then(function() {
        t3._onAVChatRoomHistoryMessage(r4, c3);
      }), e3) : (this.emitGroupListUpdate(true, false), T2({ status: Qe2, group: n3 }));
    } }, { key: "quitGroup", value: function(e3) {
      var t3, n3 = this, o3 = "".concat(this._n, ".").concat("quitGroup"), i4 = "groupID:".concat(e3), s4 = (M2.l("".concat(o3, " ").concat(i4)), this.checkJoinedAVChatRoomByID(e3));
      return s4 || this.hasLocalGroup(e3) ? s4 && !this.isLoggedIn() ? (M2.l("".concat(o3, " anonymously ok. ").concat(i4)), this.deleteLocalGroupAndConversation(e3), this._AVChatRoomHandler.reset(e3), D2({ groupID: e3 })) : ((t3 = new P2("quitGroup")).setMessage(i4), this.req({ P: G2.QUIT_GRP, data: { groupID: e3 } }).then(function() {
        return t3.end(), M2.l("".concat(o3, " ok")), n3.deleteLocalGroupAndConversation(e3), s4 && n3._AVChatRoomHandler.reset(e3), n3._groupAttributesHandler.deleteLocalGroupAttributes(e3), T2({ groupID: e3 });
      }).catch(function(e4) {
        return t3.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      })) : E2({ code: k2.MEMBER_NOT_IN_GRP });
    } }, { key: "searchGroupByID", value: function(e3) {
      var t3 = "".concat(this._n, ".").concat("searchGroupByID"), n3 = { groupIDList: [e3] }, o3 = new P2("searchGroupByID");
      return o3.setMessage("groupID:".concat(e3)), M2.l("".concat(t3, " groupID:").concat(e3)), this.req({ P: G2.SEARCH_GRP, data: n3 }).then(function(e4) {
        e4 = e4.data.groupProfile;
        if (0 !== e4[0].errorCode)
          throw new L2({ code: e4[0].errorCode, message: e4[0].errorInfo });
        return o3.end(), M2.l("".concat(t3, " ok")), T2({ group: new qo(e4[0]) });
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.w("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "changeGroupOwner", value: function(i4) {
      var s4, a3 = this, r4 = "".concat(this._n, ".").concat("changeGroupOwner");
      return this.hasLocalGroup(i4.groupID) && this.getLocalGroupProfile(i4.groupID).type === R2.GRP_AVCHATROOM ? E2({ code: k2.CANNOT_CHANGE_OWNER_IN_AV }) : i4.newOwnerID === this.getMyUserID() ? E2({ code: k2.CANNOT_CHANGE_OWNER_TO_SELF }) : ((s4 = new P2("changeGroupOwner")).setMessage("groupID:".concat(i4.groupID, " newOwnerID:").concat(i4.newOwnerID)), M2.l("".concat(r4, " groupID:").concat(i4.groupID)), this.req({ P: G2.CHANGE_GRP_OWNER, data: i4 }).then(function() {
        s4.end(), M2.l("".concat(r4, " ok"));
        var e3, t3 = i4.groupID, n3 = i4.newOwnerID, o3 = (a3.groupMap.get(t3).ownerID = n3, a3._groupMemberHandler.getLocalGroupMemberList(t3));
        return o3 instanceof Map && (e3 = o3.get(a3.getMyUserID()), N3(e3) || (e3.updateRole("Member"), a3.groupMap.get(t3).selfInfo.role = "Member"), e3 = o3.get(n3), N3(e3) || e3.updateRole("Owner")), a3.emitGroupListUpdate(true, false), T2({ group: a3.groupMap.get(t3) });
      }).catch(function(e3) {
        return s4.setError(e3).end(), M2.e("".concat(r4, " failed. error:"), e3), E2(e3);
      }));
    } }, { key: "getGroupApplicationList", value: function() {
      return this._groupSystemNoticeHandler.getGroupApplicationList();
    } }, { key: "handleGroupApplication", value: function(e3) {
      var t3, n3, o3, i4, s4, a3 = this, r4 = "".concat(this._n, ".").concat("handleGroupApplication"), c3 = e3.handleAction, u3 = e3.handleMessage, l3 = e3.message, d3 = e3.application, p4 = (l3 ? (t3 = l3.payload.operatorID, n3 = l3.payload.groupProfile.groupID, o3 = l3.payload.authentication, i4 = l3.payload.messageKey) : d3 && (t3 = d3.applicant, n3 = d3.groupID, o3 = d3.authentication, i4 = d3.messageKey), G2.HANDLE_GRP_APPLICATION), _3 = (d3 && 2 === d3.applicationType && (p4 = G2.HANDLE_INVITE_JOIN_GRP, s4 = d3.userID), new P2("handleGroupApplication"));
      return _3.setMessage("groupID:".concat(n3)), M2.l("".concat(r4, " groupID:").concat(n3)), this.req({ P: p4, data: { handleAction: c3, handleMessage: u3, applicant: t3, invitee: s4, groupID: n3, authentication: o3, messageKey: i4 } }).then(function() {
        return _3.end(), M2.l("".concat(r4, " ok")), l3 && a3._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e3.message] }), T2({ group: a3.getLocalGroupProfile(n3) });
      }).catch(function(e4) {
        return _3.setError(e4).end(), M2.e("".concat(r4, " failed. error"), e4), E2(e4);
      });
    } }, { key: "handleGroupInvitation", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("handleGroupInvitation"), o3 = e3.message.payload, i4 = o3.groupProfile.groupID, s4 = o3.authentication, a3 = o3.messageKey, o3 = o3.operatorID, r4 = e3.handleAction, c3 = new P2("handleGroupInvitation");
      return c3.setMessage("groupID:".concat(i4, " inviter:").concat(o3, " handleAction:").concat(r4)), M2.l("".concat(n3, " groupID:").concat(i4, " inviter:").concat(o3, " handleAction:").concat(r4)), this.req({ P: G2.HANDLE_GRP_INVITATION, data: y2(y2({}, e3), {}, { inviter: o3, groupID: i4, authentication: s4, messageKey: a3 }) }).then(function() {
        return c3.end(), M2.l("".concat(n3, " ok")), t3._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e3.message] }), T2({ group: t3.getLocalGroupProfile(i4) });
      }).catch(function(e4) {
        return c3.setError(e4).end(), M2.e("".concat(n3, " failed. error"), e4), E2(e4);
      });
    } }, { key: "getGroupOnlineMemberCount", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".getGroupOnlineMemberCount"), e3 = this._AVChatRoomHandler.checkJoinedAVChatRoomByID(t3), i4 = this.hasLocalGroup(t3);
      if (M2.l("".concat(o3, " groupID:").concat(t3, " isAVChatRoom:").concat(e3, " has:").concat(i4)), e3)
        return this._AVChatRoomHandler.getGroupOnlineMemberCount(t3);
      if (!i4)
        return D2({ memberCount: 0 });
      e3 = Date.now();
      if (this._onlineMemberCountMap.has(t3)) {
        i4 = this._onlineMemberCountMap.get(t3);
        if (e3 - i4.lastReqTime <= 6e4)
          return D2({ memberCount: i4.memberCount });
        i4.lastReqTime = e3;
      }
      return this.requestOnlineCount(t3).then(function(e4) {
        e4 = e4.data.memberCount, e4 = void 0 === e4 ? 0 : e4;
        return n3._onlineMemberCountMap.set(t3, { lastReqTime: Date.now(), memberCount: e4 }), M2.l("".concat(o3, " ok. groupID:").concat(t3, " memberCount:").concat(e4)), D2({ memberCount: e4 });
      }).catch(function(e4) {
        return M2.w("".concat(o3, " failed. error:"), e4), Promise.reject(e4);
      });
    } }, { key: "requestOnlineCount", value: function(e3) {
      return this.req({ P: G2.GET_ONLINE_MBR_NUM, data: { groupID: e3 } });
    } }, { key: "hasLocalGroup", value: function(e3) {
      return this.groupMap.has(e3);
    } }, { key: "deleteLocalGroupAndConversation", value: function(e3) {
      var t3 = this.checkJoinedAVChatRoomByID(e3), n3 = (M2.l("".concat(this._n, ".deleteLocalGroupAndConversation groupID:").concat(e3, " isJoinedAVChatRoom:").concat(t3)), this.get(11)), o3 = "".concat(R2.CONV_GROUP).concat(e3);
      t3 && (this.stopMessageLongPolling({ groupID: e3 }), n3.deleteLocalConv(o3)), Ot2({ groupID: e3 }) && (t3 = this.getLocalGroupProfile(e3)) && true === t3.isSupportTopic && this.get(10).deleteTopicListInCommunity(e3), n3.clearUnreadCount(o3), n3.setCompleted(o3), this._deleteLocalGroup(e3), this._onlineMemberCountMap.delete(e3), this.emitGroupListUpdate(true, false);
    } }, { key: "_deleteLocalGroup", value: function(e3) {
      this.groupMap.delete(e3), this._groupMemberHandler.deleteGroupMemberList(e3);
    } }, { key: "sendMessage", value: function(e3, t3) {
      return O2(e3._receiverList) && 0 < e3._receiverList.length && !this.canIUse(g2.MSG_TO_SPECIFIED_GRP_MBR) ? this.noUse("Targeted Group Message") : (e3 = this.createGroupMessagePack(e3, t3), this.req(e3));
    } }, { key: "createGroupMessagePack", value: function(e3, t3) {
      var n3 = null, o3 = (t3 && t3.offlinePushInfo && (n3 = t3.offlinePushInfo), ""), i4 = (C2(e3.cloudCustomData) && 0 < e3.cloudCustomData.length && (o3 = e3.cloudCustomData), []), s4 = (m2(t3) && m2(t3.messageControlInfo) && (s4 = (r4 = t3.messageControlInfo).excludedFromUnreadCount, a3 = r4.excludedFromLastMessage, r4 = r4.excludedFromContentModeration, true === s4 && i4.push("NoUnread"), true === a3 && i4.push("NoLastMsg"), true === r4) && i4.push("NoMsgCheck"), void 0), a3 = (O2(e3._receiverList) && 0 < e3._receiverList.length && (s4 = e3._receiverList, 50 < e3._receiverList.length) && (s4 = e3._receiverList.slice(0, 50), this.warn("ReceiverListLimit")), this.isOnlineMessage(e3, t3) ? 1 : 0), r4 = JSON.parse(JSON.stringify(e3.getElements())), c3 = this.get(17).getFileDNList(), u3 = e3.getGroupAtInfoList(), r4 = { fromAccount: this.getMyUserID(), groupID: e3.to, msgBody: ao(e3.type, r4, c3), cloudCustomData: o3, random: e3.random, priority: e3.priority, clientSequence: e3.clientSequence, groupAtInfo: e3.type !== R2.MSG_TEXT || S2(u3) ? void 0 : u3, onlineOnlyFlag: a3, clientTime: e3.clientTime, offlinePushInfo: Lo(n3), messageControlInfo: 0 == a3 ? i4 : void 0, needReadReceipt: true !== e3.needReadReceipt || this.isMessageFromOrToAVChatroom(e3.to) ? 0 : 1, receiverList: s4, isSupportExtension: true === e3.isSupportExtension ? 1 : 0, isRelayMessage: true === e3._relayFlag ? 1 : 0, cmConfigID: e3._cmConfigID, forbidCallbackControl: kt2(t3) };
      return Nt2(e3.to) && (r4.groupID = jt2(e3.to), r4.topicID = e3.to), { P: G2.SEND_GRP_MSG, data: r4 };
    } }, { key: "revokeMessage", value: function(e3) {
      var t3 = { groupID: e3.to, msgSeqList: [{ msgSeq: e3.sequence }] };
      return Nt2(e3.to) && (t3.groupID = jt2(e3.to), t3.topicID = e3.to), this.req({ P: G2.REVOKE_GRP_MSG, data: t3 });
    } }, { key: "deleteMessage", value: function(e3) {
      var t3 = e3.to, e3 = e3.keyList, e3 = (M2.l("".concat(this._n, ".deleteMessage groupID:").concat(t3, " count:").concat(e3.length)), { groupID: t3, deleter: this.getMyUserID(), keyList: e3 });
      return Nt2(t3) && (e3.groupID = jt2(t3), e3.topicID = t3), this.req({ P: G2.DEL_GRP_MSG, data: e3 });
    } }, { key: "modifyRemoteMessage", value: function(e3) {
      var t3 = e3.to, n3 = e3.sequence, o3 = e3.payload, i4 = e3.type, s4 = e3.version, s4 = void 0 === s4 ? 0 : s4, a3 = e3.cloudCustomData, e3 = e3._elements, r4 = t3, c3 = void 0, t3 = (Nt2(t3) && (r4 = jt2(t3), c3 = t3), void 0);
      return zt(i4) && (1 < e3.length && e3.splice(0, 1, { type: i4, content: o3 }), t3 = e3), this.req({ P: G2.MODIFY_GRP_MSG, data: { groupID: r4, topicID: c3, sequence: n3, version: s4, elements: t3, cloudCustomData: a3 } });
    } }, { key: "getRoamingMessage", value: function(e3) {
      var r4 = this, c3 = "".concat(this._n, ".").concat("getRoamingMessage"), u3 = e3.conversationID, l3 = e3.groupID, e3 = e3.sequence, d3 = new P2("getRoamingMessage"), p4 = 0, _3 = void 0;
      return Nt2(l3) && (l3 = jt2(_3 = l3)), this._computeLastSequence({ groupID: l3, topicID: _3, sequence: e3 }).then(function(e4) {
        return p4 = e4, M2.l("".concat(c3, " groupID:").concat(l3, " startSequence:").concat(p4)), r4.req({ P: G2.GET_GRP_ROAMING_MSG, data: { groupID: l3, count: 21, sequence: p4, topicID: _3 } });
      }).then(function(e4) {
        var t3 = e4.data, n3 = t3.messageList, o3 = t3.complete, t3 = t3.invisibleSequenceList, t3 = void 0 === t3 ? [] : t3, e4 = e4.data.nextSequence, e4 = void 0 === e4 ? 0 : e4, i4 = (N3(n3) ? M2.l("".concat(c3, " ok. complete:").concat(o3, " nextSequence:").concat(e4, " but messageList is undefined!")) : M2.l("".concat(c3, " ok. complete:").concat(o3, " nextSequence:").concat(e4, " count:").concat(n3.length)), d3.setMessage("groupID:".concat(l3, " topicID:").concat(_3, " startSequence:").concat(p4, " complete:").concat(o3, " nextSequence:").concat(e4)).end(), r4.get(11)), s4 = [], a3 = [], n3 = (S2(n3) || (s4 = i4.onRoamingMessage(n3, u3, true, a3), i4.updateIsRead(u3), i4.patchConvLastMessage(u3)), 2 === o3 || e4 < 1);
        return n3 && (i4.setCompleted(u3), e4 = ""), M2.l("".concat(c3, " isPullingCompleted:").concat(n3, " nextReqID:").concat(e4, " storedMsgCount:").concat(s4.length) + " invisibleSeqCount:".concat(t3.length)), { nextReqID: e4 + "", storedMessageList: s4, assembledMessageList: a3, isPullingCompleted: n3 };
      }).catch(function(e4) {
        return d3.setError(e4).setMessage("groupID:".concat(l3, " topicID:").concat(_3, " startSequence:").concat(p4)).end(), M2.w("".concat(c3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_getGroupIDOfMessage", value: function(e3) {
      return e3.conversationID.replace(R2.CONV_GROUP, "");
    } }, { key: "getReadReceiptList", value: function(n3) {
      var t3, o3 = "".concat(this._n, ".").concat("getReadReceiptList"), e3 = this._getGroupIDOfMessage(n3[0]), i4 = this.getMyUserID(), s4 = n3.filter(function(e4) {
        return e4.from === i4 && true === e4.needReadReceipt;
      }).map(function(e4) {
        return { sequence: e4.sequence };
      });
      return M2.l("".concat(o3, " groupID:").concat(e3, " sequenceList:").concat(JSON.stringify(s4))), 0 === s4.length ? D2({ messageList: n3 }) : ((t3 = new P2("getReadReceiptList")).setMessage("groupID:".concat(e3)), this.req({ P: G2.GET_READ_RECEIPT, data: { groupID: e3, sequenceList: s4 } }).then(function(e4) {
        t3.end(), M2.l("".concat(o3, " ok"));
        e4 = e4.data.readReceiptList;
        return O2(e4) && e4.forEach(function(t4) {
          n3.forEach(function(e5) {
            0 === t4.code && t4.sequence === e5.sequence && (e5.readReceiptInfo.readCount = t4.readCount, e5.readReceiptInfo.unreadCount = t4.unreadCount);
          });
        }), T2({ messageList: n3 });
      }).catch(function(e4) {
        return t3.setError(e4).end(), M2.w("".concat(o3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "sendReadReceipt", value: function(e3) {
      var t3 = "".concat(this._n, ".").concat("sendReadReceipt"), n3 = this._getGroupIDOfMessage(e3[0]), o3 = new P2("sendReadReceipt"), i4 = (o3.setMessage("groupID:".concat(n3)), this.getMyUserID()), e3 = e3.filter(function(e4) {
        return e4.from !== i4 && true === e4.needReadReceipt;
      }).map(function(e4) {
        return { sequence: e4.sequence };
      });
      return 0 === e3.length ? E2({ code: k2.READ_RECEIPT_MSG_LIST_EMPTY }) : (M2.l("".concat(t3, ". sequenceList:").concat(JSON.stringify(e3))), this.req({ P: G2.SEND_READ_RECEIPT, data: { groupID: n3, sequenceList: e3 } }).then(function(e4) {
        return o3.end(), M2.l("".concat(t3, " ok")), T2();
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.w("".concat(t3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "getReadReceiptDetail", value: function(e3) {
      var i4 = this, t3 = e3.message, n3 = e3.filter, o3 = e3.cursor, e3 = e3.count, s4 = this._getGroupIDOfMessage(t3), a3 = t3.ID, t3 = t3.sequence, r4 = "".concat(this._n, ".").concat("getReadReceiptDetail"), c3 = this._receiptDetailCompleteMap.get(a3) || false, u3 = 0 !== n3 && 1 !== n3 ? 0 : n3, n3 = C2(o3) ? o3 : "", o3 = !A2(e3) || e3 <= 0 || 100 <= e3 ? 100 : e3, e3 = "groupID:".concat(s4, " sequence:").concat(t3, " cursor:").concat(n3, " filter:").concat(u3, " completeFlag:").concat(c3), l3 = (M2.l("".concat(r4, " ").concat(e3)), { cursor: "", isCompleted: false, messageID: a3, unreadUserIDList: [], readUserIDList: [] }), d3 = new P2("getReadReceiptDetail");
      return d3.setMessage(e3), this.req({ P: G2.GET_READ_RECEIPT_DETAIL, data: { groupID: s4, sequence: t3, flag: u3, cursor: n3, count: o3 } }).then(function(e4) {
        d3.end();
        var e4 = e4.data, t4 = e4.cursor, n4 = e4.isCompleted, o4 = e4.unreadUserIDList, e4 = e4.readUserIDList;
        return l3.cursor = t4, 1 === n4 && (l3.isCompleted = true, i4._receiptDetailCompleteMap.set(a3, true)), 0 === u3 ? l3.readUserIDList = e4.map(function(e5) {
          return e5.userID;
        }) : 1 === u3 && (l3.unreadUserIDList = o4.map(function(e5) {
          return e5.userID;
        })), M2.l("".concat(r4, " ok")), T2(l3);
      }).catch(function(e4) {
        return d3.setError(e4).end(), M2.w("".concat(r4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "getGroupReceiptsByUsers", value: function(e3) {
      var t3 = "".concat(this._n, ".").concat("getGroupReceiptsByUsers"), n3 = e3.groupID, e3 = e3.dataList, e3 = void 0 === e3 ? [] : e3, o3 = "groupID:".concat(n3, " dataList length:").concat(e3.length);
      return M2.l("".concat(t3, " ").concat(o3)), 0 === e3.length && M2.w("".concat(t3, " dataList is empty.")), this.req({ P: G2.GET_GRP_RECEIPTS_BY_USERS, data: { groupID: n3, dataList: e3 } }).then(function(e4) {
        e4 = e4.data.dataList, e4 = void 0 === e4 ? [] : e4;
        return M2.l("".concat(t3, " ok.")), T2({ dataList: e4 });
      }).catch(function(e4) {
        return M2.w("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "getRoamingMessagesHopping", value: function(c3) {
      var u3 = this, l3 = "".concat(this._n, ".").concat("getRoamingMessagesHopping"), t3 = c3.groupID, n3 = c3.count, d3 = c3.sequence, p4 = c3.direction, o3 = void 0;
      return N3(d3) && 1 === p4 ? D2({ messageList: [], isCompleted: true, nextMessageSeq: "" }) : (Nt2(t3) && (t3 = jt2(o3 = t3)), this._computeReqSeqHopping({ groupID: t3, topicID: o3, sequence: d3 }).then(function(e3) {
        N3(d3) || 1 !== p4 || (e3 = d3 + n3 - 1);
        var a3 = "".concat(o3 ? "topicID:".concat(o3) : "groupID:".concat(t3), " sequence:").concat(d3, " reqSeq:").concat(e3, " direction:").concat(p4), r4 = (M2.l("".concat(l3, " ").concat(a3)), new P2("getRoamingMessagesHopping"));
        return u3.req({ P: G2.GET_GRP_ROAMING_MSG, data: { groupID: t3, topicID: o3, count: n3, sequence: e3 } }).then(function(e4) {
          var e4 = e4.data, t4 = e4.messageList, t4 = void 0 === t4 ? [] : t4, n4 = e4.complete, o4 = e4.nextSequence, o4 = void 0 === o4 ? 0 : o4, e4 = e4.invisibleSequenceList, e4 = void 0 === e4 ? [] : e4, i4 = "complete:".concat(n4, " nextSequence:").concat(o4, " remoteMsgCount:").concat(t4.length, " invisibleSequenceList:").concat(e4), i4 = (r4.setMessage("".concat(a3, " ").concat(i4)).end(), M2.l("".concat(l3, " ok. ").concat(i4)), "".concat(R2.CONV_GROUP).concat(c3.groupID)), s4 = u3.get(11), i4 = s4.onRoamingMessage(t4, i4, false), t4 = u3._computeResult({ groupID: c3.groupID, direction: p4, sequence: d3, remoteMessageList: t4, processedMessageList: i4, complete: n4, nextSequence: o4, invisibleSequenceList: e4 });
          return s4.storeHoppingMessageList(t4.messageList), T2(t4);
        }).catch(function(e4) {
          return r4.setError(e4).setMessage("groupID:".concat(t3, " sequence:").concat(d3, " count:").concat(n3)).end(), M2.w("".concat(l3, " failed. error:"), e4), E2(e4);
        });
      }));
    } }, { key: "_computeReqSeqHopping", value: function(e3) {
      var n3 = this, o3 = e3.groupID, t3 = e3.topicID, t3 = void 0 === t3 ? void 0 : t3, e3 = e3.sequence, e3 = void 0 === e3 ? void 0 : e3;
      return 0 < e3 ? Promise.resolve(e3) : N3(t3) ? this.getGroupProfileAdvance({ groupIDList: [o3], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(function(e4) {
        var e4 = e4.data.successGroupList, t4 = 0;
        return S2(e4) || (t4 = e4[0].nextMessageSeq - 1), M2.l("".concat(n3._n, "._computeReqSeqHopping groupID:").concat(o3, " lastSequence:").concat(t4, " from remote")), t4;
      }).catch(function(e4) {
        return E2(e4);
      }) : Promise.resolve(0);
    } }, { key: "_computeResult", value: function(e3) {
      var t3 = { messageList: [], isCompleted: false, nextMessageSeq: "" }, n3 = e3.groupID, o3 = e3.direction, i4 = e3.sequence, s4 = e3.remoteMessageList, s4 = void 0 === s4 ? [] : s4, a3 = e3.processedMessageList, a3 = void 0 === a3 ? [] : a3, r4 = e3.complete, c3 = e3.nextSequence, e3 = e3.invisibleSequenceList;
      if (0 === o3)
        return t3.nextMessageSeq = c3, (2 === r4 || c3 < 1) && (t3.isCompleted = true, t3.nextMessageSeq = ""), t3.messageList = a3, t3;
      if (1 === o3) {
        if (S2(s4)) {
          if (S2(e3))
            return t3.isCompleted = true, t3.nextMessageSeq = "", t3;
          t3.nextMessageSeq = e3[0] + 1;
        } else {
          r4 = s4[0].sequence, c3 = e3[0] || 0;
          t3.nextMessageSeq = c3 < r4 ? r4 + 1 : c3 + 1;
        }
        return a3.forEach(function(e4) {
          e4.sequence >= i4 && t3.messageList.push(e4);
        }), (Ot2({ groupID: n3 }) || Nt2(n3)) && 0 === t3.messageList.length && s4[0].sequence < i4 && (t3.isCompleted = true, t3.nextMessageSeq = ""), t3;
      }
    } }, { key: "setMessageRead", value: function(e3) {
      var o3 = this, i4 = e3.conversationID, s4 = e3.lastMessageSeq, a3 = "".concat(this._n, ".").concat("setMessageRead"), e3 = "convID:".concat(i4, " lastMessageSeq:").concat(s4), r4 = (M2.l("".concat(a3, " ").concat(e3)), A2(s4) || this.warn("DoNotModifyLastSeq"), new P2("setMessageRead")), c3 = (r4.setMessage(e3), i4.replace(R2.CONV_GROUP, "")), u3 = void 0;
      return Nt2(c3) && (c3 = jt2(u3 = c3)), this.req({ P: G2.SET_GRP_MSG_READ, data: { groupID: c3, topicID: u3, messageReadSeq: s4 } }).then(function() {
        r4.end(), M2.l("".concat(a3, " ok"));
        var e4, t3 = o3.get(11), n3 = (t3.updateIsReadAfterReadReport({ conversationID: i4, lastMessageSeq: s4 }), true);
        return !N3(u3) && (n3 = false, e4 = o3.get(10).getLocalTopic(c3, u3)) && e4.updateSelfInfo({ readedSequence: s4 }), t3.updateUnreadCount(i4, n3), T2();
      }).catch(function(e4) {
        return r4.setError(e4).end(), M2.l("".concat(a3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_computeLastSequence", value: function(e3) {
      var t3 = e3.groupID, n3 = e3.topicID, n3 = void 0 === n3 ? void 0 : n3, e3 = e3.sequence;
      return 0 < e3 ? Promise.resolve(e3) : N3(n3) ? this.getGroupLastSequence(t3) : Promise.resolve(0);
    } }, { key: "getGroupLastSequence", value: function(e3) {
      var t3 = "".concat(this._n, ".").concat("getGroupLastSequence"), n3 = new P2("getGroupLastSequence"), o3 = 0, i4 = "", s4 = "groupID:".concat(e3);
      if (this.hasLocalGroup(e3)) {
        var a3 = this.getLocalGroupProfile(e3), r4 = a3.lastMessage;
        if (0 < r4.lastSequence && false === r4.onlineOnlyFlag)
          return o3 = r4.lastSequence, i4 = "".concat(s4, ", ").concat(o3, " from group.lastMessage.lastSequence"), M2.l("".concat(t3, " ").concat(i4)), n3.setMessage(i4).end(), Promise.resolve(o3);
        if (1 < a3.nextMessageSeq)
          return o3 = a3.nextMessageSeq - 1, i4 = "".concat(s4, ", ").concat(o3, " from group.nextMessageSeq"), M2.l("".concat(t3, " ").concat(i4)), n3.setMessage(i4).end(), Promise.resolve(o3);
      }
      r4 = this.get(11).getLocalConversation("GROUP".concat(e3));
      return r4 && r4.lastMessage.lastSequence && false === r4.lastMessage.onlineOnlyFlag ? (o3 = r4.lastMessage.lastSequence, i4 = "".concat(s4, ", ").concat(o3, " from conversation.lastMessage.lastSequence"), M2.l("".concat(t3, " ").concat(i4)), n3.setMessage(i4).end(), Promise.resolve(o3)) : this.getGroupProfileAdvance({ groupIDList: [e3], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(function(e4) {
        e4 = e4.data.successGroupList;
        return S2(e4) ? M2.w("".concat(t3, " ").concat(s4, ", empty successGroupList")) : (o3 = e4[0].nextMessageSeq - 1, i4 = "".concat(s4, ", ").concat(o3, " from remote"), M2.l("".concat(t3, " ").concat(i4))), n3.setMessage(i4).end(), o3;
      }).catch(function(e4) {
        return n3.setError(e4).setMessage(s4).end(), M2.w("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "isMessageFromOrToAVChatroom", value: function(e3) {
      return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e3);
    } }, { key: "hasJoinedAVChatRoom", value: function() {
      return this._AVChatRoomHandler.hasJoinedAVChatRoom();
    } }, { key: "getJoinedAVChatRoom", value: function() {
      return this._AVChatRoomHandler.getJoinedAVChatRoom();
    } }, { key: "getGroupRemoteLastSeq", value: function(e3) {
      e3 = this.getLocalGroupProfile(e3);
      return e3 ? e3.nextMessageSeq - 1 : 1;
    } }, { key: "isOnlineMessage", value: function(e3, t3) {
      return !(!this._canIUseOnlineOnlyFlag(e3) || !t3 || true !== t3.onlineUserOnly);
    } }, { key: "_canIUseOnlineOnlyFlag", value: function(e3) {
      var t3 = this.getJoinedAVChatRoom();
      return !t3 || !t3.includes(e3.to) || e3.conversationType !== R2.CONV_GROUP;
    } }, { key: "_onAVChatRoomHistoryMessage", value: function(e3, t3) {
      var n3;
      S2(e3) || (M2.l("".concat(this._n, "._onAVChatRoomHistoryMessage groupID:").concat(t3, " count:").concat(e3.length)), n3 = [], e3.forEach(function(e4) {
        n3.push(y2(y2({}, e4), {}, { isHistoryMessage: 1 }));
      }), this.onAVChatRoomMessage(n3, t3));
    } }, { key: "onAVChatRoomMessage", value: function(e3) {
      this._AVChatRoomHandler.onMessage(e3, 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "");
    } }, { key: "onAVChatRoomMemberBanned", value: function(e3) {
      this._AVChatRoomHandler.onAVChatRoomMemberBanned(e3);
    } }, { key: "setUnjoinedAVChatRoom", value: function(e3) {
      this._unjoinedAVChatRoomList.set(e3, 1);
    } }, { key: "deleteUnjoinedAVChatRoom", value: function(e3) {
      this._unjoinedAVChatRoomList.has(e3) && this._unjoinedAVChatRoomList.delete(e3);
    } }, { key: "isUnjoinedAVChatRoom", value: function(e3) {
      return this._unjoinedAVChatRoomList.has(e3);
    } }, { key: "isGroupAttributesUpdatedNotice", value: function(e3) {
      return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e3);
    } }, { key: "updateLocalMainSequenceOnReconnected", value: function() {
      this._groupAttributesHandler.updateLocalMainSequenceOnReconnected();
    } }, { key: "initGroupAttributes", value: function(e3) {
      return this._groupAttributesHandler.initGroupAttributes(e3);
    } }, { key: "setGroupAttributes", value: function(e3) {
      return this._groupAttributesHandler.setGroupAttributes(e3);
    } }, { key: "deleteGroupAttributes", value: function(e3) {
      return this._groupAttributesHandler.deleteGroupAttributes(e3);
    } }, { key: "getGroupAttributes", value: function(e3) {
      return this._groupAttributesHandler.getGroupAttributes(e3);
    } }, { key: "isMessageFromTopic", value: function(e3, t3) {
      return 2 === e3 && !S2(t3);
    } }, { key: "isMessageFromCommunityOfTopic", value: function(e3, t3) {
      return 2 === e3 && S2(t3);
    } }, { key: "getMessageExtensions", value: function(e3, t3) {
      return M2.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t3)), this.req({ P: G2.GET_GRP_MSG_EXT, data: { groupID: e3.to, messageSequence: e3.sequence, startSequence: t3 } });
    } }, { key: "modifyMsgExts", value: function(e3, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1;
      return M2.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n3)), this.req({ P: G2.MODIFY_GRP_MSG_EXT, data: { groupID: e3.to, messageSequence: e3.sequence, extensionList: t3, operateType: n3 } });
    } }, { key: "_genNotifyReqList", value: function(e3) {
      for (var t3, n3, o3, i4, s4 = [], a3 = 0, r4 = e3.length; a3 < r4; a3++)
        t3 = e3[a3], i4 = this.getLocalGroupProfile(t3).type, n3 = this._getGroupLastRevokedTime(t3), o3 = 1e3 * He2(), i4 = { notifyType: 1, limit: 20, type: Ot2({ type: i4, groupID: t3 }) ? R2.GRP_COMMUNITY : void 0, groupID: t3, beginTime: n3, endTime: o3 }, s4.push(i4);
      return s4;
    } }, { key: "getNotice", value: function(e3) {
      var r4 = this, t3 = "".concat(this._n, ".getNotice"), e3 = e3.filter(function(e4) {
        var t4;
        return !!r4.hasLocalGroup(e4) && (t4 = (e4 = r4.getLocalGroupProfile(e4)).type, e4 = e4.isSupportTopic, !At2(t4)) && !e4;
      });
      0 !== e3.length && (M2.l("".concat(t3, " list:").concat(e3)), this.req({ P: G2.GET_GRP_NOTIFY, data: { notifyReqList: this._genNotifyReqList(e3) } }).then(function(e4) {
        var i4, s4, e4 = e4.data.notifyRspList, a3 = [];
        O2(e4) && (i4 = { dataList: [] }, s4 = "".concat(t3, " ok."), e4.forEach(function(e5) {
          var t4 = e5.nextRevokedTime, n3 = e5.groupID, o3 = e5.notifyList;
          s4 += " groupID:".concat(n3, " nextRevokedTime:").concat(t4, " count:").concat(o3.length, "\n"), i4.dataList.push({ elements: { revokedInfos: r4._genRevokedInfos(e5) } }), 0 !== t4 ? (r4._setGroupLastRevokedTime(n3, t4), a3.push(n3)) : r4._setGroupLastRevokedTime(n3, 1e3 * He2());
        }), M2.l(s4), r4.onMsgRevoked(i4, false)), 0 < a3.length && r4.getNotice(a3);
      }).catch(function(e4) {
        M2.e("".concat(t3, " failed. error:"), e4);
      }));
    } }, { key: "_genRevokedInfos", value: function(e3) {
      var t3 = e3.notifyList, n3 = e3.groupID, o3 = [];
      return O2(t3) && t3.forEach(function(e4) {
        o3.push({ groupID: n3, sequence: e4.sequence, random: e4.random, revokerInfo: y2({}, e4.revokerInfo) });
      }), o3;
    } }, { key: "_getGroupLastRevokedTime", value: function(e3) {
      return this.hasLocalGroup(e3) ? this.getLocalGroupProfile(e3)._lastRevokedTime : 0;
    } }, { key: "_setGroupLastRevokedTime", value: function(e3, t3) {
      this.hasLocalGroup(e3) && (this.getLocalGroupProfile(e3)._lastRevokedTime = t3);
    } }, { key: "isGroupCountersNotice", value: function(e3) {
      return this._groupCountersHandler.isGroupCountersNotice(e3);
    } }, { key: "setGroupCounters", value: function(e3) {
      return this._groupCountersHandler.setGroupCounters(e3);
    } }, { key: "increaseGroupCounter", value: function(e3) {
      return this._groupCountersHandler.increaseGroupCounter(e3);
    } }, { key: "decreaseGroupCounter", value: function(e3) {
      return this._groupCountersHandler.decreaseGroupCounter(e3);
    } }, { key: "getGroupCounters", value: function(e3) {
      return this._groupCountersHandler.getGroupCounters(e3);
    } }, { key: "getGroupMemberHandler", value: function() {
      return this._groupMemberHandler;
    } }, { key: "getGroupMemberList", value: function(e3) {
      return this._groupMemberHandler.getGroupMemberList(e3);
    } }, { key: "getGroupMemberProfile", value: function(e3) {
      return this._groupMemberHandler.getGroupMemberProfile(e3);
    } }, { key: "addGroupMember", value: function(e3) {
      return this._groupMemberHandler.addGroupMember(e3);
    } }, { key: "deleteGroupMember", value: function(e3) {
      return this._groupMemberHandler.deleteGroupMember(e3);
    } }, { key: "setGroupMemberMuteTime", value: function(e3) {
      return this._groupMemberHandler.setGroupMemberMuteTime(e3);
    } }, { key: "setGroupMemberRole", value: function(e3) {
      return this._groupMemberHandler.setGroupMemberRole(e3);
    } }, { key: "setGroupMemberNameCard", value: function(e3) {
      return this._groupMemberHandler.setGroupMemberNameCard(e3);
    } }, { key: "setGroupMemberCustomField", value: function(e3) {
      return this._groupMemberHandler.setGroupMemberCustomField(e3);
    } }, { key: "markGroupMemberList", value: function(e3) {
      return this._groupMemberHandler.markGroupMemberList(e3);
    } }, { key: "modifyGroupMemberInfo", value: function(e3) {
      return this._groupMemberHandler.modifyGroupMemberInfo(e3);
    } }, { key: "restartPolling", value: function() {
      this._AVChatRoomHandler.restartPolling();
    } }, { key: "getPollingTimerID", value: function(e3) {
      var t3;
      return e3 && (t3 = this.getLocalGroupProfile(e3)) && At2(t3.type) ? this._AVChatRoomHandler.getPollingTimerID(e3) : -1;
    } }, { key: "_canIUseJoinOption", value: function(e3) {
      return e3 === R2.GRP_PUBLIC || Ot2({ type: e3 });
    } }, { key: "_silentlyGetGroupProfile", value: function(e3, t3) {
      var n3 = setTimeout(this.getGroupProfile.bind(this, { groupID: t3 }), 3e3);
      this._timeoutIDs.push(n3), M2.l("".concat(this._n, "._silentlyGetGroupProfile errorCode:").concat(e3, " groupID:").concat(t3, " timeoutIDs:").concat(this._timeoutIDs));
    } }, { key: "_clearTimeoutIDs", value: function() {
      this._timeoutIDs.forEach(function(e3) {
        e3 && clearTimeout(e3);
      }), this._timeoutIDs = [];
    } }, { key: "startMessageLongPolling", value: function(e3) {
      var t3, n3 = e3.groupID, o3 = e3.longPollingKey, e3 = e3.longPollingSequence, e3 = void 0 === e3 ? 1 : e3, i4 = this.get(12).isUnlimitedAVChatRoom();
      if (!S2(o3))
        return this._AVChatRoomHandler.hasPollingInstance(n3) && this.stopMessageLongPolling({ groupID: n3 }), t3 = this._AVChatRoomHandler.getJoinedLiveList(), !i4 && 0 < t3.length && this.stopMessageLongPolling({ groupID: t3[0] }), i4 = new qo({ groupID: n3, type: R2.GRP_LIVE }), M2.l("".concat(this._n, ".startMessageLongPolling groupID:").concat(n3, " longPollingKey:").concat(o3, " longPollingSequence:").concat(e3)), this._AVChatRoomHandler.startRunLoop({ group: i4, longPollingKey: o3, startSeq: e3 });
      index.__f__("warn", "at node_modules/@tencentcloud/chat/index.js:1", "".concat(this._n, ".startMessageLongPolling longPollingKey is empty."));
    } }, { key: "stopMessageLongPolling", value: function(e3) {
      var e3 = e3.groupID, t3 = this.get(11);
      return this._AVChatRoomHandler.reset(e3), this._deleteLocalGroup(e3), t3.deleteLocalConv("".concat(R2.CONV_GROUP).concat(e3)), M2.l("".concat(this._n, ".stopMessageLongPolling ok, groupID:").concat(e3)), D2({ groupID: e3 });
    } }, { key: "reset", value: function() {
      this.groupMap.clear(), this._unjoinedAVChatRoomList.clear(), this._receiptDetailCompleteMap.clear(), this._onlineMemberCountMap.clear(), this._commonGroupHandler.reset(), this._groupSystemNoticeHandler.reset(), this._groupTipsHandler.reset(), this._groupAttributesHandler.reset(), this._groupCountersHandler.reset(), this._AVChatRoomHandler.reset(), this._groupMemberHandler.reset(), this._clearTimeoutIDs();
    } }])), ii = ["topicID", "topicName", "avatar", "introduction", "notification", "unreadCount", "muteAllMembers", "customData", "groupAtInfoList", "nextMessageSeq", "selfInfo"], si = e2(function e3(t3, n3) {
      p3(this, e3), this.topicID = "", this.topicName = "", this.avatar = "", this.introduction = "", this.notification = "", this.unreadCount = 0, this.muteAllMembers = false, this.customData = "", this.groupAtInfoList = [], this.nextMessageSeq = 0, this.lastMessage = No(t3.lastMessage, n3), this.selfInfo = { muteTime: 0, readedSequence: 0, messageRemindType: "", excludedUnreadSequenceList: void 0 }, this._initTopic(t3);
    }, [{ key: "_initTopic", value: function(e3) {
      for (var t3 in e3)
        ii.indexOf(t3) < 0 || ("selfInfo" === t3 ? this.updateSelfInfo(e3[t3]) : this[t3] = "muteAllMembers" === t3 ? 1 === e3[t3] : e3[t3]);
    } }, { key: "updateUnreadCount", value: function() {
      this.unreadCount = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0;
    } }, { key: "updateNextMessageSeq", value: function(e3) {
      this.nextMessageSeq = e3;
    } }, { key: "updateLastMessage", value: function(e3) {
      this.lastMessage = No(e3);
    } }, { key: "updateGroupAtInfoList", value: function(e3) {
      this.groupAtInfoList = JSON.parse(JSON.stringify(e3));
    } }, { key: "updateTopic", value: function(e3) {
      N3(e3.selfInfo) || this.updateSelfInfo(e3.selfInfo), N3(e3.muteAllMembers) || (this.muteAllMembers = 1 === e3.muteAllMembers), dt2(this, e3, ["groupID", "lastMessageTime", "selfInfo", "muteAllMembers", "lastMsg"]);
    } }, { key: "updateSelfInfo", value: function(e3) {
      return 0 === dt2(this.selfInfo, e3, [], [""]);
    } }, { key: "reduceUnreadCount", value: function() {
      return 1 <= this.unreadCount && (--this.unreadCount, true);
    } }, { key: "isLastMessageRevoked", value: function(e3) {
      return e3.sequence === this.lastMessage.lastSequence;
    } }, { key: "setLastMessageRevoked", value: function(e3) {
      this.lastMessage.isRevoked = e3;
    } }, { key: "setLastMessageRevoker", value: function(e3) {
      this.lastMessage.revoker = e3;
    } }]), ai = (t2(mi, c2), e2(mi, [{ key: "_onCloudConfig", value: function() {
      var e3 = this.getCloudConfig("topic_cache_time"), t3 = this.getCloudConfig("topic_last_active_time");
      N3(e3) || (this.TOPIC_CACHE_TIME = Number(e3)), N3(t3) || (this.TOPIC_LAST_ACTIVE_TIME = Number(t3));
    } }, { key: "onTopicCreated", value: function(e3) {
      var t3 = e3.groupID;
      this.resetGetTopicTime(t3), this.emitOEvt(h2.TOPIC_CREATED, e3);
    } }, { key: "onTopicDeleted", value: function(e3) {
      var t3 = this, n3 = e3.groupID, o3 = e3.topicIDList;
      (void 0 === o3 ? [] : o3).forEach(function(e4) {
        t3._deleteLocalTopic(n3, e4);
      }), this.emitOEvt(h2.TOPIC_DELETED, e3);
    } }, { key: "onTopicProfileUpdated", value: function(e3) {
      var t3 = e3.groupID, n3 = e3.topicID, n3 = this.getLocalTopic(t3, n3);
      n3 && (n3.updateTopic(e3), this.emitOEvt(h2.TOPIC_UPDATED, { groupID: t3, topic: n3 }));
    } }, { key: "onTopicLatestMsg", value: function(e3) {
      var t3, n3, e3 = e3 || {}, o3 = e3.topicLatestMessage, e3 = e3.excludedUnreadSequenceList;
      S2(o3) || (t3 = o3.groupProfile.topicID, o3.conversationType = R2.CONV_GROUP, o3.to = t3, (n3 = new Do(o3)).setElement(o3.elements), this.updateUnreadCountAndLastMsg(t3, n3, e3));
    } }, { key: "onMessageRemindTypeUpdated", value: function(e3) {
      var t3, n3 = e3.groupID, o3 = e3.topicID, e3 = e3.messageRemindType, i4 = this.getLocalTopic(n3, o3);
      i4 && ((t3 = i4.updateSelfInfo({ messageRemindType: e3 })) && this.emitOEvt(h2.TOPIC_UPDATED, { groupID: n3, topic: i4 }), M2.l("".concat(this._n, ".onMessageRemindTypeUpdated topicID:").concat(o3, " messageRemindType:").concat(e3, " isUpdated:").concat(t3)));
    } }, { key: "onAtInfoUpdated", value: function(e3) {
      var t3 = e3.topicID, e3 = e3.groupAtInfoList, n3 = jt2(t3), t3 = this.getLocalTopic(n3, t3);
      t3 && !N3(e3) && (t3.updateGroupAtInfoList(e3), this.emitOEvt(h2.TOPIC_UPDATED, { groupID: n3, topic: t3 }));
    } }, { key: "onUnreadCountUpdatedFromConv", value: function(e3) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, n3 = jt2(e3), e3 = this.getLocalTopic(n3, e3);
      e3 && e3.unreadCount !== t3 && (e3.updateUnreadCount(t3), 0 === t3 && e3.updateSelfInfo({ readedSequence: e3.lastMessage.lastSequence }), this.emitOEvt(h2.TOPIC_UPDATED, { groupID: n3, topic: e3 }));
    } }, { key: "onMessageSent", value: function(e3) {
      var t3, n3, o3 = e3.groupID, i4 = e3.topicID, e3 = e3.lastMessage, i4 = this.getLocalTopic(o3, i4);
      i4 && (n3 = (t3 = void 0 === (t3 = e3.sequence) ? 0 : t3) + 1) > i4.nextMessageSeq && (i4.updateNextMessageSeq(n3), i4.updateLastMessage(e3), i4.updateSelfInfo({ readedSequence: t3 }), i4.updateUnreadCount(0), this.emitOEvt(h2.TOPIC_UPDATED, { groupID: o3, topic: i4 }));
    } }, { key: "onMessageModified", value: function(e3) {
      var t3, n3 = e3.to, o3 = e3.time, i4 = e3.sequence, s4 = e3.elements, a3 = e3.cloudCustomData, r4 = e3.messageVersion, c3 = jt2(n3), u3 = this.getLocalTopic(c3, n3);
      u3 && (t3 = u3.lastMessage, M2.d("".concat(this._n, ".onMessageModified topicID:").concat(n3, " lastMessage:"), JSON.stringify(t3), "options:", JSON.stringify(e3)), t3) && (null === t3.payload || t3.lastTime === o3 && t3.lastSequence === i4 && t3.version !== r4) && (t3.type = s4[0].type, t3.payload = s4[0].content, t3.messageForShow = Jt2(t3.type, t3.payload, this.isIntl()), t3.cloudCustomData = a3, t3.version = r4, t3.lastSequence = i4, t3.lastTime = o3, this.emitOEvt(h2.TOPIC_UPDATED, { groupID: c3, topic: u3 }));
    } }, { key: "onMessageRevoked", value: function(e3) {
      var n3, o3, i4, s4 = this;
      0 !== e3.length && (o3 = n3 = null, i4 = false, e3.forEach(function(e4) {
        var t3 = e4.to;
        o3 = jt2(t3), (n3 = s4.getLocalTopic(o3, t3)) && (n3.reduceUnreadCount() && (i4 = true), n3.isLastMessageRevoked(e4) && (n3.setLastMessageRevoked(true), n3.setLastMessageRevoker(e4.revoker), i4 = true), (t3 = n3.selfInfo.excludedUnreadSequenceList || []).push(e4.sequence), n3.updateSelfInfo({ excludedUnreadSequenceList: t3 }));
      }), i4) && this.emitOEvt(h2.TOPIC_UPDATED, { groupID: o3, topic: n3 });
    } }, { key: "isLastMessageRevoked", value: function(e3) {
      var t3 = e3.topicID, e3 = e3.sequence, n3 = jt2(t3), n3 = this.getLocalTopic(n3, t3), t3 = false;
      return t3 = n3 ? n3.isLastMessageRevoked({ sequence: e3 }) : t3;
    } }, { key: "updateUnreadCountAndLastMsg", value: function(e3, t3, n3) {
      var o3, i4 = jt2(e3), s4 = this.getLocalTopic(i4, e3);
      s4 && (o3 = s4.selfInfo.excludedUnreadSequenceList || [], N3(n3) || (o3 = n3), t3._isExcludedFromUnreadCount && o3.push(t3.sequence), s4.updateSelfInfo({ excludedUnreadSequenceList: o3 }), M2.l("".concat(this._n, ".updateUnreadCountAndLastMsg seq:").concat(t3.sequence, " lastSeq:").concat(s4.lastMessage.lastSequence)), t3.sequence > s4.lastMessage.lastSequence) && (s4.updateLastMessage(t3), n3 = t3.sequence + 1, s4.updateNextMessageSeq(n3), o3 = this._computeUnreadCount(s4), s4.updateUnreadCount(o3), (t3 = this.get(11).getLocalConversation("".concat(R2.CONV_GROUP).concat(e3))) && t3.updateUnreadCount({ nextUnreadCount: o3, isFromGetConversations: true }), this.emitOEvt(h2.TOPIC_UPDATED, { groupID: i4, topic: s4 }));
    } }, { key: "getJoinedCommunityList", value: function() {
      return this.get(7).syncCommunityWithTopic();
    } }, { key: "createTopicInCommunity", value: function(t3) {
      var n3, o3 = this, i4 = "".concat(this._n, ".").concat("createTopicInCommunity"), e3 = t3.topicID;
      return N3(e3) || Nt2(e3) ? t3.topicName && false === this._filterProfanity("topicName", t3) || t3.introduction && false === this._filterProfanity("introduction", t3) || t3.notification && false === this._filterProfanity("notification", t3) ? E2({ code: k2.PROFANITY_FOUND }) : (n3 = new P2("createTopicInCommunity"), this.req({ P: G2.CREATE_TOPIC, data: y2({}, t3) }).then(function(e4) {
        e4 = e4.data.topicID;
        return n3.setMessage("topicID:".concat(e4)).end(), M2.l("".concat(i4, " ok. topicID:").concat(e4)), o3._updateTopicMap([y2(y2({}, t3), {}, { topicID: e4 })]), T2({ topicID: e4 });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : E2({ code: k2.ILLEGAL_TOPIC_ID });
    } }, { key: "deleteTopicFromCommunity", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("deleteTopicFromCommunity"), s4 = e3.groupID, e3 = e3.topicIDList, e3 = void 0 === e3 ? [] : e3, a3 = new P2("deleteTopicFromCommunity");
      return a3.setMessage("groupID:".concat(s4, " topicIDList:").concat(e3)), this.req({ P: G2.DEL_TOPIC, data: { groupID: s4, topicIDList: e3 } }).then(function(e4) {
        var e4 = e4.data.resultList, o3 = [], i4 = [], e4 = ((void 0 === e4 ? [] : e4).forEach(function(e5) {
          var t4 = e5.topicID, n4 = e5.errorCode, e5 = e5.errorInfo;
          0 === n4 ? o3.push({ topicID: t4 }) : i4.push({ topicID: t4, code: n4, message: e5 });
        }), "success count:".concat(o3.length, ", fail count:").concat(i4.length));
        return a3.setMoreMessage(e4).end(), M2.l("".concat(n3, " ok. ").concat(e4)), o3.forEach(function(e5) {
          t3._deleteLocalTopic(s4, e5.topicID);
        }), T2({ successTopicList: o3, failureTopicList: i4 });
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "updateTopicProfile", value: function(e3) {
      var t3, n3 = this, o3 = "".concat(this._n, ".").concat("updateTopicProfile");
      return M2.l("".concat(o3, " options:"), e3), e3.topicName && false === this._filterProfanity("topicName", e3) || e3.introduction && false === this._filterProfanity("introduction", e3) || e3.notification && false === this._filterProfanity("notification", e3) ? E2({ code: k2.PROFANITY_FOUND }) : ((t3 = new P2("updateTopicProfile")).setMessage("groupID:".concat(e3.groupID, " topicID:").concat(e3.topicID)), N3(e3.muteAllMembers) || (e3.muteAllMembers = true === e3.muteAllMembers ? "On" : "Off"), this.req({ P: G2.UPDATE_TOPIC_PROFILE, data: y2({}, e3) }).then(function() {
        return t3.end(), M2.l("".concat(o3, " ok")), n3._updateTopicMap([e3]), T2({ topic: n3.getLocalTopic(e3.groupID, e3.topicID) });
      }).catch(function(e4) {
        return t3.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "getTopicList", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("getTopicList"), o3 = e3.groupID, e3 = e3.topicIDList, e3 = void 0 === e3 ? [] : e3, i4 = 0 === e3.length, c3 = new P2("getTopicList");
      if (c3.setMessage("groupID:".concat(o3)), this._getTopicTimeMap.has(o3)) {
        var s4 = this._getTopicTimeMap.get(o3), a3 = s4.isGetAll, s4 = s4.time;
        if ((a3 || !a3 && !i4) && Date.now() - s4 < 1e3 * this.TOPIC_CACHE_TIME) {
          a3 = this._getLocalTopicList(o3, e3);
          if (i4 || a3.length === e3.length)
            return c3.setMoreMessage("from cache, topic count:".concat(a3.length)).end(), M2.l("".concat(n3, " groupID:").concat(o3, " from cache, topic count:").concat(a3.length)), D2({ successTopicList: a3, failureTopicList: [] });
        }
      }
      return this.req({ P: G2.GET_TOPIC_LIST, data: { groupID: o3, topicIDList: e3 } }).then(function(e4) {
        var e4 = e4.data.topicInfoList, s5 = [], a4 = [], r4 = [], e4 = ((void 0 === e4 ? [] : e4).forEach(function(e5) {
          var t4 = e5.topic, n4 = e5.selfInfo, o4 = e5.errorCode, e5 = e5.errorInfo, i5 = t4.topicID;
          0 === o4 ? (s5.push(y2(y2({}, t4), {}, { selfInfo: n4 })), a4.push(i5)) : r4.push({ topicID: i5, code: o4, message: e5 });
        }), t3._updateTopicMap(s5), t3._handleTopicAtInfo(s5), "success count:".concat(a4.length, ", fail count:").concat(r4.length)), e4 = (c3.setMoreMessage(e4).end(), M2.l("".concat(n3, " groupID:").concat(o3, " from remote, ").concat(e4)), []);
        return S2(a4) || (t3._getTopicTimeMap.set(o3, { time: Date.now(), isGetAll: i4 }), e4 = t3._getLocalTopicList(o3, a4)), T2({ successTopicList: e4, failureTopicList: r4 });
      }).catch(function(e4) {
        return c3.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "hasLocalTopic", value: function(e3, t3) {
      return !!this._topicMap.has(e3) && this._topicMap.get(e3).has(t3);
    } }, { key: "getLocalTopic", value: function(e3, t3) {
      var n3 = null;
      return n3 = this._topicMap.has(e3) ? this._topicMap.get(e3).get(t3) : n3;
    } }, { key: "_getLocalTopicList", value: function(e3) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : [], e3 = this._topicMap.get(e3), n3 = [];
      return e3 && (n3 = d2(e3.values())), 0 === t3.length ? n3 : n3.filter(function(e4) {
        return t3.includes(e4.topicID);
      });
    } }, { key: "_deleteLocalTopic", value: function(e3, t3) {
      this._topicMap.has(e3) && this._topicMap.get(e3).has(t3) && (this._topicMap.get(e3).delete(t3), M2.l("".concat(this._n, "._deleteLocalTopic groupID:").concat(e3, " topicID:").concat(t3)));
    } }, { key: "_updateTopicMap", value: function(e3) {
      var i4 = this, s4 = [];
      e3.forEach(function(e4) {
        var t3 = e4.groupID, n3 = e4.topicID, o3 = null, e4 = (i4._topicMap.has(t3) || i4._topicMap.set(t3, /* @__PURE__ */ new Map()), i4._topicMap.get(t3).has(n3) ? (o3 = i4._topicMap.get(t3).get(n3)).updateTopic(e4) : (i4._getTopicLastMessage(e4), o3 = new si(e4, i4.isIntl()), i4._topicMap.get(t3).set(n3, o3)), i4._computeUnreadCount(o3));
        o3.updateUnreadCount(e4), s4.push({ conversationID: "".concat(R2.CONV_GROUP).concat(n3), type: R2.CONV_TOPIC, unreadCount: e4 });
      }), 0 < s4.length && this.get(11).updateTopicConversation(s4);
    } }, { key: "resetGetTopicTime", value: function(e3) {
      var t3 = this;
      N3(e3) ? d2(this._getTopicTimeMap.keys()).forEach(function(e4) {
        t3._getTopicTimeMap.set(e4, 0);
      }) : this._getTopicTimeMap.set(e3, 0);
    } }, { key: "getTopicListOnReconnected", value: function() {
      var o3 = this, e3 = d2(this._topicMap.keys()), i4 = [], s4 = this.get(11);
      e3.forEach(function(e4) {
        var n3 = [], t3 = o3._getLocalTopicList(e4);
        s4.deleteTopicRoamingInfo(e4), t3.forEach(function(e5) {
          var t4 = e5.lastMessage.lastTime, t4 = void 0 === t4 ? 0 : t4;
          Date.now() - 1e3 * t4 < 1e3 * o3.TOPIC_LAST_ACTIVE_TIME && n3.push(e5.topicID);
        }), 0 < n3.length && i4.push({ groupID: e4, topicIDList: n3 });
      }), M2.l("".concat(this._n, ".getTopicListOnReconnected. active community count:").concat(i4.length)), this._relayGetTopicList(i4);
    } }, { key: "_relayGetTopicList", value: function(t3) {
      var e3, n3, o3, i4 = this;
      0 !== t3.length && (n3 = 5 < (e3 = t3.shift()).topicIDList.length ? "topicIDList.length:".concat(e3.topicIDList.length) : "topicIDList:".concat(e3.topicIDList), (o3 = new P2("relayGetTopicList")).setMessage(n3), M2.l("".concat(this._n, "._relayGetTopicList. ").concat(n3)), this.getTopicList(e3).then(function() {
        o3.end(), i4._relayGetTopicList(t3);
      }).catch(function(e4) {
        o3.setError(e4).end(), i4._relayGetTopicList(t3);
      }));
    } }, { key: "_handleTopicAtInfo", value: function(e3) {
      var i4 = this;
      0 !== e3.length && e3.forEach(function(e4) {
        var t3 = e4.groupID, n3 = e4.topicID, e4 = e4.groupAtInfoList, o3 = [];
        N3(e4) || (e4.forEach(function(e5) {
          o3.push(y2(y2({}, e5), {}, { groupID: t3, topicID: n3 }));
        }), i4.get(11).onNewGroupAtTips({ dataList: o3 }));
      });
    } }, { key: "_getTopicLastMessage", value: function(e3) {
      var t3;
      N3(e3.lastMsg) || (t3 = { time: e3.lastMsg.time, sequence: e3.lastMsg.sequence, from: e3.lastMsg.from, payload: e3.lastMsg.elements[0] ? e3.lastMsg.elements[0].content : null, type: e3.lastMsg.elements[0] ? e3.lastMsg.elements[0].type : "", nick: e3.lastMsg.nick, avatar: e3.lastMsg.avatar, version: e3.lastMsg.messageVersion, cloudCustomData: e3.lastMsg.cloudCustomData, isRevoked: 2 === e3.lastMsg.isPlaceMessage, revoker: S2(e3.lastMsg.revokerInfo) ? null : e3.lastMsg.revokerInfo.revoker }, e3.lastMessage = t3);
    } }, { key: "deleteTopicListInCommunity", value: function(t3) {
      var n3 = this, e3 = this._getLocalTopicList(t3), o3 = this.get(11);
      e3.forEach(function(e4) {
        e4 = e4.topicID;
        n3._deleteLocalTopic(t3, e4), n3._getTopicTimeMap.delete(t3), o3.deleteLocalConv("".concat(R2.CONV_GROUP).concat(e4));
      });
    } }, { key: "_computeUnreadCount", value: function(t3) {
      var n3, e3 = t3.selfInfo, o3 = e3.excludedUnreadSequenceList, i4 = e3.readedSequence, e3 = t3.nextMessageSeq - t3.selfInfo.readedSequence - 1;
      return O2(o3) && (n3 = 0, o3.forEach(function(e4) {
        i4 < e4 && e4 <= t3.nextMessageSeq - 1 && (n3 += 1);
      }), 1 <= n3) && (e3 -= n3), e3 < 0 ? 0 : e3;
    } }, { key: "_filterProfanity", value: function(e3, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e3], ae2)).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e3] = o3, true));
    } }, { key: "getMessageExtensions", value: function(e3, t3) {
      M2.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t3));
      var n3 = jt2(e3.to);
      return this.req({ P: G2.GET_GRP_MSG_EXT, data: { groupID: n3, topicID: e3.to, messageSequence: e3.sequence, startSequence: t3 } });
    } }, { key: "modifyMsgExts", value: function(e3, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1, o3 = (M2.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n3)), jt2(e3.to));
      return this.req({ P: G2.MODIFY_GRP_MSG_EXT, data: { groupID: o3, topicID: e3.to, messageSequence: e3.sequence, extensionList: t3, operateType: n3 } });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._topicMap.clear(), this._getTopicTimeMap.clear(), this.TOPIC_CACHE_TIME = 300, this.TOPIC_LAST_ACTIVE_TIME = 3600;
    } }])), ri = e2(function e3(t3) {
      p3(this, e3), this._userM = t3, this._n = "ProfileHandler", this.TAG = "profile", this.accountProfileMap = /* @__PURE__ */ new Map(), this.expirationTime = 864e5;
    }, [{ key: "setExpirationTime", value: function(e3) {
      this.expirationTime = e3;
    } }, { key: "getUserProfile", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("getUserProfile"), o3 = e3.userIDList;
      e3.fromAccount = this._userM.getMyAccount(), 100 < o3.length && (M2.w("".concat(n3, " ").concat(Qt2(100))), o3.length = 100);
      for (var i4, s4 = [], a3 = [], r4 = 0, c3 = o3.length; r4 < c3; r4++)
        i4 = o3[r4], this._userM.isMyFriend(i4) && this._contains(i4) ? a3.push(this._getProfileFromMap(i4)) : s4.push(i4);
      if (0 === s4.length)
        return D2(a3);
      e3.toAccount = s4;
      var u3 = e3.bFromGetMyProfile || false, l3 = [], d3 = (e3.toAccount.forEach(function(e4) {
        l3.push({ toAccount: e4, standardSequence: 0, customSequence: 0 });
      }), e3.userItem = l3, new P2("getUserProfile"));
      return d3.setMessage(5 < o3.length ? "userIDList.length:".concat(o3.length) : "userIDList:".concat(o3)), this._userM.req({ P: G2.GET_USER_PROFILE, data: e3 }).then(function(e4) {
        d3.end(), M2.i("".concat(n3, " ok"));
        e4 = t3._handleResponse(e4).concat(a3);
        return T2(u3 ? e4[0] : e4);
      }).catch(function(e4) {
        return d3.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "getMyProfile", value: function() {
      var e3, t3 = this._userM.getMyAccount(), n3 = "".concat(this._n, ".getMyProfile");
      return M2.l("".concat(n3, " myAccount:").concat(t3)), this._fill(), this._contains(t3) ? (e3 = this._getProfileFromMap(t3), M2.d("".concat(n3, " from cache, myProfile:").concat(JSON.stringify(e3))), D2(e3)) : this.getUserProfile({ fromAccount: t3, userIDList: [t3], bFromGetMyProfile: true });
    } }, { key: "_handleResponse", value: function(e3) {
      var t3 = e3.data.userProfileItem;
      if (!O2(t3))
        return [];
      for (var n3 = [], e3 = Date.now(), o3 = 0, i4 = t3.length; o3 < i4; o3++) {
        var s4 = t3[o3], a3 = s4.to, s4 = s4.profileItem;
        "@TLS#NOT_FOUND" !== a3 && "" !== a3 && (a3 = this._update(a3, this._getLatestProfileFromResponse(a3, s4)).latestProfile, n3.push(a3));
      }
      return M2.l("".concat(this._n, "._handleResponse cost:").concat(tn(e3))), n3;
    } }, { key: "_getLatestProfileFromResponse", value: function(e3, t3) {
      var n3 = { userID: e3, profileCustomField: [] };
      if (!S2(t3))
        for (var o3 = 0, i4 = t3.length; o3 < i4; o3++)
          if (-1 < t3[o3].tag.indexOf("Tag_Profile_Custom"))
            n3.profileCustomField.push({ key: t3[o3].tag, value: t3[o3].value });
          else
            switch (t3[o3].tag) {
              case f2.NICK:
                n3.nick = t3[o3].value;
                break;
              case f2.GENDER:
                n3.gender = t3[o3].value;
                break;
              case f2.BIRTHDAY:
                n3.birthday = t3[o3].value;
                break;
              case f2.LOCATION:
                n3.location = t3[o3].value;
                break;
              case f2.SELFSIGNATURE:
                n3.selfSignature = t3[o3].value;
                break;
              case f2.ALLOWTYPE:
                n3.allowType = t3[o3].value;
                break;
              case f2.LANGUAGE:
                n3.language = t3[o3].value;
                break;
              case f2.AVATAR:
                n3.avatar = t3[o3].value;
                break;
              case f2.MESSAGESETTINGS:
                n3.messageSettings = t3[o3].value;
                break;
              case f2.ADMINFORBIDTYPE:
                n3.adminForbidType = t3[o3].value;
                break;
              case f2.LEVEL:
                n3.level = t3[o3].value;
                break;
              case f2.ROLE:
                n3.role = t3[o3].value;
                break;
              default:
                M2.w("".concat(this._n, "._getLatestProfileFromResponse unknown tag:"), t3[o3].tag, t3[o3].value);
            }
      return n3;
    } }, { key: "updateMyProfile", value: function(o3) {
      var i4 = this, s4 = "".concat(this._n, ".").concat("updateMyProfile");
      if (o3.nick && false === this._userM.filterProfanity("nick", o3))
        return E2({ code: k2.PROFANITY_FOUND });
      if (o3.selfSignature && false === this._userM.filterProfanity("selfSignature", o3))
        return E2({ code: k2.PROFANITY_FOUND });
      var a3 = new P2("updateMyProfile"), e3 = (a3.setMessage(JSON.stringify(o3)), new bo().validate(o3));
      if (!e3.valid)
        return a3.setCode(k2.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(e3.tips)).end(), M2.e("".concat(s4, " info:").concat(e3.tips)), E2({ code: k2.UPDATE_PROFILE_INVALID_PARAM });
      var t3, r4, n3 = [];
      for (t3 in o3)
        Object.prototype.hasOwnProperty.call(o3, t3) && ("profileCustomField" === t3 ? o3.profileCustomField.forEach(function(e4) {
          n3.push({ tag: e4.key, value: e4.value });
        }) : n3.push({ tag: f2[t3.toUpperCase()], value: o3[t3] }));
      return 0 === n3.length ? (e3 = new L2({ code: k2.UPDATE_PROFILE_NO_KEY }), a3.setError(e3).end(), M2.e("".concat(s4, " failed. error:"), e3), E2(e3)) : (r4 = this._userM.getMyAccount(), this._userM.req({ P: G2.UPDATE_MY_PROFILE, data: { fromAccount: r4, profileItem: n3 } }).then(function(e4) {
        a3.end(), M2.i("".concat(s4, " ok"));
        var t4 = i4._update(r4, o3), n4 = t4.isProfileUpdated, t4 = t4.latestProfile;
        return true === n4 && i4._userM.emitOEvt(h2.PROFILE_UPDATED, [t4]), D2(t4);
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(s4, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "onProfileModified", value: function(e3) {
      var t3 = e3.dataList;
      if (!S2(t3)) {
        var n3 = t3.length;
        M2.d("".concat(this._n, ".onProfileModified count:").concat(n3, " dataList:"), e3.dataList);
        for (var o3 = [], i4 = 0; i4 < n3; i4++) {
          var s4 = t3[i4].userID, s4 = this._update(s4, this._getLatestProfileFromResponse(s4, t3[i4].profileList)), a3 = s4.isProfileUpdated, s4 = s4.latestProfile;
          true === a3 && o3.push(s4);
        }
        0 < o3.length && (this._userM.emitIEvt(U2.PROFILE_UPDATED, o3), this._userM.emitOEvt(h2.PROFILE_UPDATED, o3));
      }
    } }, { key: "_fill", value: function() {
      if (0 === this.accountProfileMap.size) {
        for (var e3 = this._getCachedProfiles(), t3 = Date.now(), n3 = 0, o3 = e3.length; n3 < o3; n3++)
          t3 - e3[n3].lastUpdatedTime < this.expirationTime && this.accountProfileMap.set(e3[n3].userID, e3[n3]);
        M2.l("".concat(this._n, "._fill from cache, size:").concat(this.accountProfileMap.size));
      }
    } }, { key: "_update", value: function(e3, t3) {
      var n3, o3 = false, i4 = Date.now();
      return this._contains(e3) ? (n3 = this._getProfileFromMap(e3), t3.profileCustomField && true === Lt2(n3.profileCustomField, t3.profileCustomField) && (n3.lastUpdatedTime = i4, o3 = true), 0 < dt2(n3, t3, ["profileCustomField"]) && (n3.lastUpdatedTime = i4, o3 = true)) : (n3 = new bo(t3), !this._userM.isMyFriend(e3) && e3 !== this._userM.getMyAccount() || (n3.lastUpdatedTime = i4, o3 = true, this.accountProfileMap.set(e3, n3))), this._flush(e3 === this._userM.getMyAccount()), true === o3 && M2.l("".concat(this._n, "._update account:").concat(e3, " isUpdated:").concat(o3)), { isProfileUpdated: o3, latestProfile: n3 };
    } }, { key: "_flush", value: function(e3) {
      var t3 = d2(this.accountProfileMap.values()), n3 = this._userM.getStorageModule();
      M2.d("".concat(this._n, "._flush length:").concat(t3.length, " flushAtOnce:").concat(e3)), n3.setItem(this.TAG, t3, e3);
    } }, { key: "_contains", value: function(e3) {
      return this.accountProfileMap.has(e3);
    } }, { key: "_getProfileFromMap", value: function(e3) {
      return this.accountProfileMap.get(e3);
    } }, { key: "_getCachedProfiles", value: function() {
      var e3 = this._userM.getStorageModule().getItem(this.TAG);
      return S2(e3) ? [] : e3;
    } }, { key: "onConvProfileUpdated", value: function(e3) {
      for (var t3, n3, o3, i4 = [], s4 = 0, a3 = e3.length; s4 < a3; s4++)
        n3 = (t3 = e3[s4]).userID, this._userM.isMyFriend(n3) && (this._contains(n3) ? (o3 = this._getProfileFromMap(n3), 0 < dt2(o3, t3) && i4.push(n3)) : i4.push(t3.userID));
      0 !== i4.length && (M2.l("".concat(this._n, ".onConvProfileUpdated toAccountList:").concat(i4)), this.getUserProfile({ userIDList: i4 }));
    } }, { key: "getNickAndAvatarByUserID", value: function(e3) {
      return this._contains(e3) ? { nick: (e3 = this._getProfileFromMap(e3)).nick, avatar: e3.avatar } : { nick: "", avatar: "" };
    } }, { key: "getUserNickAndAvatar", value: function(e3) {
      var t3, n3 = this, o3 = d2(new Set(e3)), i4 = (M2.l("".concat(this._n, ".getUserNickAndAvatar userIDList.length:").concat(e3.length, " uniqueUserIDList.length:").concat(o3.length)), []);
      return 0 === e3.length ? Promise.resolve(i4) : (e3 = this._createUserIDListGroup(o3), t3 = [], e3.forEach(function(e4) {
        t3.push(n3.getUserProfile({ userIDList: e4 }));
      }), Promise.all(t3).then(function(e4) {
        return e4.forEach(function(e5) {
          e5 = e5.data.map(function(e6) {
            return { userID: e6.userID, nick: e6.nick, avatar: e6.avatar };
          });
          i4.push.apply(i4, d2(e5));
        }), i4;
      }));
    } }, { key: "_createUserIDListGroup", value: function(e3) {
      for (var t3 = [], n3 = 0; n3 < e3.length; )
        t3.push(e3.slice(n3, n3 += 100));
      return t3;
    } }, { key: "reset", value: function() {
      this._flush(true), this.accountProfileMap.clear();
    } }]), ci = e2(function e3(t3) {
      p3(this, e3);
    }), ui = e2(function e3(t3) {
      p3(this, e3), this._userM = t3, this._n = "BlacklistHandler", this._blacklistMap = /* @__PURE__ */ new Map(), this._startIndex = 0;
    }, [{ key: "getLocalBlacklist", value: function() {
      return d2(this._blacklistMap.keys());
    } }, { key: "getBlacklist", value: function() {
      var o3 = this, i4 = "".concat(this._n, ".getBlacklist"), e3 = { fromAccount: this._userM.getMyAccount(), maxLimited: 100, startIndex: this._startIndex }, s4 = new P2("getBlacklist");
      return this._userM.req({ P: G2.GET_BL, data: e3 }).then(function(e4) {
        var e4 = e4.data, t3 = e4.blackListItem, e4 = e4.startIndex, n3 = S2(t3) ? 0 : t3.length;
        s4.setMessage("count:".concat(n3)).end(), M2.i("".concat(i4, " ok")), o3._startIndex = e4, o3._handleResponse(t3, true), o3._userM.emitOEvt(h2.BLACKLIST_UPDATED, d2(o3._blacklistMap.keys())), 0 !== o3._startIndex && o3.getBlacklist();
      }).catch(function(e4) {
        return s4.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "addBlacklist", value: function(t3) {
      var e3, n3, o3 = this, i4 = new P2("addToBlacklist"), s4 = "".concat(this._n, ".addBlacklist"), a3 = this._userM.getMyAccount();
      return 1 === t3.userIDList.length && t3.userIDList[0] === a3 ? (n3 = this._userM.getErrMsg(e3 = k2.CANNOT_ADD_SELF_TO_BLACKLIST), i4.setCode(e3).setMessage(n3).end(), n3 = new L2({ code: e3 }), M2.e("".concat(s4, " failed. error:"), n3), E2(n3)) : (t3.userIDList.includes(a3) && (t3.userIDList = t3.userIDList.filter(function(e4) {
        return e4 !== a3;
      })), t3.fromAccount = this._userM.getMyAccount(), t3.toAccount = t3.userIDList, this._userM.req({ P: G2.ADD_TO_BL, data: t3 }).then(function(e4) {
        return i4.setMessage(5 < t3.userIDList.length ? "userIDList.length:".concat(t3.userIDList.length) : "userIDList:".concat(t3.userIDList)).end(), M2.i("".concat(s4, " ok")), o3._handleResponse(e4.resultItem, true), T2(d2(o3._blacklistMap.keys()));
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.e("".concat(s4, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "_handleResponse", value: function(e3, t3) {
      if (!S2(e3))
        for (var n3, o3, i4, s4 = 0, a3 = e3.length; s4 < a3; s4++)
          o3 = e3[s4].to, i4 = e3[s4].resultCode, !N3(i4) && 0 !== i4 || (t3 ? ((n3 = this._blacklistMap.has(o3) ? this._blacklistMap.get(o3) : new ci()).userID = o3, S2(e3[s4].addBlackTimeStamp) || (n3.timeStamp = e3[s4].addBlackTimeStamp), this._blacklistMap.set(o3, n3)) : this._blacklistMap.has(o3) && (n3 = this._blacklistMap.get(o3), this._blacklistMap.delete(o3)));
      M2.l("".concat(this._n, "._handleResponse total:").concat(this._blacklistMap.size, " bAdd:").concat(t3));
    } }, { key: "deleteBlacklist", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".deleteBlacklist"), i4 = new P2("removeFromBlacklist");
      return t3.fromAccount = this._userM.getMyAccount(), t3.toAccount = t3.userIDList, this._userM.req({ P: G2.RM_FROM_BL, data: t3 }).then(function(e3) {
        return i4.setMessage(5 < t3.userIDList.length ? "userIDList.length:".concat(t3.userIDList.length) : "userIDList:".concat(t3.userIDList)).end(), M2.i("".concat(o3, " ok")), n3._handleResponse(e3.data.resultItem, false), T2(d2(n3._blacklistMap.keys()));
      }).catch(function(e3) {
        return i4.setError(e3).end(), M2.e("".concat(o3, " failed. error:"), e3), E2(e3);
      });
    } }, { key: "onAccountDeleted", value: function(e3) {
      for (var t3 = 0, n3 = e3.length; t3 < n3; t3++) {
        var o3 = e3[t3];
        this._blacklistMap.has(o3) && this._blacklistMap.delete(o3);
      }
      var i4 = e3.length;
      0 < i4 && (M2.l("".concat(this._n, ".onAccountDeleted count:").concat(i4, " ").concat(i4 < 30 ? "userIDList:".concat(e3) : "")), this._userM.emitOEvt(h2.BLACKLIST_UPDATED, d2(this._blacklistMap.keys())));
    } }, { key: "onAccountAdded", value: function(e3) {
      for (var t3, n3 = [], o3 = 0, i4 = e3.length; o3 < i4; o3++)
        t3 = e3[o3], this._blacklistMap.has(t3) || (this._blacklistMap.set(t3, new ci({ userID: t3 })), n3.push(t3));
      0 < n3.length && (M2.l("".concat(this._n, ".onAccountAdded count:").concat(n3.length, " userIDList:"), n3), this._userM.emitOEvt(h2.BLACKLIST_UPDATED, d2(this._blacklistMap.keys())));
    } }, { key: "reset", value: function() {
      this._blacklistMap.clear(), this._startIndex = 0;
    } }]), li = e2(function e3(t3) {
      p3(this, e3), this._userM = t3, this._n = "UserStatusHandler", this.MAX_QUERY_USER_COUNT = 500, this.MAX_SUBSCRIBE_USER_COUNT = 100, this.MAX_UNSUBSCRIBE_USER_COUNT = 100, this._userM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e3 = this._userM.getCloudConfig("status_query_count"), t3 = this._userM.getCloudConfig("status_sub_count"), n3 = this._userM.getCloudConfig("status_unsub_count");
      M2.l("".concat(this._n, "._onCloudConfig statusQueryCount:").concat(e3, " statusSubscribeCount:").concat(t3) + " statusUnsubscribeCount:".concat(n3)), N3(e3) || (this.MAX_QUERY_USER_COUNT = parseInt(e3, 10)), N3(e3) || (this.MAX_SUBSCRIBE_USER_COUNT = parseInt(t3, 10)), N3(e3) || (this.MAX_UNSUBSCRIBE_USER_COUNT = parseInt(n3, 10));
    } }, { key: "onUserStatusUpdated", value: function(e3) {
      var e3 = e3.dataList, o3 = this._userM.getMyUserID(), i4 = this._userM.get(12), e3 = e3.map(function(e4) {
        var t3 = e4.to, n3 = e4.statusType, e4 = e4.customStatus, e4 = Go(e4);
        return t3 === o3 && i4.setCustomStatus(e4), { userID: t3, statusType: n3, customStatus: e4 };
      });
      M2.l("".concat(this._n, ".onUserStatusUpdated list:").concat(JSON.stringify(e3))), this._userM.emitOEvt(h2.USER_STATUS_UPDATED, e3);
    } }, { key: "setSelfStatus", value: function(e3) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".setSelfStatus");
      return false === this._userM.filterProfanity("customStatus", e3) ? E2({ code: k2.PROFANITY_FOUND }) : (t3 = new P2("setSelfStatus"), n3 = e3.customStatus, this._userM.req({ P: G2.SET_SELF_STATUS, data: { customStatus: n3 } }).then(function(e4) {
        return t3.setMessage("customStatus:".concat(n3)).end(), M2.l("".concat(i4, " ok. customStatus:").concat(n3)), o3._userM.get(12).setCustomStatus(n3), T2({ userID: o3._userM.getMyUserID(), statusType: 1, customStatus: n3 });
      }).catch(function(e4) {
        return t3.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "getUserStatus", value: function(e3) {
      var o3 = "".concat(this._n, ".").concat("getUserStatus"), e3 = e3.userIDList, i4 = void 0 === e3 ? [] : e3, e3 = this._userM.getMyUserID(), t3 = d2(i4), s4 = void 0, n3 = t3.indexOf(e3);
      if (-1 < n3 && (t3.splice(n3, 1), s4 = { userID: e3, statusType: 1, customStatus: this._userM.get(12).getCustomStatus() }), 0 === t3.length)
        return D2({ successUserList: [s4], failureUserList: [] });
      if (!this._userM.canIUse(g2.USER_STATUS))
        return this._userM.noUse("getUserStatus");
      t3.length > this.MAX_QUERY_USER_COUNT && (M2.w("".concat(o3, " ").concat(Qt2(this.MAX_QUERY_USER_COUNT))), t3 = i4.slice(0, this.MAX_QUERY_USER_COUNT));
      var a3 = new P2("getUserStatus");
      return this._userM.req({ P: G2.GET_USER_STATUS, data: { userIDList: t3 } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.successUserList, t4 = void 0 === t4 ? [] : t4, e4 = e4.failureUserList, e4 = void 0 === e4 ? [] : e4, t4 = t4.map(function(e5) {
          var t5 = e5.userID, n5 = e5.statusType, e5 = e5.customStatus;
          return { userID: t5, statusType: n5, customStatus: Go(e5) };
        }), e4 = e4.map(function(e5) {
          var t5 = e5.userID, n5 = e5.invalidUserID, o4 = e5.errorCode, e5 = e5.errorInfo;
          return { userID: S2(n5) ? t5 : n5, code: o4, message: e5 };
        }), n4 = (N3(s4) || t4.unshift(s4), "userID count:".concat(i4.length, ", success count:").concat(t4.length, ", fail count:").concat(e4.length));
        return a3.setMessage("".concat(n4)).end(), M2.l("".concat(o3, " ok. ").concat(n4, ".")), T2({ successUserList: t4, failureUserList: e4 });
      }).catch(function(e4) {
        return a3.setMessage("userID count:".concat(i4.length)).setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "subscribeUserStatus", value: function(e3) {
      var t3, n3, o3, i4, s4 = "subscribeUserStatus";
      return this._userM.canIUse(g2.USER_STATUS) ? (t3 = "".concat(this._n, ".").concat(s4), (n3 = d2(e3 = void 0 === (e3 = e3.userIDList) ? [] : e3)).length > this.MAX_SUBSCRIBE_USER_COUNT && (M2.w("".concat(t3, " ").concat(Qt2(this.MAX_SUBSCRIBE_USER_COUNT))), n3 = e3.slice(0, this.MAX_SUBSCRIBE_USER_COUNT)), o3 = new P2(s4), i4 = "userID count:".concat(e3.length), M2.l("".concat(t3, " ").concat(i4)), this._userM.req({ P: G2.SUB_USER_STATUS, data: { userIDList: n3 } }).then(function(e4) {
        e4 = e4.data.failureUserList, e4 = (void 0 === e4 ? [] : e4).map(function(e5) {
          var t4 = e5.userID, n4 = e5.invalidUserID, o4 = e5.errorCode, e5 = e5.errorInfo;
          return { userID: S2(n4) ? t4 : n4, code: o4, message: e5 };
        });
        return o3.setMessage("".concat(i4, " fail count:").concat(e4.length)).end(), M2.l("".concat(t3, " ok. fail count:").concat(e4.length, ".")), T2({ failureUserList: e4 });
      }).catch(function(e4) {
        return o3.setMessage(i4).setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this._userM.noUse(s4);
    } }, { key: "unsubscribeUserStatus", value: function(e3) {
      var t3, n3, o3, i4, s4 = "unsubscribeUserStatus";
      return this._userM.canIUse(g2.USER_STATUS) ? (t3 = "".concat(this._n, ".").concat(s4), n3 = d2(e3 = void 0 === (e3 = (e3 || {}).userIDList) ? [] : e3), e3.length > this.MAX_UNSUBSCRIBE_USER_COUNT && (M2.w("".concat(t3, " ").concat(Qt2(this.MAX_UNSUBSCRIBE_USER_COUNT))), n3 = e3.slice(0, this.MAX_UNSUBSCRIBE_USER_COUNT)), o3 = new P2(s4), i4 = "userID count:".concat(e3.length), M2.l("".concat(t3, " ").concat(i4)), e3 = { userIDList: n3 }, 0 === n3.length && (e3.userIDList = void 0, e3.unsubscribeAll = 1), this._userM.req({ P: G2.UNSUB_USER_STATUS, data: e3 }).then(function(e4) {
        e4 = e4.data.failureUserList, e4 = (void 0 === e4 ? [] : e4).map(function(e5) {
          var t4 = e5.userID, n4 = e5.invalidUserID, o4 = e5.errorCode, e5 = e5.errorInfo;
          return { userID: S2(n4) ? t4 : n4, code: o4, message: e5 };
        });
        return o3.setMessage("".concat(i4, " fail count:").concat(e4.length)).end(), M2.l("".concat(t3, " ok. fail count:").concat(e4.length, ".")), T2({ failureUserList: e4 });
      }).catch(function(e4) {
        return o3.setMessage("".concat(i4)).setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this._userM.noUse(s4);
    } }, { key: "reset", value: function() {
      this.MAX_QUERY_USER_COUNT = 500, this.MAX_SUBSCRIBE_USER_COUNT = 100, this.MAX_UNSUBSCRIBE_USER_COUNT = 100;
    } }]), di = (t2(fi, c2), e2(fi, [{ key: "onContextUpdated", value: function(e3) {
      this._profileHandler.getMyProfile(), this._blacklistHandler.getBlacklist();
    } }, { key: "mockOnNickAvatarModified", value: function(e3, t3) {
      M2.l("".concat(this._n, "._mockOnNickAvatarModified nick:").concat(e3, " avatar:").concat(t3)), this.onProfileModified({ dataList: [{ pushType: 1, userID: this.getMyUserID(), profileList: [{ tag: f2.NICK, value: e3 }, { tag: f2.AVATAR, value: t3 }] }] });
    } }, { key: "onProfileModified", value: function(e3) {
      this._profileHandler.onProfileModified(e3);
    } }, { key: "onRelationChainModified", value: function(e3) {
      var t3, n3, e3 = e3.dataList;
      S2(e3) || (t3 = [], e3.forEach(function(e4) {
        e4.blackListDelAccount && t3.push.apply(t3, d2(e4.blackListDelAccount));
      }), 0 < t3.length && this._blacklistHandler.onAccountDeleted(t3), n3 = [], e3.forEach(function(e4) {
        e4.blackListAddAccount && n3.push.apply(n3, d2(e4.blackListAddAccount));
      }), 0 < n3.length && this._blacklistHandler.onAccountAdded(n3));
    } }, { key: "onConvProfileUpdated", value: function(e3) {
      this._profileHandler.onConvProfileUpdated(e3);
    } }, { key: "getMyAccount", value: function() {
      return this.getMyUserID();
    } }, { key: "getMyNick", value: function() {
      return this._profileHandler.getNickAndAvatarByUserID(this.getMyUserID()).nick;
    } }, { key: "getMyProfile", value: function() {
      return this._profileHandler.getMyProfile();
    } }, { key: "getStorageModule", value: function() {
      return this.get(13);
    } }, { key: "filterProfanity", value: function(e3, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e3], "user_profile")).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e3] = o3, true));
    } }, { key: "isMyFriend", value: function(e3) {
      var t3 = this.get(8);
      return !!t3 && t3.isMyFriend(e3);
    } }, { key: "getUserProfile", value: function(e3) {
      return this._profileHandler.getUserProfile(e3);
    } }, { key: "updateMyProfile", value: function(e3) {
      return this._profileHandler.updateMyProfile(e3);
    } }, { key: "getNickAndAvatarByUserID", value: function(e3) {
      return this._profileHandler.getNickAndAvatarByUserID(e3);
    } }, { key: "getUserNickAndAvatar", value: function(e3) {
      return this._profileHandler.getUserNickAndAvatar(e3);
    } }, { key: "getLocalBlacklist", value: function() {
      var e3 = this._blacklistHandler.getLocalBlacklist();
      return D2(e3);
    } }, { key: "addBlacklist", value: function(e3) {
      return this._blacklistHandler.addBlacklist(e3);
    } }, { key: "deleteBlacklist", value: function(e3) {
      return this._blacklistHandler.deleteBlacklist(e3);
    } }, { key: "onUserStatusUpdated", value: function(e3) {
      this._userStatusHandler.onUserStatusUpdated(e3);
    } }, { key: "setSelfStatus", value: function(e3) {
      return this._userStatusHandler.setSelfStatus(e3);
    } }, { key: "getUserStatus", value: function(e3) {
      return this._userStatusHandler.getUserStatus(e3);
    } }, { key: "subscribeUserStatus", value: function(e3) {
      return this._userStatusHandler.subscribeUserStatus(e3);
    } }, { key: "unsubscribeUserStatus", value: function(e3) {
      return this._userStatusHandler.unsubscribeUserStatus(e3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._profileHandler.reset(), this._blacklistHandler.reset(), this._userStatusHandler.reset();
    } }])), pi = e2(function e3(t3, n3) {
      p3(this, e3), this._m = t3, this._isLoggedIn = false, this._SDKAppID = n3.SDKAppID, this._userID = n3.userID || "", this._userSig = n3.userSig || "", this._version = "3.5.4", this._a2Key = "", this._tinyID = "", this._customStatus = "", this._contentType = "json", this._unlimitedAVChatRoom = n3.unlimitedAVChatRoom, this._scene = n3.scene || "", this._oversea = n3.oversea, this._instanceID = n3.instanceID, this._statusInstanceID = 0, this._isDevMode = n3.devMode, this._isTestEnv = n3.testEnv, this._proxyServer = n3.proxyServer, this._fileUploadProxy = n3.fileUploadProxy, this._fileDownloadProxy = n3.fileDownloadProxy, this._applicationID = 0, this._isPartialUpdatedConvs = n3.partialUpdatedConversations, this._isIndependentDomainDisabled = n3.disableIndependentDomain, this._isUsingChatCore = false, this._uiPlatform = 0, this._authKey = "", this._customLoginInfo = "";
    }, [{ key: "isLoggedIn", value: function() {
      return this._isLoggedIn;
    } }, { key: "isOversea", value: function() {
      return this._oversea;
    } }, { key: "isPrivateNetWork", value: function() {
      return this._proxyServer;
    } }, { key: "isDevMode", value: function() {
      return this._isDevMode;
    } }, { key: "isTestEnv", value: function() {
      return this._isTestEnv;
    } }, { key: "isPartialUpdatedConvs", value: function() {
      return this._isPartialUpdatedConvs;
    } }, { key: "isIndependentDomainDisabled", value: function() {
      return this._isIndependentDomainDisabled;
    } }, { key: "isSingaporeSite", value: function() {
      return 2e7 <= this._SDKAppID && this._SDKAppID < 3e7 || 172e7 <= this._SDKAppID && this._SDKAppID < 173e7;
    } }, { key: "isKoreaSite", value: function() {
      return 3e7 <= this._SDKAppID && this._SDKAppID < 4e7 || 173e7 <= this._SDKAppID && this._SDKAppID < 174e7;
    } }, { key: "isGermanySite", value: function() {
      return 4e7 <= this._SDKAppID && this._SDKAppID < 5e7 || 174e7 <= this._SDKAppID && this._SDKAppID < 175e7;
    } }, { key: "isIndiaSite", value: function() {
      return 5e7 <= this._SDKAppID && this._SDKAppID < 6e7 || 175e7 <= this._SDKAppID && this._SDKAppID < 176e7;
    } }, { key: "isJapanSite", value: function() {
      return 6e7 <= this._SDKAppID && this._SDKAppID < 7e7 || 176e7 <= this._SDKAppID && this._SDKAppID < 177e7;
    } }, { key: "isUSASite", value: function() {
      return 7e7 <= this._SDKAppID && this._SDKAppID < 8e7 || 177e7 <= this._SDKAppID && this._SDKAppID < 178e7;
    } }, { key: "isIndonesiaSite", value: function() {
      return 8e7 <= this._SDKAppID && this._SDKAppID < 9e7 || 178e7 <= this._SDKAppID && this._SDKAppID < 179e7;
    } }, { key: "isIntl", value: function() {
      return 0 === (e3 = this._SDKAppID) || 2e7 <= e3 && e3 < 9e7 || 172e7 <= e3 && e3 < 179e7;
      var e3;
    } }, { key: "isUnlimitedAVChatRoom", value: function() {
      return this._unlimitedAVChatRoom;
    } }, { key: "isUsingChatCore", value: function() {
      return this._isUsingChatCore;
    } }, { key: "setUsingChatCore", value: function(e3) {
      this._isUsingChatCore = e3;
    } }, { key: "getUIPlatform", value: function() {
      return this._uiPlatform;
    } }, { key: "setUIPlatform", value: function(e3) {
      this._uiPlatform = e3;
    } }, { key: "setUserID", value: function(e3) {
      this._userID = e3;
    } }, { key: "getUserID", value: function() {
      return this._userID;
    } }, { key: "setUserSig", value: function(e3) {
      this._userSig = e3;
    } }, { key: "getUserSig", value: function() {
      return this._userSig;
    } }, { key: "getSDKAppID", value: function() {
      return this._SDKAppID;
    } }, { key: "setTinyID", value: function(e3) {
      this._tinyID = e3, this._isLoggedIn = true;
    } }, { key: "getTinyID", value: function() {
      return this._tinyID;
    } }, { key: "setCustomStatus", value: function(e3) {
      this._customStatus = e3;
    } }, { key: "getCustomStatus", value: function() {
      return this._customStatus;
    } }, { key: "getScene", value: function() {
      return Ne2 ? window.tencent_cloud_im_csig_flutter_for_web_25F_cy : this._isTUIKit() ? "tuikit" : this._scene;
    } }, { key: "getInstanceID", value: function() {
      return this._instanceID;
    } }, { key: "getStatusInstanceID", value: function() {
      return this._statusInstanceID;
    } }, { key: "setStatusInstanceID", value: function(e3) {
      this._statusInstanceID = e3;
    } }, { key: "getVersion", value: function() {
      return this._version;
    } }, { key: "getA2Key", value: function() {
      return this._a2Key;
    } }, { key: "setA2Key", value: function(e3) {
      this._a2Key = e3;
    } }, { key: "getContentType", value: function() {
      return this._contentType;
    } }, { key: "getProxyServer", value: function() {
      return this._proxyServer;
    } }, { key: "getFileUploadProxy", value: function() {
      return this._fileUploadProxy;
    } }, { key: "getFileDownloadProxy", value: function() {
      return this._fileDownloadProxy;
    } }, { key: "setApplicationID", value: function(e3) {
      this._applicationID = e3;
    } }, { key: "getApplicationID", value: function() {
      return this._applicationID;
    } }, { key: "setDowloadFileAuthKey", value: function(e3) {
      this._authKey = e3;
    } }, { key: "getDownloadFileAuthKey", value: function() {
      return this._authKey;
    } }, { key: "setCustomLoginInfo", value: function(e3) {
      this._customLoginInfo = e3;
    } }, { key: "getCustomLoginInfo", value: function() {
      return this._customLoginInfo;
    } }, { key: "_isTUIKit", value: function() {
      var e3 = false, t3 = false, n3 = false, o3 = false, i4 = [];
      v3 && (i4 = Object.keys(I2));
      for (var s4 = 0, a3 = (i4 = Ie2 ? me2 ? Object.keys(index) : Object.keys(window) : i4).length; s4 < a3; s4++)
        if (i4[s4].toLowerCase().includes("uikit")) {
          e3 = true;
          break;
        }
      var r4, i4 = null, c3 = (v3 && !ct2(I2.createGamePortal) && ct2(getApp) && !N3(getApp()) && (r4 = getApp().globalData, m2(r4)) && true === r4.isTUIKit && (t3 = true), true === this._m.get(13).getStorageSync("TIM_".concat(this._SDKAppID, "_isTUIKit")) && (n3 = true), null);
      if (le2 && !_e2 && "undefined" == typeof index && __wxConfig && (c3 = __wxConfig.pages), pe2 && "undefined" == typeof index && __qqConfig && (c3 = __qqConfig.pages), O2(c3) && 0 < c3.length) {
        for (var u3 = 0, l3 = c3.length; u3 < l3; u3++)
          if (c3[u3].toLowerCase().includes("tui")) {
            o3 = true;
            break;
          }
        c3 = null;
      }
      return e3 || t3 || n3 || o3;
    } }, { key: "reset", value: function() {
      this._isLoggedIn = false, this._userSig = "", this._a2Key = "", this._tinyID = "", this._customStatus = "", this._statusInstanceID = 0;
    } }]), _i = { "k-vue2-pc": 1, "k-vue2-h5": 2, "k-vue2-h5-uni": 3, "k-vue2-app-uni": 4, "k-vue2-mp-uni": 5, "k-vue2-pc-uni": 6, "k-vue3-pc": 7, "k-vue3-h5": 8, "k-vue3-h5-uni": 9, "k-vue3-app-uni": 10, "k-vue3-mp-uni": 11, "k-vue3-pc-uni": 12, "k-rn": 13 }, hi = (t2(gi, c2), e2(gi, [{ key: "onCheckTimer", value: function(e3) {
      this.isLoggedIn() && e3 % this._helloInterval == 0 && this._hello();
    } }, { key: "getPushModule", value: function() {
      var e3 = void 0, t3 = this.get(36), n3 = this.get(28);
      return t3.canIUseTIMPush() ? e3 = t3 : n3.canIUseOfflinePush() && (e3 = n3), e3;
    } }, { key: "login", value: function(e3) {
      if (this.isLoggedIn())
        return n3 = this.getMyUserID(), (n3 = this.getErrMsg("RepeatLogin", n3)) && M2.w(n3), D2({ actionStatus: "OK", errorCode: 0, errorInfo: n3, repeatLogin: true });
      if (Date.now() - this._lastLoginTs <= 15e3)
        return this.warn("LoggingIn", e3.userID), E2({ code: k2.REPEAT_LOGIN });
      M2.l("".concat(this._n, ".login userID:").concat(e3.userID));
      var t3, n3 = this._checkLoginInfo(e3);
      return 0 !== n3.code ? E2(n3) : (n3 = this.get(12), t3 = e3.userID, e3 = e3.userSig, n3.setUserID(t3), n3.setUserSig(e3), this.get(20).updateProtocolConfig(), this._login());
    } }, { key: "_login", value: function() {
      var _3 = this, h3 = this.get(12), g3 = h3.getScene(), e3 = 0, t3 = g3, f3 = (g3 && g3.startsWith("k-") && (t3 = _i[g3], g3 = "tuikit"), new P2("login")), n3 = (f3.setMessage("".concat(t3)).setMoreMessage("identifier:".concat(this.getMyUserID())), "tuikit" === g3), o3 = 0, n3 = (me2 ? o3 = n3 ? 3 === t3 || 4 === t3 || 5 === t3 || 6 === t3 ? 31 : 9 === t3 || 10 === t3 || 11 === t3 || 12 === t3 ? 32 : 4 : 3 : v3 ? o3 = de2 ? 36 : "tuikit" === g3 ? 12 : 11 : Ie2 ? o3 = Ne2 ? "flutter_web_uikit" === g3 ? 21 : 20 : this._isReactUIKit() ? Oe2 ? 25 : 24 : n3 ? 1 === t3 || 2 === t3 ? 29 : 7 === t3 || 8 === t3 ? 30 : Oe2 ? 17 : 14 : Oe2 ? 16 : 13 : 13 === t3 && (o3 = 38), f3.setUIPlatform(o3), h3.setUIPlatform(o3), this.getPushModule()), m3 = (n3 && (this._isWebUniapp = n3.getUniAppPlatform(), t3 = this._getStatusInstanceID(), h3.setStatusInstanceID(t3), this.get(20).updateProtocolConfig(), e3 = n3.getDeviceBrand()), "".concat(this._n, "._login"));
      return this._lastLoginTs = Date.now(), this.req({ P: G2.LOGIN, data: { deviceBrand: e3, isWebUniapp: this._isWebUniapp, customInfo: h3.getCustomLoginInfo() } }).then(function(e4) {
        _3._lastLoginTs = 0;
        var t4 = Date.now(), n4 = null, o4 = e4.data, i4 = o4.a2Key, s4 = o4.tinyID, a3 = o4.helloInterval, r4 = o4.instanceID, c3 = o4.timeStamp, u3 = o4.customStatus, u3 = void 0 === u3 ? "" : u3, l3 = o4.purchaseBits, o4 = o4.authKey, o4 = void 0 === o4 ? "" : o4, d3 = 1e3 * c3, p4 = t4 - f3.getStartTs(), p4 = d3 + parseInt(p4 / 2) - t4, t4 = f3.getStartTs() + p4;
        if (f3.start(t4), t4 = d3, Be2 = p4, (d3 = /* @__PURE__ */ new Date()).setTime(t4), M2.i("baseTime from server:".concat(d3, " offset:").concat(Be2)), s4) {
          if (i4)
            return t4 = _3.get(21).getSocketID(), d3 = Go(u3), u3 = "socketID:".concat(t4, " scene:").concat(g3, " helloInterval:").concat(a3, " instanceID:").concat(r4, " timeStamp:").concat(c3) + " offset:".concat(p4, " customStatus:").concat(d3, " isWebUniapp:").concat(_3._isWebUniapp), M2.l("".concat(m3, " ok. ").concat(u3)), c3 = t4 = "", le2 && ct2(I2.getAccountInfoSync) && (p4 = I2.getAccountInfoSync().miniProgram) && (t4 = p4.appId, c3 = p4.envVersion), f3.setMoreMessage("".concat(u3, " href:").concat(Ie2 ? window.location.href : "", " mpAppId:").concat(t4, " envVersion:").concat(c3, " authKey:").concat(o4)).end(), h3.setA2Key(i4), h3.setTinyID(s4), h3.setStatusInstanceID(r4), h3.setCustomStatus(d3), h3.setDowloadFileAuthKey(o4), l3 && _3.get(27).onPushedConfig({ errorCode: 0, expiredTime: 0, purchaseBits: l3 }), _3.get(20).updateProtocolConfig(), _3.emitIEvt(U2.A2KEY_AND_TINYID_UPDATED), _3._helloInterval = a3, _3.triggerReady(), (p4 = _3.getPushModule()) && (index.setStorageSync("timUniAppInstanceID", r4), p4.init()), _3._fetchCloudControlConfig(), _3.get(29).init(), e4;
          n4 = new L2({ code: k2.NO_A2KEY });
        } else
          n4 = new L2({ code: k2.NO_TINYID });
        throw f3.setError(n4).end(), n4;
      }).catch(function(e4) {
        return f3.setError(e4).end(true), _3._m.setNotReadyReason(k2.LOGIN_FAILED), M2.e("".concat(m3, " failed. error:"), e4), _3._lastLoginTs = 0, _3._m.onLoginFailed(), E2(e4);
      });
    } }, { key: "logout", value: function() {
      var t3 = this, e3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0, n3 = "".concat(this._n, ".logout"), o3 = this.isLoggedIn();
      return M2.i("".concat(n3, " type:").concat(e3, " isLoggedIn:").concat(o3, " isWebUniapp:").concat(this._isWebUniapp)), o3 ? (new P2("logout").setMessage("identifier:".concat(this.getMyUserID())).end(true), 0 === e3 && this._m.setNotReadyReason(k2.LOGGED_OUT), this.req({ P: G2.LOGOUT, data: { type: e3, isWebUniapp: this._isWebUniapp } }).then(function() {
        return t3.resetReady(), D2({});
      }).catch(function(e4) {
        return M2.e("".concat(n3, " error:"), e4), t3.resetReady(), D2({});
      })) : E2({ code: k2.USER_NOT_LOGGED_IN });
    } }, { key: "getLoginUser", value: function() {
      return this.isLoggedIn() ? this.getMyUserID() : "";
    } }, { key: "_fetchCloudControlConfig", value: function() {
      this.get(23).fetchConfig();
    } }, { key: "_getStatusInstanceID", value: function() {
      return index.getStorageSync("timUniAppInstanceID") || 0;
    } }, { key: "_hello", value: function() {
      var t3 = this;
      this._lastWsHelloTs = Date.now(), this.req({ P: G2.HELLO, data: { isWebUniapp: this._isWebUniapp } }).catch(function(e3) {
        M2.w("".concat(t3._n, "._hello error:"), e3);
      });
    } }, { key: "getLastWsHelloTs", value: function() {
      return this._lastWsHelloTs;
    } }, { key: "_checkLoginInfo", value: function(e3) {
      var t3 = 0;
      return S2(this.get(12).getSDKAppID()) ? t3 = k2.NO_SDKAPPID : S2(e3.userID) ? t3 = k2.NO_IDENTIFIER : S2(e3.userSig) && (t3 = k2.NO_USERSIG), { code: t3 };
    } }, { key: "_isReactUIKit", value: function() {
      return Ie2 && void 0 !== window.tencent_cloud_im_csig_react_uikit_23F_xa;
    } }, { key: "onMultipleAccountKickedOut", value: function(e3) {
      var t3 = this;
      new P2("kickedOut").setMessage("type:".concat(R2.KICKED_OUT_MULT_ACCOUNT, " newInstanceInfo:").concat(JSON.stringify(e3))).end(true), M2.w("".concat(this._n, ".onMultipleAccountKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e3), this.logout(1).then(function() {
        t3.emitOEvt(h2.KICKED_OUT, { type: R2.KICKED_OUT_MULT_ACCOUNT }), t3._m.setNotReadyReason(k2.KICKED_OUT_MULT_ACCOUNT), t3._m.reset();
      });
    } }, { key: "onMultipleDeviceKickedOut", value: function(e3) {
      var t3 = this;
      new P2("kickedOut").setMessage("type:".concat(R2.KICKED_OUT_MULT_DEVICE, " newInstanceInfo:").concat(JSON.stringify(e3))).end(true), M2.w("".concat(this._n, ".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e3), this.logout(1).then(function() {
        t3.emitOEvt(h2.KICKED_OUT, { type: R2.KICKED_OUT_MULT_DEVICE }), t3._m.setNotReadyReason(k2.KICKED_OUT_MULT_DEVICE), t3._m.reset();
      });
    } }, { key: "onUserSigExpired", value: function() {
      new P2("kickedOut").setMessage(R2.KICKED_OUT_USERSIG_EXPIRED).end(true), M2.w("".concat(this._n, ".onUserSigExpired userID:").concat(this.getMyUserID())), 0 !== this.get(12).getStatusInstanceID() && (this.emitOEvt(h2.KICKED_OUT, { type: R2.KICKED_OUT_USERSIG_EXPIRED }), this._m.setNotReadyReason(k2.KICKED_OUT_USERSIG_EXPIRED), this._m.reset());
    } }, { key: "onRestApiKickedOut", value: function(e3) {
      new P2("kickedOut").setMessage("type:".concat(R2.KICKED_OUT_REST_API, " newInstanceInfo:").concat(JSON.stringify(e3))).end(true), M2.w("".concat(this._n, ".onRestApiKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e3), 0 !== this.get(12).getStatusInstanceID() && (this.emitOEvt(h2.KICKED_OUT, { type: R2.KICKED_OUT_REST_API }), this._m.setNotReadyReason(k2.KICKED_OUT_REST_API), this._m.reset(), this.get(21).onRestApiKickedOut());
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this.resetReady(), this._helloInterval = 120, this._lastLoginTs = 0, this._lastWsHelloTs = 0, this._isWebUniapp = 0;
    } }]));
    function gi(e3) {
      return p3(this, gi), (e3 = i3(this, gi, [e3]))._n = "SignModule", e3._helloInterval = 120, e3._lastLoginTs = 0, e3._lastWsHelloTs = 0, e3._isWebUniapp = 0, Ao.mixin(e3), e3;
    }
    function fi(e3) {
      return p3(this, fi), (e3 = i3(this, fi, [e3]))._n = "UserModule", e3._profileHandler = new ri(e3), e3._blacklistHandler = new ui(e3), e3._userStatusHandler = new li(e3), e3.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, e3.onContextUpdated, e3), e3;
    }
    function mi(e3) {
      return p3(this, mi), (e3 = i3(this, mi, [e3]))._n = "TopicModule", e3._topicMap = /* @__PURE__ */ new Map(), e3._getTopicTimeMap = /* @__PURE__ */ new Map(), e3.TOPIC_CACHE_TIME = 300, e3.TOPIC_LAST_ACTIVE_TIME = 3600, e3.getIEmitInst().on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    function vi(e3) {
      return p3(this, vi), (e3 = i3(this, vi, [e3]))._n = "GroupModule", e3._commonGroupHandler = new Yo(e3), e3._groupAttributesHandler = new jo(e3), e3._groupCountersHandler = new Jo(e3), e3._AVChatRoomHandler = new Zo(e3), e3._groupTipsHandler = new Wo(e3), e3._groupSystemNoticeHandler = new ti(e3), e3._groupMemberHandler = new $o(e3), e3.groupMap = /* @__PURE__ */ new Map(), e3._unjoinedAVChatRoomList = /* @__PURE__ */ new Map(), e3._receiptDetailCompleteMap = /* @__PURE__ */ new Map(), e3._onlineMemberCountMap = /* @__PURE__ */ new Map(), e3._timeoutIDs = [], e3.getIEmitInst().on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    function Ii(e3) {
      return p3(this, Ii), (e3 = i3(this, Ii, [e3]))._n = "ConvModule", Ao.mixin(e3), e3._msgListHandler = new ko(e3), e3._msgRemindHandler = new Bo(e3), e3._convGroupHandler = new Ho(e3), e3._sll = new wo(100), e3._pagingStatus = Gn, e3._pagingTs = 0, e3._pagingStartIdx = 0, e3._pagingPinnedTs = 0, e3._pagingPinnedStartIdx = 0, e3._pagingConvIDMap = /* @__PURE__ */ new Map(), e3._convIDFromUnreadDBMap = /* @__PURE__ */ new Map(), e3._convMap = /* @__PURE__ */ new Map(), e3._tmpGroupList = [], e3._tmpGroupAtTipsList = [], e3._peerReadTimeMap = /* @__PURE__ */ new Map(), e3._completedMap = /* @__PURE__ */ new Map(), e3._roamingMsgKeyAndTimeMap = /* @__PURE__ */ new Map(), e3._remoteGroupReadSeqMap = /* @__PURE__ */ new Map(), e3._convTotalUnreadCount = 0, e3._pagingGetCostList = [], e3._convMapForDiff = /* @__PURE__ */ new Map(), e3._partialUpdatedConvMap = /* @__PURE__ */ new Map(), e3._everClearedMap = /* @__PURE__ */ new Map(), e3._bPullOnInvite = true, e3._initListeners(), e3;
    }
    function Mi() {
      return null;
    }
    function yi(e3) {
      var t3 = e3.get(12);
      return { SDKType: 10, SDKAppID: t3.getSDKAppID(), SDKVersion: t3.getVersion(), tinyID: Number(t3.getTinyID()), userID: t3.getUserID(), platform: e3.getPlatform(), instanceID: t3.getInstanceID(), traceID: He2() };
    }
    var Ci = e2(function e3(t3) {
      p3(this, e3), this._m = t3, this._n = "StorageModule", this._storageQueue = /* @__PURE__ */ new Map(), this._errorTolerantHandle();
    }, [{ key: "_errorTolerantHandle", value: function() {
      v3 || "undefined" != typeof window && this._canIUseCookies() || (this.getItem = Mi, this.setItem = Mi, this.removeItem = Mi, this.clear = Mi);
    } }, { key: "onCheckTimer", value: function(e3) {
      e3 % 20 == 0 && 0 !== this._storageQueue.size && this._doFlush();
    } }, { key: "_doFlush", value: function() {
      try {
        var e3, t3 = F2(this._storageQueue);
        try {
          for (t3.s(); !(e3 = t3.n()).done; ) {
            var n3 = j2(e3.value, 2), o3 = n3[0], i4 = n3[1];
            this._setStorageSync(this._getKey(o3), i4);
          }
        } catch (e4) {
          t3.e(e4);
        } finally {
          t3.f();
        }
        this._storageQueue.clear();
      } catch (e4) {
        M2.w("".concat(this._n, "._doFlush error:"), e4);
      }
    } }, { key: "_getPrefix", value: function() {
      var e3 = this._m.get(12);
      return "TIM_".concat(e3.getSDKAppID(), "_").concat(e3.getUserID(), "_");
    } }, { key: "_getKey", value: function(e3) {
      return "".concat(this._getPrefix()).concat(e3);
    } }, { key: "getItem", value: function(e3) {
      var t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1];
      try {
        var n3 = t3 ? this._getKey(e3) : e3;
        return this.getStorageSync(n3);
      } catch (e4) {
        return M2.w("".concat(this._n, ".getItem error:"), e4), {};
      }
    } }, { key: "setItem", value: function(e3, t3) {
      var n3;
      2 < arguments.length && void 0 !== arguments[2] && arguments[2] ? (n3 = !(3 < arguments.length && void 0 !== arguments[3]) || arguments[3] ? this._getKey(e3) : e3, this._setStorageSync(n3, t3)) : this._storageQueue.set(e3, t3);
    } }, { key: "clear", value: function() {
      try {
        v3 ? I2.clearStorageSync() : this._canIUseCookies() && localStorage.clear();
      } catch (e3) {
        M2.w("".concat(this._n, ".clear error:"), e3);
      }
    } }, { key: "removeItem", value: function(e3) {
      var t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1];
      try {
        var n3 = t3 ? this._getKey(e3) : e3;
        this._removeStorageSync(n3);
      } catch (e4) {
        M2.w("".concat(this._n, ".removeItem error:"), e4);
      }
    } }, { key: "getSize", value: function(e3) {
      var t3 = this, n3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "b";
      try {
        var o3 = { size: 0, limitSize: 5242880, unit: n3 };
        if (Object.defineProperty(o3, "leftSize", { enumerable: true, get: function() {
          return o3.limitSize - o3.size;
        } }), v3 && (o3.limitSize = 1024 * I2.getStorageInfoSync().limitSize), e3)
          o3.size = JSON.stringify(this.getItem(e3)).length + this._getKey(e3).length;
        else if (v3)
          I2.getStorageInfoSync().keys.forEach(function(e4) {
            o3.size += JSON.stringify(t3.getStorageSync(e4)).length + t3._getKey(e4).length;
          });
        else if (this._canIUseCookies())
          for (var i4 in localStorage)
            localStorage.hasOwnProperty(i4) && (o3.size += localStorage.getItem(i4).length + i4.length);
        return this._convertUnit(o3);
      } catch (e4) {
        M2.w("".concat(this._n, " error:"), e4);
      }
    } }, { key: "_convertUnit", value: function(e3) {
      var t3, n3 = {}, o3 = e3.unit;
      for (t3 in n3.unit = o3, e3)
        "number" == typeof e3[t3] && ("kb" === o3.toLowerCase() ? n3[t3] = Math.round(e3[t3] / 1024) : "mb" === o3.toLowerCase() ? n3[t3] = Math.round(e3[t3] / 1024 / 1024) : n3[t3] = e3[t3]);
      return n3;
    } }, { key: "_setStorageSync", value: function(e3, t3) {
      v3 ? ge2 ? my.setStorageSync({ key: e3, data: t3 }) : I2.setStorageSync(e3, t3) : this._canIUseCookies() && localStorage.setItem(e3, JSON.stringify(t3));
    } }, { key: "getStorageSync", value: function(e3) {
      return v3 ? ge2 ? my.getStorageSync({ key: e3 }).data : I2.getStorageSync(e3) : this._canIUseCookies() ? JSON.parse(localStorage.getItem(e3)) : {};
    } }, { key: "_removeStorageSync", value: function(e3) {
      v3 ? ge2 ? my.removeStorageSync({ key: e3 }) : I2.removeStorageSync(e3) : this._canIUseCookies() && localStorage.removeItem(e3);
    } }, { key: "_canIUseCookies", value: function() {
      return "undefined" != typeof window && navigator && navigator.cookieEnabled && localStorage;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._doFlush();
    } }]), Ti = e2(function e3(t3) {
      p3(this, e3), this._n = "SSOLogBody", this._report = [];
    }, [{ key: "pushIn", value: function(e3) {
      M2.d("".concat(this._n, ".pushIn"), this._report.length, e3), this._report.push(e3);
    } }, { key: "backfill", value: function(e3) {
      var t3;
      O2(e3) && 0 !== e3.length && (M2.d("".concat(this._n, ".backfill"), this._report.length, e3.length), (t3 = this._report).unshift.apply(t3, d2(e3)));
    } }, { key: "getLogsNumInMemory", value: function() {
      return this._report.length;
    } }, { key: "isEmpty", value: function() {
      return 0 === this._report.length;
    } }, { key: "_reset", value: function() {
      this._report.length = 0, this._report = [];
    } }, { key: "getLogsInMemory", value: function() {
      var e3 = this._report.slice();
      return this._reset(), e3;
    } }]), Di = (t2(ki, c2), e2(ki, [{ key: "reportAtOnce", value: function() {
      this._report();
    } }, { key: "_onLoginSuccess", value: function() {
      var t3 = this, e3 = this.get(13), n3 = e3.getItem(this.TAG, false);
      !S2(n3) && ct2(n3.forEach) && (M2.l("".concat(this._n, "._onLoginSuccess. logs count:").concat(n3.length)), n3.forEach(function(e4) {
        t3._reportBody.pushIn(e4);
      }), e3.removeItem(this.TAG, false));
    } }, { key: "_onCloudConfig", value: function() {
      var e3 = this.getCloudConfig("evt_rpt_threshold"), t3 = this.getCloudConfig("evt_rpt_waiting"), n3 = this.getCloudConfig("evt_rpt_level"), o3 = this.getCloudConfig("evt_rpt_sdkappid_bl"), i4 = this.getCloudConfig("evt_rpt_tinyid_wl");
      N3(e3) || (this.MIN_THRESHOLD = Number(e3)), N3(t3) || (this.WAITING_TIME = Number(t3)), N3(n3) || (this.REPORT_LEVEL = n3.split(",").map(function(e4) {
        return Number(e4);
      })), N3(o3) || (this.REPORT_SDKAPPID_BLACKLIST = o3.split(",").map(function(e4) {
        return Number(e4);
      })), N3(i4) || (this.REPORT_TINYID_WHITELIST = i4.split(","));
    } }, { key: "pushIn", value: function(e3) {
      e3 instanceof P2 && (e3.updateTimeStamp(), this._reportBody.pushIn(e3), this._reportBody.getLogsNumInMemory() >= this.MIN_THRESHOLD) && this._report();
    } }, { key: "onCheckTimer", value: function() {
      Date.now() < this._lastReportTime + this.WAITING_TIME || this._reportBody.isEmpty() || this._report();
    } }, { key: "_filterLogs", value: function(e3) {
      var t3 = this, n3 = this.get(12), o3 = n3.getSDKAppID(), n3 = n3.getTinyID();
      return Wt2(this.REPORT_SDKAPPID_BLACKLIST, o3) && !Yt2(this.REPORT_TINYID_WHITELIST, n3) ? [] : e3.filter(function(e4) {
        return t3.REPORT_LEVEL.includes(e4.level);
      });
    } }, { key: "_report", value: function() {
      var t3, e3, n3 = this;
      this._reportBody.isEmpty() || (t3 = this._reportBody.getLogsInMemory(), 0 !== (e3 = this._filterLogs(t3)).length ? (e3 = { header: yi(this), event: e3 }, this.req({ P: G2.SSO_STAT, data: y2({}, e3) }).then(function() {
        n3._lastReportTime = Date.now();
      }).catch(function(e4) {
        M2.w("".concat(n3._n, "._report failed. error:"), e4), n3._lastReportTime = Date.now(), n3._reportBody.backfill(t3), n3._reportBody.getLogsNumInMemory() > n3.MAX_THRESHOLD && n3._flushAtOnce();
      })) : this._lastReportTime = Date.now());
    } }, { key: "_flushAtOnce", value: function() {
      var e3 = this.get(13), t3 = e3.getItem(this.TAG, false), n3 = this._reportBody.getLogsInMemory(), o3 = "".concat(this._n, "._flushAtOnce");
      S2(t3) ? (M2.l("".concat(o3, " count:").concat(n3.length)), e3.setItem(this.TAG, n3, true, false)) : ((n3 = n3.concat(t3)).length > this.MAX_THRESHOLD && (n3 = n3.slice(0, this.MAX_THRESHOLD)), M2.l("".concat(o3, " count:").concat(n3.length)), e3.setItem(this.TAG, n3, true, false));
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._lastReportTime = 0, this._report(), this.REPORT_SDKAPPID_BLACKLIST = [], this.REPORT_TINYID_WHITELIST = [];
    } }])), Ei = "none", Li = "online", Si = e2(function e3(t3) {
      p3(this, e3), this._m = t3, this._networkType = Li, this._n = "NetMonitorModule", this._mpNetworkStatusCallback = null, this._webOnlineCallback = null, this._webOfflineCallback = null, this._removeListener = null, this._m.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, this._startRN, this);
    }, [{ key: "_startRN", value: function() {
      var e3, n3 = this;
      ve2 && (e3 = this._m.get(18).getPlugin("chat-network-monitor")) && (this._removeListener = e3.addEventListener(function(e4) {
        var t3 = e4.isConnected, e4 = e4.type;
        n3._networkType !== e4 && n3._onNetworkStatusChange({ isConnected: void 0 !== t3 && t3, networkType: e4 });
      }));
    } }, { key: "start", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".start");
      v3 ? (I2.getNetworkType({ success: function(e3) {
        t3._networkType = e3.networkType || e3.subtype || "", e3.networkType === Ei ? M2.w("".concat(n3, " no network, please check!")) : M2.i("".concat(n3, " networkType:").concat(e3.networkType));
      } }), this._mpNetworkStatusCallback = this._onNetworkStatusChange.bind(this), I2.onNetworkStatusChange(this._mpNetworkStatusCallback)) : Ie2 && (this._networkType = Li, this._webOnlineCallback = this._onWebOnline.bind(this), this._webOfflineCallback = this._onWebOffline.bind(this), window.addEventListener("online", this._webOnlineCallback), window.addEventListener("offline", this._webOfflineCallback));
    } }, { key: "_onWebOnline", value: function() {
      this._onNetworkStatusChange({ isConnected: true, networkType: Li });
    } }, { key: "_onWebOffline", value: function() {
      this._onNetworkStatusChange({ isConnected: false, networkType: Ei });
    } }, { key: "_onNetworkStatusChange", value: function(e3) {
      var t3 = e3.isConnected, e3 = e3.networkType, n3 = "".concat(this._n, "._onNetworkStatusChange"), o3 = false, i4 = "previous:".concat(this._networkType, " current:").concat(e3);
      t3 ? (M2.i("".concat(n3, " ").concat(i4)), this._networkType !== e3 && (o3 = true, this._networkType = e3, this._m.get(21).reConnect(true))) : this._networkType !== e3 && (o3 = true, this._networkType = e3, M2.w("".concat(n3, " no network, please check!")), this._m.get(21).offline()), o3 && new P2("networkChange").setMessage("isConnected:".concat(t3, " ").concat(i4)).end();
    } }, { key: "isOnline", value: function() {
      return this._networkType !== Ei;
    } }, { key: "getNetworkType", value: function() {
      return this._networkType;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), v3 ? null !== this._mpNetworkStatusCallback && (I2.offNetworkStatusChange && I2.offNetworkStatusChange(this._mpNetworkStatusCallback), this._mpNetworkStatusCallback = null) : Ie2 ? (null !== this._webOnlineCallback && (window.removeEventListener("online", this._webOnlineCallback), this._webOnlineCallback = null), null !== this._onWebOffline && (window.removeEventListener("offline", this._webOfflineCallback), this._webOfflineCallback = null)) : ve2 && this._removeListener && (this._removeListener(), this._removeListener = null);
    } }]);
    function ki(e3) {
      p3(this, ki), (e3 = i3(this, ki, [e3]))._n = "EventStatModule", e3.TAG = "im-ssolog-event", e3._reportBody = new Ti(), e3.MIN_THRESHOLD = 20, e3.MAX_THRESHOLD = 100, e3.WAITING_TIME = 6e4, e3.REPORT_LEVEL = [4, 5, 6], e3.REPORT_SDKAPPID_BLACKLIST = [], e3.REPORT_TINYID_WHITELIST = [], e3._lastReportTime = Date.now();
      var t3 = e3.getIEmitInst();
      return t3.on(U2.A2KEY_AND_TINYID_UPDATED, e3._onLoginSuccess, e3), t3.on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    function Ri(e3, t3) {
      return e3(t3 = { exports: {} }, t3.exports), t3.exports;
    }
    var Ai = Ri(function(e3) {
      var o3 = Object.prototype.hasOwnProperty, _3 = "~";
      function n3() {
      }
      function s4(e4, t4, n4) {
        this.fn = e4, this.context = t4, this.once = n4 || false;
      }
      function i4(e4, t4, n4, o4, i5) {
        if ("function" != typeof n4)
          throw new TypeError("The listener must be a function");
        n4 = new s4(n4, o4 || e4, i5), o4 = _3 ? _3 + t4 : t4;
        return e4._events[o4] ? e4._events[o4].fn ? e4._events[o4] = [e4._events[o4], n4] : e4._events[o4].push(n4) : (e4._events[o4] = n4, e4._eventsCount++), e4;
      }
      function c3(e4, t4) {
        0 == --e4._eventsCount ? e4._events = new n3() : delete e4._events[t4];
      }
      function t3() {
        this._events = new n3(), this._eventsCount = 0;
      }
      Object.create && (n3.prototype = /* @__PURE__ */ Object.create(null), new n3().__proto__ || (_3 = false)), t3.prototype.eventNames = function() {
        var e4, t4, n4 = [];
        if (0 === this._eventsCount)
          return n4;
        for (t4 in e4 = this._events)
          o3.call(e4, t4) && n4.push(_3 ? t4.slice(1) : t4);
        return Object.getOwnPropertySymbols ? n4.concat(Object.getOwnPropertySymbols(e4)) : n4;
      }, t3.prototype.listeners = function(e4) {
        var e4 = _3 ? _3 + e4 : e4, t4 = this._events[e4];
        if (!t4)
          return [];
        if (t4.fn)
          return [t4.fn];
        for (var n4 = 0, o4 = t4.length, i5 = new Array(o4); n4 < o4; n4++)
          i5[n4] = t4[n4].fn;
        return i5;
      }, t3.prototype.listenerCount = function(e4) {
        e4 = _3 ? _3 + e4 : e4, e4 = this._events[e4];
        return e4 ? e4.fn ? 1 : e4.length : 0;
      }, t3.prototype.emit = function(e4, t4, n4, o4, i5, s5) {
        var a3 = _3 ? _3 + e4 : e4;
        if (!this._events[a3])
          return false;
        var r4, c4 = this._events[a3], u3 = arguments.length;
        if (c4.fn) {
          switch (c4.once && this.removeListener(e4, c4.fn, void 0, true), u3) {
            case 1:
              return c4.fn.call(c4.context), true;
            case 2:
              return c4.fn.call(c4.context, t4), true;
            case 3:
              return c4.fn.call(c4.context, t4, n4), true;
            case 4:
              return c4.fn.call(c4.context, t4, n4, o4), true;
            case 5:
              return c4.fn.call(c4.context, t4, n4, o4, i5), true;
            case 6:
              return c4.fn.call(c4.context, t4, n4, o4, i5, s5), true;
          }
          for (p4 = 1, r4 = new Array(u3 - 1); p4 < u3; p4++)
            r4[p4 - 1] = arguments[p4];
          c4.fn.apply(c4.context, r4);
        } else
          for (var l3, d3 = c4.length, p4 = 0; p4 < d3; p4++)
            switch (c4[p4].once && this.removeListener(e4, c4[p4].fn, void 0, true), u3) {
              case 1:
                c4[p4].fn.call(c4[p4].context);
                break;
              case 2:
                c4[p4].fn.call(c4[p4].context, t4);
                break;
              case 3:
                c4[p4].fn.call(c4[p4].context, t4, n4);
                break;
              case 4:
                c4[p4].fn.call(c4[p4].context, t4, n4, o4);
                break;
              default:
                if (!r4)
                  for (l3 = 1, r4 = new Array(u3 - 1); l3 < u3; l3++)
                    r4[l3 - 1] = arguments[l3];
                c4[p4].fn.apply(c4[p4].context, r4);
            }
        return true;
      }, t3.prototype.on = function(e4, t4, n4) {
        return i4(this, e4, t4, n4, false);
      }, t3.prototype.once = function(e4, t4, n4) {
        return i4(this, e4, t4, n4, true);
      }, t3.prototype.removeListener = function(e4, t4, n4, o4) {
        e4 = _3 ? _3 + e4 : e4;
        if (this._events[e4])
          if (t4) {
            var i5 = this._events[e4];
            if (i5.fn)
              i5.fn !== t4 || o4 && !i5.once || n4 && i5.context !== n4 || c3(this, e4);
            else {
              for (var s5 = 0, a3 = [], r4 = i5.length; s5 < r4; s5++)
                (i5[s5].fn !== t4 || o4 && !i5[s5].once || n4 && i5[s5].context !== n4) && a3.push(i5[s5]);
              a3.length ? this._events[e4] = 1 === a3.length ? a3[0] : a3 : c3(this, e4);
            }
          } else
            c3(this, e4);
        return this;
      }, t3.prototype.removeAllListeners = function(e4) {
        return e4 ? (e4 = _3 ? _3 + e4 : e4, this._events[e4] && c3(this, e4)) : (this._events = new n3(), this._eventsCount = 0), this;
      }, t3.prototype.off = t3.prototype.removeListener, t3.prototype.addListener = t3.prototype.on, t3.prefixed = _3, e3.exports = t3.EventEmitter = t3;
    }), Oi = ["rich.my-imcloud.com", "imrich.qcloud.com"], Ni = ["requestSnapshotUrl"], Gi = (t2(Fi, c2), e2(Fi, [{ key: "_init", value: function() {
      this._fileDownloadProxy = this.getFileDownloadProxy(), this._authKey = this.getDownloadFileAuthKey();
      var e3 = this.get(18);
      this.TIMUploadPlugin = e3.getPlugin("tim-upload-plugin"), this.TIMUploadPlugin ? this._initUploaderMethod() : (this.COSSDK = e3.getPlugin(e3 = v3 ? "cos-wx-sdk" : "cos-js-sdk"), this.COSSDK ? (this._getAuthorizationKey(), this.warn("CosReplacement", e3)) : this.warn("PluginUndetected"));
    } }, { key: "_onCloudConfig", value: function() {
      var t3 = this, e3 = "".concat(this._n, "._onCloudConfig"), n3 = this.getCloudConfig("upload_size_limit"), o3 = this.getCloudConfig("simple_cos"), i4 = this.getCloudConfig("file_dn_list");
      if (M2.l("".concat(e3, " uploadSizeLimit:").concat(n3, " simpleCos:").concat(o3)), !N3(n3))
        try {
          var s4 = JSON.parse(n3);
          this.UPLOAD_SIZE_LIMIT = { A: s4.a ? 1048576 * parseInt(s4.a) : this.UPLOAD_SIZE_LIMIT.A, F: s4.f ? 1048576 * parseInt(s4.f) : this.UPLOAD_SIZE_LIMIT.F, I: s4.i ? 1048576 * parseInt(s4.i) : this.UPLOAD_SIZE_LIMIT.I, V: s4.v ? 1048576 * parseInt(s4.v) : this.UPLOAD_SIZE_LIMIT.V };
        } catch (e4) {
        }
      if (N3(o3) || (this.isSimpleCos = "1" === o3), !N3(i4))
        try {
          JSON.parse(i4).forEach(function(e4) {
            t3._fileDNList.includes(e4) || t3._fileDNList.push(e4);
          });
        } catch (e4) {
        }
    } }, { key: "_getAuthorizationKey", value: function() {
      var n3 = this, o3 = "".concat(this._n, ".").concat("_getAuthorizationKey"), i4 = new P2("_getAuthorizationKey"), s4 = Math.ceil(Date.now() / 1e3);
      this.req({ P: G2.COS_SIGN, data: { duration: this.expiredTimeLimit } }).then(function(e3) {
        var e3 = e3.data, t3 = (M2.l("".concat(o3, " ok. data:"), e3), e3.expiredTime - s4);
        i4.setMessage("requestId:".concat(e3.requestId, " requestTime:").concat(s4, " expiredTime:").concat(e3.expiredTime, " diff:").concat(t3, "s")).end(), !v3 && e3.region && (n3.region = e3.region), n3.appid = e3.appid, n3.bucketName = e3.bucketName, n3.ciUrl = e3.ciUrl, n3.directory = e3.directory, n3.downloadUrl = e3.downloadUrl, n3.uploadUrl = e3.uploadUrl, n3.cosOptions = { secretId: e3.secretId, secretKey: e3.secretKey, sessionToken: e3.sessionToken, expiredTime: e3.expiredTime }, M2.l("".concat(o3, " ok. region:").concat(n3.region, " bucketName:").concat(n3.bucketName)), n3._initUploaderMethod();
      }).catch(function(e3) {
        i4.setError(e3).end(), M2.w("".concat(o3, " failed. error:"), e3);
      });
    } }, { key: "_getCosPreSigUrl", value: function(t3) {
      var i4 = this, s4 = "".concat(this._n, ".").concat("_getCosPreSigUrl"), a3 = Math.ceil(Date.now() / 1e3), r4 = new P2("_getCosPreSigUrl"), e3 = { uploadMethod: t3.uploadMethod, platform: this.getPlatform(), SDKAppID: this.getSDKAppID(), userID: t3.userID, conversationType: t3.conversationType, uploadConfig: [{ fileID: 1, fileType: t3.fileType, fileName: t3.fileName }] }, n3 = G2.SIMPLE_COS_PRE_SIG;
      return this.isSimpleCos || (e3 = { fileType: t3.fileType, fileName: t3.fileName, uploadMethod: t3.uploadMethod, duration: t3.duration }, n3 = G2.COS_PRE_SIG), this.req({ P: n3, data: e3 }).then(function(e4) {
        i4.tryCount = 0;
        var t4, n4, e4 = e4.data || {}, o3 = (M2.l("".concat(s4, " ok. isSimpleCos:").concat(i4.isSimpleCos, " data:"), e4), "");
        return o3 = i4.isSimpleCos ? (t4 = (n4 = e4.preSig[0]).uploadUrl, n4 = n4.fileKey, "uploadIP:".concat(e4.uploadIP, " uploadUrl:").concat(t4, " fileKey:").concat(n4, " cost:").concat(tn(a3))) : "requestId:".concat(e4.requestId, " expiredTime:").concat(e4.expiredTime, " diff:").concat(e4.expiredTime - a3, "s"), r4.setMessage(o3).end(), e4;
      }).catch(function(e4) {
        return -1 === e4.code && (e4.code = k2.COS_GET_SIG_FAIL), r4.setError(e4).end(), M2.w("".concat(s4, " failed. error:"), e4), i4.tryCount < 1 ? (i4.tryCount++, i4._getCosPreSigUrl(t3)) : (i4.tryCount = 0, E2({ code: k2.COS_GET_SIG_FAIL }));
      });
    } }, { key: "_initUploaderMethod", value: function() {
      var n3 = this;
      this.TIMUploadPlugin ? (this.timUploadPlugin = new this.TIMUploadPlugin(), this._cosUploadMethod = function(e3, t3) {
        n3.timUploadPlugin.uploadFile(e3, t3);
      }) : this.appid && (this.cos = v3 ? new this.COSSDK({ ForcePathStyle: true, getAuthorization: this._getAuthorization.bind(this) }) : new this.COSSDK({ getAuthorization: this._getAuthorization.bind(this) }), this._cosUploadMethod = v3 ? function(e3, t3) {
        n3.cos.postObject(e3, t3);
      } : function(e3, t3) {
        n3.cos.uploadFiles(e3, t3);
      });
    } }, { key: "onCheckTimer", value: function(e3) {
      !this.COSSDK || this.TIMUploadPlugin || this.isLoggedIn() && e3 % 60 == 0 && Math.ceil(Date.now() / 1e3) >= this.cosOptions.expiredTime - 120 && this._getAuthorizationKey();
    } }, { key: "getFileDNList", value: function() {
      return this._fileDNList;
    } }, { key: "_getAuthorization", value: function(e3, t3) {
      t3({ TmpSecretId: this.cosOptions.secretId, TmpSecretKey: this.cosOptions.secretKey, XCosSecurityToken: this.cosOptions.sessionToken, ExpiredTime: this.cosOptions.expiredTime });
    } }, { key: "upload", value: function(e3) {
      if (true === e3._relayFlag)
        return Promise.resolve();
      var t3 = this.get(26);
      switch (e3.type) {
        case R2.MSG_IMAGE:
          return t3.addTotalCount(Jn), this._uploadImage(e3);
        case R2.MSG_FILE:
          return t3.addTotalCount(Jn), this._uploadFile(e3);
        case R2.MSG_AUDIO:
          return t3.addTotalCount(Jn), this._uploadAudio(e3);
        case R2.MSG_VIDEO:
          return t3.addTotalCount(Jn), this._uploadVideo(e3);
        default:
          return Promise.resolve();
      }
    } }, { key: "_uploadImage", value: function(v4) {
      var I3 = this, e3 = this.get(2), M3 = v4.getElements()[0], t3 = e3.getMessageOption(v4.clientSequence);
      return this.doUploadImage({ file: t3.payload.file, to: t3.to, message: v4, onProgress: function(e4) {
        if (M3.updatePercent(e4), ct2(t3.onProgress))
          try {
            t3.onProgress(e4);
          } catch (e5) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e4) {
        var t4 = e4.location, n3 = e4.fileType, o3 = e4.fileSize, i4 = e4.width, s4 = e4.height, a3 = e4.smallImageUrl, r4 = e4.smallImageWidth, c3 = e4.smallImageHeight, u3 = e4.largeImageUrl, l3 = e4.largeImageWidth, d3 = e4.largeImageHeight, p4 = e4.imageInfoArray, e4 = I3.isPrivateNetWork() ? t4 : mt2(t4);
        M3.updateImageFormat(n3);
        var _3, h3, g3 = { size: o3, url: e4, width: i4, height: s4 };
        if (p4 && 0 < p4.length)
          for (var f3 = 0; f3 < p4.length; f3++) {
            var m3 = p4[f3];
            1 === m3.type ? _3 = m3 : 2 === m3.type ? h3 = m3 : g3 = y2(y2({}, g3), m3);
          }
        else
          h3 = a3 && u3 ? (_3 = { url: a3, width: r4, height: c3 }, { url: u3, width: l3, height: d3 }) : (_3 = Vt2({ originUrl: e4, originWidth: i4, originHeight: s4, min: 198 }), Vt2({ originUrl: e4, originWidth: i4, originHeight: s4, min: 720 }));
        return M3.updateImageInfoArray([y2({}, g3), y2({}, h3), y2({}, _3)]), v4;
      });
    } }, { key: "_uploadFile", value: function(n3) {
      var o3 = this, e3 = this.get(2), i4 = n3.getElements()[0], t3 = e3.getMessageOption(n3.clientSequence);
      return this.doUploadFile({ file: t3.payload.file, to: t3.to, message: n3, onProgress: function(e4) {
        if (i4.updatePercent(e4), ct2(t3.onProgress))
          try {
            t3.onProgress(e4);
          } catch (e5) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e4) {
        var e4 = e4.location, t4 = e4;
        return o3.isPrivateNetWork() || (t4 = so(t4 = mt2(e4), o3._fileDownloadProxy, o3._authKey, o3._fileDNList)), i4.updateFileUrl(t4), n3;
      });
    } }, { key: "_uploadAudio", value: function(t3) {
      var n3 = this, e3 = this.get(2), o3 = t3.getElements()[0], i4 = e3.getMessageOption(t3.clientSequence);
      return this.doUploadAudio({ file: i4.payload.file, to: i4.to, message: t3, onProgress: function(e4) {
        if (o3.updatePercent(e4), ct2(i4.onProgress))
          try {
            i4.onProgress(e4);
          } catch (e5) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e4) {
        e4 = e4.location, e4 = n3.isPrivateNetWork() ? e4 : mt2(e4);
        return o3.updateAudioUrl(e4), t3;
      });
    } }, { key: "_uploadVideo", value: function(n3) {
      var o3 = this, e3 = this.get(2), i4 = n3.getElements()[0], t3 = e3.getMessageOption(n3.clientSequence);
      return this.doUploadVideo({ file: t3.payload.file, to: t3.to, message: n3, onProgress: function(e4) {
        if (i4.updatePercent(e4), ct2(t3.onProgress))
          try {
            t3.onProgress(e4);
          } catch (e5) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e4) {
        var t4 = e4.location, e4 = e4.snapshotInfo, t4 = o3.isPrivateNetWork() ? t4 : mt2(t4);
        return i4.updateVideoUrl(t4), S2(e4) || i4.updateSnapshotInfo(e4), n3;
      });
    } }, { key: "_checkSizeError", value: function(e3) {
      var t3 = "";
      return "A" === e3 ? t3 = "audio" : "I" === e3 ? t3 = "image" : "V" === e3 ? t3 = "video" : "F" === e3 && (t3 = "file"), E2({ code: k2["MSG_".concat(e3, "_SIZE_LIMIT")], message: this.getErrMsg("UploadSizeLimit", t3, "".concat(this.UPLOAD_SIZE_LIMIT[e3] / 1048576, "MB")) });
    } }, { key: "doUploadImage", value: function(o3) {
      var e3, i4, s4 = this;
      return !o3.file || this._isEmptyFileList(o3.file.files) ? E2({ code: k2.MSG_I_SELECT_F_FIRST }) : true !== (e3 = this._checkImageType(o3.file)) ? e3 : true !== (e3 = this._checkImageSize(o3.file)) ? e3 : (i4 = null, this._setUploadFileType(1), this.uploadByCOS(o3).then(function(e4) {
        if (i4 = e4, s4.isPrivateNetWork())
          return wt2(n3);
        if (O2(i4.imageInfoArray)) {
          var t3 = i4.imageInfoArray.find(function(e5) {
            return 3 === e5.type;
          });
          if (t3)
            return t3;
        }
        var n3;
        return ve2 ? { width: o3.file.width, height: o3.file.height } : (n3 = mt2(e4.location), s4.COSSDK ? wt2(n3) : wt2(n3 = so(n3, s4._fileDownloadProxy, s4._authKey, s4._fileDNList)));
      }).then(function(e4) {
        return i4.width = e4.width, i4.height = e4.height, Promise.resolve(i4);
      }));
    } }, { key: "_checkImageType", value: function(e3) {
      var t3 = "", t3 = v3 ? e3.url.slice(e3.url.lastIndexOf(".") + 1) : ve2 ? e3.type.split("/")[1] : e3.files[0].name.slice(e3.files[0].name.lastIndexOf(".") + 1);
      return 0 <= Po.indexOf(t3.toLowerCase()) || E2({ code: k2.MSG_I_TYPES_LIMIT });
    } }, { key: "_checkImageSize", value: function(e3) {
      return 0 === (e3 = (v3 || ve2 ? e3 : e3.files[0]).size) ? E2({ code: k2.MSG_F_IS_EMPTY }) : e3 < this.UPLOAD_SIZE_LIMIT.I || this._checkSizeError("I");
    } }, { key: "doUploadFile", value: function(e3) {
      return !e3.file || this._isEmptyFileList(e3.file.files) ? E2({ code: k2.MSG_F_SELECT_F_FIRST }) : e3.file.files[0].size > this.UPLOAD_SIZE_LIMIT.F ? this._checkSizeError("F") : 0 === e3.file.files[0].size ? E2({ code: k2.MSG_F_IS_EMPTY }) : (this._setUploadFileType(255), this.uploadByCOS(e3));
    } }, { key: "doUploadVideo", value: function(e3) {
      return e3.file.videoFile.size > this.UPLOAD_SIZE_LIMIT.V ? this._checkSizeError("V") : 0 === e3.file.videoFile.size ? E2({ code: k2.MSG_F_IS_EMPTY }) : -1 === Uo.indexOf(e3.file.videoFile.type) ? E2({ code: k2.MSG_V_TYPES_LIMIT }) : (this._setUploadFileType(2), v3 || ve2 ? this.handleVideoUpload(y2(y2({}, e3), {}, { file: e3.file.videoFile })) : Ie2 ? this.handleVideoUpload(e3) : void 0);
    } }, { key: "handleVideoUpload", value: function(n3) {
      var o3 = this;
      return new Promise(function(t3, e3) {
        o3.uploadByCOS(n3).then(function(e4) {
          t3(e4);
        }).catch(function() {
          o3.uploadByCOS(n3).then(function(e4) {
            t3(e4);
          }).catch(function() {
            e3(new L2({ code: k2.MSG_V_UPLOAD_FAIL }));
          });
        });
      });
    } }, { key: "doUploadAudio", value: function(e3) {
      return e3.file ? e3.file.size > this.UPLOAD_SIZE_LIMIT.A ? this._checkSizeError("A") : 0 === e3.file.size ? E2({ code: k2.MSG_F_IS_EMPTY }) : (this._setUploadFileType(3), this.uploadByCOS(e3)) : E2({ code: k2.MSG_A_UPLOAD_FAIL });
    } }, { key: "uploadByCOS", value: function(t3) {
      var c3, u3, l3, d3, p4 = this;
      return ct2(this._cosUploadMethod) ? this.timUploadPlugin ? this._uploadWithPreSigUrl(t3) : (c3 = new P2("upload"), u3 = "".concat(this._n, ".uploadByCOS"), l3 = Date.now(), d3 = this._getFile(t3), new Promise(function(s4, a3) {
        var e3 = v3 ? p4._createCosOptionsWXMiniApp(t3) : p4._createCosOptionsWeb(t3), r4 = p4;
        p4._cosUploadMethod(e3, function(e4, t4) {
          var n3, o3, i4 = /* @__PURE__ */ Object.create(null);
          t4 ? e4 || O2(t4.files) && t4.files[0].error ? (n3 = new L2({ code: k2.MSG_F_UPLOAD_FAIL }), c3.setError(n3).end(), M2.l("".concat(u3, " failed. error:"), t4.files[0].error), 403 === t4.files[0].error.statusCode && p4._getAuthorizationKey(), a3(n3)) : (i4.fileName = d3.name, i4.fileSize = d3.size, i4.fileType = d3.type.slice(d3.type.indexOf("/") + 1).toLowerCase(), i4.location = (v3 ? t4 : t4.files[0].data).Location, n3 = Date.now() - l3, t4 = r4._formatFileSize(d3.size), o3 = r4._formatSpeed(1e3 * d3.size / n3), t4 = "size:".concat(t4, " time:").concat(n3, "ms speed:").concat(o3), M2.l("".concat(u3, " success. name:").concat(d3.name, " ").concat(t4)), s4(i4), (o3 = p4.get(26)).addCost(Jn, n3), o3.addFileSize(Jn, d3.size), c3.setMessage(t4).end()) : (i4 = new L2({ code: k2.MSG_F_UPLOAD_FAIL }), c3.setError(i4).end(), M2.w("".concat(u3, " failed. error:"), e4), 403 === e4.statusCode && p4._getAuthorizationKey(), a3(i4));
        });
      })) : (this.warn("PluginUndetected"), E2({ code: k2.COS_UNDETECTED }));
    } }, { key: "_uploadWithPreSigUrl", value: function(e3) {
      var p4 = this, _3 = "".concat(this._n, "._uploadWithPreSigUrl"), h3 = this._getFile(e3);
      return this._createCosOptionsPreSigUrl(e3).then(function(d3) {
        return new Promise(function(s4, a3) {
          var r4 = new P2("upload"), e4 = d3.requestSnapshotUrl, c3 = void 0 === e4 ? void 0 : e4, u3 = W2(d3, Ni), l3 = Date.now();
          p4._cosUploadMethod(u3, function(e5, t3) {
            if (e5 || 403 === t3.statusCode)
              r4.setError(new L2(e5)).end(), o3 = { HttpStatusCode: 9999, CostTime: tn(l3, false), error: e5, url: d3.url }, t3.data && t3.data.uploadIP && (o3.uploadIP = t3.data.uploadIP), p4._uploadSSOLog(o3), M2.l("".concat(_3, " failed, error:"), e5), a3(new L2({ code: k2.MSG_F_UPLOAD_FAIL }));
            else {
              var n3 = /* @__PURE__ */ Object.create(null), o3 = t3.data.location || "", e5 = (p4.isPrivateNetWork() || 0 !== o3.indexOf("https://") && 0 !== o3.indexOf("http://") || (o3 = o3.split("//")[1]), n3.fileName = h3.name, n3.fileSize = h3.size, n3.fileType = h3.type.slice(h3.type.indexOf("/") + 1).toLowerCase(), n3.location = o3, tn(l3, false)), o3 = p4._formatFileSize(h3.size), i4 = p4._formatSpeed(1e3 * h3.size / e5), o3 = "size:".concat(o3, " time:").concat(e5, "ms speed:").concat(i4, " res:").concat(JSON.stringify(t3.data)), i4 = (M2.l("".concat(_3, " ok. name:").concat(h3.name, " ").concat(o3)), r4.setMessage(o3).end(), { HttpStatusCode: t3.statusCode, FileSize: h3.size, CostTime: e5, url: d3.url }), o3 = (t3.data && t3.data.uploadIP && (i4.uploadIP = t3.data.uploadIP), p4._uploadSSOLog(i4), p4.get(26)), i4 = (o3.addCost(Jn, e5), o3.addFileSize(Jn, h3.size), []);
              if (u3.thumbUrl && u3.largeUrl && i4.push.apply(i4, [p4._getSmallImageInfoByUrl(u3.thumbUrl, n3), p4._getLargeImageInfoByUrl(u3.largeUrl, n3)]), 1 === p4.uploadFileType && p4.isSimpleCos && !p4.isPrivateNetWork() && (i4.push(p4._getImageInfoArray(u3.downloadUrl, n3)), t3.data.uploadIP) && i4.push(p4._getDownloadIP(u3.downloadUrl.split("//")[1].split("/")[0], n3)), c3 && i4.push(p4._getSnapshotInfoByUrl(c3, n3)), 0 < i4.length)
                return Promise.all(i4).then(function() {
                  s4(n3);
                });
              s4(n3);
            }
          });
        });
      });
    } }, { key: "_getDownloadIP", value: function(e3, n3) {
      var o3 = "".concat(this._n, "._getDownloadIP"), i4 = Date.now();
      return this.req({ P: G2.GET_IP, data: { domainName: e3 } }).then(function(e4) {
        var t3;
        e4.data && e4.data.ip && (M2.l("".concat(o3, " ok. downloadIP:").concat(e4.data.ip, " cost:").concat(tn(i4))), (t3 = n3.location.split("/"))[0] = e4.data.ip, n3.location = t3.join("/"));
      }).catch(function(e4) {
      });
    } }, { key: "_getImageInfoArray", value: function(t3, n3) {
      var o3 = this, i4 = "".concat(this._n, "._getImageInfoArray"), s4 = Date.now();
      return this.req({ P: G2.GET_IMAGE_INFO, data: { imageUrl: t3 } }).then(function(e3) {
        e3 = e3.data || {};
        return M2.l("".concat(i4, " ok. data: ").concat(JSON.stringify(e3), " cost:").concat(tn(s4))), n3.imageInfoArray = e3.imageInfoArray, e3;
      }).catch(function(e3) {
        n3.imageInfoArray = void 0, o3._uploadSSOLog({ HttpStatusCode: 1e4, CostTime: tn(s4, false), url: t3 });
      });
    } }, { key: "_uploadSSOLog", value: function(e3) {
      var t3, n3;
      this.isSimpleCos && ((t3 = new P2()).setEventType(18), e3.error && t3.setError(new L2(e3.error)), n3 = "HttpStatusCode:".concat(e3.HttpStatusCode, "|CosRequestId:").concat(e3.CosRequestId || "", "|") + "FileAlreadyExist:".concat(e3.FileAlreadyExist || 0, "|FileSize:").concat(e3.FileSize || 0, "|CostTime:").concat(e3.CostTime), e3.uploadIP && (n3 += "|FinalIP:".concat(e3.uploadIP)), t3.setMessage("OK").setMoreMessage(e3.url).setExtension(n3).end());
    } }, { key: "_getRawOrUploadProxyUrl", value: function(e3) {
      var t3 = this.get(12).getFileUploadProxy(), n3 = e3;
      return n3 = t3 ? e3.replace(/^https:\/\/[^/]+/, t3) : n3;
    } }, { key: "_getFile", value: function(e3) {
      return O2(e3.file.files) || ut2(e3.file.files) ? e3.file.files[0] : e3.file;
    } }, { key: "_formatFileSize", value: function(e3) {
      return e3 < 1024 ? e3 + "B" : e3 < 1048576 ? Math.floor(e3 / 1024) + "KB" : Math.floor(e3 / 1048576) + "MB";
    } }, { key: "_formatSpeed", value: function(e3) {
      return e3 <= 1048576 ? Kt2(e3 / 1024, 1) + "KB/s" : Kt2(e3 / 1048576, 1) + "MB/s";
    } }, { key: "_createCosOptionsWeb", value: function(t3) {
      var e3 = this._getFile(t3), n3 = e3.name, n3 = n3.slice(n3.lastIndexOf(".")), n3 = this._genFileName("".concat(ht2(999999)).concat(n3));
      return { files: [{ Bucket: "".concat(this.bucketName, "-").concat(this.appid), Region: this.region, Key: "".concat(this.directory, "/").concat(n3), Body: e3 }], SliceSize: 1048576, onProgress: function(e4) {
        if ("function" == typeof t3.onProgress)
          try {
            t3.onProgress(e4.percent);
          } catch (e5) {
            M2.w("onProgress callback error:", e5);
          }
      }, onFileFinish: function(e4, t4, n4) {
      } };
    } }, { key: "_createCosOptionsWXMiniApp", value: function(t3) {
      var e3 = this._getFile(t3), n3 = this._genFileName(e3.name), e3 = e3.url;
      return { Bucket: "".concat(this.bucketName, "-").concat(this.appid), Region: this.region, Key: "".concat(this.directory, "/").concat(n3), FilePath: e3, onProgress: function(e4) {
        if (M2.l(JSON.stringify(e4)), "function" == typeof t3.onProgress)
          try {
            t3.onProgress(e4.percent);
          } catch (e5) {
            M2.w("onProgress callback error:", e5);
          }
      } };
    } }, { key: "_createCosOptionsPreSigUrl", value: function(r4) {
      var e3, c3 = this, u3 = "", l3 = "", t3 = 0, n3 = this._getFile(r4), t3 = v3 || ve2 ? (u3 = r4.message.type === R2.MSG_FILE ? (e3 = (e3 = n3.name).slice(e3.lastIndexOf(".")), this._genFileName("".concat(ht2(999999)).concat(e3))) : this._genFileName(n3.name), l3 = n3.url, 1) : (e3 = (e3 = n3.name).slice(e3.lastIndexOf(".")), u3 = this._genFileName("".concat(ht2(999999)).concat(e3)), l3 = n3, 0);
      return this._getCosPreSigUrl({ fileType: this.uploadFileType, fileName: u3, uploadMethod: t3, duration: this.duration, userID: r4.message.from, conversationType: Gt2(r4.message.conversationID) ? 1 : 2 }).then(function(e4) {
        var t4 = c3.isSimpleCos ? e4.preSig[0] : e4, n4 = t4.uploadUrl, o3 = t4.downloadUrl, i4 = t4.requestSnapshotUrl, i4 = void 0 === i4 ? void 0 : i4, s4 = t4.thumbUrl, a3 = t4.largeUrl, t4 = t4.fileKey, e4 = e4.uploadIP, e4 = void 0 === e4 ? "" : e4;
        return { url: c3._getRawOrUploadProxyUrl(n4), fileType: c3.uploadFileType, fileName: u3, resources: l3, downloadUrl: o3, requestSnapshotUrl: i4, thumbUrl: s4, largeUrl: a3, fileKey: t4, uploadIP: !c3.isPrivateNetWork() && e4, onProgress: function(e5) {
          if ("function" == typeof r4.onProgress)
            try {
              r4.onProgress(e5.percent);
            } catch (e6) {
              M2.w("onProgress callback error:", e6), M2.e(e6);
            }
        } };
      });
    } }, { key: "_genFileName", value: function(e3) {
      return "".concat(Ft2(), "-").concat(e3);
    } }, { key: "_setUploadFileType", value: function(e3) {
      this.uploadFileType = e3;
    } }, { key: "_getSnapshotInfoByUrl", value: function(e3, n3) {
      var o3 = this, i4 = "_getSnapshotInfoByUrl", s4 = new P2(i4);
      return this.req({ P: G2.VIDEO_COVER, data: { platform: this.getPlatform(), coverName: this._genFileName(ht2(99999)), requestSnapshotUrl: e3 } }).then(function(e4) {
        var t3, e4 = (e4.data || {}).snapshotUrl;
        return M2.l("".concat(o3._n, ".").concat(i4, " ok. snapshotUrl:").concat(e4)), s4.setMessage("snapshotUrl:".concat(e4)).end(), S2(e4) ? {} : wt2(t3 = so(e4, o3._fileDownloadProxy, o3._authKey, o3._fileDNList)).then(function(e5) {
          n3.snapshotInfo = { snapshotUrl: t3, snapshotWidth: e5.width, snapshotHeight: e5.height };
        });
      }).catch(function(e4) {
        return M2.w("".concat(o3._n, ".").concat(i4, " failed. error:"), e4), s4.setCode(e4.errorCode).setMessage(e4.errorInfo).end(), {};
      });
    } }, { key: "_getSmallImageInfoByUrl", value: function(t3, n3) {
      return wt2(so(t3, this._fileDownloadProxy, this._authKey, this._fileDNList)).then(function(e3) {
        n3.smallImageUrl = t3, n3.smallImageWidth = e3.width, n3.smallImageHeight = e3.height;
      });
    } }, { key: "_getLargeImageInfoByUrl", value: function(t3, n3) {
      return wt2(so(t3, this._fileDownloadProxy, this._authKey, this._fileDNList)).then(function(e3) {
        n3.largeImageUrl = t3, n3.largeImageWidth = e3.width, n3.largeImageHeight = e3.height;
      });
    } }, { key: "_isEmptyFileList", value: function(e3) {
      return !(!ut2(e3) || 0 !== e3.length);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }])), Pi = ["downloadKey", "pbDownloadKey", "messageList"], Ui = e2(function e3(t3) {
      p3(this, e3), this._n = "MergerMessageHandler", this._msgM = t3;
    }, [{ key: "uploadMergerMessage", value: function(e3, n3) {
      var o3 = "".concat(this._n, ".").concat("uploadMergerMessage"), e3 = (M2.d("".concat(o3, " message:"), e3, "messageBytes:".concat(n3)), JSON.parse(JSON.stringify(e3.payload)).messageList), i4 = e3.length, t3 = this._msgM.get(17).getFileDNList(), s4 = new P2("uploadMergerMessage");
      return e3.forEach(function(e4) {
        ao(e4.messageBody[0].type, e4.messageBody, t3);
      }), this._msgM.req({ P: G2.UPLOAD_MERGER_MSG, data: { messageList: e3 } }).then(function(e4) {
        M2.d("".concat(o3, " ok. response:"), e4.data);
        var e4 = e4.data, t4 = e4.pbDownloadKey, e4 = e4.downloadKey, t4 = { pbDownloadKey: t4, downloadKey: e4, messageNumber: i4 };
        return s4.setMessage("".concat(i4, "-").concat(n3, "-").concat(e4)).end(), t4;
      }).catch(function(e4) {
        throw M2.w("".concat(o3, " failed. error:"), e4), s4.setError(e4).end(), e4;
      });
    } }, { key: "downloadMergerMessage", value: function(i4) {
      var s4 = this, a3 = "".concat(this._n, ".").concat("downloadMergerMessage"), t3 = (M2.d("".concat(a3, " message:"), i4), i4.payload.downloadKey), r4 = this._msgM.getFileDownloadProxy(), c3 = this._msgM.getDownloadFileAuthKey(), u3 = new P2("downloadMergerMessage");
      return u3.setMessage("downloadKey:".concat(t3)), this._msgM.req({ P: G2.DOWNLOAD_MERGER_MSG, data: { downloadKey: t3 } }).then(function(e3) {
        M2.d("".concat(a3, " ok. response:"), e3.data);
        var t4, n3, o3 = s4._msgM.get(17).getFileDNList();
        return ct2(i4.clearElement) ? ((t4 = i4.payload).downloadKey, t4.pbDownloadKey, t4.messageList, t4 = W2(t4, Pi), i4.clearElement(), i4.setElement({ type: i4.type, content: y2({ messageList: e3.data.messageList }, t4) }, r4, c3, o3)) : (n3 = [], e3.data.messageList.forEach(function(e4) {
          S2(e4) || (e4 = new yo(e4, r4, c3, o3), n3.push(e4));
        }), i4.payload.messageList = n3, i4.payload.downloadKey = "", i4.payload.pbDownloadKey = ""), u3.end(), i4;
      }).catch(function(e3) {
        throw M2.w("".concat(a3, " failed. key:").concat(t3, " error:"), e3), u3.setError(e3).end(), e3;
      });
    } }, { key: "createMergerMessagePack", value: function(e3, t3, n3) {
      return e3.conversationType === R2.CONV_C2C ? this._createC2CMergerMessagePack(e3, t3, n3) : this._createGroupMergerMessagePack(e3, t3, n3);
    } }, { key: "_createC2CMergerMessagePack", value: function(e3, t3, n3) {
      var o3 = null, i4 = (t3 && (t3.offlinePushInfo && (o3 = t3.offlinePushInfo), true === t3.onlineUserOnly) && (o3 ? o3.disablePush = true : o3 = { disablePush: true }), []), s4 = (m2(t3) && m2(t3.messageControlInfo) && (s4 = (r4 = t3.messageControlInfo).excludedFromUnreadCount, a3 = r4.excludedFromLastMessage, r4 = r4.excludedFromContentModeration, true === s4 && i4.push("NoUnread"), true === a3 && i4.push("NoLastMsg"), true === r4) && i4.push("NoMsgCheck"), ""), a3 = (C2(e3.cloudCustomData) && 0 < e3.cloudCustomData.length && (s4 = e3.cloudCustomData), n3.pbDownloadKey), r4 = n3.downloadKey, n3 = n3.messageNumber, c3 = e3.payload, u3 = c3.title, l3 = c3.abstractList, c3 = c3.compatibleText, d3 = this._msgM.get(6), d3 = d3 && d3.isOnlineMessage(e3, t3) ? 0 : void 0;
      return { P: G2.SEND_C2C_MSG, data: { fromAccount: this._msgM.getMyUserID(), toAccount: e3.to, msgBody: [{ msgType: e3.type, msgContent: { pbDownloadKey: a3, downloadKey: r4, title: u3, abstractList: l3, compatibleText: c3, messageNumber: n3 } }], cloudCustomData: s4, clientTime: e3.clientTime, msgSeq: e3.sequence, msgRandom: e3.random, msgLifeTime: d3, offlinePushInfo: Lo(o3), messageControlInfo: 0 !== d3 ? i4 : void 0, isSupportExtension: true === e3.isSupportExtension ? 1 : 0, isRelayMessage: true === e3._relayFlag ? 1 : 0 } };
    } }, { key: "_createGroupMergerMessagePack", value: function(e3, t3, n3) {
      var o3 = null, i4 = (t3 && t3.offlinePushInfo && (o3 = t3.offlinePushInfo), []), s4 = (m2(t3) && m2(t3.messageControlInfo) && (s4 = (r4 = t3.messageControlInfo).excludedFromUnreadCount, a3 = r4.excludedFromLastMessage, r4 = r4.excludedFromContentModeration, true === s4 && i4.push("NoUnread"), true === a3 && i4.push("NoLastMsg"), true === r4) && i4.push("NoMsgCheck"), ""), a3 = (C2(e3.cloudCustomData) && 0 < e3.cloudCustomData.length && (s4 = e3.cloudCustomData), n3.pbDownloadKey), r4 = n3.downloadKey, n3 = n3.messageNumber, c3 = e3.payload, u3 = c3.title, l3 = c3.abstractList, c3 = c3.compatibleText, d3 = this._msgM.get(7), t3 = d3 && d3.isOnlineMessage(e3, t3) ? 1 : 0;
      return { P: G2.SEND_GRP_MSG, data: { fromAccount: this._msgM.getMyUserID(), groupID: e3.to, msgBody: [{ msgType: e3.type, msgContent: { pbDownloadKey: a3, downloadKey: r4, title: u3, abstractList: l3, compatibleText: c3, messageNumber: n3 } }], random: e3.random, priority: e3.priority, clientSequence: e3.clientSequence, groupAtInfo: void 0, cloudCustomData: s4, onlineOnlyFlag: t3, offlinePushInfo: Lo(o3), clientTime: e3.clientTime, needReadReceipt: true !== e3.needReadReceipt || d3.isMessageFromOrToAVChatroom(e3.to) ? 0 : 1, messageControlInfo: 0 == t3 ? i4 : void 0, isSupportExtension: true === e3.isSupportExtension ? 1 : 0, isRelayMessage: true === e3._relayFlag ? 1 : 0 } };
    } }]), bi = { ERR_SVR_COMM_SENSITIVE_TEXT: 80001, ERR_SVR_COMM_BODY_SIZE_LIMIT: 80002, OPEN_SERVICE_OVERLOAD_ERROR: 60022, ERR_SVR_MSG_PKG_PARSE_FAILED: 20001, ERR_SVR_MSG_INTERNAL_AUTH_FAILED: 20002, ERR_SVR_MSG_INVALID_ID: 20003, ERR_SVR_MSG_PUSH_DENY: 20006, ERR_SVR_MSG_IN_PEER_BLACKLIST: 20007, ERR_SVR_MSG_BOTH_NOT_FRIEND: 20009, ERR_SVR_MSG_NOT_PEER_FRIEND: 20010, ERR_SVR_MSG_NOT_SELF_FRIEND: 20011, ERR_SVR_MSG_SHUTUP_DENY: 20012, ERR_SVR_GROUP_INVALID_PARAMETERS: 10004, ERR_SVR_GROUP_PERMISSION_DENY: 10007, ERR_SVR_GROUP_NOT_FOUND: 10010, ERR_SVR_GROUP_INVALID_GROUPID: 10015, ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY: 10016, ERR_SVR_GROUP_SHUTUP_DENY: 10017, MSG_SEND_FAIL: 2100, OVER_FREQUENCY_LIMIT: 2996 }, wi = [k2.MSG_ONPROGRESS_ERR, k2.MSG_I_SELECT_F_FIRST, k2.MSG_I_TYPES_LIMIT, k2.MSG_F_IS_EMPTY, k2.MSG_I_SIZE_LIMIT, k2.MSG_F_SELECT_F_FIRST, k2.MSG_F_SIZE_LIMIT, k2.MSG_V_SIZE_LIMIT, k2.MSG_V_TYPES_LIMIT, k2.MSG_A_UPLOAD_FAIL, k2.MSG_A_SIZE_LIMIT, k2.COS_UNDETECTED];
    function Fi(e3) {
      p3(this, Fi), (e3 = i3(this, Fi, [e3]))._n = "UploadModule", e3.TIMUploadPlugin = null, e3.timUploadPlugin = null, e3.COSSDK = null, e3._cosUploadMethod = null, e3.expiredTimeLimit = 600, e3.appid = 0, e3.bucketName = "", e3.ciUrl = "", e3.directory = "", e3.downloadUrl = "", e3.uploadUrl = "", e3.region = "ap-shanghai", e3.cos = null, e3.cosOptions = { secretId: "", secretKey: "", sessionToken: "", expiredTime: 0 }, e3.uploadFileType = "", e3.duration = 900, e3.tryCount = 0, e3.UPLOAD_SIZE_LIMIT = { A: 20971520, F: 104857600, I: 20971520, V: 104857600 }, e3.isSimpleCos = false, e3._fileDownloadProxy = "", e3._authKey = "", e3._fileDNList = Oi;
      var t3 = e3.getIEmitInst();
      return t3.on(U2.A2KEY_AND_TINYID_UPDATED, e3._init, e3), t3.on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    function qi(e3) {
      var t3 = false;
      return Object.values(bi).includes(e3) && (t3 = true), t3 = 120001 <= e3 && e3 <= 13e4 || 10100 <= e3 && e3 <= 10200 ? true : t3;
    }
    t2(Qi, c2);
    var xi = e2(Qi, [{ key: "createTextMessage", value: function(e3) {
      var t3 = this.getMyUserID(), n3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), new Do(e3)), e3 = C2(e3.payload) ? e3.payload : e3.payload.text, e3 = new no({ text: e3 }), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e3), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "createImageMessage", value: function(e3) {
      var t3 = this.getMyUserID(), n3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), new Do(e3));
      if (v3) {
        var o3 = e3.payload.file;
        if (st2(o3))
          return void this.warn("FileUnsupportedInMP", "createImageMessage");
        var i4 = o3.tempFiles[0].path || o3.tempFiles[0].tempFilePath, o3 = { url: i4, name: i4.slice(i4.lastIndexOf("/") + 1), size: o3.tempFiles && o3.tempFiles[0].size || 1, type: i4.slice(i4.lastIndexOf(".") + 1).toLowerCase() };
        e3.payload.file = o3;
      } else
        ve2 ? (o3 = { url: (i4 = e3.payload.file).uri, name: i4.fileName, size: i4.fileSize || 1, type: i4.type, width: i4.width, height: i4.height }, e3.payload.file = o3) : Ie2 && (st2(e3.payload.file) ? (i4 = e3.payload.file, e3.payload.file = { files: [i4] }) : m2(e3.payload.file) && "undefined" != typeof index && (o3 = e3.payload.file.tempFiles[0], e3.payload.file = { files: [o3] }));
      i4 = this.get(17).getFileDNList(), o3 = new uo({ imageFormat: je2.UNKNOWN, uuid: this._generateUUID(e3.payload.file), file: e3.payload.file }, this.getFileDownloadProxy(), this.getDownloadFileAuthKey(), i4), i4 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(o3), n3.setNickAndAvatar(i4), n3.setNameCard(this._getNameCardByGroupID(n3)), this._messageOptionsMap.set(n3.clientSequence, e3), n3;
    } }, { key: "createAudioMessage", value: function(e3) {
      var t3 = e3.payload.file, n3 = (v3 && (n3 = { url: t3.tempFilePath, name: t3.tempFilePath.slice(t3.tempFilePath.lastIndexOf("/") + 1), size: t3.fileSize, second: parseInt(t3.duration) / 1e3, type: t3.tempFilePath.slice(t3.tempFilePath.lastIndexOf(".") + 1).toLowerCase() }, e3.payload.file = n3), ve2 && (n3 = { url: t3.uri, name: t3.uri.slice(t3.uri.lastIndexOf("/") + 1), size: t3.fileSize || 1, second: Math.floor(t3.duration / 1e3), type: t3.uri.slice(t3.uri.lastIndexOf(".") + 1).toLowerCase() }, e3.payload.file = n3, S2(t3.uri)) && this.warn("VoiceFileInRN"), this.getMyUserID()), o3 = (e3.currentUser = n3, e3.senderTinyID = this.getMyTinyID(), this.get(17).getFileDNList()), i4 = new Do(e3), t3 = new po({ second: Math.floor(t3.duration / 1e3), size: t3.fileSize || t3.size || 1, url: t3.tempFilePath || t3.uri, uuid: this._generateUUID(e3.payload.file) }, this.getFileDownloadProxy(), this.getDownloadFileAuthKey(), o3), o3 = this._getNickAndAvatarByUserID(n3);
      return i4.setElement(t3), i4.setNickAndAvatar(o3), i4.setNameCard(this._getNameCardByGroupID(i4)), this._messageOptionsMap.set(i4.clientSequence, e3), i4;
    } }, { key: "createVideoMessage", value: function(e3) {
      var t3 = this.getMyUserID(), n3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), e3.payload.file.thumbUrl = "", e3.payload.file.thumbSize = 0, {});
      if (v3) {
        if (ge2)
          return void this.warn("VideoUnsupportedInAlipay");
        if (st2(e3.payload.file))
          return void this.warn("FileUnsupportedInMP", "createVideoMessage");
        var o3 = e3.payload.file;
        O2(o3.tempFiles) && (o3 = o3.tempFiles[0]), n3.url = o3.tempFilePath, n3.name = o3.tempFilePath.slice(o3.tempFilePath.lastIndexOf("/") + 1), n3.size = o3.size || 1, n3.second = o3.duration || 0, n3.type = o3.tempFilePath.slice(o3.tempFilePath.lastIndexOf(".") + 1).toLowerCase();
      } else
        ve2 ? (o3 = e3.payload.file, n3.url = o3.uri, n3.name = o3.fileName, n3.size = o3.fileSize || 1, n3.second = o3.duration || 0, n3.type = o3.type.split("/")[1]) : Ie2 && (st2(e3.payload.file) ? (o3 = e3.payload.file, e3.payload.file.files = [o3]) : m2(e3.payload.file) && "undefined" != typeof index && (o3 = e3.payload.file.tempFile, e3.payload.file.files = [o3]), o3 = e3.payload.file, n3.url = window.URL.createObjectURL(o3.files[0]), n3.name = o3.files[0].name, n3.size = o3.files[0].size || 1, n3.second = o3.files[0].duration || 0, n3.type = o3.files[0].type.split("/")[1]);
      e3.payload.file.videoFile = n3;
      var o3 = this.get(17).getFileDNList(), i4 = new Do(e3), n3 = new Io({ videoFormat: n3.type, videoSecond: Kt2(n3.second, 0), videoSize: n3.size, remoteVideoUrl: "", videoUrl: n3.url, videoUUID: this._generateUUID(e3.payload.file.videoFile), thumbUUID: this._generateUUID(e3.payload.file.videoFile, "jpg"), thumbWidth: e3.payload.file.width || 200, thumbHeight: e3.payload.file.height || 200, thumbUrl: e3.payload.file.thumbUrl, thumbSize: e3.payload.file.thumbSize, thumbFormat: "jpg" }, this.getFileDownloadProxy(), this.getDownloadFileAuthKey(), o3), o3 = this._getNickAndAvatarByUserID(t3);
      return i4.setElement(n3), i4.setNickAndAvatar(o3), i4.setNameCard(this._getNameCardByGroupID(i4)), this._messageOptionsMap.set(i4.clientSequence, e3), i4;
    } }, { key: "createCustomMessage", value: function(e3) {
      var t3 = this.getMyUserID(), n3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), new Do(e3)), e3 = new vo({ data: e3.payload.data, description: e3.payload.description, extension: e3.payload.extension }), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e3), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "createFaceMessage", value: function(e3) {
      var t3 = this.getMyUserID(), n3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), new Do(e3)), e3 = new lo(e3.payload), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e3), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "createMergerMessage", value: function(e3) {
      var t3 = this.getMyUserID(), t3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), this._getNickAndAvatarByUserID(t3)), n3 = new Do(e3), e3 = new Co(e3.payload);
      return n3.setElement(e3), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3.setRelayFlag(true), n3;
    } }, { key: "createForwardMessage", value: function(e3) {
      var t3, n3, o3 = e3.to, i4 = e3.conversationType, s4 = e3.priority, a3 = e3.payload, r4 = e3.needReadReceipt, c3 = e3.receiverList;
      return O2(a3._elements) ? (t3 = this.getMyUserID(), n3 = this._getNickAndAvatarByUserID(t3), a3.type === R2.MSG_GRP_TIP ? E2({ code: k2.MSG_FORWARD_TYPE_INVALID }) : (i4 = { to: o3, conversationType: i4, conversationID: "".concat(i4).concat(o3), priority: s4, isPlaceMessage: 0, status: An, currentUser: t3, senderTinyID: this.getMyTinyID(), cloudCustomData: e3.cloudCustomData || a3.cloudCustomData || "", needReadReceipt: r4, receiverList: c3, isSupportExtension: e3.isSupportExtension || false }, (o3 = new Do(i4)).setElement(a3._elements[0]), o3.setNickAndAvatar(n3), o3.setNameCard(this._getNameCardByGroupID(a3)), o3.setRelayFlag(true), o3)) : E2({ code: k2.MSG_FORWARD_INVALID_ELEMENTS });
    } }, { key: "downloadMergerMessage", value: function(e3) {
      return this._mergerMessageHandler.downloadMergerMessage(e3);
    } }, { key: "createFileMessage", value: function(e3) {
      if (v3) {
        if (!le2 && !pe2 && !fe2)
          return;
        var t3 = I2.getSystemInfoSync().SDKVersion;
        if (le2 && xt2(t3, "2.5.0") < 0)
          return void this.warn("WXChooseMessageFile");
        if (pe2 && xt2(t3, "1.18.0") < 0)
          return void this.warn("QQChooseMessageFile");
      }
      Ie2 || fe2 ? st2(e3.payload.file) ? (t3 = e3.payload.file, e3.payload.file = { files: [t3] }) : m2(e3.payload.file) && "undefined" != typeof index && (o3 = (t3 = e3.payload.file).tempFiles, t3 = t3.files, n3 = null, O2(o3) ? n3 = o3[0] : O2(t3) && (n3 = t3[0]), e3.payload.file = { files: [n3] }) : le2 || pe2 ? (t3 = y2(y2({}, (o3 = e3.payload.file.tempFiles)[0]), {}, { url: o3[0].path }), e3.payload.file = { files: [t3] }) : ve2 && (o3 = y2(y2({}, n3 = e3.payload.file), {}, { url: n3.uri }), e3.payload.file = { files: [o3] });
      var t3 = this.getMyUserID(), n3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), new Do(e3)), o3 = new mo({ uuid: this._generateUUID(e3.payload.file), file: e3.payload.file }), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(o3), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), this._messageOptionsMap.set(n3.clientSequence, e3), n3;
    } }, { key: "createLocationMessage", value: function(e3) {
      var t3 = this.getMyUserID(), n3 = (e3.currentUser = t3, e3.senderTinyID = this.getMyTinyID(), new Do(e3)), e3 = new Mo(e3.payload), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e3), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "_onNoModule", value: function() {
      return E2({ code: k2.NO_MODULE });
    } }, { key: "sendMessageInstance", value: function(i4, s4) {
      var a3 = this;
      if (false === this.get(29).filterMessage(i4, s4))
        return i4.hasRiskContent = true, this._onSendMessageFailed(i4, new L2({ code: k2.PROFANITY_FOUND }));
      var r4, c3, u3, l3, t3 = null;
      if (i4.conversationType === R2.CONV_C2C)
        t3 = this.get(6);
      else {
        if (i4.conversationType !== R2.CONV_GROUP)
          return E2({ code: k2.MSG_INVALID_CONV_TYPE });
        t3 = this.get(7);
      }
      return t3 ? (c3 = "".concat(this._n, ".sendMessageInstance"), u3 = this.get(11), l3 = t3.isOnlineMessage(i4, s4), this.get(17).upload(i4).then(function() {
        return a3._getSendMessageSpecifiedKey(i4) === jn && a3.get(26).addSuccessCount(Jn), a3._guardForGroup(i4).then(function() {
          if (!i4.isSendable())
            return E2({ code: k2.MSG_F_URL_IS_EMPTY });
          a3._addSendMessageTotalCount(i4), r4 = Date.now();
          var e3 = function(e4) {
            var t4 = "utf-8";
            Ie2 && document && (t4 = document.charset.toLowerCase());
            var n3, o3 = 0, i5 = e4.length;
            if ("utf-8" === t4 || "utf8" === t4)
              for (var s5 = 0; s5 < i5; s5++)
                (n3 = e4.codePointAt(s5)) <= 127 ? o3 += 1 : n3 <= 2047 ? o3 += 2 : n3 <= 65535 ? o3 += 3 : (o3 += 4, s5++);
            else if ("utf-16" === t4 || "utf16" === t4)
              for (var a4 = 0; a4 < i5; a4++)
                (n3 = e4.codePointAt(a4)) <= 65535 ? o3 += 2 : (o3 += 4, a4++);
            else
              o3 = e4.replace(/[^\x00-\xff]/g, "aa").length;
            return o3;
          }(JSON.stringify(i4));
          return i4.type === R2.MSG_MERGER && 11264 < e3 ? a3._mergerMessageHandler.uploadMergerMessage(i4, e3).then(function(e4) {
            e4 = a3._mergerMessageHandler.createMergerMessagePack(i4, s4, e4);
            return a3.req(e4);
          }) : (u3.setMessageRandom(i4), t3.sendMessage(i4, s4));
        }).then(function(e3) {
          var e3 = e3.data, t4 = e3.time, n3 = e3.sequence, o3 = e3.readReceiptCode, e3 = e3.messageDropReason, e3 = (A2(o3) && 0 !== o3 && (new P2("sendMessageWithReceipt").setMessage("from:".concat(i4.from, " to:").concat(i4.to, " sequence:").concat(n3, " readReceiptCode:").concat(o3)).end(), M2.w("".concat(c3, " readReceiptCode:").concat(o3, " message:").concat(a3.getErrMsg(o3)))), e3 && (o3 = new P2("messageDropReason"), e3 = "from:".concat(i4.from, " to:").concat(i4.to, " sequence:").concat(n3, " messageDropReason:").concat(e3), o3.setMessage(e3).end(), M2.w("".concat(c3, " ").concat(e3))), a3._addSendMessageSuccessCount(i4, r4), a3._messageOptionsMap.delete(i4.clientSequence), true === i4.isResend && (o3 = u3.findMessage(i4.ID)) && (M2.l("".concat(c3, " resend ok. ID:").concat(o3.ID)), u3.deleteLocalMessage(o3)), i4.status = On, i4.time = t4, false);
          return i4.conversationType === R2.CONV_GROUP ? i4.sequence = n3 : i4.conversationType === R2.CONV_C2C && (o3 = u3.getLatestMessageSentByMe(i4.conversationID)) && (t4 = o3.nick, n3 = o3.avatar, t4 === i4.nick && n3 === i4.avatar || (e3 = true)), e3 && u3.modifyMessageSentByMe({ conversationID: i4.conversationID, latestNick: i4.nick, latestAvatar: i4.avatar }), true === l3 ? i4._onlineOnlyFlag = true : (u3.appendToMessageList(i4), o3 = i4, m2(s4) && m2(s4.messageControlInfo) && (true === s4.messageControlInfo.excludedFromLastMessage && (i4._isExcludedFromLastMessage = true, o3 = ""), true === s4.messageControlInfo.excludedFromUnreadCount) && (i4._isExcludedFromUnreadCount = true), t4 = i4.conversationType, Nt2(i4.to) && (t4 = R2.CONV_TOPIC, a3.get(10).onMessageSent({ groupID: jt2(i4.to), topicID: i4.to, lastMessage: o3 })), u3.onMessageSent({ conversationOptionsList: [{ conversationID: i4.conversationID, unreadCount: 0, type: t4, subType: i4.conversationSubType, lastMessage: o3 }] })), i4._relayFlag || "TIMImageElem" !== i4.type || Bt2(i4.payload.imageInfoArray), T2({ message: i4 });
        });
      }).catch(function(e3) {
        return a3._onSendMessageFailed(i4, e3, l3);
      })) : this._onNoModule();
    } }, { key: "_guardForGroup", value: function(e3) {
      if (e3.conversationType !== R2.CONV_GROUP)
        return Promise.resolve();
      var t3 = this.get(7);
      if (!t3)
        return this._onNoModule();
      if (Ot2({ groupID: e3.to })) {
        var n3 = t3.getLocalGroupProfile(e3.to);
        if (n3 && n3.isSupportTopic)
          return E2({ code: k2.MSG_SEND_GRP_WITH_TOPIC_FAIL });
      }
      return t3.guardForAVChatRoom(e3);
    } }, { key: "_onSendMessageFailed", value: function(e3, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] && arguments[2], o3 = "".concat(this._n, "._onSendMessageFailed"), i4 = (e3.status = Nn, 80001 !== t3.code && 80004 !== t3.code || (e3.hasRiskContent = true), this.get(11)), s4 = (i4.deleteMessageRandom(e3), 10100 <= t3.code && t3.code <= 10200 || 120001 <= t3.code && t3.code <= 13e4), n3 = (n3 || s4 || true === i4.appendToMessageList(e3) && M2.l("".concat(o3, " message stored, ID:").concat(e3.ID)), this._addSendMessageFailCountOnUser(e3, t3), new P2("sendMessage")), s4 = "head.seq:".concat(t3.data.headSeq, " type:").concat(e3.type, " from:").concat(e3.from, " to:").concat(e3.to);
      return Ie2 && ("connection" in navigator && (i4 = navigator.connection, s4 += " downlink:".concat(i4.downlink, " effectiveType:").concat(i4.effectiveType, " rtt:").concat(i4.rtt)), "memory" in window.performance) && (i4 = window.performance.memory, s4 += " usedJSHeapSize:".concat(i4.usedJSHeapSize, " totalJSHeapSize:").concat(i4.totalJSHeapSize, " jsHeapSizeLimit:").concat(i4.jsHeapSizeLimit)), n3.setMessage(s4).setError(t3).end(), M2.e("".concat(o3, " ").concat(s4, " error:"), t3), E2(new L2({ code: t3 && t3.code ? t3.code : k2.MSG_SEND_FAIL, message: t3 && t3.message ? t3.message : void 0, data: { message: e3 } }));
    } }, { key: "_getSendMessageSpecifiedKey", value: function(e3) {
      if ([R2.MSG_IMAGE, R2.MSG_AUDIO, R2.MSG_VIDEO, R2.MSG_FILE].includes(e3.type))
        return jn;
      if (e3.conversationType === R2.CONV_C2C)
        return Kn;
      if (e3.conversationType === R2.CONV_GROUP) {
        var t3 = this.get(7);
        if (t3) {
          t3 = t3.getLocalGroupProfile(e3.to);
          if (t3)
            return e3 = t3.type, At2(e3) ? Yn : Wn;
        }
      }
    } }, { key: "_addSendMessageTotalCount", value: function(e3) {
      e3 = this._getSendMessageSpecifiedKey(e3);
      e3 && this.get(26).addTotalCount(e3);
    } }, { key: "_addSendMessageSuccessCount", value: function(e3, t3) {
      var n3, e3 = this._getSendMessageSpecifiedKey(e3);
      e3 && ((n3 = this.get(26)).addSuccessCount(e3), n3.addCost(e3, tn(t3, false)));
    } }, { key: "_addSendMessageFailCountOnUser", value: function(e3, t3) {
      var n3, t3 = t3.code, t3 = void 0 === t3 ? -1 : t3, o3 = this.get(26), e3 = this._getSendMessageSpecifiedKey(e3);
      e3 === jn && (n3 = false, n3 = wi.includes(t3) ? true : n3) ? o3.addFailedCountOfUserSide(Jn) : qi(t3) && e3 && o3.addFailedCountOfUserSide(e3);
    } }, { key: "resendMessage", value: function(e3, t3) {
      return e3.isResend = true, e3.status = An, this.sendMessageInstance(e3, t3);
    } }, { key: "revokeMessage", value: function(n3) {
      var o3, i4, t3 = this, e3 = null;
      return n3.conversationType === R2.CONV_C2C ? e3 = this.get(6) : n3.conversationType === R2.CONV_GROUP && (e3 = this.get(7)), e3 ? ((o3 = new P2("revokeMessage")).setMessage("type:".concat(n3.type, " from:").concat(n3.from, " to:").concat(n3.to)), i4 = "".concat(this._n, ".").concat("revokeMessage"), e3.revokeMessage(n3).then(function(e4) {
        var e4 = e4.data.recallRetList;
        return S2(e4) || 0 === e4[0].retCode ? (M2.i("".concat(i4, " ok. ID:").concat(n3.ID)), n3.isRevoked = true, o3.end(), t3.get(11).onMessageRevoked([n3]), T2({ message: n3 })) : (e4 = new L2({ code: e4[0].retCode, data: { message: n3 } }), o3.setCode(e4.code).setMoreMessage(e4.message).end(), E2(e4));
      }).catch(function(e4) {
        o3.setError(e4).end();
        var t4 = new L2({ code: e4 && e4.code ? e4.code : k2.MSG_REVOKE_FAIL, message: e4 && e4.message ? e4.message : void 0, data: { message: n3 } });
        return M2.w("".concat(i4, " failed. error:"), e4), E2(t4);
      })) : this._onNoModule();
    } }, { key: "deleteMessage", value: function(e3) {
      var t3 = this, n3 = null, o3 = e3[0], i4 = o3.conversationID, s4 = "", a3 = [], r4 = [];
      if (o3.conversationType === R2.CONV_C2C)
        n3 = this.get(6), s4 = i4.replace(R2.CONV_C2C, ""), e3.forEach(function(e4) {
          e4 && e4.status === On && e4.conversationID === i4 && (e4._onlineOnlyFlag || a3.push("".concat(e4.sequence, "_").concat(e4.random, "_").concat(e4.time)), r4.push(e4));
        });
      else if (o3.conversationType === R2.CONV_GROUP)
        n3 = this.get(7), s4 = i4.replace(R2.CONV_GROUP, ""), e3.forEach(function(e4) {
          e4 && e4.status === On && e4.conversationID === i4 && (e4._onlineOnlyFlag || a3.push("".concat(e4.sequence)), r4.push(e4));
        });
      else if (o3.conversationType === R2.CONV_SYSTEM)
        return E2({ code: k2.CANNOT_DELETE_GRP_SYSTEM_NOTICE });
      if (!n3)
        return this._onNoModule();
      if (0 === a3.length)
        return this._onMessageDeleted(r4);
      30 < a3.length && (a3 = a3.slice(0, 30), r4 = r4.slice(0, 30));
      var c3 = new P2("deleteMessage"), u3 = (c3.setMessage("to:".concat(s4, " count:").concat(a3.length)), "".concat(this._n, ".").concat("deleteMessage"));
      return n3.deleteMessage({ to: s4, keyList: a3 }).then(function(e4) {
        return c3.end(), M2.i("".concat(u3, " ok")), t3._onMessageDeleted(r4);
      }).catch(function(e4) {
        c3.setError(e4).end(), M2.w("".concat(u3, " failed. error:"), e4);
        e4 = new L2({ code: e4 && e4.code ? e4.code : k2.MSG_DELETE_FAIL, message: e4 && e4.message ? e4.message : void 0 });
        return E2(e4);
      });
    } }, { key: "_onMessageDeleted", value: function(e3) {
      return this.get(11).onMessageDeleted(e3), D2({ messageList: e3 });
    } }, { key: "translateText", value: function(e3) {
      var o3 = "".concat(this._n, ".").concat("translateText"), t3 = e3.sourceTextList, n3 = e3.sourceLanguage, e3 = e3.targetLanguage, i4 = new P2("translateText");
      return i4.setMessage("sourceLanguage:".concat(n3, " targetLanguage:").concat(e3)), this.req({ P: G2.TRANSLATE_TEXT, data: { sourceTextList: t3, source: n3 || "auto", target: e3, from: this.getMyTinyID(), SDKAppID: this.getSDKAppID() } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.error, n4 = e4.requestID, e4 = e4.translatedTextList;
        if (0 === t4.code)
          return i4.end(), M2.i("".concat(o3, " ok. requestID:").concat(n4)), T2({ translatedTextList: e4 });
        throw y2(y2({}, t4), {}, { requestID: n4 });
      }).catch(function(e4) {
        return i4.setCode(e4.code).setMoreMessage(e4.requestID).end(), M2.w("".concat(o3, " failed. error:"), e4), E2({ code: e4.code || k2.TRANSLATE_TEXT_FAIL, message: e4.message });
      });
    } }, { key: "convertVoiceToText", value: function(e3) {
      var t3, o3, i4, n3 = e3.message, e3 = e3.language, s4 = n3.payload.url, n3 = (n3.from === this.getMyUserID() && "out" === n3.flow && (s4 = n3.payload.remoteAudioUrl), /\.(wav|pcm|ogg-opus|speex|silk|mp3|m4a|aac|amr)/);
      return n3.test(s4) ? (n3 = n3.exec(s4)[1] || "mp3", t3 = "16k_zh-PY", e3 ? "zh (cmn-Hans-CN)" === e3 ? t3 = "16k_zh" : "en-US" === e3 ? t3 = "16k_en" : "yue-Hant-HK" === e3 ? t3 = "16k_yue" : "ja-JP" === e3 && (t3 = "16k_ja") : t3 = "16k_zh-PY", e3 = "serviceType:".concat(t3, " url:").concat(s4), o3 = "".concat(this._n, ".").concat("convertVoiceToText"), M2.i("".concat(o3, " ").concat(e3)), (i4 = new P2("convertVoiceToText")).setMessage(e3), this.req({ P: G2.VOICE_TO_TEXT, data: { url: s4, language: t3, SDKAppID: this.getSDKAppID(), format: n3 } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.error, n4 = e4.requestID, e4 = e4.result;
        if (0 === t4.code)
          return i4.end(), M2.i("".concat(o3, " ok. requestID:").concat(n4)), T2({ result: e4 });
        throw y2(y2({}, t4), {}, { requestID: n4 });
      }).catch(function(e4) {
        return i4.setCode(e4.code).setMoreMessage(e4.requestID || "").end(), M2.w("".concat(o3, " failed. error:"), e4), E2({ code: k2.VOICE_TO_TEXT_FAIL });
      })) : E2({ code: k2.UNSUPPORTED_VOICE_FORMAT });
    } }, { key: "modifyRemoteMessage", value: function(n3) {
      var o3 = this;
      if (false === this.get(29).filterMessage(n3))
        return n3.hasRiskContent = true, E2({ code: k2.PROFANITY_FOUND, data: { message: n3 } });
      var e3 = null, t3 = n3.conversationType, i4 = n3.to;
      if (t3 === R2.CONV_C2C)
        e3 = this.get(6);
      else if (t3 === R2.CONV_GROUP) {
        if (!(e3 = this.get(7)))
          return this._onNoModule();
        if (e3.isMessageFromOrToAVChatroom(i4))
          return E2({ code: k2.MSG_MODIFY_DISABLED_IN_AV, data: { message: n3 } });
      }
      var s4 = new P2("modifyMessage"), a3 = (s4.setMessage("to:".concat(i4)), "".concat(this._n, ".modifyRemoteMessage"));
      return e3.modifyRemoteMessage(n3).then(function(e4) {
        s4.end(), M2.i("".concat(a3, " ok"));
        e4 = o3._onModifyRemoteMessageResp(n3, e4.data);
        return T2({ message: e4 });
      }).catch(function(e4) {
        var t4;
        return s4.setCode(e4.code).setMoreMessage(e4.message).end(), M2.w("".concat(a3, " failed. error:"), e4), 20027 === e4.code ? (t4 = o3._onModifyRemoteMessageResp(n3, e4.data), E2({ code: k2.MSG_MODIFY_CONFLICT, data: { message: t4 } })) : E2({ code: e4.code, message: e4.message, data: { message: n3 } });
      });
    } }, { key: "_onModifyRemoteMessageResp", value: function(e3, t3) {
      M2.d("".concat(this._n, "._onModifyRemoteMessageResp options:"), t3);
      var n3 = e3.conversationType, o3 = e3.from, i4 = e3.to, s4 = e3.random, a3 = e3.sequence, e3 = e3.time, r4 = t3.elements, c3 = t3.messageVersion, t3 = t3.cloudCustomData, t3 = void 0 === t3 ? "" : t3;
      return this.get(11).onMessageModified({ conversationType: n3, from: o3, to: i4, time: e3, random: s4, sequence: a3, elements: r4, cloudCustomData: t3, messageVersion: c3 });
    } }, { key: "_generateUUID", value: function(e3, t3) {
      var n3 = this.get(12), n3 = "".concat(n3.getSDKAppID(), "-").concat(n3.getUserID(), "-").concat(gt2());
      return t3 ? "".concat(n3, ".").concat(t3) : (e3 = (t3 = e3.name || e3.value || e3.url || e3.tempFilePath) && t3.slice(t3.lastIndexOf(".") + 1)) ? "".concat(n3, ".").concat(e3) : n3;
    } }, { key: "getMessageOption", value: function(e3) {
      return this._messageOptionsMap.get(e3);
    } }, { key: "_getNickAndAvatarByUserID", value: function(e3) {
      return this.get(4).getNickAndAvatarByUserID(e3);
    } }, { key: "_getNameCardByGroupID", value: function(e3) {
      if (e3.conversationType === R2.CONV_GROUP) {
        var t3 = this.get(7);
        if (t3)
          return t3.getMyNameCardByGroupID(e3.to);
      }
      return "";
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._messageOptionsMap.clear();
    } }]), Vi = (t2(Zi, c2), e2(Zi, [{ key: "onMsgExtNotify", value: function(e3) {
      var o3 = this, e3 = e3.dataList, t3 = e3.messageInfo, i4 = e3.operateType, n3 = e3.operateResultList, s4 = e3.tinyID, e3 = e3.globalSequence, a3 = t3.clientTime, t3 = t3.random, r4 = "".concat(s4, "-").concat(a3, "-").concat(t3), c3 = [], u3 = [], l3 = (M2.l("".concat(this._n, ".onMsgExtNotify messageID:").concat(r4, " operateType:").concat(i4, " globalSequence:").concat(e3)), this._updateGlobalSeq(r4, e3), false), d3 = false;
      n3.forEach(function(e4) {
        var t4 = e4.extensions, t4 = void 0 === t4 ? [] : t4, n4 = e4.clearSequence;
        1 === i4 ? (l3 = true, t4.forEach(function(e5) {
          c3.push({ key: e5.key, value: e5.value });
        }), o3._updateLocalExt(r4, t4)) : 2 === i4 ? (d3 = true, t4.forEach(function(e5) {
          u3.push(e5.key);
        }), o3._updateLocalExt(r4, t4)) : 3 === i4 && (d3 = true, o3._hasLocalExt(r4) && o3._getLocalExt(r4).forEach(function(e5, t5) {
          e5.seq <= n4 && !S2(e5.value) && u3.push(t5);
        }), o3._clearLocalExt(r4, n4));
      }), l3 && this.emitOEvt(h2.MESSAGE_EXTENSIONS_UPDATED, { messageID: r4, extensions: c3 }), d3 && this.emitOEvt(h2.MESSAGE_EXTENSIONS_DELETED, { messageID: r4, keyList: u3 });
    } }, { key: "setMessageExtensions", value: function(e3, t3) {
      var o3, n3, i4, s4, a3, r4, c3, u3 = "setMessageExtensions";
      return this.canIUse(g2.MSG_EXT) ? (o3 = "".concat(this._n, ".").concat(u3), n3 = e3.ID, i4 = e3.conversationID, s4 = e3.sequence, a3 = e3.time, r4 = d2(t3), 20 < t3.length && (r4 = t3.slice(0, 20), M2.w("".concat(o3, ". the length of extensions cannot exceed 20."))), t3 = "convID:".concat(i4, " messageID:").concat(n3, " sequence:").concat(s4, " time:").concat(a3, " count:").concat(r4.length), (c3 = new P2(u3)).setMessage(t3), M2.l("".concat(o3, " ").concat(t3)), this._modifyMsgExts(e3, r4).then(function(e4) {
        var t4 = e4.resultList, n4 = e4.successCount, e4 = e4.failureCount, n4 = "successCount:".concat(n4, " failCount:").concat(e4);
        return c3.setMoreMessage(n4).end(), M2.l("".concat(o3, " ok. ").concat(n4)), T2({ extensions: t4 });
      }).catch(function(e4) {
        return c3.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      })) : this.noUse(u3);
    } }, { key: "getMessageExtensions", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4, c3 = this, u3 = "getMessageExtensions";
      return this.canIUse(g2.MSG_EXT) ? (t3 = "".concat(this._n, ".").concat(u3), n3 = e3.ID, s4 = e3.conversationID, o3 = e3.sequence, i4 = e3.time, s4 = "convID:".concat(s4, " messageID:").concat(n3, " sequence:").concat(o3, " time:").concat(i4), (a3 = new P2(u3)).setMessage(s4), r4 = void M2.l("".concat(t3, " ").concat(s4)), this.getMsgExtsMap.has(n3) && (r4 = this._getGlobalSeq(n3)), this._getMsgExts(e3, r4).then(function(e4) {
        return a3.end(), M2.l("".concat(t3, " ok. extCount:").concat(e4.length)), N3(r4) && 0 < e4.length && c3.getMsgExtsMap.set(n3, 1), T2({ extensions: e4 });
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this.noUse(u3);
    } }, { key: "deleteMessageExtensions", value: function(e3, t3) {
      var i4, n3, s4, o3, a3, r4, c3, u3 = "deleteMessageExtensions";
      return this.canIUse(g2.MSG_EXT) ? (i4 = "".concat(this._n, ".").concat(u3), n3 = [], s4 = 3, S2(t3) || (s4 = 2, t3.forEach(function(e4) {
        n3.push({ key: e4, value: "", seq: 0 });
      })), t3 = e3.ID, r4 = e3.conversationID, o3 = e3.sequence, a3 = e3.time, r4 = "convID:".concat(r4, " messageID:").concat(t3, " sequence:").concat(o3, " time:").concat(a3, " operateType:").concat(s4), (c3 = new P2(u3)).setMessage(r4), M2.l("".concat(i4, " ").concat(r4)), this._modifyMsgExts(e3, n3, s4).then(function(e4) {
        var t4 = e4.resultList, n4 = e4.successCount, e4 = e4.failureCount, o4 = "";
        return 2 === s4 && (o4 = "success count:".concat(n4, " fail count:").concat(e4)), c3.setMoreMessage("".concat(o4)).end(), M2.l("".concat(i4, " ok. ").concat(o4)), T2({ extensions: t4 });
      }).catch(function(e4) {
        return c3.setError(e4).end(), M2.e("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : this.noUse(u3);
    } }, { key: "_modifyMsgExts", value: function(n3, e3) {
      var o3 = this, t3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1, i4 = Nt2(n3.to) ? R2.CONV_TOPIC : n3.conversationType, s4 = void 0, a3 = (3 !== t3 && (s4 = this._getReqExts(n3, e3)), null);
      switch (i4) {
        case R2.CONV_C2C:
          a3 = this.get(6);
          break;
        case R2.CONV_GROUP:
          a3 = this.get(7);
          break;
        case R2.CONV_TOPIC:
          a3 = this.get(10);
          break;
        default:
          return E2({ code: k2.NO_MODULE });
      }
      return a3.modifyMsgExts(n3, s4, t3).then(function(e4) {
        var e4 = e4.data, t4 = e4.extensions, e4 = e4.seq, i5 = [], s5 = 0, a4 = 0, r4 = [];
        return (t4 = S2(t4) ? [] : t4).forEach(function(e5) {
          var t5 = e5.errorCode, e5 = e5.extension, n4 = e5.key, o4 = e5.value, e5 = e5.seq;
          i5.push({ code: t5, key: n4, value: o4 }), 0 === t5 ? s5++ : a4++, r4.push({ key: n4, value: o4, seq: e5 });
        }), o3._updateGlobalSeq(n3.ID, e4), 0 < r4.length && (o3._updateLocalExt(n3.ID, r4), r4 = null), { resultList: i5, successCount: s5, failureCount: a4 };
      }).catch(function(e4) {
        return E2(e4);
      });
    } }, { key: "_getReqExts", value: function(e3, t3) {
      var o3, i4 = [];
      return this._hasLocalExt(e3.ID) ? (o3 = this._getLocalExt(e3.ID), t3.forEach(function(e4) {
        var t4 = e4.key, e4 = e4.value, n3 = 0;
        o3.has(t4) && (n3 = o3.get(t4).seq), i4.push({ key: t4, value: e4, seq: n3 });
      })) : t3.forEach(function(e4) {
        var t4 = e4.key, e4 = e4.value;
        i4.push({ key: t4, value: e4, seq: 0 });
      }), i4;
    } }, { key: "_getMsgExts", value: function(i4, e3) {
      var s4 = this, a3 = "".concat(this._n, "._getMsgExts"), r4 = i4.ID, t3 = i4.to, n3 = null;
      switch (Nt2(t3) ? R2.CONV_TOPIC : i4.conversationType) {
        case R2.CONV_C2C:
          n3 = this.get(6);
          break;
        case R2.CONV_GROUP:
          n3 = this.get(7);
          break;
        case R2.CONV_TOPIC:
          n3 = this.get(10);
          break;
        default:
          return E2({ code: k2.NO_MODULE });
      }
      return n3.getMessageExtensions(i4, e3).then(function(e4) {
        var e4 = e4.data, t4 = e4.extensions, n4 = e4.completeFlag, o3 = e4.globalSequence, e4 = e4.clearSequence, t4 = S2(t4) ? [] : t4;
        return M2.l("".concat(a3, " ok. completeFlag:").concat(n4, " globalSequence:").concat(o3, " clearSequence:").concat(e4, " count:").concat(t4.length)), s4._updateLocalExt(r4, t4), s4._clearLocalExt(r4, e4), s4._updateGlobalSeq(r4, o3), 1 !== n4 ? (e4 = t4.slice(-1)[0].seq + 1, s4._getMsgExts(i4, e4)) : s4._getLocalExtList(r4);
      }).catch(function(e4) {
        return E2(e4);
      });
    } }, { key: "_hasLocalExt", value: function(e3) {
      return this.msgExtMap.has(e3);
    } }, { key: "_getLocalExt", value: function(e3) {
      return this.msgExtMap.get(e3);
    } }, { key: "_updateLocalExt", value: function(e3, t3) {
      this._hasLocalExt(e3) || this.msgExtMap.set(e3, /* @__PURE__ */ new Map());
      var o3 = this._getLocalExt(e3);
      t3.forEach(function(e4) {
        var t4 = e4.key, n3 = e4.value, e4 = e4.seq;
        o3.set(t4, { value: void 0 === n3 ? "" : n3, seq: e4 });
      });
    } }, { key: "_clearLocalExt", value: function(e3, n3) {
      var o3;
      n3 <= 0 || !this._hasLocalExt(e3) || (o3 = this._getLocalExt(e3)).forEach(function(e4, t3) {
        e4.seq <= n3 && o3.delete(t3);
      });
    } }, { key: "_getLocalExtList", value: function(e3) {
      var n3 = [];
      return this._hasLocalExt(e3) && this._getLocalExt(e3).forEach(function(e4, t3) {
        e4 = e4.value;
        S2(e4) || n3.push({ key: t3, value: e4 });
      }), n3;
    } }, { key: "_getGlobalSeq", value: function(e3) {
      return this.globalSeqMap.get(e3);
    } }, { key: "_updateGlobalSeq", value: function(e3, t3) {
      this.globalSeqMap.set(e3, t3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this.msgExtMap.clear(), this.globalSeqMap.clear(), this.getMsgExtsMap.clear();
    } }])), Bi = (t2(Xi, c2), e2(Xi, [{ key: "onReactionNotifyList", value: function(e3) {
      var s4 = this, e3 = (e3 || {}).dataList;
      (void 0 === e3 ? [] : e3).forEach(function(e4) {
        var t3 = e4.C2CMessageInfo, n3 = e4.groupMessageInfo, n3 = void 0 === n3 ? {} : n3, e4 = e4.reactionList, e4 = void 0 === e4 ? [] : e4, t3 = y2(y2({}, void 0 === t3 ? {} : t3), n3), n3 = t3.tinyID, o3 = t3.clientTime, t3 = t3.random, n3 = "".concat(n3, "-").concat(o3, "-").concat(t3), i4 = [];
        e4.forEach(function(e5) {
          N3(e5.userIDList) && (e5.userIDList = [], e5.count = 0), i4.push.apply(i4, d2(e5.userIDList));
        }), M2.l("".concat(s4._n, ".onReactionNotifyList messageID:").concat(n3, " reactionList:").concat(e4.length)), s4._handleReactionSummary([{ messageID: n3, reactionList: e4 }], i4).then(function(e5) {
          s4.emitOEvt(h2.MESSAGE_REACTIONS_UPDATED, y2({}, e5[0]));
        });
      });
    } }, { key: "onReactionNotify", value: function(e3) {
      var e3 = e3.dataList || {}, t3 = e3.C2CMessageInfo, n3 = e3.groupMessageInfo, n3 = void 0 === n3 ? {} : n3, o3 = e3.reactionID, e3 = e3.operateType, t3 = y2(y2({}, void 0 === t3 ? {} : t3), n3), n3 = t3.tinyID, i4 = t3.clientTime, t3 = t3.random, n3 = "".concat(n3, "-").concat(i4, "-").concat(t3), i4 = (M2.l("".concat(this._n, ".onReactionNotify messageID:").concat(n3, " reactionID:").concat(o3, " operateType:").concat(e3)), 1 === e3 ? this._addReactedByMyselfMap(n3, o3) : this._removeReactedByMyselfMap(n3, o3), "".concat(n3, "-").concat(o3));
      this._reactionInfoMap.has(i4) && ((t3 = this._reactionInfoMap.get(i4)).reactedByMyself = 1 === e3, this.emitOEvt(h2.MESSAGE_REACTIONS_UPDATED, { messageID: n3, reactionList: [t3] }));
    } }, { key: "addMessageReaction", value: function(t3, n3) {
      var o3, e3, i4, s4, a3 = this, r4 = "addMessageReaction";
      return this.canIUse(g2.MSG_REACTION) ? (o3 = "".concat(this._n, ".").concat(r4), s4 = t3.ID, e3 = t3.conversationID, e3 = "convID:".concat(e3, " messageID:").concat(s4, " reactionID:").concat(n3), (i4 = new P2(r4)).setMessage(e3), M2.l("".concat(o3, " ").concat(e3)), s4 = this._createReactionOperationPack(t3, n3, 1), this._addReactedByMyselfMap(t3.ID, n3), this.req(s4).then(function() {
        return i4.end(), M2.l("".concat(o3, " ok.")), T2();
      }).catch(function(e4) {
        return a3._removeReactedByMyselfMap(t3.ID, n3), i4.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      })) : this.noUse(r4);
    } }, { key: "removeMessageReaction", value: function(e3, t3) {
      var n3, o3, i4, s4, a3 = "removeMessageReaction";
      return this.canIUse(g2.MSG_REACTION) ? (n3 = "".concat(this._n, ".").concat(a3), s4 = e3.ID, o3 = e3.conversationID, o3 = "convID:".concat(o3, " messageID:").concat(s4, " reactionID:").concat(t3), (i4 = new P2(a3)).setMessage(o3), M2.l("".concat(n3, " ").concat(o3)), s4 = this._createReactionOperationPack(e3, t3, 2), this._removeReactedByMyselfMap(e3.ID, t3), this.req(s4).then(function() {
        return i4.end(), M2.l("".concat(n3, " ok.")), T2();
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      })) : this.noUse(a3);
    } }, { key: "getMessageReactions", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4 = this, c3 = "getMessageReactions";
      return this.canIUse(g2.MSG_REACTION) ? (t3 = "".concat(this._n, ".").concat(c3), n3 = e3.messageList, a3 = e3.maxUserCountPerReaction, o3 = n3[0].conversationID, o3 = "convID:".concat(o3, " maxUserCountPerReaction:").concat(a3, " msgCount:").concat(n3.length), (i4 = new P2(c3)).setMessage(o3), M2.l("".concat(t3, " ").concat(o3)), s4 = /* @__PURE__ */ new Map(), a3 = this._createReactionSummaryPack(y2(y2({}, e3), {}, { messageIDMap: s4 })), this.req(a3).then(function(e4) {
        var e4 = e4.data.resultList, o4 = [], i5 = [];
        return (void 0 === e4 ? [] : e4).forEach(function(e5) {
          var t4 = e5.messageKey, t4 = void 0 === t4 ? void 0 : t4, n4 = e5.messageSequence, n4 = void 0 === n4 ? void 0 : n4, e5 = e5.reactionList, e5 = void 0 === e5 ? [] : e5, n4 = N3(t4) ? s4.get(n4) : s4.get(t4);
          o4.push({ messageID: n4, reactionList: e5 }), e5.forEach(function(e6) {
            i5.push.apply(i5, d2(e6.userIDList));
          });
        }), r4._handleReactionSummary(o4, i5);
      }).then(function(e4) {
        return i4.end(), M2.l("".concat(t3, " ok.")), s4.clear(), T2({ resultList: e4 });
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this.noUse(c3);
    } }, { key: "getAllUserListOfMessageReaction", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4, c3, u3 = this, l3 = "getAllUserListOfMessageReaction";
      return this.canIUse(g2.MSG_REACTION) ? (t3 = "".concat(this._n, ".").concat(l3), s4 = e3.message, n3 = e3.reactionID, o3 = e3.nextSeq, i4 = e3.count, c3 = s4.ID, s4 = s4.conversationID, s4 = "convID:".concat(s4, " messageID:").concat(c3, " reactionID:").concat(n3, " nextSeq:").concat(o3, " count:").concat(i4), (a3 = new P2(l3)).setMessage(s4), M2.l("".concat(t3, " ").concat(s4)), r4 = { userList: [], nextSeq: 0, isCompleted: false }, c3 = this._createReactionUserListPack(e3), this.req(c3).then(function(e4) {
        var e4 = e4.data, t4 = e4.userIDList, t4 = void 0 === t4 ? [] : t4, e4 = e4.nextSeq, e4 = void 0 === e4 ? 0 : e4;
        return r4.nextSeq = e4, r4.isCompleted = 0 === e4, u3.get(4).getUserNickAndAvatar(t4);
      }).then(function(e4) {
        return r4.userList = e4, a3.end(), M2.l("".concat(t3, " ok.")), T2(r4);
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this.noUse(l3);
    } }, { key: "_createReactionOperationPack", value: function(e3, t3, n3) {
      var o3, i4, s4 = void 0, t3 = { reactionID: t3, userIDList: [this.getMyUserID()] };
      return e3.conversationType === R2.CONV_C2C && (o3 = this.get(6), s4 = 1 === n3 ? G2.ADD_C2C_MSG_REACTION : G2.RM_C2C_MSG_REACTION, t3.from = e3.from, t3.to = e3.to, t3.messageKey = o3.getMessageKey(e3)), e3.conversationType === R2.CONV_GROUP && (o3 = void 0, i4 = e3.to, Nt2(e3.to) && (i4 = jt2(o3 = e3.to)), s4 = 1 === n3 ? G2.ADD_GRP_MSG_REACTION : G2.RM_GRP_MSG_REACTION, t3.groupID = i4, t3.topicID = o3, t3.messageSequence = e3.sequence), { P: s4, data: t3 };
    } }, { key: "_createReactionSummaryPack", value: function(e3) {
      var n3, t3, o3, i4 = e3.messageList, s4 = e3.maxUserCountPerReaction, s4 = void 0 === s4 ? 10 : s4, a3 = e3.messageIDMap, e3 = i4[0], r4 = void 0, c3 = void 0;
      return e3.conversationType === R2.CONV_C2C && (n3 = this.get(6), t3 = i4.map(function(e4) {
        var t4 = n3.getMessageKey(e4);
        return a3.set(t4, e4.ID), t4;
      }), r4 = G2.GET_C2C_MSG_REACTIONS, c3 = { from: e3.from, to: e3.to, messageKeyList: t3, count: s4 }), e3.conversationType === R2.CONV_GROUP && (t3 = void 0, o3 = e3.to, Nt2(e3.to) && (o3 = jt2(t3 = e3.to)), e3 = i4.map(function(e4) {
        return a3.set(e4.sequence, e4.ID), e4.sequence;
      }), r4 = G2.GET_GRP_MSG_REACTIONS, c3 = { groupID: o3, topicID: t3, messageSequenceList: e3, count: s4 }), { P: r4, data: c3 };
    } }, { key: "_createReactionUserListPack", value: function(e3) {
      var t3 = e3.message, n3 = e3.reactionID, o3 = e3.nextSeq, e3 = e3.count, e3 = void 0 === e3 ? 100 : e3, i4 = void 0, n3 = { reactionID: n3, nextSeq: void 0 === o3 ? 0 : o3, count: 100 < e3 ? 100 : e3 };
      return t3.conversationType === R2.CONV_C2C && (o3 = this.get(6), i4 = G2.GET_C2C_MSG_REACTION_USER_LIST, n3.from = t3.from, n3.to = t3.to, n3.messageKey = o3.getMessageKey(t3)), t3.conversationType === R2.CONV_GROUP && (e3 = void 0, o3 = t3.to, Nt2(t3.to) && (o3 = jt2(e3 = t3.to)), i4 = G2.GET_GRP_MSG_REACTION_USER_LIST, n3.groupID = o3, n3.topicID = e3, n3.messageSequence = t3.sequence), { P: i4, data: n3 };
    } }, { key: "_handleReactionSummary", value: function(t3, e3) {
      var c3 = this;
      return this.get(4).getUserNickAndAvatar(e3).then(function(r4) {
        var e4 = [];
        return t3.forEach(function(s4) {
          var a3 = [];
          s4.reactionList.forEach(function(e5) {
            var t4 = e5.reactionID, n3 = e5.count, o3 = e5.userIDList, e5 = e5.reactedByMyself, e5 = void 0 === e5 ? void 0 : e5, i4 = [], o3 = (o3.forEach(function(t5) {
              r4.forEach(function(e6) {
                t5 === e6.userID && i4.push(e6);
              });
            }), { reactionID: t4, totalUserCount: n3, partialUserList: i4, reactedByMyself: c3._computeReactedByMyself({ reactedByMyself: e5, messageID: s4.messageID, reactionID: t4 }) });
            a3.push(o3), N3(e5) && !c3._reactedByMyselfMap.has(s4.messageID) && (n3 = "".concat(s4.messageID, "-").concat(t4), c3._reactionInfoMap.set(n3, o3));
          }), e4.push({ messageID: s4.messageID, reactionList: a3 });
        }), e4;
      });
    } }, { key: "_addReactedByMyselfMap", value: function(e3, t3) {
      this._reactedByMyselfMap.has(e3) || this._reactedByMyselfMap.set(e3, []);
      e3 = this._reactedByMyselfMap.get(e3);
      -1 === e3.indexOf(t3) && e3.push(t3);
    } }, { key: "_removeReactedByMyselfMap", value: function(e3, t3) {
      this._reactedByMyselfMap.has(e3) && -1 < (t3 = (e3 = this._reactedByMyselfMap.get(e3)).indexOf(t3)) && e3.splice(t3, 1);
    } }, { key: "_computeReactedByMyself", value: function(e3) {
      var t3 = e3.reactedByMyself, n3 = e3.messageID, e3 = e3.reactionID;
      return N3(t3) ? !!this._reactedByMyselfMap.has(n3) && this._reactedByMyselfMap.get(n3).includes(e3) : 1 === t3;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._reactedByMyselfMap.clear(), this._reactionInfoMap.clear();
    } }])), Hi = (t2(zi, c2), e2(zi, [{ key: "sendMessage", value: function(e3) {
      var o3 = this, i4 = this._createMsg(e3);
      if (null === i4)
        return E2({ code: k2.MSG_SEND_FAIL });
      this._addSendMessageTotalCount(i4);
      var s4 = Date.now();
      return this.get(11).setMessageRandom(i4), this._sendComboMessage(i4, e3).then(function(e4) {
        var e4 = e4.data, t3 = e4.time, n3 = e4.sequence, e4 = e4.readReceiptCode, e4 = (A2(e4) && 0 !== e4 && (new P2("sendMessageWithReceipt").setMessage("from:".concat(i4.from, " to:").concat(i4.to, " sequence:").concat(n3, " readReceiptCode:").concat(e4)).end(), M2.w("".concat(o3._n, ".sendMessage readReceiptCode:").concat(e4, " message:").concat(o3.getErrMsg(e4)))), o3._addSendMessageSuccessCount(i4, s4), o3.get(11)), t3 = (i4.status = On, i4.time = t3, i4.conversationType === R2.CONV_GROUP && (i4.sequence = n3), e4.appendToMessageList(i4), i4);
        return true === i4._isExcludedFromLastMessage && (t3 = ""), e4.onMessageSent({ conversationOptionsList: [{ conversationID: i4.conversationID, unreadCount: 0, type: i4.conversationType, subType: i4.conversationSubType, lastMessage: t3 }] }), T2({ message: i4 });
      }).catch(function(e4) {
        return o3._onSendMessageFailed(i4, e4);
      });
    } }, { key: "_sendComboMessage", value: function(e3, t3) {
      var n3 = this._m.get(20), o3 = "";
      return e3.conversationType === R2.CONV_C2C && (o3 = "".concat(s3.NAME.OPEN_IM, ".").concat(G2.SEND_C2C_MSG)), e3.conversationType === R2.CONV_GROUP && (o3 = "".concat(s3.NAME.GRP, ".").concat(G2.SEND_GRP_MSG)), n3.sendComboMessage({ servcmd: o3, data: t3 });
    } }, { key: "_createMsg", value: function(e3) {
      var t3 = "".concat(this._n, "._createMsg"), n3 = null;
      try {
        var o3, i4 = this.getMyUserID(), s4 = {};
        s4.senderTinyID = this.getMyTinyID(), s4.currentUser = i4, s4.from = e3.From_Account || i4, e3.GroupId ? (s4.conversationID = "".concat(R2.CONV_GROUP).concat(e3.GroupId), s4.conversationType = R2.CONV_GROUP, s4.to = e3.GroupId) : e3.To_Account && (s4.conversationID = "".concat(R2.CONV_C2C).concat(e3.To_Account), s4.conversationType = R2.CONV_C2C, s4.to = e3.To_Account), s4.time = e3.MsgTimeStamp || 0, s4.random = e3.Random || e3.MsgRandom || 0, s4.priority = e3.MsgPriority, C2(e3.CloudCustomData) && 0 < e3.CloudCustomData.length && (s4.cloudCustomData = e3.CloudCustomData), O2(e3.SendMsgControl) && (s4.messageControlInfo = {}, e3.SendMsgControl.includes("NoUnread") && (s4.messageControlInfo.excludedFromUnreadCount = 1), e3.SendMsgControl.includes("NoLastMsg")) && (s4.messageControlInfo.excludedFromLastMessage = 1), s4.conversationType === R2.CONV_GROUP && O2(e3.To_Account) && 0 < e3.To_Account.length && (o3 = e3.To_Account, 50 < e3.To_Account.length && (o3 = e3.To_Account.slice(0, 50), M2.w("".concat(t3, " To_Account must be less than or equal to 50."))), s4.receiverList = d2(o3), e3.To_Account = d2(o3)), 1 !== e3.IsNeedReadReceipt && 1 !== e3.NeedReadReceipt || (s4.needReadReceipt = true), 1 === e3.SupportMessageExtension && (s4.isSupportExtension = true), (n3 = new Do(s4)).status = An, e3.MsgClientTime = n3.clientTime, n3.conversationType === R2.CONV_C2C && (e3.MsgSeq = n3.sequence);
        for (var a3, r4 = e3.MsgBody.length, c3 = 0; c3 < r4; c3++)
          "TIMTextElem" === (a3 = e3.MsgBody[c3]).MsgType ? n3.setTextElement(a3.MsgContent.Text) : "TIMCustomElem" === a3.MsgType ? n3.setCustomElement({ data: a3.MsgContent.Data || "", description: a3.MsgContent.Desc || "", extension: a3.MsgContent.Ext || "" }) : "TIMFaceElem" === a3.MsgType && n3.setFaceElement({ index: a3.MsgContent.Index, data: a3.MsgContent.Data });
        var u3 = n3.getElements();
        n3.payload = u3[0].content, n3.type = u3[0].type;
      } catch (e4) {
        n3 = null, M2.e("".concat(t3, " failed. error:"), e4);
      }
      return n3;
    } }, { key: "_onSendMessageFailed", value: function(e3, t3) {
      e3.status = Nn, this.get(11).deleteMessageRandom(e3), this._addSendMessageFailCountOnUser(e3, t3);
      var n3 = new P2("sendMessage"), o3 = "head.seq:".concat(t3.data.headSeq, "  type:").concat(e3.type, " from:").concat(e3.from, " to:").concat(e3.to);
      return n3.setMessage(o3).setError(t3).end(), M2.e("".concat(this._n, "._onSendMessageFailed ").concat(o3, " error:"), t3), E2(new L2({ code: t3 && t3.code ? t3.code : k2.MSG_SEND_FAIL, message: t3 && t3.message ? t3.message : void 0, data: { message: e3 } }));
    } }, { key: "_getSendMessageSpecifiedKey", value: function(e3) {
      if (e3.conversationType === R2.CONV_C2C)
        return Kn;
      if (e3.conversationType === R2.CONV_GROUP) {
        var e3 = this.get(7).getLocalGroupProfile(e3.to);
        if (e3)
          return e3 = e3.type, At2(e3) ? Yn : Wn;
      }
    } }, { key: "_addSendMessageTotalCount", value: function(e3) {
      e3 = this._getSendMessageSpecifiedKey(e3);
      e3 && this.get(26).addTotalCount(e3);
    } }, { key: "_addSendMessageSuccessCount", value: function(e3, t3) {
      var n3, e3 = this._getSendMessageSpecifiedKey(e3);
      e3 && ((n3 = this.get(26)).addSuccessCount(e3), n3.addCost(e3, tn(t3, false)));
    } }, { key: "_addSendMessageFailCountOnUser", value: function(e3, t3) {
      var t3 = t3.code, t3 = void 0 === t3 ? -1 : t3, n3 = this.get(26), e3 = this._getSendMessageSpecifiedKey(e3);
      qi(t3) && e3 && n3.addFailedCountOfUserSide(e3);
    } }])), Ki = (t2(Ji, c2), e2(Ji, [{ key: "registerPlugin", value: function(t3) {
      var n3 = this, o3 = "0";
      Object.keys(t3).forEach(function(e3) {
        n3.plugins[e3] = t3[e3], "tim-upload-plugin" === e3 && "function" == typeof t3[e3].getVersion && (o3 = t3[e3].getVersion());
      }), new P2("registerPlugin").setMessage("".concat(Object.keys(t3))).setMoreMessage("version:".concat(o3)).end();
    } }, { key: "getPlugin", value: function(e3) {
      return this.plugins[e3];
    } }, { key: "reset", value: function() {
    } }])), Wi = (t2(ji, c2), e2(ji, [{ key: "_init", value: function() {
      this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 0 });
    } }, { key: "_startSync", value: function(e3) {
      var i4 = this, t3 = e3.cookie, n3 = e3.syncFlag, o3 = e3.isOnlineSync, s4 = "".concat(this._n, "._startSync"), a3 = (M2.l("".concat(s4, " options:"), e3), new P2("syncUnread"));
      a3.setMessage(JSON.stringify(e3)), this.req({ P: G2.SYNC_UNREAD_MSG, data: { cookie: t3, syncFlag: n3, isOnlineSync: o3 } }).then(function(e4) {
        var t4 = e4.data, n4 = t4.cookie, t4 = t4.syncFlag, o4 = "$cookie:".concat(n4, " syncFlag:").concat(t4);
        M2.l("".concat(s4, " ok. ").concat(o4)), i4._cookie = n4, a3.setMoreMessage(o4).end(), S2(n4) || (0 === t4 || 1 === t4 ? (i4._dispatch(y2(y2({}, e4.data), {}, { isSyncingEnded: false })), i4._startSync({ cookie: n4, syncFlag: t4, isOnlineSync: 0 })) : 2 === t4 && i4._dispatch(y2(y2({}, e4.data), {}, { isSyncingEnded: true })));
      }).catch(function(e4) {
        a3.setError(e4).end(), M2.e("".concat(s4, " failed. error:"), e4);
      });
    } }, { key: "_dispatch", value: function(e3) {
      e3.eventArray && this.get(20).onMessage({ head: {}, body: { eventArray: e3.eventArray, isInstantMessage: this._onlineSyncFlag, isSyncingEnded: e3.isSyncingEnded } }), this.get(6).onNewMessage({ dataList: e3.messageList, isInstantMessage: !!e3.isSyncingEnded && this._onlineSyncFlag, C2CRemainingUnreadList: e3.C2CRemainingUnreadList, C2CPairUnreadList: e3.C2CPairUnreadList, isSyncingEnded: e3.isSyncingEnded });
    } }, { key: "syncOnNeed", value: function() {
      M2.l("".concat(this._n, ".syncOnNeed cookie:").concat(this._cookie)), this._onlineSyncFlag = true, this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 1 });
    } }, { key: "syncOnReconnected", value: function() {
      M2.l("".concat(this._n, ".syncOnReconnected cookie:").concat(this._cookie)), this._onlineSyncFlag = true, this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 0 });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._onlineSyncFlag = false, this._cookie = "";
    } }])), Yi = { req: { toAccount: "To_Account", fromAccount: "From_Account", to: "To_Account", from: "From_Account", groupID: "GroupId", groupAtUserID: "GroupAt_Account", extension: "Ext", data: "Data", description: "Desc", elements: "MsgBody", sizeType: "Type", downloadFlag: "Download_Flag", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", videoUrl: "", imageUrl: "URL", fileUrl: "Url", uuid: "UUID", priority: "MsgPriority", receiverUserID: "To_Account", receiverGroupID: "GroupId", messageSender: "SenderId", messageReceiver: "ReceiverId", nick: "From_AccountNick", avatar: "From_AccountHeadurl", messageNumber: "MsgNum", pbDownloadKey: "PbMsgKey", downloadKey: "JsonMsgKey", applicationType: "PendencyType", userIDList: "To_Account", groupNameList: "GroupName", userID: "To_Account", groupAttributeList: "GroupAttr", mainSequence: "AttrMainSeq", avChatRoomKey: "BytesKey", attributeControl: "AttrControl", sequence: "seq", messageControlInfo: "SendMsgControl", updateSequence: "UpdateSeq", clientTime: "MsgClientTime", sequenceList: "MsgSeqList", topicID: "TopicId", customData: "CustomString", isSupportTopic: "SupportTopic", isWebUniapp: "is_web_uniapp", isSupportExtension: "SupportMessageExtension", messageSequence: "MsgSeq", messageKey: "MsgKey", startSequence: "startSeq", simplifiedMessage: "DownsizeFlag", isRelayMessage: "IsRelayMsg", reactionID: "Reaction", messageSequenceList: "MsgSeqList", messageKeyList: "MsgKeyList", cmConfigID: "CustomModerationConfigID" }, res: { MsgPriority: "priority", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID", Download_Flag: "downloadFlag", GroupId: "groupID", Member_Account: "userID", MsgList: "messageList", SyncFlag: "syncFlag", To_Account: "to", From_Account: "from", MsgSeq: "sequence", MsgRandom: "random", MsgTime: "time", MsgTimeStamp: "time", MsgContent: "content", MsgBody: "elements", From_AccountNick: "nick", From_AccountHeadurl: "avatar", GroupWithdrawInfoArray: "revokedInfos", GroupReadInfoArray: "groupMessageReadNotice", LastReadMsgSeq: "lastMessageSeq", WithdrawC2cMsgNotify: "c2cMessageRevokedNotify", C2cWithdrawInfoArray: "revokedInfos", C2cReadedReceipt: "c2cMessageReadReceipt", ReadC2cMsgNotify: "c2cMessageReadNotice", LastReadTime: "peerReadTime", MsgRand: "random", MsgType: "type", MsgShow: "messageShow", NextMsgSeq: "nextMessageSeq", FaceUrl: "avatar", ProfileDataMod: "profileModify", Profile_Account: "userID", ValueBytes: "value", ValueNum: "value", NoticeSeq: "noticeSequence", NotifySeq: "notifySequence", MsgFrom_AccountExtraInfo: "messageFromAccountExtraInformation", Operator_Account: "operatorID", OpType: "operationType", ReportType: "operationType", UserId: "userID", User_Account: "userID", List_Account: "userIDList", MsgOperatorMemberExtraInfo: "operatorInfo", MsgMemberExtraInfo: "memberInfoList", ImageUrl: "avatar", NickName: "nick", MsgGroupNewInfo: "newGroupProfile", MsgAppDefinedData: "groupCustomField", Owner_Account: "ownerID", GroupFaceUrl: "avatar", GroupIntroduction: "introduction", GroupNotification: "notification", GroupApplyJoinOption: "joinOption", MsgKey: "messageKey", GroupInfo: "groupProfile", ShutupTime: "muteTime", Desc: "description", Ext: "extension", GroupAt_Account: "groupAtUserID", MsgNum: "messageNumber", PbMsgKey: "pbDownloadKey", JsonMsgKey: "downloadKey", MsgModifiedFlag: "isModified", PendencyItem: "applicationItem", PendencyType: "applicationType", AddTime: "time", AddSource: "source", AddWording: "wording", ProfileImImage: "avatar", PendencyAdd: "friendApplicationAdded", FrienPencydDel_Account: "friendApplicationDeletedUserIDList", Peer_Account: "userID", GroupAttr: "groupAttributeList", GroupAttrAry: "groupAttributeList", AttrMainSeq: "mainSequence", seq: "sequence", GroupAttrOption: "groupAttributeOption", BytesChangedKeys: "changedKeyList", GroupAttrInfo: "groupAttributeList", GroupAttrSeq: "mainSequence", PushChangedAttrValFlag: "isWithChangedAttributeInfo", SubKeySeq: "sequence", Val: "value", MsgGroupFromCardName: "senderNameCard", MsgGroupFromNickName: "senderNick", C2cNick: "peerNick", C2cImage: "peerAvatar", SendMsgControl: "messageControlInfo", NoLastMsg: "excludedFromLastMessage", NoUnread: "excludedFromUnreadCount", UpdateSeq: "updateSequence", MuteNotifications: "muteFlag", MsgClientTime: "clientTime", TinyId: "tinyID", GroupMsgReceiptList: "readReceiptList", ReadNum: "readCount", UnreadNum: "unreadCount", TopicId: "topicID", MillionGroupFlag: "communityType", SupportTopic: "isSupportTopic", MsgTopicNewInfo: "newTopicInfo", ShutupAll: "muteAllMembers", CustomString: "customData", TopicFaceUrl: "avatar", TopicIntroduction: "introduction", TopicNotification: "notification", TopicIdArray: "topicIDList", MsgVersion: "messageVersion", C2cMsgModNotifys: "c2cMessageModified", GroupMsgModNotifys: "groupMessageModified", ApplyJoinOption: "joinOption", MsgFlag: "messageRemindType", AtInfoList: "groupAtInfoList", AtFlagList: "groupAtType", AtMsgSeq: "sequence", BanDuration: "duration", BanDescription: "reason", NotVisible: "invisible", BytesTag: "tag", BytesValue: "value", RptBytesValue: "value", LatestSeq: "globalSequence", ClearSeq: "clearSequence", SupportMessageExtension: "isSupportExtension", ExtensionList: "extensions", GroupCounter: "counterList", Revoker_Account: "revoker", MsgExtensionNotify: "messageExtensionNotify", ExtensionC2cMsgInfo: "messageInfo", ExtensionGroupMsgInfo: "messageInfo", MsgOptType: "operateType", SetKVInfo: "operateResultList", DeleteKVInfo: "operateResultList", ClearKVInfo: "operateResultList", MsgKeyValue: "extensions", ClearMsgSeq: "clearSequence", MsgLastSeq: "globalSequence", InviteJoinOption: "inviteOption", MemberList_Account: "inviteeList", MsgMemberExtraInfoList: "inviteeInfoList", E: "event", GInf: "groupProfile", MCT: "clientTime", MR: "random", MP: "priority", MTS: "time", GId: "groupID", MS: "sequence", CCD: "cloudCustomData", F_Account: "from", F_Hd: "avatar", F_NN: "nick", GN: "groupName", GT: "groupType", IsSys: "isSystemMessage", OpInf: "operatorInfo", Img: "avatar", NN: "nick", OnlineInf: "onlineMemberInfo", ET: "expireTime", Num: "onlineMemberNum", Opt: "operationType", O_Account: "operatorID", RT: "operationType", UDF: "userDefinedField", L_Account: "userIDList", IsPlaceMsg: "isPlaceMessage", MsgCheckResult: "checkResult", Results: "resultList", Reaction: "reactionID", Reaction_Account: "userIDList", MsgReactionNotifyList: "messageReactionNotifyList", MsgReactionNotify: "messageReactionNotify", MsgReactionSummary: "reactionList", C2CMsgInfo: "C2CMessageInfo", GroupMsgInfo: "groupMessageInfo", int32_err_code: "errorCode", str_err_msg: "errorMsg", MsgDropReason: "messageDropReason", ReactedByMe: "reactedByMyself", Level: "messageRemindType", PeerReadTime: "timestamp", NoUnreadSeqList: "excludedUnreadSequenceList", NewMsg: "topicLatestMessage" }, ignoreKeyWord: ["C2C", "ID", "USP"] };
    function ji(e3) {
      return p3(this, ji), (e3 = i3(this, ji, [e3]))._n = "SyncUnreadMsgModule", e3._cookie = "", e3._onlineSyncFlag = false, e3.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, e3._init, e3), e3;
    }
    function Ji(e3) {
      return p3(this, Ji), (e3 = i3(this, Ji, [e3]))._n = "PluginModule", e3.plugins = {}, e3;
    }
    function zi(e3) {
      return p3(this, zi), (e3 = i3(this, zi, [e3]))._n = "ComboMsgModule", e3;
    }
    function Xi(e3) {
      return p3(this, Xi), (e3 = i3(this, Xi, [e3]))._n = "MsgReactionModule", e3._reactedByMyselfMap = /* @__PURE__ */ new Map(), e3._reactionInfoMap = /* @__PURE__ */ new Map(), e3;
    }
    function Zi(e3) {
      return p3(this, Zi), (e3 = i3(this, Zi, [e3]))._n = "MsgExtModule", e3.msgExtMap = /* @__PURE__ */ new Map(), e3.globalSeqMap = /* @__PURE__ */ new Map(), e3.getMsgExtsMap = /* @__PURE__ */ new Map(), e3;
    }
    function Qi(e3) {
      return p3(this, Qi), (e3 = i3(this, Qi, [e3]))._n = "MessageModule", e3._messageOptionsMap = /* @__PURE__ */ new Map(), e3._mergerMessageHandler = new Ui(e3), e3;
    }
    function $i(e3, t3) {
      if ("string" == typeof e3 || Array.isArray(e3))
        return t3 = Object.assign({ pascalCase: false }, t3), 0 === (e3 = Array.isArray(e3) ? e3.map(function(e4) {
          return e4.trim();
        }).filter(function(e4) {
          return e4.length;
        }).join("-") : e3.trim()).length ? "" : 1 === e3.length ? t3.pascalCase ? e3.toUpperCase() : e3.toLowerCase() : (e3 = e3 = (e3 = e3 !== e3.toLowerCase() ? es2(e3) : e3).replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+(\w|$)/g, function(e4, t4) {
          return t4.toUpperCase();
        }).replace(/\d+(\w|$)/g, function(e4) {
          return e4.toUpperCase();
        }), t3.pascalCase ? e3.charAt(0).toUpperCase() + e3.slice(1) : e3);
      throw new TypeError("Expected the input to be `string | string[]`");
    }
    var es2 = function(e3) {
      for (var t3 = false, n3 = false, o3 = false, i4 = 0; i4 < e3.length; i4++) {
        var s4 = e3[i4];
        t3 && /[a-zA-Z]/.test(s4) && s4.toUpperCase() === s4 ? (e3 = e3.slice(0, i4) + "-" + e3.slice(i4), o3 = n3, n3 = !(t3 = false), i4++) : n3 && o3 && /[a-zA-Z]/.test(s4) && s4.toLowerCase() === s4 ? (e3 = e3.slice(0, i4 - 1) + "-" + e3.slice(i4 - 1), o3 = n3, t3 = !(n3 = false)) : (t3 = s4.toLowerCase() === s4 && s4.toUpperCase() !== s4, o3 = n3, n3 = s4.toUpperCase() === s4 && s4.toLowerCase() !== s4);
      }
      return e3;
    };
    function ts2(e3, t3) {
      var r4 = 0;
      return function n3(e4, i4) {
        var t4, o3, s4, a3;
        return 100 < ++r4 ? (r4--, e4) : O2(e4) ? (t4 = e4.map(function(e5) {
          return at2(e5) ? n3(e5, i4) : e5;
        }), r4--, t4) : at2(e4) ? (o3 = e4, s4 = function(e5, t5) {
          if (!lt2(t5))
            return false;
          if (t5 !== $i(t5))
            for (var n4 = 0; n4 < Yi.ignoreKeyWord.length && !t5.includes(Yi.ignoreKeyWord[n4]); n4++)
              ;
          var o4;
          return N3(i4[t5]) ? (o4 = t5)[0].toUpperCase() + $i(o4).slice(1) : i4[t5];
        }, a3 = /* @__PURE__ */ Object.create(null), Object.keys(o3).forEach(function(e5) {
          var t5 = s4(o3[e5], e5);
          t5 && (a3[t5] = o3[e5]);
        }), t4 = bt2(t4 = a3, function(e5, t5) {
          return O2(e5) || at2(e5) ? n3(e5, i4) : e5;
        }), r4--, t4) : void 0;
      }(e3, t3);
    }
    for (var ns = String.fromCharCode, os = function(e3) {
      var t3 = 0 | e3.charCodeAt(0);
      if (55296 <= t3)
        if (t3 < 56320) {
          e3 = 0 | e3.charCodeAt(1);
          if (56320 <= e3 && e3 <= 57343) {
            if (65535 < (t3 = (t3 << 10) + e3 - 56613888 | 0))
              return ns(240 | t3 >>> 18, 128 | t3 >>> 12 & 63, 128 | t3 >>> 6 & 63, 128 | 63 & t3);
          } else
            t3 = 65533;
        } else
          t3 <= 57343 && (t3 = 65533);
      return t3 <= 2047 ? ns(192 | t3 >>> 6, 128 | 63 & t3) : ns(224 | t3 >>> 12, 128 | t3 >>> 6 & 63, 128 | 63 & t3);
    }, is = function(e3) {
      for (var t3 = void 0 === e3 ? "" : ("" + e3).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g, os), n3 = 0 | t3.length, o3 = new Uint8Array(n3), i4 = 0; i4 < n3; i4 = i4 + 1 | 0)
        o3[i4] = 0 | t3.charCodeAt(i4);
      return o3;
    }, ss2 = e2(function e3(t3) {
      p3(this, e3);
      var n3, i4, o3 = (this._handler = t3).getURL();
      this._socket = null, this._workerSocket = null, this._id = ht2(), this._handler.getIsWorkerEnabled() ? (n3 = URL.createObjectURL(new Blob([';let _socket = null;onmessage = function(event) {  if (event.data.cmd === "start") {    const url = event.data.url;    _socket = new WebSocket(url);    _socket.binaryType = "arraybuffer";    _socket.onopen = function() {      postMessage({ callback: "onOpen", extensions: _socket.extensions });    };    _socket.onclose = function(e) {      postMessage({ callback: "onOpen", e: { code: e.code, reason: e.reason } });    };    _socket.onmessage = function(e) {      postMessage({ callback: "onMessage", data: e.data });    };    _socket.onerror = function(e) {      postMessage({ callback: "onError", e: { isTrusted: "true" } });    };  } else if (event.data.cmd === "sendMessage") {    if (_socket !== null) {      _socket.send(event.data.data);    }  } else if (event.data.cmd === "stop") {    if (_socket !== null) {      _socket.close(event.data.code);      _socket = null;    }  }};'], { type: "application/javascript; charset=utf-8" })), this._workerSocket = new Worker(n3), (i4 = this)._workerSocket.onmessage = function(e4) {
        var t4 = e4.data, n4 = t4.callback, o4 = t4.e, t4 = t4.extensions;
        "onOpen" === n4 ? i4._onOpen(t4) : "onClose" === n4 ? i4._onClose(o4) : "onError" === n4 ? i4._onError(o4) : "onMessage" === n4 && i4._onMessage(e4.data);
      }, this._workerSocket.postMessage({ cmd: "start", id: this._id, url: o3 })) : v3 ? ge2 ? (I2.connectSocket({ url: o3, header: { "content-type": "application/json" } }), I2.onSocketClose(this._onClose.bind(this)), I2.onSocketOpen(this._onOpen.bind(this)), I2.onSocketMessage(this._onMessage.bind(this)), I2.onSocketError(this._onError.bind(this))) : (this._socket = I2.connectSocket({ url: o3, header: { "content-type": "application/json" }, complete: function() {
      } }), this._socket.onClose(this._onClose.bind(this)), this._socket.onOpen(this._onOpen.bind(this)), this._socket.onMessage(this._onMessage.bind(this)), this._socket.onError(this._onError.bind(this))) : (this._socket = new WebSocket(o3), this._socket.binaryType = "arraybuffer", this._socket.onopen = this._onOpen.bind(this, this._socket.extensions), this._socket.onmessage = this._onMessage.bind(this), this._socket.onclose = this._onClose.bind(this), this._socket.onerror = this._onError.bind(this)), this._canIUseBinaryFrame = t3.canIUseBinaryFrame();
    }, [{ key: "getID", value: function() {
      return this._id;
    } }, { key: "_onOpen", value: function(e3) {
      this._handler.onOpen({ id: this._id, res: JSON.stringify(e3) });
    } }, { key: "_onClose", value: function(e3) {
      this._handler.onClose({ id: this._id, e: e3 });
    } }, { key: "_onMessage", value: function(e3) {
      e3 = this._canIUseBinaryFrame ? this._isAppCompressedData(e3.data) ? this._handler.inflate(e3.data) : function(e4) {
        for (var t3 = new Uint8Array(e4), n3 = "", o3 = 0, i4 = t3.length; o3 < i4; ) {
          var s4 = t3[o3], a3 = 0, r4 = 0;
          if (s4 <= 127 ? (a3 = 0, r4 = 255 & s4) : s4 <= 223 ? (a3 = 1, r4 = 31 & s4) : s4 <= 239 ? (a3 = 2, r4 = 15 & s4) : s4 <= 244 && (a3 = 3, r4 = 7 & s4), 0 < i4 - o3 - a3)
            for (var c3 = 0; c3 < a3; )
              r4 = r4 << 6 | 63 & (s4 = t3[o3 + c3 + 1]), c3 += 1;
          else
            r4 = 65533, a3 = i4 - o3;
          n3 += String.fromCodePoint(r4), o3 += a3 + 1;
        }
        return n3;
      }(e3.data) : e3.data;
      this._handler.onMessage({ data: e3 });
    } }, { key: "_isAppCompressedData", value: function(e3) {
      e3 = new Uint8Array(e3);
      return 67 === e3[0] && 79 === e3[1] && 77 === e3[2] && 80 === e3[3];
    } }, { key: "_onError", value: function(e3) {
      this._handler.onError({ id: this._id, e: e3 });
    } }, { key: "setIsWorkerEnabled", value: function(e3) {
      this._isWorkerEnabled = true;
    } }, { key: "close", value: function(e3) {
      this._workerSocket && (this._workerSocket.postMessage({ cmd: "stop", code: e3 }), this._workerSocket.terminate(), this._workerSocket = null), ge2 ? (I2.offSocketClose(), I2.offSocketMessage(), I2.offSocketOpen(), I2.offSocketError(), I2.closeSocket()) : this._socket && (v3 ? (this._socket.onClose(function() {
      }), this._socket.onOpen(function() {
      }), this._socket.onMessage(function() {
      }), this._socket.onError(function() {
      })) : (this._socket.onopen = null, this._socket.onmessage = null, this._socket.onclose = null, this._socket.onerror = null), he2 ? this._socket.close({ code: e3 }) : this._socket.close(e3), this._socket = null);
    } }, { key: "send", value: function(e3) {
      this._workerSocket ? this._workerSocket.postMessage({ cmd: "sendMessage", data: this._canIUseBinaryFrame ? is(e3.data).buffer : e3.data }) : ge2 ? I2.sendSocketMessage({ data: e3.data, fail: function() {
        e3.fail && e3.requestID && e3.fail(e3.requestID);
      } }) : this._socket && (v3 ? this._socket.send({ data: this._canIUseBinaryFrame ? is(e3.data).buffer : e3.data, fail: function() {
        e3.fail && e3.requestID && e3.fail(e3.requestID);
      } }) : this._socket.send(this._canIUseBinaryFrame ? is(e3.data) : e3.data));
    } }]), as = ["keyMap"], rs = ["keyMap"], cs = "connected", us = "connecting", ls = "disconnected", ds = e2(function e3(t3) {
      p3(this, e3), this._chM = t3, this._n = "SocketHandler", this._promiseMap = /* @__PURE__ */ new Map(), this._readyState = ls, this._simpleRequestMap = /* @__PURE__ */ new Map(), this.MAX_SIZE = 100, this._startSequence = ht2(), this._startTs = 0, this._reConnectFlag = false, this._nextPingTs = 0, this._reConnectCount = 0, this.MAX_RECONNECT_COUNT = 3, this._socketID = -1, this._random = 0, this._socket = null, this._url = "", this._onOpenTs = 0, this._canIUseBinaryFrame = true, this._isWorkerEnabled = true, this._currentSite = se2, this._setWebsocketHost(), this._initConnection();
    }, [{ key: "_setWebsocketHost", value: function() {
      var e3 = this._chM.get(12);
      this._currentSite = se2, this._chM.isOversea() && (this._currentSite = "OVERSEA"), e3.isSingaporeSite() ? this._currentSite = "SINGAPORE" : e3.isKoreaSite() ? this._currentSite = "KOREA" : e3.isGermanySite() ? this._currentSite = "GERMANY" : e3.isIndiaSite() ? this._currentSite = "IND" : e3.isJapanSite() ? this._currentSite = "JPN" : e3.isUSASite() ? this._currentSite = "USA" : e3.isIndonesiaSite() && (this._currentSite = "INDONESIA"), s3.HOST.setCurrent(this._currentSite);
    } }, { key: "_initConnection", value: function() {
      var e3 = this._chM.get(12).getSDKAppID() + "", t3 = this._chM.get(12).isIndependentDomainDisabled(), t3 = (N3(s3.HOST.CURRENT.BACKUP) ? this._url = s3.HOST.CURRENT.DEFAULT : "" === this._url ? this._url = t3 ? s3.HOST.CURRENT.DEFAULT : s3.HOST.CURRENT.DEFAULT0.replace("*", e3) : -1 < this._url.indexOf(e3) ? this._url = s3.HOST.CURRENT.DEFAULT : this._url === s3.HOST.CURRENT.DEFAULT ? this._url = s3.HOST.CURRENT.IPV6 : this._url === s3.HOST.CURRENT.IPV6 ? this._url = Ie2 ? this._genRandomDomain() : s3.HOST.CURRENT.BACKUP : this._isWebBackupUrl(this._url) || this._url === s3.HOST.CURRENT.BACKUP ? this._url = this._canIUseAnyCast() ? s3.HOST.CURRENT.ANYCAST : s3.HOST.CURRENT.DEFAULT : this._url === s3.HOST.CURRENT.ANYCAST && (s3.HOST.CURRENT.ANYCAST = "", this._url = s3.HOST.CURRENT.DEFAULT), this._chM.get(12)), e3 = t3.getProxyServer();
      S2(e3) || (this._url = e3), t3.isTestEnv() && (this._url = ee2.TEST[this._currentSite].DEFAULT), this._connect(), this._nextPingTs = 0;
    } }, { key: "_genRandomDomain", value: function() {
      var e3 = Math.floor(10001 * Math.random()) + 1e4;
      return s3.HOST.CURRENT.BACKUP_WEB.replace("*", e3);
    } }, { key: "_isWebBackupUrl", value: function(e3) {
      return e3.includes("my-cpaas.com");
    } }, { key: "_canIUseAnyCast", value: function() {
      return Ie2 && s3.HOST.CURRENT.ANYCAST;
    } }, { key: "onCheckTimer", value: function(e3) {
      e3 % 1 == 0 && (this._checkPromiseMap(), this._checkNativeAppWS());
    } }, { key: "_checkPromiseMap", value: function() {
      var s4 = this;
      0 !== this._promiseMap.size && this._promiseMap.forEach(function(e3, t3) {
        var n3 = e3.reject, o3 = e3.timestamp, e3 = e3.headSeq, i4 = 15e3;
        -1 !== t3.indexOf(G2.LOGIN) ? i4 = 9e4 : -1 !== t3.indexOf(G2.PING) && (i4 = 3e3), Date.now() - o3 >= i4 && (M2.l("".concat(s4._n, "._checkPromiseMap request timeout, delete requestID:").concat(t3)), s4._promiseMap.delete(t3), n3(new L2({ code: k2.NETWORK_TIMEOUT, data: { headSeq: e3 } })), s4._chM.onRequestTimeout());
      });
    } }, { key: "_checkNativeAppWS", value: function() {
      fe2 && !this.isConnected() && this._reConnect();
    } }, { key: "onOpen", value: function(e3) {
      var t3, n3;
      this._readyState !== ls && (this._onOpenTs = Date.now(), n3 = e3.id, e3 = e3.res, this._socketID = n3, t3 = tn(this._startTs, false), n3 = "socketID:".concat(n3, " res:").concat(e3), M2.l("".concat(this._n, "._onOpen cost:").concat(t3, " ms. ").concat(n3)), new P2("wsOnOpen").setMessage(t3).setCostTime(t3).setMoreMessage(n3).end(), this._readyState = cs, this._reConnectCount = 0, this._resend(), true === this._reConnectFlag && (this._chM.onReconnected(), this._reConnectFlag = false), this._chM.onOpen());
    } }, { key: "onClose", value: function(e3) {
      var t3 = new P2("wsOnClose"), n3 = e3.id, e3 = e3.e, o3 = "sourceSocketID:".concat(n3, " currentSocketID:").concat(this._socketID, " code:").concat(e3.code, " reason:").concat(e3.reason), i4 = 0;
      0 !== this._onOpenTs && (i4 = Date.now() - this._onOpenTs), t3.setMessage(i4).setCostTime(i4).setMoreMessage(o3).setCode(e3.code).end(true), M2.l("".concat(this._n, "._onClose ").concat(o3, " onlineTime:").concat(i4)), n3 === this._socketID && (this._readyState = ls, i4 < 1e3 ? this._chM.onReconnectFailed() : this._chM.onClose());
    } }, { key: "onError", value: function(e3) {
      var t3 = e3.id, e3 = e3.e, n3 = "sourceSocketID:".concat(t3, " currentSocketID:").concat(this._socketID);
      new P2("wsOnError").setMessage(e3.errMsg || JSON.stringify(e3, ["message", "code"])).setMoreMessage(n3).setLevel("error").end(true), M2.w("".concat(this._n, "._onError"), e3, n3), t3 === this._socketID && (this._readyState = ls, this._chM.onError());
    } }, { key: "onMessage", value: function(t3) {
      var e3, n3, o3, i4, s4, a3;
      try {
        e3 = JSON.parse(t3.data);
      } catch (e4) {
        new P2("jsonParseError").setMessage(t3.data).end();
      }
      e3 && e3.head && (t3 = this._getRequestIDFromHead(e3.head), n3 = e3.body, this._chM.get(30).isTRTCCommand(t3) || (a3 = Ht2(e3.head), n3 = function t4(e4, n4) {
        var o4, i5, s5;
        return O2(e4) ? e4.map(function(e5) {
          return at2(e5) ? t4(e5, n4) : e5;
        }) : at2(e4) ? (o4 = e4, i5 = function(e5, t5) {
          return N3(n4[t5]) ? $i(t5) : n4[t5];
        }, s5 = {}, Object.keys(o4).forEach(function(e5) {
          s5[i5(o4[e5], e5)] = o4[e5];
        }), bt2(s5, function(e5) {
          return O2(e5) || at2(e5) ? t4(e5, n4) : e5;
        })) : void 0;
      }(e3.body, this._getResKeyMap(a3))), M2.d("".concat(this._n, ".onMessage ret:").concat(JSON.stringify(n3), " requestID:").concat(t3, " has:").concat(this._promiseMap.has(t3))), this._setNextPingTs(), this._promiseMap.has(t3) ? (o3 = (a3 = this._promiseMap.get(t3)).resolve, i4 = a3.reject, s4 = a3.timestamp, a3 = a3.headSeq, this._promiseMap.delete(t3), this._calcRTT(s4), n3.errorCode && 0 !== n3.errorCode ? (this._chM.onErrorCodeNotZero(n3), i4(new L2({ code: n3.errorCode, message: n3.errorInfo || "", data: t3.includes(G2.MODIFY_C2C_MSG) || t3.includes(G2.MODIFY_GRP_MSG) ? { elements: n3.elements, messageVersion: n3.messageVersion, cloudCustomData: n3.cloudCustomData, headSeq: a3 } : { headSeq: a3 } }))) : o3(T2(n3))) : this._chM.onMessage({ head: e3.head, body: n3 }));
    } }, { key: "_calcRTT", value: function(e3) {
      e3 = Date.now() - e3;
      this._chM.get(26).addRTT(e3);
    } }, { key: "_connect", value: function() {
      this._readyState !== us && this._readyState !== cs && (this._startTs = Date.now(), this._onOpenTs = 0, this._readyState = us, this._socket = new ss2(this), this._socketID = this._socket.getID(), M2.l("".concat(this._n, "._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled(), " socketID:").concat(this._socketID, " url:").concat(this.getURL())), new P2("wsConnect").setMessage("socketID:".concat(this._socketID, " url:").concat(this.getURL())).end());
    } }, { key: "getURL", value: function() {
      this._chM.isDevMode() && (this._canIUseBinaryFrame = false);
      var e3 = qt2(), t3 = ((ge2 || le2 && "windows" === e3 || fe2) && (this._canIUseBinaryFrame = false), -1), n3 = ("ios" === e3 ? t3 = Te2 || -1 : "android" === e3 && (t3 = Ee2 || -1), this._chM.get(12)), o3 = this._chM.getPlatform(), i4 = n3.getSDKAppID(), n3 = n3.getInstanceID(), i4 = "sdkappid=".concat(i4, "&instanceid=").concat(n3, "&random=").concat(this._getRandom(), "&platform=").concat(o3, "&host=").concat(e3) + "&version=".concat(t3, "&sdkversion=").concat("3.5.4");
      return de2 && (i4 += "&isminigame=1"), this._chM.canIUseInflate() && (i4 += "&compress=gzip"), (this._canIUseBinaryFrame ? "".concat(this._url, "/binfo?") : "".concat(this._url, "/info?")).concat(i4);
    } }, { key: "_closeConnection", value: function(e3) {
      M2.l("".concat(this._n, "._closeConnection socketID:").concat(this._socketID)), this._socket && (this._socket.close(e3), this._socketID = -1, this._socket = null, this._readyState = ls);
    } }, { key: "_resend", value: function() {
      var i4 = this;
      if (M2.l("".concat(this._n, "._resend reConnectFlag:").concat(this._reConnectFlag), "promiseMap.size:".concat(this._promiseMap.size, " simpleRequestMap.size:").concat(this._simpleRequestMap.size)), 0 < this._promiseMap.size && this._promiseMap.forEach(function(e4, t4) {
        var n4 = e4.uplinkData, o4 = e4.resolve, e4 = e4.reject;
        -1 !== t4.indexOf(G2.AV_POLLING) ? i4._promiseMap.delete(t4) : (i4._promiseMap.set(t4, { resolve: o4, reject: e4, timestamp: Date.now(), uplinkData: n4 }), i4._execute(t4, n4));
      }), 0 < this._simpleRequestMap.size) {
        var e3, t3 = F2(this._simpleRequestMap);
        try {
          for (t3.s(); !(e3 = t3.n()).done; ) {
            var n3 = j2(e3.value, 2), o3 = n3[0], s4 = n3[1];
            this._execute(o3, s4);
          }
        } catch (e4) {
          t3.e(e4);
        } finally {
          t3.f();
        }
        this._simpleRequestMap.clear();
      }
    } }, { key: "send", value: function(n3) {
      var o3 = this, i4 = (n3.head.seq = this._getSequence(), n3.head.reqtime = Math.floor(Date.now() / 1e3), n3.head.cs = this._calcCheckSum(n3.head.servcmd, n3.body), n3.keyMap, W2(n3, as)), s4 = this._getRequestIDFromHead(n3.head), a3 = JSON.stringify(i4);
      return new Promise(function(e3, t3) {
        o3._promiseMap.set(s4, { resolve: e3, reject: t3, timestamp: Date.now(), uplinkData: a3, headSeq: n3.head.seq }), M2.d("".concat(o3._n, ".send uplinkData:").concat(JSON.stringify(i4), " requestID:").concat(s4, " readyState:").concat(o3._readyState)), o3._readyState !== cs ? o3._reConnect() : (o3._execute(s4, a3), o3._chM.get(26).addRequestCount());
      });
    } }, { key: "simplySend", value: function(e3) {
      e3.head.seq = this._getSequence(), e3.head.reqtime = Math.floor(Date.now() / 1e3), e3.keyMap;
      var t3 = W2(e3, rs), e3 = this._getRequestIDFromHead(e3.head), t3 = JSON.stringify(t3);
      this._readyState !== cs ? (this._simpleRequestMap.size < this.MAX_SIZE ? this._simpleRequestMap.set(e3, t3) : M2.l("".concat(this._n, ".simplySend. simpleRequestMap is full, drop request!")), this._reConnect()) : this._execute(e3, t3);
    } }, { key: "_execute", value: function(e3, t3) {
      this._socket.send({ data: t3, fail: v3 ? this._onSendFail.bind(this) : void 0, requestID: e3 });
    } }, { key: "_onSendFail", value: function(e3) {
      M2.l("".concat(this._n, "._onSendFail requestID:").concat(e3)), this._chM.onSendFail();
    } }, { key: "_getSequence", value: function() {
      var e3;
      if (this._startSequence < 2415919103)
        return e3 = this._startSequence, this._startSequence += 1, 2415919103 === this._startSequence && (this._startSequence = ht2()), e3;
    } }, { key: "_getRequestIDFromHead", value: function(e3) {
      return e3.servcmd + e3.seq;
    } }, { key: "_getResKeyMap", value: function(e3) {
      e3 = this._chM.getKeyMap(e3);
      return y2(y2({}, Yi.res), e3.res);
    } }, { key: "_reConnect", value: function() {
      this._readyState !== cs && this._readyState !== us && this.forcedReconnect();
    } }, { key: "forcedReconnect", value: function() {
      var e3 = "".concat(this._n, ".forcedReconnect");
      M2.l("".concat(e3, " count:").concat(this._reConnectCount, " readyState:").concat(this._readyState)), this._reConnectFlag = true, this._resetRandom(), this._reConnectCount < this.MAX_RECONNECT_COUNT ? (this._reConnectCount += 1, this._closeConnection(4001), this._initConnection()) : (this._reConnectCount = 0, this._chM.get(15).isOnline() ? (M2.w("".concat(e3, " disconnected from wsserver but network is ok, continue...")), this._closeConnection(4001), this._initConnection()) : this._chM.onReconnectFailed());
    } }, { key: "getReconnectFlag", value: function() {
      return this._reConnectFlag;
    } }, { key: "_setNextPingTs", value: function() {
      this._nextPingTs = fe2 ? Date.now() + 5e3 : Date.now() + 1e4;
    } }, { key: "getNextPingTs", value: function() {
      return this._nextPingTs;
    } }, { key: "isConnected", value: function() {
      return this._readyState === cs;
    } }, { key: "canIUseBinaryFrame", value: function() {
      return this._canIUseBinaryFrame;
    } }, { key: "getSocketID", value: function() {
      return this._socketID;
    } }, { key: "inflate", value: function(e3) {
      if (this._chM.canIUseInflate())
        return this._chM.get(37).inflate(e3);
    } }, { key: "setIsWorkerEnabled", value: function(e3) {
      M2.l("".concat(this._n, ".setIsWorkerEnabled flag:").concat(e3)), this._isWorkerEnabled = e3;
    } }, { key: "getIsWorkerEnabled", value: function() {
      return this._isWorkerEnabled && Ae2;
    } }, { key: "_getRandom", value: function() {
      return 0 === this._random && (this._random = Math.random()), this._random;
    } }, { key: "_resetRandom", value: function() {
      this._random = 0;
    } }, { key: "_calcCheckSum", value: function(e3, t3) {
      if (-1 !== e3.indexOf(G2.PING) || -1 !== e3.indexOf(G2.LOGIN) || -1 !== e3.indexOf(G2.LOGOUT) || -1 !== e3.indexOf(G2.AV_POLLING) || -1 !== e3.indexOf(G2.AV_NOAUTH_POLLING))
        return 0;
      for (var n3 = is(JSON.stringify(t3)), o3 = 4294967295, i4 = 0, s4 = n3.length; i4 < s4; i4++) {
        o3 ^= n3[i4];
        for (var a3 = 0; a3 < 8; a3++)
          1 == (1 & o3) ? o3 = o3 >>> 1 ^ 3988292384 : o3 >>>= 1;
      }
      return (4294967295 ^ o3) >>> 0;
    } }, { key: "close", value: function() {
      M2.l("".concat(this._n, ".close")), this._closeConnection(4e3), this._promiseMap.clear(), this._startSequence = ht2(), this._readyState = ls, this._simpleRequestMap.clear(), this._reConnectFlag = false, this._reConnectCount = 0, this._onOpenTs = 0, this._url = "", this._random = 0, this._canIUseBinaryFrame = true, this._isWorkerEnabled = true;
    } }]), ps = function(s4, a3, r4) {
      return new Promise(function(t3, e3) {
        var n3, o3, i4 = "application/x-www-form-urlencoded;charset=UTF-8";
        v3 ? I2.request({ url: a3, data: r4, method: s4, timeout: 3e3, header: { "content-type": i4 }, success: function(e4) {
          e4 && e4.data && e4.data.NetCheckInfo && M2.l("".concat("getconninfo ok in", " miniapp. ret:"), e4.data), t3();
        }, fail: function() {
          e3(new L2({ code: k2.NETWORK_ERROR }));
        } }) : (n3 = new XMLHttpRequest(), o3 = setTimeout(function() {
          n3.abort(), e3(new L2({ code: k2.NETWORK_TIMEOUT }));
        }, 3e3), n3.onreadystatechange = function() {
          4 === n3.readyState && (o3 && clearTimeout(o3), 200 === n3.status || 304 === n3.status ? (n3.responseText && -1 < n3.responseText.indexOf("NetCheckInfo") && M2.l("".concat("getconninfo ok in", " web. ret:"), JSON.parse(n3.responseText)), t3()) : e3(new L2({ code: k2.NETWORK_ERROR })));
        }, n3.open(s4, a3, true), n3.setRequestHeader("Content-type", i4), r4 ? n3.send(r4) : n3.send());
      });
    }, _s = (t2(Ds, c2), e2(Ds, [{ key: "onCheckTimer", value: function(e3) {
      this._socketHandler && (this.isLoggedIn() ? (0 < this._timerForNotLoggedIn && (clearInterval(this._timerForNotLoggedIn), this._timerForNotLoggedIn = -1), this._socketHandler.onCheckTimer(e3)) : this._socketHandler.onCheckTimer(1), this._checkNextPing());
    } }, { key: "onErrorCodeNotZero", value: function(e3) {
      this.get(20).onErrorCodeNotZero(e3);
    } }, { key: "onMessage", value: function(e3) {
      this.get(20).onMessage(e3);
    } }, { key: "send", value: function(e3) {
      return this._socketHandler ? this._previousState !== R2.NET_STATE_CONNECTED && e3.head.servcmd.includes(G2.SSO_STAT) ? (this.reConnect(), this.isPrivateNetWork() ? Promise.resolve() : this._sendLogViaHTTP(e3)) : this._socketHandler.send(e3) : Promise.reject();
    } }, { key: "_sendLogViaHTTP", value: function(e3) {
      var t3 = s3.HOST.CURRENT.STAT, t3 = "".concat(t3, "/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e3.head.sdkappid, "&reqtime=").concat(Date.now()), e3 = JSON.stringify(e3.body);
      return ps("POST", t3, e3);
    } }, { key: "simplySend", value: function(e3) {
      return this._socketHandler ? this._socketHandler.simplySend(e3) : Promise.reject();
    } }, { key: "onOpen", value: function() {
      this._ping();
    } }, { key: "onClose", value: function() {
      this._socketHandler && this._socketHandler.getReconnectFlag() && this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED), this.reConnect();
    } }, { key: "onError", value: function() {
      v3 && !fe2 && this.warn("DomainNameInMP"), this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "getKeyMap", value: function(e3) {
      return this.get(20).getKeyMap(e3);
    } }, { key: "onRequestTimeout", value: function() {
      3e4 <= Date.now() - this._lastDiagnoseTS && this.diagnose();
    } }, { key: "onSendFail", value: function() {
      this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "onReconnected", value: function() {
      M2.l("".concat(this._n, ".onReconnected cost:").concat(tn(this._disconnectedTS, true, true))), this._m.restartTimer(), this.get(20).onReconnected(tn(this._disconnectedTS, false, false)), this._disconnectedTS = 0, this._emitNetStateChangeEvent(R2.NET_STATE_CONNECTED);
    } }, { key: "onReconnectFailed", value: function() {
      M2.l("".concat(this._n, ".onReconnectFailed")), this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "setIsWorkerEnabled", value: function(e3) {
      this._socketHandler && this._socketHandler.setIsWorkerEnabled(false);
    } }, { key: "offline", value: function() {
      this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "reConnect", value: function() {
      var e3 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t3 = false, n3 = (this._socketHandler && (t3 = this._socketHandler.getReconnectFlag()), "forcedFlag:".concat(e3, " fatalErrorFlag:").concat(this._fatalErrorFlag, " previousState:").concat(this._previousState, " reconnectFlag:").concat(t3));
      M2.l("".concat(this._n, ".reConnect ").concat(n3)), this._fatalErrorFlag || !this._socketHandler || true !== e3 && this._previousState === R2.NET_STATE_CONNECTING && t3 || (this._socketHandler.forcedReconnect(), this._emitNetStateChangeEvent(R2.NET_STATE_CONNECTING));
    } }, { key: "_emitNetStateChangeEvent", value: function(e3) {
      this._previousState !== e3 && (M2.l("".concat(this._n, "._emitNetStateChangeEvent from ").concat(this._previousState, " to ").concat(e3)), e3 === R2.NET_STATE_DISCONNECTED && 0 === this._disconnectedTS && (this._disconnectedTS = Date.now(), this.diagnose()), this._previousState = e3, this.emitOEvt(h2.NET_STATE_CHANGE, { state: e3 }));
    } }, { key: "_ping", value: function() {
      var e3, n3 = this;
      true !== this._probing && (this._probing = true, e3 = this.get(20).getProtocolData({ P: G2.PING }), this.send(e3).then(function() {
        n3._probing = false;
      }).catch(function(e4) {
        n3._probing = false;
        var t3 = n3.get(15).isOnline();
        M2.w("".concat(n3._n, "._ping failed. bOnline:").concat(t3, " error:"), e4), e4 && 60002 === e4.code ? (new P2("error").setMessage("code:".concat(e4.code, " message:").concat(e4.message)).end(), n3._fatalErrorFlag = true, n3._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED)) : t3 ? n3.reConnect() : n3._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
      }));
    } }, { key: "_checkNextPing", value: function() {
      this._socketHandler && this._socketHandler.isConnected() && Date.now() >= this._socketHandler.getNextPingTs() && this._ping();
    } }, { key: "dealloc", value: function() {
      this._socketHandler && (this._socketHandler.close(), this._socketHandler = null), -1 < this._timerForNotLoggedIn && clearInterval(this._timerForNotLoggedIn);
    } }, { key: "onRestApiKickedOut", value: function() {
      this._socketHandler && (this._socketHandler.close(), this.reConnect(true));
    } }, { key: "canIUseInflate", value: function() {
      return this._m.canIUseInflate();
    } }, { key: "getSocketID", value: function() {
      if (this._socketHandler)
        return this._socketHandler.getSocketID();
    } }, { key: "diagnose", value: function() {
      this.isPrivateNetWork() || (this._lastDiagnoseTS = Date.now(), this._diagnoseBySSO(), this._diagnoseByCDN());
    } }, { key: "_diagnoseBySSO", value: function() {
      var t3 = this, e3 = this._socketHandler.getURL(), n3 = e3.split("/")[2];
      n3.startsWith("ws") && (e3 = e3.slice(e3.indexOf("info?") + 5), n3 = "https://".concat(n3, "/v3/netcheck/getconninfo?").concat(e3, "&reqtime=").concat(Date.now()), ps("GET", n3).catch(function(e4) {
        M2.w("".concat(t3._n, "._diagnoseBySSO failed. error:"), e4);
      }));
    } }, { key: "_diagnoseByCDN", value: function() {
      var t3 = this, e3 = this._socketHandler.getURL(), e3 = e3.slice(e3.indexOf("info?") + 5), e3 = "https://boce-cdn.my-imcloud.com/v3/netcheck/getconninfo?".concat(e3, "&reqtime=").concat(Date.now());
      ps("GET", e3).catch(function(e4) {
        M2.w("".concat(t3._n, "._diagnoseByCDN failed. error:"), e4);
      });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._previousState = R2.NET_STATE_CONNECTED, this._probing = false, this._fatalErrorFlag = false, this._timerForNotLoggedIn = setInterval(this.onCheckTimer.bind(this), 1e3), this._disconnectedTS = 0, this._lastDiagnoseTS = 0;
    } }])), hs = ["a2", "tinyid"], gs = ["a2", "tinyid"], fs = e2(function e3(t3) {
      p3(this, e3), this._n = "PHandler", this._sessionM = t3, this._map = /* @__PURE__ */ new Map(), this._fillMap();
    }, [{ key: "_fillMap", value: function() {
      this._map.clear();
      var e3 = this._sessionM.genCommonHead(), t3 = this._sessionM.genCosSpecifiedHead(), n3 = this._sessionM.genSSOReportHead();
      this._map.set(G2.LOGIN, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.LOGIN) }), body: { state: "Online", isWebUniapp: 0, deviceBrand: 0, customInfo: "" }, keyMap: { req: { deviceBrand: "InstType" }, res: { InstId: "instanceID", HelloInterval: "helloInterval", RichMsgAuthKey: "authKey" } } }), this._map.set(G2.LOGOUT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.LOGOUT) }), body: { type: 0, isWebUniapp: 0 }, keyMap: { req: { type: "wslogout_type" } } }), this._map.set(G2.HELLO, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.HELLO) }), body: { isWebUniapp: 0 }, keyMap: { res: { NewInstInfo: "newInstanceInfo" } } }), this._map.set(G2.KICK_OTHER, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.STAT_SERVICE, ".").concat(G2.KICK_OTHER) }), body: {} }), this._map.set(G2.COS_SIGN, { head: y2(y2({}, t3), {}, { servcmd: "".concat(s3.NAME.IM_COS_SIGN, ".").concat(G2.COS_SIGN) }), body: { cmd: "open_im_cos_svc", subCmd: "get_cos_token", duration: 300, version: 2 }, keyMap: { req: { userSig: "usersig", subCmd: "sub_cmd", cmd: "cmd", duration: "duration", version: "version" }, res: { expired_time: "expiredTime", bucket_name: "bucketName", session_token: "sessionToken", tmp_secret_id: "secretId", tmp_secret_key: "secretKey" } } }), this._map.set(G2.COS_PRE_SIG, { head: y2(y2({}, t3), {}, { servcmd: "".concat(s3.NAME.CUSTOM_UPLOAD, ".").concat(G2.COS_PRE_SIG) }), body: { fileType: void 0, fileName: void 0, uploadMethod: 0, duration: 900 }, keyMap: { req: { userSig: "usersig", fileType: "file_type", fileName: "file_name", uploadMethod: "upload_method" }, res: { expired_time: "expiredTime", request_id: "requestId", head_url: "headUrl", upload_url: "uploadUrl", download_url: "downloadUrl", ci_url: "ciUrl", snapshot_url: "requestSnapshotUrl" } } }), this._map.set(G2.SIMPLE_COS_PRE_SIG, { head: y2(y2({}, t3), {}, { servcmd: "".concat(s3.NAME.CUSTOM_UPLOAD, ".").concat(G2.SIMPLE_COS_PRE_SIG) }), body: { uploadMethod: 0, platform: 2, SDKAppID: 0, userID: "", conversationType: 1, uploadConfig: [{ fileID: 1, fileType: 1, fileName: "" }] }, keyMap: { req: { platform: "uint32_platform", SDKAppID: "uint32_sdkappid", userID: "str_user_id", uploadMethod: "uint32_upload_method", conversationType: "uint32_scene", uploadConfig: "rpt_upload_object", fileID: "uint32_file_id", fileType: "uint32_file_type", fileName: "str_file_name" }, res: { str_final_ip: "uploadIP", rpt_pre_sig: "preSig", uint32_file_id: "fileID", uint32_exist_flag: "existFlag", str_download_url: "downloadUrl", str_upload_url: "uploadUrl", str_snapshot_url: "requestSnapshotUrl", str_file_key: "fileKey" } } }), this._map.set(G2.GET_IMAGE_INFO, { head: y2(y2({}, t3), {}, { servcmd: "".concat(s3.NAME.CUSTOM_UPLOAD, ".").concat(G2.GET_IMAGE_INFO) }), body: { imageUrl: "" }, keyMap: { req: { imageUrl: "str_image_url" }, res: { rpt_msg_image_info: "imageInfoArray", uint32_image_type: "type", str_url: "url", uint32_width: "width", uint32_height: "height", str_image_format: "imageFormat" } } }), this._map.set(G2.GET_IP, { head: y2(y2({}, t3), {}, { servcmd: "".concat(s3.NAME.CUSTOM_UPLOAD, ".").concat(G2.GET_IP) }), body: { domainName: "" }, keyMap: { req: { domainName: "str_domain" }, res: { str_final_ip: "ip" } } }), this._map.set(G2.VIDEO_COVER, { head: y2(y2({}, t3), {}, { servcmd: "".concat(s3.NAME.CUSTOM_UPLOAD, ".").concat(G2.VIDEO_COVER) }), body: { version: 1, platform: void 0, coverName: void 0, requestSnapshotUrl: void 0 }, keyMap: { req: { version: "version", platform: "platform", coverName: "cover_name", requestSnapshotUrl: "snapshot_url" }, res: { error_code: "errorCode", error_msg: "errorInfo", download_url: "snapshotUrl" } } }), this._map.set(G2.FETCH_COMMERCIAL_CONFIG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.FETCH_COMMERCIAL_CONFIG) }), body: { SDKAppID: 0 }, keyMap: { req: { SDKAppID: "uint32_sdkappid" }, res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_purchase_bits: "purchaseBits", uint32_expired_time: "expiredTime" } } }), this._map.set(G2.PUSHED_COMMERCIAL_CONFIG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.PUSHED_COMMERCIAL_CONFIG) }), body: {}, keyMap: { res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_purchase_bits: "purchaseBits", uint32_expired_time: "expiredTime" } } }), this._map.set(G2.FETCH_CLOUD_CTRL_CONFIG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.FETCH_CLOUD_CTRL_CONFIG) }), body: { SDKAppID: 0, version: 0 }, keyMap: { req: { SDKAppID: "uint32_sdkappid", version: "uint64_version" }, res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_json_config: "cloudControlConfig", uint32_expired_time: "expiredTime", uint32_sdkappid: "SDKAppID", uint64_version: "version" } } }), this._map.set(G2.PUSHED_CLOUD_CTRL_CONFIG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.PUSHED_CLOUD_CTRL_CONFIG) }), body: {}, keyMap: { res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_json_config: "cloudControlConfig", uint32_expired_time: "expiredTime", uint32_sdkappid: "SDKAppID", uint64_version: "version" } } }), this._map.set(G2.OVERLOAD_NOTIFY, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OVERLOAD_PUSH, ".").concat(G2.OVERLOAD_NOTIFY) }), body: {}, keyMap: { res: { OverLoadServCmd: "overloadCommand", DelaySecs: "waitingTime" } } }), this._map.set(G2.SYNC_UNREAD_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.SYNC_UNREAD_MSG) }), body: { cookie: "", syncFlag: 0, needAbstract: 1, isOnlineSync: 0, needSignaling: 1, needCachedMsg: 1 }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", from: "From_Account", to: "To_Account", time: "MsgTimeStamp", sequence: "MsgSeq", random: "MsgRandom", elements: "MsgBody" }, res: { MsgList: "messageList", SyncFlag: "syncFlag", To_Account: "to", From_Account: "from", ClientSeq: "clientSequence", MsgSeq: "sequence", NoticeSeq: "noticeSequence", NotifySeq: "notifySequence", MsgRandom: "random", MsgTimeStamp: "time", MsgContent: "content", ToGroupId: "to", MsgKey: "messageKey", GroupTips: "groupTips", MsgBody: "elements", MsgType: "type", C2CRemainingUnreadCount: "C2CRemainingUnreadList", C2CPairUnreadCount: "C2CPairUnreadList" } } }), this._map.set(G2.GET_PROFANITY_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_MSG_AUDIT_MGR, ".").concat(G2.GET_PROFANITY_LIST) }), body: { version: 0, deviceID: "", startIndex: void 0 }, keyMap: { req: { version: "uint64_version", deviceID: "str_device_id", startIndex: "uint64_start_index" }, res: { msg_cmd_error_code: "errorInfo", str_err_msg: "errorMessage", uint32_code: "errorCode", msg_scene_ctl_config: "filterConfig", uint64_c2c_custom_msg_flag: "c2c_custom_message", uint64_c2c_text_msg_flag: "c2c_text_message", uint64_group_custom_msg_flag: "group_custom_message", uint64_group_text_msg_flag: "group_text_message", uint64_group_info_flag: "group_profile", uint64_group_member_info_flag: "group_member_profile", uint64_relation_chain_flag: "sns", uint64_user_info_flag: "user_profile", rpt_msg_dirty_word: "lexicon", str_dirty_word: "profanity", str_replaced_content: "replacement", uint64_filter_type: "filterType", uint64_id: "id", uint64_word_type: "profanityType", uint64_complete_flag: "completeFlag", uint64_next_start_index: "nextStartIndex", uint64_version: "version", uint64_expired_time: "expiredTime" } } }), this._map.set(G2.SEND_C2C_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.SEND_C2C_MSG) }), body: { fromAccount: "", toAccount: "", msgSeq: 0, msgRandom: 0, msgBody: [], cloudCustomData: void 0, nick: "", avatar: "", msgLifeTime: void 0, offlinePushInfo: { pushFlag: 0, title: "", desc: "", ext: "", apnsInfo: { sound: "", badgeMode: 0, isVoipPush: void 0, image: "" }, androidInfo: { sound: "", XiaoMiChannelID: "", OPPOChannelID: "", GoogleChannelID: "", VIVOClassification: 1, VIVOCategory: "", HuaWeiCategory: "", OPPOCategory: "", HuaWeiImage: "", HonorImage: "", GoogleImage: "", HonorImportance: "" } }, messageControlInfo: void 0, clientTime: void 0, needReadReceipt: 0, isSupportExtension: 0, isRelayMessage: 0, cmConfigID: void 0, forbidCallbackControl: void 0 }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom", msgBody: "MsgBody", count: "MaxCnt", lastMessageTime: "LastMsgTime", messageKey: "MsgKey", peerAccount: "Peer_Account", data: "Data", description: "Desc", extension: "Ext", type: "MsgType", content: "MsgContent", sizeType: "Type", uuid: "UUID", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", nick: "From_AccountNick", avatar: "From_AccountHeadurl", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", elements: "MsgBody", clientSequence: "ClientSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody", needReadReceipt: "IsNeedReadReceipt", GoogleChannelID: "GoogleChannelID", XiaoMiChannelID: "XiaoMiChannelID", OPPOChannelID: "OPPOChannelID", OPPOCategory: "OPPOCategory", VIVOClassification: "VIVOClassification", VIVOCategory: "VIVOCategory", HonorImportance: "HonorImportance" } } }), this._map.set(G2.SEND_GRP_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.SEND_GRP_MSG) }), body: { fromAccount: "", groupID: "", random: 0, clientSequence: 0, priority: "", msgBody: [], cloudCustomData: void 0, onlineOnlyFlag: 0, offlinePushInfo: { pushFlag: 0, title: "", desc: "", ext: "", apnsInfo: { sound: "", badgeMode: 0, isVoipPush: void 0, image: "" }, androidInfo: { sound: "", XiaoMiChannelID: "", OPPOChannelID: "", GoogleChannelID: "", VIVOClassification: 1, VIVOCategory: "", HuaWeiCategory: "", OPPOCategory: "", HuaWeiImage: "", HonorImage: "", GoogleImage: "", HonorImportance: "" } }, groupAtInfo: [], messageControlInfo: void 0, clientTime: void 0, needReadReceipt: 0, topicID: void 0, receiverList: void 0, isSupportExtension: 0, isRelayMessage: 0, cmConfigID: void 0, forbidCallbackControl: void 0 }, keyMap: { req: { to: "GroupId", extension: "Ext", data: "Data", description: "Desc", random: "Random", sequence: "ReqMsgSeq", count: "ReqMsgNumber", type: "MsgType", priority: "MsgPriority", content: "MsgContent", elements: "MsgBody", sizeType: "Type", uuid: "UUID", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", clientSequence: "ClientSeq", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody", needReadReceipt: "NeedReadReceipt", receiverList: "To_Account", GoogleChannelID: "GoogleChannelID", XiaoMiChannelID: "XiaoMiChannelID", OPPOChannelID: "OPPOChannelID", OPPOCategory: "OPPOCategory", VIVOClassification: "VIVOClassification", VIVOCategory: "VIVOCategory", HonorImportance: "HonorImportance" }, res: { MsgTime: "time", MsgSeq: "sequence" } } }), this._map.set(G2.REVOKE_C2C_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.REVOKE_C2C_MSG) }), body: { msgInfo: { fromAccount: "", toAccount: "", msgTimeStamp: 0, msgSeq: 0, msgRandom: 0 } }, keyMap: { req: { msgInfo: "MsgInfo", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom" } } }), this._map.set(G2.REVOKE_GRP_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.REVOKE_GRP_MSG) }), body: { groupID: "", msgSeqList: void 0, topicID: "" }, keyMap: { req: { msgSeqList: "MsgSeqList", msgSeq: "MsgSeq" } } }), this._map.set(G2.GET_C2C_ROAMING_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.GET_C2C_ROAMING_MSG) }), body: { peerAccount: "", count: 15, lastMessageTime: 0, messageKey: "", withRecalledMessage: 1, direction: 0 }, keyMap: { req: { messageKey: "MsgKey", peerAccount: "Peer_Account", count: "MaxCnt", lastMessageTime: "LastMsgTime", withRecalledMessage: "WithRecalledMsg", direction: "GetDirection" }, res: { LastMsgTime: "lastMessageTime", IsNeedReadReceipt: "needReadReceipt", IsPeerRead: "readReceiptSentByPeer" } } }), this._map.set(G2.MODIFY_C2C_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.MODIFY_C2C_MSG) }), body: { from: "", to: "", sequence: 0, random: 0, time: 0, version: 0, elements: void 0, cloudCustomData: void 0 }, keyMap: { req: { sequence: "MsgSeq", random: "MsgRandom", time: "MsgTime", version: "MsgVersion", type: "MsgType", content: "MsgContent" } } }), this._map.set(G2.GET_GRP_ROAMING_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_ROAMING_MSG) }), body: { withRecalledMsg: 1, groupID: "", count: 15, sequence: "", topicID: void 0 }, keyMap: { req: { sequence: "ReqMsgSeq", count: "ReqMsgNumber", withRecalledMessage: "WithRecalledMsg" }, res: { Random: "random", MsgTime: "time", MsgSeq: "sequence", ReqMsgSeq: "sequence", RspMsgList: "messageList", IsSystemMsg: "isSystemMessage", ToGroupId: "to", EnumFrom_AccountType: "fromAccountType", EnumTo_AccountType: "toAccountType", GroupCode: "groupCode", MsgPriority: "priority", MsgBody: "elements", MsgType: "type", MsgContent: "content", IsFinished: "complete", Download_Flag: "downloadFlag", ClientSeq: "clientSequence", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID", ToTopicId: "topicID", InvisibleMsgSeq: "invisibleSequenceList", NextReqMsgSeq: "nextSequence" } } }), this._map.set(G2.SET_C2C_MSG_READ, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.SET_C2C_MSG_READ) }), body: { C2CMsgReaded: void 0 }, keyMap: { req: { lastMessageTime: "LastedMsgTime" } } }), this._map.set(G2.SET_C2C_PEER_MUTE_NOTIFICATIONS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.SET_C2C_PEER_MUTE_NOTIFICATIONS) }), body: { userIDList: void 0, muteFlag: 0 }, keyMap: { req: { userIDList: "Peer_Account", muteFlag: "Mute_Notifications" } } }), this._map.set(G2.GET_C2C_PEER_MUTE_NOTIFICATIONS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.GET_C2C_PEER_MUTE_NOTIFICATIONS) }), body: { toAccount: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Peer_Account" }, res: { MuteNotificationsList: "muteFlagList" } } }), this._map.set(G2.SET_GRP_MSG_READ, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.SET_GRP_MSG_READ) }), body: { groupID: void 0, messageReadSeq: void 0, topicID: void 0 }, keyMap: { req: { messageReadSeq: "MsgReadedSeq" } } }), this._map.set(G2.SET_ALL_MSG_READ, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.SET_ALL_MSG_READ) }), body: { readAllC2CMessage: 0, groupMessageReadInfoList: [] }, keyMap: { req: { readAllC2CMessage: "C2CReadAllMsg", groupMessageReadInfoList: "GroupReadInfo", messageSequence: "MsgSeq" }, res: { C2CReadAllMsg: "readAllC2CMessage", GroupReadInfoArray: "groupMessageReadInfoList" } } }), this._map.set(G2.DEL_C2C_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.DEL_C2C_MSG) }), body: { fromAccount: "", to: "", keyList: void 0 }, keyMap: { req: { keyList: "MsgKeyList" } } }), this._map.set(G2.DEL_GRP_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.DEL_GRP_MSG) }), body: { groupID: "", deleter: "", keyList: void 0, topicID: void 0 }, keyMap: { req: { deleter: "Deleter_Account", keyList: "Seqs" } } }), this._map.set(G2.TRANSLATE_TEXT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_TRANSLATE, ".").concat(G2.TRANSLATE_TEXT) }), body: { sourceTextList: void 0, SDKAppID: 0, from: 0, source: "", target: "" }, keyMap: { req: { sourceTextList: "SourceText", SDKAppID: "SdkAppId", from: "FromAccount" }, res: { TargetText: "translatedTextList", RequestId: "requestID", CmdErrorCode: "error", ErrorCode: "code", ErrorInfo: "message" } } }), this._map.set(G2.VOICE_TO_TEXT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_SPEECH, ".").concat(G2.VOICE_TO_TEXT) }), body: { url: "", SDKAppID: 0, format: "", sourceType: 0, language: "" }, keyMap: { req: { url: "BytesUrl", SDKAppID: "Uint32Sdkappid", format: "BytesVoiceFormat", sourceType: "Uint64SourceType", language: "BytesEngServiceType" }, res: { BytesRequestid: "requestID", BytesResult: "result", CmdErrorCode: "error", ErrorCode: "code", ErrorInfo: "message" } } }), this._map.set(G2.MODIFY_GRP_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.MODIFY_GRP_MSG) }), body: { groupID: "", topicID: void 0, sequence: 0, version: 0, elements: void 0, cloudCustomData: void 0 }, keyMap: { req: { sequence: "MsgSeq", version: "MsgVersion", type: "MsgType", content: "MsgContent" } } }), this._map.set(G2.GET_READ_RECEIPT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_READ_RECEIPT) }), body: { groupID: "", sequenceList: void 0 }, keyMap: { req: { sequence: "MsgSeq" } } }), this._map.set(G2.SEND_C2C_READ_RECEIPT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.SEND_C2C_READ_RECEIPT) }), body: { peerAccount: "", messageInfoList: void 0 }, keyMap: { req: { peerAccount: "Peer_Account", messageInfoList: "C2CMsgInfo", fromAccount: "From_Account", toAccount: "To_Account", sequence: "MsgSeq", random: "MsgRandom", time: "MsgTime", clientTime: "MsgClientTime" } } }), this._map.set(G2.SEND_READ_RECEIPT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.SEND_READ_RECEIPT) }), body: { groupID: "", sequenceList: void 0 }, keyMap: { req: { sequenceList: "MsgSeqList", sequence: "MsgSeq" } } }), this._map.set(G2.GET_READ_RECEIPT_DETAIL, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_READ_RECEIPT_DETAIL) }), body: { groupID: "", sequence: void 0, flag: 0, cursor: 0, count: 0 }, keyMap: { req: { sequence: "MsgSeq", count: "Num" }, res: { ReadList: "readUserIDList", Read_Account: "userID", UnreadList: "unreadUserIDList", Unread_Account: "userID", IsFinish: "isCompleted" } } }), this._map.set(G2.GET_GRP_RECEIPTS_BY_USERS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_RECEIPTS_BY_USERS) }), body: { groupID: "", dataList: void 0 }, keyMap: { req: { dataList: "MemberReadMsgList", sequence: "MsgSeq", userIDList: "MemberList_Account" }, res: { MsgReadList: "dataList", Read_Account: "userID", Read_Time: "readTime" } } }), this._map.set(G2.MODIFY_C2C_MSG_EXT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.MODIFY_C2C_MSG_EXT) }), body: { from: void 0, to: void 0, messageKey: void 0, operateType: void 0, extensionList: void 0 } }), this._map.set(G2.GET_C2C_MSG_EXT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_C2C_MSG_EXT) }), body: { from: void 0, to: void 0, messageKey: void 0, startSequence: void 0 } }), this._map.set(G2.MODIFY_GRP_MSG_EXT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.MODIFY_GRP_MSG_EXT) }), body: { groupID: void 0, topicID: void 0, messageSequence: void 0, operateType: void 0, extensionList: void 0 } }), this._map.set(G2.GET_GRP_MSG_EXT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_GRP_MSG_EXT) }), body: { groupID: void 0, topicID: void 0, messageSequence: void 0, startSequence: void 0 } }), this._map.set(G2.ADD_C2C_MSG_REACTION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.ADD_C2C_MSG_REACTION) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Add_Account" } } }), this._map.set(G2.RM_C2C_MSG_REACTION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.RM_C2C_MSG_REACTION) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Del_Account" } } }), this._map.set(G2.GET_C2C_MSG_REACTIONS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_C2C_MSG_REACTIONS) }), body: { from: void 0, to: void 0, messageKeyList: void 0, count: void 0 } }), this._map.set(G2.GET_C2C_MSG_REACTION_USER_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_C2C_MSG_REACTION_USER_LIST) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, count: void 0 } }), this._map.set(G2.ADD_GRP_MSG_REACTION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.ADD_GRP_MSG_REACTION) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Add_Account" } } }), this._map.set(G2.RM_GRP_MSG_REACTION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.RM_GRP_MSG_REACTION) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Del_Account" } } }), this._map.set(G2.GET_GRP_MSG_REACTIONS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_GRP_MSG_REACTIONS) }), body: { groupID: void 0, topicID: void 0, messageSequenceList: void 0, count: void 0 }, keyMap: { res: { MsgSeq: "messageSequence" } } }), this._map.set(G2.GET_GRP_MSG_REACTION_USER_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_GRP_MSG_REACTION_USER_LIST) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, nextSeq: void 0, count: void 0 } }), this._map.set(G2.GET_C2C_PEER_READ_TIME, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.GET_C2C_PEER_READ_TIME) }), body: { userIDList: void 0 }, keyMap: { req: { userIDList: "To_Account" }, res: { ReadTime: "peerReadTimeList" } } }), this._map.set(G2.PAGING_GET_CONV_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.PAGING_GET_CONV_LIST) }), body: { fromAccount: void 0, timeStamp: void 0, startIndex: void 0, pinnedTimeStamp: void 0, pinnedStartIndex: void 0, orderType: void 0, messageAssistFlag: 15, assistFlag: 31 }, keyMap: { req: { messageAssistFlag: "MsgAssistFlags", assistFlag: "AssistFlags", pinnedTimeStamp: "TopTimeStamp", pinnedStartIndex: "TopStartIndex" }, res: { SessionItem: "conversations", ToAccount: "groupID", To_Account: "userID", UnreadMsgCount: "unreadCount", MsgGroupReadedSeq: "messageReadSeq", C2cPeerReadTime: "c2cPeerReadTime", LastMsgFlags: "lastMessageFlag", TopFlags: "isPinned", TopTimeStamp: "pinnedTimeStamp", TopStartIndex: "pinnedStartIndex", GroupId: "convGroupID", C2cRemark: "friendRemark", MsgRecvOption: "messageRemindType", GroupIgnoredUnreadSeqCount: "noUnreadCount", GroupNextMsgSeq: "nextMessageSeq" } } }), this._map.set(G2.DEL_CONV, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.DEL_CONV) }), body: { fromAccount: "", conversationList: void 0, clearHistoryMessage: void 0 }, keyMap: { req: { toGroupID: "ToGroupid", clearHistoryMessage: "ClearRamble", conversationList: "ContactItem" }, res: { ResultItem: "resultList", ToGroupid: "groupID", ResultCode: "code", ResultInfo: "info" } } }), this._map.set(G2.CLEAR_HISTORY_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.CLEAR_HISTORY_MSG) }), body: { fromAccount: "", toAccount: void 0, type: 1, toGroupID: void 0 }, keyMap: { req: { toGroupID: "ToGroupid" } } }), this._map.set(G2.PIN_CONV, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.PIN_CONV) }), body: { fromAccount: "", operationType: 1, itemList: void 0 }, keyMap: { req: { itemList: "RecentContactItem" } } }), this._map.set(G2.DEL_GROUP_AT_TIPS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.DEL_GROUP_AT_TIPS) }), body: { messageListToDelete: void 0 }, keyMap: { req: { messageListToDelete: "DelMsgList", messageSeq: "MsgSeq", messageRandom: "MsgRandom" } } }), this._map.set(G2.SET_CONV_CUSTOM_DATA, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.MARK_CONV) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "MarkItem", operationType: "OptType", groupID: "ToGroupId" }, res: { ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(G2.MARK_CONV, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.MARK_CONV) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "MarkItem", operationType: "OptType", groupID: "ToGroupId" }, res: { ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(G2.CREATE_CONV_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.CREATE_CONV_GRP) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "GroupContactItem", groupID: "ToGroupId" }, res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(G2.DEL_CONV_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.DEL_CONV_GRP) }), body: { fromAccount: "", groupName: void 0 }, keyMap: { res: { GroupId: "convGroupID" } } }), this._map.set(G2.RENAME_CONV_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: void 0 }, keyMap: { req: { oldName: "OldGroupName", newName: "NewGroupName", groupID: "ToGroupId", operationType: "ContactOptType", groupName: "OldGroupName", updateItem: "ContactUpdateItem" }, res: { ContactOptType: "operationType", ToGroupId: "groupID", GroupId: "convGroupID" } } }), this._map.set(G2.ADD_CONV_TO_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: { groupName: void 0, updateGroupType: void 0, updateItem: void 0 } } }), this._map.set(G2.DEL_CONV_FROM_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: void 0 } }), this._map.set(G2.GET_CONV_GRP_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.GET_CONV_GRP_LIST) }), body: { fromAccount: "", startIndex: void 0 }, keyMap: { res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType", CustomMark: "customData", ContactGroupId: "convGroupIDList" } } }), this._map.set(G2.SEARCH_CONV_GRP_MARK, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.RECENT_CONTACT, ".").concat(G2.SEARCH_CONV_GRP_MARK) }), body: { fromAccount: "", contactItem: void 0 }, keyMap: { req: { groupID: "ToGroupId" }, res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType", CustomMark: "customData", ContactGroupId: "convGroupIDList", ContactResultItem: "contactItem" } } }), this._map.set(G2.GET_USER_PROFILE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.PROFILE, ".").concat(G2.GET_USER_PROFILE) }), body: { fromAccount: "", userItem: [] }, keyMap: { req: { toAccount: "To_Account", standardSequence: "StandardSequence", customSequence: "CustomSequence" } } }), this._map.set(G2.UPDATE_MY_PROFILE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.PROFILE, ".").concat(G2.UPDATE_MY_PROFILE) }), body: { fromAccount: "", profileItem: [{ tag: f2.NICK, value: "" }, { tag: f2.GENDER, value: "" }, { tag: f2.ALLOWTYPE, value: "" }, { tag: f2.AVATAR, value: "" }] }, keyMap: { req: { toAccount: "To_Account", standardSequence: "StandardSequence", customSequence: "CustomSequence" } } }), this._map.set(G2.GET_BL, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.GET_BL) }), body: { fromAccount: "", startIndex: 0, maxLimited: 30 } }), this._map.set(G2.ADD_TO_BL, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.ADD_TO_BL) }), body: { fromAccount: "", toAccount: [] } }), this._map.set(G2.RM_FROM_BL, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.RM_FROM_BL) }), body: { fromAccount: "", toAccount: [] } }), this._map.set(G2.SET_SELF_STATUS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.SET_SELF_STATUS) }), body: { customStatus: "" } }), this._map.set(G2.GET_USER_STATUS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.GET_USER_STATUS) }), body: { userIDList: void 0 }, keyMap: { res: { UserStatusList: "successUserList", ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID", Status: "statusType" } } }), this._map.set(G2.SUB_USER_STATUS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.SUB_USER_STATUS) }), body: { userIDList: void 0 }, keyMap: { res: { ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID" } } }), this._map.set(G2.UNSUB_USER_STATUS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.UNSUB_USER_STATUS) }), body: { userIDList: void 0, unsubscribeAll: void 0 }, keyMap: { res: { ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID" } } }), this._map.set(G2.GET_FD_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.GET_FD_LIST) }), body: { fromAccount: "", startIndex: 0, standardSequence: 0, customSequence: 0 }, keyMap: { res: { FriendNum: "friendCount", UserDataItem: "resultList", ValueItem: "tagValueList" } } }), this._map.set(G2.ADD_FD, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.ADD_FD) }), body: { fromAccount: "", addFriendItem: [], type: "" }, keyMap: { req: { source: "AddSource", wording: "AddWording", type: "AddType" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.UPDATE_FD, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.UPDATE_FD) }), body: { fromAccount: "", updateItem: void 0 }, keyMap: { req: { snsItem: "SnsItem" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.DEL_FD, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.DEL_FD) }), body: { fromAccount: "", userIDList: [], type: "" }, keyMap: { req: { type: "DeleteType" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.GET_FD_PROFILE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.GET_FD_PROFILE) }), body: { fromAccount: "", userIDList: void 0 }, keyMap: { res: { InfoItem: "resultList", SnsProfileItem: "tagValueList" } } }), this._map.set(G2.CHECK_FD, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.CHECK_FD) }), body: { fromAccount: "", userIDList: [], type: "" }, keyMap: { req: { type: "CheckType" }, res: { InfoItem: "resultList" } } }), this._map.set(G2.GET_FD_APPLICATION_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.GET_FD_APPLICATION_LIST) }), body: { fromAccount: "", applicationType: "", startTime: 0, maxLimited: 0, lastSequence: 0 }, keyMap: { res: { PendencyItem: "resultList", AddSource: "source", AddTime: "time", AddWording: "wording", Image: "avatar", UnreadPendencyCount: "unreadCount", To_Account: "userID", PendencyType: "type" } } }), this._map.set(G2.RESPOND_FD_APPLICATION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.RESPOND_FD_APPLICATION) }), body: { fromAccount: "", responseFriendItem: [] }, keyMap: { req: { tag: "TagName", action: "ResponseAction" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.DEL_FD_APPLICATION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.DEL_FD_APPLICATION) }), body: { fromAccount: "", type: "", userIDList: void 0 }, keyMap: { req: { type: "PendencyType", userIDList: "To_Account" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.REPORT_FD_APPLICATION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.REPORT_FD_APPLICATION) }), body: { fromAccount: "", latestTimeStamp: "" }, keyMap: { req: { latestTimeStamp: "LatestPendencyTimeStamp" } } }), this._map.set(G2.CREATE_FD_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.CREATE_FD_GRP) }), body: { fromAccount: "", groupName: void 0, userIDList: void 0 }, keyMap: { req: { groupName: "GroupName", userIDList: "To_Account" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.DEL_FD_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.DEL_FD_GRP) }), body: { fromAccount: "", nameList: void 0 }, keyMap: { req: { nameList: "GroupName" } } }), this._map.set(G2.GET_FD_GRP_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.GET_FD_GRP_LIST) }), body: { fromAccount: "", lastSequence: 0, needFriend: "Need_Friend_Type_Yes" }, keyMap: { res: { ResultItem: "resultList", GroupName: "name", FriendNumber: "friendCount", To_Account: "userIDList" } } }), this._map.set(G2.UPDATE_FD_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FD, ".").concat(G2.UPDATE_FD_GRP) }), body: { fromAccount: "", oldName: "", newName: void 0, updateGroupItem: void 0 }, keyMap: { req: { oldName: "GroupOldName", newName: "GroupNewName" }, res: { UpdateType: "type", ResultItem: "resultList" } } }), this._map.set(G2.GET_GRP_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_LIST) }), body: { memberAccount: "", limit: void 0, offset: void 0, groupType: void 0, responseFilter: { groupBaseInfoFilter: void 0, selfInfoFilter: void 0 }, isSupportTopic: 0, needAppDefineData: 1 }, keyMap: { req: { memberAccount: "Member_Account" }, res: { GroupIdList: "groups", MsgSeq: "readedSequence", LastRecallTime: "_lastRevokedTime", AppDefinedData: "groupCustomField" } } }), this._map.set(G2.GET_GRP_PROFILE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_PROFILE) }), body: { groupIDList: void 0, responseFilter: { groupBaseInfoFilter: void 0, groupCustomFieldFilter: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 } }, keyMap: { req: { groupIDList: "GroupIdList", groupCustomField: "AppDefinedData", memberCustomField: "AppMemberDefinedData", groupCustomFieldFilter: "AppDefinedDataFilter_Group", memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { GroupIdList: "groups", AppDefinedData: "groupCustomField", AppMemberDefinedData: "memberCustomField", AppDefinedDataFilter_Group: "groupCustomFieldFilter", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", InfoSeq: "infoSequence", MemberList: "members", GroupInfo: "groups", ShutUpUntil: "muteUntil", ShutUpAllMember: "muteAllMembers" } } }), this._map.set(G2.CREATE_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.CREATE_GRP) }), body: { type: void 0, name: void 0, groupID: void 0, ownerID: void 0, introduction: void 0, notification: void 0, maxMemberNum: void 0, joinOption: void 0, memberList: void 0, groupCustomField: void 0, memberCustomField: void 0, webPushFlag: 1, avatar: "", isSupportTopic: void 0, inviteOption: void 0 }, keyMap: { req: { ownerID: "Owner_Account", userID: "Member_Account", avatar: "FaceUrl", maxMemberNum: "MaxMemberCount", joinOption: "ApplyJoinOption", groupCustomField: "AppDefinedData", memberCustomField: "AppMemberDefinedData", inviteOption: "InviteJoinOption" }, res: { HugeGroupFlag: "avChatRoomFlag", OverJoinedGroupLimit_Account: "overLimitUserIDList" } } }), this._map.set(G2.DISMISS_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.DISMISS_GRP) }), body: { groupID: void 0 } }), this._map.set(G2.UPDATE_GRP_PROFILE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.UPDATE_GRP_PROFILE) }), body: { groupID: void 0, name: void 0, introduction: void 0, notification: void 0, avatar: void 0, joinOption: void 0, groupCustomField: void 0, muteAllMembers: void 0, inviteOption: void 0 }, keyMap: { req: { groupCustomField: "AppDefinedData", muteAllMembers: "ShutUpAllMember", joinOption: "ApplyJoinOption", avatar: "FaceUrl", inviteOption: "InviteJoinOption" }, res: { AppDefinedData: "groupCustomField", ShutUpAllMember: "muteAllMembers" } } }), this._map.set(G2.APPLY_JOIN_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.APPLY_JOIN_GRP) }), body: { groupID: void 0, applyMessage: void 0, userDefinedField: void 0, webPushFlag: 1, historyMessageFlag: void 0 }, keyMap: { req: { applyMessage: "ApplyMsg", historyMessageFlag: "HugeGroupHistoryMsgFlag" }, res: { HugeGroupFlag: "avChatRoomFlag", AVChatRoomKey: "avChatRoomKey", RspMsgList: "messageList", ToGroupId: "to" } } }), this._map.set(G2.APPLY_JOIN_GRP_NOAUTH, (e3.a2, e3.tinyid, { head: y2(y2({}, W2(e3, hs)), {}, { servcmd: "".concat(s3.NAME.BIG_GRP_NO_AUTH, ".").concat(G2.APPLY_JOIN_GRP) }), body: { groupID: void 0, applyMessage: void 0, userDefinedField: void 0, webPushFlag: 1 }, keyMap: { req: { applyMessage: "ApplyMsg" }, res: { HugeGroupFlag: "avChatRoomFlag" } } })), this._map.set(G2.QUIT_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.QUIT_GRP) }), body: { groupID: void 0 } }), this._map.set(G2.SEARCH_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.SEARCH_GRP) }), body: { groupIDList: void 0, responseFilter: { groupBasePublicInfoFilter: ["Type", "Name", "Introduction", "Notification", "FaceUrl", "CreateTime", "Owner_Account", "LastInfoTime", "LastMsgTime", "NextMsgSeq", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "InviteJoinOption"] } } }), this._map.set(G2.CHANGE_GRP_OWNER, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.CHANGE_GRP_OWNER) }), body: { groupID: void 0, newOwnerID: void 0 }, keyMap: { req: { newOwnerID: "NewOwner_Account" } } }), this._map.set(G2.HANDLE_GRP_APPLICATION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.HANDLE_GRP_APPLICATION) }), body: { groupID: void 0, applicant: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, messageKey: void 0, userDefinedField: void 0 }, keyMap: { req: { applicant: "Applicant_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg", messageKey: "MsgKey" } } }), this._map.set(G2.HANDLE_INVITE_JOIN_GRP, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.HANDLE_INVITE_JOIN_GRP) }), body: { groupID: void 0, applicant: void 0, invitee: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, userDefinedField: void 0 }, keyMap: { req: { applicant: "Applicant_Account", invitee: "Invited_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg" } } }), this._map.set(G2.HANDLE_GRP_INVITATION, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.HANDLE_GRP_INVITATION) }), body: { groupID: void 0, inviter: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, messageKey: void 0, userDefinedField: void 0 }, keyMap: { req: { inviter: "Inviter_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg", messageKey: "MsgKey" } } }), this._map.set(G2.GET_GRP_PENDENCY, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_PENDENCY) }), body: { startTime: void 0, limit: void 0, handleAccount: void 0 }, keyMap: { req: { handleAccount: "Handle_Account" }, res: { To_Account: "userID", ApplyInviteMsg: "note" } } }), this._map.set(G2.DEL_GRP_SYSTEM_NOTICE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.DEL_GRP_SYSTEM_NOTICE) }), body: { messageListToDelete: void 0 }, keyMap: { req: { messageListToDelete: "DelMsgList", messageSeq: "MsgSeq", messageRandom: "MsgRandom" } } }), this._map.set(G2.AV_POLLING, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.BIG_GRP_POLLING, ".").concat(G2.AV_POLLING) }), body: { USP: 1, startSeq: 1, startBroadcastSeq: void 0, holdTime: 90, key: void 0, simplifiedMessage: void 0 }, keyMap: { req: { USP: "USP" }, res: { ToGroupId: "groupID", RspBroadcastMsgList: "broadcastMessageList", IsSystemMsg: "isSystemMessage" } } }), this._map.set(G2.AV_NOAUTH_POLLING, (e3.a2, e3.tinyid, { head: y2(y2({}, W2(e3, gs)), {}, { servcmd: "".concat(s3.NAME.BIG_GRP_POLLING_NO_AUTH, ".").concat(G2.AV_POLLING) }), body: { USP: 1, startSeq: 1, holdTime: 90, key: void 0, simplifiedMessage: void 0 }, keyMap: { req: { USP: "USP" }, res: { ToGroupId: "groupID", RspBroadcastMsgList: "broadcastMessageList", IsSystemMsg: "isSystemMessage" } } })), this._map.set(G2.GET_ONLINE_MBR_NUM, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_ONLINE_MBR_NUM) }), body: { groupID: void 0 }, keyMap: { res: { OnlineMemberNum: "memberCount" } } }), this._map.set(G2.SET_GRP_ATTR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.SET_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key", value: "value" } } }), this._map.set(G2.MODIFY_GRP_ATTR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.MODIFY_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key", value: "value" } } }), this._map.set(G2.DEL_GRP_ATTR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.DEL_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key" } } }), this._map.set(G2.CLEAR_GRP_ATTR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.CLEAR_GRP_ATTR) }), body: { groupID: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] } }), this._map.set(G2.GET_GRP_ATTR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_ATTR, ".").concat(G2.GET_GRP_ATTR) }), body: { groupID: void 0, avChatRoomKey: void 0, groupType: 1 }, keyMap: { req: { avChatRoomKey: "Key", groupType: "GroupType" } } }), this._map.set(G2.GET_GRP_NOTIFY, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_NOTIFY) }), body: { notifyReqList: [] }, keyMap: { req: { notifyReqList: "NotifyReqList" }, res: { NextMsgTime: "nextRevokedTime", NotifyMsgList: "notifyList", NotifyRspList: "notifyRspList" } } }), this._map.set(G2.UPDATE_GRP_COUNTER, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.UPDATE_GRP_COUNTER) }), body: { groupID: void 0, counterList: void 0, avChatRoomKey: void 0, mode: void 0 }, keyMap: { req: { counterList: "GroupCounter" } } }), this._map.set(G2.GET_GRP_COUNTER, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_COUNTER) }), body: { groupID: void 0, keyList: [], avChatRoomKey: void 0 }, keyMap: { req: { keyList: "GroupCounterKeys" } } }), this._map.set(G2.CREATE_TOPIC, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_COMMUNITY, ".").concat(G2.CREATE_TOPIC) }), body: { groupID: void 0, topicName: void 0, avatar: void 0, customData: void 0, topicID: void 0, notification: void 0, introduction: void 0 }, keyMap: { req: { avatar: "FaceUrl" } } }), this._map.set(G2.DEL_TOPIC, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_COMMUNITY, ".").concat(G2.DEL_TOPIC) }), body: { groupID: void 0, topicIDList: void 0 }, keyMap: { req: { topicIDList: "TopicIdList" }, res: { DestroyResultItem: "resultList" } } }), this._map.set(G2.UPDATE_TOPIC_PROFILE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_COMMUNITY, ".").concat(G2.UPDATE_TOPIC_PROFILE) }), body: { groupID: void 0, topicID: void 0, avatar: void 0, customData: void 0, notification: void 0, introduction: void 0, muteAllMembers: void 0, topicName: void 0 }, keyMap: { req: { avatar: "FaceUrl", muteAllMembers: "ShutUpAllMember" } } }), this._map.set(G2.GET_TOPIC_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_COMMUNITY, ".").concat(G2.GET_TOPIC_LIST) }), body: { groupID: void 0, topicIDList: void 0, MemberInfoFilter: ["NoUnreadSeqList"] }, keyMap: { req: { topicIDList: "TopicIdList" }, res: { TopicAndSelfInfo: "topicInfoList", TopicInfo: "topic", GroupID: "groupID", ShutUpTime: "muteTime", ShutUpAllFlag: "muteAllMembers", LastMsgTime: "lastMessageTime", MsgSeq: "readedSequence", LastMsgSeq: "sequence" } } }), this._map.set(G2.GET_GRP_MBR_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_MBR_LIST) }), body: { groupID: void 0, limit: 0, offset: void 0, next: void 0, memberRoleFilter: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 }, keyMap: { req: { memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { AppMemberDefinedData: "memberCustomField", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", MemberList: "members", ShutUpUntil: "muteUntil" } } }), this._map.set(G2.GET_AV_MBR_LIST, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_AV, ".").concat(G2.GET_AV_MBR_LIST) }), body: { groupID: void 0, offset: void 0, filter: void 0 }, keyMap: { req: { offset: "Timestamp", filter: "Mark" }, res: { NextTimestamp: "offset" } } }), this._map.set(G2.GET_GRP_MBR_PROFILE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.GET_GRP_MBR_PROFILE) }), body: { groupID: void 0, userIDList: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 }, keyMap: { req: { userIDList: "Member_List_Account", memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { MemberList: "members", ShutUpUntil: "muteUntil", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", AppMemberDefinedData: "memberCustomField" } } }), this._map.set(G2.ADD_GRP_MBR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.ADD_GRP_MBR) }), body: { groupID: void 0, silence: void 0, userIDList: void 0 }, keyMap: { req: { userID: "Member_Account", userIDList: "MemberList" }, res: { MemberList: "members" } } }), this._map.set(G2.DEL_GRP_MBR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.DEL_GRP_MBR) }), body: { groupID: void 0, userIDList: void 0, reason: void 0 }, keyMap: { req: { userIDList: "MemberToDel_Account" } } }), this._map.set(G2.BAN_AV_MBR, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.BAN_AV_MBR) }), body: { groupID: void 0, userIDList: void 0, duration: void 0, reason: "" }, keyMap: { req: { userIDList: "Members_Account", duration: "Duration", reason: "Description" } } }), this._map.set(G2.MODIFY_GRP_MBR_INFO, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP, ".").concat(G2.MODIFY_GRP_MBR_INFO) }), body: { groupID: void 0, topicID: void 0, userID: void 0, messageRemindType: void 0, nameCard: void 0, role: void 0, memberCustomField: void 0, muteTime: void 0 }, keyMap: { req: { userID: "Member_Account", memberCustomField: "AppMemberDefinedData", muteTime: "ShutUpTime", messageRemindType: "MsgFlag" } } }), this._map.set(G2.MARK_AV_MBR_INFO, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_AV, ".").concat(G2.MARK_AV_MBR_INFO) }), body: { groupID: void 0, operationType: 1, memberList: [] }, keyMap: { req: { operationType: "CommandType", memberList: "MemberList", markType: "Marks", userID: "Member_Account" }, res: { CommandType: "operationType", Marks: "markType", Member_Account: "userID" } } }), this._map.set(G2.CS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.MSG_SEARCH, ".").concat(G2.CS) }), body: { keywordList: void 0, keywordListMatchType: "or", account: void 0, groupID: void 0, count: 100, cursor: void 0, messageTypeList: void 0, senderUserIDList: void 0, startTime: void 0, endTime: void 0 }, keyMap: { req: { keywordListMatchType: "MatchType", account: "PeerAccount", groupID: "GroupID", messageTypeList: "MsgTypeList", senderUserIDList: "SendUserIDList", keywords: "Keywords", keywordMatchType: "KeywordMatchType", count: "Count", miniBirthday: "UserBirthStart", maxBirthday: "UserBirthEnd", gender: "UserGenderType", groupTypeList: "GroupType", groupIDList: "GroupIdList" }, res: { GroupID: "groupID", UserID: "userID", ErrorCode: "code", ErrorInfo: "message", TotalCount: "totalCount", Count: "messageCount", LastMsgTime: "lastMessageTime", ConversationMsgs: "searchResult", IsNeedReadReceipt: "needReadReceipt", IsPeerRead: "readReceiptSentByPeer", MsgSeq: "sequence", ReqMsgSeq: "sequence", IsSystemMsg: "isSystemMessage", ToGroupId: "to", EnumFrom_AccountType: "fromAccountType", EnumTo_AccountType: "toAccountType", GroupCode: "groupCode", MsgContent: "content", ClientSeq: "clientSequence", ToTopicId: "topicID", InvisibleMsgSeq: "invisibleSequenceList", Users: "userList", ProfileItems: "profileItems", StrValue: "value", IntValue: "value", Groups: "groupList", GroupFaceUrl: "avatar", GroupIntroduction: "introduction", GroupOwnerUserID: "ownerID", GroupOwnerUserName: "ownerNick", GroupOwnerTinyID: "ownerTinyID", GroupMemberNum: "memberNum", GroupName: "name", GroupType: "type", GroupMembers: "groupMemberList", GroupMemberUserID: "userID", GroupMemberTinyID: "userTinyID", GroupMemberUserName: "nick", GroupMemberNameCard: "nameCard" } } }), this._map.set(G2.USER_CS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.USER_SEARCH, ".").concat(G2.CS) }), body: { keywords: void 0, keywordMatchType: 0, miniBirthday: void 0, maxBirthday: void 0, gender: void 0, count: 20, cursor: void 0 } }), this._map.set(G2.GRP_CS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_SEARCH, ".").concat(G2.CS) }), body: { keywords: void 0, keywordMatchType: 0, groupType: void 0, count: 20, cursor: void 0 } }), this._map.set(G2.MBR_CS, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.GRP_MEMBER_SEARCH, ".").concat(G2.CS) }), body: { keywords: void 0, keywordMatchType: 0, groupType: void 0, groupIDList: void 0, count: 20, cursor: void 0 } }), this._map.set(G2.SSO_STAT, { head: y2(y2({}, n3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STAT, ".").concat(G2.SSO_STAT) }), body: { header: {}, event: [], quality: [] }, keyMap: { req: { SDKType: "sdk_type", SDKVersion: "sdk_version", deviceType: "device_type", platform: "platform", instanceID: "instance_id", traceID: "trace_id", SDKAppID: "sdk_app_id", userID: "user_id", tinyID: "tiny_id", extension: "extension", timestamp: "timestamp", networkType: "network_type", eventType: "event_type", code: "error_code", message: "error_message", moreMessage: "more_message", duplicate: "duplicate", costTime: "cost_time", level: "level", qualityType: "quality_type", reportIndex: "report_index", wholePeriod: "whole_period", totalCount: "total_count", rttCount: "success_count_business", successRateOfRequest: "percent_business", countLessThan1Second: "success_count_business", percentOfCountLessThan1Second: "percent_business", countLessThan3Second: "success_count_platform", percentOfCountLessThan3Second: "percent_platform", successCountOfBusiness: "success_count_business", successRateOfBusiness: "percent_business", successCountOfPlatform: "success_count_platform", successRateOfPlatform: "percent_platform", successCountOfMessageReceived: "success_count_business", successRateOfMessageReceived: "percent_business", avgRTT: "average_value", avgDelay: "average_value", avgValue: "average_value", uiPlatform: "ui_platform" } } }), this._map.set(G2.PING, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.HEARTBEAT, ".").concat(G2.PING) }), body: {} }), this._map.set(G2.MSG_PUSH, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_PUSH, ".").concat(G2.MSG_PUSH) }), body: {}, keyMap: { res: { C2cMsgArray: "C2CMessageArray", GroupMsgArray: "groupMessageArray", GroupTips: "groupTips", C2cNotifyMsgArray: "C2CNotifyMessageArray", C2cMsgInfo: "C2CReadReceiptArray", ClientSeq: "clientSequence", MsgPriority: "priority", NoticeSeq: "noticeSequence", MsgContent: "content", MsgType: "type", MsgBody: "elements", ToGroupId: "to", Desc: "description", Ext: "extension", IsSyncMsg: "isSyncMessage", Flag: "needSync", NeedAck: "needAck", PendencyAdd_Account: "userID", ProfileImNick: "nick", PendencyType: "applicationType", C2CReadAllMsg: "readAllC2CMessage", IsNeedReadReceipt: "needReadReceipt", Status: "statusType" } } }), this._map.set(G2.MULTI_MSG_PUSH, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_PUSH, ".").concat(G2.MULTI_MSG_PUSH) }), body: {}, keyMap: { res: { GroupMsgArray: "groupMessageArray", GroupTips: "groupTips", ClientSeq: "clientSequence", MsgPriority: "priority", NoticeSeq: "noticeSequence", MsgContent: "content", MsgType: "type", MsgBody: "elements", ToGroupId: "to", Desc: "description", Ext: "extension", IsSyncMsg: "isSyncMessage", Flag: "needSync", NeedAck: "needAck", PendencyType: "applicationType" } } }), this._map.set(G2.MSG_PUSH_ACK, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OPEN_IM, ".").concat(G2.MSG_PUSH_ACK) }), body: { sessionData: void 0 }, keyMap: { req: { sessionData: "SessionData" } } }), this._map.set(G2.STATUS_FORCE_OFFLINE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.STATUS_FORCE_OFFLINE) }), body: {}, keyMap: { res: { C2cNotifyMsgArray: "C2CNotifyMessageArray", NoticeSeq: "noticeSequence", KickoutMsgNotify: "kickoutMsgNotify", NewInstInfo: "newInstanceInfo" } } }), this._map.set(G2.DOWNLOAD_MERGER_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_LONG_MSG, ".").concat(G2.DOWNLOAD_MERGER_MSG) }), body: { downloadKey: "" }, keyMap: { res: { Data: "data", Desc: "description", Ext: "extension", Download_Flag: "downloadFlag", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID" } } }), this._map.set(G2.UPLOAD_MERGER_MSG, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_LONG_MSG, ".").concat(G2.UPLOAD_MERGER_MSG) }), body: { messageList: [] }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom", msgBody: "MsgBody", type: "MsgType", content: "MsgContent", data: "Data", description: "Desc", extension: "Ext", sizeType: "Type", uuid: "UUID", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", elements: "MsgBody", clientSequence: "ClientSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody" } } }), this._map.set(G2.FOLLOW, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FOLLOW, ".").concat(G2.FOLLOW) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "FollowItem" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(G2.UNFOLLOW, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FOLLOW, ".").concat(G2.UNFOLLOW) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(G2.GET_FOLLOW_INFO, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FOLLOW, ".").concat(G2.GET_FOLLOW_INFO) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { FollowInfo: "followInfoList", To_Account: "userID", FollowerCount: "followersCount", FollowingCount: "followingCount", MutualFollowingCount: "mutualFollowersCount" } } }), this._map.set(G2.GET_FOLLOW, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FOLLOW, ".").concat(G2.GET_FOLLOW) }), body: { fromAccount: "", type: 1, nextCursor: "", count: 500 }, keyMap: { req: { type: "FollowType", nextCursor: "StartCursor", count: "WantNum" }, res: { FollowItem: "resultList", To_Account: "userID", ProfileItem: "profileList" } } }), this._map.set(G2.CHECK_FOLLOW_TYPE, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.FOLLOW, ".").concat(G2.CHECK_FOLLOW_TYPE) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(G2.SET_TOKEN, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.SET_TOKEN) }), body: { tokenID: "", pushMsg: 0, sdkAppID: 0, businessID: "", deviceBrand: "", deviceToken: "", isTpns: 0, isWebUniapp: 0, notificationStatus: 0, deviceModel: "", systemVersion: "", pushVersion: "" }, keyMap: { req: { tokenID: "TokenID", pushMsg: "PushMsg", sdkAppID: "EnterVersion", businessID: "BusiID", deviceBrand: "InstType", deviceToken: "VarToken", isTpns: "IsTpns", notificationStatus: "NotificationStatus", deviceModel: "DeviceModel", systemVersion: "SystemVersion", pushVersion: "PushPluginVersion" } } }), this._map.set(G2.STAT_FOREGROUND, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.STAT_FOREGROUND) }), body: { isWebUniapp: 0 } }), this._map.set(G2.STAT_BACKGROUND, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_OPEN_STATUS, ".").concat(G2.STAT_BACKGROUND) }), body: { C2CUnread: 0, GroupUnread: 0, isWebUniapp: 0 }, keyMap: { req: { c2cUnreadCount: "C2cUnread", groupUnreadCount: "GrpUnread" } } }), this._map.set(G2.PUSH_REPORT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.OFFLINE_PUSH_REPORT, ".").concat(G2.PUSH_REPORT) }), body: { eventList: [] }, keyMap: { req: { eventList: "UinappPushEvents", type: "EventType", time: "EventTime", pushId: "ClickExt" } } }), this._map.set(G2.SET_ALL_RECEIVE_MSG_OPT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_MSG_LOGIC, ".").concat(G2.SET_ALL_RECEIVE_MSG_OPT) }), body: { startTime: 0, endTime: 0, isRepeated: 0, messageRemindType: 0 }, keyMap: { req: { messageRemindType: "Level" } } }), this._map.set(G2.GET_ALL_RECEIVE_MSG_OPT, { head: y2(y2({}, e3), {}, { servcmd: "".concat(s3.NAME.IM_MSG_LOGIC, ".").concat(G2.GET_ALL_RECEIVE_MSG_OPT) }), body: { toAccount: void 0 } });
    } }, { key: "has", value: function(e3) {
      return this._map.has(e3);
    } }, { key: "get", value: function(e3) {
      return this._map.get(e3);
    } }, { key: "update", value: function() {
      this._fillMap();
    } }, { key: "getKeyMap", value: function(e3) {
      return this.has(e3) ? this.get(e3).keyMap || {} : (M2.w("".concat(this._n, ".getKeyMap unknown P:").concat(e3)), {});
    } }, { key: "getProtocolData", value: function(e3) {
      var t3 = e3.P, n3 = e3.data, e3 = this.get(t3), t3 = null;
      if (n3) {
        var o3, i4 = this._simpleDeepCopy(e3), i4 = this._updateService(n3, i4), s4 = i4.body, a3 = /* @__PURE__ */ Object.create(null);
        for (o3 in s4)
          if (Object.prototype.hasOwnProperty.call(s4, o3)) {
            if (a3[o3] = s4[o3], void 0 === n3[o3])
              continue;
            a3[o3] = n3[o3];
          }
        i4.body = a3, t3 = this._getUplinkData(i4);
      } else
        t3 = this._getUplinkData(e3);
      return t3;
    } }, { key: "_getUplinkData", value: function(e3) {
      var e3 = this._dataCleaner(e3), t3 = Ht2(e3.head), t3 = ts2(e3.body, this._getReqKeyMap(t3));
      return e3.body = t3, e3;
    } }, { key: "_updateService", value: function(e3, t3) {
      var n3, o3, i4 = Ht2(t3.head);
      return this._isFromGroupRequest(t3) && (n3 = e3.type, o3 = e3.groupID, e3 = void 0 === (e3 = e3.groupIDList) ? [] : e3, N3(o3 = void 0 === o3 ? void 0 : o3) && (o3 = e3[0] || ""), Ot2({ type: n3, groupID: o3 })) && (t3.head.servcmd = "".concat(s3.NAME.GRP_COMMUNITY, ".").concat(i4)), t3;
    } }, { key: "_isFromGroupRequest", value: function(e3) {
      return e3.head.servcmd.includes(s3.NAME.GRP) || e3.head.servcmd.includes(s3.NAME.GRP_ATTR);
    } }, { key: "_getReqKeyMap", value: function(e3) {
      e3 = this.getKeyMap(e3);
      return y2(y2({}, Yi.req), e3.req);
    } }, { key: "_dataCleaner", value: function(e3) {
      var t3, n3 = Array.isArray(e3) ? [] : /* @__PURE__ */ Object.create(null);
      for (t3 in e3)
        Object.prototype.hasOwnProperty.call(e3, t3) && lt2(t3) && null !== e3[t3] && void 0 !== e3[t3] && ("object" !== z2(e3[t3]) ? n3[t3] = e3[t3] : n3[t3] = this._dataCleaner.bind(this)(e3[t3]));
      return n3;
    } }, { key: "_simpleDeepCopy", value: function(e3) {
      for (var t3, n3 = Object.keys(e3), o3 = {}, i4 = 0, s4 = n3.length; i4 < s4; i4++)
        t3 = n3[i4], O2(e3[t3]) ? o3[t3] = Array.from(e3[t3]) : at2(e3[t3]) ? o3[t3] = this._simpleDeepCopy(e3[t3]) : o3[t3] = e3[t3];
      return o3;
    } }]), ms = [G2.MSG_PUSH_ACK], vs = e2(function e3(t3) {
      p3(this, e3), this._sessionM = t3, this._n = "MsgDispatcher", this._eventHandlerMap = /* @__PURE__ */ new Map(), this._eventHandlerMap.set("C2CMessageArray", this._onC2CMsgArray.bind(this)), this._eventHandlerMap.set("groupMessageArray", this._onGroupMsgArray.bind(this)), this._eventHandlerMap.set("groupTips", this._onGroupTips.bind(this)), this._eventHandlerMap.set("C2CNotifyMessageArray", this._onC2CNotifyMsgArray.bind(this)), this._eventHandlerMap.set("C2CReadReceiptArray", this._onC2CReadReceiptArray.bind(this)), this._eventHandlerMap.set("profileModify", this._onProfileModified.bind(this)), this._eventHandlerMap.set("friendListMod", this._onRelationChainModified.bind(this)), this._eventHandlerMap.set("recentContactMod", this._onRecentContact.bind(this)), this._eventHandlerMap.set("readAllC2CMessage", this._onAllMsgRead.bind(this)), this._eventHandlerMap.set("c2cMessageModified", this._onC2CMsgModified.bind(this)), this._eventHandlerMap.set("groupMessageModified", this._onGroupMsgModified.bind(this)), this._eventHandlerMap.set("userStatusList", this._onUserStatusList.bind(this)), this._eventHandlerMap.set("messageExtensionNotify", this._onMsgExtNotify.bind(this)), this._eventHandlerMap.set("messageReactionNotifyList", this._onMsgReactionNotifyList.bind(this)), this._eventHandlerMap.set("messageReactionNotify", this._onMsgReactionNotify.bind(this)), this._eventHandlerMap.set("followChangeList", this._onFollowNotify.bind(this)), this._keys = d2(this._eventHandlerMap.keys());
    }, [{ key: "_onC2CMsgArray", value: function(e3) {
      var t3 = this._sessionM.get(6);
      e3.dataList.forEach(function(e4) {
        var t4;
        1 === e4.isSyncMessage && (t4 = e4.from, e4.from = e4.to, e4.to = t4);
      }), 1 === e3.needSync && this._sessionM.get(19).syncOnNeed(), t3.onNewMessage({ dataList: e3.dataList, isInstantMessage: true });
    } }, { key: "_onC2CMsgModified", value: function(e3) {
      this._sessionM.get(6).onMsgModified(e3);
    } }, { key: "_onGroupMsgArray", value: function(e3) {
      var t3 = this._sessionM.get(7);
      t3 && t3.onNewMessage({ event: e3.event, dataList: e3.dataList, isInstantMessage: true });
    } }, { key: "_onGroupMsgModified", value: function(e3) {
      var t3 = this._sessionM.get(7);
      t3 && t3.onMsgModified(e3);
    } }, { key: "_onGroupTips", value: function(e3) {
      var t3 = this._sessionM.get(7);
      if (t3) {
        var n3 = e3.event, o3 = e3.dataList, i4 = e3.isInstantMessage, s4 = void 0 === i4 || i4, a3 = e3.isSyncingEnded;
        switch (n3) {
          case 4:
          case 6:
            t3.onNewGroupTips({ event: n3, dataList: o3 });
            break;
          case 5:
            for (var r4 = 0; r4 < o3.length; r4++)
              if (O2(o3[r4].elements.revokedInfos))
                t3.onMsgRevoked({ dataList: o3 });
              else if (O2(o3[r4].elements.groupMessageReadNotice))
                t3.onMsgReadNotice({ dataList: o3 });
              else {
                if (!O2(o3[r4].elements.readReceiptList)) {
                  t3.onNewGroupSystemNotice({ dataList: o3, isInstantMessage: s4, isSyncingEnded: a3 });
                  break;
                }
                t3.onReadReceiptList({ dataList: o3 });
              }
            break;
          case 12:
            this._sessionM.get(11).onNewGroupAtTips({ dataList: o3 });
            break;
          default:
            M2.l("".concat(this._n, "._onGroupTips unknown event:").concat(n3, " dataList:"), o3);
        }
      }
    } }, { key: "_onC2CNotifyMsgArray", value: function(e3) {
      var o3, i4 = this, s4 = e3.dataList;
      O2(s4) && (o3 = this._sessionM.get(6), s4.forEach(function(e4) {
        var t3, n3;
        m2(e4) && (e4.hasOwnProperty("kickoutMsgNotify") ? (t3 = (n3 = e4.kickoutMsgNotify).kickType, n3 = void 0 === (n3 = n3.newInstanceInfo) ? {} : n3, 1 === t3 ? i4._sessionM.onMultipleAccountKickedOut(n3) : 2 === t3 ? i4._sessionM.onMultipleDeviceKickedOut(n3) : 3 === t3 && i4._sessionM.onRestApiKickedOut(n3)) : e4.hasOwnProperty("c2cMessageRevokedNotify") ? o3 && o3.onMsgRevoked({ dataList: s4 }, true) : e4.hasOwnProperty("c2cMessageReadReceipt") ? o3 && o3.onMsgReadReceipt({ dataList: s4 }) : e4.hasOwnProperty("c2cMessageReadNotice") ? o3 && o3.onMsgReadNotice({ dataList: s4 }) : e4.hasOwnProperty("muteNotificationsSync") && i4._sessionM.get(11).onC2CMsgRemindTypeSynced({ dataList: s4 }));
      }));
    } }, { key: "_onC2CReadReceiptArray", value: function(e3) {
      this._sessionM.get(6).onReadReceiptList(e3);
    } }, { key: "_onProfileModified", value: function(e3) {
      this._sessionM.get(4).onProfileModified({ dataList: e3.dataList });
      var t3 = this._sessionM.get(8);
      t3 && t3.onFriendProfileModified({ dataList: e3.dataList });
    } }, { key: "_onRelationChainModified", value: function(e3) {
      this._sessionM.get(4).onRelationChainModified({ dataList: e3.dataList });
      var t3 = this._sessionM.get(8);
      t3 && t3.onRelationChainModified({ dataList: e3.dataList });
    } }, { key: "_onRecentContact", value: function(e3) {
      var i4, e3 = e3.dataList;
      O2(e3) && (i4 = this._sessionM.get(11)) && e3.forEach(function(e4) {
        var t3, n3, o3 = e4.pushType;
        1 === o3 ? (t3 = e4.recentContactDeleteItem, i4.onConvDeleted(t3.recentContactList)) : 2 === o3 ? (t3 = e4.recentContactTopItem, i4.onConvPinnedStatus(t3.recentContactList, true)) : 3 === o3 ? (t3 = e4.recentContactTopItem, i4.onConvPinnedStatus(t3.recentContactList, false)) : 4 === o3 ? (t3 = e4.recentContactMarkContact, i4.onConvMarkUpdated(t3.recentContactMarkContactItem)) : 5 === o3 ? (t3 = e4.recentContactCreateContactGroup, i4.onConvGroupCreated(t3.msgContactGroupContactItem)) : 6 === o3 ? (t3 = e4.recentContactDelContactGroup, i4.onConvGroupDeleted(t3.msgGroupItem)) : 7 === o3 && (o3 = (t3 = e4.recentContactUpdateContactGroup).updateType, e4 = t3.msgUpdateGroup, t3 = t3.msgUpdateContact, 1 === o3 ? 1 === (n3 = e4.updateGroupType) ? i4.onConvGroupNameUpdated(e4) : 2 === n3 && i4.onConvInGroupUpdated(e4) : 2 === o3 && i4.onConvAddedToOrDeletedFromGroup(t3));
      });
    } }, { key: "_onAllMsgRead", value: function(e3) {
      var e3 = e3.dataList, t3 = this._sessionM.get(11);
      t3 && t3.onPushedAllMessageRead(e3);
    } }, { key: "_onUserStatusList", value: function(e3) {
      this._sessionM.get(4).onUserStatusUpdated(e3);
    } }, { key: "_onMsgExtNotify", value: function(e3) {
      this._sessionM.get(3).onMsgExtNotify(e3);
    } }, { key: "_onMsgReactionNotifyList", value: function(e3) {
      this._sessionM.get(34).onReactionNotifyList(e3);
    } }, { key: "_onMsgReactionNotify", value: function(e3) {
      this._sessionM.get(34).onReactionNotify(e3);
    } }, { key: "_onFollowNotify", value: function(e3) {
      this._sessionM.get(35).onFollowNotify(e3);
    } }, { key: "_onTopicLatestMsg", value: function(e3) {
      this._sessionM.get(10).onTopicLatestMsg(e3);
    } }, { key: "onMessage", value: function(e3) {
      var t3 = this, n3 = e3.body;
      if (this._filterMsgFromIMOpenPush(e3)) {
        var o3, i4 = n3.eventArray, s4 = n3.isInstantMessage, a3 = n3.isSyncingEnded, r4 = n3.needSync;
        if (O2(i4))
          for (var c3, u3, l3, d3 = 0, p4 = i4.length; d3 < p4; d3++)
            100 !== (l3 = (c3 = i4[d3]).event) ? 24 !== l3 ? 26 !== l3 ? (o3 = Object.keys(c3).find(function(e4) {
              return -1 !== t3._keys.indexOf(e4);
            })) ? (u3 = 14 === l3 ? { readAllC2CMessage: c3[o3], groupMessageReadInfoList: c3.groupMessageReadNotice || [] } : 16 === l3 ? { userID: c3.userID, timestamp: c3.timestamp, readReceiptList: c3[o3] } : c3[o3], this._eventHandlerMap.get(o3)({ event: l3, dataList: u3, isInstantMessage: s4, isSyncingEnded: a3, needSync: r4 })) : M2.l("".concat(this._n, ".onMessage unknown eventItem:"), c3) : this._onTopicLatestMsg(c3) : this._onAllRcvMsgOptNotify(c3) : this._onRoomCustomData(c3.content);
      }
    } }, { key: "_onRoomCustomData", value: function(e3) {
      this._sessionM.get(30).onRoomCustomDataReceived(e3), M2.l("".concat(this._n, "._onRoomCustomData data:").concat(e3));
    } }, { key: "_onAllRcvMsgOptNotify", value: function(e3) {
      this._sessionM.get(11).onAllRcvMsgOptNotify(e3);
    } }, { key: "_filterMsgFromIMOpenPush", value: function(e3) {
      var t3 = e3.head, e3 = e3.body, t3 = t3.servcmd, n3 = false;
      return !(n3 = N3(t3) ? n3 : t3.includes(s3.NAME.IM_CONFIG_MANAGER) || t3.includes(s3.NAME.OVERLOAD_PUSH) || t3.includes(s3.NAME.STAT_SERVICE)) || (t3.includes(G2.PUSHED_CLOUD_CTRL_CONFIG) ? this._sessionM.get(23).onPushedConfig(e3) : t3.includes(G2.PUSHED_COMMERCIAL_CONFIG) ? this._sessionM.get(27).onPushedConfig(e3) : t3.includes(G2.OVERLOAD_NOTIFY) ? this._sessionM.onPushedServerOverload(e3) : t3.includes(G2.KICK_OTHER) && (n3 = Date.now(), this._sessionM.reLoginOnKickOther(), e3 = new P2("kickOther"), n3 = n3 - (t3 = this._sessionM.get(1).getLastWsHelloTs()), e3.setMessage("last wshello time:".concat(t3, " diff:").concat(n3, "ms")).end()), false);
    } }]), Is = [{ cmd: G2.GET_GRP_PROFILE, interval: 1, count: 8 }, { cmd: G2.UPDATE_GRP_PROFILE, interval: 1, count: 8 }, { cmd: G2.GET_AV_MBR_LIST, interval: 3, count: 1 }, { cmd: G2.GET_GRP_PENDENCY, interval: 1, count: 15 }, { cmd: G2.GET_TOPIC_LIST, interval: 1, count: 10 }, { cmd: G2.SET_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.MODIFY_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.DEL_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.CLEAR_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.GET_GRP_ATTR, interval: 5, count: 20 }, { cmd: G2.UPDATE_GRP_COUNTER, interval: 5, count: 20 }, { cmd: G2.GET_GRP_COUNTER, interval: 5, count: 20 }, { cmd: G2.SET_ALL_MSG_READ, interval: 1, count: 1 }, { cmd: G2.GET_USER_STATUS, interval: 5, count: 20 }, { cmd: G2.SUB_USER_STATUS, interval: 5, count: 20 }, { cmd: G2.UNSUB_USER_STATUS, interval: 5, count: 20 }, { cmd: G2.CS, interval: 5, count: 20 }, { cmd: G2.GRP_CS, interval: 5, count: 20 }, { cmd: G2.MBR_CS, interval: 5, count: 20 }, { cmd: G2.USER_CS, interval: 5, count: 20 }, { cmd: G2.CHECK_FOLLOW_TYPE, interval: 5, count: 20 }, { cmd: G2.GET_GRP_ROAMING_MSG, interval: 1, count: 20 }, { cmd: G2.GET_C2C_ROAMING_MSG, interval: 1, count: 20 }], Ms = /* @__PURE__ */ new Map(), ys = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"], Cs = 0, Ts = ys.length; Cs < Ts; Cs++)
      Ms.set(Cs, ys[Cs]);
    function Ds(e3) {
      return p3(this, Ds), (e3 = i3(this, Ds, [e3]))._n = "ChannelModule", e3._socketHandler = new ds(e3), e3._probing = false, e3._isAppShowing = true, e3._previousState = R2.NET_STATE_CONNECTED, e3._timerForNotLoggedIn = -1, e3._timerForNotLoggedIn = setInterval(e3.onCheckTimer.bind(e3), 1e3), e3._fatalErrorFlag = false, e3._disconnectedTS = 0, e3._lastDiagnoseTS = 0, e3;
    }
    function Es(e3) {
      for (var t3, n3, o3 = e3, i4 = "", s4 = 0, a3 = (o3 = e3.length % 8 != 0 ? "0".repeat(8 - e3.length % 8) + e3 : o3).length; s4 < a3; s4 += 8)
        t3 = parseInt(o3.slice(s4, s4 + 4), 2), n3 = parseInt(o3.slice(s4 + 4, s4 + 8), 2), i4 += Ms.get(t3) + Ms.get(n3);
      return i4;
    }
    function Ls(e3) {
      var t3;
      return e3 < 0 || 53 < e3 ? NaN : (t3 = 0 | 1073741824 * Math.random(), 30 < e3 ? t3 + 1073741824 * (0 | Math.random() * (1 << e3 - 30)) : t3 >>> 30 - e3);
    }
    function Ss(e3, t3) {
      for (var n3 = e3.toString(16), o3 = t3 - n3.length, i4 = "0"; 0 < o3; o3 >>>= 1, i4 += i4)
        1 & o3 && (n3 = i4 + n3);
      return n3;
    }
    t2(va, c2);
    var ks2 = e2(va, [{ key: "_init", value: function() {
      this._updateCmdFreqLimitMap(Is);
    } }, { key: "_onCloudConfig", value: function() {
      var e3 = this.getCloudConfig("cmd_frequency_limit");
      N3(e3) || (e3 = JSON.parse(e3), this._updateCmdFreqLimitMap(e3));
    } }, { key: "_updateCmdFreqLimitMap", value: function(e3) {
      var t3 = this;
      e3.forEach(function(e4) {
        t3._cmdFreqLimitMap.set(e4.cmd, { interval: e4.interval, count: e4.count });
      });
    } }, { key: "updateProtocolConfig", value: function() {
      this._pHandler.update();
    } }, { key: "req", value: function(e3) {
      M2.d("".concat(this._n, ".req options:"), e3);
      var t3, n3, o3 = e3.P;
      return this._pHandler.has(o3) ? (t3 = (e3 = this.getProtocolData(e3)).head.servcmd, this._isFreqOverLimit(t3) ? E2({ code: n3 = k2.OVER_FREQUENCY_LIMIT, message: this.getErrMsg(n3, this._getCmd(t3)) }) : this._isServerOverload(t3) ? E2({ code: n3 = k2.OPEN_SERVICE_OVERLOAD_ERROR, message: this.getErrMsg(n3, this._getCmd(t3)) }) : (n3 = this.get(21), ms.includes(o3) ? n3.simplySend(e3) : n3.send(e3))) : (M2.w("".concat(this._n, ".req unknown P:").concat(o3)), E2({ code: k2.NO_PROTOCOL }));
    } }, { key: "getKeyMap", value: function(e3) {
      return this._pHandler.getKeyMap(e3);
    } }, { key: "genCommonHead", value: function() {
      var e3 = this.get(12);
      return { ver: "v4", platform: this._platform, websdkappid: oe2, websdkversion: ne2, a2: e3.getA2Key() || void 0, tinyid: e3.getTinyID() || void 0, status_instid: e3.getStatusInstanceID(), sdkappid: e3.getSDKAppID(), contenttype: e3.getContentType(), reqtime: 0, identifier: e3.getA2Key() ? void 0 : e3.getUserID(), usersig: e3.getA2Key() ? void 0 : e3.getUserSig(), sdkability: 75689843, sdkability_ext: Es(""), cappid: e3.getApplicationID(), cs: 0 };
    } }, { key: "genCosSpecifiedHead", value: function() {
      var e3 = this.get(12);
      return { ver: "v4", platform: this._platform, websdkappid: oe2, websdkversion: ne2, sdkappid: e3.getSDKAppID(), contenttype: e3.getContentType(), reqtime: 0, identifier: e3.getUserID(), usersig: e3.getUserSig(), status_instid: e3.getStatusInstanceID(), sdkability: 75689843, sdkability_ext: Es(""), cappid: e3.getApplicationID(), cs: 0 };
    } }, { key: "genSSOReportHead", value: function() {
      var e3 = this.get(12);
      return { ver: "v4", platform: this._platform, websdkappid: oe2, websdkversion: ne2, sdkappid: e3.getSDKAppID(), contenttype: "", reqtime: 0, identifier: "", usersig: "", status_instid: e3.getStatusInstanceID(), sdkability: 75689843, sdkability_ext: Es(""), cappid: e3.getApplicationID(), cs: 0 };
    } }, { key: "getProtocolData", value: function(e3) {
      return this._pHandler.getProtocolData(e3);
    } }, { key: "trans", value: function(e3) {
      var t3 = e3.servcmd, e3 = e3.data, t3 = { head: y2(y2({}, this.genCommonHead()), {}, { servcmd: t3 }), body: e3 };
      return this.get(21).send(t3);
    } }, { key: "sendComboMessage", value: function(e3) {
      var t3 = e3.servcmd, e3 = e3.data, t3 = { head: y2(y2({}, this.genCommonHead()), {}, { servcmd: t3 }), body: e3 };
      return this.get(21).send(t3);
    } }, { key: "onErrorCodeNotZero", value: function(e3) {
      var t3, n3 = e3.errorCode;
      n3 === k2.HELLO_ANSWER_KICKED_OUT && (t3 = e3.kickType, e3 = void 0 === (e3 = e3.newInstanceInfo) ? {} : e3, 1 === t3 ? this.onMultipleAccountKickedOut(e3) : 2 === t3 ? this.onMultipleDeviceKickedOut(e3) : 3 === t3 && this.onRestApiKickedOut(e3)), n3 !== k2.MSG_A2KEY_EXPIRED && n3 !== k2.ACCOUNT_A2KEY_EXPIRED || (this._onUserSigExpired(), this.get(21).reConnect());
    } }, { key: "onMessage", value: function(e3) {
      var t3 = e3.body, n3 = t3.needAck, t3 = t3.sessionData;
      1 === (void 0 === n3 ? 0 : n3) && this._sendACK(t3), this._msgDispatcher.onMessage(e3);
    } }, { key: "onReconnected", value: function(e3) {
      this._incrementalPullContactFlag = e3 <= 300, this._reLoginOnReconnected();
    } }, { key: "reLoginOnKickOther", value: function() {
      M2.l("".concat(this._n, ".reLoginOnKickOther")), this._reLogin();
    } }, { key: "_reLoginOnReconnected", value: function() {
      M2.l("".concat(this._n, "._reLoginOnReconnected")), this._reLogin();
    } }, { key: "_reLogin", value: function() {
      var e3, t3, a3, r4 = this, c3 = "".concat(this._n, "._reLogin");
      this.isLoggedIn() && (e3 = 0, (t3 = this.get(1).getPushModule()) && (e3 = t3.getUniAppPlatform()), a3 = new P2("reLogin"), this.req({ P: G2.LOGIN, data: { isWebUniapp: e3, customInfo: this.get(12).getCustomLoginInfo() } }).then(function(e4) {
        var e4 = e4.data, t4 = e4.instanceID, e4 = e4.customStatus, n3 = r4.get(12), o3 = Go(e4), i4 = (n3.setStatusInstanceID(t4), r4.get(21)), s4 = i4.getSocketID(), s4 = "socketID:".concat(s4, " instanceID:").concat(t4, " customStatus:").concat(o3), t4 = (a3.setMessage(s4).end(true), M2.l("".concat(c3, " ok. ").concat(s4)), n3.getCustomStatus() !== o3 && r4.get(4).onUserStatusUpdated({ dataList: [{ to: r4.getMyUserID(), statusType: R2.USER_STATUS_ONLINE, customStatus: e4 }] }), i4.diagnose(), r4.get(11).syncConvList(r4._incrementalPullContactFlag).then(function() {
          M2.l("".concat(c3, ", sync conv list ok.")), r4.get(25).start();
        }), r4.get(7)), s4 = (t4 && t4.updateLocalMainSequenceOnReconnected(), r4.get(10)), n3 = (s4.resetGetTopicTime(), s4.getTopicListOnReconnected(), r4.get(35));
        n3 && n3.clearCacheOnReconnected();
      }));
    } }, { key: "onMultipleAccountKickedOut", value: function(e3) {
      this.get(1).onMultipleAccountKickedOut(e3);
    } }, { key: "onMultipleDeviceKickedOut", value: function(e3) {
      this.get(1).onMultipleDeviceKickedOut(e3);
    } }, { key: "_onUserSigExpired", value: function() {
      this.get(1).onUserSigExpired();
    } }, { key: "onRestApiKickedOut", value: function(e3) {
      this.get(1).onRestApiKickedOut(e3);
    } }, { key: "_sendACK", value: function(e3) {
      this.req({ P: G2.MSG_PUSH_ACK, data: { sessionData: e3 } });
    } }, { key: "_isFreqOverLimit", value: function(e3) {
      var t3, n3, o3, i4, e3 = e3.split(".")[1];
      return !!this._cmdFreqLimitMap.has(e3) && (!this._cmdReqInfoMap.has(e3) || (t3 = (n3 = this._cmdFreqLimitMap.get(e3)).count, n3 = n3.interval, o3 = (i4 = this._cmdReqInfoMap.get(e3)).startTime, i4 = i4.requestCount, Date.now() - o3 > 1e3 * n3) ? (this._cmdReqInfoMap.set(e3, { startTime: Date.now(), requestCount: 1 }), false) : (this._cmdReqInfoMap.set(e3, { startTime: o3, requestCount: i4 += 1 }), t3 < i4));
    } }, { key: "_isServerOverload", value: function(e3) {
      var t3, n3;
      return !!this._serverOverloadInfoMap.has(e3) && (t3 = (n3 = this._serverOverloadInfoMap.get(e3)).overloadTime, n3 = n3.waitingTime, Date.now() - t3 <= 1e3 * n3 || (this._serverOverloadInfoMap.delete(e3), false));
    } }, { key: "_getCmd", value: function(e3) {
      var t3 = "";
      if (e3.includes(".")) {
        var n3, o3 = e3.split(".")[1];
        for (n3 in G2)
          if (G2[n3] === o3) {
            t3 = n3;
            break;
          }
      }
      return t3;
    } }, { key: "onPushedServerOverload", value: function(e3) {
      var t3 = e3.overloadCommand, e3 = e3.waitingTime;
      this._serverOverloadInfoMap.set(t3, { overloadTime: Date.now(), waitingTime: e3 }), M2.w("".concat(this._n, ".onPushedServerOverload waitingTime:").concat(e3, "s cmd:").concat(this._getCmd(t3)));
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._updateCmdFreqLimitMap(Is), this._cmdReqInfoMap.clear(), this._serverOverloadInfoMap.clear(), this._incrementalPullContactFlag = true;
    } }]), Rs = (t2(ma, c2), e2(ma, [{ key: "getCloudConfig", value: function(e3) {
      return N3(e3) ? this._cloudConfig : this._cloudConfig.has(e3) ? this._cloudConfig.get(e3) : void 0;
    } }, { key: "getServerConfig", value: function(e3) {
      var t3 = { code: 0, data: "" };
      return !N3(e3) && this._cloudConfig.has(e3) && (t3.data = this._cloudConfig.get(e3)), Promise.resolve(t3);
    } }, { key: "_canFetch", value: function() {
      return this.isLoggedIn() && !this._isFetching && Date.now() >= this._expiredTime;
    } }, { key: "fetchConfig", value: function() {
      var o3, i4 = this, s4 = "".concat(this._n, ".fetchConfig"), e3 = this._canFetch();
      M2.l("".concat(s4, " canFetch:").concat(e3)), e3 && (o3 = new P2("fetchCloudCtrlConfig"), e3 = this.get(12).getSDKAppID(), this._isFetching = true, this.req({ P: G2.FETCH_CLOUD_CTRL_CONFIG, data: { SDKAppID: e3, version: this._version } }).then(function(e4) {
        i4._isFetching = false;
        var t3 = e4.data, n3 = t3.version, t3 = t3.cloudControlConfig;
        o3.setMessage("version:".concat(i4._version, " newVersion:").concat(n3, " config:").concat(t3)).end(), M2.l("".concat(s4, " ok")), i4._parse(e4.data);
      }).catch(function(e4) {
        i4._isFetching = false, o3.setError(e4).end(), M2.l("".concat(s4, " failed. error:"), e4), i4._setExpiredTime(12e4);
      }));
    } }, { key: "onPushedConfig", value: function(e3) {
      M2.l("".concat(this._n, ".onPushedConfig config:"), e3), new P2("pushedCloudCtrlConfig").setMessage("newVersion:".concat(e3.version, " config:").concat(e3.cloudControlConfig)).end(), this._parse(e3);
    } }, { key: "onCheckTimer", value: function(e3) {
      this._canFetch() && this.fetchConfig();
    } }, { key: "_parse", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, "._parse"), o3 = e3.errorCode, i4 = e3.errorMessage, s4 = e3.cloudControlConfig, a3 = e3.version, r4 = e3.expiredTime;
      if (0 === o3) {
        if (this._version !== a3) {
          var c3 = null;
          try {
            c3 = JSON.parse(s4);
          } catch (e4) {
            this.isPrivateNetWork() || M2.e("".concat(n3, " failed. config:"), s4);
          }
          c3 && (this._cloudConfig.clear(), Object.keys(c3).forEach(function(e4) {
            t3._cloudConfig.set(e4, c3[e4]);
          }), this._version = a3, this.emitIEvt(U2.CLOUD_CONFIG));
        }
        this._setExpiredTime(1e3 * r4);
      } else
        N3(o3) ? (M2.l("".concat(n3, " failed. Invalid message format:"), e3), this._setExpiredTime(36e5)) : (M2.e("".concat(n3, " errorCode:").concat(o3, " errorMessage:").concat(i4)), this._setExpiredTime(12e4));
    } }, { key: "_setExpiredTime", value: function(e3) {
      this._expiredTime = Date.now() + e3;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._cloudConfig.clear(), this._expiredTime = 0, this._version = 0, this._isFetching = false;
    } }])), As = (t2(fa, c2), e2(fa, [{ key: "start", value: function() {
      this._recoverGroupChat(), this._recoverC2CChat();
    } }, { key: "_recoverGroupChat", value: function() {
      var n3, o3, i4, s4, a3 = this, e3 = this._getLocalConvList().filter(function(e4) {
        return e4.type === R2.CONV_GROUP && e4.groupProfile.type !== R2.GRP_AVCHATROOM;
      }), r4 = this.get(11), c3 = [];
      e3.forEach(function(e4) {
        var t3 = e4.conversationID, e4 = e4.lastMessage;
        n3 = t3.replace(R2.CONV_GROUP, ""), o3 = r4.getLocalLastMessage(t3), e4 && 0 !== e4.lastSequence && o3 && (i4 = e4.lastSequence, o3 = o3.sequence, s4 = i4 - o3, 0 < o3) && 1 <= s4 && s4 < 300 ? a3._recoverGroupMsg({ groupID: n3, localLastMessageSequence: o3, remoteLastMessageSequence: i4 }) : c3.push(n3);
      }), this._getGroupNotice(c3);
    } }, { key: "_recoverC2CChat", value: function() {
      var n3, o3, i4, s4 = this, e3 = this._getLocalConvList().filter(function(e4) {
        return e4.type === R2.CONV_C2C;
      }), a3 = this.get(11), r4 = [Promise.resolve()], c3 = [];
      e3.forEach(function(e4) {
        var t3 = e4.conversationID, e4 = e4.lastMessage;
        n3 = a3.getLocalLastMessage(t3), e4 && 0 !== e4.lastTime && n3 && (o3 = e4.lastTime, n3 = n3.time, i4 = o3 - n3, 0 < n3) && 1 <= i4 && i4 <= 600 && (r4.push(s4._recoverC2CMsg({ conversationID: t3, localLastMessageTime: n3, remoteLastMessageTime: o3 })), c3.push(t3));
      }), Promise.all(r4).then(function() {
        M2.l("".concat(s4._n, "._recoverC2CChat all done, convIDList:"), c3), s4.get(19).syncOnReconnected();
      });
    } }, { key: "_getLocalConvList", value: function() {
      return this.get(11).getLocalConvList();
    } }, { key: "_recoverGroupMsg", value: function(e3) {
      var d3 = this, p4 = "".concat(this._n, ".").concat("_recoverGroupMsg"), _3 = (M2.l("".concat(p4, " options:"), e3), e3.groupID), h3 = e3.localLastMessageSequence, g3 = e3.remoteLastMessageSequence, f3 = JSON.stringify(e3), m3 = new P2("_recoverGroupMsg");
      m3.setMessage(f3), this._getGroupRoamingMsg({ groupID: _3, sequence: h3 }).then(function(e4) {
        var e4 = e4.data, t3 = e4.complete, n3 = e4.messageList;
        if (!N3(n3)) {
          var e4 = n3[0].sequence, o3 = n3.map(function(e5) {
            return e5.sequence;
          }), o3 = "".concat(f3, " complete:").concat(t3, " sequenceList:").concat(o3), i4 = (M2.l("".concat(p4, " ").concat(o3)), e4 !== h3 && e4 < g3 && 2 !== t3 && d3._recoverGroupMsg({ groupID: _3, localLastMessageSequence: e4, remoteLastMessageSequence: g3 }), m3.setMessage(o3).end(), d3.get(7));
          1 < n3.length && n3.sort(function(e5, t4) {
            return e5.sequence - t4.sequence;
          });
          for (var s4 = false, a3 = 0, r4 = n3.length; a3 < r4; a3++)
            if (n3[a3].from === R2.CONV_SYSTEM) {
              s4 = true;
              break;
            }
          if (s4)
            for (var c3 = 0, u3 = n3.length; c3 < u3; c3++) {
              var l3 = n3[c3];
              l3.from !== R2.CONV_SYSTEM ? i4.onNewMessage({ dataList: [l3], isInstantMessage: false, updateUnreadCount: false }) : i4.onNewGroupTips({ event: l3.event, dataList: [l3] });
            }
          else
            i4.onNewMessage({ dataList: n3, isInstantMessage: false, updateUnreadCount: false });
        }
      }).catch(function(e4) {
        m3.setError(e4).end(), M2.w("".concat(p4, " failed. error:"), e4);
      });
    } }, { key: "_getGroupNotice", value: function(e3) {
      var t3 = e3.length;
      if (M2.l("".concat(this._n, "._getGroupNotice length:").concat(t3)), 0 !== t3) {
        var n3 = this.get(7);
        if (t3 <= 10)
          n3.getNotice(e3);
        else {
          var o3 = Math.floor(t3 / 10);
          5 <= o3 && (o3 = 5);
          for (var i4 = 0; i4 <= o3; i4++)
            n3.getNotice(e3.slice(10 * i4, 10 * (i4 + 1)));
        }
      }
    } }, { key: "_getGroupRoamingMsg", value: function(e3) {
      var t3 = e3.groupID, e3 = e3.sequence;
      return this.req({ P: G2.GET_GRP_ROAMING_MSG, data: { groupID: t3, count: this.PULL_LIMIT_COUNT, sequence: e3 + this.PULL_LIMIT_COUNT - 1 } });
    } }, { key: "_recoverC2CMsg", value: function(e3) {
      var o3 = this, i4 = "".concat(this._n, ".").concat("_recoverC2CMsg"), s4 = (M2.l("".concat(i4, " options:"), e3), e3.conversationID), t3 = e3.localLastMessageTime, a3 = e3.remoteLastMessageTime, r4 = JSON.stringify(e3), c3 = new P2("_recoverC2CMsg");
      return c3.setMessage(r4), this._getC2CRoamingMsg({ conversationID: s4, time: t3 }).then(function(e4) {
        var e4 = e4.data, t4 = e4.complete, e4 = e4.messageList;
        if (!N3(e4)) {
          var n3 = e4.length, n3 = (o3.get(6).onNewMessage({ dataList: e4, isInstantMessage: true }), e4[n3 - 1].time), e4 = e4.map(function(e5) {
            return e5.random;
          }), e4 = "".concat(r4, " complete:").concat(t4, " randomList:").concat(e4);
          if (M2.l("".concat(i4, " ").concat(e4)), c3.setMessage(e4).end(), n3 < a3 && 1 !== t4)
            return o3._recoverC2CMsg({ conversationID: s4, localLastMessageTime: n3, remoteLastMessageTime: a3 });
        }
      }).catch(function(e4) {
        c3.setError(e4).end(), M2.w("".concat(i4, " failed. error:"), e4);
      });
    } }, { key: "_getC2CRoamingMsg", value: function(e3) {
      var t3 = e3.conversationID, e3 = e3.time;
      return this.req({ P: G2.GET_C2C_ROAMING_MSG, data: { peerAccount: t3.replace(R2.CONV_C2C, ""), count: this.PULL_LIMIT_COUNT + 1, lastMessageTime: e3, direction: 1 } });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }])), Os = e2(function e3() {
      p3(this, e3), this._n = "AvgE2EDelay", this._e2eDelayArray = [];
    }, [{ key: "addMessageDelay", value: function(e3) {
      e3 = xe2() - e3;
      0 <= e3 && this._e2eDelayArray.push(e3);
    } }, { key: "_calcAvg", value: function(e3, t3) {
      var n3;
      return 0 === t3 ? 0 : (n3 = 0, e3.forEach(function(e4) {
        n3 += e4;
      }), Kt2(n3 / t3, 1));
    } }, { key: "_calcCountWithLimit", value: function(e3) {
      var t3 = e3.e2eDelayArray, n3 = e3.min, o3 = e3.max;
      return t3.filter(function(e4) {
        return n3 <= e4 && e4 < o3;
      }).length;
    } }, { key: "_calcPercent", value: function(e3, t3) {
      e3 = Kt2(e3 / t3 * 100, 2);
      return e3 = 100 < e3 ? 100 : e3;
    } }, { key: "_checkE2EDelayException", value: function(e3, t3) {
      var n3, o3, i4, s4 = e3.filter(function(e4) {
        return t3 < e4;
      });
      0 < s4.length && (n3 = s4.length, o3 = Math.min.apply(Math, d2(s4)), i4 = Math.max.apply(Math, d2(s4)), s4 = this._calcAvg(s4, n3), 50 < (e3 = Kt2(n3 / e3.length * 100, 2))) && new P2("messageE2EDelayException").setMessage("count:".concat(n3, " min:").concat(o3, " max:").concat(i4, " avg:").concat(s4, " percent:").concat(e3)).setLevel("warning").end();
    } }, { key: "getStatResult", value: function() {
      var e3, t3, n3, o3, i4, s4, a3 = this._e2eDelayArray.length;
      return 0 === a3 ? null : (e3 = d2(this._e2eDelayArray), t3 = this._calcCountWithLimit({ e2eDelayArray: e3, min: 0, max: 1 }), n3 = this._calcCountWithLimit({ e2eDelayArray: e3, min: 1, max: 3 }), o3 = this._calcPercent(t3, a3), i4 = this._calcPercent(n3, a3), s4 = this._calcAvg(e3, a3), this._checkE2EDelayException(e3, 3), e3.length = 0, this.reset(), { totalCount: a3, countLessThan1Second: t3, percentOfCountLessThan1Second: o3, countLessThan3Second: n3, percentOfCountLessThan3Second: i4, avgDelay: s4 });
    } }, { key: "reset", value: function() {
      this._e2eDelayArray.length = 0;
    } }]), Ns = e2(function e3() {
      p3(this, e3), this._n = "AvgRTT", this._requestCount = 0, this._rttArray = [];
    }, [{ key: "addRequestCount", value: function() {
      this._requestCount += 1;
    } }, { key: "addRTT", value: function(e3) {
      this._rttArray.push(e3);
    } }, { key: "_calcTotalCount", value: function() {
      return this._requestCount;
    } }, { key: "_calcRTTCount", value: function(e3) {
      return e3.length;
    } }, { key: "_calcSuccessRateOfRequest", value: function(e3, t3) {
      return 0 === t3 ? 0 : 100 < (e3 = Kt2(e3 / t3 * 100, 2)) ? 100 : e3;
    } }, { key: "_calcAvg", value: function(e3, t3) {
      var n3;
      return 0 === t3 ? 0 : (n3 = 0, e3.forEach(function(e4) {
        n3 += e4;
      }), parseInt(n3 / t3));
    } }, { key: "_calcMax", value: function() {
      return Math.max.apply(Math, d2(this._rttArray));
    } }, { key: "_calcMin", value: function() {
      return Math.min.apply(Math, d2(this._rttArray));
    } }, { key: "getStatResult", value: function() {
      var e3, t3, n3 = this._calcTotalCount(), o3 = d2(this._rttArray);
      return 0 === n3 ? null : (e3 = this._calcRTTCount(o3), t3 = this._calcSuccessRateOfRequest(e3, n3), o3 = this._calcAvg(o3, e3), M2.l("".concat(this._n, ".getStatResult max:").concat(this._calcMax(), " min:").concat(this._calcMin(), " avg:").concat(o3)), this.reset(), { totalCount: n3, rttCount: e3, successRateOfRequest: t3, avgRTT: o3 });
    } }, { key: "reset", value: function() {
      this._requestCount = 0, this._rttArray.length = 0;
    } }]), Gs = e2(function e3() {
      p3(this, e3), this._map = /* @__PURE__ */ new Map();
    }, [{ key: "initMap", value: function(e3) {
      var t3 = this;
      e3.forEach(function(e4) {
        t3._map.set(e4, { totalCount: 0, successCount: 0, failedCountOfUserSide: 0, costArray: [], fileSizeArray: [] });
      });
    } }, { key: "addTotalCount", value: function(e3) {
      return !(N3(e3) || !this._map.has(e3) || (this._map.get(e3).totalCount += 1, 0));
    } }, { key: "addSuccessCount", value: function(e3) {
      return !(N3(e3) || !this._map.has(e3) || (this._map.get(e3).successCount += 1, 0));
    } }, { key: "addFailedCountOfUserSide", value: function(e3) {
      return !(N3(e3) || !this._map.has(e3) || (this._map.get(e3).failedCountOfUserSide += 1, 0));
    } }, { key: "addCost", value: function(e3, t3) {
      return !(N3(e3) || !this._map.has(e3) || (this._map.get(e3).costArray.push(t3), 0));
    } }, { key: "addFileSize", value: function(e3, t3) {
      return !(N3(e3) || !this._map.has(e3) || (this._map.get(e3).fileSizeArray.push(t3), 0));
    } }, { key: "_calcSuccessRateOfBusiness", value: function(e3) {
      return N3(e3) || !this._map.has(e3) ? -1 : 100 < (e3 = Kt2((e3 = this._map.get(e3)).successCount / e3.totalCount * 100, 2)) ? 100 : e3;
    } }, { key: "_calcSuccessRateOfPlatform", value: function(e3) {
      var t3;
      return N3(e3) || !this._map.has(e3) ? -1 : (t3 = this._map.get(e3), 100 < (e3 = Kt2(e3 = this._calcSuccessCountOfPlatform(e3) / t3.totalCount * 100, 2)) ? 100 : e3);
    } }, { key: "_calcTotalCount", value: function(e3) {
      return N3(e3) || !this._map.has(e3) ? -1 : this._map.get(e3).totalCount;
    } }, { key: "_calcSuccessCountOfBusiness", value: function(e3) {
      return N3(e3) || !this._map.has(e3) ? -1 : this._map.get(e3).successCount;
    } }, { key: "_calcSuccessCountOfPlatform", value: function(e3) {
      return N3(e3) || !this._map.has(e3) ? -1 : (e3 = this._map.get(e3)).successCount + e3.failedCountOfUserSide;
    } }, { key: "_calcAvg", value: function(e3) {
      return N3(e3) || !this._map.has(e3) ? -1 : e3 === Jn ? this._calcAvgSpeed(e3) : this._calcAvgCost(e3);
    } }, { key: "_calcAvgCost", value: function(e3) {
      var t3, n3 = this._map.get(e3).costArray.length;
      return 0 === n3 ? 0 : (t3 = 0, this._map.get(e3).costArray.forEach(function(e4) {
        t3 += e4;
      }), parseInt(t3 / n3));
    } }, { key: "_calcAvgSpeed", value: function(e3) {
      var t3 = 0, n3 = 0;
      return this._map.get(e3).costArray.forEach(function(e4) {
        t3 += e4;
      }), this._map.get(e3).fileSizeArray.forEach(function(e4) {
        n3 += e4;
      }), parseInt(1e3 * n3 / t3);
    } }, { key: "getStatResult", value: function(e3) {
      var t3, n3, o3, i4, s4, a3 = this._calcTotalCount(e3);
      return 0 === a3 ? null : (t3 = this._calcSuccessCountOfBusiness(e3), n3 = this._calcSuccessRateOfBusiness(e3), o3 = this._calcSuccessCountOfPlatform(e3), i4 = this._calcSuccessRateOfPlatform(e3), s4 = this._calcAvg(e3), this.reset(e3), { totalCount: a3, successCountOfBusiness: t3, successRateOfBusiness: n3, successCountOfPlatform: o3, successRateOfPlatform: i4, avgValue: s4 });
    } }, { key: "reset", value: function(e3) {
      N3(e3) ? this._map.clear() : this._map.set(e3, { totalCount: 0, successCount: 0, failedCountOfUserSide: 0, costArray: [], fileSizeArray: [] });
    } }]), Ps = e2(function e3() {
      p3(this, e3), this._lastMap = /* @__PURE__ */ new Map(), this._currentMap = /* @__PURE__ */ new Map();
    }, [{ key: "initMap", value: function(e3) {
      var t3 = this;
      e3.forEach(function(e4) {
        t3._lastMap.set(e4, /* @__PURE__ */ new Map()), t3._currentMap.set(e4, /* @__PURE__ */ new Map());
      });
    } }, { key: "addMessageSequence", value: function(e3) {
      var t3, n3, o3, i4 = e3.key, s4 = e3.message;
      return !(N3(i4) || !this._lastMap.has(i4) || !this._currentMap.has(i4) || (t3 = s4.conversationID, s4 = s4.sequence, t3 = t3.replace(R2.CONV_GROUP, ""), 0 !== this._lastMap.get(i4).size && this._lastMap.get(i4).has(t3) && (o3 = (n3 = this._lastMap.get(i4).get(t3)).length - 1, s4 > n3[0]) && s4 < n3[o3] ? (n3.push(s4), n3.sort(), this._lastMap.get(i4).set(t3, n3)) : this._addCurrentMap(e3), 0));
    } }, { key: "_addCurrentMap", value: function(e3) {
      var t3 = e3.key, e3 = e3.message, n3 = e3.conversationID, e3 = e3.sequence, n3 = n3.replace(R2.CONV_GROUP, "");
      this._currentMap.get(t3).has(n3) || this._currentMap.get(t3).set(n3, []), this._currentMap.get(t3).get(n3).push(e3);
    } }, { key: "_copyData", value: function(e3) {
      if (!N3(e3)) {
        this._lastMap.set(e3, /* @__PURE__ */ new Map());
        var t3, n3 = this._lastMap.get(e3), o3 = F2(this._currentMap.get(e3));
        try {
          for (o3.s(); !(t3 = o3.n()).done; ) {
            var i4 = j2(t3.value, 2), s4 = i4[0], a3 = i4[1];
            n3.set(s4, a3);
          }
        } catch (e4) {
          o3.e(e4);
        } finally {
          o3.f();
        }
        n3 = null, this._currentMap.set(e3, /* @__PURE__ */ new Map());
      }
    } }, { key: "getStatResult", value: function(e3) {
      var o3, i4, t3;
      return N3(this._currentMap.get(e3)) || N3(this._lastMap.get(e3)) ? null : 0 === this._lastMap.get(e3).size ? (this._copyData(e3), null) : (i4 = o3 = 0, this._lastMap.get(e3).forEach(function(e4, t4) {
        var e4 = d2(e4.values()), n3 = e4.length, e4 = e4[n3 - 1] - e4[0] + 1;
        o3 += e4, i4 += n3;
      }), 0 === o3 ? null : (100 < (t3 = Kt2(i4 / o3 * 100, 2)) && (t3 = 100), this._copyData(e3), { totalCount: o3, successCountOfMessageReceived: i4, successRateOfMessageReceived: t3 }));
    } }, { key: "reset", value: function() {
      this._currentMap.clear(), this._lastMap.clear();
    } }]), Us = (t2(ga, c2), e2(ga, [{ key: "_onLoginSuccess", value: function() {
      var t3 = this, e3 = (this._rateMessageSent.initMap(this._messageSentItems), this._rateMessageReceived.initMap(this._messageReceivedItems), this.get(13)), n3 = e3.getItem(this.TAG, false);
      !S2(n3) && ct2(n3.forEach) && (M2.l("".concat(this._n, "._onLoginSuccess. logs count:").concat(n3.length)), n3.forEach(function(e4) {
        t3._statInfoArr.push(e4);
      }), e3.removeItem(this.TAG, false));
    } }, { key: "_onCloudConfig", value: function() {
      var e3 = this.getCloudConfig("q_rpt_interval"), t3 = this.getCloudConfig("q_rpt_sdkappid_bl"), n3 = this.getCloudConfig("q_rpt_tinyid_wl");
      N3(e3) || (this.REPORT_INTERVAL = Number(e3)), N3(t3) || (this.REPORT_SDKAPPID_BLACKLIST = t3.split(",").map(function(e4) {
        return Number(e4);
      })), N3(n3) || (this.REPORT_TINYID_WHITELIST = n3.split(","));
    } }, { key: "onCheckTimer", value: function(e3) {
      this.isLoggedIn() && e3 % this.REPORT_INTERVAL == 0 && (this.wholePeriod = true, this._report());
    } }, { key: "addRequestCount", value: function() {
      this._avgRTT.addRequestCount();
    } }, { key: "addRTT", value: function(e3) {
      this._avgRTT.addRTT(e3);
    } }, { key: "addMessageDelay", value: function(e3) {
      this._avgE2EDelay.addMessageDelay(e3);
    } }, { key: "addTotalCount", value: function(e3) {
      this._rateMessageSent.addTotalCount(e3) || M2.w("".concat(this._n, ".addTotalCount invalid key:"), e3);
    } }, { key: "addSuccessCount", value: function(e3) {
      this._rateMessageSent.addSuccessCount(e3) || M2.w("".concat(this._n, ".addSuccessCount invalid key:"), e3);
    } }, { key: "addFailedCountOfUserSide", value: function(e3) {
      this._rateMessageSent.addFailedCountOfUserSide(e3) || M2.w("".concat(this._n, ".addFailedCountOfUserSide invalid key:"), e3);
    } }, { key: "addCost", value: function(e3, t3) {
      this._rateMessageSent.addCost(e3, t3) || M2.w("".concat(this._n, ".addCost invalid key or cost:"), e3, t3);
    } }, { key: "addFileSize", value: function(e3, t3) {
      this._rateMessageSent.addFileSize(e3, t3) || M2.w("".concat(this._n, ".addFileSize invalid key or size:"), e3, t3);
    } }, { key: "addMessageSequence", value: function(e3) {
      this._rateMessageReceived.addMessageSequence(e3) || M2.w("".concat(this._n, ".addMessageSequence invalid key:"), e3.key);
    } }, { key: "_getQualityItem", value: function(e3) {
      var t3 = {}, n3 = eo[this.get(15).getNetworkType()], n3 = (N3(n3) && (n3 = 8), { qualityType: Qn[e3], timestamp: He2(), networkType: n3, extension: "" });
      switch (e3) {
        case Bn:
          t3 = this._avgRTT.getStatResult();
          break;
        case Hn:
          t3 = this._avgE2EDelay.getStatResult();
          break;
        case Kn:
        case Wn:
        case Yn:
        case jn:
        case Jn:
          t3 = this._rateMessageSent.getStatResult(e3);
          break;
        case zn:
        case Xn:
        case Zn:
          t3 = this._rateMessageReceived.getStatResult(e3);
      }
      return null === t3 ? null : y2(y2({}, n3), t3);
    } }, { key: "_report", value: function(e3) {
      var t3 = this, n3 = [], o3 = null, e3 = (N3(e3) ? this._qualityItems.forEach(function(e4) {
        null !== (o3 = t3._getQualityItem(e4)) && (o3.reportIndex = t3.reportIndex, o3.wholePeriod = t3.wholePeriod, n3.push(o3));
      }) : null !== (o3 = this._getQualityItem(e3)) && (o3.reportIndex = this.reportIndex, o3.wholePeriod = this.wholePeriod, n3.push(o3)), M2.d("".concat(this._n, "._report"), n3), 0 < this._statInfoArr.length && (n3 = n3.concat(this._statInfoArr), this._statInfoArr = []), this.get(12)), i4 = e3.getSDKAppID(), e3 = e3.getTinyID();
      0 < (n3 = Wt2(this.REPORT_SDKAPPID_BLACKLIST, i4) && !Yt2(this.REPORT_TINYID_WHITELIST, e3) ? [] : n3).length && this._doReport(n3);
    } }, { key: "_doReport", value: function(t3) {
      var n3 = this, e3 = { header: yi(this), quality: t3 };
      this.req({ P: G2.SSO_STAT, data: y2({}, e3) }).then(function() {
        n3.reportIndex++, n3.wholePeriod = false;
      }).catch(function(e4) {
        M2.w("".concat(n3._n, "._doReport failed. error:"), e4), n3._statInfoArr = n3._statInfoArr.concat(t3), n3._flushAtOnce();
      });
    } }, { key: "_flushAtOnce", value: function() {
      var e3 = this.get(13), t3 = e3.getItem(this.TAG, false), n3 = this._statInfoArr, o3 = "".concat(this._n, "._flushAtOnce");
      S2(t3) ? (M2.l("".concat(o3, " count:").concat(n3.length)), e3.setItem(this.TAG, n3, true, false)) : (10 < (n3 = n3.concat(t3)).length && (n3 = n3.slice(0, 10)), M2.l("".concat(o3, " count:").concat(n3.length)), e3.setItem(this.TAG, n3, true, false)), this._statInfoArr = [];
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._report(), this.reportIndex = 0, this.wholePeriod = false, this.REPORT_SDKAPPID_BLACKLIST = [], this.REPORT_TINYID_WHITELIST = [], this._avgRTT.reset(), this._avgE2EDelay.reset(), this._rateMessageSent.reset(), this._rateMessageReceived.reset();
    } }])), bs = e2(function e3(t3) {
      p3(this, e3), S2(t3) || (this.userID = t3.userID || "", this.nick = t3.nick || "", this.avatar = t3.avatar || "", this.time = t3.time || 0, this.source = t3.source || "", this.wording = t3.wording || "", this.type = t3.type || "");
    }), ws = e2(function e3(t3) {
      p3(this, e3), this._snsM = t3, this._n = "FriendApplicationHandler", this._startTime = 0, this._maxLimited = 100, this._currentSeq = 0, this._map = /* @__PURE__ */ new Map(), this._unreadCount = 0;
    }, [{ key: "getLocalApplicationList", value: function() {
      return { friendApplicationList: d2(this._map.values()), unreadCount: this._unreadCount };
    } }, { key: "_onApplicationListUpdated", value: function() {
      this._snsM.emitOEvt(h2.FRIEND_APPLICATION_LIST_UPDATED, { friendApplicationList: d2(this._map.values()), unreadCount: this._unreadCount });
    } }, { key: "onApplicationRead", value: function() {
      this._unreadCount = 0, this._onApplicationListUpdated();
    } }, { key: "onApplicationAdded", value: function(e3, t3) {
      var n3, o3, i4 = this;
      S2(e3) || (n3 = "", n3 = t3 === this._snsM.getMyUserID() ? R2.SNS_APPLICATION_SENT_BY_ME : R2.SNS_APPLICATION_SENT_TO_ME, o3 = false, e3.forEach(function(e4) {
        var t4 = "".concat(e4.userID, "_").concat(n3);
        n3 !== R2.SNS_APPLICATION_SENT_TO_ME || i4._map.has(t4) || (i4._unreadCount += 1), i4._map.set(t4, new bs(y2(y2({}, e4), {}, { type: n3 }))), o3 = true;
      }), o3 && this._onApplicationListUpdated());
    } }, { key: "onApplicationDeleted", value: function(e3) {
      S2(e3) || (this._startTime = 0, this._currentSeq = 0, this.getApplicationList());
    } }, { key: "getApplicationList", value: function() {
      var s4 = this, a3 = "".concat(this._n, ".").concat("getApplicationList"), r4 = new P2("getApplicationList");
      return this._snsM.req({ P: G2.GET_FD_APPLICATION_LIST, data: { applicationType: R2.SNS_APPLICATION_TYPE_BOTH, fromAccount: this._snsM.getMyUserID(), maxLimited: this._maxLimited, startTime: this._startTime, lastSequence: this._currentSeq } }).then(function(e3) {
        var e3 = e3.data, t3 = e3.resultList, n3 = e3.unreadCount, o3 = e3.startTime, e3 = e3.currentSequence, i4 = (s4._startTime = o3, s4._currentSeq = e3, s4._unreadCount = n3, O2(t3) ? t3.length : 0), i4 = "applicationCount:".concat(i4, " unreadCount:").concat(n3, " startTime:").concat(o3, " currentSequence:").concat(e3);
        r4.setMessage(i4).end(), M2.i("".concat(a3, " ok. ").concat(i4)), s4._map.clear(), O2(t3) && t3.forEach(function(e4) {
          var t4 = e4.userID, n4 = e4.type, e4 = new bs(e4);
          s4._map.set("".concat(t4, "_").concat(n4), e4);
        }), s4._onApplicationListUpdated();
      }).catch(function(e3) {
        return r4.setError(e3).end(), M2.w("".concat(a3, " failed. error:"), e3), E2(e3);
      });
    } }, { key: "deleteApplication", value: function(e3) {
      var i4, s4 = "".concat(this._n, ".").concat("deleteApplication"), a3 = e3.userID, r4 = e3.type;
      return r4 && (r4 === R2.SNS_APPLICATION_SENT_BY_ME || r4 === R2.SNS_APPLICATION_SENT_TO_ME) || (r4 = R2.SNS_APPLICATION_SENT_TO_ME), this._map.has("".concat(a3, "_").concat(r4)) ? ((i4 = new P2("deleteApplication")).setMessage("userID:".concat(a3, " type:").concat(r4)), this._snsM.req({ P: G2.DEL_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), userIDList: [a3], type: r4 } }).then(function(e4) {
        var e4 = e4.data.resultList, t3 = e4[0], n3 = t3.to, o3 = t3.resultCode, t3 = t3.resultInfo;
        return i4.setMoreMessage("resultList:".concat(JSON.stringify(e4))).end(), M2.i("".concat(s4, " ok. userID:").concat(a3, " type:").concat(r4)), 0 === o3 ? T2() : E2({ userID: n3, code: o3, message: t3 });
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.w("".concat(s4, " failed. error:"), e4), E2(e4);
      })) : E2({ code: k2.FRIEND_APPLICATION_NOT_EXIST });
    } }, { key: "acceptApplication", value: function(e3) {
      var n3 = "".concat(this._n, ".").concat("acceptApplication"), o3 = e3.userID, t3 = e3.remark, i4 = e3.tag, s4 = e3.type, a3 = (s4 && (s4 === R2.SNS_APPLICATION_AGREE || s4 === R2.SNS_APPLICATION_AGREE_AND_ADD) || (s4 = R2.SNS_APPLICATION_AGREE_AND_ADD), new P2("acceptApplication"));
      return a3.setMessage("userID:".concat(o3, " type:").concat(s4)), this._snsM.req({ P: G2.RESPOND_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), responseFriendItem: [{ userID: o3, remark: t3, tag: i4, action: s4 }] } }).then(function(e4) {
        a3.end();
        var e4 = e4.data.resultList[0], t4 = e4.resultCode, e4 = e4.resultInfo;
        if (0 !== t4)
          return E2({ code: t4, message: e4 });
        M2.i("".concat(n3, " ok. userID:").concat(o3, " type:").concat(s4));
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.w("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "refuseApplication", value: function(e3) {
      var n3 = "".concat(this._n, ".").concat("refuseApplication"), o3 = e3.userID, i4 = new P2("refuseApplication");
      return i4.setMessage("userID:".concat(o3)), this._snsM.req({ P: G2.RESPOND_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), responseFriendItem: [{ userID: o3, action: "Response_Action_Reject" }] } }).then(function(e4) {
        i4.end();
        var e4 = e4.data.resultList[0], t3 = e4.resultCode, e4 = e4.resultInfo;
        if (0 !== t3)
          return E2({ code: t3, message: e4 });
        M2.i("".concat(n3, " ok. userID:").concat(o3));
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.w("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "setApplicationRead", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("setApplicationRead"), o3 = new P2("setApplicationRead");
      return this._snsM.req({ P: G2.REPORT_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), latestTimeStamp: Kt2(He2() / 1e3, 0) } }).then(function(e3) {
        o3.end(), M2.i("".concat(n3, " ok")), t3._unreadCount = 0;
      }).catch(function(e3) {
        return o3.setError(e3).end(), M2.w("".concat(n3, " failed. error:"), e3), E2(e3);
      });
    } }, { key: "reset", value: function() {
      this._maxLimited = 100, this._currentSeq = 0, this._unreadCount = 0, this._map.clear();
    } }]), Fs = e2(function e3(t3, n3) {
      p3(this, e3), this.userID = t3, this.remark = "", this.groupList = [], this.source = "", this.addTime = 0, this.friendCustomField = [], this.timestamp = 0;
      var o3 = {}, i4 = [];
      if (o3.userID = t3, !S2(n3))
        for (var s4, a3 = "", r4 = 0, c3 = n3.length; r4 < c3; r4++)
          if (a3 = n3[r4].tag, s4 = n3[r4].value, -1 < a3.indexOf("Tag_SNS_Custom"))
            this.friendCustomField.push({ key: a3, value: s4 });
          else if (-1 < a3.indexOf("Tag_Profile_Custom"))
            i4.push({ key: a3, value: s4 });
          else
            switch (a3) {
              case f2.NICK:
                o3.nick = s4;
                break;
              case f2.GENDER:
                o3.gender = s4;
                break;
              case f2.BIRTHDAY:
                o3.birthday = s4;
                break;
              case f2.LOCATION:
                o3.location = s4;
                break;
              case f2.SELFSIGNATURE:
                o3.selfSignature = s4;
                break;
              case f2.ALLOWTYPE:
                o3.allowType = s4;
                break;
              case f2.LANGUAGE:
                o3.language = s4;
                break;
              case f2.AVATAR:
                o3.avatar = s4;
                break;
              case f2.MESSAGESETTINGS:
                o3.messageSettings = s4;
                break;
              case f2.ADMINFORBIDTYPE:
                o3.adminForbidType = s4;
                break;
              case f2.LEVEL:
                o3.level = s4;
                break;
              case f2.ROLE:
                o3.role = s4;
                break;
              case Je2.REMARK:
                this.remark = s4;
                break;
              case Je2.ADDTIME:
                this.addTime = s4;
                break;
              case Je2.GROUP:
                this.groupList = JSON.parse(JSON.stringify(s4));
                break;
              case Je2.ADDSOURCE:
                this.source = s4;
                break;
              case Je2.ADDWORDING:
                break;
              default:
                M2.l("snsProfileItem unknown tag->", n3[r4].tag);
            }
      this.profile = new bo(y2(y2({}, o3), {}, { profileCustomField: i4 }));
    }, [{ key: "validate", value: function(e3) {
      var t3, n3 = true, o3 = "";
      if (S2(e3))
        return { valid: false, tips: "empty options" };
      if (e3.profileCustomField)
        for (var i4 = e3.profileCustomField.length, s4 = null, a3 = 0; a3 < i4; a3++) {
          if (s4 = e3.profileCustomField[a3], !C2(s4.key) || -1 === s4.key.indexOf("Tag_Profile_Custom"))
            return { valid: false, tips: "The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom" };
          if (!C2(s4.value))
            return { valid: false, tips: "The type of values of the custom profile key-value pairs (which is profileCustomField) must be String" };
        }
      for (t3 in e3)
        if (Object.prototype.hasOwnProperty.call(e3, t3)) {
          if ("profileCustomField" === t3)
            continue;
          if (S2(e3[t3]) && !C2(e3[t3]) && !A2(e3[t3])) {
            o3 = "key:" + t3 + ", invalid value:" + e3[t3], n3 = false;
            continue;
          }
          switch (t3) {
            case "nick":
              C2(e3[t3]) || (n3 = !(o3 = "nick must be a string")), 500 < _t2(e3[t3]) && (o3 = "nick name limited: must less than or equal to ".concat(500, " bytes, current size: ").concat(_t2(e3[t3]), " bytes"), n3 = false);
              break;
            case "gender":
              ft2(ze2, e3.gender) || (o3 = "key:gender, invalid value:" + e3.gender, n3 = false);
              break;
            case "birthday":
              A2(e3.birthday) || (n3 = !(o3 = "birthday must be a number"));
              break;
            case "location":
              C2(e3.location) || (n3 = !(o3 = "location must be a string"));
              break;
            case "selfSignature":
              C2(e3.selfSignature) || (n3 = !(o3 = "selfSignature must be a string"));
              break;
            case "allowType":
              ft2(Ze2, e3.allowType) || (o3 = "key:allowType, invalid value:" + e3.allowType, n3 = false);
              break;
            case "language":
              A2(e3.language) || (n3 = !(o3 = "language must be a number"));
              break;
            case "avatar":
              C2(e3.avatar) || (n3 = !(o3 = "avatar must be a string"));
              break;
            case "messageSettings":
              0 !== e3.messageSettings && 1 !== e3.messageSettings && (n3 = !(o3 = "messageSettings must be 0 or 1"));
              break;
            case "adminForbidType":
              ft2(Xe2, e3.adminForbidType) || (o3 = "key:adminForbidType, invalid value:" + e3.adminForbidType, n3 = false);
              break;
            case "level":
              A2(e3.level) || (n3 = !(o3 = "level must be a number"));
              break;
            case "role":
              A2(e3.role) || (n3 = !(o3 = "role must be a number"));
              break;
            default:
              o3 = "unknown key:" + t3 + "  " + e3[t3], n3 = false;
          }
        }
      return { valid: n3, tips: o3 };
    } }, { key: "update", value: function(e3) {
      var n3 = this, o3 = "", i4 = "", s4 = [];
      this.friendCustomField.forEach(function(e4) {
        s4.push(e4.key);
      });
      for (var a3 = 0, t3 = e3.length; a3 < t3; a3++)
        !function() {
          if (o3 = e3[a3].tag, i4 = e3[a3].value, -1 < o3.indexOf("Tag_SNS_Custom"))
            -1 < s4.indexOf(o3) ? n3.friendCustomField.forEach(function(e4) {
              e4.key === o3 && (e4.value = i4);
            }) : n3.friendCustomField.push({ key: o3, value: i4 });
          else if (-1 < o3.indexOf("Tag_Profile_Custom")) {
            var t4 = false;
            n3.profile.profileCustomField.forEach(function(e4) {
              e4.key === o3 && (e4.value = i4, t4 = true);
            }), t4 || n3.profile.profileCustomField.push({ key: o3, value: i4 });
          } else
            switch (o3) {
              case f2.NICK:
                n3.profile.nick = i4;
                break;
              case f2.GENDER:
                n3.profile.gender = i4;
                break;
              case f2.BIRTHDAY:
                n3.profile.birthday = i4;
                break;
              case f2.LOCATION:
                n3.profile.location = i4;
                break;
              case f2.SELFSIGNATURE:
                n3.profile.selfSignature = i4;
                break;
              case f2.ALLOWTYPE:
                n3.profile.allowType = i4;
                break;
              case f2.LANGUAGE:
                n3.profile.language = i4;
                break;
              case f2.AVATAR:
                n3.profile.avatar = i4;
                break;
              case f2.MESSAGESETTINGS:
                n3.profile.messageSettings = i4;
                break;
              case f2.ADMINFORBIDTYPE:
                n3.profile.adminForbidType = i4;
                break;
              case f2.LEVEL:
                n3.profile.level = i4;
                break;
              case f2.ROLE:
                n3.profile.role = i4;
                break;
              case Je2.REMARK:
                n3.remark = i4;
                break;
              case Je2.ADDTIME:
                n3.addTime = i4;
                break;
              case Je2.GROUP:
                n3.groupList = JSON.parse(JSON.stringify(i4));
                break;
              case Je2.ADDSOURCE:
                n3.source = i4;
                break;
              case Je2.ADDWORDING:
                break;
              default:
                M2.d("snsProfileItem unkown tag->", e3[a3].tag);
            }
        }();
      this.timestamp = Date.now(), s4.length = 0;
    } }, { key: "updateProfile", value: function(e3) {
      this.profile = JSON.parse(JSON.stringify(e3)), this.timestamp = Date.now();
    } }, { key: "addToGroupList", value: function(e3) {
      -1 === this.groupList.indexOf(e3) && (this.groupList.push(e3), this.count = this.groupList.length);
    } }, { key: "removeFromGroupList", value: function(e3) {
      e3 = this.groupList.indexOf(e3);
      -1 < e3 && (this.groupList.splice(e3, 1), this.count = this.groupList.length);
    } }]), qs = e2(function e3(t3) {
      p3(this, e3), this._snsM = t3, this._n = "FriendHandler", this._map = /* @__PURE__ */ new Map(), this._startIdx = 0, this._standardSeq = 0, this._customSeq = 0, this._expirationTime = 18e4;
    }, [{ key: "getLocalFriendList", value: function() {
      return d2(this._map.values());
    } }, { key: "getFriendRemark", value: function(e3) {
      return this._map.has(e3) ? this._map.get(e3).remark : "";
    } }, { key: "onFriendProfileModified", value: function(e3) {
      var o3, i4 = this, e3 = e3.dataList;
      S2(e3) || (o3 = this._snsM.get(11), e3.forEach(function(e4) {
        var t3, n3 = e4.userID, e4 = e4.profileList;
        i4.isMyFriend(n3) && (M2.l("".concat(i4._n, ".onFriendProfileModified. friend account:").concat(n3, ", profileList:").concat(JSON.stringify(e4))), (t3 = i4._map.get(n3)).update(e4), o3.modifyMessageSentByPeer({ conversationID: "".concat(R2.CONV_C2C).concat(n3), latestNick: t3.profile.nick, latestAvatar: t3.profile.avatar }));
      }), this._onFriendListUpdated());
    } }, { key: "onFriendAdded", value: function(t3) {
      var n3 = this;
      0 !== t3.length && (M2.l("".concat(this._n, ".onFriendAdded userIDList:").concat(t3)), t3.forEach(function(e3) {
        n3._map.set(e3, new Fs(e3));
      }), this.getFriendProfile({ userIDList: t3 }).then(function(e3) {
        t3.forEach(function(e4) {
          var t4 = n3._map.get(e4);
          0 < t4.groupList.length && n3._snsM.updateWhenFriendAdded({ nameList: t4.groupList, userID: e4 });
        }), n3._onFriendListUpdated();
      }));
    } }, { key: "onFriendDeleted", value: function(e3) {
      var n3 = this;
      0 !== e3.length && (M2.l("".concat(this._n, ".onFriendDeleted userIDList:").concat(e3)), e3.forEach(function(e4) {
        var t3 = n3._map.get(e4);
        0 < t3.groupList.length && n3._snsM.updateWhenFriendDeleted({ nameList: t3.groupList, userID: e4 }), n3._map.delete(e4);
      }), this._onFriendListUpdated());
    } }, { key: "_onFriendListUpdated", value: function() {
      this._snsM.emitOEvt(h2.FRIEND_LIST_UPDATED), this._snsM.get(11).checkAndPatchRemark();
    } }, { key: "getFriendProfile", value: function(e3) {
      var t3, s4 = this, n3 = "".concat(this._n, ".").concat("getFriendProfile"), e3 = e3.userIDList, a3 = [], r4 = [], o3 = [];
      return e3.forEach(function(e4) {
        var t4;
        s4._map.has(e4) ? (t4 = s4._map.get(e4), Date.now() - t4.timestamp < s4._expirationTime ? r4.push(t4) : o3.push(e4)) : a3.push({ userID: e4, code: k2.NOT_MY_FRIEND, message: s4._snsM.getErrMsg(k2.NOT_MY_FRIEND) });
      }), 0 === o3.length ? (M2.i("".concat(n3, " newUserIDList is empty")), D2({ friendList: r4, failureUserIDList: a3 })) : ((t3 = new P2("getFriendProfile")).setMessage("userIDList:".concat(o3)), M2.i("".concat(n3, " userIDList:").concat(o3)), this._snsM.req({ P: G2.GET_FD_PROFILE, data: { fromAccount: this._snsM.getMyUserID(), userIDList: o3 } }).then(function(e4) {
        return t3.end(), M2.i("".concat(n3, " ok")), e4.data.resultList.forEach(function(e5) {
          var t4, n4 = e5.to, o4 = e5.resultCode, i4 = e5.resultInfo, e5 = e5.tagValueList;
          N3(o4) || 0 === o4 ? (s4._map.has(n4) ? (t4 = s4._map.get(n4)).update(e5) : (t4 = new Fs(n4, e5), s4._map.set(n4, t4)), r4.push(t4)) : a3.push({ userID: n4, code: o4, message: i4 });
        }), T2({ friendList: r4, failureUserIDList: a3 });
      }).catch(function(e4) {
        return t3.setError(e4).end(), M2.w("".concat(n3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "isMyFriend", value: function(e3) {
      return this._map.has(e3);
    } }, { key: "pagingGetFriendList", value: function() {
      var a3 = this, r4 = "".concat(this._n, ".").concat("getFriendList"), c3 = new P2("getFriendList"), u3 = Date.now();
      this._snsM.req({ P: G2.GET_FD_LIST, data: { fromAccount: this._snsM.getMyUserID(), startIndex: this._startIdx, standardSequence: this._standardSeq, customSequence: this._customSeq } }).then(function(e3) {
        var e3 = e3.data, t3 = e3.friendCount, n3 = e3.resultList, o3 = e3.nextStartIndex, i4 = e3.standardSequence, s4 = e3.customSequence, e3 = e3.completeFlag, t3 = (a3._startIdx = o3, a3._standardSeq = i4, a3._customSeq = s4, "friendCount:".concat(t3, " nextStartIndex:").concat(o3, " standardSequence:").concat(i4, " ") + "customSequence:".concat(s4, " completeFlag:").concat(e3, " cost:").concat(tn(u3)));
        c3.setMessage(t3).end(), M2.i("".concat(r4, " ok."), t3), S2(n3) || n3.forEach(function(e4) {
          var t4 = e4.to, e4 = e4.tagValueList;
          a3._map.set(t4, new Fs(t4, e4));
        }), 0 === e3 ? a3.pagingGetFriendList() : (a3._snsM.emitOEvt(h2.FRIEND_LIST_UPDATED), a3._pagingGetFriendProfile());
      }).catch(function(e3) {
        return c3.setError(e3).end(), M2.w("".concat(r4, " failed. error:"), e3), E2(e3);
      });
    } }, { key: "_pagingGetFriendProfile", value: function() {
      var n3 = this, e3 = d2(this._map.keys()), t3 = this._snsM.get(4), o3 = e3.length, i4 = o3 <= 100 ? 1 : Math.ceil(o3 / 100);
      M2.l("".concat(this._n, "._pagingGetFriendProfile friendCount:").concat(o3, " pageCount:").concat(i4));
      for (var s4 = 0; s4 < i4; s4++)
        t3.getUserProfile({ userIDList: e3.slice(100 * s4, 100 * (s4 + 1)) }).then(function(e4) {
          e4.data.forEach(function(e5) {
            var t4 = n3._map.get(e5.userID);
            t4 && t4.updateProfile(e5);
          }), n3._onFriendListUpdated();
        });
    } }, { key: "addFriend", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4, c3 = this, u3 = "".concat(this._n, ".").concat("addFriend");
      return e3.wording && false === this._snsM.filterProfanity("wording", e3) ? E2({ code: k2.PROFANITY_FOUND }) : (t3 = e3.to, n3 = e3.source, o3 = e3.type, i4 = e3.wording, s4 = e3.remark, e3 = e3.groupName, (a3 = o3) && (a3 === R2.SNS_ADD_TYPE_SINGLE || a3 === R2.SNS_ADD_TYPE_BOTH) || (a3 = R2.SNS_ADD_TYPE_BOTH), (r4 = new P2("addFriend")).setMessage("to:".concat(t3, " source:").concat(n3, " type:").concat(a3)), this._snsM.req({ P: G2.ADD_FD, data: { fromAccount: this._snsM.getMyUserID(), addFriendItem: [{ to: t3, source: n3, wording: i4, remark: s4, groupName: e3 }], type: a3 } }).then(function(e4) {
        var e4 = e4.data.resultList, e4 = (r4.setMoreMessage("resultList:".concat(JSON.stringify(e4))).end(), e4[0]), t4 = e4.to, n4 = e4.resultCode, e4 = e4.resultInfo;
        return M2.i("".concat(u3, " ok. to:").concat(t4, " type:").concat(a3, " code:").concat(n4)), N3(n4) || 0 === n4 ? T2({ userID: t4, code: 0 }) : 30539 === n4 ? T2({ userID: t4, code: n4, message: c3._snsM.getErrMsg(n4) }) : E2({ userID: t4, code: n4, message: c3._snsM.getErrMsg(n4) || e4 });
      }).catch(function(e4) {
        return r4.setError(e4).end(), M2.w("".concat(u3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "deleteFriend", value: function(e3) {
      var t3, n3 = this, o3 = "".concat(this._n, ".").concat("deleteFriend"), i4 = e3.userIDList, e3 = e3.type, s4 = (1e3 < i4.length && (M2.w("".concat(o3, " ").concat(Qt2(1e3))), i4.length = 1e3), []), a3 = [], r4 = [];
      return i4.forEach(function(e4) {
        n3._map.has(e4) ? r4.push(e4) : s4.push({ userID: e4, code: k2.NOT_MY_FRIEND, message: n3._snsM.getErrMsg(k2.NOT_MY_FRIEND) });
      }), 0 === r4.length ? D2({ successUserIDList: a3, failureUserIDList: s4 }) : ((i4 = e3) && (i4 === R2.SNS_DELETE_TYPE_SINGLE || i4 === R2.SNS_DELETE_TYPE_BOTH) || (i4 = R2.SNS_DELETE_TYPE_BOTH), (t3 = new P2("deleteFriend")).setMessage("userIDList:".concat(r4, " type:").concat(i4)), this._snsM.req({ P: G2.DEL_FD, data: { fromAccount: this._snsM.getMyUserID(), userIDList: r4, type: i4 } }).then(function(e4) {
        t3.end(), M2.i("".concat(o3, " ok"));
        e4 = e4.data.resultList;
        return S2(e4) || e4.forEach(function(e5) {
          var t4 = e5.to, n4 = e5.resultCode, e5 = e5.resultInfo;
          N3(n4) || 0 === n4 ? a3.push({ userID: t4 }) : s4.push({ userID: t4, code: n4, message: e5 });
        }), T2({ successUserIDList: a3, failureUserIDList: s4 });
      }).catch(function(e4) {
        return t3.setError(e4).end(), M2.w("".concat(o3, " error:"), e4), E2(e4);
      }));
    } }, { key: "updateFriend", value: function(e3) {
      var o3, i4, t3, s4 = this, n3 = e3.userID, a3 = e3.remark, r4 = e3.friendCustomField;
      return this._map.has(n3) ? (o3 = "".concat(this._n, ".").concat("updateFriend"), (i4 = new P2("updateFriend")).setMessage("userID:".concat(n3, " remark:").concat(a3, " friendCustomField:").concat(r4)), t3 = [], N3(a3) || t3.push({ tag: Je2.REMARK, value: a3 }), O2(r4) && 0 < r4.length && r4.forEach(function(e4) {
        t3.push({ tag: e4.key, value: e4.value });
      }), this._snsM.req({ P: G2.UPDATE_FD, data: { fromAccount: this._snsM.getMyUserID(), updateItem: [{ to: n3, snsItem: t3 }] } }).then(function(e4) {
        i4.end(), M2.i("".concat(o3, " ok"));
        var e4 = e4.data.resultList[0], t4 = e4.to, n4 = e4.resultCode, e4 = e4.resultInfo;
        return N3(n4) || 0 === n4 ? ((t4 = s4._map.get(t4)) && (N3(a3) || (t4.remark = a3), O2(r4) && 0 < r4.length && Lt2(t4.friendCustomField, r4), s4._onFriendListUpdated()), T2(t4)) : E2({ code: n4, message: e4 });
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.w("".concat(o3, " failed. error:"), e4), E2(e4);
      })) : E2({ code: k2.NOT_MY_FRIEND });
    } }, { key: "checkFriend", value: function(e3) {
      var t3 = "".concat(this._n, ".").concat("checkFriend"), n3 = e3.userIDList, o3 = e3.type, a3 = (o3 && (o3 === R2.SNS_CHECK_TYPE_SINGLE || o3 === R2.SNS_CHECK_TYPE_BOTH) || (o3 = R2.SNS_CHECK_TYPE_BOTH), new P2("checkFriend"));
      return a3.setMessage("userIDList:".concat(n3, " type:").concat(o3)), this._snsM.req({ P: G2.CHECK_FD, data: { fromAccount: this._snsM.getMyUserID(), userIDList: n3, type: o3 } }).then(function(e4) {
        a3.end(), M2.i("".concat(t3, " ok. userIDList:").concat(n3, " type:").concat(o3));
        var i4 = [], s4 = [], e4 = e4.data.resultList;
        return O2(e4) && e4.forEach(function(e5) {
          var t4 = e5.to, n4 = e5.relation, o4 = e5.resultCode, e5 = e5.resultInfo;
          N3(o4) || 0 === o4 ? i4.push({ userID: t4, code: 0, relation: n4 }) : s4.push({ userID: t4, code: o4, message: e5 });
        }), T2({ successUserIDList: i4, failureUserIDList: s4 });
      }).catch(function(e4) {
        return a3.setError(e4).end(), M2.w("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "onAddedToFriendGroup", value: function(e3) {
      var t3 = this, n3 = e3.name, e3 = e3.userIDList;
      M2.l("".concat(this._n, ".onAddedToFriendGroup groupName:").concat(n3, " userIDList:").concat(e3)), n3 && !S2(e3) && e3.forEach(function(e4) {
        t3._map.has(e4) && t3._map.get(e4).addToGroupList(n3);
      });
    } }, { key: "onRemovedFromFriendGroup", value: function(e3) {
      var t3 = this, n3 = e3.name, e3 = e3.userIDList;
      M2.l("".concat(this._n, ".onRemovedFromFriendGroup groupName:").concat(n3, " userIDList:").concat(e3)), n3 && !S2(e3) && e3.forEach(function(e4) {
        t3._map.has(e4) && t3._map.get(e4).removeFromGroupList(n3);
      });
    } }, { key: "reset", value: function() {
      this._map.clear(), this._startIdx = 0, this._standardSeq = 0, this._customSeq = 0;
    } }]), xs = e2(function e3(t3) {
      p3(this, e3), S2(t3) || (this.name = t3.name || "", this.userIDList = t3.userIDList || [], this.count = this.userIDList.length || 0);
    }, [{ key: "addToUserIDList", value: function(e3) {
      -1 === this.userIDList.indexOf(e3) && (this.userIDList.push(e3), this.count = this.userIDList.length);
    } }, { key: "removeFromUserIDList", value: function(e3) {
      e3 = this.userIDList.indexOf(e3);
      -1 < e3 && (this.userIDList.splice(e3, 1), this.count = this.userIDList.length);
    } }]), Vs = e2(function e3(t3) {
      p3(this, e3), this._snsM = t3, this._n = "FriendGroupHandler", this._map = /* @__PURE__ */ new Map();
    }, [{ key: "getLocalGroupList", value: function() {
      return d2(this._map.values());
    } }, { key: "_onGroupListUpdated", value: function() {
      var e3 = d2(this._map.values());
      this._snsM.emitOEvt(h2.FRIEND_GROUP_LIST_UPDATED, e3);
    } }, { key: "getGroupList", value: function() {
      var n3 = this, t3 = "".concat(this._n, ".").concat("getGroupList"), o3 = new P2("getGroupList");
      return this._snsM.req({ P: G2.GET_FD_GRP_LIST, data: { fromAccount: this._snsM.getMyUserID() } }).then(function(e3) {
        o3.end();
        e3 = e3.data.resultList;
        S2(e3) ? M2.i("".concat(t3, " ok. count:0")) : (M2.i("".concat(t3, " ok. count:").concat(e3.length)), n3._map.clear(), e3.forEach(function(e4) {
          var t4 = new xs(e4);
          n3._map.set(e4.name, t4);
        }), n3._onGroupListUpdated());
      }).catch(function(e3) {
        return o3.setError(e3).end(), M2.w("".concat(t3, " error:"), e3), E2(e3);
      });
    } }, { key: "createGroup", value: function(e3) {
      var t3, n3, o3 = this, a3 = "".concat(this._n, ".").concat("createGroup"), r4 = e3.name, e3 = e3.userIDList;
      return this._map.has(r4) ? E2({ code: k2.FRIEND_GRP_EXISTED }) : (t3 = "name:".concat(r4, " userIDList:").concat(e3), (n3 = new P2("createGroup")).setMessage(t3), this._snsM.req({ P: G2.CREATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), groupName: [r4], userIDList: O2(e3) ? e3 : void 0 } }).then(function(e4) {
        n3.end(), M2.l("".concat(a3, " ok. ").concat(t3));
        var e4 = e4.data.resultList, i4 = [], s4 = [], e4 = (e4 && e4.forEach(function(e5) {
          var t4 = e5.to, n4 = e5.resultCode, o4 = e5.resultInfo;
          N3(n4) || 0 === n4 ? i4.push(t4) : (t4 = { userID: e5.to, code: n4, message: o4 }, s4.push(t4));
        }), new xs({ name: r4, userIDList: i4 }));
        return o3._map.set(r4, e4), o3._snsM.onAddedToFriendGroup({ name: r4, userIDList: i4 }), o3._onGroupListUpdated(), T2({ friendGroup: e4, failureUserIDList: s4 });
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.w("".concat(a3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "deleteGroup", value: function(e3) {
      var n3, o3, i4 = this, s4 = "".concat(this._n, ".").concat("deleteGroup"), a3 = e3.name;
      return this._map.has(a3) ? (n3 = "name:".concat(a3), (o3 = new P2("deleteGroup")).setMessage(n3), this._snsM.req({ P: G2.DEL_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), nameList: [a3] } }).then(function(e4) {
        o3.end(), M2.l("".concat(s4, " ok. ").concat(n3));
        var t3 = i4._map.get(a3);
        return t3 && (i4._snsM.onRemovedFromFriendGroup({ name: a3, userIDList: t3.userIDList }), i4._map.delete(a3), t3.userIDList.length = 0), i4._onGroupListUpdated(), T2(t3);
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.w("".concat(s4, " failed. error:"), e4), E2(e4);
      })) : this._onGroupNotExist();
    } }, { key: "renameGroup", value: function(e3) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("renameGroup"), s4 = e3.oldName, a3 = e3.newName;
      return this._map.has(s4) ? (t3 = "oldName:".concat(s4, " newName:").concat(a3), (n3 = new P2("renameGroup")).setMessage(t3), this._snsM.req({ P: G2.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: s4, newName: a3 } }).then(function() {
        var e4;
        return n3.end(), M2.l("".concat(i4, " ok. ").concat(t3)), o3._map.has(s4) ? ((e4 = o3._map.get(s4)).name = a3, o3._map.delete(s4), o3._map.set(a3, e4), o3._snsM.onRemovedFromFriendGroup({ name: s4, userIDList: e4.userIDList }), o3._snsM.onAddedToFriendGroup({ name: a3, userIDList: e4.userIDList }), o3._onGroupListUpdated(), T2(e4)) : T2();
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.w("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : this._onGroupNotExist();
    } }, { key: "addToGroup", value: function(e3) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("addToGroup"), s4 = e3.name, e3 = e3.userIDList;
      return this._map.has(s4) ? (t3 = "name:".concat(s4, " userIDList:").concat(e3), (n3 = new P2("addToGroup")).setMessage(t3), this._snsM.req({ P: G2.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: s4, updateGroupItem: e3.filter(function(e4) {
        return o3._snsM.isMyFriend(e4);
      }).map(function(e4) {
        return { to: e4, updateType: "Update_Type_Add" };
      }) } }).then(function(e4) {
        return n3.end(), M2.l("".concat(i4, " ok. ").concat(t3)), o3._onGroupUpdated(s4, e4);
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.w("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : this._onGroupNotExist();
    } }, { key: "removeFromGroup", value: function(e3) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("removeFromGroup"), s4 = e3.name, e3 = e3.userIDList;
      return this._map.has(s4) ? (t3 = "name:".concat(s4, " userIDList:").concat(e3), (n3 = new P2("removeFromGroup")).setMessage(t3), this._snsM.req({ P: G2.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: s4, updateGroupItem: e3.filter(function(e4) {
        return o3._snsM.isMyFriend(e4);
      }).map(function(e4) {
        return { to: e4, updateType: "Update_Type_Delete" };
      }) } }).then(function(e4) {
        return n3.end(), M2.l("".concat(i4, " ok. ").concat(t3)), o3._onGroupUpdated(s4, e4);
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.w("".concat(i4, " failed. error:"), e4), E2(e4);
      })) : this._onGroupNotExist();
    } }, { key: "_onGroupUpdated", value: function(e3, t3) {
      var t3 = t3.data.resultList, s4 = this._map.get(e3), a3 = [], r4 = [], c3 = [];
      return O2(t3) && t3.forEach(function(e4) {
        var t4 = e4.to, n3 = e4.resultCode, o3 = e4.resultInfo, i4 = e4.type;
        0 === n3 ? "Update_Type_Add" === i4 ? s4 && (s4.addToUserIDList(t4), r4.push(t4)) : "Update_Type_Delete" === i4 && s4 && (s4.removeFromUserIDList(t4), c3.push(t4)) : a3.push({ to: e4.to, code: n3, message: o3 });
      }), M2.l("".concat(this._n, "._onGroupUpdated name:").concat(e3, " userIDList:").concat(s4.userIDList)), 0 < r4.length && this._snsM.onAddedToFriendGroup({ name: e3, userIDList: r4 }), 0 < c3.length && this._snsM.onRemovedFromFriendGroup({ name: e3, userIDList: c3 }), T2({ friendGroup: s4, failureUserIDList: a3 });
    } }, { key: "updateWhenFriendAdded", value: function(e3) {
      var t3 = this, n3 = e3.nameList, o3 = e3.userID;
      M2.l("".concat(this._n, ".updateWhenFriendAdded userID:").concat(o3, " nameList:").concat(n3)), S2(n3) || n3.forEach(function(e4) {
        t3._map.has(e4) && t3._map.get(e4).addToUserIDList(o3);
      });
    } }, { key: "updateWhenFriendDeleted", value: function(e3) {
      var t3 = this, n3 = e3.nameList, o3 = e3.userID;
      M2.l("".concat(this._n, ".updateWhenFriendDeleted userID:").concat(o3, " nameList:").concat(n3)), S2(n3) || n3.forEach(function(e4) {
        t3._map.has(e4) && t3._map.get(e4).removeFromUserIDList(o3);
      });
    } }, { key: "_onGroupNotExist", value: function(e3) {
      return E2({ code: k2.FRIEND_GRP_NOT_EXIST });
    } }, { key: "reset", value: function() {
      this._map.clear();
    } }]), Bs = (t2(ha, c2), e2(ha, [{ key: "onContextUpdated", value: function(e3) {
      this._friendHandler.pagingGetFriendList(), this._friendGroupHandler.getGroupList(), this._friendApplicationHandler.getApplicationList();
    } }, { key: "onRelationChainModified", value: function(e3) {
      var n3, o3, i4, s4, a3, r4, c3 = this, e3 = e3.dataList;
      S2(e3) || (n3 = [], o3 = [], i4 = [], a3 = !(s4 = []), r4 = "", e3.forEach(function(e4) {
        var t3;
        3 !== e4.pushType && 4 !== e4.pushType || !e4.from || (r4 = e4.from), e4.friendAddAccount && (n3.push.apply(n3, d2(e4.friendAddAccount)), s4.push.apply(s4, d2(e4.friendAddAccount))), e4.friendDelAccount && o3.push.apply(o3, d2(e4.friendDelAccount)), e4.friendApplicationAdded && i4.push.apply(i4, d2(e4.friendApplicationAdded)), e4.friendApplicationDeletedUserIDList && s4.push.apply(s4, d2(e4.friendApplicationDeletedUserIDList)), e4.reportTime && 7 === e4.pushType && (a3 = true), e4.friendUpInfo && (t3 = { dataList: [] }, e4.friendUpInfo.forEach(function(e5) {
          t3.dataList.push({ userID: e5.friendAccount, profileList: d2(e5.sns) });
        }), c3.onFriendProfileModified(t3));
      }), a3 && this._friendApplicationHandler.onApplicationRead(), this._friendApplicationHandler.onApplicationAdded(i4, r4), this._friendApplicationHandler.onApplicationDeleted(s4), this._friendHandler.onFriendAdded(n3), this._friendHandler.onFriendDeleted(o3));
    } }, { key: "isMyFriend", value: function(e3) {
      return this._friendHandler.isMyFriend(e3);
    } }, { key: "filterProfanity", value: function(e3, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e3], "sns")).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e3] = o3, true));
    } }, { key: "onFriendProfileModified", value: function(e3) {
      this._friendHandler.onFriendProfileModified(e3);
    } }, { key: "getLocalFriendList", value: function() {
      var e3 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t3 = this._friendHandler.getLocalFriendList();
      return e3 ? D2(t3) : t3;
    } }, { key: "getFriendRemark", value: function(e3) {
      return this._friendHandler.getFriendRemark(e3);
    } }, { key: "getFriendList", value: function() {
      return this._friendHandler.pagingGetFriendList();
    } }, { key: "addFriend", value: function(e3) {
      return this._friendHandler.addFriend(e3);
    } }, { key: "deleteFriend", value: function(e3) {
      return this._friendHandler.deleteFriend(e3);
    } }, { key: "checkFriend", value: function(e3) {
      return this._friendHandler.checkFriend(e3);
    } }, { key: "getFriendProfile", value: function(e3) {
      return this._friendHandler.getFriendProfile(e3);
    } }, { key: "updateFriend", value: function(e3) {
      return this._friendHandler.updateFriend(e3);
    } }, { key: "onAddedToFriendGroup", value: function(e3) {
      this._friendHandler.onAddedToFriendGroup(e3);
    } }, { key: "onRemovedFromFriendGroup", value: function(e3) {
      this._friendHandler.onRemovedFromFriendGroup(e3);
    } }, { key: "getLocalFriendApplicationList", value: function() {
      var e3 = this._friendApplicationHandler.getLocalApplicationList();
      return D2(e3);
    } }, { key: "deleteFriendApplication", value: function(e3) {
      return this._friendApplicationHandler.deleteApplication(e3);
    } }, { key: "refuseFriendApplication", value: function(e3) {
      return this._friendApplicationHandler.refuseApplication(e3);
    } }, { key: "acceptFriendApplication", value: function(e3) {
      return this._friendApplicationHandler.acceptApplication(e3);
    } }, { key: "setFriendApplicationRead", value: function(e3) {
      return this._friendApplicationHandler.setApplicationRead(e3);
    } }, { key: "getLocalFriendGroupList", value: function() {
      var e3 = this._friendGroupHandler.getLocalGroupList();
      return D2(e3);
    } }, { key: "createFriendGroup", value: function(e3) {
      return this._friendGroupHandler.createGroup(e3);
    } }, { key: "deleteFriendGroup", value: function(e3) {
      return this._friendGroupHandler.deleteGroup(e3);
    } }, { key: "addToFriendGroup", value: function(e3) {
      return this._friendGroupHandler.addToGroup(e3);
    } }, { key: "removeFromFriendGroup", value: function(e3) {
      return this._friendGroupHandler.removeFromGroup(e3);
    } }, { key: "renameFriendGroup", value: function(e3) {
      return this._friendGroupHandler.renameGroup(e3);
    } }, { key: "updateWhenFriendAdded", value: function(e3) {
      this._friendGroupHandler.updateWhenFriendAdded(e3);
    } }, { key: "updateWhenFriendDeleted", value: function(e3) {
      this._friendGroupHandler.updateWhenFriendDeleted(e3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._friendHandler.reset(), this._friendGroupHandler.reset(), this._friendApplicationHandler.reset();
    } }])), Hs = (t2(_a, c2), e2(_a, [{ key: "isWorkerEnabled", value: function() {
      return this._isWorkerEnabled && Ae2;
    } }, { key: "startWorkerTimer", value: function() {
      M2.l("".concat(this._n, ".startWorkerTimer")), this._workerTimer && this._workerTimer.postMessage("start");
    } }, { key: "stopWorkerTimer", value: function() {
      M2.l("".concat(this._n, ".stopWorkerTimer")), this._workerTimer && this._workerTimer.postMessage("stop");
    } }, { key: "_init", value: function() {
      var e3, t3;
      Ae2 && (e3 = URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) {  if (event.data === "start") {    if (interval > 0) {      clearInterval(interval);    }    interval = setInterval(() => {      postMessage("");    }, 1000);    postMessage(interval);  } else if (event.data === "stop") {    clearInterval(interval);    interval = -1;  }};'], { type: "application/javascript; charset=utf-8" })), this._workerTimer = new Worker(e3), (t3 = this)._workerTimer.onmessage = function(e4) {
        e4.data ? (t3._timerID = e4.data, M2.l("".concat(t3._n, "._init seed:").concat(t3._timerID))) : t3._m.onCheckTimer();
      });
    } }, { key: "_onCloudConfig", value: function() {
      var e3 = this.getCloudConfig("enable_worker");
      M2.l("".concat(this._n, "._onCloudConfig enableWorker:").concat(e3)), N3(e3) || "1" === e3 ? !this._isWorkerEnabled && Ae2 && (this._isWorkerEnabled = true, this.startWorkerTimer(), this._m.onWorkerTimerEnabled()) : this._isWorkerEnabled && Ae2 && (this._isWorkerEnabled = false, this.stopWorkerTimer(), this._m.onWorkerTimerDisabled());
    } }, { key: "terminate", value: function() {
      M2.l("".concat(this._n, ".terminate")), this._workerTimer && (this._workerTimer.terminate(), this._workerTimer = null, this._timerID = -1);
    } }, { key: "getTimerID", value: function() {
      return this._timerID;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }])), Ks = e2(function e3(t3) {
      p3(this, e3), this._commercialConfigM = t3, this._n = "PurchasedFeatureHandler", this._isCSPluginReported = false, this._featureMap = /* @__PURE__ */ new Map();
    }, [{ key: "isValidPurchaseBits", value: function(e3) {
      return e3 && "string" == typeof e3 && 1 <= e3.length && e3.length <= 64 && /[01]{1,64}/.test(e3);
    } }, { key: "parsePurchaseBits", value: function(e3) {
      if (this.isValidPurchaseBits(e3)) {
        this._featureMap.clear();
        for (var t3, n3 = e3.length - 1, o3 = 0; 0 <= n3; n3--, o3++)
          t3 = (o3 < 32 ? new $2(0, Math.pow(2, o3)) : new $2(Math.pow(2, o3 - 32), 0)).toString(), "1" === e3[n3] ? this._featureMap.set(t3, true) : this._featureMap.set(t3, false);
      } else
        M2.w("".concat(this._n, ".parsePurchaseBits invalid purchasebits:").concat(e3));
    } }, { key: "hasPurchasedFeature", value: function(e3) {
      return !!this._featureMap.get(e3);
    } }, { key: "isFeatureEnabled", value: function(e3) {
      for (var t3 = parseInt(e3).toString(2), n3 = void 0, o3 = true, i4 = t3.length - 1, s4 = 0; 0 <= i4; i4--, s4++)
        if ("1" === t3.charAt(i4) && (n3 = (s4 < 32 ? new $2(0, Math.pow(2, s4)) : new $2(Math.pow(2, s4 - 32), 0)).toString(), !this._featureMap.get(n3))) {
          o3 = false;
          break;
        }
      return M2.l("".concat(this._n, ".isFeatureEnabled decimalNumber:").concat(e3, " key:").concat(n3, " ret:").concat(o3)), D2({ enabled: o3 });
    } }, { key: "isFeatureEnabledForStat", value: function(e3) {
      for (var t3 = parseInt(e3).toString(2), n3 = t3.length - 1, o3 = 0; 0 <= n3; n3--, o3++)
        if ("1" === t3.charAt(n3)) {
          if (i4 = (o3 < 32 ? new $2(0, Math.pow(2, o3)) : new $2(Math.pow(2, o3 - 32), 0)).toString(), !this._featureMap.get(i4))
            break;
          var i4, s4 = "", a3 = 0;
          i4 === g2.PLUGIN_TRANSLATE ? (s4 = "plugin_translate", a3 = 16) : i4 === g2.PLUGIN_VOICE_TO_TEXT ? (s4 = "plugin_voice_to_text", a3 = 17) : i4 === g2.PLUGIN_CS ? (s4 = "plugin_cs", a3 = 14) : i4 === g2.PLUGIN_PUSH ? (s4 = "plugin_push", a3 = 13) : i4 === g2.PLUGIN_BOT ? (s4 = "plugin_bot", a3 = 15) : i4 === g2.MSG_REACTION && (s4 = "plugin_emoji_reaction", a3 = 18), "" !== s4 && (i4 = this._commercialConfigM.get(12).getUIPlatform(), new P2(s4).setCode(a3).setUIPlatform(i4).end(), M2.l("".concat(this._n, ".isFeatureEnabledForStat ").concat(s4, " code:").concat(a3, " uiPlatform:").concat(i4)));
        }
    } }, { key: "isCSPluginEnabled", value: function() {
      var e3;
      this._isCSPluginReported || (e3 = this._commercialConfigM.get(12).getUIPlatform(), new P2("plugin_search").setCode(6).setUIPlatform(e3).end(), this._isCSPluginReported = true);
    } }, { key: "clear", value: function() {
      this._featureMap.clear(), this._isCSPluginReported = false;
    } }]), Ws = e2(function e3(t3) {
      p3(this, e3), this._m = t3, this._n = "CommercialConfigModule", this._expiredTime = 0, this._isFetching = false, this._purchasedFeatureHandler = new Ks(this);
    }, [{ key: "_canFetch", value: function() {
      return this.get(12).isLoggedIn() ? !this._isFetching && Date.now() >= this._expiredTime : (this._expiredTime = Date.now() + 2e3, false);
    } }, { key: "onCheckTimer", value: function(e3) {
      this._canFetch() && this.fetchConfig();
    } }, { key: "fetchConfig", value: function() {
      var t3, e3, n3 = this, o3 = this._canFetch(), i4 = "".concat(this._n, ".fetchConfig");
      M2.l("".concat(i4, " canFetch:").concat(o3)), o3 && (t3 = new P2("fetchCommercialConfig"), o3 = this.get(12).getSDKAppID(), e3 = this.get(20), this._isFetching = true, e3.req({ P: G2.FETCH_COMMERCIAL_CONFIG, data: { SDKAppID: o3 } }).then(function(e4) {
        t3.setMessage("purchaseBits:".concat(e4.data.purchaseBits)).end(), M2.l("".concat(i4, " ok.")), n3._parseConfig(e4.data), n3._isFetching = false;
      }).catch(function(e4) {
        t3.setError(e4).end(), n3._isFetching = false;
      }));
    } }, { key: "onPushedConfig", value: function(e3) {
      var t3 = "".concat(this._n, ".onPushedConfig data:").concat(JSON.stringify(e3));
      M2.l("".concat(t3)), new P2("pushedCommercialConfig").setMessage("purchaseBits:".concat(e3.purchaseBits)).end(), this._parseConfig(e3);
    } }, { key: "_parseConfig", value: function(e3) {
      var t3 = "".concat(this._n, "._parseConfig"), n3 = e3.errorCode, o3 = e3.errorMessage, i4 = e3.purchaseBits, s4 = e3.expiredTime;
      0 === n3 ? (this._purchasedFeatureHandler.parsePurchaseBits(i4), this._expiredTime = Date.now() + 1e3 * s4) : N3(n3) ? (M2.l("".concat(t3, " failed. Invalid message format:"), e3), this._setExpiredTimeOnResponseError(36e5)) : (M2.e("".concat(t3, " errorCode:").concat(n3, " errorMessage:").concat(o3)), this._setExpiredTimeOnResponseError(12e4));
    } }, { key: "_setExpiredTimeOnResponseError", value: function(e3) {
      this._expiredTime = Date.now() + e3;
    } }, { key: "canIUse", value: function(e3) {
      return this._purchasedFeatureHandler.hasPurchasedFeature(e3);
    } }, { key: "isFeatureEnabled", value: function(e3) {
      return this._purchasedFeatureHandler.isFeatureEnabled(e3);
    } }, { key: "isFeatureEnabledForStat", value: function(e3) {
      this._purchasedFeatureHandler.isFeatureEnabledForStat(e3);
    } }, { key: "isCSPluginEnabled", value: function() {
      this._purchasedFeatureHandler.isCSPluginEnabled();
    } }, { key: "get", value: function(e3) {
      return this._m.get(e3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._expiredTime = 0, this._isFetching = false, this._purchasedFeatureHandler.clear();
    } }]), Ys = (t2(pa, c2), e2(pa, [{ key: "registerPlugin", value: function(e3) {
      var t3, n3, o3, i4, s4, a3, r4, c3, u3, l3, d3, p4, _3;
      fe2 ? (this._offlinePushPlugin = e3["tim-offline-push-plugin"], t3 = (_3 = e3.offlinePushConfig || {}).huaweiBusinessID, n3 = _3.xiaomiBusinessID, o3 = _3.xiaomiAppID, i4 = _3.xiaomiAppKey, s4 = _3.meizuBusinessID, a3 = _3.meizuAppID, r4 = _3.meizuAppKey, c3 = _3.vivoBusinessID, u3 = _3.oppoBusinessID, l3 = _3.oppoAppKey, d3 = _3.oppoAppSecret, p4 = _3.honorBusinessID, _3 = _3.iosBusinessID, this._androidPushConfig.huaweiPushBussinessId = t3, this._androidPushConfig.xiaomiPushBussinessId = n3, this._androidPushConfig.xiaomiPushAppId = o3, this._androidPushConfig.xiaomiPushAppKey = i4, this._androidPushConfig.meizuPushBussinessId = s4, this._androidPushConfig.meizuPushAppId = a3, this._androidPushConfig.meizuPushAppKey = r4, this._androidPushConfig.vivoPushBussinessId = c3, this._androidPushConfig.oppoPushBussinessId = u3, this._androidPushConfig.oppoPushAppKey = l3, this._androidPushConfig.oppoPushAppSecret = d3, this._androidPushConfig.honorPushBussinessId = p4, new P2("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!N3(this._offlinePushPlugin))).end(true), M2.l("".concat(this._n, ".").concat("registerPlugin", " ok. offlinePushConfig:").concat(JSON.stringify(e3.offlinePushConfig))), this._iosBusinessID = _3, this._setAppShowListener()) : this.warn("OfflinePushInUniapp");
    } }, { key: "init", value: function() {
      this._isWebUniapp = this.getUniAppPlatform(), this._getDeviceToken();
    } }, { key: "_getDeviceToken", value: function() {
      var c3, u3 = this, l3 = "".concat(this._n, ".").concat("_getDeviceToken");
      ct2(this._offlinePushPlugin.getDeviceToken) ? (c3 = "androidPushConfig:".concat(JSON.stringify(this._androidPushConfig), ", iosBusinessID:").concat(this._iosBusinessID), M2.l("".concat(l3, " start. ").concat(c3)), new P2("_getDeviceToken").setMessage("".concat(c3)).end(true), this._offlinePushPlugin.getDeviceToken(this._androidPushConfig, function(e3) {
        var t3, n3, o3, i4, s4 = new P2("getDeviceTokenRes"), a3 = e3.code, r4 = e3.msg;
        0 === a3 ? (t3 = (i4 = e3.data).deviceToken, n3 = i4.deviceBrand, o3 = i4.deviceType, i4 = i4.bussinessId, u3._deviceToken = t3, u3._businessID = i4 || u3._iosBusinessID, c3 = "deviceToken:".concat(t3, ", deviceBrand:").concat(n3 || o3, ", businessID:").concat(u3._businessID), M2.l("".concat(l3, " ok. ").concat(c3)), s4.setMessage(c3).end(true), u3._setToken()) : (s4.setMessage("code:".concat(a3, ", msg:").concat(r4)).end(true), M2.e("".concat(l3, " failed. error:"), e3));
      })) : M2.e("".concat(l3, " getDeviceToken is not a function"));
    } }, { key: "canIUseOfflinePush", value: function() {
      return fe2 && !N3(this._offlinePushPlugin);
    } }, { key: "_setAppShowListener", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_setAppShowListener");
      N3(this._offlinePushPlugin) ? M2.e("".concat(n3, " offlinePushPlugin is undefined")) : ct2(this._offlinePushPlugin.setAppShowListener) ? (new P2("_setAppShowListener").end(true), M2.l("".concat(n3, " start")), this._offlinePushPlugin.setAppShowListener(function(e3) {
        e3 = (e3 || {}).appShow;
        new P2("setAppShowListenerRes").setMessage("appShow:".concat(e3)).end(true), M2.l("".concat(n3, " ok. appShow:").concat(e3)), t3._m.isReady() && (0 === e3 ? (t3._getConvUnreadCount(), t3._onBackground()) : 1 === e3 && t3._onForeground());
      })) : M2.e("".concat(n3, " setAppShowListener is not a function"));
    } }, { key: "getDeviceBrand", value: function() {
      var e3;
      if (!N3(this._offlinePushPlugin) && ct2(this._offlinePushPlugin.getDeviceType))
        return e3 = (this._offlinePushPlugin.getDeviceType() || {}).deviceType, M2.l("".concat(this._n, ".getDeviceBrand ok. deviceType:").concat(e3)), e3;
    } }, { key: "_setToken", value: function() {
      var t3 = "".concat(this._n, "._setToken"), e3 = this.get(12), n3 = 1, o3 = "", i4 = "", s4 = (S2(this._deviceToken) && (n3 = 0), this.getUniAppPlatform()), a3 = this.getDeviceBrand(), r4 = (s4 === te2.IOS || s4 === te2.IPAD || s4 === te2.MAC ? i4 = this._deviceToken : s4 === te2.ANDROID && (o3 = this._deviceToken), new P2("offlinePushSetToken")), s4 = "deviceToken:".concat(i4 || o3, ", businessID:").concat(this._businessID, ", ") + "deviceBrand:".concat(a3, ", isWebUniapp:").concat(this._isWebUniapp, ", pushMsg:").concat(n3, ", platform:").concat(s4);
      return r4.setMessage("".concat(s4)), M2.l("".concat(t3, " ").concat(s4)), this.req({ P: G2.SET_TOKEN, data: { tokenID: o3, pushMsg: n3, sdkAppID: e3.getSDKAppID(), businessID: parseInt(this._businessID), deviceBrand: a3, deviceToken: i4, isWebUniapp: this._isWebUniapp } }).then(function(e4) {
        return r4.end(), M2.l("".concat(t3, " ok")), e4;
      }).catch(function(e4) {
        return r4.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_getConvUnreadCount", value: function() {
      var t3 = this;
      this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this.get(11).getLocalConvList().forEach(function(e3) {
        e3.type === R2.CONV_C2C && (t3._c2cUnreadCount += e3.unreadCount), e3.type === R2.CONV_GROUP && (t3._groupUnreadCount += e3.unreadCount);
      });
    } }, { key: "_onBackground", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_onBackground"), o3 = new P2("_onBackground");
      this.req({ P: G2.STAT_BACKGROUND, data: { c2cUnreadCount: this._c2cUnreadCount, groupUnreadCount: this._groupUnreadCount, isWebUniapp: this._isWebUniapp } }).then(function(e3) {
        return o3.setMessage("c2cUnreadCount: ".concat(t3._c2cUnreadCount, ", groupUnreadCount: ").concat(t3._groupUnreadCount)).end(), M2.l("".concat(n3, " ok")), e3;
      }).catch(function(e3) {
        o3.setError(e3).end(), M2.e("".concat(n3, " failed. error:"), e3);
      });
    } }, { key: "_onForeground", value: function() {
      var t3 = "".concat(this._n, ".").concat("_onForeground"), n3 = new P2("_onForeground");
      this.req({ P: G2.STAT_FOREGROUND, data: { isWebUniapp: this._isWebUniapp } }).then(function(e3) {
        return n3.end(), M2.l("".concat(t3, " ok")), e3;
      }).catch(function(e3) {
        n3.setError(e3).end(), M2.e("".concat(t3, " failed. error:"), e3);
      });
    } }, { key: "getUniAppPlatform", value: function() {
      var e3 = index.getSystemInfoSync().platform, t3 = this.getDeviceBrand();
      return "ios" === e3 ? te2.IOS : "android" === e3 ? te2.ANDROID : 1002 === t3 ? te2.IPAD : 1001 === t3 ? te2.MAC : void 0;
    } }, { key: "reset", value: function() {
      this._deviceToken = "", this._businessID = 0, this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this._isWebUniapp = 0, M2.l("".concat(this._n, ".reset"));
    } }])), js = (t2(da, c2), e2(da, [{ key: "registerPlugin", value: function(e3) {
      var t3, n3, o3;
      fe2 ? (t3 = "".concat(this._n, ".").concat("registerPlugin"), this._pushPlugin = e3["tim-push"], this._getDeviceInfo(), n3 = (o3 = e3.pushConfig || {}).androidConfig, o3 = o3.iOSConfig, at2(n3) && (this._androidPushConfig = n3[this._deviceInfo.packageName]), n3 = (o3 || {}).iOSBusinessID, this._iOSBusinessID = n3, o3 = !N3(this._pushPlugin), new P2("registerPlugin").setMessage(this._pluginName).setMoreMessage("isExisted:".concat(o3)).end(true), M2.l("".concat(t3, " ok. pushConfig:").concat(JSON.stringify(e3.pushConfig))), o3 ? (this._setAppShowListener(), this._setPushEventReportListener()) : M2.e("".concat(t3, " ").concat(this._pluginName, " is undefined"))) : this.warn("TIMPushInUniapp");
    } }, { key: "init", value: function() {
      this._isWebUniapp = this.getUniAppPlatform(), this._reportEventCacheList(), this._getDeviceToken(), this.get(27).isFeatureEnabledForStat(Math.pow(2, 41));
    } }, { key: "_reportEventCacheList", value: function() {
      var s4 = this, a3 = "".concat(this._n, ".").concat("_reportEventCacheList");
      ct2(this._pushPlugin.getPushEventCacheList) ? (new P2("_reportEventCacheList").end(true), this._pushPlugin.getPushEventCacheList(function(e3) {
        var t3 = e3.code, n3 = e3.data.eventList, o3 = new P2("getPushEventCacheListRes");
        if (o3.setCode(t3), 0 !== t3)
          o3.setMessage("res:".concat(JSON.stringify(e3))).end(true), M2.e("".concat(a3, " failed. error:").concat(JSON.stringify(e3)));
        else {
          t3 = n3.length < 10 ? "eventList:".concat(JSON.stringify(n3)) : "eventList.length:".concat(n3.length);
          M2.l("".concat(a3, " ok. ").concat(t3)), o3.setMessage(t3).end(true);
          for (var i4 = y2(y2({}, e3.data), {}, { eventList: [] }); 0 < n3.length; )
            i4.eventList = n3.splice(0, 40), s4._pushReport(i4);
        }
      })) : M2.e("".concat(this._pluginName, ".getPushEventCacheList is not a function"));
    } }, { key: "_getDeviceToken", value: function() {
      var r4, c3 = this, u3 = "".concat(this._n, ".").concat("_getDeviceToken");
      ct2(this._pushPlugin.getDeviceToken) ? (r4 = "androidPushConfig:".concat(JSON.stringify(this._androidPushConfig), " iOSBusinessID:").concat(this._iOSBusinessID), M2.l("".concat(u3, " start. ").concat(r4)), new P2("_getDeviceToken").setMessage("".concat(r4)).end(true), this._pushPlugin.getDeviceToken(this._androidPushConfig, function(e3) {
        var t3, n3, o3, i4 = e3.code, s4 = e3.msg, a3 = new P2("getDeviceTokenRes");
        a3.setCode(i4), 0 === i4 ? (t3 = (i4 = e3.data).deviceToken, n3 = i4.deviceBrand, o3 = i4.deviceType, i4 = i4.bussinessId, c3._deviceToken = t3, c3._businessID = i4 || c3._iOSBusinessID, r4 = "deviceToken:".concat(t3, " deviceBrand:").concat(n3 || o3, " businessID:").concat(c3._businessID), M2.l("".concat(u3, " ok. ").concat(r4)), a3.setMessage(r4).end(true), c3._setToken()) : (a3.setMessage(s4).end(true), M2.e("".concat(u3, " failed. error:").concat(JSON.stringify(e3))));
      })) : M2.e("".concat(this._pluginName, ".getDeviceToken is not a function"));
    } }, { key: "_getDeviceInfo", value: function() {
      var e3, t3, n3, o3, i4 = "".concat(this._n, ".").concat("_getDeviceInfo");
      ct2(this._pushPlugin.getDeviceInfo) ? (o3 = (e3 = this._pushPlugin.getDeviceInfo()).code, t3 = e3.data, (n3 = new P2("_getDeviceInfo")).setCode(o3), 0 === o3 ? (this._deviceInfo = y2(y2({}, this._deviceInfo), t3), this._deviceInfo.pushVersion || (this._deviceInfo.pushVersion = "1.0.1"), o3 = "deviceInfo:".concat(JSON.stringify(this._deviceInfo)), M2.l("".concat(i4, " ok. ").concat(o3)), n3.setMessage(o3).end(true)) : (n3.setMessage("deviceInfoRes:".concat(JSON.stringify(e3))).end(true), M2.e("".concat(i4, " failed. error:").concat(JSON.stringify(e3))))) : M2.e("".concat(this._pluginName, ".getDeviceInfo is not a function"));
    } }, { key: "canIUseTIMPush", value: function() {
      return fe2 && !N3(this._pushPlugin);
    } }, { key: "_setAppShowListener", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_setAppShowListener");
      ct2(this._pushPlugin.setAppShowListener) ? (new P2("_setAppShowListener").end(true), M2.l("".concat(n3, " start")), this._pushPlugin.setAppShowListener(function(e3) {
        e3 = (e3 || {}).appShow;
        new P2("setAppShowListenerRes").setMessage("appShow:".concat(e3)).end(true), M2.l("".concat(n3, " ok. appShow:").concat(e3)), t3._m.isReady() && (0 === e3 ? (t3._getConvUnreadCount(), t3._onBackground()) : 1 === e3 && t3._onForeground());
      })) : M2.e("".concat(this._pluginName, ".setAppShowListener is not a function"));
    } }, { key: "_setPushEventReportListener", value: function() {
      var s4 = this, a3 = "".concat(this._n, ".").concat("_setPushEventReportListener");
      ct2(this._pushPlugin.setPushEventReportListener) ? (new P2("_setPushEventReportListener").end(true), this._pushPlugin.setPushEventReportListener(function(e3) {
        var t3 = e3.code, n3 = e3.data, o3 = n3.eventList, i4 = new P2("setPushEventReportListenerRes");
        i4.setCode(t3), 0 === t3 ? (t3 = "eventList:".concat(JSON.stringify(o3)), M2.l("".concat(a3, " ok. ").concat(t3)), i4.setMessage(t3).end(true), s4._m.isReady() && O2(o3) && 0 < o3.length && s4._pushReport(n3)) : (i4.setMessage("res:".concat(JSON.stringify(e3))).end(true), M2.e("".concat(a3, " failed. error:").concat(JSON.stringify(e3))));
      })) : M2.e("".concat(this._pluginName, ".setPushEventReportListener is not a function"));
    } }, { key: "getDeviceBrand", value: function() {
      var e3;
      if (!N3(this._pushPlugin) && ct2(this._pushPlugin.getDeviceType))
        return e3 = (this._pushPlugin.getDeviceType() || {}).deviceType, M2.l("".concat(this._n, ".getDeviceBrand ok. deviceType:").concat(e3)), e3;
    } }, { key: "_setToken", value: function() {
      var t3 = "".concat(this._n, ".").concat("_setToken"), e3 = this.get(12), n3 = 1, o3 = "", i4 = "", s4 = (S2(this._deviceToken) && (n3 = 0), this.getUniAppPlatform()), a3 = this.getDeviceBrand(), s4 = (s4 === te2.IOS || s4 === te2.IPAD || s4 === te2.MAC ? i4 = this._deviceToken : s4 === te2.ANDROID && (o3 = this._deviceToken), y2({ tokenID: o3, pushMsg: n3, sdkAppID: e3.getSDKAppID(), businessID: parseInt(this._businessID), deviceBrand: a3, deviceToken: i4, isWebUniapp: this._isWebUniapp }, this._deviceInfo)), r4 = new P2("_setToken"), o3 = "data:".concat(JSON.stringify(s4));
      r4.setMessage("".concat(o3)), M2.l("".concat(t3, " ").concat(o3)), this.req({ P: G2.SET_TOKEN, data: s4 }).then(function() {
        r4.end(), M2.w("".concat(t3, " ok"));
      }).catch(function(e4) {
        r4.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_getConvUnreadCount", value: function() {
      var t3 = this;
      this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this.get(11).getLocalConvList().forEach(function(e3) {
        e3.type === R2.CONV_C2C && (t3._c2cUnreadCount += e3.unreadCount), e3.type === R2.CONV_GROUP && (t3._groupUnreadCount += e3.unreadCount);
      });
    } }, { key: "_onBackground", value: function() {
      var e3 = this, t3 = "".concat(this._n, ".").concat("_onBackground"), n3 = new P2("_onBackground");
      this.req({ P: G2.STAT_BACKGROUND, data: { c2cUnreadCount: this._c2cUnreadCount, groupUnreadCount: this._groupUnreadCount, isWebUniapp: this._isWebUniapp } }).then(function() {
        n3.setMessage("c2cUnreadCount:".concat(e3._c2cUnreadCount, " groupUnreadCount:").concat(e3._groupUnreadCount)).end(), M2.l("".concat(t3, " ok"));
      }).catch(function(e4) {
        n3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4);
      });
    } }, { key: "_onForeground", value: function() {
      var t3 = "".concat(this._n, ".").concat("_onForeground"), n3 = new P2("_onForeground");
      this.req({ P: G2.STAT_FOREGROUND, data: { isWebUniapp: this._isWebUniapp } }).then(function() {
        n3.end(), M2.l("".concat(t3, " ok"));
      }).catch(function(e3) {
        n3.setError(e3).end(), M2.e("".concat(t3, " failed. error:"), e3);
      });
    } }, { key: "_pushReport", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_pushReport"), o3 = new P2("_pushReport");
      this.req({ P: G2.PUSH_REPORT, data: { eventList: e3.eventList } }).then(function() {
        o3.end(), t3._notifyReportSuccess(e3);
      }).catch(function(e4) {
        o3.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4);
      });
    } }, { key: "_notifyReportSuccess", value: function(e3) {
      !N3(this._pushPlugin) && ct2(this._pushPlugin.notifyReportSuccess) && (this._pushPlugin.notifyReportSuccess(e3), M2.l("".concat(this._n, "._notifyReportSuccess ok")));
    } }, { key: "getUniAppPlatform", value: function() {
      var e3 = index.getSystemInfoSync().platform, t3 = this.getDeviceBrand();
      return "ios" === e3 ? te2.IOS : "android" === e3 ? te2.ANDROID : 1002 === t3 ? te2.IPAD : 1001 === t3 ? te2.MAC : void 0;
    } }, { key: "reset", value: function() {
      this._deviceToken = "", this._businessID = 0, this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this._isWebUniapp = 0, M2.l("".concat(this._n, ".reset"));
    } }])), Js = (t2(la, c2), e2(la, [{ key: "init", value: function() {
      var e3 = this.get(18).getPlugin("tim-profanity-filter-plugin");
      e3 && (this._plugin = new e3({ logger: M2, isArray: O2, isMap: ot2, isDevMode: this.isDevMode() }), this._getLexicon());
    } }, { key: "onCheckTimer", value: function() {
      this._plugin && this._canIUseLexicon && this.isLoggedIn() && !this._isFetching && Date.now() >= this._expiredTime && this._getLexicon();
    } }, { key: "filterMessage", value: function(e3, t3) {
      var n3 = true;
      if (this._plugin && this._canIUseLexicon && (!t3 || !t3.messageControlInfo || true !== t3.messageControlInfo.excludedFromContentModeration)) {
        var t3 = e3.type, o3 = e3.conversationType;
        if (t3 === R2.MSG_TEXT || t3 === R2.MSG_CUSTOM) {
          var i4, s4 = "".concat(this._n, ".filterMessage");
          if (M2.l("".concat(s4)), t3 === R2.MSG_TEXT) {
            if (o3 === R2.CONV_C2C ? i4 = "c2c_text_message" : o3 === R2.CONV_GROUP && (i4 = "group_text_message"), !this._isConfigOn(i4))
              return n3;
            var a3 = this._plugin.filter(e3.payload.text), r4 = a3.type, a3 = a3.modifiedText;
            1 === r4 ? n3 = false : 2 === r4 && (e3.payload.text = a3);
          } else if (t3 === R2.MSG_CUSTOM) {
            if (o3 === R2.CONV_C2C ? i4 = "c2c_custom_message" : o3 === R2.CONV_GROUP && (i4 = "group_custom_message"), !this._isConfigOn(i4))
              return n3;
            r4 = this._plugin.filter(e3.payload.data), a3 = this._plugin.filter(e3.payload.description), t3 = this._plugin.filter(e3.payload.extension);
            1 === r4.type || 1 === a3.type || 1 === t3.type ? n3 = false : (2 === r4.type && (e3.payload.data = r4.modifiedText), 2 === a3.type && (e3.payload.description = a3.modifiedText), 2 === t3.type && (e3.payload.extension = t3.modifiedText));
          }
          M2.l("".concat(s4, " done. isAllowedToSend:").concat(n3));
        }
      }
      return n3;
    } }, { key: "filterText", value: function(e3, t3) {
      var n3 = "".concat(this._n, ".filterText"), o3 = { isAllowedToSend: true, modifiedText: e3 };
      return this._plugin && this._canIUseLexicon && this._isConfigOn(t3) && (M2.l("".concat(n3)), e3 = (t3 = this._plugin.filter(e3)).type, t3 = t3.modifiedText, 1 === e3 ? o3.isAllowedToSend = false : 2 === e3 && (o3.modifiedText = t3), M2.l("".concat(n3, " done. ret:"), o3)), o3;
    } }, { key: "_getLexicon", value: function() {
      var l3 = this, d3 = new P2("profanityFilter"), p4 = "".concat(this._n, "._getLexicon");
      this._isFetching = true, this.req({ P: G2.GET_PROFANITY_LIST, data: { startIndex: this._startIndex, version: this._version } }).then(function(e3) {
        var e3 = e3.data, t3 = e3.errorInfo, n3 = e3.filterConfig, o3 = e3.lexicon, i4 = e3.strToken, s4 = e3.completeFlag, a3 = e3.nextStartIndex, r4 = e3.version, e3 = e3.expiredTime, c3 = t3.errorCode, u3 = t3.errorMessage;
        return 0 !== c3 ? (l3._isFetching = false, M2.w("".concat(p4, " failed. error:"), t3), void d3.setCode(c3).setMessage(u3).end()) : (l3._onFilterConfig(n3), l3._getToken(i4), 1 === s4 ? (M2.l("".concat(p4, " done. version:").concat(r4, " expiredTime:").concat(e3)), l3._version = r4, l3._canIUseLexicon = true, l3._isFetching = false, l3._expiredTime = Date.now() + 1e3 * e3, void l3._plugin.onLexiconCompleted(o3)) : (l3._startIndex = a3, l3._plugin.onLexiconSliced(o3), void l3._getLexicon()));
      }).catch(function(e3) {
        d3.setError(e3).end(), l3._isFetching = false, M2.l("".concat(p4, " failed. error:"), e3);
      });
    } }, { key: "_onFilterConfig", value: function(t3) {
      var n3 = this;
      S2(t3) || (this._filterConfigMap.clear(), Object.keys(t3).forEach(function(e3) {
        n3._filterConfigMap.set(e3, t3[e3]);
      }), M2.l("".concat(this._n, "._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys()), " values:").concat(Array.from(this._filterConfigMap.values()))));
    } }, { key: "_isConfigOn", value: function(e3) {
      return 1 === this._filterConfigMap.get(e3);
    } }, { key: "_getToken", value: function(e3) {
      if (C2(e3)) {
        var t3 = e3.length, n3 = "";
        if (t3 % 2 == 0)
          for (var o3 = 0; o3 <= t3 - 1; o3 += 2)
            n3 = (n3 += e3[o3 + 1]) + e3[o3];
        else {
          for (var i4 = 0; i4 < t3 - 1; i4 += 2)
            n3 = (n3 += e3[i4 + 1]) + e3[i4];
          n3 += e3[t3 - 1];
        }
        this._plugin.onToken(n3);
      }
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._plugin && (this._plugin.reset(), this._plugin = null), this._filterConfigMap.clear(), this._startIndex = 0, this._version = 0, this._canIUseLexicon = false, this._isFetching = false, this._expiredTime = 0;
    } }])), zs = e2(function e3(t3) {
      p3(this, e3), this._m = t3, this._n = "TransCmdModule", this._TRTCCommandList = ["tui_room_svr.*", "callkit_records_svr.*", "room_engine_srv.*", "room_engine_http_srv.*", "room_engine_mic.*", "live_engine_srv.*", "live_engine_http_srv.*", "live_engine_pk.*", "trtc_ai_service.*", "call_engine_srv.*"], this._TRTCCommandMap = /* @__PURE__ */ new Map(), this._setTRTCCommandMap(), this._m.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var t3 = this, e3 = this._m.get(23).getCloudConfig("rtc_cmd");
      N3(e3) || ((e3 = JSON.parse(e3)).forEach(function(e4) {
        t3._TRTCCommandList.includes(e4) || t3._TRTCCommandList.push(e4);
      }), this._setTRTCCommandMap());
    } }, { key: "_setTRTCCommandMap", value: function() {
      for (var e3, t3 = 0, n3 = this._TRTCCommandList.length; t3 < n3; t3++)
        e3 = this._TRTCCommandList[t3].split(".")[0], this._TRTCCommandMap.set(e3, 1);
    } }, { key: "onRoomCustomDataReceived", value: function(e3) {
      this._m.getOEmitInst().emit(h2.ROOM_CUSTOM_DATA_RECEIVED, e3);
    } }, { key: "sendTRTCCustomData", value: function(e3) {
      var t3 = e3.serviceCommand, e3 = e3.data, n3 = "".concat(s3.NAME.TUIROOM_SVR, ".*");
      return N3(t3) || (n3 = t3), this._isValidServiceCommand(n3) ? this._trans({ servcmd: n3, data: e3 }) : E2({ code: k2.INVALID_TRTC_CMD });
    } }, { key: "_trans", value: function(e3) {
      M2.d("".concat(this._n, "._trans. options:").concat(JSON.stringify(e3)));
      var t3 = e3.servcmd, e3 = e3.data;
      return this._m.get(20).trans({ servcmd: t3, data: C2(e3) ? JSON.parse(e3) : e3 });
    } }, { key: "_isValidServiceCommand", value: function(e3) {
      return e3.endsWith(".*") ? this._TRTCCommandList.includes(e3) : (e3 = e3.split(".")[0], this._TRTCCommandMap.has(e3));
    } }, { key: "isTRTCCommand", value: function(e3) {
      e3 = e3.split(".")[0];
      return this._TRTCCommandMap.has(e3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }]), Xs = e2(function e3(t3) {
      p3(this, e3), this._m = t3, this._n = "ErrMsgModule", this.TIM_ERROR_ASSISTANCE = "tim_error_assistance", this.STORAGE_EXPIRES_TIME = 6048e5, this._map = /* @__PURE__ */ new Map(), this._init();
    }, [{ key: "_init", value: function() {
      var e3, t3 = this._getStorageModule().getItem(this.TIM_ERROR_ASSISTANCE, false);
      if (t3) {
        try {
          e3 = JSON.parse(t3);
        } catch (e4) {
          this._getStorageModule().removeItem(this.TIM_ERROR_ASSISTANCE, false), M2.w("".concat(this._n, "._init error:"), e4);
        }
        e3 && (this._needToUpdate(e3) ? this._fetch() : this._fillMap(e3.message));
      } else
        this._fetch();
    } }, { key: "_needToUpdate", value: function(e3) {
      var t3 = e3.localSavedTime, e3 = e3.localSavedVersion, t3 = t3 && (/* @__PURE__ */ new Date()).getTime() - t3 >= this.STORAGE_EXPIRES_TIME, e3 = !e3 || "3.5.4" !== e3;
      return M2.l("".concat(this._n, "._needToUpdate isTimeout:").concat(t3, " isDifferentVersion:").concat(e3)), t3 || e3;
    } }, { key: "_fetch", value: function() {
      var e3, t3, n3, o3, i4, s4;
      this._m.get(12).isPrivateNetWork() || (e3 = "https://web.sdk.qcloud.com/im/download/error-message/v3/0.0.7/tim-error-message.txt", t3 = "application/x-www-form-urlencoded;charset=UTF-8", n3 = "".concat(this._n, "._fetch ok in"), o3 = this, v3 ? I2.request({ url: e3, method: "GET", timeout: 3e3, header: { "content-type": t3 }, dataType: "text", success: function(e4) {
        o3._fillAndSave(e4.data), M2.l("".concat(n3, " mini program"));
      }, fail: function() {
      } }) : (i4 = new XMLHttpRequest(), s4 = setTimeout(function() {
        i4.abort();
      }, 3e3), i4.onreadystatechange = function() {
        4 === i4.readyState && (s4 && clearTimeout(s4), 200 !== i4.status && 304 !== i4.status || (M2.l("".concat(n3, " browser")), o3._fillAndSave(i4.responseText)));
      }, i4.open("GET", e3, true), i4.setRequestHeader("Content-type", t3), i4.send()));
    } }, { key: "_fillAndSave", value: function(e3) {
      this._fillMap(e3), this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE, JSON.stringify({ message: e3, localSavedTime: (/* @__PURE__ */ new Date()).getTime(), localSavedVersion: "3.5.4" }), true, false);
    } }, { key: "_getStorageModule", value: function() {
      return this._m.get(13);
    } }, { key: "_fillMap", value: function(e3) {
      this._map.clear();
      for (var t3, n3, o3 = e3.split(";\n"), i4 = o3.length, s4 = new RegExp(/'/g), a3 = 0; a3 < i4; a3++)
        if (n3 = o3[a3].indexOf(":"), t3 = o3[a3].slice(0, n3), n3 = o3[a3].slice(n3 + 1, o3[a3].length), !t3.startsWith("//")) {
          if (N3(n3))
            continue;
          this._map.set(t3, n3.replace(s4, ""));
        }
    } }, { key: "get", value: function(e3) {
      var t3 = e3.isIntl, n3 = e3.key, o3 = e3.replacement1, e3 = e3.replacement2, t3 = "".concat(n3, t3 ? "_en" : "_cn"), n3 = (!this._map.has(t3) && this._map.has(n3) && (t3 = n3), "");
      return this._map.has(t3) && (n3 = this._map.get(t3), N3(o3) || (n3 = n3.replace("$replacement1", o3)), N3(e3) || (n3 = n3.replace("$replacement2", e3))), n3;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }]), Zs = e2(function e3(t3) {
      p3(this, e3), this._n = "RemoteSignalingHandler", this._sigM = t3;
    }, [{ key: "onNewMessageList", value: function(e3) {
      var n3 = this;
      e3.forEach(function(e4) {
        var t3 = n3.getPayloadData(e4);
        t3 && n3._handleActionType(t3, e4);
      });
    } }, { key: "onMessageModified", value: function(e3) {
      var n3 = this;
      e3.forEach(function(e4) {
        var t3 = n3.getPayloadData(e4);
        t3 && n3._onInvitationModified(t3, e4);
      });
    } }, { key: "getPayloadData", value: function(t3) {
      var n3 = "".concat(this._n, ".getPayloadData"), t3 = t3.payload.data;
      try {
        return JSON.parse(t3);
      } catch (e3) {
        return M2.e("".concat(n3, " JSON parse error. signalingData:").concat(t3)), null;
      }
    } }, { key: "_handleActionType", value: function(e3, t3) {
      switch (e3.actionType) {
        case _2.ACTION_TYPE_INVITE:
          this._onNewInvitationReceived(e3, t3);
          break;
        case _2.ACTION_TYPE_REJECT_INVITE:
          this._onInviteeRejected(e3);
          break;
        case _2.ACTION_TYPE_ACCEPT_INVITE:
          this._onInviteeAccepted(e3);
          break;
        case _2.ACTION_TYPE_CANCEL_INVITE:
          this._onInvitationCancelled(e3);
          break;
        case _2.ACTION_TYPE_INVITE_TIMEOUT:
          this._onInvitationTimeout(e3);
      }
    } }, { key: "_genBaseEmitData", value: function(e3) {
      return { inviteID: e3.inviteID, inviter: e3.inviter, groupID: e3.groupID, data: e3.data || "" };
    } }, { key: "_onNewInvitationReceived", value: function(e3, t3) {
      var n3 = "".concat(this._n, "._onNewInvitationReceived"), o3 = e3.inviteID, i4 = e3.inviteeList, s4 = e3.groupID, a3 = e3.inviter, r4 = this._sigM.getMyUserID(), c3 = i4.includes(r4), u3 = e3.timeout, l3 = (Fe2().getTime() - 1e3 * t3.time) / 1e3, n3 = (0 < u3 && 0 < l3 && l3 < u3 && (u3 -= l3), "".concat(n3, " myselfIncluded:").concat(c3, " groupID:").concat(s4, " signalObj:").concat(JSON.stringify(e3)));
      M2.l("".concat(n3, " timeout:").concat(u3, "s delta:").concat(l3, "s")), !(s4 && c3 || !s4) || (n3 = this._sigM.getInviteInfo(o3)) && n3 === e3 || (n3 || this._sigM.setInviteInfo(o3, y2(y2({}, e3), {}, { message: t3 })), this._sigM.emitEvent(_2.NEW_INVITATION_RECEIVED, y2(y2({}, this._genBaseEmitData(e3)), {}, { inviteeList: i4 })), a3 !== r4 && this._sigM.startTimer(y2(y2({}, e3), {}, { timeout: u3 })));
    } }, { key: "_onInviteeRejected", value: function(e3) {
      var t3 = "".concat(this._n, "._onInviteeRejected"), n3 = e3.inviteID, o3 = e3.inviter, i4 = e3.groupID, s4 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(s4, " inviter:").concat(o3, " groupID:").concat(i4)), s4 && (this._sigM.updateInviteInfo(e3), this._sigM.emitEvent(_2.INVITEE_REJECTED, y2(y2({}, this._genBaseEmitData(e3)), {}, { invitee: e3.inviteeList[0] })));
    } }, { key: "_onInviteeAccepted", value: function(e3) {
      var t3 = "".concat(this._n, "._onInviteeAccepted"), n3 = e3.inviteID, o3 = e3.inviter, i4 = e3.groupID, s4 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(s4, " inviter:").concat(o3, " groupID:").concat(i4)), s4 && (this._sigM.updateInviteInfo(e3), this._sigM.emitEvent(_2.INVITEE_ACCEPTED, y2(y2({}, this._genBaseEmitData(e3)), {}, { invitee: e3.inviteeList[0] })));
    } }, { key: "_onInvitationCancelled", value: function(e3) {
      var t3 = "".concat(this._n, "._onInvitationCancelled"), n3 = e3.inviteID, o3 = e3.inviter, i4 = e3.groupID, s4 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(s4, " inviter:").concat(o3, " groupID:").concat(i4)), s4 && (this._sigM.deleteInviteInfo(n3), this._sigM.emitEvent(_2.INVITATION_CANCELLED, this._genBaseEmitData(e3)));
    } }, { key: "_onInvitationTimeout", value: function(e3) {
      var t3 = "".concat(this._n, "._onInvitationTimeout"), n3 = e3.inviteID, o3 = e3.inviter, i4 = e3.groupID, s4 = e3.inviteeList, a3 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(a3, " inviter:").concat(o3, " groupID:").concat(i4, "  data:").concat(e3.data)), a3 && (this._sigM.updateInviteInfo(e3), this._sigM.emitEvent(_2.INVITATION_TIMEOUT, y2(y2({}, this._genBaseEmitData(e3)), {}, { inviteeList: s4, isSelfTimeout: false })));
    } }, { key: "_onInvitationModified", value: function(e3, t3) {
      var n3 = "".concat(this._n, "._onInvitationModified"), o3 = e3.inviteID, i4 = e3.data, s4 = this._sigM.hasInviteInfo(o3);
      M2.l("".concat(n3, " inviteID:").concat(o3, " hasInviteID:").concat(s4, " data:").concat(i4)), s4 && (this._sigM.setInviteInfo(o3, y2(y2({}, e3), {}, { message: t3 })), this._sigM.emitEvent(_2.INVITATION_MODIFIED, { inviteID: o3, data: i4 }));
    } }]), Qs = e2(function e3(t3) {
      p3(this, e3), this._n = "LocalSignalingHandler", this._sigM = t3;
    }, [{ key: "generateInviteID", value: function() {
      var e3, t3 = (t3 = Ss)((e3 = Ls)(32), 8) + "-" + t3(e3(16), 4) + "-" + t3(16384 | e3(12), 4) + "-" + t3(32768 | e3(14), 4) + "-" + t3(e3(48), 12);
      return M2.l("".concat(this._n, ".generateInviteID inviteID:").concat(t3)), t3;
    } }, { key: "createInviteInfo", value: function(e3) {
      var t3 = this.generateInviteID(), e3 = this.createInviteCustomData(y2(y2({}, e3), {}, { inviteID: t3 })), n3 = e3.groupID, o3 = e3.inviteeList, n3 = n3 || o3[0];
      return { customData: e3, message: this._sigM.createSignaling(e3, n3), inviteID: t3 };
    } }, { key: "_genBaseCustomData", value: function(e3) {
      var t3 = e3.data, n3 = e3.inviteID, e3 = e3.groupID;
      return { businessID: 1, timeout: 0, data: void 0 === t3 ? "" : t3, inviteID: void 0 === n3 ? "" : n3, groupID: void 0 === e3 ? "" : e3 };
    } }, { key: "createInviteCustomData", value: function(e3) {
      var t3 = e3.userID, n3 = e3.timeout, n3 = void 0 === n3 ? 0 : n3, o3 = e3.groupID, o3 = void 0 === o3 ? "" : o3, i4 = this._sigM.getMyUserID(), i4 = y2(y2({}, this._genBaseCustomData(e3)), {}, { actionType: _2.ACTION_TYPE_INVITE, inviter: i4, inviteeList: o3 ? e3.inviteeList : [t3], timeout: n3 });
      return M2.l("".concat(this._n, ".createInviteCustomData customData:"), i4), i4;
    } }, { key: "createCancelCustomData", value: function(e3) {
      var t3, n3 = "".concat(this._n, ".createCancelCustomData"), o3 = e3.inviteID, i4 = this._sigM.getMyUserID(), o3 = this._sigM.getInviteInfo(o3), s4 = o3.inviteeList, a3 = o3.groupID, o3 = o3.inviter;
      return o3 === i4 ? t3 = y2(y2({}, this._genBaseCustomData(e3)), {}, { actionType: _2.ACTION_TYPE_CANCEL_INVITE, groupID: a3, inviter: i4, inviteeList: s4 }) : M2.e("".concat(n3, " unmatched inviter:").concat(o3, " and my userID:").concat(i4)), M2.l("".concat(n3, " customData:"), t3), t3;
    } }, { key: "createAcceptCustomData", value: function(e3) {
      var t3, n3 = "".concat(this._n, ".createAcceptCustomData"), o3 = e3.inviteID, i4 = this._sigM.getMyUserID(), s4 = this._sigM.getInviteInfo(o3), a3 = s4.inviter, r4 = s4.groupID;
      return s4.inviteeList.includes(i4) ? t3 = y2(y2({}, this._genBaseCustomData(e3)), {}, { actionType: _2.ACTION_TYPE_ACCEPT_INVITE, groupID: r4, inviter: a3, inviteeList: [i4] }) : M2.e("".concat(n3, " userID:").concat(i4, " not in inviteeList. inviteID:").concat(o3, " groupID:").concat(r4)), M2.l("".concat(n3, " customData:"), t3), t3;
    } }, { key: "createRejectCustomData", value: function(e3) {
      var t3, n3 = "".concat(this._n, ".createRejectCustomData"), o3 = e3.inviteID, i4 = this._sigM.getMyUserID(), s4 = this._sigM.getInviteInfo(o3), a3 = s4.inviter, r4 = s4.groupID;
      return s4.inviteeList.includes(i4) ? t3 = y2(y2({}, this._genBaseCustomData(e3)), {}, { actionType: _2.ACTION_TYPE_REJECT_INVITE, groupID: r4, inviter: a3, inviteeList: [i4] }) : M2.e("".concat(n3, " userID:").concat(i4, " not in inviteeList. inviteID:").concat(o3, " groupID:").concat(r4)), M2.l("".concat(n3, " customData:"), t3), t3;
    } }, { key: "createTimeoutCustomData", value: function(e3) {
      var t3 = "".concat(this._n, ".createTimeoutCustomData"), n3 = e3.inviteeList, o3 = e3.inviter, i4 = e3.isInviter, i4 = void 0 !== i4 && i4, s4 = this._sigM.getMyUserID(), e3 = y2(y2({}, this._genBaseCustomData(e3)), {}, { actionType: _2.ACTION_TYPE_INVITE_TIMEOUT, inviter: o3, inviteeList: i4 ? n3 : [s4] });
      return M2.l("".concat(t3, " customData:"), e3), e3;
    } }]), $s = e2(function e3(t3) {
      p3(this, e3), this._n = "HistorySignalingHandler", this._sigM = t3, this.COUNT = 20, this.EXPIRED_TIME = 300, this._map = /* @__PURE__ */ new Map(), this._relatedToMeMap = /* @__PURE__ */ new Map();
    }, [{ key: "setCloudConfig", value: function() {
      var e3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 20, t3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 300;
      this.COUNT = e3, this.EXPIRED_TIME = t3, M2.l("".concat(this._n, ".setCloudConfig count:").concat(e3, ", time:").concat(t3));
    } }, { key: "getHistorySignaling", value: function() {
      var t3 = this, e3 = this._sigM.get(11).getLocalConvList();
      S2(e3) || (this._getC2CSignalingList(), e3 = this._getValidGroupConvList(e3), this._getGroupSignalingList(e3).then(function(e4) {
        t3._handleSignalingList(e4);
      }));
    } }, { key: "_getC2CSignalingList", value: function() {
      var e3 = this._sigM.get(6).getMessageListFromUnreadDB(), e3 = this._sigM.filterMessageList(e3);
      this._getRelatedToMeMap(e3);
    } }, { key: "_getGroupSignalingList", value: function(e3) {
      var n3 = this, e3 = this._createPromiseList(e3);
      return 0 === e3.length ? Promise.resolve(this._sortSignaling(this._relatedToMeMap)) : this._concurrentGetMessageList(e3).then(function(e4) {
        var t3 = /* @__PURE__ */ new Map();
        return e4.forEach(function(e5) {
          e5 = e5.list, e5 = n3._getRelatedToMeMap(e5);
          t3 = new Map([].concat(d2(t3), d2(e5)));
        }), n3._sortSignaling(t3);
      });
    } }, { key: "_handleSignalingList", value: function(e3) {
      S2(e3) || this._sigM.onNewMessageList(e3);
    } }, { key: "_getValidGroupConvList", value: function(e3) {
      for (var t3 = [], n3 = 0, o3 = e3.length; n3 < o3; n3++) {
        var i4 = e3[n3], s4 = i4.type, a3 = i4.unreadCount, i4 = i4.lastMessage, s4 = s4 === R2.CONV_GROUP, i4 = this._isNotExpired(i4);
        s4 && a3 && i4 && t3.push(e3[n3]);
      }
      return t3;
    } }, { key: "_isNotExpired", value: function(e3) {
      return !(!e3 || !e3.lastTime) && e3.lastTime > xe2() - this.EXPIRED_TIME;
    } }, { key: "_createPromiseList", value: function(e3) {
      for (var t3 = [], n3 = 0; n3 < e3.length; n3++) {
        var o3 = e3[n3], i4 = o3.conversationID, o3 = o3.unreadCount, o3 = o3 < this.COUNT ? o3 : this.COUNT, o3 = (this._map.set(i4, { msgCount: o3, list: [] }), this._sigM.get(11).getMessageList({ conversationID: i4 }));
        t3.push(o3);
      }
      return t3;
    } }, { key: "_concurrentGetMessageList", value: function(e3) {
      var i4 = this, s4 = [];
      return Promise.all(e3).then(function(e4) {
        for (var t3 = 0; t3 < e4.length; t3++) {
          var n3 = e4[t3], o3 = n3.code, n3 = n3.data;
          0 === o3 && 0 !== n3.messageList.length && (i4._handleMessageList(n3.messageList), o3 = i4._relayGetMessageList(n3)) && s4.push(o3);
        }
        return 0 < s4.length ? i4._concurrentGetMessageList(s4) : i4._map;
      });
    } }, { key: "_relayGetMessageList", value: function(e3) {
      var t3, n3 = e3.messageList, o3 = e3.nextReqMessageID, e3 = e3.isCompleted;
      return 0 === n3.length || (n3 = n3[0].conversationID, 0 === (t3 = this._map.get(n3).msgCount)) || e3 ? null : this._sigM.get(11).getMessageList({ conversationID: n3, nextReqMessageID: o3, count: t3 });
    } }, { key: "_handleMessageList", value: function(e3) {
      var t3 = e3.length, n3 = e3[0].conversationID, o3 = this._map.get(n3), i4 = o3.msgCount, o3 = o3.list;
      this._map.set(n3, { msgCount: 0 < i4 - t3 ? i4 - t3 : 0, list: o3.concat(this._sigM.filterMessageList(e3)) });
    } }, { key: "_getRelatedToMeMap", value: function(e3) {
      for (var t3 = 0; t3 < e3.length; t3++) {
        var n3 = e3[t3];
        this._saveRelatedToMe(n3);
      }
      return this._relatedToMeMap;
    } }, { key: "_saveRelatedToMe", value: function(e3) {
      var t3 = this._sigM.getPayloadData(e3) || {}, n3 = t3.actionType, t3 = t3.inviteID, o3 = void 0 === t3 ? "" : t3;
      switch (void 0 === n3 ? "" : n3) {
        case _2.ACTION_TYPE_INVITE:
          this._setHistoryInvite(e3);
          break;
        case _2.ACTION_TYPE_REJECT_INVITE:
        case _2.ACTION_TYPE_ACCEPT_INVITE:
          this._updateHistoryInvite(e3);
          break;
        case _2.ACTION_TYPE_CANCEL_INVITE:
          this._delHistoryInvite(o3);
          break;
        case _2.ACTION_TYPE_INVITE_TIMEOUT:
          this._updateHistoryInvite(e3);
      }
    } }, { key: "_setHistoryInvite", value: function(e3) {
      var t3 = this._sigM.getPayloadData(e3) || {}, n3 = t3.inviteID, n3 = void 0 === n3 ? "" : n3, o3 = t3.inviteeList, o3 = void 0 === o3 ? [] : o3, i4 = t3.timeout, i4 = void 0 === i4 ? 0 : i4, s4 = this._sigM.getMyUserID();
      o3.includes(s4) && (o3 = xe2() - e3.time, 0 < i4 && i4 < o3 && 0 !== i4 || this._relatedToMeMap.set(n3, y2(y2({}, t3), {}, { messageList: [e3] })));
    } }, { key: "_delHistoryInvite", value: function(e3) {
      this._relatedToMeMap.has(e3) && this._relatedToMeMap.delete(e3);
    } }, { key: "_updateHistoryInvite", value: function(e3) {
      var t3 = this._sigM.getPayloadData(e3) || {}, n3 = t3.inviteID, n3 = void 0 === n3 ? "" : n3, t3 = t3.inviteeList, o3 = void 0 === t3 ? [] : t3;
      if (this._relatedToMeMap.has(n3)) {
        for (var t3 = this._relatedToMeMap.get(n3), i4 = t3.inviteeList, t3 = t3.messageList, s4 = 0; s4 < o3.length; s4++) {
          var a3 = o3[s4];
          i4.includes(a3) && i4.splice(i4.indexOf(a3), 1);
        }
        0 === i4.length ? this._delHistoryInvite(n3) : t3.push(e3);
      } else
        this._delHistoryInvite(n3);
    } }, { key: "_sortSignaling", value: function(e3) {
      var t3 = [];
      return e3.forEach(function(e4) {
        t3 = [].concat(d2(t3), d2(e4.messageList));
      }), t3.sort(function(e4, t4) {
        return e4.time - t4.time;
      });
    } }, { key: "reset", value: function() {
      this._map.clear(), this._relatedToMeMap.clear();
    } }]), ea = e2(function e3(t3, n3) {
      p3(this, e3), this.businessID = t3.businessID || 1, this.inviteID = t3.inviteID, this.groupID = t3.groupID || "", this.inviter = t3.inviter || "", this.inviteeList = t3.inviteeList || [], this.data = t3.data || "", this.actionType = t3.actionType || _2.ACTION_TYPE_INVITE, this.timeout = t3.timeout || 0;
    }), ta = ["message"], na = ["message"], oa = (t2(ua, c2), e2(ua, [{ key: "onC2CUnreadHandleCompleted", value: function() {
      this._isC2CUnreadHandleCompleted = true, this._isCloudConfigCompleted && this._isConvSyncCompleted && !this._isSyncCompleted && this.onReady();
    } }, { key: "onConvSyncCompleted", value: function() {
      this._isConvSyncCompleted = true, this._isC2CUnreadHandleCompleted && this._isCloudConfigCompleted && !this._isSyncCompleted && this.onReady();
    } }, { key: "onCloudConfig", value: function() {
      this._isCloudConfigCompleted = true;
      var e3 = this.getCloudConfig("history_s_count"), t3 = this.getCloudConfig("history_s_time");
      N3(e3) || (e3 = Number(e3)), N3(t3) || (t3 = Number(t3)), this._historySignalingHandler.setCloudConfig(e3, t3), this._isC2CUnreadHandleCompleted && this._isConvSyncCompleted && !this._isSyncCompleted && this.onReady();
    } }, { key: "_isListenerExisted", value: function() {
      return -1 < this._m.getOEmitInst().eventNames().indexOf(_2.NEW_INVITATION_RECEIVED);
    } }, { key: "onReady", value: function() {
      this._isSyncCompleted = true;
      var e3 = this._isListenerExisted();
      M2.l("".concat(this._n, ".onReady. isListenerExisted: ").concat(e3)), e3 && this._historySignalingHandler.getHistorySignaling();
    } }, { key: "onNewMessageList", value: function(e3) {
      e3 = this.filterMessageList(e3);
      if (0 < e3.length)
        return this._remoteSignalingHandler.onNewMessageList(e3);
    } }, { key: "onMessageModified", value: function(e3) {
      e3 = this.filterMessageList(e3);
      if (0 < e3.length)
        return this._remoteSignalingHandler.onMessageModified(e3);
    } }, { key: "hasInviteInfo", value: function(e3) {
      return this._inviteInfoMap.has(e3);
    } }, { key: "getInviteInfo", value: function(e3) {
      return this._inviteInfoMap.get(e3);
    } }, { key: "setInviteInfo", value: function(e3, t3) {
      var n3 = t3.message, t3 = W2(t3, ta);
      M2.l("".concat(this._n, ".setInviteInfo inviteID:").concat(e3, " data:"), t3), this._inviteInfoMap.set(e3, y2(y2({}, t3), {}, { message: n3 }));
    } }, { key: "deleteInviteInfo", value: function(e3) {
      this.hasInviteInfo(e3) && (M2.l("".concat(this._n, ".deleteInviteInfo inviteID:").concat(e3, ".")), this._inviteInfoMap.delete(e3));
    } }, { key: "updateInviteInfo", value: function(e3) {
      var t3 = "".concat(this._n, ".updateInviteInfo"), n3 = e3.inviteID, o3 = e3.inviter, i4 = e3.inviteeList, e3 = e3.groupID;
      M2.l("".concat(t3, " inviteID:").concat(n3, " inviter:").concat(o3, " groupID:").concat(e3)), e3 && this.hasInviteInfo(n3) && (o3 = i4[0], (e3 = this.getInviteInfo(n3).inviteeList).includes(o3) && (e3.splice(e3.indexOf(o3), 1), M2.l("".concat(t3, " remove ").concat(o3, ". localInviteeList.length:").concat(e3.length))), 0 !== e3.length) || this.deleteInviteInfo(n3);
    } }, { key: "canIUseSignaling", value: function() {
      return this._canIUseSignaling;
    } }, { key: "emitEvent", value: function(e3, t3) {
      this.emitOEvt(e3, t3);
    } }, { key: "addSignalingListener", value: function(e3, t3, n3) {
      this._canIUseSignaling || (this._canIUseSignaling = true), this._m.getOEmitInst().on(e3, t3, n3);
    } }, { key: "removeSignalingListener", value: function(e3, t3, n3) {
      this._m.getOEmitInst().off(e3, t3, n3), this._isListenerExisted() || (this._canIUseSignaling = false);
    } }, { key: "invite", value: function(e3) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("invite"), o3 = this._localSignalingHandler.createInviteInfo(e3), i4 = o3.message, s4 = o3.customData, a3 = o3.inviteID;
      return M2.l("".concat(n3, " options:").concat(JSON.stringify(e3), " inviteID:").concat(a3)), this.sendSignaling(i4, e3).then(function(e4) {
        return e4 && 0 === e4.code ? (t3.setInviteInfo(a3, y2(y2({}, s4), {}, { message: i4 })), t3.startTimer(y2(y2({}, s4), {}, { inviteID: a3 })), y2(y2({}, e4), {}, { inviteID: a3 })) : e4;
      }).catch(function(e4) {
        return E2(e4);
      });
    } }, { key: "inviteSync", value: function(e3, t3, n3) {
      var o3 = this, i4 = "".concat(this._n, ".").concat("inviteSync"), s4 = this._localSignalingHandler.createInviteInfo(e3), a3 = s4.message, r4 = s4.customData, c3 = s4.inviteID;
      return M2.l("".concat(i4, " options:").concat(JSON.stringify(e3), " inviteID:").concat(c3)), this.sendSignaling(a3, e3).then(function(e4) {
        if (e4 && 0 === e4.code)
          return o3.setInviteInfo(c3, y2(y2({}, r4), {}, { message: a3 })), o3.startTimer(y2(y2({}, r4), {}, { inviteID: c3 })), t3 && t3({ inviteID: c3 }), { inviteID: c3 };
        n3 && n3(0 === e4.code, e4.message || "");
      }).catch(function(e4) {
        return n3 && n3(e4.code, e4.message), E2(e4);
      }), c3;
    } }, { key: "_handleImResponse", value: function(e3, t3, n3) {
      t3 && 0 === t3.code && (this._isHandling = false, n3 ? this.deleteInviteInfo(e3.inviteID) : this.updateInviteInfo(e3));
    } }, { key: "cancel", value: function(t3) {
      var n3 = this, e3 = "".concat(this._n, ".").concat("cancel");
      if (M2.l("".concat(e3, " options:").concat(JSON.stringify(t3))), !this.hasInviteInfo(t3.inviteID) || this._isHandling)
        return E2({ code: k2.INVALID_CANCEL_MESSAGE });
      this._isHandling = true;
      var o3, i4 = this._localSignalingHandler.createCancelCustomData(t3);
      return i4 ? (e3 = i4.groupID, o3 = i4.inviteeList, e3 = e3 || o3[0], o3 = this.createSignaling(i4, e3), this.sendSignaling(o3, t3).then(function(e4) {
        return n3._handleImResponse(i4, e4, true), 0 === e4.code ? y2(y2({}, e4), {}, { inviteID: t3.inviteID }) : e4;
      }).catch(function(e4) {
        return E2(e4);
      })) : (this._isHandling = false, E2({ code: k2.SIGNALING_NO_PERMISSION }));
    } }, { key: "accept", value: function(t3) {
      var n3 = this, e3 = "".concat(this._n, ".").concat("accept");
      if (M2.l("".concat(e3, " options:").concat(JSON.stringify(t3))), !this.hasInviteInfo(t3.inviteID) || this._isHandling)
        return E2({ code: k2.SIGNALING_INVALID_INVITE_ID });
      this._isHandling = true;
      var o3 = this._localSignalingHandler.createAcceptCustomData(t3);
      return o3 ? (e3 = this.createSignaling(o3), this.sendSignaling(e3, t3).then(function(e4) {
        return n3._handleImResponse(o3, e4), 0 === e4.code ? y2(y2({}, e4), {}, { inviteID: t3.inviteID }) : e4;
      }).catch(function(e4) {
        return E2(e4);
      })) : (this._isHandling = false, E2({ code: k2.SIGNALING_NO_PERMISSION }));
    } }, { key: "reject", value: function(t3) {
      var n3 = this, e3 = "".concat(this._n, ".").concat("reject");
      if (M2.l("".concat(e3, " options:").concat(JSON.stringify(t3))), !this.hasInviteInfo(t3.inviteID) || this._isHandling)
        return E2({ code: k2.SIGNALING_INVALID_INVITE_ID });
      this._isHandling = true;
      var o3 = this._localSignalingHandler.createRejectCustomData(t3);
      return o3 ? (e3 = this.createSignaling(o3), this.sendSignaling(e3, t3).then(function(e4) {
        return n3._handleImResponse(o3, e4, true), 0 === e4.code ? y2(y2({}, e4), {}, { inviteID: t3.inviteID }) : e4;
      }).catch(function(e4) {
        return E2(e4);
      })) : (this._isHandling = false, E2({ code: k2.SIGNALING_NO_PERMISSION }));
    } }, { key: "getSignalingInfo", value: function(e3) {
      var t3 = "".concat(this._n, ".getSignalingInfo"), n3 = e3.ID, o3 = e3.from, i4 = e3.to, s4 = this._filterSignaling(e3), a3 = null, e3 = (s4 && (e3 = this.getPayloadData(e3), a3 = new ea(e3)), s4 ? "actionType:".concat(a3.actionType) : "");
      return M2.l("".concat(t3, " messageID:").concat(n3, " from:").concat(o3, " to:").concat(i4, " ") + "".concat(e3, " isSignaling:").concat(s4)), a3;
    } }, { key: "modifyInvitation", value: function(e3) {
      var t3, n3, o3, i4, s4 = this, a3 = e3.inviteID, e3 = e3.data;
      return this.hasInviteInfo(a3) ? (t3 = this.getInviteInfo(a3), n3 = t3.message, o3 = W2(t3, na), i4 = n3.payload.data, o3.data = e3, n3.payload.data = JSON.stringify(o3), this.get(2).modifyRemoteMessage(n3).then(function(e4) {
        return s4.hasInviteInfo(a3) && s4.setInviteInfo(a3, y2(y2({}, o3), {}, { message: n3 })), e4;
      }).catch(function(e4) {
        return n3.payload.data = i4, E2(e4);
      })) : E2({ code: k2.SIGNALING_INVALID_INVITE_ID });
    } }, { key: "_genMsgCtrlInfo", value: function() {
      var e3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t3 = e3.data, t3 = void 0 === t3 ? "" : t3, n3 = e3.onlineUserOnly, o3 = e3.inviteID, o3 = void 0 === o3 ? "" : o3, i4 = e3.offlinePushInfo, e3 = e3.actionType, s4 = { _onlineOnlyFlag: false }, o3 = { onlineUserOnly: (s4 = o3 && this.getInviteInfo(o3) ? this.getInviteInfo(o3).message : s4)._onlineOnlyFlag || n3 || false, offlinePushInfo: i4, messageControlInfo: { excludedFromContentModeration: true, excludedFromUnreadCount: false, excludedFromLastMessage: false } };
      return e3 === _2.ACTION_TYPE_INVITE_TIMEOUT ? (s4 = !!t3.match(/excludeTimeoutSignalingFromHistoryMessage/), o3.messageControlInfo.excludedFromUnreadCount = s4, o3.messageControlInfo.excludedFromLastMessage = s4) : (n3 = !!t3.match(/excludeFromHistoryMessage/), i4 = !!t3.match(/excludeOriginalSignalingFromHistoryMessage/), o3.messageControlInfo.excludedFromUnreadCount = n3 || i4, o3.messageControlInfo.excludedFromLastMessage = n3 || i4), o3;
    } }, { key: "sendSignaling", value: function(e3, t3) {
      var n3 = this;
      return this.get(2).sendMessageInstance(e3, this._genMsgCtrlInfo(t3)).catch(function(e4) {
        return n3._isHandling = false, E2(e4);
      });
    } }, { key: "filterMessageList", value: function(e3) {
      var t3 = this;
      return e3.filter(function(e4) {
        return t3._filterSignaling(e4);
      });
    } }, { key: "getPayloadData", value: function(e3) {
      return this._remoteSignalingHandler.getPayloadData(e3);
    } }, { key: "createSignaling", value: function(e3, t3) {
      var n3 = e3.groupID, o3 = e3.inviter, t3 = { to: t3 || n3 || o3, conversationType: n3 ? R2.CONV_GROUP : R2.CONV_C2C, priority: R2.MSG_PRIORITY_HIGH, payload: { data: JSON.stringify(e3) } }, o3 = this.get(2).createCustomMessage(t3);
      return M2.l("".concat(this._n, ".createSignaling. message:"), o3), o3;
    } }, { key: "_filterSignaling", value: function(e3) {
      var t3, n3, o3 = false;
      return e3.type && e3.type === R2.MSG_CUSTOM && (t3 = e3.cloudCustomData, e3 = void 0 === (e3 = e3.payload.data) ? "" : e3, t3 = (void 0 === t3 ? "" : t3).match(/"type":"tsignaling"/), n3 = e3.match(/inviteID/), e3 = e3.match(/actionType/), o3 = t3 || n3 && e3), !!o3;
    } }, { key: "startTimer", value: function(t3) {
      var n3, o3, i4, s4 = this, a3 = "".concat(this._n, ".startTimer"), e3 = t3.timeout, r4 = t3.inviteID, c3 = t3.inviter, u3 = t3.groupID, l3 = c3 === this.getMyUserID();
      M2.l("".concat(a3, " timeout:").concat(e3, " isInviter:").concat(l3, " groupID:").concat(u3)), e3 <= 0 || (n3 = l3 ? e3 + 5 : e3, o3 = 1, i4 = setInterval(function() {
        var e4 = s4._hasLocalInviteInfo(t3, l3);
        o3 < n3 && e4 ? ++o3 : (e4 && s4._sendTimeoutNotice(r4, l3), M2.l("".concat(a3, " end.")), clearInterval(i4));
      }, 1e3));
    } }, { key: "_hasLocalInviteInfo", value: function(e3, t3) {
      var n3, o3, i4 = e3.inviteID, e3 = e3.groupID;
      return !!this.hasInviteInfo(i4) && (n3 = "".concat(this._n, "._hasLocalInviteInfo"), o3 = this.getInviteInfo(i4).inviteeList, M2.l("".concat(n3, " inviteID:").concat(i4, " inviteeList:").concat(o3, " groupID:").concat(e3)), !e3 || (t3 ? 0 < o3.length : 0 < o3.length && o3.includes(this.getMyUserID())));
    } }, { key: "_getReceiver", value: function(e3, t3) {
      var n3 = t3.groupID, o3 = t3.inviteeList, t3 = t3.inviter;
      return e3 ? n3 || o3[0] : n3 || t3;
    } }, { key: "_sendTimeoutNotice", value: function(i4, s4) {
      var a3 = this, e3 = this.getInviteInfo(i4), t3 = this._getReceiver(s4, e3), r4 = (M2.l("".concat(this._n, "._sendTimeoutNotice inviteID:").concat(i4, " to:").concat(t3, " isInviter:").concat(s4)), this._localSignalingHandler.createTimeoutCustomData(y2(y2({}, e3), {}, { isInviter: s4 }))), c3 = this.createSignaling(r4, t3);
      return this.sendSignaling(c3, r4).then(function(e4) {
        var t4, n3, o3;
        e4 && 0 === e4.code && (e4 = r4.data, t4 = r4.groupID, n3 = r4.inviteeList, o3 = r4.inviter, a3.emitEvent(_2.INVITATION_TIMEOUT, { data: e4, groupID: t4, inviteID: i4, inviteeList: n3, inviter: o3, isSelfTimeout: true, message: c3 }), s4 ? a3.deleteInviteInfo(i4) : a3.updateInviteInfo(r4));
      });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._inviteInfoMap.clear(), this._canIUseSignaling = false, this._isHandling = false, this._historySignalingHandler.reset(), this._isC2CUnreadHandleCompleted = false, this._isConvSyncCompleted = false, this._isSyncCompleted = false, this._isCloudConfigCompleted = false;
    } }])), ia = ["followDiffList"], sa = ["from"], aa = { NONE: 0, FOLLOWERS: 1, FOLLOWING: 2, MUTUAL: 3 }, ra = (t2(ca, c2), e2(ca, [{ key: "_onCloudConfig", value: function() {
      var e3 = this.getCloudConfig("follow_req_count");
      N3(e3) || (e3 = Number(e3), this.DEFAULT_COUNT = e3 > this.MAX_COUNT ? this.MAX_COUNT : e3, this._clearFollowList());
    } }, { key: "clearCacheOnReconnected", value: function() {
      this._clearFollowList();
    } }, { key: "onFollowNotify", value: function(e3) {
      var s4 = this, e3 = e3.dataList || [];
      M2.l("".concat(this._n, ".onFollowNotify followChangeList:").concat(e3.length)), e3.forEach(function(e4) {
        var t3 = e4.followDiffList, t3 = void 0 === t3 ? [] : t3, e4 = W2(e4, ia), o3 = e4.from, i4 = W2(e4, sa);
        t3.forEach(function(e5) {
          var t4 = e5.isAdd, e5 = e5.followType, e5 = void 0 === e5 ? 0 : e5, n3 = s4._initFollowInfo();
          1 === t4 ? (i4.userID = o3, n3[e5].userInfoList.push(i4), n3[e5].isAdd = true) : (n3[e5].userInfoList.push(o3), n3[e5].isAdd = false), s4._emitEvent(n3);
        });
      });
    } }, { key: "_initFollowInfo", value: function() {
      var t3 = {};
      return Object.values(aa).forEach(function(e3) {
        e3 !== aa.NONE && (t3[e3] = { userInfoList: [], isAdd: false });
      }), t3;
    } }, { key: "_emitEvent", value: function(n3) {
      var o3 = this;
      Object.keys(n3).forEach(function(e3) {
        var e3 = Number(e3), t3 = n3[e3];
        0 < t3.userInfoList.length && (e3 === aa.FOLLOWERS && (o3._clearFollowList(aa.FOLLOWERS), o3.emitOEvt(h2.MY_FOLLOWERS_LIST_UPDATED, t3)), e3 === aa.FOLLOWING && (o3._clearFollowList(aa.FOLLOWING), o3.emitOEvt(h2.MY_FOLLOWING_LIST_UPDATED, t3)), e3 === aa.MUTUAL) && (o3._clearFollowList(aa.MUTUAL), o3.emitOEvt(h2.MUTUAL_FOLLOWERS_LIST_UPDATED, t3));
      });
    } }, { key: "followUser", value: function(e3) {
      var t3, n3, o3;
      return this.canIUse(g2.FOLLOW) ? (t3 = "".concat(this._n, ".").concat("followUser"), n3 = "userIDList:".concat(e3.length), (o3 = new P2("followUser")).setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.FOLLOW, data: { fromAccount: this.getMyUserID(), userIDList: e3.map(function(e4) {
        return { userID: e4 };
      }) } }).then(function(e4) {
        return o3.end(), M2.l("".concat(t3, " ok.")), T2(e4.data.resultList);
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this.noUse("followUser");
    } }, { key: "unfollowUser", value: function(e3) {
      var t3, n3, o3;
      return this.canIUse(g2.FOLLOW) ? (t3 = "".concat(this._n, ".").concat("unfollowUser"), n3 = "userIDList:".concat(e3.length), (o3 = new P2("unfollowUser")).setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.UNFOLLOW, data: { fromAccount: this.getMyUserID(), userIDList: e3 } }).then(function(e4) {
        return o3.end(), M2.l("".concat(t3, " ok.")), T2(e4.data.resultList);
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this.noUse("unfollowUser");
    } }, { key: "getMyFollowersList", value: function() {
      var t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o3 = "getMyFollowersList";
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse(o3);
      var i4 = n3 || this.FIRST_PAGE_INDEX;
      if (this._myFollowersList.has(i4)) {
        var e3 = this._myFollowersList.get(i4), s4 = e3.resultList, a3 = e3.nextCursor, e3 = e3.lastUpdateTime;
        if (Date.now() - e3 < this.MAX_CATCH_TIME && 0 < s4.length)
          return M2.l("".concat(this._n, ".").concat(o3, " nextCursor:").concat(n3, " from local.")), D2({ resultList: s4, nextCursor: a3 });
      }
      return this._getFollowList(n3, aa.FOLLOWERS).then(function(e4) {
        return t3._myFollowersList.set(i4, y2(y2({}, e4), {}, { lastUpdateTime: Date.now() })), M2.l("".concat(t3._n, ".").concat(o3, " nextCursor:").concat(n3, " from remote.")), T2(e4);
      });
    } }, { key: "getMyFollowingList", value: function() {
      var t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o3 = "getMyFollowingList";
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse(o3);
      var i4 = n3 || this.FIRST_PAGE_INDEX;
      if (this._myFollowingList.has(i4)) {
        var e3 = this._myFollowingList.get(i4), s4 = e3.resultList, a3 = e3.nextCursor, e3 = e3.lastUpdateTime;
        if (Date.now() - e3 < this.MAX_CATCH_TIME && 0 < s4.length)
          return M2.l("".concat(this._n, ".").concat(o3, " nextCursor:").concat(n3, " from local.")), D2({ resultList: s4, nextCursor: a3 });
      }
      return this._getFollowList(n3, aa.FOLLOWING).then(function(e4) {
        return t3._myFollowingList.set(i4, y2(y2({}, e4), {}, { lastUpdateTime: Date.now() })), M2.l("".concat(t3._n, ".").concat(o3, " nextCursor:").concat(n3, " from remote.")), T2(e4);
      });
    } }, { key: "getMutualFollowersList", value: function() {
      var t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o3 = "getMutualFollowersList";
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse(o3);
      var i4 = n3 || this.FIRST_PAGE_INDEX;
      if (this._myMutualFollowersList.has(i4)) {
        var e3 = this._myMutualFollowersList.get(i4), s4 = e3.resultList, a3 = e3.nextCursor, e3 = e3.lastUpdateTime;
        if (Date.now() - e3 < this.MAX_CATCH_TIME && 0 < s4.length)
          return M2.l("".concat(this._n, ".").concat(o3, " nextCursor:").concat(n3, " from local.")), D2({ resultList: s4, nextCursor: a3 });
      }
      return this._getFollowList(n3, aa.MUTUAL).then(function(e4) {
        return t3._myMutualFollowersList.set(i4, y2(y2({}, e4), {}, { lastUpdateTime: Date.now() })), M2.l("".concat(t3._n, ".").concat(o3, " nextCursor:").concat(n3, " from remote.")), T2(e4);
      });
    } }, { key: "_getFollowList", value: function(e3, t3) {
      var i4 = this, n3 = new P2("_getFollowList");
      return n3.setMessage("nextCursor:".concat(e3, " type:").concat(t3)), this.req({ P: G2.GET_FOLLOW, data: { fromAccount: this.getMyUserID(), count: this.DEFAULT_COUNT, nextCursor: e3, type: t3 } }).then(function(e4) {
        n3.end();
        var e4 = e4.data, t4 = e4.resultList, t4 = void 0 === t4 ? [] : t4, e4 = e4.nextCursor, e4 = void 0 === e4 ? "" : e4, o3 = [];
        return t4.forEach(function(e5) {
          var t5 = e5.userID, n4 = e5.followTime, e5 = e5.profileList;
          o3.push(y2({ userID: t5, followTime: n4 }, i4._handleProfileItem(void 0 === e5 ? [] : e5)));
        }), { resultList: o3, nextCursor: e4 };
      }).catch(function(e4) {
        return n3.setError(e4).end(), M2.e("".concat(i4._n, "._getFollowList failed. error:"), e4), E2(e4);
      });
    } }, { key: "_handleProfileItem", value: function(e3) {
      var t3 = {};
      return e3.forEach(function(e4) {
        switch (e4.tag) {
          case f2.NICK:
            t3.nick = e4.value;
            break;
          case f2.GENDER:
            t3.gender = e4.value;
            break;
          case f2.BIRTHDAY:
            t3.birthday = e4.value;
            break;
          case f2.LOCATION:
            t3.location = e4.value;
            break;
          case f2.SELFSIGNATURE:
            t3.selfSignature = e4.value;
            break;
          case f2.ALLOWTYPE:
            t3.allowType = e4.value;
            break;
          case f2.LANGUAGE:
            t3.language = e4.value;
            break;
          case f2.AVATAR:
            t3.avatar = e4.value;
            break;
          case f2.MESSAGESETTINGS:
            t3.messageSettings = e4.value;
            break;
          case f2.ADMINFORBIDTYPE:
            t3.adminForbidType = e4.value;
            break;
          case f2.LEVEL:
            t3.level = e4.value;
            break;
          case f2.ROLE:
            t3.role = e4.value;
            break;
          default:
            t3[e4.tag] = e4.value;
        }
      }), t3;
    } }, { key: "getUserFollowInfo", value: function(e3) {
      var t3, n3, i4;
      return this.canIUse(g2.FOLLOW) ? (n3 = false, N3(e3 = e3) && (e3 = [this.getMyUserID()], n3 = true), t3 = "".concat(this._n, ".").concat("getUserFollowInfo"), n3 = "userIDList:".concat(e3.length, " isGetMyFollowInfo:").concat(n3), (i4 = new P2("getUserFollowInfo")).setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.GET_FOLLOW_INFO, data: { fromAccount: this.getMyUserID(), userIDList: e3 } }).then(function(e4) {
        i4.end(), M2.l("".concat(t3, " ok."));
        var e4 = e4.data.followInfoList, o3 = [];
        return (void 0 === e4 ? [] : e4).forEach(function(e5) {
          var t4 = e5.followersCount, n4 = e5.followingCount, e5 = e5.mutualFollowersCount;
          o3.push({ followersCount: t4, followingCount: n4, mutualFollowersCount: e5 });
        }), T2(o3);
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      })) : this.noUse("getUserFollowInfo");
    } }, { key: "checkFollowType", value: function(e3) {
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse("checkFollowType");
      100 < e3.length && (e3 = e3.slice(0, 100), M2.w("".concat(t3, " ").concat(Qt2(100))));
      var t3 = "".concat(this._n, ".").concat("checkFollowType"), n3 = "userIDList length:".concat(e3.length, " "), o3 = new P2("checkFollowType");
      return o3.setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.CHECK_FOLLOW_TYPE, data: { fromAccount: this.getMyUserID(), userIDList: e3 } }).then(function(e4) {
        o3.end(), M2.l("".concat(t3, " ok."));
        var e4 = e4.data.resultList, n4 = [];
        return (void 0 === e4 ? [] : e4).forEach(function(e5) {
          var t4 = e5.userID, e5 = e5.followType;
          n4.push({ userID: t4, followType: e5 });
        }), T2(n4);
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_clearFollowList", value: function(e3) {
      N3(e3) ? (this._myFollowersList.clear(), this._myFollowingList.clear(), this._myMutualFollowersList.clear()) : e3 !== aa.FOLLOWERS ? e3 !== aa.FOLLOWING ? e3 === aa.MUTUAL && this._myMutualFollowersList.clear() : this._myFollowingList.clear() : this._myFollowersList.clear();
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._clearFollowList();
    } }])), ie2 = Ri(function(e3, t3) {
      var n3 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array;
      t3.assign = function(e4) {
        for (var t4, n4, o4 = Array.prototype.slice.call(arguments, 1); o4.length; ) {
          var i5 = o4.shift();
          if (i5) {
            if ("object" !== z2(i5))
              throw new TypeError(i5 + "must be non-object");
            for (var s4 in i5)
              t4 = i5, n4 = s4, Object.prototype.hasOwnProperty.call(t4, n4) && (e4[s4] = i5[s4]);
          }
        }
        return e4;
      }, t3.shrinkBuf = function(e4, t4) {
        return e4.length === t4 ? e4 : e4.subarray ? e4.subarray(0, t4) : (e4.length = t4, e4);
      };
      var o3 = { arraySet: function(e4, t4, n4, o4, i5) {
        if (t4.subarray && e4.subarray)
          e4.set(t4.subarray(n4, n4 + o4), i5);
        else
          for (var s4 = 0; s4 < o4; s4++)
            e4[i5 + s4] = t4[n4 + s4];
      }, flattenChunks: function(e4) {
        for (var t4, n4, o4, i5 = 0, s4 = 0, a3 = e4.length; s4 < a3; s4++)
          i5 += e4[s4].length;
        for (o4 = new Uint8Array(i5), s4 = t4 = 0, a3 = e4.length; s4 < a3; s4++)
          n4 = e4[s4], o4.set(n4, t4), t4 += n4.length;
        return o4;
      } }, i4 = { arraySet: function(e4, t4, n4, o4, i5) {
        for (var s4 = 0; s4 < o4; s4++)
          e4[i5 + s4] = t4[n4 + s4];
      }, flattenChunks: function(e4) {
        return [].concat.apply([], e4);
      } };
      t3.setTyped = function(e4) {
        e4 ? (t3.Buf8 = Uint8Array, t3.Buf16 = Uint16Array, t3.Buf32 = Int32Array, t3.assign(t3, o3)) : (t3.Buf8 = Array, t3.Buf16 = Array, t3.Buf32 = Array, t3.assign(t3, i4));
      }, t3.setTyped(n3);
    });
    function ca(e3) {
      return p3(this, ca), (e3 = i3(this, ca, [e3]))._n = "FollowModule", e3._myFollowersList = /* @__PURE__ */ new Map(), e3._myFollowingList = /* @__PURE__ */ new Map(), e3._myMutualFollowersList = /* @__PURE__ */ new Map(), e3.MAX_CATCH_TIME = 6e5, e3.FIRST_PAGE_INDEX = gt2(), e3.DEFAULT_COUNT = 500, e3.MAX_COUNT = 1e3, e3.getIEmitInst().on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    function ua(e3) {
      p3(this, ua), (e3 = i3(this, ua, [e3]))._n = "SignalingModule", e3._inviteInfoMap = /* @__PURE__ */ new Map(), e3._canIUseSignaling = false, e3._isHandling = false, e3._remoteSignalingHandler = new Zs(e3), e3._localSignalingHandler = new Qs(e3), e3._historySignalingHandler = new $s(e3), e3._isC2CUnreadHandleCompleted = false, e3._isConvSyncCompleted = false, e3._isSyncCompleted = false, e3._isCloudConfigCompleted = false;
      var t3 = e3.getIEmitInst();
      return t3.on(U2.C2C_UNREAD_HANDLE_COMPLETED, e3.onC2CUnreadHandleCompleted, e3), t3.on(U2.CONV_SYNC_COMPLETED, e3.onConvSyncCompleted, e3), t3.on(U2.CLOUD_CONFIG, e3.onCloudConfig, e3), e3;
    }
    function la(e3) {
      return p3(this, la), (e3 = i3(this, la, [e3]))._n = "ProfanityFilterModule", e3._plugin = null, e3._filterConfigMap = /* @__PURE__ */ new Map(), e3._startIndex = 0, e3._version = 0, e3._canIUseLexicon = false, e3._isFetching = false, e3._expiredTime = 0, e3;
    }
    function da(e3) {
      var t3;
      return p3(this, da), (t3 = i3(this, da, [e3]))._m = e3, t3._n = "TIMPushModule", t3._pluginName = "TIMPush", t3._pushPlugin = void 0, t3._androidPushConfig = {}, t3._deviceToken = "", t3._businessID = 0, t3._iOSBusinessID = 0, t3._c2cUnreadCount = 0, t3._groupUnreadCount = 0, t3._isWebUniapp = 0, t3._deviceInfo = { notificationStatus: 0, deviceModel: "", systemVersion: "", pushVersion: "1.0.1", packageName: "" }, t3;
    }
    function pa(e3) {
      var t3;
      return p3(this, pa), (t3 = i3(this, pa, [e3]))._m = e3, t3._n = "OfflinePushModule", t3._offlinePushPlugin = void 0, t3._androidPushConfig = { huaweiPushBussinessId: "", xiaomiPushBussinessId: "", xiaomiPushAppId: "", xiaomiPushAppKey: "", meizuPushBussinessId: "", meizuPushAppId: "", meizuPushAppKey: "", vivoPushBussinessId: "", fcmPushBussinessId: "", oppoPushBussinessId: "", oppoPushAppKey: "", oppoPushAppSecret: "", honorPushBussinessId: "" }, t3._deviceToken = "", t3._businessID = 0, t3._iosBusinessID = 0, t3._c2cUnreadCount = 0, t3._groupUnreadCount = 0, t3._isWebUniapp = 0, t3;
    }
    function _a(e3) {
      return p3(this, _a), (e3 = i3(this, _a, [e3]))._n = "WorkerTimerModule", e3._isWorkerEnabled = true, e3._workerTimer = null, e3._timerID = -1, e3._init(), e3.getIEmitInst().on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    function ha(e3) {
      return p3(this, ha), (e3 = i3(this, ha, [e3]))._n = "SnsModule", e3._friendHandler = new qs(e3), e3._friendApplicationHandler = new ws(e3), e3._friendGroupHandler = new Vs(e3), e3.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, e3.onContextUpdated, e3), e3;
    }
    function ga(e3) {
      p3(this, ga), (e3 = i3(this, ga, [e3]))._n = "QualityStatModule", e3.TAG = "im-ssolog-quality-stat", e3.reportIndex = 0, e3.wholePeriod = false, e3._qualityItems = [Bn, Hn, Kn, Wn, Yn, jn, Jn, zn, Xn, Zn], e3._messageSentItems = [Kn, Wn, Yn, jn, Jn], e3._messageReceivedItems = [zn, Xn, Zn], e3.REPORT_INTERVAL = 120, e3.REPORT_SDKAPPID_BLACKLIST = [], e3.REPORT_TINYID_WHITELIST = [], e3._statInfoArr = [], e3._avgRTT = new Ns(), e3._avgE2EDelay = new Os(), e3._rateMessageSent = new Gs(), e3._rateMessageReceived = new Ps();
      var t3 = e3.getIEmitInst();
      return t3.on(U2.A2KEY_AND_TINYID_UPDATED, e3._onLoginSuccess, e3), t3.on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    function fa(e3) {
      return p3(this, fa), (e3 = i3(this, fa, [e3]))._n = "RecoverMsgModule", e3.PULL_LIMIT_COUNT = 15, e3;
    }
    function ma(e3) {
      return p3(this, ma), (e3 = i3(this, ma, [e3]))._n = "CloudControlModule", e3._cloudConfig = /* @__PURE__ */ new Map(), e3._expiredTime = 0, e3._version = 0, e3._isFetching = false, e3;
    }
    function va(e3) {
      return p3(this, va), (e3 = i3(this, va, [e3]))._n = "SessionModule", e3._platform = e3.getPlatform(), e3._pHandler = new fs(e3), e3._msgDispatcher = new vs(e3), e3._cmdFreqLimitMap = /* @__PURE__ */ new Map(), e3._cmdReqInfoMap = /* @__PURE__ */ new Map(), e3._serverOverloadInfoMap = /* @__PURE__ */ new Map(), e3._incrementalPullContactFlag = true, e3._init(), e3.getIEmitInst().on(U2.CLOUD_CONFIG, e3._onCloudConfig, e3), e3;
    }
    ie2.assign, ie2.shrinkBuf, ie2.setTyped, ie2.Buf8, ie2.Buf16, ie2.Buf32;
    function Ia(e3, t3, n3, o3) {
      for (var i4 = 65535 & e3 | 0, s4 = e3 >>> 16 & 65535 | 0, a3 = 0; 0 !== n3; ) {
        for (n3 -= a3 = 2e3 < n3 ? 2e3 : n3; s4 = s4 + (i4 = i4 + t3[o3++] | 0) | 0, --a3; )
          ;
        i4 %= 65521, s4 %= 65521;
      }
      return i4 | s4 << 16 | 0;
    }
    function Ma(e3, t3, n3, o3) {
      var i4 = Ca, s4 = o3 + n3;
      e3 ^= -1;
      for (var a3 = o3; a3 < s4; a3++)
        e3 = e3 >>> 8 ^ i4[255 & (e3 ^ t3[a3])];
      return -1 ^ e3;
    }
    function ya(e3, t3, n3, o3, i4, s4, a3, r4) {
      for (var c3, u3, l3, d3, p4, _3, h3, g3, f3, m3 = r4.bits, v4 = 0, I3 = 0, M3 = 0, y3 = 0, C3 = 0, T3 = 0, D3 = 0, E3 = 0, L3 = 0, S3 = 0, k3 = null, R3 = 0, A3 = new ie2.Buf16(16), O3 = new ie2.Buf16(16), N4 = null, G3 = 0, v4 = 0; v4 <= 15; v4++)
        A3[v4] = 0;
      for (I3 = 0; I3 < o3; I3++)
        A3[t3[n3 + I3]]++;
      for (C3 = m3, y3 = 15; 1 <= y3 && 0 === A3[y3]; y3--)
        ;
      if (y3 < C3 && (C3 = y3), 0 === y3)
        i4[s4++] = 20971520, i4[s4++] = 20971520, r4.bits = 1;
      else {
        for (M3 = 1; M3 < y3 && 0 === A3[M3]; M3++)
          ;
        for (C3 < M3 && (C3 = M3), v4 = E3 = 1; v4 <= 15; v4++)
          if ((E3 = (E3 << 1) - A3[v4]) < 0)
            return -1;
        if (0 < E3 && (0 === e3 || 1 !== y3))
          return -1;
        for (O3[1] = 0, v4 = 1; v4 < 15; v4++)
          O3[v4 + 1] = O3[v4] + A3[v4];
        for (I3 = 0; I3 < o3; I3++)
          0 !== t3[n3 + I3] && (a3[O3[t3[n3 + I3]]++] = I3);
        if (_3 = 0 === e3 ? (k3 = N4 = a3, 19) : 1 === e3 ? (k3 = Ta, R3 -= 257, N4 = Da, G3 -= 257, 256) : (k3 = Ea, N4 = La, -1), v4 = M3, p4 = s4, D3 = I3 = S3 = 0, l3 = -1, d3 = (L3 = 1 << (T3 = C3)) - 1, 1 === e3 && 852 < L3 || 2 === e3 && 592 < L3)
          return 1;
        for (; ; ) {
          for (f3 = a3[I3] < _3 ? (g3 = 0, a3[I3]) : a3[I3] > _3 ? (g3 = N4[G3 + a3[I3]], k3[R3 + a3[I3]]) : (g3 = 96, 0), c3 = 1 << (h3 = v4 - D3), M3 = u3 = 1 << T3; i4[p4 + (S3 >> D3) + (u3 -= c3)] = h3 << 24 | g3 << 16 | f3 | 0, 0 !== u3; )
            ;
          for (c3 = 1 << v4 - 1; S3 & c3; )
            c3 >>= 1;
          if (0 !== c3 ? S3 = (S3 & c3 - 1) + c3 : S3 = 0, I3++, 0 == --A3[v4]) {
            if (v4 === y3)
              break;
            v4 = t3[n3 + a3[I3]];
          }
          if (C3 < v4 && (S3 & d3) !== l3) {
            for (p4 += M3, E3 = 1 << (T3 = v4 - (D3 = 0 === D3 ? C3 : D3)); T3 + D3 < y3 && !((E3 -= A3[T3 + D3]) <= 0); )
              T3++, E3 <<= 1;
            if (L3 += 1 << T3, 1 === e3 && 852 < L3 || 2 === e3 && 592 < L3)
              return 1;
            i4[l3 = S3 & d3] = C3 << 24 | T3 << 16 | p4 - s4 | 0;
          }
        }
        0 !== S3 && (i4[p4 + S3] = v4 - D3 << 24 | 64 << 16 | 0), r4.bits = C3;
      }
      return 0;
    }
    var Ca = function() {
      for (var e3 = [], t3 = 0; t3 < 256; t3++) {
        for (var n3 = t3, o3 = 0; o3 < 8; o3++)
          n3 = 1 & n3 ? 3988292384 ^ n3 >>> 1 : n3 >>> 1;
        e3[t3] = n3;
      }
      return e3;
    }(), Ta = [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, 0, 0], Da = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], Ea = [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, 0, 0], La = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
    function Sa(e3) {
      return (e3 >>> 24 & 255) + (e3 >>> 8 & 65280) + ((65280 & e3) << 8) + ((255 & e3) << 24);
    }
    function ka() {
      this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new ie2.Buf16(320), this.work = new ie2.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
    }
    function Ra(e3) {
      var t3;
      return e3 && e3.state ? (t3 = e3.state, e3.total_in = e3.total_out = t3.total = 0, e3.msg = "", t3.wrap && (e3.adler = 1 & t3.wrap), t3.mode = 1, t3.last = 0, t3.havedict = 0, t3.dmax = 32768, t3.head = null, t3.hold = 0, t3.bits = 0, t3.lencode = t3.lendyn = new ie2.Buf32(852), t3.distcode = t3.distdyn = new ie2.Buf32(592), t3.sane = 1, t3.back = -1, 0) : -2;
    }
    function Aa(e3) {
      var t3;
      return e3 && e3.state ? ((t3 = e3.state).wsize = 0, t3.whave = 0, t3.wnext = 0, Ra(e3)) : -2;
    }
    function Oa(e3, t3) {
      var n3, o3;
      return !e3 || !e3.state || (o3 = e3.state, t3 < 0 ? (n3 = 0, t3 = -t3) : (n3 = 1 + (t3 >> 4), t3 < 48 && (t3 &= 15)), t3 && (t3 < 8 || 15 < t3)) ? -2 : (null !== o3.window && o3.wbits !== t3 && (o3.window = null), o3.wrap = n3, o3.wbits = t3, Aa(e3));
    }
    function Na(e3, t3) {
      var n3;
      return e3 ? (n3 = new ka(), (e3.state = n3).window = null, 0 !== (n3 = Oa(e3, t3)) && (e3.state = null), n3) : -2;
    }
    var Ga, Pa, Ua = true;
    function ba(e3, t3, n3, o3) {
      var i4, e3 = e3.state;
      return null === e3.window && (e3.wsize = 1 << e3.wbits, e3.wnext = 0, e3.whave = 0, e3.window = new ie2.Buf8(e3.wsize)), o3 >= e3.wsize ? (ie2.arraySet(e3.window, t3, n3 - e3.wsize, e3.wsize, 0), e3.wnext = 0, e3.whave = e3.wsize) : ((i4 = e3.wsize - e3.wnext) > o3 && (i4 = o3), ie2.arraySet(e3.window, t3, n3 - o3, i4, e3.wnext), (o3 -= i4) ? (ie2.arraySet(e3.window, t3, n3 - o3, o3, 0), e3.wnext = o3, e3.whave = e3.wsize) : (e3.wnext += i4, e3.wnext === e3.wsize && (e3.wnext = 0), e3.whave < e3.wsize && (e3.whave += i4))), 0;
    }
    var wa = { inflateReset: Aa, inflateReset2: Oa, inflateResetKeep: Ra, inflateInit: function(e3) {
      return Na(e3, 15);
    }, inflateInit2: Na, inflate: function(e3, b3) {
      var t3, n3, w3, o3, i4, s4, a3, r4, c3, F3, u3, l3, q3, x3, d3, p4, _3, h3, V3, B3, g3, f3, m3, v4, I3 = 0, M3 = new ie2.Buf8(4), H3 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
      if (!e3 || !e3.state || !e3.output || !e3.input && 0 !== e3.avail_in)
        return -2;
      12 === (t3 = e3.state).mode && (t3.mode = 13), i4 = e3.next_out, w3 = e3.output, a3 = e3.avail_out, o3 = e3.next_in, n3 = e3.input, s4 = e3.avail_in, r4 = t3.hold, c3 = t3.bits, F3 = s4, u3 = a3, f3 = 0;
      e:
        for (; ; )
          switch (t3.mode) {
            case 1:
              if (0 === t3.wrap)
                t3.mode = 13;
              else {
                for (; c3 < 16; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                if (2 & t3.wrap && 35615 === r4)
                  M3[t3.check = 0] = 255 & r4, M3[1] = r4 >>> 8 & 255, t3.check = Ma(t3.check, M3, 2, 0), c3 = r4 = 0, t3.mode = 2;
                else if (t3.flags = 0, t3.head && (t3.head.done = false), !(1 & t3.wrap) || (((255 & r4) << 8) + (r4 >> 8)) % 31)
                  e3.msg = "incorrect header check", t3.mode = 30;
                else if (8 != (15 & r4))
                  e3.msg = "unknown compression method", t3.mode = 30;
                else {
                  if (c3 -= 4, g3 = 8 + (15 & (r4 >>>= 4)), 0 === t3.wbits)
                    t3.wbits = g3;
                  else if (g3 > t3.wbits) {
                    e3.msg = "invalid window size", t3.mode = 30;
                    break;
                  }
                  t3.dmax = 1 << g3, e3.adler = t3.check = 1, t3.mode = 512 & r4 ? 10 : 12, c3 = r4 = 0;
                }
              }
              break;
            case 2:
              for (; c3 < 16; ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              if (t3.flags = r4, 8 != (255 & t3.flags)) {
                e3.msg = "unknown compression method", t3.mode = 30;
                break;
              }
              if (57344 & t3.flags) {
                e3.msg = "unknown header flags set", t3.mode = 30;
                break;
              }
              t3.head && (t3.head.text = r4 >> 8 & 1), 512 & t3.flags && (M3[0] = 255 & r4, M3[1] = r4 >>> 8 & 255, t3.check = Ma(t3.check, M3, 2, 0)), c3 = r4 = 0, t3.mode = 3;
            case 3:
              for (; c3 < 32; ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              t3.head && (t3.head.time = r4), 512 & t3.flags && (M3[0] = 255 & r4, M3[1] = r4 >>> 8 & 255, M3[2] = r4 >>> 16 & 255, M3[3] = r4 >>> 24 & 255, t3.check = Ma(t3.check, M3, 4, 0)), c3 = r4 = 0, t3.mode = 4;
            case 4:
              for (; c3 < 16; ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              t3.head && (t3.head.xflags = 255 & r4, t3.head.os = r4 >> 8), 512 & t3.flags && (M3[0] = 255 & r4, M3[1] = r4 >>> 8 & 255, t3.check = Ma(t3.check, M3, 2, 0)), c3 = r4 = 0, t3.mode = 5;
            case 5:
              if (1024 & t3.flags) {
                for (; c3 < 16; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                t3.length = r4, t3.head && (t3.head.extra_len = r4), 512 & t3.flags && (M3[0] = 255 & r4, M3[1] = r4 >>> 8 & 255, t3.check = Ma(t3.check, M3, 2, 0)), c3 = r4 = 0;
              } else
                t3.head && (t3.head.extra = null);
              t3.mode = 6;
            case 6:
              if (1024 & t3.flags && ((l3 = (l3 = t3.length) > s4 ? s4 : l3) && (t3.head && (g3 = t3.head.extra_len - t3.length, t3.head.extra || (t3.head.extra = new Array(t3.head.extra_len)), ie2.arraySet(t3.head.extra, n3, o3, l3, g3)), 512 & t3.flags && (t3.check = Ma(t3.check, n3, l3, o3)), s4 -= l3, o3 += l3, t3.length -= l3), t3.length))
                break e;
              t3.length = 0, t3.mode = 7;
            case 7:
              if (2048 & t3.flags) {
                if (0 === s4)
                  break e;
                for (l3 = 0; g3 = n3[o3 + l3++], t3.head && g3 && t3.length < 65536 && (t3.head.name += String.fromCharCode(g3)), g3 && l3 < s4; )
                  ;
                if (512 & t3.flags && (t3.check = Ma(t3.check, n3, l3, o3)), s4 -= l3, o3 += l3, g3)
                  break e;
              } else
                t3.head && (t3.head.name = null);
              t3.length = 0, t3.mode = 8;
            case 8:
              if (4096 & t3.flags) {
                if (0 === s4)
                  break e;
                for (l3 = 0; g3 = n3[o3 + l3++], t3.head && g3 && t3.length < 65536 && (t3.head.comment += String.fromCharCode(g3)), g3 && l3 < s4; )
                  ;
                if (512 & t3.flags && (t3.check = Ma(t3.check, n3, l3, o3)), s4 -= l3, o3 += l3, g3)
                  break e;
              } else
                t3.head && (t3.head.comment = null);
              t3.mode = 9;
            case 9:
              if (512 & t3.flags) {
                for (; c3 < 16; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                if (r4 !== (65535 & t3.check)) {
                  e3.msg = "header crc mismatch", t3.mode = 30;
                  break;
                }
                c3 = r4 = 0;
              }
              t3.head && (t3.head.hcrc = t3.flags >> 9 & 1, t3.head.done = true), e3.adler = t3.check = 0, t3.mode = 12;
              break;
            case 10:
              for (; c3 < 32; ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              e3.adler = t3.check = Sa(r4), c3 = r4 = 0, t3.mode = 11;
            case 11:
              if (0 === t3.havedict)
                return e3.next_out = i4, e3.avail_out = a3, e3.next_in = o3, e3.avail_in = s4, t3.hold = r4, t3.bits = c3, 2;
              e3.adler = t3.check = 1, t3.mode = 12;
            case 12:
              if (5 === b3 || 6 === b3)
                break e;
            case 13:
              if (t3.last)
                r4 >>>= 7 & c3, c3 -= 7 & c3, t3.mode = 27;
              else {
                for (; c3 < 3; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                switch (t3.last = 1 & r4, --c3, 3 & (r4 >>>= 1)) {
                  case 0:
                    t3.mode = 14;
                    break;
                  case 1:
                    y3 = C3 = void 0;
                    var y3, C3 = t3;
                    if (Ua) {
                      for (Ga = new ie2.Buf32(512), Pa = new ie2.Buf32(32), y3 = 0; y3 < 144; )
                        C3.lens[y3++] = 8;
                      for (; y3 < 256; )
                        C3.lens[y3++] = 9;
                      for (; y3 < 280; )
                        C3.lens[y3++] = 7;
                      for (; y3 < 288; )
                        C3.lens[y3++] = 8;
                      for (ya(1, C3.lens, 0, 288, Ga, 0, C3.work, { bits: 9 }), y3 = 0; y3 < 32; )
                        C3.lens[y3++] = 5;
                      ya(2, C3.lens, 0, 32, Pa, 0, C3.work, { bits: 5 }), Ua = false;
                    }
                    if (C3.lencode = Ga, C3.lenbits = 9, C3.distcode = Pa, C3.distbits = 5, t3.mode = 20, 6 !== b3)
                      break;
                    r4 >>>= 2, c3 -= 2;
                    break e;
                  case 2:
                    t3.mode = 17;
                    break;
                  case 3:
                    e3.msg = "invalid block type", t3.mode = 30;
                }
                r4 >>>= 2, c3 -= 2;
              }
              break;
            case 14:
              for (r4 >>>= 7 & c3, c3 -= 7 & c3; c3 < 32; ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              if ((65535 & r4) != (r4 >>> 16 ^ 65535)) {
                e3.msg = "invalid stored block lengths", t3.mode = 30;
                break;
              }
              if (t3.length = 65535 & r4, c3 = r4 = 0, t3.mode = 15, 6 === b3)
                break e;
            case 15:
              t3.mode = 16;
            case 16:
              if (l3 = t3.length) {
                if (0 === (l3 = a3 < (l3 = s4 < l3 ? s4 : l3) ? a3 : l3))
                  break e;
                ie2.arraySet(w3, n3, o3, l3, i4), s4 -= l3, o3 += l3, a3 -= l3, i4 += l3, t3.length -= l3;
              } else
                t3.mode = 12;
              break;
            case 17:
              for (; c3 < 14; ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              if (t3.nlen = 257 + (31 & r4), r4 >>>= 5, c3 -= 5, t3.ndist = 1 + (31 & r4), r4 >>>= 5, c3 -= 5, t3.ncode = 4 + (15 & r4), r4 >>>= 4, c3 -= 4, 286 < t3.nlen || 30 < t3.ndist) {
                e3.msg = "too many length or distance symbols", t3.mode = 30;
                break;
              }
              t3.have = 0, t3.mode = 18;
            case 18:
              for (; t3.have < t3.ncode; ) {
                for (; c3 < 3; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                t3.lens[H3[t3.have++]] = 7 & r4, r4 >>>= 3, c3 -= 3;
              }
              for (; t3.have < 19; )
                t3.lens[H3[t3.have++]] = 0;
              if (t3.lencode = t3.lendyn, t3.lenbits = 7, m3 = { bits: t3.lenbits }, f3 = ya(0, t3.lens, 0, 19, t3.lencode, 0, t3.work, m3), t3.lenbits = m3.bits, f3) {
                e3.msg = "invalid code lengths set", t3.mode = 30;
                break;
              }
              t3.have = 0, t3.mode = 19;
            case 19:
              for (; t3.have < t3.nlen + t3.ndist; ) {
                for (; p4 = (I3 = t3.lencode[r4 & (1 << t3.lenbits) - 1]) >>> 16 & 255, _3 = 65535 & I3, !((d3 = I3 >>> 24) <= c3); ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                if (_3 < 16)
                  r4 >>>= d3, c3 -= d3, t3.lens[t3.have++] = _3;
                else {
                  if (16 === _3) {
                    for (v4 = d3 + 2; c3 < v4; ) {
                      if (0 === s4)
                        break e;
                      s4--, r4 += n3[o3++] << c3, c3 += 8;
                    }
                    if (r4 >>>= d3, c3 -= d3, 0 === t3.have) {
                      e3.msg = "invalid bit length repeat", t3.mode = 30;
                      break;
                    }
                    g3 = t3.lens[t3.have - 1], l3 = 3 + (3 & r4), r4 >>>= 2, c3 -= 2;
                  } else if (17 === _3) {
                    for (v4 = d3 + 3; c3 < v4; ) {
                      if (0 === s4)
                        break e;
                      s4--, r4 += n3[o3++] << c3, c3 += 8;
                    }
                    g3 = 0, l3 = 3 + (7 & (r4 >>>= d3)), r4 >>>= 3, c3 = c3 - d3 - 3;
                  } else {
                    for (v4 = d3 + 7; c3 < v4; ) {
                      if (0 === s4)
                        break e;
                      s4--, r4 += n3[o3++] << c3, c3 += 8;
                    }
                    g3 = 0, l3 = 11 + (127 & (r4 >>>= d3)), r4 >>>= 7, c3 = c3 - d3 - 7;
                  }
                  if (t3.have + l3 > t3.nlen + t3.ndist) {
                    e3.msg = "invalid bit length repeat", t3.mode = 30;
                    break;
                  }
                  for (; l3--; )
                    t3.lens[t3.have++] = g3;
                }
              }
              if (30 === t3.mode)
                break;
              if (0 === t3.lens[256]) {
                e3.msg = "invalid code -- missing end-of-block", t3.mode = 30;
                break;
              }
              if (t3.lenbits = 9, m3 = { bits: t3.lenbits }, f3 = ya(1, t3.lens, 0, t3.nlen, t3.lencode, 0, t3.work, m3), t3.lenbits = m3.bits, f3) {
                e3.msg = "invalid literal/lengths set", t3.mode = 30;
                break;
              }
              if (t3.distbits = 6, t3.distcode = t3.distdyn, m3 = { bits: t3.distbits }, f3 = ya(2, t3.lens, t3.nlen, t3.ndist, t3.distcode, 0, t3.work, m3), t3.distbits = m3.bits, f3) {
                e3.msg = "invalid distances set", t3.mode = 30;
                break;
              }
              if (t3.mode = 20, 6 === b3)
                break e;
            case 20:
              t3.mode = 21;
            case 21:
              if (6 <= s4 && 258 <= a3) {
                e3.next_out = i4, e3.avail_out = a3, e3.next_in = o3, e3.avail_in = s4, t3.hold = r4, t3.bits = c3, G3 = W3 = k3 = S3 = L3 = E3 = D3 = T3 = oe3 = ne3 = te3 = ee3 = U3 = P3 = $3 = Q3 = Z3 = X3 = z3 = J3 = j3 = N4 = Y3 = O3 = A3 = void 0;
                var T3, D3, E3, L3, S3, k3, R3 = e3, K3 = u3, A3 = R3.state, O3 = R3.next_in, W3 = R3.input, Y3 = O3 + (R3.avail_in - 5), N4 = R3.next_out, G3 = R3.output, j3 = N4 - (K3 - R3.avail_out), J3 = N4 + (R3.avail_out - 257), z3 = A3.dmax, X3 = A3.wsize, Z3 = A3.whave, Q3 = A3.wnext, $3 = A3.window, P3 = A3.hold, U3 = A3.bits, ee3 = A3.lencode, te3 = A3.distcode, ne3 = (1 << A3.lenbits) - 1, oe3 = (1 << A3.distbits) - 1;
                t:
                  do {
                    for (U3 < 15 && (P3 += W3[O3++] << U3, U3 += 8, P3 += W3[O3++] << U3, U3 += 8), T3 = ee3[P3 & ne3]; ; ) {
                      if (P3 >>>= D3 = T3 >>> 24, U3 -= D3, 0 == (D3 = T3 >>> 16 & 255))
                        G3[N4++] = 65535 & T3;
                      else {
                        if (!(16 & D3)) {
                          if (0 == (64 & D3)) {
                            T3 = ee3[(65535 & T3) + (P3 & (1 << D3) - 1)];
                            continue;
                          }
                          if (32 & D3) {
                            A3.mode = 12;
                            break t;
                          }
                          R3.msg = "invalid literal/length code", A3.mode = 30;
                          break t;
                        }
                        for (E3 = 65535 & T3, (D3 &= 15) && (U3 < D3 && (P3 += W3[O3++] << U3, U3 += 8), E3 += P3 & (1 << D3) - 1, P3 >>>= D3, U3 -= D3), U3 < 15 && (P3 += W3[O3++] << U3, U3 += 8, P3 += W3[O3++] << U3, U3 += 8), T3 = te3[P3 & oe3]; ; ) {
                          if (P3 >>>= D3 = T3 >>> 24, U3 -= D3, !(16 & (D3 = T3 >>> 16 & 255))) {
                            if (0 == (64 & D3)) {
                              T3 = te3[(65535 & T3) + (P3 & (1 << D3) - 1)];
                              continue;
                            }
                            R3.msg = "invalid distance code", A3.mode = 30;
                            break t;
                          }
                          if (L3 = 65535 & T3, U3 < (D3 &= 15) && (P3 += W3[O3++] << U3, (U3 += 8) < D3) && (P3 += W3[O3++] << U3, U3 += 8), (L3 += P3 & (1 << D3) - 1) > z3) {
                            R3.msg = "invalid distance too far back", A3.mode = 30;
                            break t;
                          }
                          if (P3 >>>= D3, U3 -= D3, L3 > (D3 = N4 - j3)) {
                            if ((D3 = L3 - D3) > Z3 && A3.sane) {
                              R3.msg = "invalid distance too far back", A3.mode = 30;
                              break t;
                            }
                            if (k3 = $3, (S3 = 0) === Q3) {
                              if (S3 += X3 - D3, D3 < E3) {
                                for (E3 -= D3; G3[N4++] = $3[S3++], --D3; )
                                  ;
                                S3 = N4 - L3, k3 = G3;
                              }
                            } else if (Q3 < D3) {
                              if (S3 += X3 + Q3 - D3, (D3 -= Q3) < E3) {
                                for (E3 -= D3; G3[N4++] = $3[S3++], --D3; )
                                  ;
                                if (S3 = 0, Q3 < E3) {
                                  for (E3 -= D3 = Q3; G3[N4++] = $3[S3++], --D3; )
                                    ;
                                  S3 = N4 - L3, k3 = G3;
                                }
                              }
                            } else if (S3 += Q3 - D3, D3 < E3) {
                              for (E3 -= D3; G3[N4++] = $3[S3++], --D3; )
                                ;
                              S3 = N4 - L3, k3 = G3;
                            }
                            for (; 2 < E3; )
                              G3[N4++] = k3[S3++], G3[N4++] = k3[S3++], G3[N4++] = k3[S3++], E3 -= 3;
                            E3 && (G3[N4++] = k3[S3++], 1 < E3) && (G3[N4++] = k3[S3++]);
                          } else {
                            for (S3 = N4 - L3; G3[N4++] = G3[S3++], G3[N4++] = G3[S3++], G3[N4++] = G3[S3++], 2 < (E3 -= 3); )
                              ;
                            E3 && (G3[N4++] = G3[S3++], 1 < E3) && (G3[N4++] = G3[S3++]);
                          }
                          break;
                        }
                      }
                      break;
                    }
                  } while (O3 < Y3 && N4 < J3);
                O3 -= E3 = U3 >> 3, P3 &= (1 << (U3 -= E3 << 3)) - 1, R3.next_in = O3, R3.next_out = N4, R3.avail_in = O3 < Y3 ? Y3 - O3 + 5 : 5 - (O3 - Y3), R3.avail_out = N4 < J3 ? J3 - N4 + 257 : 257 - (N4 - J3), A3.hold = P3, A3.bits = U3, i4 = e3.next_out, w3 = e3.output, a3 = e3.avail_out, o3 = e3.next_in, n3 = e3.input, s4 = e3.avail_in, r4 = t3.hold, c3 = t3.bits, 12 === t3.mode && (t3.back = -1);
                break;
              }
              for (t3.back = 0; p4 = (I3 = t3.lencode[r4 & (1 << t3.lenbits) - 1]) >>> 16 & 255, _3 = 65535 & I3, !((d3 = I3 >>> 24) <= c3); ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              if (p4 && 0 == (240 & p4)) {
                for (h3 = d3, V3 = p4, B3 = _3; p4 = (I3 = t3.lencode[B3 + ((r4 & (1 << h3 + V3) - 1) >> h3)]) >>> 16 & 255, _3 = 65535 & I3, !(h3 + (d3 = I3 >>> 24) <= c3); ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                r4 >>>= h3, c3 -= h3, t3.back += h3;
              }
              if (r4 >>>= d3, c3 -= d3, t3.back += d3, t3.length = _3, 0 === p4) {
                t3.mode = 26;
                break;
              }
              if (32 & p4) {
                t3.back = -1, t3.mode = 12;
                break;
              }
              if (64 & p4) {
                e3.msg = "invalid literal/length code", t3.mode = 30;
                break;
              }
              t3.extra = 15 & p4, t3.mode = 22;
            case 22:
              if (t3.extra) {
                for (v4 = t3.extra; c3 < v4; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                t3.length += r4 & (1 << t3.extra) - 1, r4 >>>= t3.extra, c3 -= t3.extra, t3.back += t3.extra;
              }
              t3.was = t3.length, t3.mode = 23;
            case 23:
              for (; p4 = (I3 = t3.distcode[r4 & (1 << t3.distbits) - 1]) >>> 16 & 255, _3 = 65535 & I3, !((d3 = I3 >>> 24) <= c3); ) {
                if (0 === s4)
                  break e;
                s4--, r4 += n3[o3++] << c3, c3 += 8;
              }
              if (0 == (240 & p4)) {
                for (h3 = d3, V3 = p4, B3 = _3; p4 = (I3 = t3.distcode[B3 + ((r4 & (1 << h3 + V3) - 1) >> h3)]) >>> 16 & 255, _3 = 65535 & I3, !(h3 + (d3 = I3 >>> 24) <= c3); ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                r4 >>>= h3, c3 -= h3, t3.back += h3;
              }
              if (r4 >>>= d3, c3 -= d3, t3.back += d3, 64 & p4) {
                e3.msg = "invalid distance code", t3.mode = 30;
                break;
              }
              t3.offset = _3, t3.extra = 15 & p4, t3.mode = 24;
            case 24:
              if (t3.extra) {
                for (v4 = t3.extra; c3 < v4; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                t3.offset += r4 & (1 << t3.extra) - 1, r4 >>>= t3.extra, c3 -= t3.extra, t3.back += t3.extra;
              }
              if (t3.offset > t3.dmax) {
                e3.msg = "invalid distance too far back", t3.mode = 30;
                break;
              }
              t3.mode = 25;
            case 25:
              if (0 === a3)
                break e;
              if (t3.offset > (l3 = u3 - a3)) {
                if ((l3 = t3.offset - l3) > t3.whave && t3.sane) {
                  e3.msg = "invalid distance too far back", t3.mode = 30;
                  break;
                }
                q3 = l3 > t3.wnext ? (l3 -= t3.wnext, t3.wsize - l3) : t3.wnext - l3, l3 > t3.length && (l3 = t3.length), x3 = t3.window;
              } else
                x3 = w3, q3 = i4 - t3.offset, l3 = t3.length;
              for (a3 -= l3 = a3 < l3 ? a3 : l3, t3.length -= l3; w3[i4++] = x3[q3++], --l3; )
                ;
              0 === t3.length && (t3.mode = 21);
              break;
            case 26:
              if (0 === a3)
                break e;
              w3[i4++] = t3.length, a3--, t3.mode = 21;
              break;
            case 27:
              if (t3.wrap) {
                for (; c3 < 32; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 |= n3[o3++] << c3, c3 += 8;
                }
                if (u3 -= a3, e3.total_out += u3, t3.total += u3, u3 && (e3.adler = t3.check = (t3.flags ? Ma : Ia)(t3.check, w3, u3, i4 - u3)), u3 = a3, (t3.flags ? r4 : Sa(r4)) !== t3.check) {
                  e3.msg = "incorrect data check", t3.mode = 30;
                  break;
                }
                c3 = r4 = 0;
              }
              t3.mode = 28;
            case 28:
              if (t3.wrap && t3.flags) {
                for (; c3 < 32; ) {
                  if (0 === s4)
                    break e;
                  s4--, r4 += n3[o3++] << c3, c3 += 8;
                }
                if (r4 !== (4294967295 & t3.total)) {
                  e3.msg = "incorrect length check", t3.mode = 30;
                  break;
                }
                c3 = r4 = 0;
              }
              t3.mode = 29;
            case 29:
              f3 = 1;
              break e;
            case 30:
              f3 = -3;
              break e;
            case 31:
              return -4;
            default:
              return -2;
          }
      return e3.next_out = i4, e3.avail_out = a3, e3.next_in = o3, e3.avail_in = s4, t3.hold = r4, t3.bits = c3, (t3.wsize || u3 !== e3.avail_out && t3.mode < 30 && (t3.mode < 27 || 4 !== b3)) && ba(e3, e3.output, e3.next_out, u3 - e3.avail_out), F3 -= e3.avail_in, u3 -= e3.avail_out, e3.total_in += F3, e3.total_out += u3, t3.total += u3, t3.wrap && u3 && (e3.adler = t3.check = (t3.flags ? Ma : Ia)(t3.check, w3, u3, e3.next_out - u3)), e3.data_type = t3.bits + (t3.last ? 64 : 0) + (12 === t3.mode ? 128 : 0) + (20 === t3.mode || 15 === t3.mode ? 256 : 0), f3 = (0 == F3 && 0 === u3 || 4 === b3) && 0 === f3 ? -5 : f3;
    }, inflateEnd: function(e3) {
      var t3;
      return e3 && e3.state ? ((t3 = e3.state).window && (t3.window = null), e3.state = null, 0) : -2;
    }, inflateGetHeader: function(e3, t3) {
      return !e3 || !e3.state || 0 == (2 & (e3 = e3.state).wrap) ? -2 : ((e3.head = t3).done = false, 0);
    }, inflateSetDictionary: function(e3, t3) {
      var n3, o3 = t3.length;
      return !e3 || !e3.state || 0 !== (n3 = e3.state).wrap && 11 !== n3.mode ? -2 : 11 === n3.mode && Ia(1, t3, o3, 0) !== n3.check ? -3 : ba(e3, t3, o3, o3) ? (n3.mode = 31, -4) : (n3.havedict = 1, 0);
    }, inflateInfo: "pako inflate (from Nodeca project)" }, Fa = true, qa2 = true;
    try {
      String.fromCharCode.apply(null, [0]);
    } catch (e3) {
      Fa = false;
    }
    try {
      String.fromCharCode.apply(null, new Uint8Array(1));
    } catch (e3) {
      qa2 = false;
    }
    for (var xa = new ie2.Buf8(256), Va = 0; Va < 256; Va++)
      xa[Va] = 252 <= Va ? 6 : 248 <= Va ? 5 : 240 <= Va ? 4 : 224 <= Va ? 3 : 192 <= Va ? 2 : 1;
    xa[254] = xa[254] = 1;
    function Ba(e3, t3) {
      for (var n3, o3, i4 = t3 || e3.length, s4 = new Array(2 * i4), a3 = 0, r4 = 0; r4 < i4; )
        if ((n3 = e3[r4++]) < 128)
          s4[a3++] = n3;
        else if (4 < (o3 = xa[n3]))
          s4[a3++] = 65533, r4 += o3 - 1;
        else {
          for (n3 &= 2 === o3 ? 31 : 3 === o3 ? 15 : 7; 1 < o3 && r4 < i4; )
            n3 = n3 << 6 | 63 & e3[r4++], o3--;
          1 < o3 ? s4[a3++] = 65533 : n3 < 65536 ? s4[a3++] = n3 : (n3 -= 65536, s4[a3++] = 55296 | n3 >> 10 & 1023, s4[a3++] = 56320 | 1023 & n3);
        }
      var c3 = s4, u3 = a3;
      if (u3 < 65534 && (c3.subarray && qa2 || !c3.subarray && Fa))
        return String.fromCharCode.apply(null, ie2.shrinkBuf(c3, u3));
      for (var l3 = "", d3 = 0; d3 < u3; d3++)
        l3 += String.fromCharCode(c3[d3]);
      return l3;
    }
    function Ha() {
      this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
    }
    function Ka() {
      this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = false;
    }
    var Wa = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }, Ya = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }, ja = Object.prototype.toString;
    function Ja(e3) {
      if (!(this instanceof Ja))
        return new Ja(e3);
      this.options = ie2.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e3 || {});
      var t3 = this.options, e3 = (t3.raw && 0 <= t3.windowBits && t3.windowBits < 16 && (t3.windowBits = -t3.windowBits, 0 === t3.windowBits) && (t3.windowBits = -15), !(0 <= t3.windowBits && t3.windowBits < 16) || e3 && e3.windowBits || (t3.windowBits += 32), 15 < t3.windowBits && t3.windowBits < 48 && 0 == (15 & t3.windowBits) && (t3.windowBits |= 15), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new Ha(), this.strm.avail_out = 0, wa.inflateInit2(this.strm, t3.windowBits));
      if (e3 !== Wa.Z_OK)
        throw new Error(Ya[e3]);
      if (this.header = new Ka(), wa.inflateGetHeader(this.strm, this.header), t3.dictionary && ("string" == typeof t3.dictionary ? t3.dictionary = function(e4) {
        for (var t4, n3, o3, i4, s4 = e4.length, a3 = 0, r4 = 0; r4 < s4; r4++)
          55296 == (64512 & (n3 = e4.charCodeAt(r4))) && r4 + 1 < s4 && 56320 == (64512 & (o3 = e4.charCodeAt(r4 + 1))) && (n3 = 65536 + (n3 - 55296 << 10) + (o3 - 56320), r4++), a3 += n3 < 128 ? 1 : n3 < 2048 ? 2 : n3 < 65536 ? 3 : 4;
        for (t4 = new ie2.Buf8(a3), r4 = i4 = 0; i4 < a3; r4++)
          55296 == (64512 & (n3 = e4.charCodeAt(r4))) && r4 + 1 < s4 && 56320 == (64512 & (o3 = e4.charCodeAt(r4 + 1))) && (n3 = 65536 + (n3 - 55296 << 10) + (o3 - 56320), r4++), n3 < 128 ? t4[i4++] = n3 : (n3 < 2048 ? t4[i4++] = 192 | n3 >>> 6 : (n3 < 65536 ? t4[i4++] = 224 | n3 >>> 12 : (t4[i4++] = 240 | n3 >>> 18, t4[i4++] = 128 | n3 >>> 12 & 63), t4[i4++] = 128 | n3 >>> 6 & 63), t4[i4++] = 128 | 63 & n3);
        return t4;
      }(t3.dictionary) : "[object ArrayBuffer]" === ja.call(t3.dictionary) && (t3.dictionary = new Uint8Array(t3.dictionary)), t3.raw) && (e3 = wa.inflateSetDictionary(this.strm, t3.dictionary)) !== Wa.Z_OK)
        throw new Error(Ya[e3]);
    }
    function za(e3, t3) {
      t3 = new Ja(t3);
      if (t3.push(e3, true), t3.err)
        throw t3.msg || Ya[t3.err];
      return t3.result;
    }
    Ja.prototype.push = function(e3, t3) {
      var n3, o3, i4, s4, a3, r4 = this.strm, c3 = this.options.chunkSize, u3 = this.options.dictionary, l3 = false;
      if (this.ended)
        return false;
      o3 = t3 === ~~t3 ? t3 : true === t3 ? Wa.Z_FINISH : Wa.Z_NO_FLUSH, "string" == typeof e3 ? r4.input = function(e4) {
        for (var t4 = new ie2.Buf8(e4.length), n4 = 0, o4 = t4.length; n4 < o4; n4++)
          t4[n4] = e4.charCodeAt(n4);
        return t4;
      }(e3) : "[object ArrayBuffer]" === ja.call(e3) ? r4.input = new Uint8Array(e3) : r4.input = e3, r4.next_in = 0, r4.avail_in = r4.input.length;
      do {
        if (0 === r4.avail_out && (r4.output = new ie2.Buf8(c3), r4.next_out = 0, r4.avail_out = c3), (n3 = (n3 = wa.inflate(r4, Wa.Z_NO_FLUSH)) === Wa.Z_NEED_DICT && u3 ? wa.inflateSetDictionary(this.strm, u3) : n3) === Wa.Z_BUF_ERROR && true === l3 && (n3 = Wa.Z_OK, l3 = false), n3 !== Wa.Z_STREAM_END && n3 !== Wa.Z_OK)
          return this.onEnd(n3), !(this.ended = true);
        !r4.next_out || 0 !== r4.avail_out && n3 !== Wa.Z_STREAM_END && (0 !== r4.avail_in || o3 !== Wa.Z_FINISH && o3 !== Wa.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i4 = function(e4, t4) {
          for (var n4 = (t4 = (t4 = t4 || e4.length) > e4.length ? e4.length : t4) - 1; 0 <= n4 && 128 == (192 & e4[n4]); )
            n4--;
          return !(n4 < 0 || 0 === n4) && n4 + xa[e4[n4]] > t4 ? n4 : t4;
        }(r4.output, r4.next_out), s4 = r4.next_out - i4, a3 = Ba(r4.output, i4), r4.next_out = s4, r4.avail_out = c3 - s4, s4 && ie2.arraySet(r4.output, r4.output, i4, s4, 0), this.onData(a3)) : this.onData(ie2.shrinkBuf(r4.output, r4.next_out))), 0 === r4.avail_in && 0 === r4.avail_out && (l3 = true);
      } while ((0 < r4.avail_in || 0 === r4.avail_out) && n3 !== Wa.Z_STREAM_END);
      return (o3 = n3 === Wa.Z_STREAM_END ? Wa.Z_FINISH : o3) === Wa.Z_FINISH ? (n3 = wa.inflateEnd(this.strm), this.onEnd(n3), this.ended = true, n3 === Wa.Z_OK) : o3 !== Wa.Z_SYNC_FLUSH || (this.onEnd(Wa.Z_OK), !(r4.avail_out = 0));
    }, Ja.prototype.onData = function(e3) {
      this.chunks.push(e3);
    }, Ja.prototype.onEnd = function(e3) {
      e3 === Wa.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = ie2.flattenChunks(this.chunks)), this.chunks = [], this.err = e3, this.msg = this.strm.msg;
    };
    var wn = {}, Xa = ((0, ie2.assign)(wn, { Inflate: Ja, inflate: za, inflateRaw: function(e3, t3) {
      return (t3 = t3 || {}).raw = true, za(e3, t3);
    }, ungzip: za }, Wa), wn), Za = e2(function e3(t3) {
      p3(this, e3), this._m = t3, this._n = "InflateModule", this._bLogForInflateOK = false, this._bLogForInflateError = false;
    }, [{ key: "inflate", value: function(e3) {
      var t3, e3 = new Uint8Array(e3).slice(4), n3 = Date.now();
      try {
        t3 = Xa.inflate(e3, { to: "string" }), this._bLogForInflateOK || (this._bLogForInflateOK = true, new P2("inflateOK").end());
      } catch (e4) {
        return this._bLogForInflateError ? void 0 : (this._bLogForInflateError = true, void new P2("inflateError").setMessage(e4).end());
      }
      var e3 = e3.length + 4, o3 = t3.length;
      return M2.d("inflate ok. zipped:".concat(e3, " unzipped:").concat(o3) + " compression ratio:".concat(Math.round(100 * (o3 - e3) / o3), "% cost:").concat(Date.now() - n3)), t3;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._bLogForInflateOK = false, this._bLogForInflateError = false;
    } }]), Qa = "Message", $a = "User", er = "Group", tr = "GroupMember", nr = ["count"], or = ["conversationID", "timePosition", "timePeriod"], ir = ["miniBirthday", "maxBirthday"], sr2 = q2(q2(q2(q2({}, Qa, G2.CS), $a, G2.USER_CS), er, G2.GRP_CS), tr, G2.MBR_CS), ar = (t2(dr, c2), e2(dr, [{ key: "searchCloudMessages", value: function(e3) {
      return this.search(Qa, e3);
    } }, { key: "searchCloudUsers", value: function(e3) {
      return this.search($a, e3);
    } }, { key: "searchCloudGroups", value: function(e3) {
      return this.search(er, e3);
    } }, { key: "searchCloudGroupMembers", value: function(e3) {
      return this.search(tr, e3);
    } }, { key: "search", value: function(i4, s4) {
      var a3 = this, e3 = "searchCloud".concat(i4, "s"), r4 = "".concat(this._n, ".").concat(e3);
      if (!s4)
        return E2({ code: k2.OPTIONS_IS_EMPTY, message: this.getErrMsg(k2.OPTIONS_IS_EMPTY, e3) });
      var t3 = s4.keywordList, n3 = rt2(t3), o3 = s4.count;
      if (s4.count && (o3 = parseInt(o3)), i4 === Qa && !n3 && !rt2(s4.senderUserIDList) && !rt2(s4.messageTypeList) || i4 !== Qa && !n3)
        throw M2.e("[".concat(e3, '] Missing required params: "keywordList".')), new Error("Params validate failed.");
      var c3 = Date.now(), u3 = new P2(e3), l3 = "keywordList:".concat(t3, " keywordListMatchType:").concat(s4.keywordListMatchType, " cursor:").concat(s4.cursor, " count:").concat(o3);
      return M2.l("".concat(r4, " ").concat(l3)), this.req({ P: sr2[i4], data: this._genParams(i4, s4) }).then(function(e4) {
        var t4 = e4.data, n4 = t4.code, t4 = t4.message;
        if (0 !== n4)
          return 60020 === (o4 = n4) ? o4 = "SearchUnable" : i4 !== Qa && 27003 === n4 ? o4 = "SearchParamsError" : i4 !== Qa && 60018 === n4 && (o4 = "SearchOverLimit"), o4 = a3.getErrMsg(o4) || t4, t4 = new L2({ code: n4, message: o4 }), u3.setMessage(l3).setError(t4).end(), E2(t4);
        a3.get(27).isCSPluginEnabled();
        var n4 = e4.data, o4 = n4.cursor, t4 = void 0 === o4 ? "" : o4, o4 = n4.totalCount, n4 = "totalCount:".concat(o4, " cost:").concat(tn(c3)), n4 = (M2.l("".concat(r4, " ok. cursor:").concat(t4, " ").concat(n4)), u3.setMessage("".concat(l3, " ").concat(n4)).end(), a3._genRes(i4, s4, e4.data));
        return T2({ searchResultList: n4, cursor: t4, totalCount: o4 });
      }).catch(function(e4) {
        return u3.setMessage(l3).setError(e4).end(), E2(e4);
      });
    } }, { key: "_genParams", value: function(e3, t3) {
      var n3 = t3.count, o3 = W2(t3, nr);
      return n3 && (o3.count = parseInt(n3)), e3 === Qa ? this._genMsgParams(o3) : (n3 = t3.keywordList, t3 = t3.keywordListMatchType, o3.keywords = n3, o3.keywordMatchType = "and" === t3 ? 1 : 0, e3 === $a ? this._genUserParams(o3) : o3);
    } }, { key: "_genMsgParams", value: function(e3) {
      var t3 = e3.conversationID, n3 = e3.timePosition, o3 = e3.timePeriod, e3 = W2(e3, or);
      return N3(t3) || (Gt2(t3) && (e3.account = t3.replace(R2.CONV_C2C, "")), Pt2(t3) && (e3.groupID = t3.replace(R2.CONV_GROUP, ""))), A2(o3) && 0 < o3 && (A2(n3) && 0 < n3 ? e3.startTime = n3 - o3 : e3.startTime = xe2() - o3), e3.startTime && e3.startTime < 0 && (e3.startTime = void 0), A2(n3) && 0 < n3 && (e3.endTime = n3), e3;
    } }, { key: "_genUserParams", value: function(e3) {
      var t3 = e3.miniBirthday, n3 = e3.maxBirthday, e3 = W2(e3, ir);
      return A2(t3) && (e3.miniBirthday = parseInt(t3), A2(n3) || (e3.maxBirthday = 4294967295)), A2(n3) && (e3.maxBirthday = parseInt(n3)), e3;
    } }, { key: "_genRes", value: function(e3, t3, n3) {
      switch (e3) {
        case Qa:
          return this._genMsgRes(n3.searchResult, !t3.conversationID);
        case $a:
          return this._genUserRes(n3.userList);
        case er:
          return this._genGrpRes(n3.groupList);
        case tr:
          return this._genMemberRes(n3.groupMemberList);
        default:
          return [];
      }
    } }, { key: "_genMsgRes", value: function(e3, s4) {
      var a3 = this.get(11);
      return O2(e3) && 0 !== e3.length ? e3.map(function(e4) {
        var t3 = e4.groupID, n3 = e4.userID, o3 = e4.messageCount, e4 = e4.messageList, e4 = void 0 === e4 ? [] : e4, n3 = t3 ? "".concat(R2.CONV_GROUP).concat(t3) : "".concat(R2.CONV_C2C).concat(n3), i4 = { conversationID: n3, messageCount: o3, messageList: [] };
        return s4 && 1 < o3 || 0 < (o3 = e4.filter(function(e5) {
          return !!e5;
        })).length && (e4 = a3.onRoamingMessage(o3, n3, false), t3 && e4.reverse(), i4.messageList = e4, i4.messageCount = e4.length), i4;
      }) : [];
    } }, { key: "_genUserRes", value: function(e3) {
      var t3 = this.get(4)._profileHandler;
      if (!O2(e3))
        return [];
      for (var n3 = [], o3 = 0, i4 = e3.length; o3 < i4; o3++) {
        var s4 = e3[o3], a3 = s4.userID, s4 = s4.profileItems;
        "@TLS#NOT_FOUND" !== a3 && "" !== a3 && (a3 = t3._update(a3, t3._getLatestProfileFromResponse(a3, s4)).latestProfile, n3.push(a3));
      }
      return n3;
    } }, { key: "_genGrpRes", value: function(e3) {
      if (!O2(e3))
        return [];
      for (var t3 = [], n3 = 0, o3 = e3.length; n3 < o3; n3++)
        e3[n3] && e3[n3].groupID && t3.push(new qo(e3[n3]));
      return t3;
    } }, { key: "_genMemberRes", value: function(e3) {
      if (!O2(e3))
        return [];
      for (var t3, n3, o3, i4, s4, a3, r4 = /* @__PURE__ */ new Map(), c3 = 0, u3 = e3.length; c3 < u3; c3++)
        e3[c3] && e3[c3].userID && e3[c3].groupID && (n3 = (t3 = e3[c3]).groupID, i4 = t3.name, s4 = t3.type, a3 = t3.avatar, o3 = t3.nick, i4 = { groupID: n3, name: i4, type: s4, avatar: a3 }, s4 = { userID: t3.userID, nick: o3, nameCard: t3.nameCard }, r4.has(n3) ? ((a3 = r4.get(n3)).memberList.push(s4), r4.set(n3, a3)) : r4.set(n3, { groupInfo: i4, memberList: [s4] }));
      return d2(r4.values());
    } }])), rr = e2(function e3(t3) {
      var n3 = this;
      p3(this, e3);
      var o3, i4 = new P2("sdkConstruct"), s4 = (this._n = "ModuleManager", this._isReady = false, this._reason = k2.USER_NOT_LOGGED_IN, this._startLoginTs = 0, this._map = /* @__PURE__ */ new Map(), this._optionalModuleMap = /* @__PURE__ */ new Map(), this._codeMsgForTUIMap = /* @__PURE__ */ new Map(), this._iEmitter = null, this._oEmitter = null, this._checkCount = 0, this._checkTimer = -1, this._map.set(12, new pi(this, t3)), this._map.set(37, new Za(this)), this._map.set(15, new Si(this)), this._map.set(27, new Ws(this)), this._map.set(23, new Rs(this)), this._map.set(24, new Hs(this)), this._map.set(26, new Us(this)), this._map.set(21, new _s(this)), this._map.set(20, new ks2(this)), this._map.set(1, new hi(this)), this._map.set(2, new xi(this)), this._map.set(3, new Vi(this)), this._map.set(34, new Bi(this)), this._map.set(31, new Hi(this)), this._map.set(4, new di(this)), this._map.set(6, new So(this)), this._map.set(11, new Ko(this)), this._map.set(7, new oi(this)), this._map.set(10, new ai(this)), this._map.set(13, new Ci(this)), this._map.set(32, new Xs(this)), this._map.set(14, new Di(this)), this._map.set(17, new Gi(this)), this._map.set(18, new Ki(this)), this._map.set(19, new Wi(this)), this._map.set(25, new As(this)), this._map.set(8, new Bs(this)), this._map.set(28, new Ys(this)), this._map.set(36, new js(this)), this._map.set(29, new Js(this)), this._map.set(30, new zs(this)), this._map.set(33, new oa(this)), this._map.set(35, new ra(this)), this._map.set(38, new ar(this)), this._eventThrottleMap = /* @__PURE__ */ new Map(), this._eventThrottling = t3.eventThrottling, this._map.get(12).isPartialUpdatedConvs() && (this._eventThrottling = false), m2(t3.modules) ? (Object.keys(t3.modules).forEach(function(e4) {
        o3 = t3.modules[e4], "group-module" === e4 ? n3._map.set(7, new o3(n3)) : "relationship-module" === e4 ? n3._map.set(8, new o3(n3)) : "signaling-module" === e4 ? n3._map.set(33, new o3(n3)) : "follow-module" === e4 ? n3._map.set(35, new o3(n3)) : "cloud-search-module" === e4 && n3._map.set(38, new o3(n3)), n3._optionalModuleMap.set(e4, 1);
      }), this._map.get(12).setUsingChatCore(true)) : this._map.has(7) || this._map.get(12).setUsingChatCore(true), t3.instanceID), a3 = t3.SDKAppID, r4 = this._map.get(12).isIntl(), c3 = this._map.get(12).isUsingChatCore(), s4 = "instanceID:".concat(s4, " SDKAppID:").concat(a3, " isIntl:").concat(r4, " isUsingChatCore:").concat(c3, " host:").concat(qt2()) + " isIOSWebView:".concat(Ge2, " platform:").concat(ye2, " canIUseInflate:").concat(this.canIUseInflate()) + " workerAvailable:".concat(Ae2, " eventThrottling:").concat(this._eventThrottling, " UserAgent:").concat(Me2);
      P2.bindEventStatModule(this._map.get(14)), P2.bindNetMonitorModule(this._map.get(15)), i4.setMessage("".concat(s4, " ").concat(function() {
        var t4 = "";
        if (v3)
          try {
            var e4 = I2.getSystemInfoSync(), n4 = e4.model, o4 = e4.version, i5 = e4.system, s5 = e4.platform, a4 = e4.SDKVersion, t4 = "model:".concat(n4, " version:").concat(o4, " system:").concat(i5, " platform:").concat(s5, " SDKVersion:").concat(a4);
          } catch (e5) {
            t4 = "";
          }
        return t4;
      }())).end(), M2.i("SDK ".concat(s4)), L2.prototype._getErrMsg = this.getErrMsg.bind(this), this._readyList = void 0, this._ssoLogForReady = null, this._initReadyList();
    }, [{ key: "_startTimer", value: function() {
      var e3 = this._map.get(24), t3 = e3.isWorkerEnabled();
      M2.l("".concat(this._n, ".startTimer isWorkerEnabled:").concat(t3, " seed:").concat(this._checkTimer)), t3 ? e3.startWorkerTimer() : this._startMainThreadTimer();
    } }, { key: "_startMainThreadTimer", value: function() {
      this._checkTimer < 0 && (this._checkTimer = setInterval(this.onCheckTimer.bind(this), 1e3)), M2.l("".concat(this._n, "._startMainThreadTimer seed:").concat(this._checkTimer));
    } }, { key: "stopTimer", value: function() {
      var e3 = this._map.get(24), t3 = e3.isWorkerEnabled();
      M2.l("".concat(this._n, ".stopTimer isWorkerEnabled:").concat(t3, " seed:").concat(this._checkTimer)), t3 ? e3.stopWorkerTimer() : this._stopMainThreadTimer();
    } }, { key: "_stopMainThreadTimer", value: function() {
      M2.l("".concat(this._n, "._stopMainThreadTimer")), 0 < this._checkTimer && (clearInterval(this._checkTimer), this._checkTimer = -1, this._checkCount = 0);
    } }, { key: "_stopMainThreadSocket", value: function() {
      M2.l("".concat(this._n, "._stopMainThreadSocket"));
      var e3 = this._map.get(21);
      e3.setIsWorkerEnabled(true), e3.reConnect();
    } }, { key: "_startMainThreadSocket", value: function() {
      M2.l("".concat(this._n, "._startMainThreadSocket"));
      var e3 = this._map.get(21);
      e3.setIsWorkerEnabled(false), e3.reConnect();
    } }, { key: "onWorkerTimerEnabled", value: function() {
      M2.l("".concat(this._n, ".onWorkerTimerEnabled, disable main thread timer and socket")), this._stopMainThreadTimer(), this._stopMainThreadSocket();
    } }, { key: "onWorkerTimerDisabled", value: function() {
      M2.l("".concat(this._n, ".onWorkerTimerDisabled, enable main thread timer and socket")), this._startMainThreadTimer(), this._startMainThreadSocket();
    } }, { key: "onCheckTimer", value: function() {
      this._checkCount += 1;
      var e3, t3 = F2(this._map);
      try {
        for (t3.s(); !(e3 = t3.n()).done; ) {
          var n3 = j2(e3.value, 2)[1];
          n3.onCheckTimer && n3.onCheckTimer(this._checkCount);
        }
      } catch (e4) {
        t3.e(e4);
      } finally {
        t3.f();
      }
    } }, { key: "_initReadyList", value: function() {
      var t3 = this;
      this._readyList = [this._map.get(1)], this._readyList.forEach(function(e3) {
        e3.ready(function() {
          return t3._onModuleReady();
        });
      });
    } }, { key: "_onModuleReady", value: function() {
      var e3, t3, n3 = true;
      this._readyList.forEach(function(e4) {
        e4.isReady() || (n3 = false);
      }), n3 && !this._isReady && (this._isReady = true, this._oEmitter.emit(h2.SDK_READY), e3 = Date.now() - this._startLoginTs, M2.w("SDK is ready. cost ".concat(e3, " ms")), this._startLoginTs = Date.now(), t3 = this._ssoLogForReady.getStartTs() + Be2, this._ssoLogForReady.setMessage(e3).start(t3).end());
    } }, { key: "login", value: function() {
      0 === this._startLoginTs && (qe2(), this._startLoginTs = Date.now(), this._startTimer(), this._map.get(15).start(), this._ssoLogForReady = new P2("sdkReady"), this._reason = k2.LOGGING_IN);
    } }, { key: "onLoginFailed", value: function() {
      this._startLoginTs = 0;
    } }, { key: "getOEmitInst", value: function() {
      return null === this._oEmitter && (this._oEmitter = new Ai(), e3 = this._oEmitter, Vn = e3, this._oEmitter._emit = this._oEmitter.emit, this._oEmitter.emit = (function(e4, t3) {
        var n3, o3, i4 = this;
        this._canIUseSignaling() && (e4 === h2.MESSAGE_RECEIVED && this.get(33).onNewMessageList(t3), e4 === h2.MESSAGE_MODIFIED) && this.get(33).onMessageModified(t3), e4 === h2.CONVERSATION_LIST_UPDATED || e4 === h2.FRIEND_LIST_UPDATED || e4 === h2.GROUP_LIST_UPDATED || e4 === h2.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED ? false !== this._eventThrottling ? this._eventThrottleMap.has(e4) ? (n3 = Date.now()) - (o3 = this._eventThrottleMap.get(e4)).last <= 1e3 ? (-1 < o3.timeoutID && clearTimeout(o3.timeoutID), o3.timeoutID = setTimeout(function() {
          o3.last = Date.now(), i4._oEmitter._emit.apply(i4._oEmitter, [e4, { name: e4, data: i4._getEventData(e4) }]);
        }, 1e3)) : (o3.last = n3, this._oEmitter._emit.apply(this._oEmitter, [e4, { name: e4, data: this._getEventData(e4) }])) : (this._eventThrottleMap.set(e4, { last: Date.now(), timeoutID: -1 }), this._oEmitter._emit.apply(this._oEmitter, [e4, { name: e4, data: this._getEventData(e4) }])) : this._oEmitter._emit.apply(this._oEmitter, [e4, { name: e4, data: this._getEventData(e4) }]) : this._oEmitter._emit.apply(this._oEmitter, [e4, { name: e4, data: t3 }]);
      }).bind(this)), this._oEmitter;
      var e3;
    } }, { key: "_canIUseSignaling", value: function() {
      var e3 = this.get(33);
      return !!e3 && e3.canIUseSignaling();
    } }, { key: "_getEventData", value: function(e3) {
      return e3 === h2.CONVERSATION_LIST_UPDATED ? this._map.get(12).isPartialUpdatedConvs() ? this._map.get(11).getPartialUpdatedConvs() : this._map.get(11).getLocalConvList() : e3 === h2.FRIEND_LIST_UPDATED ? this._map.get(8).getLocalFriendList(false) : e3 === h2.GROUP_LIST_UPDATED ? this._map.get(7).getLocalGroupList() : e3 === h2.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED ? this._map.get(11).getTotalUnreadCount() : e3 === h2.CONVERSATION_ID_LIST_UPDATED ? this._map.get(11).getUpdatedConvIDList() : void 0;
    } }, { key: "getIEmitInst", value: function() {
      return null === this._iEmitter && (this._iEmitter = new Ai(), this._iEmitter._emit = this._iEmitter.emit, this._iEmitter.emit = (function(e3, t3) {
        e3 = m2(t3) && t3.data ? [e3, { name: e3, data: t3.data }] : [e3, { name: e3, data: t3 }];
        this._iEmitter._emit.apply(this._iEmitter, e3);
      }).bind(this)), this._iEmitter;
    } }, { key: "hasModule", value: function(e3) {
      return this._map.has(e3);
    } }, { key: "get", value: function(e3) {
      return this._map.get(e3);
    } }, { key: "canIUseModule", value: function(e3) {
      return !this._map.get(12).isUsingChatCore() || this._optionalModuleMap.has(e3);
    } }, { key: "canIUseInflate", value: function() {
      return !!this._map.get(37);
    } }, { key: "isReady", value: function() {
      return this._isReady;
    } }, { key: "isIntl", value: function() {
      return this.get(12).isIntl();
    } }, { key: "getNotReadyReason", value: function() {
      return this._reason;
    } }, { key: "setNotReadyReason", value: function(e3) {
      this._reason = e3;
    } }, { key: "getErrMsg", value: function(e3, t3, n3) {
      return this._map.get(32).get({ key: e3, replacement1: t3, replacement2: n3, isIntl: this.isIntl() });
    } }, { key: "warn", value: function(e3, t3, n3) {
      e3 = this.getErrMsg(e3, t3, n3);
      e3 && M2.w(e3);
    } }, { key: "onError", value: function(e3) {
      var t3 = "code:".concat(e3.code, " message:").concat(e3.message);
      M2.w("Oops! ".concat(t3)), new P2("error").setMessage(t3).setLevel("error").end(), this.getOEmitInst().emit(h2.ERROR, e3);
    } }, { key: "restartTimer", value: function() {
      M2.l("".concat(this._n, ".restartTimer")), this.stopTimer(), this._startTimer();
      var e3 = this.get(7);
      e3 && e3.restartPolling();
    } }, { key: "getTimerID", value: function() {
      var e3 = this._map.get(24);
      return e3.isWorkerEnabled() ? e3.getTimerID() : this._checkTimer;
    } }, { key: "getPollingTimerID", value: function(e3) {
      return this._map.get(7).getPollingTimerID(e3);
    } }, { key: "statTUIKeyFeatures", value: function(e3) {
      var t3 = e3.code, e3 = e3.msg, e3 = void 0 === e3 ? "" : e3, n3 = t3 + e3;
      this._codeMsgForTUIMap.has(n3) || (this._codeMsgForTUIMap.set(n3, 1), n3 = this.get(12).getUIPlatform(), new P2("tui_key_features").setCode(t3).setMessage(e3).setUIPlatform(n3).end());
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), qe2();
      var e3, t3 = F2(this._map);
      try {
        for (t3.s(); !(e3 = t3.n()).done; ) {
          var n3 = j2(e3.value, 2)[1];
          n3.reset && n3.reset();
        }
      } catch (e4) {
        t3.e(e4);
      } finally {
        t3.f();
      }
      this._startLoginTs = 0, this._initReadyList(), this._isReady = false, this.stopTimer(), this._oEmitter.emit(h2.SDK_NOT_READY);
      var o3, i4 = F2(this._eventThrottleMap);
      try {
        for (i4.s(); !(o3 = i4.n()).done; ) {
          var s4 = j2(o3.value, 2)[1];
          -1 < s4.timeoutID && clearTimeout(s4.timeoutID);
        }
      } catch (e4) {
        i4.e(e4);
      } finally {
        i4.f();
      }
      this._eventThrottleMap.clear(), this._codeMsgForTUIMap.clear();
    } }]), cr = e2(function e3(t3) {
      p3(this, e3), this._funcMap = /* @__PURE__ */ new Map(), this._m = t3, this._n = "SafetyCallback", this._reportCount = 0;
    }, [{ key: "defense", value: function(e3, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : void 0;
      if ("string" != typeof e3)
        return null;
      if (0 === e3.length)
        return null;
      if ("function" != typeof t3)
        return null;
      if (this._funcMap.has(e3) && this._funcMap.get(e3).has(t3))
        return this._funcMap.get(e3).get(t3);
      this._funcMap.has(e3) || this._funcMap.set(e3, /* @__PURE__ */ new Map());
      var o3 = null;
      return this._funcMap.get(e3).has(t3) ? o3 = this._funcMap.get(e3).get(t3) : (o3 = this._pack(e3, t3, n3), this._funcMap.get(e3).set(t3, o3)), o3;
    } }, { key: "defenseOnce", value: function(e3, t3) {
      return "function" != typeof t3 ? null : this._pack(e3, t3, 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : void 0);
    } }, { key: "find", value: function(e3, t3) {
      return "string" != typeof e3 || 0 === e3.length || "function" != typeof t3 ? null : this._funcMap.has(e3) && this._funcMap.get(e3).has(t3) ? this._funcMap.get(e3).get(t3) : (this._m.warn("ListenerFnNotFound", e3), null);
    } }, { key: "delete", value: function(e3, t3) {
      return "function" == typeof t3 && !!this._funcMap.has(e3) && !!this._funcMap.get(e3).has(t3) && (this._funcMap.get(e3).delete(t3), 0 === this._funcMap.get(e3).size && this._funcMap.delete(e3), true);
    } }, { key: "_pack", value: function(o3, e3, i4) {
      var s4 = this;
      return function() {
        try {
          e3.apply(i4, Array.from(arguments));
        } catch (e4) {
          var t3 = Object.values(h2).indexOf(o3), n3 = "CallbackError";
          -1 !== t3 && (t3 = Object.keys(h2)[t3], s4._m.warn(n3, t3, e4)), s4._reportCount < 5 && (new P2(n3).setMessage("eventName:".concat(o3)).setMoreMessage(e4.message).end(), s4._reportCount += 1);
        }
      };
    } }, { key: "destroy", value: function() {
      this._funcMap.clear();
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._reportCount = 0;
    } }]), ur = e2(function e3(t3) {
      p3(this, e3);
      t3 = { SDKAppID: t3.SDKAppID, unlimitedAVChatRoom: t3.unlimitedAVChatRoom || false, scene: t3.scene || "", oversea: t3.oversea || false, instanceID: Ft2(), devMode: t3.devMode || false, testEnv: t3.testEnv || false, proxyServer: t3.proxyServer || void 0, fileUploadProxy: t3.fileUploadProxy || void 0, fileDownloadProxy: t3.fileDownloadProxy || t3.fileUploadProxy || void 0, eventThrottling: false !== t3.eventThrottling, partialUpdatedConversations: true === t3.partialUpdatedConversations, disableIndependentDomain: true === t3.disableIndependentDomain, modules: t3.modules || void 0 };
      this._m = new rr(t3), this._safetyCallbackFactory = new cr(this._m);
    }, [{ key: "onError", value: function(e3) {
      this._m.onError(e3);
    } }, { key: "login", value: function(e3) {
      return this._m.login(), this._get(1).login(e3);
    } }, { key: "logout", value: function() {
      var t3 = this;
      return this._get(1).logout().then(function(e3) {
        return t3._safetyCallbackFactory.reset(), t3._m.reset(), e3;
      });
    } }, { key: "getLoginUser", value: function() {
      return this._get(1).getLoginUser();
    } }, { key: "getServerTime", value: function() {
      return He2();
    } }, { key: "isReady", value: function() {
      return this._m.isReady();
    } }, { key: "isIntl", value: function() {
      return this._m.isIntl();
    } }, { key: "getNotReadyReason", value: function() {
      return this._m.getNotReadyReason();
    } }, { key: "getErrMsg", value: function(e3, t3, n3) {
      return this._m.getErrMsg(e3, t3, n3);
    } }, { key: "_get", value: function(e3) {
      return this._m.get(e3);
    } }, { key: "destroy", value: function() {
      var e3 = this, t3 = this._get(12), n3 = t3.getSDKAppID();
      return M2.w("destroy ".concat(n3, " ").concat(t3.getInstanceID())), this.logout().finally(function() {
        e3._safetyCallbackFactory.destroy(), e3._m.stopTimer(), e3._get(24).terminate(), e3._get(21).dealloc(), e3._m.getOEmitInst().emit(h2.SDK_DESTROY, { SDKAppID: n3 });
      });
    } }, { key: "on", value: function(e3, t3, n3) {
      M2.d("on", "eventName:".concat(e3)), this._m.getOEmitInst().on(e3, this._safetyCallbackFactory.defense(e3, t3, n3), n3);
    } }, { key: "once", value: function(e3, t3, n3) {
      M2.d("once", "eventName:".concat(e3)), this._m.getOEmitInst().once(e3, this._safetyCallbackFactory.defenseOnce(e3, t3, n3), n3 || this);
    } }, { key: "off", value: function(e3, t3, n3, o3) {
      M2.d("off", "eventName:".concat(e3));
      var i4 = this._safetyCallbackFactory.find(e3, t3);
      null !== i4 && (this._m.getOEmitInst().off(e3, i4, n3, o3), this._safetyCallbackFactory.delete(e3, t3));
    } }, { key: "registerPlugin", value: function(e3) {
      (N3(e3["tim-push"]) ? N3(e3["tim-offline-push-plugin"]) ? this._get(18) : this._get(28) : this._get(36)).registerPlugin(e3);
    } }, { key: "setLogLevel", value: function(e3) {
      var t3;
      e3 <= 0 && ((t3 = this.getErrMsg("TIM_ASCII_ART")) && index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", t3), (t3 = this.getErrMsg("API_REFER")) && (Zt2() ? index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", "%c ".concat("IM SDK API ->", " %c"), "background:#ff9d00; padding:1px; border-radius:3px; color: #fff", "background:transparent", t3) : index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", "IM SDK API ->", t3)), (t3 = this.getErrMsg("DOCS_GUIDE")) && index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", t3), t3 = this.getErrMsg("IOS_WEBVIEW_WARNING"), Ge2) && t3 && index.__f__("warn", "at node_modules/@tencentcloud/chat/index.js:1", t3), M2.setLevel(e3);
    } }, { key: "createTextMessage", value: function(e3) {
      return this._get(2).createTextMessage(e3);
    } }, { key: "createTextAtMessage", value: function(e3) {
      return this._get(2).createTextMessage(e3);
    } }, { key: "createImageMessage", value: function(e3) {
      return this._get(2).createImageMessage(e3);
    } }, { key: "createAudioMessage", value: function(e3) {
      return this._get(2).createAudioMessage(e3);
    } }, { key: "createVideoMessage", value: function(e3) {
      return this._get(2).createVideoMessage(e3);
    } }, { key: "createCustomMessage", value: function(e3) {
      return this._get(2).createCustomMessage(e3);
    } }, { key: "createFaceMessage", value: function(e3) {
      return this._get(2).createFaceMessage(e3);
    } }, { key: "createFileMessage", value: function(e3) {
      return this._get(2).createFileMessage(e3);
    } }, { key: "createLocationMessage", value: function(e3) {
      return this._get(2).createLocationMessage(e3);
    } }, { key: "createMergerMessage", value: function(e3) {
      return this._get(2).createMergerMessage(e3);
    } }, { key: "downloadMergerMessage", value: function(e3) {
      return e3.type !== R2.MSG_MERGER ? E2({ code: k2.MSG_MERGER_TYPE_INVALID }) : S2(e3.payload.downloadKey) ? E2({ code: k2.MSG_MERGER_KEY_INVALID }) : this._get(2).downloadMergerMessage(e3).catch(function(e4) {
        return E2({ code: k2.MSG_MERGER_DOWNLOAD_FAIL });
      });
    } }, { key: "createForwardMessage", value: function(e3) {
      return this._get(2).createForwardMessage(e3);
    } }, { key: "sendMessage", value: function(e3, t3) {
      return e3 instanceof Do ? this._get(2).sendMessageInstance(e3, t3) : E2({ code: k2.MSG_INSTANCE_REQUIRED });
    } }, { key: "callExperimentalAPI", value: function(e3, t3) {
      return "sendComboMessage" === e3 ? this._get(31).sendMessage(t3) : "handleGroupInvitation" === e3 ? this._get(7).handleGroupInvitation(t3) : "isCommercialAbilityEnabled" === e3 ? this._get(27).isFeatureEnabled(t3) : "isFeatureEnabledForStat" === e3 ? this._get(27).isFeatureEnabledForStat(t3) : "isIntl" === e3 ? this.isIntl() : "sendTRTCCustomData" === e3 || "sendRoomCustomData" === e3 ? this._get(30).sendTRTCCustomData(t3) : "getTimerID" === e3 ? this._m.getTimerID() : "getPollingTimerID" === e3 ? this._m.getPollingTimerID(t3) : "setApplicationID" === e3 ? (this._get(12).setApplicationID(t3), void this._get(20).updateProtocolConfig()) : "getServerConfig" === e3 ? this._get(23).getServerConfig(t3) : "canIUseModule" === e3 ? this._m.canIUseModule(t3) : "startMessageLongPolling" === e3 ? this._get(7).startMessageLongPolling(t3) : "stopMessageLongPolling" === e3 ? this._get(7).stopMessageLongPolling(t3) : "disableMessagePullOnInvite" === e3 ? this._get(11).disableMsgPullOnInvite(t3) : "clearLocalMessage" === e3 ? this._get(11).clearMemMsg(t3, false) : "setCustomLoginInfo" === e3 ? this._get(12).setCustomLoginInfo(t3) : "statTUIKeyFeatures" === e3 ? this._m.statTUIKeyFeatures(t3) : "getGroupReceiptsByUsers" === e3 ? this._get(7).getGroupReceiptsByUsers(t3) : E2({ code: k2.INVALID_OPERATION });
    } }, { key: "revokeMessage", value: function(e3) {
      return this._get(2).revokeMessage(e3);
    } }, { key: "resendMessage", value: function(e3, t3) {
      return e3 instanceof Do ? this._get(2).resendMessage(e3, t3) : E2({ code: k2.MSG_INSTANCE_REQUIRED });
    } }, { key: "deleteMessage", value: function(e3) {
      return this._get(2).deleteMessage(e3);
    } }, { key: "translateText", value: function(e3) {
      return this._get(2).translateText(e3);
    } }, { key: "convertVoiceToText", value: function(e3) {
      return this._get(2).convertVoiceToText(e3);
    } }, { key: "setMessageExtensions", value: function(e3, t3) {
      return this._get(3).setMessageExtensions(e3, t3);
    } }, { key: "getMessageExtensions", value: function(e3) {
      return this._get(3).getMessageExtensions(e3);
    } }, { key: "deleteMessageExtensions", value: function(e3, t3) {
      return this._get(3).deleteMessageExtensions(e3, t3);
    } }, { key: "addMessageReaction", value: function(e3, t3) {
      return this._get(34).addMessageReaction(e3, t3);
    } }, { key: "removeMessageReaction", value: function(e3, t3) {
      return this._get(34).removeMessageReaction(e3, t3);
    } }, { key: "getMessageReactions", value: function(e3) {
      return this._get(34).getMessageReactions(e3);
    } }, { key: "getAllUserListOfMessageReaction", value: function(e3) {
      return this._get(34).getAllUserListOfMessageReaction(e3);
    } }, { key: "modifyMessage", value: function(e3) {
      return this._get(2).modifyRemoteMessage(e3);
    } }, { key: "getMessageList", value: function(e3) {
      return this._get(11).getMessageList(e3);
    } }, { key: "getMessageListHopping", value: function(e3) {
      return this._get(11).getMessageListHopping(e3);
    } }, { key: "sendMessageReadReceipt", value: function(e3) {
      return this._get(11).sendReadReceipt(e3);
    } }, { key: "getMessageReadReceiptList", value: function(e3) {
      return this._get(11).getReadReceiptList(e3);
    } }, { key: "getGroupMessageReadMemberList", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.getReadReceiptDetail(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "findMessage", value: function(e3) {
      return this._get(11).findMessage(e3);
    } }, { key: "setMessageRead", value: function(e3) {
      return this._get(11).setMessageRead(e3);
    } }, { key: "getConversationList", value: function(e3) {
      return this._get(11).getConvList(e3);
    } }, { key: "getConversationProfile", value: function(e3) {
      return this._get(11).getConversationProfile(e3);
    } }, { key: "deleteConversation", value: function(e3) {
      return this._get(11).deleteConversation(e3);
    } }, { key: "setConversationDraft", value: function(e3) {
      return this._get(11).setConvDraft(e3);
    } }, { key: "clearHistoryMessage", value: function(e3) {
      return this._get(11).clearHistoryMessage(e3);
    } }, { key: "pinConversation", value: function(e3) {
      return this._get(11).pinConversation(e3);
    } }, { key: "setAllMessageRead", value: function(e3) {
      return this._get(11).setAllMessageRead(e3);
    } }, { key: "setMessageRemindType", value: function(e3) {
      return this._get(11).setMessageRemindType(e3);
    } }, { key: "setAllReceiveMessageOpt", value: function(e3) {
      return this._get(11).setAllRcvMsgOpt(e3);
    } }, { key: "getAllReceiveMessageOpt", value: function() {
      return this._get(11).getAllRcvMsgOpt();
    } }, { key: "getTotalUnreadMessageCount", value: function() {
      return this._get(11).getTotalUnreadCount();
    } }, { key: "setConversationCustomData", value: function(e3) {
      return this._get(11).setConvCustomData(e3);
    } }, { key: "markConversation", value: function(e3) {
      return this._get(11).markConv(e3);
    } }, { key: "getConversationGroupList", value: function() {
      return this._get(11).getConvGroupList();
    } }, { key: "createConversationGroup", value: function(e3) {
      return this._get(11).createConvGroup(e3);
    } }, { key: "deleteConversationGroup", value: function(e3) {
      return this._get(11).deleteConvGroup(e3);
    } }, { key: "renameConversationGroup", value: function(e3) {
      return this._get(11).renameConvGroup(e3);
    } }, { key: "addConversationsToGroup", value: function(e3) {
      return this._get(11).addConvsToGroup(e3);
    } }, { key: "deleteConversationsFromGroup", value: function(e3) {
      return this._get(11).deleteConvsFromGroup(e3);
    } }, { key: "searchCloudMessages", value: function(e3) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudMessages(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchCloudUsers", value: function(e3) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudUsers(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchCloudGroups", value: function(e3) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudGroups(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchCloudGroupMembers", value: function(e3) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudGroupMembers(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMyProfile", value: function() {
      return this._get(4).getMyProfile();
    } }, { key: "getUserProfile", value: function(e3) {
      return this._get(4).getUserProfile(e3);
    } }, { key: "updateMyProfile", value: function(e3) {
      return this._get(4).updateMyProfile(e3);
    } }, { key: "getBlacklist", value: function() {
      return this._get(4).getLocalBlacklist();
    } }, { key: "addToBlacklist", value: function(e3) {
      return this._get(4).addBlacklist(e3);
    } }, { key: "removeFromBlacklist", value: function(e3) {
      return this._get(4).deleteBlacklist(e3);
    } }, { key: "setSelfStatus", value: function(e3) {
      return this._get(4).setSelfStatus(e3);
    } }, { key: "getUserStatus", value: function(e3) {
      return this._get(4).getUserStatus(e3);
    } }, { key: "subscribeUserStatus", value: function(e3) {
      return this._get(4).subscribeUserStatus(e3);
    } }, { key: "unsubscribeUserStatus", value: function(e3) {
      return this._get(4).unsubscribeUserStatus(e3);
    } }, { key: "getFriendList", value: function() {
      var e3 = this._get(8);
      return e3 ? e3.getLocalFriendList() : E2({ code: k2.NO_MODULE });
    } }, { key: "addFriend", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.addFriend(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteFriend", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.deleteFriend(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "checkFriend", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.checkFriend(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getFriendProfile", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.getFriendProfile(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "updateFriend", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.updateFriend(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getFriendApplicationList", value: function() {
      var e3 = this._get(8);
      return e3 ? e3.getLocalFriendApplicationList() : E2({ code: k2.NO_MODULE });
    } }, { key: "acceptFriendApplication", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.acceptFriendApplication(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "refuseFriendApplication", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.refuseFriendApplication(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteFriendApplication", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.deleteFriendApplication(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "setFriendApplicationRead", value: function() {
      var e3 = this._get(8);
      return e3 ? e3.setFriendApplicationRead() : E2({ code: k2.NO_MODULE });
    } }, { key: "getFriendGroupList", value: function() {
      var e3 = this._get(8);
      return e3 ? e3.getLocalFriendGroupList() : E2({ code: k2.NO_MODULE });
    } }, { key: "createFriendGroup", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.createFriendGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteFriendGroup", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.deleteFriendGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "addToFriendGroup", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.addToFriendGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "removeFromFriendGroup", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.removeFromFriendGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "renameFriendGroup", value: function(e3) {
      var t3 = this._get(8);
      return t3 ? t3.renameFriendGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "followUser", value: function(e3) {
      var t3 = this._get(35);
      return t3 ? t3.followUser(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "unfollowUser", value: function(e3) {
      var t3 = this._get(35);
      return t3 ? t3.unfollowUser(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMyFollowersList", value: function(e3) {
      var t3 = this._get(35);
      return t3 ? t3.getMyFollowersList(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMyFollowingList", value: function(e3) {
      var t3 = this._get(35);
      return t3 ? t3.getMyFollowingList(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMutualFollowersList", value: function(e3) {
      var t3 = this._get(35);
      return t3 ? t3.getMutualFollowersList(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getUserFollowInfo", value: function(e3) {
      var t3 = this._get(35);
      return t3 ? t3.getUserFollowInfo(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "checkFollowType", value: function(e3) {
      var t3 = this._get(35);
      return t3 ? t3.checkFollowType(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupList", value: function() {
      var e3 = this._get(7);
      return e3 ? e3.getGroupList() : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupProfile", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupProfile(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "createGroup", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.createGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "dismissGroup", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.dismissGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "updateGroupProfile", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.updateGroupProfile(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "joinGroup", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.joinGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "quitGroup", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.quitGroup(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchGroupByID", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.searchGroupByID(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupOnlineMemberCount", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupOnlineMemberCount(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "changeGroupOwner", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.changeGroupOwner(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupApplicationList", value: function() {
      var e3 = this._get(7);
      return e3 ? e3.getGroupApplicationList() : E2({ code: k2.NO_MODULE });
    } }, { key: "handleGroupApplication", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.handleGroupApplication(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "initGroupAttributes", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.initGroupAttributes(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupAttributes", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupAttributes(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteGroupAttributes", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.deleteGroupAttributes(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupAttributes", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupAttributes(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupCounters", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupCounters(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "increaseGroupCounter", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.increaseGroupCounter(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "decreaseGroupCounter", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.decreaseGroupCounter(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupCounters", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupCounters(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupMemberList", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupMemberList(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupMemberProfile", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupMemberProfile(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "addGroupMember", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.addGroupMember(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteGroupMember", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.deleteGroupMember(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberMuteTime", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberMuteTime(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberRole", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberRole(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberNameCard", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberNameCard(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberCustomField", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberCustomField(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "markGroupMemberList", value: function(e3) {
      var t3 = this._get(7);
      return t3 ? t3.markGroupMemberList(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getJoinedCommunityList", value: function() {
      return this._get(10).getJoinedCommunityList();
    } }, { key: "createTopicInCommunity", value: function(e3) {
      return this._get(10).createTopicInCommunity(e3);
    } }, { key: "deleteTopicFromCommunity", value: function(e3) {
      return this._get(10).deleteTopicFromCommunity(e3);
    } }, { key: "updateTopicProfile", value: function(e3) {
      return this._get(10).updateTopicProfile(e3);
    } }, { key: "getTopicList", value: function(e3) {
      return this._get(10).getTopicList(e3);
    } }, { key: "addSignalingListener", value: function(e3, t3, n3) {
      var o3 = this._get(33);
      o3 && o3.addSignalingListener(e3, this._safetyCallbackFactory.defense(e3, t3, n3), n3);
    } }, { key: "removeSignalingListener", value: function(e3, t3, n3) {
      var o3, i4 = this._safetyCallbackFactory.find(e3, t3);
      null !== i4 && (o3 = this._get(33)) && (o3.removeSignalingListener(e3, i4, n3), this._safetyCallbackFactory.delete(e3, t3));
    } }, { key: "invite", value: function(e3) {
      var t3 = this._get(33);
      return t3 ? t3.invite(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "inviteSync", value: function(e3, t3, n3) {
      var o3 = this._get(33);
      return o3 ? o3.inviteSync(e3, t3, n3) : "";
    } }, { key: "inviteInGroup", value: function(e3) {
      var t3 = this._get(33);
      return t3 ? t3.invite(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "inviteInGroupSync", value: function(e3, t3, n3) {
      var o3 = this._get(33);
      return o3 ? o3.inviteSync(e3, t3, n3) : "";
    } }, { key: "cancel", value: function(e3) {
      var t3 = this._get(33);
      return t3 ? t3.cancel(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "accept", value: function(e3) {
      var t3 = this._get(33);
      return t3 ? t3.accept(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "reject", value: function(e3) {
      var t3 = this._get(33);
      return t3 ? t3.reject(e3) : E2({ code: k2.NO_MODULE });
    } }, { key: "getSignalingInfo", value: function(e3) {
      var t3 = this._get(33);
      return t3 ? t3.getSignalingInfo(e3) : null;
    } }, { key: "modifyInvitation", value: function(e3) {
      var t3 = this._get(33);
      return t3 ? t3.modifyInvitation(e3) : E2({ code: k2.NO_MODULE });
    } }]), lr = { login: 1, logout: 1, getLoginUser: 1, destroy: 1, on: 1, off: 1, ready: 1, setLogLevel: 1, joinGroup: 1, quitGroup: 1, registerPlugin: 1, getGroupOnlineMemberCount: 1, isReady: 1, addSignalingListener: 1, removeSignalingListener: 1, callExperimentalAPI: 1 };
    function dr(e3) {
      return p3(this, dr), (e3 = i3(this, dr, [e3]))._n = "CSModule", e3;
    }
    var pr = {}, Fn = {};
    return Fn.create = function(e3) {
      var t3 = "TencentCloudChat.create", n3 = 0, o3 = e3.SDKAppID;
      if (A2(o3))
        n3 = o3;
      else if (n3 = parseInt(o3), isNaN(o3))
        return M2.e("".concat(t3, " failed. Failed to parse the SDKAppID, please check the arguments")), null;
      if (n3 && pr[n3])
        return pr[n3];
      M2.l("".concat(t3));
      var a3, i4, o3 = new ur(y2(y2({}, e3), {}, { SDKAppID: n3 })), e3 = (o3.on(h2.SDK_DESTROY, function(e4) {
        pr[e4.data.SDKAppID] = null, delete pr[e4.data.SDKAppID];
      }), a3 = o3, i4 = /* @__PURE__ */ Object.create(null), Object.keys(xn).forEach(function(s4) {
        var t4;
        a3[s4] && (t4 = new Q2(), i4[s4] = function() {
          var e4 = Array.from(arguments);
          return t4.use(function(e5, t5) {
            i5 = s4;
            var n4, o4, i5 = !(!(n4 = a3).isReady() && 1 !== lr[i5]) || (o4 = { code: o4 = n4.getNotReadyReason(), message: "".concat(n4.getErrMsg(o4), " | ").concat(i5, " | ").concat(n4.getErrMsg(k2.SDK_IS_NOT_READY)) }, n4.onError(o4), o4);
            return true === i5 ? t5() : E2(i5);
          }).use(function(e5, t5) {
            if (true === function(n4, o4, i5) {
              if (void 0 === o4)
                return true;
              var s5 = true;
              if (m2(o4))
                Object.keys(o4).forEach(function(e7) {
                  var t6 = 1 === n4.length ? n4[0][e7] : void 0;
                  s5 = !!on(t6, o4[e7], i5, e7) && s5;
                });
              else if (O2(o4))
                for (var e6 = 0; e6 < o4.length; e6++)
                  s5 = !!on(n4[e6], o4[e6], i5, o4[e6].name) && s5;
              if (s5)
                return s5;
              throw new Error("Params validate failed.");
            }(e5, qn[s4], s4))
              return t5();
          }).use(function(e5, t5) {
            return a3[s4].apply(a3, e5);
          }), t4.run(e4);
        });
      }), i4);
      return pr[n3] = e3, qn.hookGetAPITips(o3.getErrMsg.bind(o3)), M2.l("".concat(t3, " ok")), e3;
    }, Fn.TYPES = R2, Fn.EVENT = h2, Fn.TSignaling = _2, Fn.VERSION = "3.5.4", M2.l("TencentCloudChat.VERSION:".concat(Fn.VERSION)), Fn;
  });
})(chat);
var chatExports = chat.exports;
const e$1 = /* @__PURE__ */ getDefaultExportFromCjs(chatExports);
var timUploadPlugin = { exports: {} };
(function(module2, exports2) {
  !function(e2, t2) {
    module2.exports = t2();
  }(commonjsGlobal, function() {
    function e2(e3, t3) {
      var o3 = Object.keys(e3);
      if (Object.getOwnPropertySymbols) {
        var n3 = Object.getOwnPropertySymbols(e3);
        t3 && (n3 = n3.filter(function(t4) {
          return Object.getOwnPropertyDescriptor(e3, t4).enumerable;
        })), o3.push.apply(o3, n3);
      }
      return o3;
    }
    function t2(t3) {
      for (var o3 = 1; o3 < arguments.length; o3++) {
        var n3 = null != arguments[o3] ? arguments[o3] : {};
        o3 % 2 ? e2(Object(n3), true).forEach(function(e3) {
          s3(t3, e3, n3[e3]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t3, Object.getOwnPropertyDescriptors(n3)) : e2(Object(n3)).forEach(function(e3) {
          Object.defineProperty(t3, e3, Object.getOwnPropertyDescriptor(n3, e3));
        });
      }
      return t3;
    }
    function o2(e3) {
      return (o2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
        return typeof e4;
      } : function(e4) {
        return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
      })(e3);
    }
    function n2(e3, t3) {
      if (!(e3 instanceof t3))
        throw new TypeError("Cannot call a class as a function");
    }
    function r3(e3, t3) {
      for (var o3 = 0; o3 < t3.length; o3++) {
        var n3 = t3[o3];
        n3.enumerable = n3.enumerable || false, n3.configurable = true, "value" in n3 && (n3.writable = true), Object.defineProperty(e3, n3.key, n3);
      }
    }
    function a2(e3, t3, o3) {
      return t3 && r3(e3.prototype, t3), o3 && r3(e3, o3), Object.defineProperty(e3, "prototype", { writable: false }), e3;
    }
    function s3(e3, t3, o3) {
      return t3 in e3 ? Object.defineProperty(e3, t3, { value: o3, enumerable: true, configurable: true, writable: true }) : e3[t3] = o3, e3;
    }
    function i3(e3, t3) {
      if (null == e3)
        return {};
      var o3, n3, r4 = function(e4, t4) {
        if (null == e4)
          return {};
        var o4, n4, r5 = {}, a4 = Object.keys(e4);
        for (n4 = 0; n4 < a4.length; n4++)
          o4 = a4[n4], t4.indexOf(o4) >= 0 || (r5[o4] = e4[o4]);
        return r5;
      }(e3, t3);
      if (Object.getOwnPropertySymbols) {
        var a3 = Object.getOwnPropertySymbols(e3);
        for (n3 = 0; n3 < a3.length; n3++)
          o3 = a3[n3], t3.indexOf(o3) >= 0 || Object.prototype.propertyIsEnumerable.call(e3, o3) && (r4[o3] = e3[o3]);
      }
      return r4;
    }
    var u2 = "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, l2 = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), f2 = "undefined" != typeof qq && "function" == typeof qq.getSystemInfoSync && Boolean(qq.getSystemInfoSync().fontSizeSetting), c2 = "undefined" != typeof tt && "function" == typeof tt.getSystemInfoSync && Boolean(tt.getSystemInfoSync().fontSizeSetting), d2 = "undefined" != typeof swan && "function" == typeof swan.getSystemInfoSync && Boolean(swan.getSystemInfoSync().fontSizeSetting), p3 = "undefined" != typeof my && "function" == typeof my.getSystemInfoSync && Boolean(my.getSystemInfoSync().fontSizeSetting), y2 = "undefined" != typeof index && "undefined" == typeof window && "function" == typeof index.requireNativePlugin, h2 = y2 && "ios" === index.getDeviceInfo().platform.toLocaleLowerCase(), g2 = (y2 && index.getDeviceInfo().platform.toLocaleLowerCase(), l2 || f2 || c2 || d2 || p3 || y2), m2 = void 0 !== u2 && (void 0 !== u2.nativeModuleProxy || void 0 !== u2.ReactNative), v3 = f2 ? qq : c2 ? tt : d2 ? swan : p3 ? my : l2 ? wx$1 : y2 ? index : {}, b2 = function(e3) {
      if ("object" !== o2(e3) || null === e3)
        return false;
      var t3 = Object.getPrototypeOf(e3);
      if (null === t3)
        return true;
      for (var n3 = t3; null !== Object.getPrototypeOf(n3); )
        n3 = Object.getPrototypeOf(n3);
      return t3 === n3;
    };
    function w2(e3) {
      if (null == e3)
        return true;
      if ("boolean" == typeof e3)
        return false;
      if ("number" == typeof e3)
        return 0 === e3;
      if ("string" == typeof e3)
        return 0 === e3.length;
      if ("function" == typeof e3)
        return 0 === e3.length;
      if (Array.isArray(e3))
        return 0 === e3.length;
      if (e3 instanceof Error)
        return "" === e3.message;
      if (b2(e3)) {
        for (var t3 in e3)
          if (Object.prototype.hasOwnProperty.call(e3, t3))
            return false;
        return true;
      }
      return false;
    }
    var O2 = function() {
      function e3() {
        n2(this, e3), this._n = "WebRequest";
      }
      return a2(e3, [{ key: "request", value: function(e4, o3) {
        var n3 = this, r4 = "".concat(this._n, ".request"), a3 = e4.downloadUrl || "", s4 = (e4.method || "PUT").toUpperCase(), i4 = e4.url;
        if (index.__f__("log", "at node_modules/tim-upload-plugin/index.js:1", "%c tim-upload-plugin %c", "background:#0abf5b; padding:1px; border-radius:3px; color: #fff", "background:transparent", "".concat(r4, " URL:").concat(i4)), e4.qs) {
          var u3 = function(e5) {
            var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "&", o4 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "=";
            return w2(e5) ? "" : b2(e5) ? Object.keys(e5).map(function(n4) {
              var r5 = encodeURIComponent(n4) + o4;
              return Array.isArray(e5[n4]) ? e5[n4].map(function(e6) {
                return r5 + encodeURIComponent(e6);
              }).join(t3) : r5 + encodeURIComponent(e5[n4]);
            }).filter(Boolean).join(t3) : void 0;
          }(e4.qs);
          u3 && (i4 += "".concat(-1 === i4.indexOf("?") ? "?" : "&").concat(u3));
        }
        var l3 = new XMLHttpRequest();
        l3.open(s4, i4, true), l3.responseType = e4.dataType || "text";
        var f3 = e4.headers || {};
        if (e4.uploadByIP && (f3 = t2(t2({}, f3), {}, { host: e4.uploadIP })), !w2(f3))
          for (var c3 in f3)
            f3.hasOwnProperty(c3) && "content-length" !== c3.toLowerCase() && "user-agent" !== c3.toLowerCase() && "origin" !== c3.toLowerCase() && "host" !== c3.toLowerCase() && l3.setRequestHeader(c3, f3[c3]);
        return l3.onload = function() {
          if (200 === l3.status)
            o3(null, n3._xhrRes(l3, n3._xhrBody(l3, a3, e4.uploadByIP && e4.uploadIP), f3));
          else {
            if (e4.uploadIP && -1 === e4.url.indexOf(e4.uploadIP))
              return e4.url = function(e5, t4) {
                return e5.replace(/^http(s)?:\/\/(.*?)\//, "https://".concat(t4, "/"));
              }(e4.url, e4.uploadIP), e4.uploadByIP = true, n3.request(e4, o3);
            var t3 = { code: l3.status, message: JSON.stringify(l3.responseText) };
            o3(t3, n3._xhrRes(l3, n3._xhrBody(l3, a3, e4.uploadByIP && e4.uploadIP), f3));
          }
        }, l3.onerror = function(t3) {
          var r5 = n3._xhrBody(l3, a3, e4.uploadByIP && e4.uploadIP), s5 = { code: l3.status, message: JSON.stringify(l3.responseText) };
          r5 || l3.statusText || 0 !== l3.status || (t3.message = "CORS blocked or network error"), o3(s5, n3._xhrRes(l3, r5)), s5 = null;
        }, e4.onProgress && l3.upload && (l3.upload.onprogress = function(t3) {
          var o4 = t3.total, n4 = t3.loaded, r5 = Math.floor(100 * n4 / o4);
          e4.onProgress({ total: o4, loaded: n4, percent: (r5 >= 100 ? 100 : r5) / 100 });
        }), l3.send(e4.resources), l3;
      } }, { key: "_xhrRes", value: function(e4, t3) {
        var o3 = {};
        return e4.getAllResponseHeaders().trim().split("\n").forEach(function(e5) {
          if (e5) {
            var t4 = e5.indexOf(":"), n3 = e5.substr(0, t4).trim().toLowerCase(), r4 = e5.substr(t4 + 1).trim();
            o3[n3] = r4;
          }
        }), { statusCode: e4.status, statusMessage: e4.statusText, headers: o3, data: t3 };
      } }, { key: "_xhrBody", value: function(e4, t3, o3) {
        return 200 === e4.status && t3 ? { location: t3, uploadIP: o3 } : { response: e4.responseText, uploadIP: o3 };
      } }]), e3;
    }(), S2 = ["unknown", "image", "video", "audio", "log"], P2 = ["name"], I2 = function() {
      function e3() {
        n2(this, e3);
      }
      return a2(e3, [{ key: "request", value: function(e4, o3) {
        var n3 = this, r4 = e4.resources, a3 = void 0 === r4 ? "" : r4, s4 = e4.headers, u3 = void 0 === s4 ? {} : s4, l3 = e4.url, f3 = e4.downloadUrl, c3 = void 0 === f3 ? "" : f3, d3 = l3, y3 = null, g3 = c3.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/), m3 = decodeURIComponent(g3[3]), b3 = m3.indexOf("?") > -1 ? m3.split("?")[0] : m3, w3 = { key: e4.fileKey ? e4.fileKey : b3, success_action_status: 200, "Content-Type": "" }, O3 = {};
        if (h2) {
          var I3 = l3.split("?sign=");
          if (I3.length > 1) {
            var C3 = I3[1];
            d3 = "".concat(I3[0], "?sign=").concat(encodeURIComponent("".concat(C3))), O3.sign = decodeURIComponent(C3), O3.signature = decodeURIComponent(C3);
          }
        }
        var k2 = { url: d3, header: u3, name: "file", filePath: a3, formData: t2(t2({}, w3), O3), timeout: e4.timeout || 3e5 };
        if (p3) {
          var x2 = k2;
          x2.name;
          k2 = t2(t2({}, i3(x2, P2)), {}, { fileName: "file", fileType: S2[e4.fileType] });
        }
        return (y3 = v3.uploadFile(t2(t2({}, k2), {}, { success: function(e5) {
          n3._handleResponse({ response: e5, downloadUrl: c3, callback: o3 });
        }, fail: function(e5) {
          n3._handleResponse({ response: e5, downloadUrl: c3, callback: o3 });
        } }))).onProgressUpdate && y3.onProgressUpdate(function(t3) {
          e4.onProgress && e4.onProgress({ total: t3.totalBytesExpectedToSend, loaded: t3.totalBytesSent, percent: Math.floor(t3.progress) / 100 });
        }), y3;
      } }, { key: "_handleResponse", value: function(e4) {
        var o3 = e4.downloadUrl, n3 = e4.response, r4 = e4.callback, a3 = n3.header, s4 = {};
        if (a3)
          for (var i4 in a3)
            a3.hasOwnProperty(i4) && (s4[i4.toLowerCase()] = a3[i4]);
        var u3 = +n3.statusCode;
        200 === u3 ? r4(null, { statusCode: u3, headers: s4, data: t2(t2({}, n3.data), {}, { location: o3 }) }) : r4({ code: u3, message: JSON.stringify(n3.data) }, { statusCode: u3, headers: s4, data: void 0 });
      } }]), e3;
    }(), C2 = function() {
      function e3() {
        n2(this, e3);
      }
      return a2(e3, [{ key: "request", value: function(e4, t3) {
        var o3 = this, n3 = e4.resources, r4 = void 0 === n3 ? "" : n3, a3 = e4.fileKey, s4 = void 0 === a3 ? "" : a3, i4 = e4.url, u3 = e4.downloadUrl, l3 = void 0 === u3 ? "" : u3, f3 = new FormData();
        f3.append("key", s4), f3.append("success_action_status", 200), f3.append("file", { uri: r4, type: "application/octet-stream", name: "uploaded_file" }), fetch(i4, { method: "POST", headers: { "Content-Type": "multipart/form-data" }, body: f3 }).then(function(e5) {
          o3._handleResponse({ response: e5, downloadUrl: l3, callback: t3 });
        }).catch(function(e5) {
          o3._handleResponse({ response: e5, downloadUrl: l3, callback: t3 });
        });
      } }, { key: "_handleResponse", value: function(e4) {
        var t3 = e4.downloadUrl, o3 = e4.response, n3 = e4.callback, r4 = o3.headers, a3 = o3.status, s4 = r4 && r4.map || {};
        200 === a3 ? n3(null, { statusCode: 200, headers: s4, data: { location: t3 } }) : n3({ code: a3, message: JSON.stringify(o3) }, { statusCode: a3, headers: s4, data: void 0 });
      } }]), e3;
    }();
    return function() {
      function e3() {
        n2(this, e3), this.retry = 1, this.tryCount = 0, this.systemClockOffset = 0, this.httpRequest = g2 ? new I2() : m2 ? new C2() : new O2(), index.__f__("log", "at node_modules/tim-upload-plugin/index.js:1", "TIMUploadPlugin.VERSION: ".concat("1.4.2"));
      }
      return a2(e3, [{ key: "uploadFile", value: function(e4, t3) {
        var o3 = this;
        return this.httpRequest.request(e4, function(n3, r4) {
          n3 && o3.tryCount < o3.retry && o3.allowRetry(n3) ? (o3.tryCount++, o3.uploadFile(e4, t3)) : (o3.tryCount = 0, t3(n3, r4));
        });
      } }, { key: "allowRetry", value: function(e4) {
        var t3 = false, o3 = false;
        if (e4) {
          var n3 = e4.headers && (e4.headers.date || e4.headers.Date) || e4.error && e4.error.ServerTime;
          try {
            var r4 = e4.error && e4.error.Code, a3 = e4.error && e4.error.Message;
            ("RequestTimeTooSkewed" === r4 || "AccessDenied" === r4 && "Request has expired" === a3) && (o3 = true);
          } catch (u3) {
          }
          if (o3 && n3) {
            var s4 = Date.now(), i4 = Date.parse(n3);
            Math.abs(s4 + this.systemClockOffset - i4) >= 3e4 && (this.systemClockOffset = i4 - s4, t3 = true);
          } else
            5 === Math.floor(e4.statusCode / 100) && (t3 = true);
        }
        return t3;
      } }], [{ key: "getVersion", value: function() {
        return "1.4.2";
      } }]), e3;
    }();
  });
})(timUploadPlugin);
var timUploadPluginExports = timUploadPlugin.exports;
const t$1 = /* @__PURE__ */ getDefaultExportFromCjs(timUploadPluginExports);
var timProfanityFilterPlugin = { exports: {} };
(function(module2, exports2) {
  !function(t2, e2) {
    module2.exports = e2();
  }(commonjsGlobal, function() {
    function t2(t3, e3) {
      if (!(t3 instanceof e3))
        throw new TypeError("Cannot call a class as a function");
    }
    function e2(t3, e3) {
      for (var r4 = 0; r4 < e3.length; r4++) {
        var i4 = e3[r4];
        i4.enumerable = i4.enumerable || false, i4.configurable = true, "value" in i4 && (i4.writable = true), Object.defineProperty(t3, (n3 = i4.key, o3 = void 0, "symbol" == typeof (o3 = function(t4, e4) {
          if ("object" != typeof t4 || null === t4)
            return t4;
          var r5 = t4[Symbol.toPrimitive];
          if (void 0 !== r5) {
            var i5 = r5.call(t4, e4 || "default");
            if ("object" != typeof i5)
              return i5;
            throw new TypeError("@@toPrimitive must return a primitive value.");
          }
          return ("string" === e4 ? String : Number)(t4);
        }(n3, "string")) ? o3 : String(o3)), i4);
      }
      var n3, o3;
    }
    function r3(t3, r4, i4) {
      return r4 && e2(t3.prototype, r4), i4 && e2(t3, i4), Object.defineProperty(t3, "prototype", { writable: false }), t3;
    }
    function i3(t3, e3) {
      return function(t4) {
        if (Array.isArray(t4))
          return t4;
      }(t3) || function(t4, e4) {
        var r4 = null == t4 ? null : "undefined" != typeof Symbol && t4[Symbol.iterator] || t4["@@iterator"];
        if (null != r4) {
          var i4, n3, o3, s4, a3 = [], c3 = true, h3 = false;
          try {
            if (o3 = (r4 = r4.call(t4)).next, 0 === e4) {
              if (Object(r4) !== r4)
                return;
              c3 = false;
            } else
              for (; !(c3 = (i4 = o3.call(r4)).done) && (a3.push(i4.value), a3.length !== e4); c3 = true)
                ;
          } catch (t5) {
            h3 = true, n3 = t5;
          } finally {
            try {
              if (!c3 && null != r4.return && (s4 = r4.return(), Object(s4) !== s4))
                return;
            } finally {
              if (h3)
                throw n3;
            }
          }
          return a3;
        }
      }(t3, e3) || o2(t3, e3) || function() {
        throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }();
    }
    function n2(t3) {
      return function(t4) {
        if (Array.isArray(t4))
          return s3(t4);
      }(t3) || function(t4) {
        if ("undefined" != typeof Symbol && null != t4[Symbol.iterator] || null != t4["@@iterator"])
          return Array.from(t4);
      }(t3) || o2(t3) || function() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }();
    }
    function o2(t3, e3) {
      if (t3) {
        if ("string" == typeof t3)
          return s3(t3, e3);
        var r4 = Object.prototype.toString.call(t3).slice(8, -1);
        return "Object" === r4 && t3.constructor && (r4 = t3.constructor.name), "Map" === r4 || "Set" === r4 ? Array.from(t3) : "Arguments" === r4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r4) ? s3(t3, e3) : void 0;
      }
    }
    function s3(t3, e3) {
      (null == e3 || e3 > t3.length) && (e3 = t3.length);
      for (var r4 = 0, i4 = new Array(e3); r4 < e3; r4++)
        i4[r4] = t3[r4];
      return i4;
    }
    function a2(t3, e3) {
      var r4 = "undefined" != typeof Symbol && t3[Symbol.iterator] || t3["@@iterator"];
      if (!r4) {
        if (Array.isArray(t3) || (r4 = o2(t3)) || e3 && t3 && "number" == typeof t3.length) {
          r4 && (t3 = r4);
          var i4 = 0, n3 = function() {
          };
          return { s: n3, n: function() {
            return i4 >= t3.length ? { done: true } : { done: false, value: t3[i4++] };
          }, e: function(t4) {
            throw t4;
          }, f: n3 };
        }
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      var s4, a3 = true, c3 = false;
      return { s: function() {
        r4 = r4.call(t3);
      }, n: function() {
        var t4 = r4.next();
        return a3 = t4.done, t4;
      }, e: function(t4) {
        c3 = true, s4 = t4;
      }, f: function() {
        try {
          a3 || null == r4.return || r4.return();
        } finally {
          if (c3)
            throw s4;
        }
      } };
    }
    var c2 = function() {
      for (var t3 = ` 	\r
~!@#$%^&*()_+-=【】、{}|;':"，。、《》？αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。，、；：？！…—·ˉ¨‘’“”々～‖∶＂＇｀｜〃〔〕〈〉《》「」『』．〖〗【】（）［］｛｝ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠＝≤≥＜＞≮≯∷±＋－×÷／∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°＃＆＠＼︿＿￣―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄`, e3 = /* @__PURE__ */ new Map(), r4 = 0, i4 = t3.length; r4 < i4; r4++)
        e3.set(t3.charCodeAt(0), true);
      return e3;
    }(), h2 = function() {
      function e3(r4) {
        t2(this, e3);
        var i4, o3 = r4.input, s4 = r4.isArray, a3 = r4.isMap;
        this._trieTree = {}, s4(o3) ? i4 = o3 : a3(o3) && (i4 = n2(o3.keys()), this._map = o3);
        for (var c3 = 0, h3 = i4.length; c3 < h3; c3++)
          if (i4[c3]) {
            for (var l3 = this._trieTree, f3 = i4[c3], u3 = 0, d2 = f3.length; u3 < d2; u3++)
              l3[f3[u3]] || (l3[f3[u3]] = {}), l3 = l3[f3[u3]];
            l3.isEnd = true;
          }
      }
      return r3(e3, [{ key: "filter", value: function(t3) {
        var e4 = t3.text, r4 = t3.replacingEnabled;
        if (0 === Object.keys(this._trieTree).length)
          return { isMatched: false, modifiedText: e4 };
        for (var i4 = this._trieTree, n3 = e4.toLowerCase(), o3 = "", s4 = false, a3 = n3.length, h3 = 0; h3 < a3; h3++)
          if (true !== c2.get(n3.charCodeAt(h3))) {
            for (var l3 = 0, f3 = "", u3 = false, d2 = h3; d2 < a3; d2++) {
              if (!i4[n3[d2]]) {
                i4 = this._trieTree;
                break;
              }
              if (f3 += n3[d2], i4[n3[d2]].isEnd) {
                u3 = true, l3 = d2 - h3, i4 = this._trieTree;
                break;
              }
              i4 = i4[n3[d2]];
            }
            if (l3 > 1 && (h3 += l3), u3) {
              if (s4 = true, !r4)
                break;
              var p3 = this._map.get(f3) || "*";
              o3 = e4.replace(new RegExp(f3, "gi"), p3);
            }
          }
        return { isMatched: s4, modifiedText: o3 };
      } }, { key: "reset", value: function() {
        this._trieTree = {}, this._map = null;
      } }]), e3;
    }(), l2 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : {};
    var f2 = {}, u2 = function(t3, e3) {
      return t3(e3 = { exports: {} }, e3.exports), e3.exports;
    }(function(t3, e3) {
      var r4, i4, n3, o3, s4, a3;
      t3.exports = (a3 = a3 || function(t4, e4) {
        var r5;
        if ("undefined" != typeof window && window.crypto && (r5 = window.crypto), !r5 && "undefined" != typeof window && window.msCrypto && (r5 = window.msCrypto), !r5 && void 0 !== l2 && l2.crypto && (r5 = l2.crypto), !r5)
          try {
            r5 = f2;
          } catch (v3) {
          }
        var i5 = function() {
          if (r5) {
            if ("function" == typeof r5.getRandomValues)
              try {
                return r5.getRandomValues(new Uint32Array(1))[0];
              } catch (v3) {
              }
            if ("function" == typeof r5.randomBytes)
              try {
                return r5.randomBytes(4).readInt32LE();
              } catch (v3) {
              }
          }
          throw new Error("Native crypto module could not be used to get secure random number.");
        }, n4 = Object.create || /* @__PURE__ */ function() {
          function t5() {
          }
          return function(e5) {
            var r6;
            return t5.prototype = e5, r6 = new t5(), t5.prototype = null, r6;
          };
        }(), o4 = {}, s5 = o4.lib = {}, a4 = s5.Base = { extend: function(t5) {
          var e5 = n4(this);
          return t5 && e5.mixIn(t5), e5.hasOwnProperty("init") && this.init !== e5.init || (e5.init = function() {
            e5.$super.init.apply(this, arguments);
          }), e5.init.prototype = e5, e5.$super = this, e5;
        }, create: function() {
          var t5 = this.extend();
          return t5.init.apply(t5, arguments), t5;
        }, init: function() {
        }, mixIn: function(t5) {
          for (var e5 in t5)
            t5.hasOwnProperty(e5) && (this[e5] = t5[e5]);
          t5.hasOwnProperty("toString") && (this.toString = t5.toString);
        }, clone: function() {
          return this.init.prototype.extend(this);
        } }, c3 = s5.WordArray = a4.extend({ init: function(t5, e5) {
          t5 = this.words = t5 || [], this.sigBytes = null != e5 ? e5 : 4 * t5.length;
        }, toString: function(t5) {
          return (t5 || u3).stringify(this);
        }, concat: function(t5) {
          var e5 = this.words, r6 = t5.words, i6 = this.sigBytes, n5 = t5.sigBytes;
          if (this.clamp(), i6 % 4)
            for (var o5 = 0; o5 < n5; o5++) {
              var s6 = r6[o5 >>> 2] >>> 24 - o5 % 4 * 8 & 255;
              e5[i6 + o5 >>> 2] |= s6 << 24 - (i6 + o5) % 4 * 8;
            }
          else
            for (o5 = 0; o5 < n5; o5 += 4)
              e5[i6 + o5 >>> 2] = r6[o5 >>> 2];
          return this.sigBytes += n5, this;
        }, clamp: function() {
          var e5 = this.words, r6 = this.sigBytes;
          e5[r6 >>> 2] &= 4294967295 << 32 - r6 % 4 * 8, e5.length = t4.ceil(r6 / 4);
        }, clone: function() {
          var t5 = a4.clone.call(this);
          return t5.words = this.words.slice(0), t5;
        }, random: function(t5) {
          for (var e5 = [], r6 = 0; r6 < t5; r6 += 4)
            e5.push(i5());
          return new c3.init(e5, t5);
        } }), h3 = o4.enc = {}, u3 = h3.Hex = { stringify: function(t5) {
          for (var e5 = t5.words, r6 = t5.sigBytes, i6 = [], n5 = 0; n5 < r6; n5++) {
            var o5 = e5[n5 >>> 2] >>> 24 - n5 % 4 * 8 & 255;
            i6.push((o5 >>> 4).toString(16)), i6.push((15 & o5).toString(16));
          }
          return i6.join("");
        }, parse: function(t5) {
          for (var e5 = t5.length, r6 = [], i6 = 0; i6 < e5; i6 += 2)
            r6[i6 >>> 3] |= parseInt(t5.substr(i6, 2), 16) << 24 - i6 % 8 * 4;
          return new c3.init(r6, e5 / 2);
        } }, d2 = h3.Latin1 = { stringify: function(t5) {
          for (var e5 = t5.words, r6 = t5.sigBytes, i6 = [], n5 = 0; n5 < r6; n5++) {
            var o5 = e5[n5 >>> 2] >>> 24 - n5 % 4 * 8 & 255;
            i6.push(String.fromCharCode(o5));
          }
          return i6.join("");
        }, parse: function(t5) {
          for (var e5 = t5.length, r6 = [], i6 = 0; i6 < e5; i6++)
            r6[i6 >>> 2] |= (255 & t5.charCodeAt(i6)) << 24 - i6 % 4 * 8;
          return new c3.init(r6, e5);
        } }, p3 = h3.Utf8 = { stringify: function(t5) {
          try {
            return decodeURIComponent(escape(d2.stringify(t5)));
          } catch (e5) {
            throw new Error("Malformed UTF-8 data");
          }
        }, parse: function(t5) {
          return d2.parse(unescape(encodeURIComponent(t5)));
        } }, _2 = s5.BufferedBlockAlgorithm = a4.extend({ reset: function() {
          this._data = new c3.init(), this._nDataBytes = 0;
        }, _append: function(t5) {
          "string" == typeof t5 && (t5 = p3.parse(t5)), this._data.concat(t5), this._nDataBytes += t5.sigBytes;
        }, _process: function(e5) {
          var r6, i6 = this._data, n5 = i6.words, o5 = i6.sigBytes, s6 = this.blockSize, a5 = o5 / (4 * s6), h4 = (a5 = e5 ? t4.ceil(a5) : t4.max((0 | a5) - this._minBufferSize, 0)) * s6, l3 = t4.min(4 * h4, o5);
          if (h4) {
            for (var f3 = 0; f3 < h4; f3 += s6)
              this._doProcessBlock(n5, f3);
            r6 = n5.splice(0, h4), i6.sigBytes -= l3;
          }
          return new c3.init(r6, l3);
        }, clone: function() {
          var t5 = a4.clone.call(this);
          return t5._data = this._data.clone(), t5;
        }, _minBufferSize: 0 }), y2 = (s5.Hasher = _2.extend({ cfg: a4.extend(), init: function(t5) {
          this.cfg = this.cfg.extend(t5), this.reset();
        }, reset: function() {
          _2.reset.call(this), this._doReset();
        }, update: function(t5) {
          return this._append(t5), this._process(), this;
        }, finalize: function(t5) {
          return t5 && this._append(t5), this._doFinalize();
        }, blockSize: 16, _createHelper: function(t5) {
          return function(e5, r6) {
            return new t5.init(r6).finalize(e5);
          };
        }, _createHmacHelper: function(t5) {
          return function(e5, r6) {
            return new y2.HMAC.init(t5, r6).finalize(e5);
          };
        } }), o4.algo = {});
        return o4;
      }(Math), s4 = (o3 = a3).lib.WordArray, o3.enc.Base64 = { stringify: function(t4) {
        var e4 = t4.words, r5 = t4.sigBytes, i5 = this._map;
        t4.clamp();
        for (var n4 = [], o4 = 0; o4 < r5; o4 += 3)
          for (var s5 = (e4[o4 >>> 2] >>> 24 - o4 % 4 * 8 & 255) << 16 | (e4[o4 + 1 >>> 2] >>> 24 - (o4 + 1) % 4 * 8 & 255) << 8 | e4[o4 + 2 >>> 2] >>> 24 - (o4 + 2) % 4 * 8 & 255, a4 = 0; a4 < 4 && o4 + 0.75 * a4 < r5; a4++)
            n4.push(i5.charAt(s5 >>> 6 * (3 - a4) & 63));
        var c3 = i5.charAt(64);
        if (c3)
          for (; n4.length % 4; )
            n4.push(c3);
        return n4.join("");
      }, parse: function(t4) {
        var e4 = t4.length, r5 = this._map, i5 = this._reverseMap;
        if (!i5) {
          i5 = this._reverseMap = [];
          for (var n4 = 0; n4 < r5.length; n4++)
            i5[r5.charCodeAt(n4)] = n4;
        }
        var o4 = r5.charAt(64);
        if (o4) {
          var a4 = t4.indexOf(o4);
          -1 !== a4 && (e4 = a4);
        }
        return function(t5, e5, r6) {
          for (var i6 = [], n5 = 0, o5 = 0; o5 < e5; o5++)
            if (o5 % 4) {
              var a5 = r6[t5.charCodeAt(o5 - 1)] << o5 % 4 * 2, c3 = r6[t5.charCodeAt(o5)] >>> 6 - o5 % 4 * 2, h3 = a5 | c3;
              i6[n5 >>> 2] |= h3 << 24 - n5 % 4 * 8, n5++;
            }
          return s4.create(i6, n5);
        }(t4, e4, i5);
      }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" }, function(t4) {
        var e4 = a3, r5 = e4.lib, i5 = r5.WordArray, n4 = r5.Hasher, o4 = e4.algo, s5 = [];
        !function() {
          for (var e5 = 0; e5 < 64; e5++)
            s5[e5] = 4294967296 * t4.abs(t4.sin(e5 + 1)) | 0;
        }();
        var c3 = o4.MD5 = n4.extend({ _doReset: function() {
          this._hash = new i5.init([1732584193, 4023233417, 2562383102, 271733878]);
        }, _doProcessBlock: function(t5, e5) {
          for (var r6 = 0; r6 < 16; r6++) {
            var i6 = e5 + r6, n5 = t5[i6];
            t5[i6] = 16711935 & (n5 << 8 | n5 >>> 24) | 4278255360 & (n5 << 24 | n5 >>> 8);
          }
          var o5 = this._hash.words, a4 = t5[e5 + 0], c4 = t5[e5 + 1], d2 = t5[e5 + 2], p3 = t5[e5 + 3], _2 = t5[e5 + 4], y2 = t5[e5 + 5], v3 = t5[e5 + 6], g2 = t5[e5 + 7], w2 = t5[e5 + 8], B2 = t5[e5 + 9], k2 = t5[e5 + 10], m2 = t5[e5 + 11], b2 = t5[e5 + 12], x2 = t5[e5 + 13], S2 = t5[e5 + 14], A2 = t5[e5 + 15], H2 = o5[0], C2 = o5[1], z2 = o5[2], E2 = o5[3];
          H2 = h3(H2, C2, z2, E2, a4, 7, s5[0]), E2 = h3(E2, H2, C2, z2, c4, 12, s5[1]), z2 = h3(z2, E2, H2, C2, d2, 17, s5[2]), C2 = h3(C2, z2, E2, H2, p3, 22, s5[3]), H2 = h3(H2, C2, z2, E2, _2, 7, s5[4]), E2 = h3(E2, H2, C2, z2, y2, 12, s5[5]), z2 = h3(z2, E2, H2, C2, v3, 17, s5[6]), C2 = h3(C2, z2, E2, H2, g2, 22, s5[7]), H2 = h3(H2, C2, z2, E2, w2, 7, s5[8]), E2 = h3(E2, H2, C2, z2, B2, 12, s5[9]), z2 = h3(z2, E2, H2, C2, k2, 17, s5[10]), C2 = h3(C2, z2, E2, H2, m2, 22, s5[11]), H2 = h3(H2, C2, z2, E2, b2, 7, s5[12]), E2 = h3(E2, H2, C2, z2, x2, 12, s5[13]), z2 = h3(z2, E2, H2, C2, S2, 17, s5[14]), H2 = l3(H2, C2 = h3(C2, z2, E2, H2, A2, 22, s5[15]), z2, E2, c4, 5, s5[16]), E2 = l3(E2, H2, C2, z2, v3, 9, s5[17]), z2 = l3(z2, E2, H2, C2, m2, 14, s5[18]), C2 = l3(C2, z2, E2, H2, a4, 20, s5[19]), H2 = l3(H2, C2, z2, E2, y2, 5, s5[20]), E2 = l3(E2, H2, C2, z2, k2, 9, s5[21]), z2 = l3(z2, E2, H2, C2, A2, 14, s5[22]), C2 = l3(C2, z2, E2, H2, _2, 20, s5[23]), H2 = l3(H2, C2, z2, E2, B2, 5, s5[24]), E2 = l3(E2, H2, C2, z2, S2, 9, s5[25]), z2 = l3(z2, E2, H2, C2, p3, 14, s5[26]), C2 = l3(C2, z2, E2, H2, w2, 20, s5[27]), H2 = l3(H2, C2, z2, E2, x2, 5, s5[28]), E2 = l3(E2, H2, C2, z2, d2, 9, s5[29]), z2 = l3(z2, E2, H2, C2, g2, 14, s5[30]), H2 = f3(H2, C2 = l3(C2, z2, E2, H2, b2, 20, s5[31]), z2, E2, y2, 4, s5[32]), E2 = f3(E2, H2, C2, z2, w2, 11, s5[33]), z2 = f3(z2, E2, H2, C2, m2, 16, s5[34]), C2 = f3(C2, z2, E2, H2, S2, 23, s5[35]), H2 = f3(H2, C2, z2, E2, c4, 4, s5[36]), E2 = f3(E2, H2, C2, z2, _2, 11, s5[37]), z2 = f3(z2, E2, H2, C2, g2, 16, s5[38]), C2 = f3(C2, z2, E2, H2, k2, 23, s5[39]), H2 = f3(H2, C2, z2, E2, x2, 4, s5[40]), E2 = f3(E2, H2, C2, z2, a4, 11, s5[41]), z2 = f3(z2, E2, H2, C2, p3, 16, s5[42]), C2 = f3(C2, z2, E2, H2, v3, 23, s5[43]), H2 = f3(H2, C2, z2, E2, B2, 4, s5[44]), E2 = f3(E2, H2, C2, z2, b2, 11, s5[45]), z2 = f3(z2, E2, H2, C2, A2, 16, s5[46]), H2 = u3(H2, C2 = f3(C2, z2, E2, H2, d2, 23, s5[47]), z2, E2, a4, 6, s5[48]), E2 = u3(E2, H2, C2, z2, g2, 10, s5[49]), z2 = u3(z2, E2, H2, C2, S2, 15, s5[50]), C2 = u3(C2, z2, E2, H2, y2, 21, s5[51]), H2 = u3(H2, C2, z2, E2, b2, 6, s5[52]), E2 = u3(E2, H2, C2, z2, p3, 10, s5[53]), z2 = u3(z2, E2, H2, C2, k2, 15, s5[54]), C2 = u3(C2, z2, E2, H2, c4, 21, s5[55]), H2 = u3(H2, C2, z2, E2, w2, 6, s5[56]), E2 = u3(E2, H2, C2, z2, A2, 10, s5[57]), z2 = u3(z2, E2, H2, C2, v3, 15, s5[58]), C2 = u3(C2, z2, E2, H2, x2, 21, s5[59]), H2 = u3(H2, C2, z2, E2, _2, 6, s5[60]), E2 = u3(E2, H2, C2, z2, m2, 10, s5[61]), z2 = u3(z2, E2, H2, C2, d2, 15, s5[62]), C2 = u3(C2, z2, E2, H2, B2, 21, s5[63]), o5[0] = o5[0] + H2 | 0, o5[1] = o5[1] + C2 | 0, o5[2] = o5[2] + z2 | 0, o5[3] = o5[3] + E2 | 0;
        }, _doFinalize: function() {
          var e5 = this._data, r6 = e5.words, i6 = 8 * this._nDataBytes, n5 = 8 * e5.sigBytes;
          r6[n5 >>> 5] |= 128 << 24 - n5 % 32;
          var o5 = t4.floor(i6 / 4294967296), s6 = i6;
          r6[15 + (n5 + 64 >>> 9 << 4)] = 16711935 & (o5 << 8 | o5 >>> 24) | 4278255360 & (o5 << 24 | o5 >>> 8), r6[14 + (n5 + 64 >>> 9 << 4)] = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), e5.sigBytes = 4 * (r6.length + 1), this._process();
          for (var a4 = this._hash, c4 = a4.words, h4 = 0; h4 < 4; h4++) {
            var l4 = c4[h4];
            c4[h4] = 16711935 & (l4 << 8 | l4 >>> 24) | 4278255360 & (l4 << 24 | l4 >>> 8);
          }
          return a4;
        }, clone: function() {
          var t5 = n4.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        function h3(t5, e5, r6, i6, n5, o5, s6) {
          var a4 = t5 + (e5 & r6 | ~e5 & i6) + n5 + s6;
          return (a4 << o5 | a4 >>> 32 - o5) + e5;
        }
        function l3(t5, e5, r6, i6, n5, o5, s6) {
          var a4 = t5 + (e5 & i6 | r6 & ~i6) + n5 + s6;
          return (a4 << o5 | a4 >>> 32 - o5) + e5;
        }
        function f3(t5, e5, r6, i6, n5, o5, s6) {
          var a4 = t5 + (e5 ^ r6 ^ i6) + n5 + s6;
          return (a4 << o5 | a4 >>> 32 - o5) + e5;
        }
        function u3(t5, e5, r6, i6, n5, o5, s6) {
          var a4 = t5 + (r6 ^ (e5 | ~i6)) + n5 + s6;
          return (a4 << o5 | a4 >>> 32 - o5) + e5;
        }
        e4.MD5 = n4._createHelper(c3), e4.HmacMD5 = n4._createHmacHelper(c3);
      }(Math), function() {
        var t4 = a3, e4 = t4.lib, r5 = e4.WordArray, i5 = e4.Hasher, n4 = t4.algo, o4 = [], s5 = n4.SHA1 = i5.extend({ _doReset: function() {
          this._hash = new r5.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
        }, _doProcessBlock: function(t5, e5) {
          for (var r6 = this._hash.words, i6 = r6[0], n5 = r6[1], s6 = r6[2], a4 = r6[3], c3 = r6[4], h3 = 0; h3 < 80; h3++) {
            if (h3 < 16)
              o4[h3] = 0 | t5[e5 + h3];
            else {
              var l3 = o4[h3 - 3] ^ o4[h3 - 8] ^ o4[h3 - 14] ^ o4[h3 - 16];
              o4[h3] = l3 << 1 | l3 >>> 31;
            }
            var f3 = (i6 << 5 | i6 >>> 27) + c3 + o4[h3];
            f3 += h3 < 20 ? 1518500249 + (n5 & s6 | ~n5 & a4) : h3 < 40 ? 1859775393 + (n5 ^ s6 ^ a4) : h3 < 60 ? (n5 & s6 | n5 & a4 | s6 & a4) - 1894007588 : (n5 ^ s6 ^ a4) - 899497514, c3 = a4, a4 = s6, s6 = n5 << 30 | n5 >>> 2, n5 = i6, i6 = f3;
          }
          r6[0] = r6[0] + i6 | 0, r6[1] = r6[1] + n5 | 0, r6[2] = r6[2] + s6 | 0, r6[3] = r6[3] + a4 | 0, r6[4] = r6[4] + c3 | 0;
        }, _doFinalize: function() {
          var t5 = this._data, e5 = t5.words, r6 = 8 * this._nDataBytes, i6 = 8 * t5.sigBytes;
          return e5[i6 >>> 5] |= 128 << 24 - i6 % 32, e5[14 + (i6 + 64 >>> 9 << 4)] = Math.floor(r6 / 4294967296), e5[15 + (i6 + 64 >>> 9 << 4)] = r6, t5.sigBytes = 4 * e5.length, this._process(), this._hash;
        }, clone: function() {
          var t5 = i5.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        t4.SHA1 = i5._createHelper(s5), t4.HmacSHA1 = i5._createHmacHelper(s5);
      }(), function(t4) {
        var e4 = a3, r5 = e4.lib, i5 = r5.WordArray, n4 = r5.Hasher, o4 = e4.algo, s5 = [], c3 = [];
        !function() {
          function e5(e6) {
            for (var r7 = t4.sqrt(e6), i7 = 2; i7 <= r7; i7++)
              if (!(e6 % i7))
                return false;
            return true;
          }
          function r6(t5) {
            return 4294967296 * (t5 - (0 | t5)) | 0;
          }
          for (var i6 = 2, n5 = 0; n5 < 64; )
            e5(i6) && (n5 < 8 && (s5[n5] = r6(t4.pow(i6, 0.5))), c3[n5] = r6(t4.pow(i6, 1 / 3)), n5++), i6++;
        }();
        var h3 = [], l3 = o4.SHA256 = n4.extend({ _doReset: function() {
          this._hash = new i5.init(s5.slice(0));
        }, _doProcessBlock: function(t5, e5) {
          for (var r6 = this._hash.words, i6 = r6[0], n5 = r6[1], o5 = r6[2], s6 = r6[3], a4 = r6[4], l4 = r6[5], f3 = r6[6], u3 = r6[7], d2 = 0; d2 < 64; d2++) {
            if (d2 < 16)
              h3[d2] = 0 | t5[e5 + d2];
            else {
              var p3 = h3[d2 - 15], _2 = (p3 << 25 | p3 >>> 7) ^ (p3 << 14 | p3 >>> 18) ^ p3 >>> 3, y2 = h3[d2 - 2], v3 = (y2 << 15 | y2 >>> 17) ^ (y2 << 13 | y2 >>> 19) ^ y2 >>> 10;
              h3[d2] = _2 + h3[d2 - 7] + v3 + h3[d2 - 16];
            }
            var g2 = i6 & n5 ^ i6 & o5 ^ n5 & o5, w2 = (i6 << 30 | i6 >>> 2) ^ (i6 << 19 | i6 >>> 13) ^ (i6 << 10 | i6 >>> 22), B2 = u3 + ((a4 << 26 | a4 >>> 6) ^ (a4 << 21 | a4 >>> 11) ^ (a4 << 7 | a4 >>> 25)) + (a4 & l4 ^ ~a4 & f3) + c3[d2] + h3[d2];
            u3 = f3, f3 = l4, l4 = a4, a4 = s6 + B2 | 0, s6 = o5, o5 = n5, n5 = i6, i6 = B2 + (w2 + g2) | 0;
          }
          r6[0] = r6[0] + i6 | 0, r6[1] = r6[1] + n5 | 0, r6[2] = r6[2] + o5 | 0, r6[3] = r6[3] + s6 | 0, r6[4] = r6[4] + a4 | 0, r6[5] = r6[5] + l4 | 0, r6[6] = r6[6] + f3 | 0, r6[7] = r6[7] + u3 | 0;
        }, _doFinalize: function() {
          var e5 = this._data, r6 = e5.words, i6 = 8 * this._nDataBytes, n5 = 8 * e5.sigBytes;
          return r6[n5 >>> 5] |= 128 << 24 - n5 % 32, r6[14 + (n5 + 64 >>> 9 << 4)] = t4.floor(i6 / 4294967296), r6[15 + (n5 + 64 >>> 9 << 4)] = i6, e5.sigBytes = 4 * r6.length, this._process(), this._hash;
        }, clone: function() {
          var t5 = n4.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        e4.SHA256 = n4._createHelper(l3), e4.HmacSHA256 = n4._createHmacHelper(l3);
      }(Math), function() {
        var t4 = a3, e4 = t4.lib.WordArray, r5 = t4.enc;
        function i5(t5) {
          return t5 << 8 & 4278255360 | t5 >>> 8 & 16711935;
        }
        r5.Utf16 = r5.Utf16BE = { stringify: function(t5) {
          for (var e5 = t5.words, r6 = t5.sigBytes, i6 = [], n4 = 0; n4 < r6; n4 += 2) {
            var o4 = e5[n4 >>> 2] >>> 16 - n4 % 4 * 8 & 65535;
            i6.push(String.fromCharCode(o4));
          }
          return i6.join("");
        }, parse: function(t5) {
          for (var r6 = t5.length, i6 = [], n4 = 0; n4 < r6; n4++)
            i6[n4 >>> 1] |= t5.charCodeAt(n4) << 16 - n4 % 2 * 16;
          return e4.create(i6, 2 * r6);
        } }, r5.Utf16LE = { stringify: function(t5) {
          for (var e5 = t5.words, r6 = t5.sigBytes, n4 = [], o4 = 0; o4 < r6; o4 += 2) {
            var s5 = i5(e5[o4 >>> 2] >>> 16 - o4 % 4 * 8 & 65535);
            n4.push(String.fromCharCode(s5));
          }
          return n4.join("");
        }, parse: function(t5) {
          for (var r6 = t5.length, n4 = [], o4 = 0; o4 < r6; o4++)
            n4[o4 >>> 1] |= i5(t5.charCodeAt(o4) << 16 - o4 % 2 * 16);
          return e4.create(n4, 2 * r6);
        } };
      }(), function() {
        if ("function" == typeof ArrayBuffer) {
          var t4 = a3.lib.WordArray, e4 = t4.init;
          (t4.init = function(t5) {
            if (t5 instanceof ArrayBuffer && (t5 = new Uint8Array(t5)), (t5 instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && t5 instanceof Uint8ClampedArray || t5 instanceof Int16Array || t5 instanceof Uint16Array || t5 instanceof Int32Array || t5 instanceof Uint32Array || t5 instanceof Float32Array || t5 instanceof Float64Array) && (t5 = new Uint8Array(t5.buffer, t5.byteOffset, t5.byteLength)), t5 instanceof Uint8Array) {
              for (var r5 = t5.byteLength, i5 = [], n4 = 0; n4 < r5; n4++)
                i5[n4 >>> 2] |= t5[n4] << 24 - n4 % 4 * 8;
              e4.call(this, i5, r5);
            } else
              e4.apply(this, arguments);
          }).prototype = t4;
        }
      }(), /** @preserve
            (c) 2012 by C��dric Mesnil. All rights reserved.
             Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
                 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
                - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
             THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
            */
      function(t4) {
        var e4 = a3, r5 = e4.lib, i5 = r5.WordArray, n4 = r5.Hasher, o4 = e4.algo, s5 = i5.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]), c3 = i5.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]), h3 = i5.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]), l3 = i5.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]), f3 = i5.create([0, 1518500249, 1859775393, 2400959708, 2840853838]), u3 = i5.create([1352829926, 1548603684, 1836072691, 2053994217, 0]), d2 = o4.RIPEMD160 = n4.extend({ _doReset: function() {
          this._hash = i5.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
        }, _doProcessBlock: function(t5, e5) {
          for (var r6 = 0; r6 < 16; r6++) {
            var i6 = e5 + r6, n5 = t5[i6];
            t5[i6] = 16711935 & (n5 << 8 | n5 >>> 24) | 4278255360 & (n5 << 24 | n5 >>> 8);
          }
          var o5, a4, d3, B2, k2, m2, b2, x2, S2, A2, H2, C2 = this._hash.words, z2 = f3.words, E2 = u3.words, M2 = s5.words, R2 = c3.words, D2 = h3.words, P2 = l3.words;
          for (m2 = o5 = C2[0], b2 = a4 = C2[1], x2 = d3 = C2[2], S2 = B2 = C2[3], A2 = k2 = C2[4], r6 = 0; r6 < 80; r6 += 1)
            H2 = o5 + t5[e5 + M2[r6]] | 0, H2 += r6 < 16 ? p3(a4, d3, B2) + z2[0] : r6 < 32 ? _2(a4, d3, B2) + z2[1] : r6 < 48 ? y2(a4, d3, B2) + z2[2] : r6 < 64 ? v3(a4, d3, B2) + z2[3] : g2(a4, d3, B2) + z2[4], H2 = (H2 = w2(H2 |= 0, D2[r6])) + k2 | 0, o5 = k2, k2 = B2, B2 = w2(d3, 10), d3 = a4, a4 = H2, H2 = m2 + t5[e5 + R2[r6]] | 0, H2 += r6 < 16 ? g2(b2, x2, S2) + E2[0] : r6 < 32 ? v3(b2, x2, S2) + E2[1] : r6 < 48 ? y2(b2, x2, S2) + E2[2] : r6 < 64 ? _2(b2, x2, S2) + E2[3] : p3(b2, x2, S2) + E2[4], H2 = (H2 = w2(H2 |= 0, P2[r6])) + A2 | 0, m2 = A2, A2 = S2, S2 = w2(x2, 10), x2 = b2, b2 = H2;
          H2 = C2[1] + d3 + S2 | 0, C2[1] = C2[2] + B2 + A2 | 0, C2[2] = C2[3] + k2 + m2 | 0, C2[3] = C2[4] + o5 + b2 | 0, C2[4] = C2[0] + a4 + x2 | 0, C2[0] = H2;
        }, _doFinalize: function() {
          var t5 = this._data, e5 = t5.words, r6 = 8 * this._nDataBytes, i6 = 8 * t5.sigBytes;
          e5[i6 >>> 5] |= 128 << 24 - i6 % 32, e5[14 + (i6 + 64 >>> 9 << 4)] = 16711935 & (r6 << 8 | r6 >>> 24) | 4278255360 & (r6 << 24 | r6 >>> 8), t5.sigBytes = 4 * (e5.length + 1), this._process();
          for (var n5 = this._hash, o5 = n5.words, s6 = 0; s6 < 5; s6++) {
            var a4 = o5[s6];
            o5[s6] = 16711935 & (a4 << 8 | a4 >>> 24) | 4278255360 & (a4 << 24 | a4 >>> 8);
          }
          return n5;
        }, clone: function() {
          var t5 = n4.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        function p3(t5, e5, r6) {
          return t5 ^ e5 ^ r6;
        }
        function _2(t5, e5, r6) {
          return t5 & e5 | ~t5 & r6;
        }
        function y2(t5, e5, r6) {
          return (t5 | ~e5) ^ r6;
        }
        function v3(t5, e5, r6) {
          return t5 & r6 | e5 & ~r6;
        }
        function g2(t5, e5, r6) {
          return t5 ^ (e5 | ~r6);
        }
        function w2(t5, e5) {
          return t5 << e5 | t5 >>> 32 - e5;
        }
        e4.RIPEMD160 = n4._createHelper(d2), e4.HmacRIPEMD160 = n4._createHmacHelper(d2);
      }(), function() {
        var t4 = a3, e4 = t4.lib.Base, r5 = t4.enc.Utf8;
        t4.algo.HMAC = e4.extend({ init: function(t5, e5) {
          t5 = this._hasher = new t5.init(), "string" == typeof e5 && (e5 = r5.parse(e5));
          var i5 = t5.blockSize, n4 = 4 * i5;
          e5.sigBytes > n4 && (e5 = t5.finalize(e5)), e5.clamp();
          for (var o4 = this._oKey = e5.clone(), s5 = this._iKey = e5.clone(), a4 = o4.words, c3 = s5.words, h3 = 0; h3 < i5; h3++)
            a4[h3] ^= 1549556828, c3[h3] ^= 909522486;
          o4.sigBytes = s5.sigBytes = n4, this.reset();
        }, reset: function() {
          var t5 = this._hasher;
          t5.reset(), t5.update(this._iKey);
        }, update: function(t5) {
          return this._hasher.update(t5), this;
        }, finalize: function(t5) {
          var e5 = this._hasher, r6 = e5.finalize(t5);
          return e5.reset(), e5.finalize(this._oKey.clone().concat(r6));
        } });
      }(), function() {
        var t4 = a3, e4 = t4.lib, r5 = e4.Base, i5 = e4.WordArray, n4 = t4.algo, o4 = n4.SHA1, s5 = n4.HMAC, c3 = n4.PBKDF2 = r5.extend({ cfg: r5.extend({ keySize: 4, hasher: o4, iterations: 1 }), init: function(t5) {
          this.cfg = this.cfg.extend(t5);
        }, compute: function(t5, e5) {
          for (var r6 = this.cfg, n5 = s5.create(r6.hasher, t5), o5 = i5.create(), a4 = i5.create([1]), c4 = o5.words, h3 = a4.words, l3 = r6.keySize, f3 = r6.iterations; c4.length < l3; ) {
            var u3 = n5.update(e5).finalize(a4);
            n5.reset();
            for (var d2 = u3.words, p3 = d2.length, _2 = u3, y2 = 1; y2 < f3; y2++) {
              _2 = n5.finalize(_2), n5.reset();
              for (var v3 = _2.words, g2 = 0; g2 < p3; g2++)
                d2[g2] ^= v3[g2];
            }
            o5.concat(u3), h3[0]++;
          }
          return o5.sigBytes = 4 * l3, o5;
        } });
        t4.PBKDF2 = function(t5, e5, r6) {
          return c3.create(r6).compute(t5, e5);
        };
      }(), function() {
        var t4 = a3, e4 = t4.lib, r5 = e4.Base, i5 = e4.WordArray, n4 = t4.algo, o4 = n4.MD5, s5 = n4.EvpKDF = r5.extend({ cfg: r5.extend({ keySize: 4, hasher: o4, iterations: 1 }), init: function(t5) {
          this.cfg = this.cfg.extend(t5);
        }, compute: function(t5, e5) {
          for (var r6, n5 = this.cfg, o5 = n5.hasher.create(), s6 = i5.create(), a4 = s6.words, c3 = n5.keySize, h3 = n5.iterations; a4.length < c3; ) {
            r6 && o5.update(r6), r6 = o5.update(t5).finalize(e5), o5.reset();
            for (var l3 = 1; l3 < h3; l3++)
              r6 = o5.finalize(r6), o5.reset();
            s6.concat(r6);
          }
          return s6.sigBytes = 4 * c3, s6;
        } });
        t4.EvpKDF = function(t5, e5, r6) {
          return s5.create(r6).compute(t5, e5);
        };
      }(), function() {
        var t4 = a3, e4 = t4.lib.WordArray, r5 = t4.algo, i5 = r5.SHA256, n4 = r5.SHA224 = i5.extend({ _doReset: function() {
          this._hash = new e4.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
        }, _doFinalize: function() {
          var t5 = i5._doFinalize.call(this);
          return t5.sigBytes -= 4, t5;
        } });
        t4.SHA224 = i5._createHelper(n4), t4.HmacSHA224 = i5._createHmacHelper(n4);
      }(), function(t4) {
        var e4 = a3, r5 = e4.lib, i5 = r5.Base, n4 = r5.WordArray, o4 = e4.x64 = {};
        o4.Word = i5.extend({ init: function(t5, e5) {
          this.high = t5, this.low = e5;
        } }), o4.WordArray = i5.extend({ init: function(t5, e5) {
          t5 = this.words = t5 || [], this.sigBytes = null != e5 ? e5 : 8 * t5.length;
        }, toX32: function() {
          for (var t5 = this.words, e5 = t5.length, r6 = [], i6 = 0; i6 < e5; i6++) {
            var o5 = t5[i6];
            r6.push(o5.high), r6.push(o5.low);
          }
          return n4.create(r6, this.sigBytes);
        }, clone: function() {
          for (var t5 = i5.clone.call(this), e5 = t5.words = this.words.slice(0), r6 = e5.length, n5 = 0; n5 < r6; n5++)
            e5[n5] = e5[n5].clone();
          return t5;
        } });
      }(), function(t4) {
        var e4 = a3, r5 = e4.lib, i5 = r5.WordArray, n4 = r5.Hasher, o4 = e4.x64.Word, s5 = e4.algo, c3 = [], h3 = [], l3 = [];
        !function() {
          for (var t5 = 1, e5 = 0, r6 = 0; r6 < 24; r6++) {
            c3[t5 + 5 * e5] = (r6 + 1) * (r6 + 2) / 2 % 64;
            var i6 = (2 * t5 + 3 * e5) % 5;
            t5 = e5 % 5, e5 = i6;
          }
          for (t5 = 0; t5 < 5; t5++)
            for (e5 = 0; e5 < 5; e5++)
              h3[t5 + 5 * e5] = e5 + (2 * t5 + 3 * e5) % 5 * 5;
          for (var n5 = 1, s6 = 0; s6 < 24; s6++) {
            for (var a4 = 0, f4 = 0, u4 = 0; u4 < 7; u4++) {
              if (1 & n5) {
                var d2 = (1 << u4) - 1;
                d2 < 32 ? f4 ^= 1 << d2 : a4 ^= 1 << d2 - 32;
              }
              128 & n5 ? n5 = n5 << 1 ^ 113 : n5 <<= 1;
            }
            l3[s6] = o4.create(a4, f4);
          }
        }();
        var f3 = [];
        !function() {
          for (var t5 = 0; t5 < 25; t5++)
            f3[t5] = o4.create();
        }();
        var u3 = s5.SHA3 = n4.extend({ cfg: n4.cfg.extend({ outputLength: 512 }), _doReset: function() {
          for (var t5 = this._state = [], e5 = 0; e5 < 25; e5++)
            t5[e5] = new o4.init();
          this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
        }, _doProcessBlock: function(t5, e5) {
          for (var r6 = this._state, i6 = this.blockSize / 2, n5 = 0; n5 < i6; n5++) {
            var o5 = t5[e5 + 2 * n5], s6 = t5[e5 + 2 * n5 + 1];
            o5 = 16711935 & (o5 << 8 | o5 >>> 24) | 4278255360 & (o5 << 24 | o5 >>> 8), s6 = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), (C2 = r6[n5]).high ^= s6, C2.low ^= o5;
          }
          for (var a4 = 0; a4 < 24; a4++) {
            for (var u4 = 0; u4 < 5; u4++) {
              for (var d2 = 0, p3 = 0, _2 = 0; _2 < 5; _2++)
                d2 ^= (C2 = r6[u4 + 5 * _2]).high, p3 ^= C2.low;
              var y2 = f3[u4];
              y2.high = d2, y2.low = p3;
            }
            for (u4 = 0; u4 < 5; u4++) {
              var v3 = f3[(u4 + 4) % 5], g2 = f3[(u4 + 1) % 5], w2 = g2.high, B2 = g2.low;
              for (d2 = v3.high ^ (w2 << 1 | B2 >>> 31), p3 = v3.low ^ (B2 << 1 | w2 >>> 31), _2 = 0; _2 < 5; _2++)
                (C2 = r6[u4 + 5 * _2]).high ^= d2, C2.low ^= p3;
            }
            for (var k2 = 1; k2 < 25; k2++) {
              var m2 = (C2 = r6[k2]).high, b2 = C2.low, x2 = c3[k2];
              x2 < 32 ? (d2 = m2 << x2 | b2 >>> 32 - x2, p3 = b2 << x2 | m2 >>> 32 - x2) : (d2 = b2 << x2 - 32 | m2 >>> 64 - x2, p3 = m2 << x2 - 32 | b2 >>> 64 - x2);
              var S2 = f3[h3[k2]];
              S2.high = d2, S2.low = p3;
            }
            var A2 = f3[0], H2 = r6[0];
            for (A2.high = H2.high, A2.low = H2.low, u4 = 0; u4 < 5; u4++)
              for (_2 = 0; _2 < 5; _2++) {
                var C2 = r6[k2 = u4 + 5 * _2], z2 = f3[k2], E2 = f3[(u4 + 1) % 5 + 5 * _2], M2 = f3[(u4 + 2) % 5 + 5 * _2];
                C2.high = z2.high ^ ~E2.high & M2.high, C2.low = z2.low ^ ~E2.low & M2.low;
              }
            C2 = r6[0];
            var R2 = l3[a4];
            C2.high ^= R2.high, C2.low ^= R2.low;
          }
        }, _doFinalize: function() {
          var e5 = this._data, r6 = e5.words, n5 = (this._nDataBytes, 8 * e5.sigBytes), o5 = 32 * this.blockSize;
          r6[n5 >>> 5] |= 1 << 24 - n5 % 32, r6[(t4.ceil((n5 + 1) / o5) * o5 >>> 5) - 1] |= 128, e5.sigBytes = 4 * r6.length, this._process();
          for (var s6 = this._state, a4 = this.cfg.outputLength / 8, c4 = a4 / 8, h4 = [], l4 = 0; l4 < c4; l4++) {
            var f4 = s6[l4], u4 = f4.high, d2 = f4.low;
            u4 = 16711935 & (u4 << 8 | u4 >>> 24) | 4278255360 & (u4 << 24 | u4 >>> 8), d2 = 16711935 & (d2 << 8 | d2 >>> 24) | 4278255360 & (d2 << 24 | d2 >>> 8), h4.push(d2), h4.push(u4);
          }
          return new i5.init(h4, a4);
        }, clone: function() {
          for (var t5 = n4.clone.call(this), e5 = t5._state = this._state.slice(0), r6 = 0; r6 < 25; r6++)
            e5[r6] = e5[r6].clone();
          return t5;
        } });
        e4.SHA3 = n4._createHelper(u3), e4.HmacSHA3 = n4._createHmacHelper(u3);
      }(Math), function() {
        var t4 = a3, e4 = t4.lib.Hasher, r5 = t4.x64, i5 = r5.Word, n4 = r5.WordArray, o4 = t4.algo;
        function s5() {
          return i5.create.apply(i5, arguments);
        }
        var c3 = [s5(1116352408, 3609767458), s5(1899447441, 602891725), s5(3049323471, 3964484399), s5(3921009573, 2173295548), s5(961987163, 4081628472), s5(1508970993, 3053834265), s5(2453635748, 2937671579), s5(2870763221, 3664609560), s5(3624381080, 2734883394), s5(310598401, 1164996542), s5(607225278, 1323610764), s5(1426881987, 3590304994), s5(1925078388, 4068182383), s5(2162078206, 991336113), s5(2614888103, 633803317), s5(3248222580, 3479774868), s5(3835390401, 2666613458), s5(4022224774, 944711139), s5(264347078, 2341262773), s5(604807628, 2007800933), s5(770255983, 1495990901), s5(1249150122, 1856431235), s5(1555081692, 3175218132), s5(1996064986, 2198950837), s5(2554220882, 3999719339), s5(2821834349, 766784016), s5(2952996808, 2566594879), s5(3210313671, 3203337956), s5(3336571891, 1034457026), s5(3584528711, 2466948901), s5(113926993, 3758326383), s5(338241895, 168717936), s5(666307205, 1188179964), s5(773529912, 1546045734), s5(1294757372, 1522805485), s5(1396182291, 2643833823), s5(1695183700, 2343527390), s5(1986661051, 1014477480), s5(2177026350, 1206759142), s5(2456956037, 344077627), s5(2730485921, 1290863460), s5(2820302411, 3158454273), s5(3259730800, 3505952657), s5(3345764771, 106217008), s5(3516065817, 3606008344), s5(3600352804, 1432725776), s5(4094571909, 1467031594), s5(275423344, 851169720), s5(430227734, 3100823752), s5(506948616, 1363258195), s5(659060556, 3750685593), s5(883997877, 3785050280), s5(958139571, 3318307427), s5(1322822218, 3812723403), s5(1537002063, 2003034995), s5(1747873779, 3602036899), s5(1955562222, 1575990012), s5(2024104815, 1125592928), s5(2227730452, 2716904306), s5(2361852424, 442776044), s5(2428436474, 593698344), s5(2756734187, 3733110249), s5(3204031479, 2999351573), s5(3329325298, 3815920427), s5(3391569614, 3928383900), s5(3515267271, 566280711), s5(3940187606, 3454069534), s5(4118630271, 4000239992), s5(116418474, 1914138554), s5(174292421, 2731055270), s5(289380356, 3203993006), s5(460393269, 320620315), s5(685471733, 587496836), s5(852142971, 1086792851), s5(1017036298, 365543100), s5(1126000580, 2618297676), s5(1288033470, 3409855158), s5(1501505948, 4234509866), s5(1607167915, 987167468), s5(1816402316, 1246189591)], h3 = [];
        !function() {
          for (var t5 = 0; t5 < 80; t5++)
            h3[t5] = s5();
        }();
        var l3 = o4.SHA512 = e4.extend({ _doReset: function() {
          this._hash = new n4.init([new i5.init(1779033703, 4089235720), new i5.init(3144134277, 2227873595), new i5.init(1013904242, 4271175723), new i5.init(2773480762, 1595750129), new i5.init(1359893119, 2917565137), new i5.init(2600822924, 725511199), new i5.init(528734635, 4215389547), new i5.init(1541459225, 327033209)]);
        }, _doProcessBlock: function(t5, e5) {
          for (var r6 = this._hash.words, i6 = r6[0], n5 = r6[1], o5 = r6[2], s6 = r6[3], a4 = r6[4], l4 = r6[5], f3 = r6[6], u3 = r6[7], d2 = i6.high, p3 = i6.low, _2 = n5.high, y2 = n5.low, v3 = o5.high, g2 = o5.low, w2 = s6.high, B2 = s6.low, k2 = a4.high, m2 = a4.low, b2 = l4.high, x2 = l4.low, S2 = f3.high, A2 = f3.low, H2 = u3.high, C2 = u3.low, z2 = d2, E2 = p3, M2 = _2, R2 = y2, D2 = v3, P2 = g2, F2 = w2, O2 = B2, L2 = k2, T2 = m2, I2 = b2, W2 = x2, j2 = S2, U2 = A2, K2 = H2, X2 = C2, N3 = 0; N3 < 80; N3++) {
            var q2, V2, Z2 = h3[N3];
            if (N3 < 16)
              V2 = Z2.high = 0 | t5[e5 + 2 * N3], q2 = Z2.low = 0 | t5[e5 + 2 * N3 + 1];
            else {
              var $2 = h3[N3 - 15], G2 = $2.high, J2 = $2.low, Q2 = (G2 >>> 1 | J2 << 31) ^ (G2 >>> 8 | J2 << 24) ^ G2 >>> 7, Y2 = (J2 >>> 1 | G2 << 31) ^ (J2 >>> 8 | G2 << 24) ^ (J2 >>> 7 | G2 << 25), tt2 = h3[N3 - 2], et2 = tt2.high, rt2 = tt2.low, it2 = (et2 >>> 19 | rt2 << 13) ^ (et2 << 3 | rt2 >>> 29) ^ et2 >>> 6, nt2 = (rt2 >>> 19 | et2 << 13) ^ (rt2 << 3 | et2 >>> 29) ^ (rt2 >>> 6 | et2 << 26), ot2 = h3[N3 - 7], st2 = ot2.high, at2 = ot2.low, ct2 = h3[N3 - 16], ht2 = ct2.high, lt2 = ct2.low;
              V2 = (V2 = (V2 = Q2 + st2 + ((q2 = Y2 + at2) >>> 0 < Y2 >>> 0 ? 1 : 0)) + it2 + ((q2 += nt2) >>> 0 < nt2 >>> 0 ? 1 : 0)) + ht2 + ((q2 += lt2) >>> 0 < lt2 >>> 0 ? 1 : 0), Z2.high = V2, Z2.low = q2;
            }
            var ft2, ut2 = L2 & I2 ^ ~L2 & j2, dt2 = T2 & W2 ^ ~T2 & U2, pt2 = z2 & M2 ^ z2 & D2 ^ M2 & D2, _t2 = E2 & R2 ^ E2 & P2 ^ R2 & P2, yt2 = (z2 >>> 28 | E2 << 4) ^ (z2 << 30 | E2 >>> 2) ^ (z2 << 25 | E2 >>> 7), vt2 = (E2 >>> 28 | z2 << 4) ^ (E2 << 30 | z2 >>> 2) ^ (E2 << 25 | z2 >>> 7), gt2 = (L2 >>> 14 | T2 << 18) ^ (L2 >>> 18 | T2 << 14) ^ (L2 << 23 | T2 >>> 9), wt2 = (T2 >>> 14 | L2 << 18) ^ (T2 >>> 18 | L2 << 14) ^ (T2 << 23 | L2 >>> 9), Bt2 = c3[N3], kt2 = Bt2.high, mt2 = Bt2.low, bt2 = K2 + gt2 + ((ft2 = X2 + wt2) >>> 0 < X2 >>> 0 ? 1 : 0), xt2 = vt2 + _t2;
            K2 = j2, X2 = U2, j2 = I2, U2 = W2, I2 = L2, W2 = T2, L2 = F2 + (bt2 = (bt2 = (bt2 = bt2 + ut2 + ((ft2 += dt2) >>> 0 < dt2 >>> 0 ? 1 : 0)) + kt2 + ((ft2 += mt2) >>> 0 < mt2 >>> 0 ? 1 : 0)) + V2 + ((ft2 += q2) >>> 0 < q2 >>> 0 ? 1 : 0)) + ((T2 = O2 + ft2 | 0) >>> 0 < O2 >>> 0 ? 1 : 0) | 0, F2 = D2, O2 = P2, D2 = M2, P2 = R2, M2 = z2, R2 = E2, z2 = bt2 + (yt2 + pt2 + (xt2 >>> 0 < vt2 >>> 0 ? 1 : 0)) + ((E2 = ft2 + xt2 | 0) >>> 0 < ft2 >>> 0 ? 1 : 0) | 0;
          }
          p3 = i6.low = p3 + E2, i6.high = d2 + z2 + (p3 >>> 0 < E2 >>> 0 ? 1 : 0), y2 = n5.low = y2 + R2, n5.high = _2 + M2 + (y2 >>> 0 < R2 >>> 0 ? 1 : 0), g2 = o5.low = g2 + P2, o5.high = v3 + D2 + (g2 >>> 0 < P2 >>> 0 ? 1 : 0), B2 = s6.low = B2 + O2, s6.high = w2 + F2 + (B2 >>> 0 < O2 >>> 0 ? 1 : 0), m2 = a4.low = m2 + T2, a4.high = k2 + L2 + (m2 >>> 0 < T2 >>> 0 ? 1 : 0), x2 = l4.low = x2 + W2, l4.high = b2 + I2 + (x2 >>> 0 < W2 >>> 0 ? 1 : 0), A2 = f3.low = A2 + U2, f3.high = S2 + j2 + (A2 >>> 0 < U2 >>> 0 ? 1 : 0), C2 = u3.low = C2 + X2, u3.high = H2 + K2 + (C2 >>> 0 < X2 >>> 0 ? 1 : 0);
        }, _doFinalize: function() {
          var t5 = this._data, e5 = t5.words, r6 = 8 * this._nDataBytes, i6 = 8 * t5.sigBytes;
          return e5[i6 >>> 5] |= 128 << 24 - i6 % 32, e5[30 + (i6 + 128 >>> 10 << 5)] = Math.floor(r6 / 4294967296), e5[31 + (i6 + 128 >>> 10 << 5)] = r6, t5.sigBytes = 4 * e5.length, this._process(), this._hash.toX32();
        }, clone: function() {
          var t5 = e4.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        }, blockSize: 32 });
        t4.SHA512 = e4._createHelper(l3), t4.HmacSHA512 = e4._createHmacHelper(l3);
      }(), function() {
        var t4 = a3, e4 = t4.x64, r5 = e4.Word, i5 = e4.WordArray, n4 = t4.algo, o4 = n4.SHA512, s5 = n4.SHA384 = o4.extend({ _doReset: function() {
          this._hash = new i5.init([new r5.init(3418070365, 3238371032), new r5.init(1654270250, 914150663), new r5.init(2438529370, 812702999), new r5.init(355462360, 4144912697), new r5.init(1731405415, 4290775857), new r5.init(2394180231, 1750603025), new r5.init(3675008525, 1694076839), new r5.init(1203062813, 3204075428)]);
        }, _doFinalize: function() {
          var t5 = o4._doFinalize.call(this);
          return t5.sigBytes -= 16, t5;
        } });
        t4.SHA384 = o4._createHelper(s5), t4.HmacSHA384 = o4._createHmacHelper(s5);
      }(), a3.lib.Cipher || function(t4) {
        var e4 = a3, r5 = e4.lib, i5 = r5.Base, n4 = r5.WordArray, o4 = r5.BufferedBlockAlgorithm, s5 = e4.enc, c3 = (s5.Utf8, s5.Base64), h3 = e4.algo.EvpKDF, l3 = r5.Cipher = o4.extend({ cfg: i5.extend(), createEncryptor: function(t5, e5) {
          return this.create(this._ENC_XFORM_MODE, t5, e5);
        }, createDecryptor: function(t5, e5) {
          return this.create(this._DEC_XFORM_MODE, t5, e5);
        }, init: function(t5, e5, r6) {
          this.cfg = this.cfg.extend(r6), this._xformMode = t5, this._key = e5, this.reset();
        }, reset: function() {
          o4.reset.call(this), this._doReset();
        }, process: function(t5) {
          return this._append(t5), this._process();
        }, finalize: function(t5) {
          return t5 && this._append(t5), this._doFinalize();
        }, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: /* @__PURE__ */ function() {
          function t5(t6) {
            return "string" == typeof t6 ? w2 : v3;
          }
          return function(e5) {
            return { encrypt: function(r6, i6, n5) {
              return t5(i6).encrypt(e5, r6, i6, n5);
            }, decrypt: function(r6, i6, n5) {
              return t5(i6).decrypt(e5, r6, i6, n5);
            } };
          };
        }() }), f3 = (r5.StreamCipher = l3.extend({ _doFinalize: function() {
          return this._process(true);
        }, blockSize: 1 }), e4.mode = {}), u3 = r5.BlockCipherMode = i5.extend({ createEncryptor: function(t5, e5) {
          return this.Encryptor.create(t5, e5);
        }, createDecryptor: function(t5, e5) {
          return this.Decryptor.create(t5, e5);
        }, init: function(t5, e5) {
          this._cipher = t5, this._iv = e5;
        } }), d2 = f3.CBC = function() {
          var t5 = u3.extend();
          function e5(t6, e6, r6) {
            var i6, n5 = this._iv;
            n5 ? (i6 = n5, this._iv = void 0) : i6 = this._prevBlock;
            for (var o5 = 0; o5 < r6; o5++)
              t6[e6 + o5] ^= i6[o5];
          }
          return t5.Encryptor = t5.extend({ processBlock: function(t6, r6) {
            var i6 = this._cipher, n5 = i6.blockSize;
            e5.call(this, t6, r6, n5), i6.encryptBlock(t6, r6), this._prevBlock = t6.slice(r6, r6 + n5);
          } }), t5.Decryptor = t5.extend({ processBlock: function(t6, r6) {
            var i6 = this._cipher, n5 = i6.blockSize, o5 = t6.slice(r6, r6 + n5);
            i6.decryptBlock(t6, r6), e5.call(this, t6, r6, n5), this._prevBlock = o5;
          } }), t5;
        }(), p3 = (e4.pad = {}).Pkcs7 = { pad: function(t5, e5) {
          for (var r6 = 4 * e5, i6 = r6 - t5.sigBytes % r6, o5 = i6 << 24 | i6 << 16 | i6 << 8 | i6, s6 = [], a4 = 0; a4 < i6; a4 += 4)
            s6.push(o5);
          var c4 = n4.create(s6, i6);
          t5.concat(c4);
        }, unpad: function(t5) {
          var e5 = 255 & t5.words[t5.sigBytes - 1 >>> 2];
          t5.sigBytes -= e5;
        } }, _2 = (r5.BlockCipher = l3.extend({ cfg: l3.cfg.extend({ mode: d2, padding: p3 }), reset: function() {
          var t5;
          l3.reset.call(this);
          var e5 = this.cfg, r6 = e5.iv, i6 = e5.mode;
          this._xformMode == this._ENC_XFORM_MODE ? t5 = i6.createEncryptor : (t5 = i6.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == t5 ? this._mode.init(this, r6 && r6.words) : (this._mode = t5.call(i6, this, r6 && r6.words), this._mode.__creator = t5);
        }, _doProcessBlock: function(t5, e5) {
          this._mode.processBlock(t5, e5);
        }, _doFinalize: function() {
          var t5, e5 = this.cfg.padding;
          return this._xformMode == this._ENC_XFORM_MODE ? (e5.pad(this._data, this.blockSize), t5 = this._process(true)) : (t5 = this._process(true), e5.unpad(t5)), t5;
        }, blockSize: 4 }), r5.CipherParams = i5.extend({ init: function(t5) {
          this.mixIn(t5);
        }, toString: function(t5) {
          return (t5 || this.formatter).stringify(this);
        } })), y2 = (e4.format = {}).OpenSSL = { stringify: function(t5) {
          var e5 = t5.ciphertext, r6 = t5.salt;
          return (r6 ? n4.create([1398893684, 1701076831]).concat(r6).concat(e5) : e5).toString(c3);
        }, parse: function(t5) {
          var e5, r6 = c3.parse(t5), i6 = r6.words;
          return 1398893684 == i6[0] && 1701076831 == i6[1] && (e5 = n4.create(i6.slice(2, 4)), i6.splice(0, 4), r6.sigBytes -= 16), _2.create({ ciphertext: r6, salt: e5 });
        } }, v3 = r5.SerializableCipher = i5.extend({ cfg: i5.extend({ format: y2 }), encrypt: function(t5, e5, r6, i6) {
          i6 = this.cfg.extend(i6);
          var n5 = t5.createEncryptor(r6, i6), o5 = n5.finalize(e5), s6 = n5.cfg;
          return _2.create({ ciphertext: o5, key: r6, iv: s6.iv, algorithm: t5, mode: s6.mode, padding: s6.padding, blockSize: t5.blockSize, formatter: i6.format });
        }, decrypt: function(t5, e5, r6, i6) {
          return i6 = this.cfg.extend(i6), e5 = this._parse(e5, i6.format), t5.createDecryptor(r6, i6).finalize(e5.ciphertext);
        }, _parse: function(t5, e5) {
          return "string" == typeof t5 ? e5.parse(t5, this) : t5;
        } }), g2 = (e4.kdf = {}).OpenSSL = { execute: function(t5, e5, r6, i6) {
          i6 || (i6 = n4.random(8));
          var o5 = h3.create({ keySize: e5 + r6 }).compute(t5, i6), s6 = n4.create(o5.words.slice(e5), 4 * r6);
          return o5.sigBytes = 4 * e5, _2.create({ key: o5, iv: s6, salt: i6 });
        } }, w2 = r5.PasswordBasedCipher = v3.extend({ cfg: v3.cfg.extend({ kdf: g2 }), encrypt: function(t5, e5, r6, i6) {
          var n5 = (i6 = this.cfg.extend(i6)).kdf.execute(r6, t5.keySize, t5.ivSize);
          i6.iv = n5.iv;
          var o5 = v3.encrypt.call(this, t5, e5, n5.key, i6);
          return o5.mixIn(n5), o5;
        }, decrypt: function(t5, e5, r6, i6) {
          i6 = this.cfg.extend(i6), e5 = this._parse(e5, i6.format);
          var n5 = i6.kdf.execute(r6, t5.keySize, t5.ivSize, e5.salt);
          return i6.iv = n5.iv, v3.decrypt.call(this, t5, e5, n5.key, i6);
        } });
      }(), a3.mode.CFB = function() {
        var t4 = a3.lib.BlockCipherMode.extend();
        function e4(t5, e5, r5, i5) {
          var n4, o4 = this._iv;
          o4 ? (n4 = o4.slice(0), this._iv = void 0) : n4 = this._prevBlock, i5.encryptBlock(n4, 0);
          for (var s5 = 0; s5 < r5; s5++)
            t5[e5 + s5] ^= n4[s5];
        }
        return t4.Encryptor = t4.extend({ processBlock: function(t5, r5) {
          var i5 = this._cipher, n4 = i5.blockSize;
          e4.call(this, t5, r5, n4, i5), this._prevBlock = t5.slice(r5, r5 + n4);
        } }), t4.Decryptor = t4.extend({ processBlock: function(t5, r5) {
          var i5 = this._cipher, n4 = i5.blockSize, o4 = t5.slice(r5, r5 + n4);
          e4.call(this, t5, r5, n4, i5), this._prevBlock = o4;
        } }), t4;
      }(), a3.mode.ECB = ((n3 = a3.lib.BlockCipherMode.extend()).Encryptor = n3.extend({ processBlock: function(t4, e4) {
        this._cipher.encryptBlock(t4, e4);
      } }), n3.Decryptor = n3.extend({ processBlock: function(t4, e4) {
        this._cipher.decryptBlock(t4, e4);
      } }), n3), a3.pad.AnsiX923 = { pad: function(t4, e4) {
        var r5 = t4.sigBytes, i5 = 4 * e4, n4 = i5 - r5 % i5, o4 = r5 + n4 - 1;
        t4.clamp(), t4.words[o4 >>> 2] |= n4 << 24 - o4 % 4 * 8, t4.sigBytes += n4;
      }, unpad: function(t4) {
        var e4 = 255 & t4.words[t4.sigBytes - 1 >>> 2];
        t4.sigBytes -= e4;
      } }, a3.pad.Iso10126 = { pad: function(t4, e4) {
        var r5 = 4 * e4, i5 = r5 - t4.sigBytes % r5;
        t4.concat(a3.lib.WordArray.random(i5 - 1)).concat(a3.lib.WordArray.create([i5 << 24], 1));
      }, unpad: function(t4) {
        var e4 = 255 & t4.words[t4.sigBytes - 1 >>> 2];
        t4.sigBytes -= e4;
      } }, a3.pad.Iso97971 = { pad: function(t4, e4) {
        t4.concat(a3.lib.WordArray.create([2147483648], 1)), a3.pad.ZeroPadding.pad(t4, e4);
      }, unpad: function(t4) {
        a3.pad.ZeroPadding.unpad(t4), t4.sigBytes--;
      } }, a3.mode.OFB = (r4 = a3.lib.BlockCipherMode.extend(), i4 = r4.Encryptor = r4.extend({ processBlock: function(t4, e4) {
        var r5 = this._cipher, i5 = r5.blockSize, n4 = this._iv, o4 = this._keystream;
        n4 && (o4 = this._keystream = n4.slice(0), this._iv = void 0), r5.encryptBlock(o4, 0);
        for (var s5 = 0; s5 < i5; s5++)
          t4[e4 + s5] ^= o4[s5];
      } }), r4.Decryptor = i4, r4), a3.pad.NoPadding = { pad: function() {
      }, unpad: function() {
      } }, function(t4) {
        var e4 = a3, r5 = e4.lib.CipherParams, i5 = e4.enc.Hex;
        e4.format.Hex = { stringify: function(t5) {
          return t5.ciphertext.toString(i5);
        }, parse: function(t5) {
          var e5 = i5.parse(t5);
          return r5.create({ ciphertext: e5 });
        } };
      }(), function() {
        var t4 = a3, e4 = t4.lib.BlockCipher, r5 = t4.algo, i5 = [], n4 = [], o4 = [], s5 = [], c3 = [], h3 = [], l3 = [], f3 = [], u3 = [], d2 = [];
        !function() {
          for (var t5 = [], e5 = 0; e5 < 256; e5++)
            t5[e5] = e5 < 128 ? e5 << 1 : e5 << 1 ^ 283;
          var r6 = 0, a4 = 0;
          for (e5 = 0; e5 < 256; e5++) {
            var p4 = a4 ^ a4 << 1 ^ a4 << 2 ^ a4 << 3 ^ a4 << 4;
            p4 = p4 >>> 8 ^ 255 & p4 ^ 99, i5[r6] = p4, n4[p4] = r6;
            var _3 = t5[r6], y2 = t5[_3], v3 = t5[y2], g2 = 257 * t5[p4] ^ 16843008 * p4;
            o4[r6] = g2 << 24 | g2 >>> 8, s5[r6] = g2 << 16 | g2 >>> 16, c3[r6] = g2 << 8 | g2 >>> 24, h3[r6] = g2, g2 = 16843009 * v3 ^ 65537 * y2 ^ 257 * _3 ^ 16843008 * r6, l3[p4] = g2 << 24 | g2 >>> 8, f3[p4] = g2 << 16 | g2 >>> 16, u3[p4] = g2 << 8 | g2 >>> 24, d2[p4] = g2, r6 ? (r6 = _3 ^ t5[t5[t5[v3 ^ _3]]], a4 ^= t5[t5[a4]]) : r6 = a4 = 1;
          }
        }();
        var p3 = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], _2 = r5.AES = e4.extend({ _doReset: function() {
          if (!this._nRounds || this._keyPriorReset !== this._key) {
            for (var t5 = this._keyPriorReset = this._key, e5 = t5.words, r6 = t5.sigBytes / 4, n5 = 4 * ((this._nRounds = r6 + 6) + 1), o5 = this._keySchedule = [], s6 = 0; s6 < n5; s6++)
              s6 < r6 ? o5[s6] = e5[s6] : (h4 = o5[s6 - 1], s6 % r6 ? r6 > 6 && s6 % r6 == 4 && (h4 = i5[h4 >>> 24] << 24 | i5[h4 >>> 16 & 255] << 16 | i5[h4 >>> 8 & 255] << 8 | i5[255 & h4]) : (h4 = i5[(h4 = h4 << 8 | h4 >>> 24) >>> 24] << 24 | i5[h4 >>> 16 & 255] << 16 | i5[h4 >>> 8 & 255] << 8 | i5[255 & h4], h4 ^= p3[s6 / r6 | 0] << 24), o5[s6] = o5[s6 - r6] ^ h4);
            for (var a4 = this._invKeySchedule = [], c4 = 0; c4 < n5; c4++) {
              if (s6 = n5 - c4, c4 % 4)
                var h4 = o5[s6];
              else
                h4 = o5[s6 - 4];
              a4[c4] = c4 < 4 || s6 <= 4 ? h4 : l3[i5[h4 >>> 24]] ^ f3[i5[h4 >>> 16 & 255]] ^ u3[i5[h4 >>> 8 & 255]] ^ d2[i5[255 & h4]];
            }
          }
        }, encryptBlock: function(t5, e5) {
          this._doCryptBlock(t5, e5, this._keySchedule, o4, s5, c3, h3, i5);
        }, decryptBlock: function(t5, e5) {
          var r6 = t5[e5 + 1];
          t5[e5 + 1] = t5[e5 + 3], t5[e5 + 3] = r6, this._doCryptBlock(t5, e5, this._invKeySchedule, l3, f3, u3, d2, n4), r6 = t5[e5 + 1], t5[e5 + 1] = t5[e5 + 3], t5[e5 + 3] = r6;
        }, _doCryptBlock: function(t5, e5, r6, i6, n5, o5, s6, a4) {
          for (var c4 = this._nRounds, h4 = t5[e5] ^ r6[0], l4 = t5[e5 + 1] ^ r6[1], f4 = t5[e5 + 2] ^ r6[2], u4 = t5[e5 + 3] ^ r6[3], d3 = 4, p4 = 1; p4 < c4; p4++) {
            var _3 = i6[h4 >>> 24] ^ n5[l4 >>> 16 & 255] ^ o5[f4 >>> 8 & 255] ^ s6[255 & u4] ^ r6[d3++], y2 = i6[l4 >>> 24] ^ n5[f4 >>> 16 & 255] ^ o5[u4 >>> 8 & 255] ^ s6[255 & h4] ^ r6[d3++], v3 = i6[f4 >>> 24] ^ n5[u4 >>> 16 & 255] ^ o5[h4 >>> 8 & 255] ^ s6[255 & l4] ^ r6[d3++], g2 = i6[u4 >>> 24] ^ n5[h4 >>> 16 & 255] ^ o5[l4 >>> 8 & 255] ^ s6[255 & f4] ^ r6[d3++];
            h4 = _3, l4 = y2, f4 = v3, u4 = g2;
          }
          _3 = (a4[h4 >>> 24] << 24 | a4[l4 >>> 16 & 255] << 16 | a4[f4 >>> 8 & 255] << 8 | a4[255 & u4]) ^ r6[d3++], y2 = (a4[l4 >>> 24] << 24 | a4[f4 >>> 16 & 255] << 16 | a4[u4 >>> 8 & 255] << 8 | a4[255 & h4]) ^ r6[d3++], v3 = (a4[f4 >>> 24] << 24 | a4[u4 >>> 16 & 255] << 16 | a4[h4 >>> 8 & 255] << 8 | a4[255 & l4]) ^ r6[d3++], g2 = (a4[u4 >>> 24] << 24 | a4[h4 >>> 16 & 255] << 16 | a4[l4 >>> 8 & 255] << 8 | a4[255 & f4]) ^ r6[d3++], t5[e5] = _3, t5[e5 + 1] = y2, t5[e5 + 2] = v3, t5[e5 + 3] = g2;
        }, keySize: 8 });
        t4.AES = e4._createHelper(_2);
      }(), function() {
        var t4 = a3, e4 = t4.lib, r5 = e4.WordArray, i5 = e4.BlockCipher, n4 = t4.algo, o4 = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4], s5 = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32], c3 = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28], h3 = [{ 0: 8421888, 268435456: 32768, 536870912: 8421378, 805306368: 2, 1073741824: 512, 1342177280: 8421890, 1610612736: 8389122, 1879048192: 8388608, 2147483648: 514, 2415919104: 8389120, 2684354560: 33280, 2952790016: 8421376, 3221225472: 32770, 3489660928: 8388610, 3758096384: 0, 4026531840: 33282, 134217728: 0, 402653184: 8421890, 671088640: 33282, 939524096: 32768, 1207959552: 8421888, 1476395008: 512, 1744830464: 8421378, 2013265920: 2, 2281701376: 8389120, 2550136832: 33280, 2818572288: 8421376, 3087007744: 8389122, 3355443200: 8388610, 3623878656: 32770, 3892314112: 514, 4160749568: 8388608, 1: 32768, 268435457: 2, 536870913: 8421888, 805306369: 8388608, 1073741825: 8421378, 1342177281: 33280, 1610612737: 512, 1879048193: 8389122, 2147483649: 8421890, 2415919105: 8421376, 2684354561: 8388610, 2952790017: 33282, 3221225473: 514, 3489660929: 8389120, 3758096385: 32770, 4026531841: 0, 134217729: 8421890, 402653185: 8421376, 671088641: 8388608, 939524097: 512, 1207959553: 32768, 1476395009: 8388610, 1744830465: 2, 2013265921: 33282, 2281701377: 32770, 2550136833: 8389122, 2818572289: 514, 3087007745: 8421888, 3355443201: 8389120, 3623878657: 0, 3892314113: 33280, 4160749569: 8421378 }, { 0: 1074282512, 16777216: 16384, 33554432: 524288, 50331648: 1074266128, 67108864: 1073741840, 83886080: 1074282496, 100663296: 1073758208, 117440512: 16, 134217728: 540672, 150994944: 1073758224, 167772160: 1073741824, 184549376: 540688, 201326592: 524304, 218103808: 0, 234881024: 16400, 251658240: 1074266112, 8388608: 1073758208, 25165824: 540688, 41943040: 16, 58720256: 1073758224, 75497472: 1074282512, 92274688: 1073741824, 109051904: 524288, 125829120: 1074266128, 142606336: 524304, 159383552: 0, 176160768: 16384, 192937984: 1074266112, 209715200: 1073741840, 226492416: 540672, 243269632: 1074282496, 260046848: 16400, 268435456: 0, 285212672: 1074266128, 301989888: 1073758224, 318767104: 1074282496, 335544320: 1074266112, 352321536: 16, 369098752: 540688, 385875968: 16384, 402653184: 16400, 419430400: 524288, 436207616: 524304, 452984832: 1073741840, 469762048: 540672, 486539264: 1073758208, 503316480: 1073741824, 520093696: 1074282512, 276824064: 540688, 293601280: 524288, 310378496: 1074266112, 327155712: 16384, 343932928: 1073758208, 360710144: 1074282512, 377487360: 16, 394264576: 1073741824, 411041792: 1074282496, 427819008: 1073741840, 444596224: 1073758224, 461373440: 524304, 478150656: 0, 494927872: 16400, 511705088: 1074266128, 528482304: 540672 }, { 0: 260, 1048576: 0, 2097152: 67109120, 3145728: 65796, 4194304: 65540, 5242880: 67108868, 6291456: 67174660, 7340032: 67174400, 8388608: 67108864, 9437184: 67174656, 10485760: 65792, 11534336: 67174404, 12582912: 67109124, 13631488: 65536, 14680064: 4, 15728640: 256, 524288: 67174656, 1572864: 67174404, 2621440: 0, 3670016: 67109120, 4718592: 67108868, 5767168: 65536, 6815744: 65540, 7864320: 260, 8912896: 4, 9961472: 256, 11010048: 67174400, 12058624: 65796, 13107200: 65792, 14155776: 67109124, 15204352: 67174660, 16252928: 67108864, 16777216: 67174656, 17825792: 65540, 18874368: 65536, 19922944: 67109120, 20971520: 256, 22020096: 67174660, 23068672: 67108868, 24117248: 0, 25165824: 67109124, 26214400: 67108864, 27262976: 4, 28311552: 65792, 29360128: 67174400, 30408704: 260, 31457280: 65796, 32505856: 67174404, 17301504: 67108864, 18350080: 260, 19398656: 67174656, 20447232: 0, 21495808: 65540, 22544384: 67109120, 23592960: 256, 24641536: 67174404, 25690112: 65536, 26738688: 67174660, 27787264: 65796, 28835840: 67108868, 29884416: 67109124, 30932992: 67174400, 31981568: 4, 33030144: 65792 }, { 0: 2151682048, 65536: 2147487808, 131072: 4198464, 196608: 2151677952, 262144: 0, 327680: 4198400, 393216: 2147483712, 458752: 4194368, 524288: 2147483648, 589824: 4194304, 655360: 64, 720896: 2147487744, 786432: 2151678016, 851968: 4160, 917504: 4096, 983040: 2151682112, 32768: 2147487808, 98304: 64, 163840: 2151678016, 229376: 2147487744, 294912: 4198400, 360448: 2151682112, 425984: 0, 491520: 2151677952, 557056: 4096, 622592: 2151682048, 688128: 4194304, 753664: 4160, 819200: 2147483648, 884736: 4194368, 950272: 4198464, 1015808: 2147483712, 1048576: 4194368, 1114112: 4198400, 1179648: 2147483712, 1245184: 0, 1310720: 4160, 1376256: 2151678016, 1441792: 2151682048, 1507328: 2147487808, 1572864: 2151682112, 1638400: 2147483648, 1703936: 2151677952, 1769472: 4198464, 1835008: 2147487744, 1900544: 4194304, 1966080: 64, 2031616: 4096, 1081344: 2151677952, 1146880: 2151682112, 1212416: 0, 1277952: 4198400, 1343488: 4194368, 1409024: 2147483648, 1474560: 2147487808, 1540096: 64, 1605632: 2147483712, 1671168: 4096, 1736704: 2147487744, 1802240: 2151678016, 1867776: 4160, 1933312: 2151682048, 1998848: 4194304, 2064384: 4198464 }, { 0: 128, 4096: 17039360, 8192: 262144, 12288: 536870912, 16384: 537133184, 20480: 16777344, 24576: 553648256, 28672: 262272, 32768: 16777216, 36864: 537133056, 40960: 536871040, 45056: 553910400, 49152: 553910272, 53248: 0, 57344: 17039488, 61440: 553648128, 2048: 17039488, 6144: 553648256, 10240: 128, 14336: 17039360, 18432: 262144, 22528: 537133184, 26624: 553910272, 30720: 536870912, 34816: 537133056, 38912: 0, 43008: 553910400, 47104: 16777344, 51200: 536871040, 55296: 553648128, 59392: 16777216, 63488: 262272, 65536: 262144, 69632: 128, 73728: 536870912, 77824: 553648256, 81920: 16777344, 86016: 553910272, 90112: 537133184, 94208: 16777216, 98304: 553910400, 102400: 553648128, 106496: 17039360, 110592: 537133056, 114688: 262272, 118784: 536871040, 122880: 0, 126976: 17039488, 67584: 553648256, 71680: 16777216, 75776: 17039360, 79872: 537133184, 83968: 536870912, 88064: 17039488, 92160: 128, 96256: 553910272, 100352: 262272, 104448: 553910400, 108544: 0, 112640: 553648128, 116736: 16777344, 120832: 262144, 124928: 537133056, 129024: 536871040 }, { 0: 268435464, 256: 8192, 512: 270532608, 768: 270540808, 1024: 268443648, 1280: 2097152, 1536: 2097160, 1792: 268435456, 2048: 0, 2304: 268443656, 2560: 2105344, 2816: 8, 3072: 270532616, 3328: 2105352, 3584: 8200, 3840: 270540800, 128: 270532608, 384: 270540808, 640: 8, 896: 2097152, 1152: 2105352, 1408: 268435464, 1664: 268443648, 1920: 8200, 2176: 2097160, 2432: 8192, 2688: 268443656, 2944: 270532616, 3200: 0, 3456: 270540800, 3712: 2105344, 3968: 268435456, 4096: 268443648, 4352: 270532616, 4608: 270540808, 4864: 8200, 5120: 2097152, 5376: 268435456, 5632: 268435464, 5888: 2105344, 6144: 2105352, 6400: 0, 6656: 8, 6912: 270532608, 7168: 8192, 7424: 268443656, 7680: 270540800, 7936: 2097160, 4224: 8, 4480: 2105344, 4736: 2097152, 4992: 268435464, 5248: 268443648, 5504: 8200, 5760: 270540808, 6016: 270532608, 6272: 270540800, 6528: 270532616, 6784: 8192, 7040: 2105352, 7296: 2097160, 7552: 0, 7808: 268435456, 8064: 268443656 }, { 0: 1048576, 16: 33555457, 32: 1024, 48: 1049601, 64: 34604033, 80: 0, 96: 1, 112: 34603009, 128: 33555456, 144: 1048577, 160: 33554433, 176: 34604032, 192: 34603008, 208: 1025, 224: 1049600, 240: 33554432, 8: 34603009, 24: 0, 40: 33555457, 56: 34604032, 72: 1048576, 88: 33554433, 104: 33554432, 120: 1025, 136: 1049601, 152: 33555456, 168: 34603008, 184: 1048577, 200: 1024, 216: 34604033, 232: 1, 248: 1049600, 256: 33554432, 272: 1048576, 288: 33555457, 304: 34603009, 320: 1048577, 336: 33555456, 352: 34604032, 368: 1049601, 384: 1025, 400: 34604033, 416: 1049600, 432: 1, 448: 0, 464: 34603008, 480: 33554433, 496: 1024, 264: 1049600, 280: 33555457, 296: 34603009, 312: 1, 328: 33554432, 344: 1048576, 360: 1025, 376: 34604032, 392: 33554433, 408: 34603008, 424: 0, 440: 34604033, 456: 1049601, 472: 1024, 488: 33555456, 504: 1048577 }, { 0: 134219808, 1: 131072, 2: 134217728, 3: 32, 4: 131104, 5: 134350880, 6: 134350848, 7: 2048, 8: 134348800, 9: 134219776, 10: 133120, 11: 134348832, 12: 2080, 13: 0, 14: 134217760, 15: 133152, 2147483648: 2048, 2147483649: 134350880, 2147483650: 134219808, 2147483651: 134217728, 2147483652: 134348800, 2147483653: 133120, 2147483654: 133152, 2147483655: 32, 2147483656: 134217760, 2147483657: 2080, 2147483658: 131104, 2147483659: 134350848, 2147483660: 0, 2147483661: 134348832, 2147483662: 134219776, 2147483663: 131072, 16: 133152, 17: 134350848, 18: 32, 19: 2048, 20: 134219776, 21: 134217760, 22: 134348832, 23: 131072, 24: 0, 25: 131104, 26: 134348800, 27: 134219808, 28: 134350880, 29: 133120, 30: 2080, 31: 134217728, 2147483664: 131072, 2147483665: 2048, 2147483666: 134348832, 2147483667: 133152, 2147483668: 32, 2147483669: 134348800, 2147483670: 134217728, 2147483671: 134219808, 2147483672: 134350880, 2147483673: 134217760, 2147483674: 134219776, 2147483675: 0, 2147483676: 133120, 2147483677: 2080, 2147483678: 131104, 2147483679: 134350848 }], l3 = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679], f3 = n4.DES = i5.extend({ _doReset: function() {
          for (var t5 = this._key.words, e5 = [], r6 = 0; r6 < 56; r6++) {
            var i6 = o4[r6] - 1;
            e5[r6] = t5[i6 >>> 5] >>> 31 - i6 % 32 & 1;
          }
          for (var n5 = this._subKeys = [], a4 = 0; a4 < 16; a4++) {
            var h4 = n5[a4] = [], l4 = c3[a4];
            for (r6 = 0; r6 < 24; r6++)
              h4[r6 / 6 | 0] |= e5[(s5[r6] - 1 + l4) % 28] << 31 - r6 % 6, h4[4 + (r6 / 6 | 0)] |= e5[28 + (s5[r6 + 24] - 1 + l4) % 28] << 31 - r6 % 6;
            for (h4[0] = h4[0] << 1 | h4[0] >>> 31, r6 = 1; r6 < 7; r6++)
              h4[r6] = h4[r6] >>> 4 * (r6 - 1) + 3;
            h4[7] = h4[7] << 5 | h4[7] >>> 27;
          }
          var f4 = this._invSubKeys = [];
          for (r6 = 0; r6 < 16; r6++)
            f4[r6] = n5[15 - r6];
        }, encryptBlock: function(t5, e5) {
          this._doCryptBlock(t5, e5, this._subKeys);
        }, decryptBlock: function(t5, e5) {
          this._doCryptBlock(t5, e5, this._invSubKeys);
        }, _doCryptBlock: function(t5, e5, r6) {
          this._lBlock = t5[e5], this._rBlock = t5[e5 + 1], u3.call(this, 4, 252645135), u3.call(this, 16, 65535), d2.call(this, 2, 858993459), d2.call(this, 8, 16711935), u3.call(this, 1, 1431655765);
          for (var i6 = 0; i6 < 16; i6++) {
            for (var n5 = r6[i6], o5 = this._lBlock, s6 = this._rBlock, a4 = 0, c4 = 0; c4 < 8; c4++)
              a4 |= h3[c4][((s6 ^ n5[c4]) & l3[c4]) >>> 0];
            this._lBlock = s6, this._rBlock = o5 ^ a4;
          }
          var f4 = this._lBlock;
          this._lBlock = this._rBlock, this._rBlock = f4, u3.call(this, 1, 1431655765), d2.call(this, 8, 16711935), d2.call(this, 2, 858993459), u3.call(this, 16, 65535), u3.call(this, 4, 252645135), t5[e5] = this._lBlock, t5[e5 + 1] = this._rBlock;
        }, keySize: 2, ivSize: 2, blockSize: 2 });
        function u3(t5, e5) {
          var r6 = (this._lBlock >>> t5 ^ this._rBlock) & e5;
          this._rBlock ^= r6, this._lBlock ^= r6 << t5;
        }
        function d2(t5, e5) {
          var r6 = (this._rBlock >>> t5 ^ this._lBlock) & e5;
          this._lBlock ^= r6, this._rBlock ^= r6 << t5;
        }
        t4.DES = i5._createHelper(f3);
        var p3 = n4.TripleDES = i5.extend({ _doReset: function() {
          var t5 = this._key.words;
          if (2 !== t5.length && 4 !== t5.length && t5.length < 6)
            throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
          var e5 = t5.slice(0, 2), i6 = t5.length < 4 ? t5.slice(0, 2) : t5.slice(2, 4), n5 = t5.length < 6 ? t5.slice(0, 2) : t5.slice(4, 6);
          this._des1 = f3.createEncryptor(r5.create(e5)), this._des2 = f3.createEncryptor(r5.create(i6)), this._des3 = f3.createEncryptor(r5.create(n5));
        }, encryptBlock: function(t5, e5) {
          this._des1.encryptBlock(t5, e5), this._des2.decryptBlock(t5, e5), this._des3.encryptBlock(t5, e5);
        }, decryptBlock: function(t5, e5) {
          this._des3.decryptBlock(t5, e5), this._des2.encryptBlock(t5, e5), this._des1.decryptBlock(t5, e5);
        }, keySize: 6, ivSize: 2, blockSize: 2 });
        t4.TripleDES = i5._createHelper(p3);
      }(), function() {
        var t4 = a3, e4 = t4.lib.StreamCipher, r5 = t4.algo, i5 = r5.RC4 = e4.extend({ _doReset: function() {
          for (var t5 = this._key, e5 = t5.words, r6 = t5.sigBytes, i6 = this._S = [], n5 = 0; n5 < 256; n5++)
            i6[n5] = n5;
          n5 = 0;
          for (var o5 = 0; n5 < 256; n5++) {
            var s5 = n5 % r6, a4 = e5[s5 >>> 2] >>> 24 - s5 % 4 * 8 & 255;
            o5 = (o5 + i6[n5] + a4) % 256;
            var c3 = i6[n5];
            i6[n5] = i6[o5], i6[o5] = c3;
          }
          this._i = this._j = 0;
        }, _doProcessBlock: function(t5, e5) {
          t5[e5] ^= n4.call(this);
        }, keySize: 8, ivSize: 0 });
        function n4() {
          for (var t5 = this._S, e5 = this._i, r6 = this._j, i6 = 0, n5 = 0; n5 < 4; n5++) {
            r6 = (r6 + t5[e5 = (e5 + 1) % 256]) % 256;
            var o5 = t5[e5];
            t5[e5] = t5[r6], t5[r6] = o5, i6 |= t5[(t5[e5] + t5[r6]) % 256] << 24 - 8 * n5;
          }
          return this._i = e5, this._j = r6, i6;
        }
        t4.RC4 = e4._createHelper(i5);
        var o4 = r5.RC4Drop = i5.extend({ cfg: i5.cfg.extend({ drop: 192 }), _doReset: function() {
          i5._doReset.call(this);
          for (var t5 = this.cfg.drop; t5 > 0; t5--)
            n4.call(this);
        } });
        t4.RC4Drop = e4._createHelper(o4);
      }(), /** @preserve
             * Counter block mode compatible with  Dr Brian Gladman fileenc.c
             * derived from CryptoJS.mode.CTR
             * Jan Hruby jhruby.web@gmail.com
             */
      a3.mode.CTRGladman = function() {
        var t4 = a3.lib.BlockCipherMode.extend();
        function e4(t5) {
          if (255 == (t5 >> 24 & 255)) {
            var e5 = t5 >> 16 & 255, r6 = t5 >> 8 & 255, i5 = 255 & t5;
            255 === e5 ? (e5 = 0, 255 === r6 ? (r6 = 0, 255 === i5 ? i5 = 0 : ++i5) : ++r6) : ++e5, t5 = 0, t5 += e5 << 16, t5 += r6 << 8, t5 += i5;
          } else
            t5 += 1 << 24;
          return t5;
        }
        var r5 = t4.Encryptor = t4.extend({ processBlock: function(t5, r6) {
          var i5 = this._cipher, n4 = i5.blockSize, o4 = this._iv, s5 = this._counter;
          o4 && (s5 = this._counter = o4.slice(0), this._iv = void 0), function(t6) {
            0 === (t6[0] = e4(t6[0])) && (t6[1] = e4(t6[1]));
          }(s5);
          var a4 = s5.slice(0);
          i5.encryptBlock(a4, 0);
          for (var c3 = 0; c3 < n4; c3++)
            t5[r6 + c3] ^= a4[c3];
        } });
        return t4.Decryptor = r5, t4;
      }(), function() {
        var t4 = a3, e4 = t4.lib.StreamCipher, r5 = t4.algo, i5 = [], n4 = [], o4 = [], s5 = r5.Rabbit = e4.extend({ _doReset: function() {
          for (var t5 = this._key.words, e5 = this.cfg.iv, r6 = 0; r6 < 4; r6++)
            t5[r6] = 16711935 & (t5[r6] << 8 | t5[r6] >>> 24) | 4278255360 & (t5[r6] << 24 | t5[r6] >>> 8);
          var i6 = this._X = [t5[0], t5[3] << 16 | t5[2] >>> 16, t5[1], t5[0] << 16 | t5[3] >>> 16, t5[2], t5[1] << 16 | t5[0] >>> 16, t5[3], t5[2] << 16 | t5[1] >>> 16], n5 = this._C = [t5[2] << 16 | t5[2] >>> 16, 4294901760 & t5[0] | 65535 & t5[1], t5[3] << 16 | t5[3] >>> 16, 4294901760 & t5[1] | 65535 & t5[2], t5[0] << 16 | t5[0] >>> 16, 4294901760 & t5[2] | 65535 & t5[3], t5[1] << 16 | t5[1] >>> 16, 4294901760 & t5[3] | 65535 & t5[0]];
          for (this._b = 0, r6 = 0; r6 < 4; r6++)
            c3.call(this);
          for (r6 = 0; r6 < 8; r6++)
            n5[r6] ^= i6[r6 + 4 & 7];
          if (e5) {
            var o5 = e5.words, s6 = o5[0], a4 = o5[1], h3 = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), l3 = 16711935 & (a4 << 8 | a4 >>> 24) | 4278255360 & (a4 << 24 | a4 >>> 8), f3 = h3 >>> 16 | 4294901760 & l3, u3 = l3 << 16 | 65535 & h3;
            for (n5[0] ^= h3, n5[1] ^= f3, n5[2] ^= l3, n5[3] ^= u3, n5[4] ^= h3, n5[5] ^= f3, n5[6] ^= l3, n5[7] ^= u3, r6 = 0; r6 < 4; r6++)
              c3.call(this);
          }
        }, _doProcessBlock: function(t5, e5) {
          var r6 = this._X;
          c3.call(this), i5[0] = r6[0] ^ r6[5] >>> 16 ^ r6[3] << 16, i5[1] = r6[2] ^ r6[7] >>> 16 ^ r6[5] << 16, i5[2] = r6[4] ^ r6[1] >>> 16 ^ r6[7] << 16, i5[3] = r6[6] ^ r6[3] >>> 16 ^ r6[1] << 16;
          for (var n5 = 0; n5 < 4; n5++)
            i5[n5] = 16711935 & (i5[n5] << 8 | i5[n5] >>> 24) | 4278255360 & (i5[n5] << 24 | i5[n5] >>> 8), t5[e5 + n5] ^= i5[n5];
        }, blockSize: 4, ivSize: 2 });
        function c3() {
          for (var t5 = this._X, e5 = this._C, r6 = 0; r6 < 8; r6++)
            n4[r6] = e5[r6];
          for (e5[0] = e5[0] + 1295307597 + this._b | 0, e5[1] = e5[1] + 3545052371 + (e5[0] >>> 0 < n4[0] >>> 0 ? 1 : 0) | 0, e5[2] = e5[2] + 886263092 + (e5[1] >>> 0 < n4[1] >>> 0 ? 1 : 0) | 0, e5[3] = e5[3] + 1295307597 + (e5[2] >>> 0 < n4[2] >>> 0 ? 1 : 0) | 0, e5[4] = e5[4] + 3545052371 + (e5[3] >>> 0 < n4[3] >>> 0 ? 1 : 0) | 0, e5[5] = e5[5] + 886263092 + (e5[4] >>> 0 < n4[4] >>> 0 ? 1 : 0) | 0, e5[6] = e5[6] + 1295307597 + (e5[5] >>> 0 < n4[5] >>> 0 ? 1 : 0) | 0, e5[7] = e5[7] + 3545052371 + (e5[6] >>> 0 < n4[6] >>> 0 ? 1 : 0) | 0, this._b = e5[7] >>> 0 < n4[7] >>> 0 ? 1 : 0, r6 = 0; r6 < 8; r6++) {
            var i6 = t5[r6] + e5[r6], s6 = 65535 & i6, a4 = i6 >>> 16, c4 = ((s6 * s6 >>> 17) + s6 * a4 >>> 15) + a4 * a4, h3 = ((4294901760 & i6) * i6 | 0) + ((65535 & i6) * i6 | 0);
            o4[r6] = c4 ^ h3;
          }
          t5[0] = o4[0] + (o4[7] << 16 | o4[7] >>> 16) + (o4[6] << 16 | o4[6] >>> 16) | 0, t5[1] = o4[1] + (o4[0] << 8 | o4[0] >>> 24) + o4[7] | 0, t5[2] = o4[2] + (o4[1] << 16 | o4[1] >>> 16) + (o4[0] << 16 | o4[0] >>> 16) | 0, t5[3] = o4[3] + (o4[2] << 8 | o4[2] >>> 24) + o4[1] | 0, t5[4] = o4[4] + (o4[3] << 16 | o4[3] >>> 16) + (o4[2] << 16 | o4[2] >>> 16) | 0, t5[5] = o4[5] + (o4[4] << 8 | o4[4] >>> 24) + o4[3] | 0, t5[6] = o4[6] + (o4[5] << 16 | o4[5] >>> 16) + (o4[4] << 16 | o4[4] >>> 16) | 0, t5[7] = o4[7] + (o4[6] << 8 | o4[6] >>> 24) + o4[5] | 0;
        }
        t4.Rabbit = e4._createHelper(s5);
      }(), a3.mode.CTR = function() {
        var t4 = a3.lib.BlockCipherMode.extend(), e4 = t4.Encryptor = t4.extend({ processBlock: function(t5, e5) {
          var r5 = this._cipher, i5 = r5.blockSize, n4 = this._iv, o4 = this._counter;
          n4 && (o4 = this._counter = n4.slice(0), this._iv = void 0);
          var s5 = o4.slice(0);
          r5.encryptBlock(s5, 0), o4[i5 - 1] = o4[i5 - 1] + 1 | 0;
          for (var a4 = 0; a4 < i5; a4++)
            t5[e5 + a4] ^= s5[a4];
        } });
        return t4.Decryptor = e4, t4;
      }(), function() {
        var t4 = a3, e4 = t4.lib.StreamCipher, r5 = t4.algo, i5 = [], n4 = [], o4 = [], s5 = r5.RabbitLegacy = e4.extend({ _doReset: function() {
          var t5 = this._key.words, e5 = this.cfg.iv, r6 = this._X = [t5[0], t5[3] << 16 | t5[2] >>> 16, t5[1], t5[0] << 16 | t5[3] >>> 16, t5[2], t5[1] << 16 | t5[0] >>> 16, t5[3], t5[2] << 16 | t5[1] >>> 16], i6 = this._C = [t5[2] << 16 | t5[2] >>> 16, 4294901760 & t5[0] | 65535 & t5[1], t5[3] << 16 | t5[3] >>> 16, 4294901760 & t5[1] | 65535 & t5[2], t5[0] << 16 | t5[0] >>> 16, 4294901760 & t5[2] | 65535 & t5[3], t5[1] << 16 | t5[1] >>> 16, 4294901760 & t5[3] | 65535 & t5[0]];
          this._b = 0;
          for (var n5 = 0; n5 < 4; n5++)
            c3.call(this);
          for (n5 = 0; n5 < 8; n5++)
            i6[n5] ^= r6[n5 + 4 & 7];
          if (e5) {
            var o5 = e5.words, s6 = o5[0], a4 = o5[1], h3 = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), l3 = 16711935 & (a4 << 8 | a4 >>> 24) | 4278255360 & (a4 << 24 | a4 >>> 8), f3 = h3 >>> 16 | 4294901760 & l3, u3 = l3 << 16 | 65535 & h3;
            for (i6[0] ^= h3, i6[1] ^= f3, i6[2] ^= l3, i6[3] ^= u3, i6[4] ^= h3, i6[5] ^= f3, i6[6] ^= l3, i6[7] ^= u3, n5 = 0; n5 < 4; n5++)
              c3.call(this);
          }
        }, _doProcessBlock: function(t5, e5) {
          var r6 = this._X;
          c3.call(this), i5[0] = r6[0] ^ r6[5] >>> 16 ^ r6[3] << 16, i5[1] = r6[2] ^ r6[7] >>> 16 ^ r6[5] << 16, i5[2] = r6[4] ^ r6[1] >>> 16 ^ r6[7] << 16, i5[3] = r6[6] ^ r6[3] >>> 16 ^ r6[1] << 16;
          for (var n5 = 0; n5 < 4; n5++)
            i5[n5] = 16711935 & (i5[n5] << 8 | i5[n5] >>> 24) | 4278255360 & (i5[n5] << 24 | i5[n5] >>> 8), t5[e5 + n5] ^= i5[n5];
        }, blockSize: 4, ivSize: 2 });
        function c3() {
          for (var t5 = this._X, e5 = this._C, r6 = 0; r6 < 8; r6++)
            n4[r6] = e5[r6];
          for (e5[0] = e5[0] + 1295307597 + this._b | 0, e5[1] = e5[1] + 3545052371 + (e5[0] >>> 0 < n4[0] >>> 0 ? 1 : 0) | 0, e5[2] = e5[2] + 886263092 + (e5[1] >>> 0 < n4[1] >>> 0 ? 1 : 0) | 0, e5[3] = e5[3] + 1295307597 + (e5[2] >>> 0 < n4[2] >>> 0 ? 1 : 0) | 0, e5[4] = e5[4] + 3545052371 + (e5[3] >>> 0 < n4[3] >>> 0 ? 1 : 0) | 0, e5[5] = e5[5] + 886263092 + (e5[4] >>> 0 < n4[4] >>> 0 ? 1 : 0) | 0, e5[6] = e5[6] + 1295307597 + (e5[5] >>> 0 < n4[5] >>> 0 ? 1 : 0) | 0, e5[7] = e5[7] + 3545052371 + (e5[6] >>> 0 < n4[6] >>> 0 ? 1 : 0) | 0, this._b = e5[7] >>> 0 < n4[7] >>> 0 ? 1 : 0, r6 = 0; r6 < 8; r6++) {
            var i6 = t5[r6] + e5[r6], s6 = 65535 & i6, a4 = i6 >>> 16, c4 = ((s6 * s6 >>> 17) + s6 * a4 >>> 15) + a4 * a4, h3 = ((4294901760 & i6) * i6 | 0) + ((65535 & i6) * i6 | 0);
            o4[r6] = c4 ^ h3;
          }
          t5[0] = o4[0] + (o4[7] << 16 | o4[7] >>> 16) + (o4[6] << 16 | o4[6] >>> 16) | 0, t5[1] = o4[1] + (o4[0] << 8 | o4[0] >>> 24) + o4[7] | 0, t5[2] = o4[2] + (o4[1] << 16 | o4[1] >>> 16) + (o4[0] << 16 | o4[0] >>> 16) | 0, t5[3] = o4[3] + (o4[2] << 8 | o4[2] >>> 24) + o4[1] | 0, t5[4] = o4[4] + (o4[3] << 16 | o4[3] >>> 16) + (o4[2] << 16 | o4[2] >>> 16) | 0, t5[5] = o4[5] + (o4[4] << 8 | o4[4] >>> 24) + o4[3] | 0, t5[6] = o4[6] + (o4[5] << 16 | o4[5] >>> 16) + (o4[4] << 16 | o4[4] >>> 16) | 0, t5[7] = o4[7] + (o4[6] << 8 | o4[6] >>> 24) + o4[5] | 0;
        }
        t4.RabbitLegacy = e4._createHelper(s5);
      }(), a3.pad.ZeroPadding = { pad: function(t4, e4) {
        var r5 = 4 * e4;
        t4.clamp(), t4.sigBytes += r5 - (t4.sigBytes % r5 || r5);
      }, unpad: function(t4) {
        var e4 = t4.words, r5 = t4.sigBytes - 1;
        for (r5 = t4.sigBytes - 1; r5 >= 0; r5--)
          if (e4[r5 >>> 2] >>> 24 - r5 % 4 * 8 & 255) {
            t4.sigBytes = r5 + 1;
            break;
          }
      } }, a3);
    });
    return function() {
      function e3(r4) {
        t2(this, e3);
        var i4 = r4.isArray, n3 = r4.isMap, o3 = r4.isDevMode;
        this._isArray = i4, this._isMap = n3, this._isDevMode = o3, this._interceptProfanityList = [], this._interceptFilter = null, this._interceptRegExpList = [], this._replacingProfanityMap = /* @__PURE__ */ new Map(), this._replacingFilter = null, this._replacingRegExpMap = /* @__PURE__ */ new Map(), this._key = "", this._iv = "", this._decryptOptions = void 0, this._n = "TIMProfanityFilterPlugin", true === o3 && index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, ".VERSION:").concat("1.1.0"));
      }
      return r3(e3, [{ key: "onToken", value: function(t3) {
        this._key = u2.enc.Utf8.parse(t3.slice(0, 32)), this._iv = this._key, this._decryptOptions = { iv: this._iv, mode: u2.mode.CBC, padding: u2.pad.Pkcs7 };
      } }, { key: "onLexiconSliced", value: function(t3) {
        if (this._isArray(t3) && 0 !== t3.length) {
          var e4, r4, i4, n3 = a2(t3);
          try {
            for (n3.s(); !(i4 = n3.n()).done; ) {
              var o3 = i4.value, s4 = o3.filterType, c3 = o3.profanityType, h3 = o3.profanity, l3 = o3.replacement;
              e4 = this._getDecryptedString(h3), r4 = this._getDecryptedString(l3), 1 === s4 ? 1 === c3 ? this._interceptProfanityList.push(e4) : 2 === c3 && this._interceptRegExpList.push(e4) : 2 === s4 && (1 === c3 ? this._replacingProfanityMap.set(e4, r4) : 2 === c3 && this._replacingRegExpMap.set(e4, r4));
            }
          } catch (f3) {
            n3.e(f3);
          } finally {
            n3.f();
          }
        }
      } }, { key: "_getDecryptedString", value: function(t3) {
        var e4 = u2.AES.decrypt(t3, this._key, this._decryptOptions);
        return u2.enc.Utf8.stringify(e4).toLowerCase();
      } }, { key: "onLexiconCompleted", value: function(t3) {
        this.onLexiconSliced(t3), this._interceptFilter = new h2({ input: this._interceptProfanityList, isArray: this._isArray, isMap: this._isMap }), this._replacingFilter = new h2({ input: this._replacingProfanityMap, isArray: this._isArray, isMap: this._isMap }), true === this._isDevMode && (index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _interceptProfanityList ->"), this._interceptProfanityList), index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _interceptRegExpList ->"), this._interceptRegExpList), index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _replacingProfanityMap ->"), this._replacingProfanityMap), index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _replacingRegExpMap ->"), this._replacingRegExpMap));
      } }, { key: "filter", value: function(t3) {
        var e4 = { type: 0, modifiedText: t3 };
        if ("string" != typeof t3)
          return true === this._isDevMode && index.__f__("warn", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, ".filter invalid params, string required!")), e4;
        if (true === this._interceptFilter.filter({ text: t3, replacingEnabled: false }).isMatched)
          return e4.type = 1, e4;
        for (var r4 = false, n3 = 0, o3 = this._interceptRegExpList.length; n3 < o3; n3++)
          if (new RegExp(this._interceptRegExpList[n3], "gi").test(t3.toLowerCase())) {
            r4 = true;
            break;
          }
        if (r4)
          return e4.type = 1, e4;
        var s4 = this._replacingFilter.filter({ text: t3, replacingEnabled: true });
        true === s4.isMatched && (e4.type = 2, e4.modifiedText = s4.modifiedText);
        var c3, h3 = e4.modifiedText, l3 = null, f3 = a2(this._replacingRegExpMap);
        try {
          for (f3.s(); !(c3 = f3.n()).done; ) {
            var u3 = i3(c3.value, 2), d2 = u3[0], p3 = u3[1];
            l3 = new RegExp(d2, "gi"), h3 = h3.replace(l3, p3);
          }
        } catch (_2) {
          f3.e(_2);
        } finally {
          f3.f();
        }
        return h3 !== t3 && (e4.type = 2, e4.modifiedText = h3), e4;
      } }, { key: "reset", value: function() {
        this._isArray = null, this._isMap = null, this._interceptProfanityList.length = 0, this._interceptRegExpList.length = 0, this._replacingProfanityMap.clear(), this._replacingRegExpMap.clear(), this._key = "", this._iv = "", this._decryptOptions = {}, this._interceptFilter && this._interceptFilter.reset(), this._replacingFilter && this._replacingFilter.reset();
      } }]), e3;
    }();
  });
})(timProfanityFilterPlugin);
var timProfanityFilterPluginExports = timProfanityFilterPlugin.exports;
const s$2 = /* @__PURE__ */ getDefaultExportFromCjs(timProfanityFilterPluginExports);
let i$2 = class i {
  constructor() {
    this.serviceMap = /* @__PURE__ */ new Map();
  }
  registerService(e2, t2) {
    this.serviceMap.has(e2) || (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIServiceManager.registerService serviceName:${e2}`), this.serviceMap.set(e2, t2));
  }
  unregisterService(e2) {
    this.serviceMap.has(e2) && (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIServiceManager.unregisterService serviceName:${e2}`), this.serviceMap.delete(e2));
  }
  getService(e2) {
    return this.serviceMap.get(e2);
  }
  callService(e2) {
    const { serviceName: t2, method: n2, params: i3, callback: s3 } = e2, o2 = this.getService(t2);
    if (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIServiceManager.callService serviceName:${t2}, service:`, o2), o2)
      return o2.onCall(n2, i3, s3);
  }
};
let s$1 = class s {
  constructor() {
    this.extensionMap = /* @__PURE__ */ new Map();
  }
  registerExtension(e2, t2) {
    if (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIExtensionManager.registerExtension extensionID:${e2}`), !this.extensionMap.has(e2)) {
      const t3 = [];
      this.extensionMap.set(e2, t3);
    }
    const n2 = this.extensionMap.get(e2);
    -1 === n2.indexOf(t2) && n2.push(t2);
  }
  unregisterExtension(e2, t2) {
    if (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIExtensionManager.unregisterExtension extensionID:${e2}`), this.extensionMap.has(e2)) {
      const n2 = this.extensionMap.get(e2), i3 = n2.indexOf(t2);
      i3 > -1 && n2.splice(i3, 1);
    }
  }
  getExtensionList(e2, t2) {
    const n2 = t2 ? `params:${JSON.stringify(t2)}` : "";
    index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIExtensionManager.getExtensionList extensionID:${e2} ${n2}`);
    let i3 = [], s3 = [];
    if (this.extensionMap.has(e2)) {
      i3 = this.extensionMap.get(e2);
      for (let n3 = 0; n3 < i3.length; n3++) {
        const o2 = i3[n3].onGetExtension(e2, t2);
        s3 = s3.concat(o2);
      }
    }
    return s3;
  }
};
const o$1 = ["vue2", "vue3", "rn"], E$2 = { TUILogin: { EVENT: { LOGIN_STATE_CHANGED: "loginStateChanged" }, EVENT_SUB_KEY: { USER_LOGIN_SUCCESS: "userLoginSuccess", USER_LOGOUT_SUCCESS: "userLogoutSuccess", USER_KICKED_OFFLINE: "userKickedOffline", USER_SIG_EXPIRED: "userSigExpired" } }, TUIConversation: { SERVICE: { NAME: "TUIConversationService", METHOD: { CREATE_CONVERSATION: "createConversation", HIDE_CONVERSATION_HEADER: "hideConversationHeader" } }, EXTENSION: { CONV_POP_MENU: { EXT_ID: "conversationPopMenu" }, CONV_GROUP: { EXT_ID: "conversationGroup" } } }, TUIChat: { SERVICE: { NAME: "TUIChatService", METHOD: { UPDATE_MESSAGE_LIST: "updateMessageList", CLOSE_MESSAGE_POP_MENU: "closeMessagePopMenu", SEND_CUSTOM_MESSAGE: "sendCustomMessage", SEND_TEXT_MESSAGE: "sendTextMessage", SET_CHAT_TYPE: "setChatType", UPDATE_MESSAGE_INFO: "updateMessageInfo" } }, EXTENSION: { INPUT_MORE: { EXT_ID: "inputToolBarMore" }, MSG_POP_MENU: { EXT_ID: "messagePopMenu" }, CHAT_HEADER: { EXT_ID: "chatHeader" } }, TYPE: { C2C: "C2C", GROUP: "GROUP", CUSTOMER_SERVICE: "customerService", ROOM: "room" }, EVENT: { CHAT_STATE_CHANGED: "chatStateChanged", CHAT_TYPE_CHANGED: "chatTypeChanged" }, EVENT_SUB_KEY: { CHAT_OPENED: "chatOpened", CHANGE_SUCCESS: "changeSuccess" }, FEATURE: { DownloadFile: "DownloadFile", CopyMessage: "CopyMessage", DeleteMessage: "DeleteMessage", RevokeMessage: "RevokeMessage", QuoteMessage: "QuoteMessage", ForwardMessage: "ForwardMessage", TranslateMessage: "TranslateMessage", VoiceToText: "VoiceToText", MultiSelection: "MultiSelection", EmojiReaction: "EmojiReaction", InputEmoji: "InputEmoji", InputStickers: "InputStickers", InputImage: "InputImage", InputVoice: "InputVoice", InputVideo: "InputVideo", InputFile: "InputFile", InputEvaluation: "InputEvaluation", InputQuickReplies: "InputQuickReplies", InputMention: "InputMention", MessageSearch: "MessageSearch", ReadStatus: "ReadStatus" } }, TUIGroup: { SERVICE: { NAME: "TUIGroupService", METHOD: { CREATE_GROUP: "createGroup", OPEN_GROUP_MANAGEMENT: "openGroupManagement", SELECT_GROUP_MEMBER: "selectGroupMember" } } }, TUIContact: { SERVICE: { NAME: "TUIContactService", METHOD: { SELECT_FRIEND: "selectFriend" } }, EXTENSION: { CONTACT_LIST: { EXT_ID: "contactList" } } }, TUISearch: { SERVICE: { NAME: "TUISearchService", METHOD: { SEARCH_GROUP: "searchGroup", SEARCH_USER: "searchUser", SEARCH_FRIEND: "searchFriend", SEARCH_GROUP_MEMBER: "searchGroupMember" } }, EXTENSION: { SEARCH_MORE: { EXT_ID: "searchMore" } } }, TUICalling: { SERVICE: { NAME: "TUICallingService", METHOD: { START_CALL: "startCall" } } }, TUIRoom: { SERVICE: { NAME: "TUIRoomService" } }, TUIEmojiPlugin: { SERVICE: { NAME: "TUIEmojiPluginService", METHOD: { CLOSE_EMOJI_DETAIL: "closeEmojiDetail" } } }, TUITranslate: { EVENT: { LANGUAGE_CHANGED: "languageChanged" }, EVENT_SUB_KEY: { CHANGE_SUCCESS: "changeSuccess" } }, TUITranslatePlugin: { SERVICE: { NAME: "TUITranslatePluginService" } }, TUIVoiceToTextPlugin: { SERVICE: { NAME: "TUIVoiceToTextPluginService" } }, TUICustomerServicePlugin: { SERVICE: { NAME: "TUICustomerServicePlugin", METHOD: { ACTIVE_CONVERSATION: "activeConversation", FILTER_MESSAGE: "filterMessage" } }, EXTENSION: {} }, TUIPushPlugin: { SERVICE: { NAME: "TUIPushPluginService" } }, TUIChatbotPlugin: { SERVICE: { NAME: "TUIChatbotPluginService" } }, TUITheme: { EVENT: { THEME_CHANGED: "themeChanged" }, EVENT_SUB_KEY: { CHANGE_SUCCESS: "changeSuccess" } } }, r$2 = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), a$2 = "undefined" != typeof index && "undefined" == typeof window, g$2 = r$2 || a$2, S$1 = "undefined" != typeof index, c$2 = ("undefined" != typeof index || "undefined" != typeof window) && !g$2;
const h$2 = c$2 && window && window.navigator && window.navigator.userAgent || "", T$2 = /Android/i.test(h$2), u$2 = /(?:Windows Phone)/.test(h$2), I$2 = /(?:SymbianOS)/.test(h$2), l$2 = /iPad/i.test(h$2) || /iPhone/i.test(h$2) || /iPod/i.test(h$2), C$1 = T$2 || u$2 || I$2 || l$2, M$1 = c$2 && !C$1, U$1 = a$2 && !r$2, _$1 = { [E$2.TUITranslatePlugin.SERVICE.NAME]: Math.pow(2, 38), [E$2.TUIVoiceToTextPlugin.SERVICE.NAME]: Math.pow(2, 39), [E$2.TUICustomerServicePlugin.SERVICE.NAME]: Math.pow(2, 40), [E$2.TUIPushPlugin.SERVICE.NAME]: Math.pow(2, 41), [E$2.TUIChatbotPlugin.SERVICE.NAME]: Math.pow(2, 42), [E$2.TUIEmojiPlugin.SERVICE.NAME]: Math.pow(2, 48) };
let N$1 = class N {
  constructor(e2) {
    this.loginStatusPromise = /* @__PURE__ */ new Map(), this.SDKAppID = 0, this.userID = "", this.userSig = "", this.TUICore = e2, this.isOnChatEvent = false;
  }
  static getInstance(e2) {
    return !N.instance && e2 && (N.instance = new N(e2)), N.instance;
  }
  login(t2) {
    const { SDKAppID: n2, userID: i3, userSig: s3, framework: o2 } = t2;
    return this.chat = e$1.create(Object.assign(Object.assign({}, t2), { scene: this.getStatScene(o2) })), this.EVENT = e$1.EVENT, this.TYPES = e$1.TYPES, this.SDKAppID = n2, this.userID = i3, this.userSig = s3, this.offChatEvent(), this.onChatEvent(), this.registerPlugin(t2), this.loginChat(t2);
  }
  logout() {
    return this.chat.logout().then((e2) => (this.userID = "", this.userSig = "", this.TUICore.notifyEvent(E$2.TUILogin.EVENT.LOGIN_STATE_CHANGED, E$2.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS), Promise.resolve(e2)));
  }
  destroy() {
    return this.chat.destroy().then((e2) => (this.userID = "", this.userSig = "", this.TUICore.notifyEvent(E$2.TUILogin.EVENT.LOGIN_STATE_CHANGED, E$2.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS), Promise.resolve(e2)));
  }
  setLogLevel(e2) {
    return this.chat.setLogLevel(e2);
  }
  getContext() {
    return { chat: this.chat, SDKAppID: this.SDKAppID, userID: this.userID, userSig: this.userSig };
  }
  reportPlugin() {
    var e2;
    for (const t2 in _$1)
      this.TUICore.getService(t2) && (null === (e2 = this.chat.callExperimentalAPI("isFeatureEnabledForStat", _$1[t2])) || void 0 === e2 || e2.catch((e3) => {
      }));
  }
  loginChat(e2) {
    const { userID: t2, userSig: n2 } = e2;
    return new Promise((e3, i3) => {
      this.chat.login({ userID: t2, userSig: n2 }).then((t3) => {
        t3.data.repeatLogin && this.chat.isReady() && e3(t3), this.reportPlugin(), this.loginStatusPromise.set("login", { resolve: e3, reject: i3, imResponse: t3 });
      }).catch((e4) => {
        i3(e4);
      });
    });
  }
  onChatEvent() {
    this.chat.on(this.EVENT.SDK_READY, this.onSDKReady, this), this.chat.on(this.EVENT.SDK_NOT_READY, this.onSDKNotReady, this), this.chat.on(this.EVENT.KICKED_OUT, this.onUserKicked, this), this.isOnChatEvent = true;
  }
  offChatEvent() {
    this.isOnChatEvent && (this.chat.off(this.EVENT.SDK_READY, this.onSDKReady, this), this.chat.off(this.EVENT.SDK_NOT_READY, this.onSDKNotReady, this), this.chat.off(this.EVENT.KICKED_OUT, this.onUserKicked, this), this.isOnChatEvent = false);
  }
  onSDKReady() {
    if (this.loginStatusPromise.has("login")) {
      this.TUICore.notifyEvent(E$2.TUILogin.EVENT.LOGIN_STATE_CHANGED, E$2.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS);
      const e2 = setTimeout(() => {
        const t2 = this.loginStatusPromise.get("login");
        t2.resolve(t2.imResponse), clearTimeout(e2), this.loginStatusPromise.delete("login");
      }, 500);
    }
  }
  onSDKNotReady() {
    if (this.loginStatusPromise.has("login")) {
      this.loginStatusPromise.get("login").reject(new Error("sdk not ready"));
    }
    this.loginStatusPromise.delete("login");
  }
  onUserKicked(e2) {
    e2.data.type !== this.TYPES.KICKED_OUT_USERSIG_EXPIRED ? this.TUICore.notifyEvent(E$2.TUILogin.EVENT.LOGIN_STATE_CHANGED, E$2.TUILogin.EVENT_SUB_KEY.USER_KICKED_OFFLINE) : this.TUICore.notifyEvent(E$2.TUILogin.EVENT.LOGIN_STATE_CHANGED, E$2.TUILogin.EVENT_SUB_KEY.USER_SIG_EXPIRED);
  }
  registerPlugin(e2) {
    const { useUploadPlugin: i3 = false, useProfanityFilterPlugin: s3 = false, TUIOfflinePush: o2, offlinePushConfig: E2, TIMPush: r3, pushConfig: a2 } = e2;
    true === i3 && this.chat.registerPlugin({ "tim-upload-plugin": t$1 }), true === s3 && this.chat.registerPlugin({ "tim-profanity-filter-plugin": s$2 }), U$1 && r3 && a2 && this.chat.registerPlugin({ "tim-push": r3, pushConfig: a2 }), U$1 && o2 && E2 && this.chat.registerPlugin({ "tim-offline-push-plugin": o2, offlinePushConfig: E2 });
  }
  getStatScene(e2) {
    let t2;
    return e2 && o$1.indexOf(e2) > -1 && (t2 = this.genStatScene(e2)), t2;
  }
  genStatScene(e2) {
    if ("rn" === e2)
      return "k-rn";
    let t2 = "";
    return S$1 ? (M$1 && (t2 = `k-${e2}-pc-uni`), C$1 && (t2 = `k-${e2}-h5-uni`), U$1 && (t2 = `k-${e2}-app-uni`), r$2 && (t2 = `k-${e2}-mp-uni`), t2) : (M$1 && (t2 = `k-${e2}-pc`), C$1 && (t2 = `k-${e2}-h5`), t2);
  }
};
let p$2 = class p {
  constructor() {
    this.eventMap = /* @__PURE__ */ new Map();
  }
  registerEvent(e2, t2, n2) {
    const i3 = this.getKey(e2, t2);
    if (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIEventManager.registerEvent eventName:${e2} subKey:${t2}`), !this.eventMap.has(i3)) {
      const e3 = [];
      this.eventMap.set(i3, e3);
    }
    const s3 = this.eventMap.get(i3);
    -1 === s3.indexOf(n2) && (s3.push(n2), this.renotify(e2, t2, n2));
  }
  unregisterEvent(e2, t2, n2) {
    index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIEventManager.unregisterEvent eventName:${e2} subKey:${t2}`);
    const i3 = this.getKey(e2, t2);
    if (this.eventMap.has(i3)) {
      const e3 = this.eventMap.get(i3), t3 = e3.indexOf(n2);
      t3 > -1 && e3.splice(t3, 1);
    }
  }
  notifyEvent(e2, t2, n2) {
    const i3 = this.getKey(e2, t2), s3 = n2 ? `params:${JSON.stringify(n2)}` : "";
    if (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", `TUIEventManager.notifyEvent eventName:${e2} subKey:${t2} ${s3}`), this.eventMap.has(i3)) {
      this.eventMap.get(i3).forEach((i4) => {
        i4.onNotifyEvent(e2, t2, n2);
      });
    }
  }
  getKey(e2, t2) {
    let n2 = e2;
    return t2 && (n2 = `${e2}-${n2}`), n2;
  }
  renotify(e2, t2, n2) {
    if (e2 === E$2.TUILogin.EVENT.LOGIN_STATE_CHANGED && t2 === E$2.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS) {
      const { chat: e3 } = N$1.getInstance().getContext();
      e3 && e3.isReady() && (n2.onNotifyEvent(E$2.TUILogin.EVENT.LOGIN_STATE_CHANGED, E$2.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS), index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", "TUIEventManager.renotify success."));
    }
  }
};
let v$2 = class v {
  constructor() {
    this.serviceManager = new i$2(), this.extensionManager = new s$1(), this.eventManager = new p$2();
  }
  static getInstance() {
    return v.instance || (index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", "TUICore.getInstance ok."), v.instance = new v()), v.instance;
  }
  registerService(e2, t2) {
    return this.serviceManager.registerService(e2, t2);
  }
  unregisterService(e2) {
    return this.serviceManager.unregisterService(e2);
  }
  getService(e2) {
    return this.serviceManager.getService(e2);
  }
  callService(e2) {
    return this.serviceManager.callService(e2);
  }
  registerExtension(e2, t2) {
    return this.extensionManager.registerExtension(e2, t2);
  }
  unregisterExtension(e2, t2) {
    return this.extensionManager.unregisterExtension(e2, t2);
  }
  getExtensionList(e2, t2) {
    return this.extensionManager.getExtensionList(e2, t2);
  }
  registerEvent(e2, t2, n2) {
    return this.eventManager.registerEvent(e2, t2, n2);
  }
  unregisterEvent(e2, t2, n2) {
    return this.eventManager.unregisterEvent(e2, t2, n2);
  }
  notifyEvent(e2, t2, n2) {
    return this.eventManager.notifyEvent(e2, t2, n2);
  }
};
index.__f__("log", "at node_modules/@tencentcloud/tui-core/index.js:1", "TUICore.VERSION:2.4.0");
const R$1 = v$2.getInstance(), A$2 = N$1.getInstance(R$1);
var cosWxSdkV5_min = { exports: {} };
(function(module2, exports2) {
  !function(e2, t2) {
    module2.exports = t2();
  }(window, function() {
    return function(e2) {
      var t2 = {};
      function n2(i3) {
        if (t2[i3])
          return t2[i3].exports;
        var o2 = t2[i3] = { i: i3, l: false, exports: {} };
        return e2[i3].call(o2.exports, o2, o2.exports, n2), o2.l = true, o2.exports;
      }
      return n2.m = e2, n2.c = t2, n2.d = function(e3, t3, i3) {
        n2.o(e3, t3) || Object.defineProperty(e3, t3, { enumerable: true, get: i3 });
      }, n2.r = function(e3) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e3, "__esModule", { value: true });
      }, n2.t = function(e3, t3) {
        if (1 & t3 && (e3 = n2(e3)), 8 & t3)
          return e3;
        if (4 & t3 && "object" == typeof e3 && e3 && e3.__esModule)
          return e3;
        var i3 = /* @__PURE__ */ Object.create(null);
        if (n2.r(i3), Object.defineProperty(i3, "default", { enumerable: true, value: e3 }), 2 & t3 && "string" != typeof e3)
          for (var o2 in e3)
            n2.d(i3, o2, (function(t4) {
              return e3[t4];
            }).bind(null, o2));
        return i3;
      }, n2.n = function(e3) {
        var t3 = e3 && e3.__esModule ? function() {
          return e3.default;
        } : function() {
          return e3;
        };
        return n2.d(t3, "a", t3), t3;
      }, n2.o = function(e3, t3) {
        return Object.prototype.hasOwnProperty.call(e3, t3);
      }, n2.p = "/Users/chrisftian/Documents/projects/cos-sdk/cos-wx-sdk-v5/dist", n2(n2.s = 8);
    }([function(e2, t2, n2) {
      function i3(e3, t3) {
        var n3 = "undefined" != typeof Symbol && e3[Symbol.iterator] || e3["@@iterator"];
        if (!n3) {
          if (Array.isArray(e3) || (n3 = function(e4, t4) {
            if (!e4)
              return;
            if ("string" == typeof e4)
              return o2(e4, t4);
            var n4 = Object.prototype.toString.call(e4).slice(8, -1);
            "Object" === n4 && e4.constructor && (n4 = e4.constructor.name);
            if ("Map" === n4 || "Set" === n4)
              return Array.from(e4);
            if ("Arguments" === n4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
              return o2(e4, t4);
          }(e3)) || t3 && e3 && "number" == typeof e3.length) {
            n3 && (e3 = n3);
            var i4 = 0, a3 = function() {
            };
            return { s: a3, n: function() {
              return i4 >= e3.length ? { done: true } : { done: false, value: e3[i4++] };
            }, e: function(e4) {
              throw e4;
            }, f: a3 };
          }
          throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }
        var r4, s4 = true, c3 = false;
        return { s: function() {
          n3 = n3.call(e3);
        }, n: function() {
          var e4 = n3.next();
          return s4 = e4.done, e4;
        }, e: function(e4) {
          c3 = true, r4 = e4;
        }, f: function() {
          try {
            s4 || null == n3.return || n3.return();
          } finally {
            if (c3)
              throw r4;
          }
        } };
      }
      function o2(e3, t3) {
        (null == t3 || t3 > e3.length) && (t3 = e3.length);
        for (var n3 = 0, i4 = new Array(t3); n3 < t3; n3++)
          i4[n3] = e3[n3];
        return i4;
      }
      function a2() {
        /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
        a2 = function() {
          return t3;
        };
        var e3, t3 = {}, n3 = Object.prototype, i4 = n3.hasOwnProperty, o3 = Object.defineProperty || function(e4, t4, n4) {
          e4[t4] = n4.value;
        }, r4 = "function" == typeof Symbol ? Symbol : {}, c3 = r4.iterator || "@@iterator", l3 = r4.asyncIterator || "@@asyncIterator", p4 = r4.toStringTag || "@@toStringTag";
        function u3(e4, t4, n4) {
          return Object.defineProperty(e4, t4, { value: n4, enumerable: true, configurable: true, writable: true }), e4[t4];
        }
        try {
          u3({}, "");
        } catch (e4) {
          u3 = function(e5, t4, n4) {
            return e5[t4] = n4;
          };
        }
        function d3(e4, t4, n4, i5) {
          var a3 = t4 && t4.prototype instanceof x3 ? t4 : x3, r5 = Object.create(a3.prototype), s4 = new j3(i5 || []);
          return o3(r5, "_invoke", { value: A3(e4, n4, s4) }), r5;
        }
        function f3(e4, t4, n4) {
          try {
            return { type: "normal", arg: e4.call(t4, n4) };
          } catch (e5) {
            return { type: "throw", arg: e5 };
          }
        }
        t3.wrap = d3;
        var m3 = "suspendedStart", h3 = "suspendedYield", g3 = "executing", v4 = "completed", y3 = {};
        function x3() {
        }
        function k3() {
        }
        function b3() {
        }
        var C3 = {};
        u3(C3, c3, function() {
          return this;
        });
        var S3 = Object.getPrototypeOf, w3 = S3 && S3(S3(I3([])));
        w3 && w3 !== n3 && i4.call(w3, c3) && (C3 = w3);
        var T3 = b3.prototype = x3.prototype = Object.create(C3);
        function R3(e4) {
          ["next", "throw", "return"].forEach(function(t4) {
            u3(e4, t4, function(e5) {
              return this._invoke(t4, e5);
            });
          });
        }
        function B3(e4, t4) {
          function n4(o4, a4, r5, c4) {
            var l4 = f3(e4[o4], e4, a4);
            if ("throw" !== l4.type) {
              var p5 = l4.arg, u4 = p5.value;
              return u4 && "object" == s3(u4) && i4.call(u4, "__await") ? t4.resolve(u4.__await).then(function(e5) {
                n4("next", e5, r5, c4);
              }, function(e5) {
                n4("throw", e5, r5, c4);
              }) : t4.resolve(u4).then(function(e5) {
                p5.value = e5, r5(p5);
              }, function(e5) {
                return n4("throw", e5, r5, c4);
              });
            }
            c4(l4.arg);
          }
          var a3;
          o3(this, "_invoke", { value: function(e5, i5) {
            function o4() {
              return new t4(function(t5, o5) {
                n4(e5, i5, t5, o5);
              });
            }
            return a3 = a3 ? a3.then(o4, o4) : o4();
          } });
        }
        function A3(t4, n4, i5) {
          var o4 = m3;
          return function(a3, r5) {
            if (o4 === g3)
              throw Error("Generator is already running");
            if (o4 === v4) {
              if ("throw" === a3)
                throw r5;
              return { value: e3, done: true };
            }
            for (i5.method = a3, i5.arg = r5; ; ) {
              var s4 = i5.delegate;
              if (s4) {
                var c4 = P3(s4, i5);
                if (c4) {
                  if (c4 === y3)
                    continue;
                  return c4;
                }
              }
              if ("next" === i5.method)
                i5.sent = i5._sent = i5.arg;
              else if ("throw" === i5.method) {
                if (o4 === m3)
                  throw o4 = v4, i5.arg;
                i5.dispatchException(i5.arg);
              } else
                "return" === i5.method && i5.abrupt("return", i5.arg);
              o4 = g3;
              var l4 = f3(t4, n4, i5);
              if ("normal" === l4.type) {
                if (o4 = i5.done ? v4 : h3, l4.arg === y3)
                  continue;
                return { value: l4.arg, done: i5.done };
              }
              "throw" === l4.type && (o4 = v4, i5.method = "throw", i5.arg = l4.arg);
            }
          };
        }
        function P3(t4, n4) {
          var i5 = n4.method, o4 = t4.iterator[i5];
          if (o4 === e3)
            return n4.delegate = null, "throw" === i5 && t4.iterator.return && (n4.method = "return", n4.arg = e3, P3(t4, n4), "throw" === n4.method) || "return" !== i5 && (n4.method = "throw", n4.arg = new TypeError("The iterator does not provide a '" + i5 + "' method")), y3;
          var a3 = f3(o4, t4.iterator, n4.arg);
          if ("throw" === a3.type)
            return n4.method = "throw", n4.arg = a3.arg, n4.delegate = null, y3;
          var r5 = a3.arg;
          return r5 ? r5.done ? (n4[t4.resultName] = r5.value, n4.next = t4.nextLoc, "return" !== n4.method && (n4.method = "next", n4.arg = e3), n4.delegate = null, y3) : r5 : (n4.method = "throw", n4.arg = new TypeError("iterator result is not an object"), n4.delegate = null, y3);
        }
        function E3(e4) {
          var t4 = { tryLoc: e4[0] };
          1 in e4 && (t4.catchLoc = e4[1]), 2 in e4 && (t4.finallyLoc = e4[2], t4.afterLoc = e4[3]), this.tryEntries.push(t4);
        }
        function O3(e4) {
          var t4 = e4.completion || {};
          t4.type = "normal", delete t4.arg, e4.completion = t4;
        }
        function j3(e4) {
          this.tryEntries = [{ tryLoc: "root" }], e4.forEach(E3, this), this.reset(true);
        }
        function I3(t4) {
          if (t4 || "" === t4) {
            var n4 = t4[c3];
            if (n4)
              return n4.call(t4);
            if ("function" == typeof t4.next)
              return t4;
            if (!isNaN(t4.length)) {
              var o4 = -1, a3 = function n5() {
                for (; ++o4 < t4.length; )
                  if (i4.call(t4, o4))
                    return n5.value = t4[o4], n5.done = false, n5;
                return n5.value = e3, n5.done = true, n5;
              };
              return a3.next = a3;
            }
          }
          throw new TypeError(s3(t4) + " is not iterable");
        }
        return k3.prototype = b3, o3(T3, "constructor", { value: b3, configurable: true }), o3(b3, "constructor", { value: k3, configurable: true }), k3.displayName = u3(b3, p4, "GeneratorFunction"), t3.isGeneratorFunction = function(e4) {
          var t4 = "function" == typeof e4 && e4.constructor;
          return !!t4 && (t4 === k3 || "GeneratorFunction" === (t4.displayName || t4.name));
        }, t3.mark = function(e4) {
          return Object.setPrototypeOf ? Object.setPrototypeOf(e4, b3) : (e4.__proto__ = b3, u3(e4, p4, "GeneratorFunction")), e4.prototype = Object.create(T3), e4;
        }, t3.awrap = function(e4) {
          return { __await: e4 };
        }, R3(B3.prototype), u3(B3.prototype, l3, function() {
          return this;
        }), t3.AsyncIterator = B3, t3.async = function(e4, n4, i5, o4, a3) {
          void 0 === a3 && (a3 = Promise);
          var r5 = new B3(d3(e4, n4, i5, o4), a3);
          return t3.isGeneratorFunction(n4) ? r5 : r5.next().then(function(e5) {
            return e5.done ? e5.value : r5.next();
          });
        }, R3(T3), u3(T3, p4, "Generator"), u3(T3, c3, function() {
          return this;
        }), u3(T3, "toString", function() {
          return "[object Generator]";
        }), t3.keys = function(e4) {
          var t4 = Object(e4), n4 = [];
          for (var i5 in t4)
            n4.push(i5);
          return n4.reverse(), function e5() {
            for (; n4.length; ) {
              var i6 = n4.pop();
              if (i6 in t4)
                return e5.value = i6, e5.done = false, e5;
            }
            return e5.done = true, e5;
          };
        }, t3.values = I3, j3.prototype = { constructor: j3, reset: function(t4) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = e3, this.done = false, this.delegate = null, this.method = "next", this.arg = e3, this.tryEntries.forEach(O3), !t4)
            for (var n4 in this)
              "t" === n4.charAt(0) && i4.call(this, n4) && !isNaN(+n4.slice(1)) && (this[n4] = e3);
        }, stop: function() {
          this.done = true;
          var e4 = this.tryEntries[0].completion;
          if ("throw" === e4.type)
            throw e4.arg;
          return this.rval;
        }, dispatchException: function(t4) {
          if (this.done)
            throw t4;
          var n4 = this;
          function o4(i5, o5) {
            return s4.type = "throw", s4.arg = t4, n4.next = i5, o5 && (n4.method = "next", n4.arg = e3), !!o5;
          }
          for (var a3 = this.tryEntries.length - 1; a3 >= 0; --a3) {
            var r5 = this.tryEntries[a3], s4 = r5.completion;
            if ("root" === r5.tryLoc)
              return o4("end");
            if (r5.tryLoc <= this.prev) {
              var c4 = i4.call(r5, "catchLoc"), l4 = i4.call(r5, "finallyLoc");
              if (c4 && l4) {
                if (this.prev < r5.catchLoc)
                  return o4(r5.catchLoc, true);
                if (this.prev < r5.finallyLoc)
                  return o4(r5.finallyLoc);
              } else if (c4) {
                if (this.prev < r5.catchLoc)
                  return o4(r5.catchLoc, true);
              } else {
                if (!l4)
                  throw Error("try statement without catch or finally");
                if (this.prev < r5.finallyLoc)
                  return o4(r5.finallyLoc);
              }
            }
          }
        }, abrupt: function(e4, t4) {
          for (var n4 = this.tryEntries.length - 1; n4 >= 0; --n4) {
            var o4 = this.tryEntries[n4];
            if (o4.tryLoc <= this.prev && i4.call(o4, "finallyLoc") && this.prev < o4.finallyLoc) {
              var a3 = o4;
              break;
            }
          }
          a3 && ("break" === e4 || "continue" === e4) && a3.tryLoc <= t4 && t4 <= a3.finallyLoc && (a3 = null);
          var r5 = a3 ? a3.completion : {};
          return r5.type = e4, r5.arg = t4, a3 ? (this.method = "next", this.next = a3.finallyLoc, y3) : this.complete(r5);
        }, complete: function(e4, t4) {
          if ("throw" === e4.type)
            throw e4.arg;
          return "break" === e4.type || "continue" === e4.type ? this.next = e4.arg : "return" === e4.type ? (this.rval = this.arg = e4.arg, this.method = "return", this.next = "end") : "normal" === e4.type && t4 && (this.next = t4), y3;
        }, finish: function(e4) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.finallyLoc === e4)
              return this.complete(n4.completion, n4.afterLoc), O3(n4), y3;
          }
        }, catch: function(e4) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.tryLoc === e4) {
              var i5 = n4.completion;
              if ("throw" === i5.type) {
                var o4 = i5.arg;
                O3(n4);
              }
              return o4;
            }
          }
          throw Error("illegal catch attempt");
        }, delegateYield: function(t4, n4, i5) {
          return this.delegate = { iterator: I3(t4), resultName: n4, nextLoc: i5 }, "next" === this.method && (this.arg = e3), y3;
        } }, t3;
      }
      function r3(e3, t3, n3, i4, o3, a3, r4) {
        try {
          var s4 = e3[a3](r4), c3 = s4.value;
        } catch (e4) {
          return void n3(e4);
        }
        s4.done ? t3(c3) : Promise.resolve(c3).then(i4, o3);
      }
      function s3(e3) {
        return s3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
          return typeof e4;
        } : function(e4) {
          return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
        }, s3(e3);
      }
      var c2 = n2(10), l2 = n2(13), p3 = n2(14), u2 = p3.btoa, d2 = wx$1.getFileSystemManager(), f2 = n2(2), m2 = n2(15), h2 = m2.XMLParser, g2 = m2.XMLBuilder, v3 = new h2({ ignoreDeclaration: true, ignoreAttributes: true, parseTagValue: false, trimValues: false }), y2 = new g2(), x2 = function e3(t3) {
        if (A2(t3))
          for (var n3 in t3) {
            var i4 = t3[n3];
            "string" == typeof i4 ? "#text" === n3 && delete t3[n3] : Array.isArray(i4) ? i4.forEach(function(t4) {
              e3(t4);
            }) : A2(i4) && e3(i4);
          }
      };
      function k2(e3) {
        return encodeURIComponent(e3).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
      }
      function b2(e3, t3) {
        var n3 = [];
        for (var i4 in e3)
          e3.hasOwnProperty(i4) && n3.push(t3 ? k2(i4).toLowerCase() : i4);
        return n3.sort(function(e4, t4) {
          return (e4 = e4.toLowerCase()) === (t4 = t4.toLowerCase()) ? 0 : e4 > t4 ? 1 : -1;
        });
      }
      var C2 = ["cache-control", "content-disposition", "content-encoding", "content-length", "content-md5", "content-type", "expect", "expires", "host", "if-match", "if-modified-since", "if-none-match", "if-unmodified-since", "origin", "range", "transfer-encoding", "pic-operations"], S2 = function() {
      }, w2 = function(e3) {
        var t3 = {};
        for (var n3 in e3)
          e3.hasOwnProperty(n3) && void 0 !== e3[n3] && null !== e3[n3] && (t3[n3] = e3[n3]);
        return t3;
      };
      function T2(e3) {
        return E2(e3, function(e4) {
          return "object" === s3(e4) && null !== e4 ? T2(e4) : e4;
        });
      }
      function R2(e3, t3) {
        return P2(t3, function(n3, i4) {
          e3[i4] = t3[i4];
        }), e3;
      }
      function B2(e3) {
        return e3 instanceof Array;
      }
      function A2(e3) {
        return "[object Object]" === Object.prototype.toString.call(e3);
      }
      function P2(e3, t3) {
        for (var n3 in e3)
          e3.hasOwnProperty(n3) && t3(e3[n3], n3);
      }
      function E2(e3, t3) {
        var n3 = B2(e3) ? [] : {};
        for (var i4 in e3)
          e3.hasOwnProperty(i4) && (n3[i4] = t3(e3[i4], i4));
        return n3;
      }
      var O2 = function(e3, t3) {
        if (t3 = R2({}, t3), "getAuth" !== e3 && "getV4Auth" !== e3 && "getObjectUrl" !== e3) {
          var n3 = t3.Headers || {};
          if (t3 && "object" === s3(t3)) {
            !function() {
              for (var e4 in t3)
                t3.hasOwnProperty(e4) && e4.indexOf("x-cos-") > -1 && (n3[e4] = t3[e4]);
            }();
            U2.each({ "x-cos-mfa": "MFA", "Content-MD5": "ContentMD5", "Content-Length": "ContentLength", "Content-Type": "ContentType", Expect: "Expect", Expires: "Expires", "Cache-Control": "CacheControl", "Content-Disposition": "ContentDisposition", "Content-Encoding": "ContentEncoding", Range: "Range", "If-Modified-Since": "IfModifiedSince", "If-Unmodified-Since": "IfUnmodifiedSince", "If-Match": "IfMatch", "If-None-Match": "IfNoneMatch", "x-cos-copy-source": "CopySource", "x-cos-copy-source-Range": "CopySourceRange", "x-cos-metadata-directive": "MetadataDirective", "x-cos-copy-source-If-Modified-Since": "CopySourceIfModifiedSince", "x-cos-copy-source-If-Unmodified-Since": "CopySourceIfUnmodifiedSince", "x-cos-copy-source-If-Match": "CopySourceIfMatch", "x-cos-copy-source-If-None-Match": "CopySourceIfNoneMatch", "x-cos-acl": "ACL", "x-cos-grant-read": "GrantRead", "x-cos-grant-write": "GrantWrite", "x-cos-grant-full-control": "GrantFullControl", "x-cos-grant-read-acp": "GrantReadAcp", "x-cos-grant-write-acp": "GrantWriteAcp", "x-cos-storage-class": "StorageClass", "x-cos-traffic-limit": "TrafficLimit", "x-cos-mime-limit": "MimeLimit", "x-cos-forbid-overwrite": "ForbidOverwrite", "x-cos-server-side-encryption-customer-algorithm": "SSECustomerAlgorithm", "x-cos-server-side-encryption-customer-key": "SSECustomerKey", "x-cos-server-side-encryption-customer-key-MD5": "SSECustomerKeyMD5", "x-cos-server-side-encryption": "ServerSideEncryption", "x-cos-server-side-encryption-cos-kms-key-id": "SSEKMSKeyId", "x-cos-server-side-encryption-context": "SSEContext", "Pic-Operations": "PicOperations" }, function(e4, i4) {
              void 0 !== t3[e4] && (n3[i4] = t3[e4]);
            }), t3.Headers = w2(n3);
          }
        }
        return t3;
      }, j2 = function(e3) {
        return new Promise(function(t3, n3) {
          d2.readFile({ filePath: e3, success: function(e4) {
            t3(e4.data);
          }, fail: function(e4) {
            n3((null == e4 ? void 0 : e4.errMsg) || "");
          } });
        });
      }, I2 = function() {
        var e3, t3 = (e3 = a2().mark(function e4(t4, n3, i4) {
          return a2().wrap(function(e5) {
            for (; ; )
              switch (e5.prev = e5.next) {
                case 0:
                  if ("postObject" !== t4) {
                    e5.next = 4;
                    break;
                  }
                  i4(), e5.next = 21;
                  break;
                case 4:
                  if ("putObject" !== t4) {
                    e5.next = 20;
                    break;
                  }
                  if (void 0 !== n3.Body || !n3.FilePath) {
                    e5.next = 17;
                    break;
                  }
                  return e5.prev = 6, e5.next = 9, j2(n3.FilePath);
                case 9:
                  n3.Body = e5.sent, e5.next = 17;
                  break;
                case 12:
                  return e5.prev = 12, e5.t0 = e5.catch(6), n3.Body = void 0, i4({ error: "readFile error, ".concat(e5.t0) }), e5.abrupt("return");
                case 17:
                  void 0 !== n3.Body ? (n3.ContentLength = n3.Body.byteLength, i4(null, n3.ContentLength)) : i4({ error: "missing param Body" }), e5.next = 21;
                  break;
                case 20:
                  n3.FilePath ? d2.stat({ path: n3.FilePath, success: function(e6) {
                    var t5 = e6.stats;
                    n3.FileStat = t5, n3.FileStat.FilePath = n3.FilePath;
                    var o3 = t5.isDirectory() ? 0 : t5.size;
                    n3.ContentLength = o3 = o3 || 0, i4(null, o3);
                  }, fail: function(e6) {
                    i4(e6);
                  } }) : i4({ error: "missing param FilePath" });
                case 21:
                case "end":
                  return e5.stop();
              }
          }, e4, null, [[6, 12]]);
        }), function() {
          var t4 = this, n3 = arguments;
          return new Promise(function(i4, o3) {
            var a3 = e3.apply(t4, n3);
            function s4(e4) {
              r3(a3, i4, o3, s4, c3, "next", e4);
            }
            function c3(e4) {
              r3(a3, i4, o3, s4, c3, "throw", e4);
            }
            s4(void 0);
          });
        });
        return function(e4, n3, i4) {
          return t3.apply(this, arguments);
        };
      }(), _2 = function(e3) {
        return Date.now() + (e3 || 0);
      }, N3 = function(e3, t3) {
        if (!e3 || !t3)
          return -1;
        e3 = e3.split("."), t3 = t3.split(".");
        for (var n3 = Math.max(e3.length, t3.length); e3.length < n3; )
          e3.push("0");
        for (; t3.length < n3; )
          t3.push("0");
        for (var i4 = 0; i4 < n3; i4++) {
          var o3 = parseInt(e3[i4]), a3 = parseInt(t3[i4]);
          if (o3 > a3)
            return 1;
          if (o3 < a3)
            return -1;
        }
        return 0;
      }, L2 = function() {
        var e3 = {}, t3 = {};
        wx$1.canIUse("getAppBaseInfo") && (e3 = wx$1.getAppBaseInfo() || {}), wx$1.canIUse("getDeviceInfo") && (t3 = wx$1.getDeviceInfo() || {});
        var n3 = e3.SDKVersion, i4 = (t3.platform, N3(n3, "2.10.0") >= 0);
        return function() {
          return i4;
        };
      }(), U2 = { noop: S2, formatParams: O2, apiWrapper: function(e3, t3) {
        return function(n3, i4) {
          var o3, a3 = this;
          if ("function" == typeof n3 && (i4 = n3, n3 = {}), n3 = O2(e3, n3), a3.options.EnableReporter)
            if ("sliceUploadFile" === n3.calledBySdk || "sliceCopyFile" === n3.calledBySdk)
              o3 = n3.tracker && n3.tracker.generateSubTracker({ apiName: e3 });
            else if (["uploadFile", "uploadFiles"].includes(e3))
              o3 = null;
            else {
              var r4 = 0;
              n3.Body && (r4 = "string" == typeof n3.Body ? n3.Body.length : n3.Body.size || n3.Body.byteLength || 0);
              var s4 = a3.options.UseAccelerate || "string" == typeof a3.options.Domain && a3.options.Domain.includes("accelerate.");
              o3 = new f2({ Beacon: a3.options.BeaconReporter, clsReporter: a3.options.ClsReporter, bucket: n3.Bucket, region: n3.Region, apiName: e3, realApi: e3, accelerate: s4, fileKey: n3.Key, fileSize: r4, deepTracker: a3.options.DeepTracker, customId: a3.options.CustomId, delay: a3.options.TrackerDelay });
            }
          n3.tracker = o3;
          var c3 = function(e4) {
            return e4 && e4.headers && (e4.headers["x-ci-request-id"] && (e4.RequestId = e4.headers["x-ci-request-id"]), e4.headers["x-cos-request-id"] && (e4.RequestId = e4.headers["x-cos-request-id"]), e4.headers["x-cos-version-id"] && (e4.VersionId = e4.headers["x-cos-version-id"]), e4.headers["x-cos-delete-marker"] && (e4.DeleteMarker = e4.headers["x-cos-delete-marker"])), e4;
          }, l3 = function(e4, t4) {
            o3 && o3.report(e4, t4), i4 && i4(c3(e4), c3(t4));
          }, p4 = function() {
            if ("getService" !== e3 && "abortUploadTask" !== e3) {
              var t4 = function(e4, t5) {
                var n4 = t5.Bucket, i5 = t5.Region, o4 = t5.Key;
                if (e4.indexOf("Bucket") > -1 || "deleteMultipleObject" === e4 || "multipartList" === e4 || "listObjectVersions" === e4) {
                  if (!n4)
                    return "Bucket";
                  if (!i5)
                    return "Region";
                } else if (e4.indexOf("Object") > -1 || e4.indexOf("multipart") > -1 || "sliceUploadFile" === e4 || "abortUploadTask" === e4 || "uploadFile" === e4) {
                  if (!n4)
                    return "Bucket";
                  if (!i5)
                    return "Region";
                  if (!o4)
                    return "Key";
                }
                return false;
              }(e3, n3);
              if (t4)
                return "missing param " + t4;
              if (n3.Region) {
                if (n3.Region.indexOf("cos.") > -1)
                  return 'param Region should not be start with "cos."';
                if (!/^([a-z\d-]+)$/.test(n3.Region))
                  return "Region format error.";
                !a3.options.CompatibilityMode && -1 === n3.Region.indexOf("-") && "yfb" !== n3.Region && "default" !== n3.Region && n3.Region;
              }
              if (n3.Bucket) {
                if (!/^([a-z\d-]+)-(\d+)$/.test(n3.Bucket))
                  if (n3.AppId)
                    n3.Bucket = n3.Bucket + "-" + n3.AppId;
                  else {
                    if (!a3.options.AppId)
                      return 'Bucket should format as "test-1250000000".';
                    n3.Bucket = n3.Bucket + "-" + a3.options.AppId;
                  }
                n3.AppId && delete n3.AppId;
              }
              n3.Key && "/" === n3.Key.substr(0, 1) && (n3.Key = n3.Key.substr(1));
            }
          }(), u3 = ["getAuth", "getObjectUrl"].includes(e3);
          if (!u3 && !i4)
            return new Promise(function(e4, o4) {
              if (i4 = function(t4, n4) {
                t4 ? o4(t4) : e4(n4);
              }, p4)
                return l3({ error: p4 });
              t3.call(a3, n3, l3);
            });
          if (p4)
            return l3({ error: p4 });
          var d3 = t3.call(a3, n3, l3);
          return u3 ? d3 : void 0;
        };
      }, xml2json: function(e3) {
        var t3 = v3.parse(e3);
        return x2(t3), t3;
      }, json2xml: function(e3) {
        return y2.build(e3);
      }, md5: c2, clearKey: w2, fileSlice: function(e3, t3, n3, i4) {
        e3 ? d2.readFile({ filePath: e3, position: t3, length: n3 - t3, success: function(e4) {
          i4(e4.data);
        }, fail: function() {
          i4(null);
        } }) : i4(null);
      }, getBodyMd5: function(e3, t3, n3) {
        n3 = n3 || S2, e3 && t3 && t3 instanceof ArrayBuffer ? U2.getFileMd5(t3, function(e4, t4) {
          n3(t4);
        }) : n3();
      }, getFileMd5: function(e3, t3) {
        var n3 = c2(e3);
        return t3 && t3(n3), n3;
      }, binaryBase64: function(e3) {
        var t3, n3, i4, o3 = "";
        for (t3 = 0, n3 = e3.length / 2; t3 < n3; t3++)
          i4 = parseInt(e3[2 * t3] + e3[2 * t3 + 1], 16), o3 += String.fromCharCode(i4);
        return u2(o3);
      }, extend: R2, isArray: B2, isInArray: function(e3, t3) {
        for (var n3 = false, i4 = 0; i4 < e3.length; i4++)
          if (t3 === e3[i4]) {
            n3 = true;
            break;
          }
        return n3;
      }, makeArray: function(e3) {
        return B2(e3) ? e3 : [e3];
      }, each: P2, map: E2, filter: function(e3, t3) {
        var n3 = B2(e3), i4 = n3 ? [] : {};
        for (var o3 in e3)
          e3.hasOwnProperty(o3) && t3(e3[o3], o3) && (n3 ? i4.push(e3[o3]) : i4[o3] = e3[o3]);
        return i4;
      }, clone: T2, attr: function(e3, t3, n3) {
        return e3 && t3 in e3 ? e3[t3] : n3;
      }, uuid: function() {
        var e3 = function() {
          return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
        };
        return e3() + e3() + "-" + e3() + "-" + e3() + "-" + e3() + "-" + e3() + e3() + e3();
      }, camSafeUrlEncode: k2, throttleOnProgress: function(e3, t3) {
        var n3, i4, o3 = this, a3 = 0, r4 = 0, s4 = Date.now();
        function c3() {
          if (i4 = 0, t3 && "function" == typeof t3) {
            n3 = Date.now();
            var o4, c4 = Math.max(0, Math.round((r4 - a3) / ((n3 - s4) / 1e3) * 100) / 100) || 0;
            o4 = 0 === r4 && 0 === e3 ? 1 : Math.floor(r4 / e3 * 100) / 100 || 0, s4 = n3, a3 = r4;
            try {
              t3({ loaded: r4, total: e3, speed: c4, percent: o4 });
            } catch (e4) {
            }
          }
        }
        return function(t4, n4) {
          if (t4 && (r4 = t4.loaded, e3 = t4.total), n4)
            clearTimeout(i4), c3();
          else {
            if (i4)
              return;
            i4 = setTimeout(c3, o3.options.ProgressInterval);
          }
        };
      }, getFileSize: I2, getFileSizeByPath: function(e3) {
        return new Promise(function(t3, n3) {
          d2.stat({ path: e3, success: function(e4) {
            var n4 = e4.stats, i4 = n4.isDirectory() ? 0 : n4.size;
            t3(i4);
          }, fail: function(e4) {
            n3((null == e4 ? void 0 : e4.errMsg) || "");
          } });
        });
      }, getSkewTime: _2, obj2str: function(e3, t3) {
        var n3, i4, o3, a3 = [], r4 = b2(e3);
        for (n3 = 0; n3 < r4.length; n3++)
          o3 = void 0 === e3[i4 = r4[n3]] || null === e3[i4] ? "" : "" + e3[i4], i4 = t3 ? k2(i4).toLowerCase() : k2(i4), o3 = k2(o3) || "", a3.push(i4 + "=" + o3);
        return a3.join("&");
      }, getAuth: function(e3) {
        var t3, n3 = (e3 = e3 || {}).SecretId, i4 = e3.SecretKey, o3 = e3.KeyTime, a3 = (e3.method || e3.Method || "get").toLowerCase(), r4 = T2(e3.Query || e3.params || {}), s4 = function(e4) {
          var t4 = {};
          for (var n4 in e4) {
            var i5 = n4.toLowerCase();
            (i5.indexOf("x-cos-") > -1 || i5.indexOf("x-ci-") > -1 || C2.indexOf(i5) > -1) && (t4[n4] = e4[n4]);
          }
          return t4;
        }(T2(e3.Headers || e3.headers || {})), c3 = e3.Key || "";
        e3.UseRawKey ? t3 = e3.Pathname || e3.pathname || "/" + c3 : 0 !== (t3 = e3.Pathname || e3.pathname || c3).indexOf("/") && (t3 = "/" + t3);
        var p4 = false !== e3.ForceSignHost;
        if (!s4.Host && !s4.host && e3.Bucket && e3.Region && p4 && (s4.Host = e3.Bucket + ".cos." + e3.Region + ".myqcloud.com"), n3 && i4) {
          var u3 = Math.round(_2(e3.SystemClockOffset) / 1e3) - 1, d3 = u3, f3 = e3.Expires || e3.expires;
          d3 += void 0 === f3 ? 900 : 1 * f3 || 0;
          var m3 = n3, h3 = o3 || u3 + ";" + d3, g3 = o3 || u3 + ";" + d3, v4 = b2(s4, true).join(";").toLowerCase(), y3 = b2(r4, true).join(";").toLowerCase(), x3 = l2.HmacSHA1(g3, i4).toString(), k3 = [a3, t3, U2.obj2str(r4, true), U2.obj2str(s4, true), ""].join("\n"), S3 = ["sha1", h3, l2.SHA1(k3).toString(), ""].join("\n");
          return ["q-sign-algorithm=sha1", "q-ak=" + m3, "q-sign-time=" + h3, "q-key-time=" + g3, "q-header-list=" + v4, "q-url-param-list=" + y3, "q-signature=" + l2.HmacSHA1(S3, x3).toString()].join("&");
        }
      }, compareVersion: N3, canFileSlice: L2, isCIHost: function(e3) {
        return /^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e3);
      }, error: function(e3, t3) {
        var n3 = e3;
        return e3.message = e3.message || null, "string" == typeof t3 ? (e3.error = t3, e3.message = t3) : "object" === s3(t3) && null !== t3 && (R2(e3, t3), (t3.code || t3.name) && (e3.code = t3.code || t3.name), t3.message && (e3.message = t3.message), t3.stack && (e3.stack = t3.stack)), "function" == typeof Object.defineProperty && (Object.defineProperty(e3, "name", { writable: true, enumerable: false }), Object.defineProperty(e3, "message", { enumerable: true })), e3.name = t3 && t3.name || e3.name || e3.code || "Error", e3.code || (e3.code = e3.name), e3.error || (e3.error = T2(n3)), e3;
      }, getSourceParams: function(e3) {
        var t3 = this.options.CopySourceParser;
        if (t3)
          return t3(e3);
        var n3 = e3.match(/^([^.]+-\d+)\.cos(v6|-cdc|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);
        return n3 ? { Bucket: n3[1], Region: n3[3], Key: n3[7] } : null;
      }, encodeBase64: function(e3, t3) {
        var n3 = p3.encode(e3);
        return t3 && (n3 = n3.replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "")), n3;
      }, simplifyPath: function(e3) {
        var t3, n3 = [], o3 = i3(e3.split("/"));
        try {
          for (o3.s(); !(t3 = o3.n()).done; ) {
            var a3 = t3.value;
            ".." === a3 ? n3.length && n3.pop() : a3.length && "." !== a3 && n3.push(a3);
          }
        } catch (e4) {
          o3.e(e4);
        } finally {
          o3.f();
        }
        return "/" + n3.join("/");
      }, arrayBufferToString: function(e3) {
        return new TextDecoder("utf-8").decode(e3);
      }, parseResBody: function(e3) {
        var t3;
        if (e3 && "string" == typeof e3) {
          var n3 = e3.trim(), i4 = 0 === n3.indexOf("<"), o3 = 0 === n3.indexOf("{");
          if (i4)
            t3 = U2.xml2json(e3) || {};
          else if (o3)
            try {
              var a3 = e3.replace(/\n/g, " "), r4 = JSON.parse(a3);
              t3 = "[object Object]" === Object.prototype.toString.call(r4) ? r4 : e3;
            } catch (n4) {
              t3 = e3;
            }
          else
            t3 = e3;
        } else
          t3 = e3 || {};
        return t3;
      } };
      e2.exports = U2;
    }, function(e2, t2, n2) {
      const i3 = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", o2 = "[" + i3 + "][" + (i3 + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040") + "]*", a2 = new RegExp("^" + o2 + "$");
      t2.isExist = function(e3) {
        return void 0 !== e3;
      }, t2.isEmptyObject = function(e3) {
        return 0 === Object.keys(e3).length;
      }, t2.merge = function(e3, t3, n3) {
        if (t3) {
          const i4 = Object.keys(t3), o3 = i4.length;
          for (let a3 = 0; a3 < o3; a3++)
            e3[i4[a3]] = "strict" === n3 ? [t3[i4[a3]]] : t3[i4[a3]];
        }
      }, t2.getValue = function(e3) {
        return t2.isExist(e3) ? e3 : "";
      }, t2.isName = function(e3) {
        const t3 = a2.exec(e3);
        return !(null == t3);
      }, t2.getAllMatches = function(e3, t3) {
        const n3 = [];
        let i4 = t3.exec(e3);
        for (; i4; ) {
          const o3 = [];
          o3.startIndex = t3.lastIndex - i4[0].length;
          const a3 = i4.length;
          for (let e4 = 0; e4 < a3; e4++)
            o3.push(i4[e4]);
          n3.push(o3), i4 = t3.exec(e3);
        }
        return n3;
      }, t2.nameRegexp = o2;
    }, function(e2, t2, n2) {
      function i3(e3) {
        return i3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
          return typeof e4;
        } : function(e4) {
          return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
        }, i3(e3);
      }
      function o2() {
        /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
        o2 = function() {
          return t3;
        };
        var e3, t3 = {}, n3 = Object.prototype, a3 = n3.hasOwnProperty, r4 = Object.defineProperty || function(e4, t4, n4) {
          e4[t4] = n4.value;
        }, s4 = "function" == typeof Symbol ? Symbol : {}, c3 = s4.iterator || "@@iterator", l3 = s4.asyncIterator || "@@asyncIterator", p4 = s4.toStringTag || "@@toStringTag";
        function u3(e4, t4, n4) {
          return Object.defineProperty(e4, t4, { value: n4, enumerable: true, configurable: true, writable: true }), e4[t4];
        }
        try {
          u3({}, "");
        } catch (e4) {
          u3 = function(e5, t4, n4) {
            return e5[t4] = n4;
          };
        }
        function d3(e4, t4, n4, i4) {
          var o3 = t4 && t4.prototype instanceof x3 ? t4 : x3, a4 = Object.create(o3.prototype), s5 = new j2(i4 || []);
          return r4(a4, "_invoke", { value: A2(e4, n4, s5) }), a4;
        }
        function f3(e4, t4, n4) {
          try {
            return { type: "normal", arg: e4.call(t4, n4) };
          } catch (e5) {
            return { type: "throw", arg: e5 };
          }
        }
        t3.wrap = d3;
        var m3 = "suspendedStart", h3 = "suspendedYield", g3 = "executing", v4 = "completed", y3 = {};
        function x3() {
        }
        function k2() {
        }
        function b2() {
        }
        var C2 = {};
        u3(C2, c3, function() {
          return this;
        });
        var S2 = Object.getPrototypeOf, w2 = S2 && S2(S2(I2([])));
        w2 && w2 !== n3 && a3.call(w2, c3) && (C2 = w2);
        var T2 = b2.prototype = x3.prototype = Object.create(C2);
        function R2(e4) {
          ["next", "throw", "return"].forEach(function(t4) {
            u3(e4, t4, function(e5) {
              return this._invoke(t4, e5);
            });
          });
        }
        function B2(e4, t4) {
          function n4(o4, r5, s5, c4) {
            var l4 = f3(e4[o4], e4, r5);
            if ("throw" !== l4.type) {
              var p5 = l4.arg, u4 = p5.value;
              return u4 && "object" == i3(u4) && a3.call(u4, "__await") ? t4.resolve(u4.__await).then(function(e5) {
                n4("next", e5, s5, c4);
              }, function(e5) {
                n4("throw", e5, s5, c4);
              }) : t4.resolve(u4).then(function(e5) {
                p5.value = e5, s5(p5);
              }, function(e5) {
                return n4("throw", e5, s5, c4);
              });
            }
            c4(l4.arg);
          }
          var o3;
          r4(this, "_invoke", { value: function(e5, i4) {
            function a4() {
              return new t4(function(t5, o4) {
                n4(e5, i4, t5, o4);
              });
            }
            return o3 = o3 ? o3.then(a4, a4) : a4();
          } });
        }
        function A2(t4, n4, i4) {
          var o3 = m3;
          return function(a4, r5) {
            if (o3 === g3)
              throw Error("Generator is already running");
            if (o3 === v4) {
              if ("throw" === a4)
                throw r5;
              return { value: e3, done: true };
            }
            for (i4.method = a4, i4.arg = r5; ; ) {
              var s5 = i4.delegate;
              if (s5) {
                var c4 = P2(s5, i4);
                if (c4) {
                  if (c4 === y3)
                    continue;
                  return c4;
                }
              }
              if ("next" === i4.method)
                i4.sent = i4._sent = i4.arg;
              else if ("throw" === i4.method) {
                if (o3 === m3)
                  throw o3 = v4, i4.arg;
                i4.dispatchException(i4.arg);
              } else
                "return" === i4.method && i4.abrupt("return", i4.arg);
              o3 = g3;
              var l4 = f3(t4, n4, i4);
              if ("normal" === l4.type) {
                if (o3 = i4.done ? v4 : h3, l4.arg === y3)
                  continue;
                return { value: l4.arg, done: i4.done };
              }
              "throw" === l4.type && (o3 = v4, i4.method = "throw", i4.arg = l4.arg);
            }
          };
        }
        function P2(t4, n4) {
          var i4 = n4.method, o3 = t4.iterator[i4];
          if (o3 === e3)
            return n4.delegate = null, "throw" === i4 && t4.iterator.return && (n4.method = "return", n4.arg = e3, P2(t4, n4), "throw" === n4.method) || "return" !== i4 && (n4.method = "throw", n4.arg = new TypeError("The iterator does not provide a '" + i4 + "' method")), y3;
          var a4 = f3(o3, t4.iterator, n4.arg);
          if ("throw" === a4.type)
            return n4.method = "throw", n4.arg = a4.arg, n4.delegate = null, y3;
          var r5 = a4.arg;
          return r5 ? r5.done ? (n4[t4.resultName] = r5.value, n4.next = t4.nextLoc, "return" !== n4.method && (n4.method = "next", n4.arg = e3), n4.delegate = null, y3) : r5 : (n4.method = "throw", n4.arg = new TypeError("iterator result is not an object"), n4.delegate = null, y3);
        }
        function E2(e4) {
          var t4 = { tryLoc: e4[0] };
          1 in e4 && (t4.catchLoc = e4[1]), 2 in e4 && (t4.finallyLoc = e4[2], t4.afterLoc = e4[3]), this.tryEntries.push(t4);
        }
        function O2(e4) {
          var t4 = e4.completion || {};
          t4.type = "normal", delete t4.arg, e4.completion = t4;
        }
        function j2(e4) {
          this.tryEntries = [{ tryLoc: "root" }], e4.forEach(E2, this), this.reset(true);
        }
        function I2(t4) {
          if (t4 || "" === t4) {
            var n4 = t4[c3];
            if (n4)
              return n4.call(t4);
            if ("function" == typeof t4.next)
              return t4;
            if (!isNaN(t4.length)) {
              var o3 = -1, r5 = function n5() {
                for (; ++o3 < t4.length; )
                  if (a3.call(t4, o3))
                    return n5.value = t4[o3], n5.done = false, n5;
                return n5.value = e3, n5.done = true, n5;
              };
              return r5.next = r5;
            }
          }
          throw new TypeError(i3(t4) + " is not iterable");
        }
        return k2.prototype = b2, r4(T2, "constructor", { value: b2, configurable: true }), r4(b2, "constructor", { value: k2, configurable: true }), k2.displayName = u3(b2, p4, "GeneratorFunction"), t3.isGeneratorFunction = function(e4) {
          var t4 = "function" == typeof e4 && e4.constructor;
          return !!t4 && (t4 === k2 || "GeneratorFunction" === (t4.displayName || t4.name));
        }, t3.mark = function(e4) {
          return Object.setPrototypeOf ? Object.setPrototypeOf(e4, b2) : (e4.__proto__ = b2, u3(e4, p4, "GeneratorFunction")), e4.prototype = Object.create(T2), e4;
        }, t3.awrap = function(e4) {
          return { __await: e4 };
        }, R2(B2.prototype), u3(B2.prototype, l3, function() {
          return this;
        }), t3.AsyncIterator = B2, t3.async = function(e4, n4, i4, o3, a4) {
          void 0 === a4 && (a4 = Promise);
          var r5 = new B2(d3(e4, n4, i4, o3), a4);
          return t3.isGeneratorFunction(n4) ? r5 : r5.next().then(function(e5) {
            return e5.done ? e5.value : r5.next();
          });
        }, R2(T2), u3(T2, p4, "Generator"), u3(T2, c3, function() {
          return this;
        }), u3(T2, "toString", function() {
          return "[object Generator]";
        }), t3.keys = function(e4) {
          var t4 = Object(e4), n4 = [];
          for (var i4 in t4)
            n4.push(i4);
          return n4.reverse(), function e5() {
            for (; n4.length; ) {
              var i5 = n4.pop();
              if (i5 in t4)
                return e5.value = i5, e5.done = false, e5;
            }
            return e5.done = true, e5;
          };
        }, t3.values = I2, j2.prototype = { constructor: j2, reset: function(t4) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = e3, this.done = false, this.delegate = null, this.method = "next", this.arg = e3, this.tryEntries.forEach(O2), !t4)
            for (var n4 in this)
              "t" === n4.charAt(0) && a3.call(this, n4) && !isNaN(+n4.slice(1)) && (this[n4] = e3);
        }, stop: function() {
          this.done = true;
          var e4 = this.tryEntries[0].completion;
          if ("throw" === e4.type)
            throw e4.arg;
          return this.rval;
        }, dispatchException: function(t4) {
          if (this.done)
            throw t4;
          var n4 = this;
          function i4(i5, o4) {
            return s5.type = "throw", s5.arg = t4, n4.next = i5, o4 && (n4.method = "next", n4.arg = e3), !!o4;
          }
          for (var o3 = this.tryEntries.length - 1; o3 >= 0; --o3) {
            var r5 = this.tryEntries[o3], s5 = r5.completion;
            if ("root" === r5.tryLoc)
              return i4("end");
            if (r5.tryLoc <= this.prev) {
              var c4 = a3.call(r5, "catchLoc"), l4 = a3.call(r5, "finallyLoc");
              if (c4 && l4) {
                if (this.prev < r5.catchLoc)
                  return i4(r5.catchLoc, true);
                if (this.prev < r5.finallyLoc)
                  return i4(r5.finallyLoc);
              } else if (c4) {
                if (this.prev < r5.catchLoc)
                  return i4(r5.catchLoc, true);
              } else {
                if (!l4)
                  throw Error("try statement without catch or finally");
                if (this.prev < r5.finallyLoc)
                  return i4(r5.finallyLoc);
              }
            }
          }
        }, abrupt: function(e4, t4) {
          for (var n4 = this.tryEntries.length - 1; n4 >= 0; --n4) {
            var i4 = this.tryEntries[n4];
            if (i4.tryLoc <= this.prev && a3.call(i4, "finallyLoc") && this.prev < i4.finallyLoc) {
              var o3 = i4;
              break;
            }
          }
          o3 && ("break" === e4 || "continue" === e4) && o3.tryLoc <= t4 && t4 <= o3.finallyLoc && (o3 = null);
          var r5 = o3 ? o3.completion : {};
          return r5.type = e4, r5.arg = t4, o3 ? (this.method = "next", this.next = o3.finallyLoc, y3) : this.complete(r5);
        }, complete: function(e4, t4) {
          if ("throw" === e4.type)
            throw e4.arg;
          return "break" === e4.type || "continue" === e4.type ? this.next = e4.arg : "return" === e4.type ? (this.rval = this.arg = e4.arg, this.method = "return", this.next = "end") : "normal" === e4.type && t4 && (this.next = t4), y3;
        }, finish: function(e4) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.finallyLoc === e4)
              return this.complete(n4.completion, n4.afterLoc), O2(n4), y3;
          }
        }, catch: function(e4) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.tryLoc === e4) {
              var i4 = n4.completion;
              if ("throw" === i4.type) {
                var o3 = i4.arg;
                O2(n4);
              }
              return o3;
            }
          }
          throw Error("illegal catch attempt");
        }, delegateYield: function(t4, n4, i4) {
          return this.delegate = { iterator: I2(t4), resultName: n4, nextLoc: i4 }, "next" === this.method && (this.arg = e3), y3;
        } }, t3;
      }
      function a2(e3, t3, n3, i4, o3, a3, r4) {
        try {
          var s4 = e3[a3](r4), c3 = s4.value;
        } catch (e4) {
          return void n3(e4);
        }
        s4.done ? t3(c3) : Promise.resolve(c3).then(i4, o3);
      }
      function r3(e3) {
        return function() {
          var t3 = this, n3 = arguments;
          return new Promise(function(i4, o3) {
            var r4 = e3.apply(t3, n3);
            function s4(e4) {
              a2(r4, i4, o3, s4, c3, "next", e4);
            }
            function c3(e4) {
              a2(r4, i4, o3, s4, c3, "throw", e4);
            }
            s4(void 0);
          });
        };
      }
      function s3(e3, t3, n3) {
        return (t3 = l2(t3)) in e3 ? Object.defineProperty(e3, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e3[t3] = n3, e3;
      }
      function c2(e3, t3) {
        for (var n3 = 0; n3 < t3.length; n3++) {
          var i4 = t3[n3];
          i4.enumerable = i4.enumerable || false, i4.configurable = true, "value" in i4 && (i4.writable = true), Object.defineProperty(e3, l2(i4.key), i4);
        }
      }
      function l2(e3) {
        var t3 = function(e4, t4) {
          if ("object" != i3(e4) || !e4)
            return e4;
          var n3 = e4[Symbol.toPrimitive];
          if (void 0 !== n3) {
            var o3 = n3.call(e4, t4 || "default");
            if ("object" != i3(o3))
              return o3;
            throw new TypeError("@@toPrimitive must return a primitive value.");
          }
          return ("string" === t4 ? String : Number)(e4);
        }(e3, "string");
        return "symbol" == i3(t3) ? t3 : t3 + "";
      }
      var p3 = n2(3), u2 = null, d2 = function(e3) {
        return !e3 || e3 < 0 ? 0 : (e3 / 1e3).toFixed(3);
      }, f2 = function() {
        var e3 = function() {
          return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
        };
        return e3() + e3() + "-" + e3() + "-" + e3() + "-" + e3() + "-" + e3() + e3() + e3();
      }, m2 = function() {
        return new Promise(function(e3) {
          if (wx$1.canIUse("getNetworkType"))
            try {
              wx$1.getNetworkType({ success: function(t3) {
                e3(t3.networkType);
              } });
            } catch (t3) {
              e3("can_not_get_network_type");
            }
          else
            e3("can_not_get_network_type");
        });
      }, h2 = function() {
        var e3 = { devicePlatform: "can_not_get_system_info", wxVersion: "can_not_get_system_info", wxSystem: "can_not_get_system_info", wxSdkVersion: "can_not_get_system_info" }, t3 = {}, n3 = {};
        wx$1.canIUse("getAppBaseInfo") && (t3 = wx$1.getAppBaseInfo() || {}), wx$1.canIUse("getDeviceInfo") && (n3 = wx$1.getDeviceInfo() || {});
        var i4 = t3.SDKVersion || "can_not_get_system_info", o3 = t3.version || "can_not_get_system_info", a3 = n3.platform || "can_not_get_system_info", r4 = n3.system || "can_not_get_system_info";
        return Object.assign(e3, { devicePlatform: a3, wxVersion: o3, wxSystem: r4, wxSdkVersion: i4 }), e3;
      }, g2 = h2();
      function v3(e3) {
        return e3.replace(/([A-Z])/g, "_$1").toLowerCase();
      }
      function y2(e3) {
        var t3, n3 = {}, i4 = ["sdkVersionName", "sdkVersionCode", "osName", "networkType", "requestName", "requestResult", "bucket", "region", "appid", "accelerate", "url", "host", "requestPath", "userAgent", "httpMethod", "httpSize", "httpSpeed", "httpTookTime", "httpMd5", "httpSign", "httpFullTime", "httpDomain", "partNumber", "httpRetryTimes", "customId", "traceId", "realApi"], o3 = [].concat(i4, ["errorNode", "errorCode", "errorName", "errorMessage", "errorRequestId", "errorHttpCode", "errorServiceName", "errorType", "fullError"]), a3 = "Success" === e3.requestResult ? i4 : o3;
        for (var r4 in e3) {
          if (a3.includes(r4))
            n3[v3(r4)] = e3[r4];
        }
        return n3.request_name = e3.realApi ? (t3 = e3.realApi, ["putObject", "sliceUploadFile", "uploadFile", "uploadFiles"].includes(t3) ? "UploadTask" : "getObject" === t3 ? "DownloadTask" : ["putObjectCopy", "sliceCopyFile"].includes(t3) ? "CopyTask" : t3) : e3.requestName, n3;
      }
      var x2 = function() {
        function e3(t4) {
          var n4;
          !function(e4, t5) {
            if (!(e4 instanceof t5))
              throw new TypeError("Cannot call a class as a function");
          }(this, e3);
          var i4 = t4.parent, o3 = t4.traceId, a4 = t4.bucket, r4 = t4.region, c3 = t4.apiName, l4 = t4.realApi, d3 = t4.httpMethod, m3 = t4.fileKey, h3 = t4.fileSize, v4 = t4.accelerate, y3 = t4.customId, x3 = t4.delay, k2 = t4.deepTracker, b2 = t4.Beacon, C2 = t4.clsReporter, S2 = a4 && a4.substr(a4.lastIndexOf("-") + 1) || "";
          this.parent = i4, this.deepTracker = k2, this.delay = x3, C2 && !this.clsReporter && (this.clsReporter = C2), this.params = (s3(n4 = { sdkVersionName: "cos-wx-sdk-v5", sdkVersionCode: p3.version, osName: g2.devicePlatform, networkType: "", requestName: c3 || "", requestResult: "", realApi: l4, bucket: a4, region: r4, accelerate: v4, httpMethod: d3, url: "", host: "", httpDomain: "", requestPath: m3 || "", errorType: "", errorCode: "", errorName: "", errorMessage: "", errorRequestId: "", errorHttpCode: 0, errorServiceName: "", errorNode: "", httpTookTime: 0, httpSize: h3 || 0, httpMd5: 0, httpSign: 0, httpFullTime: 0, httpSpeed: 0, size: h3 || 0 }, "httpMd5", 0), s3(n4, "httpSign", 0), s3(n4, "httpFull", 0), s3(n4, "name", c3 || ""), s3(n4, "tookTime", 0), s3(n4, "md5StartTime", 0), s3(n4, "md5EndTime", 0), s3(n4, "signStartTime", 0), s3(n4, "signEndTime", 0), s3(n4, "httpStartTime", 0), s3(n4, "httpEndTime", 0), s3(n4, "startTime", (/* @__PURE__ */ new Date()).getTime()), s3(n4, "endTime", 0), s3(n4, "traceId", o3 || f2()), s3(n4, "appid", S2), s3(n4, "partNumber", 0), s3(n4, "httpRetryTimes", 0), s3(n4, "customId", y3 || ""), s3(n4, "partTime", 0), n4), b2 && (this.beacon = function(e4, t5) {
            if (!u2) {
              if ("function" != typeof e4)
                throw new Error("Beacon not found");
              u2 = new e4({ appkey: "0WEB05PY6MHRGK0U", versionCode: p3.version, channelID: "mp_sdk", openid: "openid", unionid: "unid", strictMode: false, delay: t5, sessionDuration: 6e4 });
            }
            return u2;
          }(b2, x3));
        }
        var t3, n3, a3, l3;
        return t3 = e3, n3 = [{ key: "formatResult", value: (l3 = r3(o2().mark(function e4(t4, n4) {
          var i4, a4, r4, s4, c3, l4, p4, u3, f3, h3, g3, v4, y3, x3, k2, b2, C2, S2, w2, T2, R2, B2, A2, P2, E2, O2, j2;
          return o2().wrap(function(e5) {
            for (; ; )
              switch (e5.prev = e5.next) {
                case 0:
                  return h3 = (/* @__PURE__ */ new Date()).getTime(), e5.next = 3, m2();
                case 3:
                  if (g3 = e5.sent, v4 = t4 ? (null == t4 || null === (i4 = t4.error) || void 0 === i4 || null === (a4 = i4.error) || void 0 === a4 ? void 0 : a4.Code) || "Error" : "", y3 = t4 && ((null == t4 || null === (r4 = t4.error) || void 0 === r4 || null === (s4 = r4.error) || void 0 === s4 ? void 0 : s4.Message) || (null == t4 || null === (c3 = t4.error) || void 0 === c3 ? void 0 : c3.error) || (null == t4 ? void 0 : t4.error)) || "", x3 = y3, k2 = t4 ? null == t4 || null === (l4 = t4.error) || void 0 === l4 ? void 0 : l4.statusCode : n4.statusCode, b2 = t4 ? null == t4 || null === (p4 = t4.error) || void 0 === p4 || null === (u3 = p4.error) || void 0 === u3 ? void 0 : u3.Resource : "", C2 = t4 ? (null == t4 || null === (f3 = t4.error) || void 0 === f3 ? void 0 : f3.RequestId) || "" : (null == n4 ? void 0 : n4.RequestId) || "", S2 = t4 ? C2 ? "Server" : "Client" : "", "getObject" === this.params.requestName && (this.params.httpSize = n4 ? n4.headers && n4.headers["content-length"] : 0), w2 = "sliceUploadFile" === this.params.realApi, T2 = "sliceCopyFile" === this.params.realApi, w2 || T2 ? (R2 = this.params.httpSize / 1024 / this.params.partTime, Object.assign(this.params, { httpSpeed: R2 < 0 ? 0 : R2.toFixed(3) })) : (B2 = h3 - this.params.startTime, A2 = this.params.httpEndTime - this.params.httpStartTime, P2 = this.params.httpSize / 1024 / (A2 / 1e3), E2 = this.params.md5EndTime - this.params.md5StartTime, O2 = this.params.signEndTime - this.params.signStartTime, this.parent && (this.parent.addParamValue("httpTookTime", d2(A2)), this.parent.addParamValue("httpFullTime", d2(B2)), this.parent.addParamValue("httpMd5", d2(E2)), this.parent.addParamValue("httpSign", d2(O2)), ["multipartUpload", "uploadPartCopy", "putObjectCopy"].includes(this.params.requestName) && this.parent.addParamValue("partTime", d2(A2))), Object.assign(this.params, { httpFullTime: d2(B2), httpMd5: d2(E2), httpSign: d2(O2), httpTookTime: d2(A2), httpSpeed: P2 < 0 ? 0 : P2.toFixed(3) })), Object.assign(this.params, { networkType: g3, requestResult: t4 ? "Failure" : "Success", errorType: S2, errorCode: v4, errorHttpCode: k2, errorName: x3, errorMessage: y3, errorServiceName: b2, errorRequestId: C2 }), !t4 || v4 && y3 || (this.params.fullError = t4 ? JSON.stringify(t4) : ""), "getObject" === this.params.name && (this.params.size = n4 ? n4.headers && n4.headers["content-length"] : -1), this.params.url) {
                    try {
                      j2 = /^http(s)?:\/\/(.*?)\//.exec(this.params.url), this.params.host = j2[2];
                    } catch (e6) {
                      this.params.host = this.params.url;
                    }
                    this.params.httpDomain = this.params.host;
                  }
                case 19:
                case "end":
                  return e5.stop();
              }
          }, e4, this);
        })), function(e4, t4) {
          return l3.apply(this, arguments);
        }) }, { key: "report", value: (a3 = r3(o2().mark(function e4(t4, n4) {
          var i4;
          return o2().wrap(function(e5) {
            for (; ; )
              switch (e5.prev = e5.next) {
                case 0:
                  if (this.beacon || this.clsReporter) {
                    e5.next = 2;
                    break;
                  }
                  return e5.abrupt("return");
                case 2:
                  return e5.next = 4, this.formatResult(t4, n4);
                case 4:
                  i4 = y2(this.params), this.beacon && this.sendEventsToBeacon(i4), this.clsReporter && this.sendEventsToCLS(i4);
                case 7:
                case "end":
                  return e5.stop();
              }
          }, e4, this);
        })), function(e4, t4) {
          return a3.apply(this, arguments);
        }) }, { key: "setParams", value: function(e4) {
          Object.assign(this.params, e4);
        } }, { key: "addParamValue", value: function(e4, t4) {
          this.params[e4] = (+this.params[e4] + +t4).toFixed(3);
        } }, { key: "sendEventsToBeacon", value: function(e4) {
          if ("sliceUploadFile" !== this.params.requestName && "sliceUploadFile" !== this.params.realApi || this.deepTracker) {
            var t4 = "qcloud_track_cos_sdk";
            0 === this.delay ? this.beacon && this.beacon.onDirectUserAction(t4, e4) : this.beacon && this.beacon.onUserAction(t4, e4);
          }
        } }, { key: "sendEventsToCLS", value: function(e4) {
          var t4 = !(0 !== this.delay);
          this.clsReporter.log(e4, t4);
        } }, { key: "generateSubTracker", value: function(t4) {
          return Object.assign(t4, { parent: this, deepTracker: this.deepTracker, traceId: this.params.traceId, bucket: this.params.bucket, region: this.params.region, accelerate: this.params.accelerate, fileKey: this.params.requestPath, customId: this.params.customId, delay: this.params.delay, clsReporter: this.clsReporter }), new e3(t4);
        } }], n3 && c2(t3.prototype, n3), Object.defineProperty(t3, "prototype", { writable: false }), e3;
      }();
      e2.exports = x2;
    }, function(e2) {
      e2.exports = JSON.parse('{"name":"cos-wx-sdk-v5","version":"1.8.0","description":"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)","main":"dist/cos-wx-sdk-v5.min.js","scripts":{"prettier":"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo","dev":"cross-env NODE_ENV=development node build.js --mode=development","build":"cross-env NODE_ENV=production node build.js --mode=production","sts.js":"node server/sts.js","postinstall":"patch-package"},"repository":{"type":"git","url":"http://github.com/tencentyun/cos-wx-sdk-v5.git"},"author":"carsonxu","license":"ISC","dependencies":{"fast-xml-parser":"4.5.0","mime":"^2.4.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^7.0.3","express":"^4.17.1","patch-package":"^8.0.0","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","terser-webpack-plugin":"4.2.3","webpack":"4.46.0","webpack-cli":"4.10.0"}}');
    }, function(e2, t2, n2) {
      const i3 = n2(1), o2 = { allowBooleanAttributes: false, unpairedTags: [] };
      function a2(e3) {
        return " " === e3 || "	" === e3 || "\n" === e3 || "\r" === e3;
      }
      function r3(e3, t3) {
        const n3 = t3;
        for (; t3 < e3.length; t3++)
          if ("?" != e3[t3] && " " != e3[t3])
            ;
          else {
            const i4 = e3.substr(n3, t3 - n3);
            if (t3 > 5 && "xml" === i4)
              return m2("InvalidXml", "XML declaration allowed only at the start of the document.", g2(e3, t3));
            if ("?" == e3[t3] && ">" == e3[t3 + 1]) {
              t3++;
              break;
            }
          }
        return t3;
      }
      function s3(e3, t3) {
        if (e3.length > t3 + 5 && "-" === e3[t3 + 1] && "-" === e3[t3 + 2]) {
          for (t3 += 3; t3 < e3.length; t3++)
            if ("-" === e3[t3] && "-" === e3[t3 + 1] && ">" === e3[t3 + 2]) {
              t3 += 2;
              break;
            }
        } else if (e3.length > t3 + 8 && "D" === e3[t3 + 1] && "O" === e3[t3 + 2] && "C" === e3[t3 + 3] && "T" === e3[t3 + 4] && "Y" === e3[t3 + 5] && "P" === e3[t3 + 6] && "E" === e3[t3 + 7]) {
          let n3 = 1;
          for (t3 += 8; t3 < e3.length; t3++)
            if ("<" === e3[t3])
              n3++;
            else if (">" === e3[t3] && (n3--, 0 === n3))
              break;
        } else if (e3.length > t3 + 9 && "[" === e3[t3 + 1] && "C" === e3[t3 + 2] && "D" === e3[t3 + 3] && "A" === e3[t3 + 4] && "T" === e3[t3 + 5] && "A" === e3[t3 + 6] && "[" === e3[t3 + 7]) {
          for (t3 += 8; t3 < e3.length; t3++)
            if ("]" === e3[t3] && "]" === e3[t3 + 1] && ">" === e3[t3 + 2]) {
              t3 += 2;
              break;
            }
        }
        return t3;
      }
      t2.validate = function(e3, t3) {
        t3 = Object.assign({}, o2, t3);
        const n3 = [];
        let c3 = false, l3 = false;
        "\uFEFF" === e3[0] && (e3 = e3.substr(1));
        for (let o3 = 0; o3 < e3.length; o3++)
          if ("<" === e3[o3] && "?" === e3[o3 + 1]) {
            if (o3 += 2, o3 = r3(e3, o3), o3.err)
              return o3;
          } else {
            if ("<" !== e3[o3]) {
              if (a2(e3[o3]))
                continue;
              return m2("InvalidChar", "char '" + e3[o3] + "' is not expected.", g2(e3, o3));
            }
            {
              let h3 = o3;
              if (o3++, "!" === e3[o3]) {
                o3 = s3(e3, o3);
                continue;
              }
              {
                let v4 = false;
                "/" === e3[o3] && (v4 = true, o3++);
                let y2 = "";
                for (; o3 < e3.length && ">" !== e3[o3] && " " !== e3[o3] && "	" !== e3[o3] && "\n" !== e3[o3] && "\r" !== e3[o3]; o3++)
                  y2 += e3[o3];
                if (y2 = y2.trim(), "/" === y2[y2.length - 1] && (y2 = y2.substring(0, y2.length - 1), o3--), u3 = y2, !i3.isName(u3)) {
                  let t4;
                  return t4 = 0 === y2.trim().length ? "Invalid space after '<'." : "Tag '" + y2 + "' is an invalid name.", m2("InvalidTag", t4, g2(e3, o3));
                }
                const x2 = p3(e3, o3);
                if (false === x2)
                  return m2("InvalidAttr", "Attributes for '" + y2 + "' have open quote.", g2(e3, o3));
                let k2 = x2.value;
                if (o3 = x2.index, "/" === k2[k2.length - 1]) {
                  const n4 = o3 - k2.length;
                  k2 = k2.substring(0, k2.length - 1);
                  const i4 = d2(k2, t3);
                  if (true !== i4)
                    return m2(i4.err.code, i4.err.msg, g2(e3, n4 + i4.err.line));
                  c3 = true;
                } else if (v4) {
                  if (!x2.tagClosed)
                    return m2("InvalidTag", "Closing tag '" + y2 + "' doesn't have proper closing.", g2(e3, o3));
                  if (k2.trim().length > 0)
                    return m2("InvalidTag", "Closing tag '" + y2 + "' can't have attributes or invalid starting.", g2(e3, h3));
                  if (0 === n3.length)
                    return m2("InvalidTag", "Closing tag '" + y2 + "' has not been opened.", g2(e3, h3));
                  {
                    const t4 = n3.pop();
                    if (y2 !== t4.tagName) {
                      let n4 = g2(e3, t4.tagStartPos);
                      return m2("InvalidTag", "Expected closing tag '" + t4.tagName + "' (opened in line " + n4.line + ", col " + n4.col + ") instead of closing tag '" + y2 + "'.", g2(e3, h3));
                    }
                    0 == n3.length && (l3 = true);
                  }
                } else {
                  const i4 = d2(k2, t3);
                  if (true !== i4)
                    return m2(i4.err.code, i4.err.msg, g2(e3, o3 - k2.length + i4.err.line));
                  if (true === l3)
                    return m2("InvalidXml", "Multiple possible root nodes found.", g2(e3, o3));
                  -1 !== t3.unpairedTags.indexOf(y2) || n3.push({ tagName: y2, tagStartPos: h3 }), c3 = true;
                }
                for (o3++; o3 < e3.length; o3++)
                  if ("<" === e3[o3]) {
                    if ("!" === e3[o3 + 1]) {
                      o3++, o3 = s3(e3, o3);
                      continue;
                    }
                    if ("?" !== e3[o3 + 1])
                      break;
                    if (o3 = r3(e3, ++o3), o3.err)
                      return o3;
                  } else if ("&" === e3[o3]) {
                    const t4 = f2(e3, o3);
                    if (-1 == t4)
                      return m2("InvalidChar", "char '&' is not expected.", g2(e3, o3));
                    o3 = t4;
                  } else if (true === l3 && !a2(e3[o3]))
                    return m2("InvalidXml", "Extra text at the end", g2(e3, o3));
                "<" === e3[o3] && o3--;
              }
            }
          }
        var u3;
        return c3 ? 1 == n3.length ? m2("InvalidTag", "Unclosed tag '" + n3[0].tagName + "'.", g2(e3, n3[0].tagStartPos)) : !(n3.length > 0) || m2("InvalidXml", "Invalid '" + JSON.stringify(n3.map((e4) => e4.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m2("InvalidXml", "Start tag expected.", 1);
      };
      const c2 = '"', l2 = "'";
      function p3(e3, t3) {
        let n3 = "", i4 = "", o3 = false;
        for (; t3 < e3.length; t3++) {
          if (e3[t3] === c2 || e3[t3] === l2)
            "" === i4 ? i4 = e3[t3] : i4 !== e3[t3] || (i4 = "");
          else if (">" === e3[t3] && "" === i4) {
            o3 = true;
            break;
          }
          n3 += e3[t3];
        }
        return "" === i4 && { value: n3, index: t3, tagClosed: o3 };
      }
      const u2 = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
      function d2(e3, t3) {
        const n3 = i3.getAllMatches(e3, u2), o3 = {};
        for (let e4 = 0; e4 < n3.length; e4++) {
          if (0 === n3[e4][1].length)
            return m2("InvalidAttr", "Attribute '" + n3[e4][2] + "' has no space in starting.", v3(n3[e4]));
          if (void 0 !== n3[e4][3] && void 0 === n3[e4][4])
            return m2("InvalidAttr", "Attribute '" + n3[e4][2] + "' is without value.", v3(n3[e4]));
          if (void 0 === n3[e4][3] && !t3.allowBooleanAttributes)
            return m2("InvalidAttr", "boolean attribute '" + n3[e4][2] + "' is not allowed.", v3(n3[e4]));
          const i4 = n3[e4][2];
          if (!h2(i4))
            return m2("InvalidAttr", "Attribute '" + i4 + "' is an invalid name.", v3(n3[e4]));
          if (o3.hasOwnProperty(i4))
            return m2("InvalidAttr", "Attribute '" + i4 + "' is repeated.", v3(n3[e4]));
          o3[i4] = 1;
        }
        return true;
      }
      function f2(e3, t3) {
        if (";" === e3[++t3])
          return -1;
        if ("#" === e3[t3])
          return function(e4, t4) {
            let n4 = /\d/;
            for ("x" === e4[t4] && (t4++, n4 = /[\da-fA-F]/); t4 < e4.length; t4++) {
              if (";" === e4[t4])
                return t4;
              if (!e4[t4].match(n4))
                break;
            }
            return -1;
          }(e3, ++t3);
        let n3 = 0;
        for (; t3 < e3.length; t3++, n3++)
          if (!(e3[t3].match(/\w/) && n3 < 20)) {
            if (";" === e3[t3])
              break;
            return -1;
          }
        return t3;
      }
      function m2(e3, t3, n3) {
        return { err: { code: e3, msg: t3, line: n3.line || n3, col: n3.col } };
      }
      function h2(e3) {
        return i3.isName(e3);
      }
      function g2(e3, t3) {
        const n3 = e3.substring(0, t3).split(/\r?\n/);
        return { line: n3.length, col: n3[n3.length - 1].length + 1 };
      }
      function v3(e3) {
        return e3.startIndex + e3[1].length;
      }
    }, function(e2, t2) {
      e2.exports = function(e3) {
        return "function" == typeof e3 ? e3 : Array.isArray(e3) ? (t3) => {
          for (const n2 of e3) {
            if ("string" == typeof n2 && t3 === n2)
              return true;
            if (n2 instanceof RegExp && n2.test(t3))
              return true;
          }
        } : () => false;
      };
    }, function(e2, t2) {
      var n2 = function(e3) {
        var t3 = {}, n3 = function(e4) {
          return !t3[e4] && (t3[e4] = []), t3[e4];
        };
        e3.on = function(e4, t4) {
          n3(e4).push(t4);
        }, e3.off = function(e4, t4) {
          for (var i3 = n3(e4), o2 = i3.length - 1; o2 >= 0; o2--)
            t4 === i3[o2] && i3.splice(o2, 1);
        }, e3.emit = function(e4, t4) {
          for (var i3 = n3(e4).map(function(e5) {
            return e5;
          }), o2 = 0; o2 < i3.length; o2++)
            i3[o2](t4);
        };
      };
      e2.exports.init = n2, e2.exports.EventProxy = function() {
        n2(this);
      };
    }, function(e2, t2, n2) {
      var i3, o2, a2 = n2(0), r3 = "cos_sdk_upload_cache", s3 = function() {
        try {
          i3.length ? wx$1.setStorageSync(r3, JSON.stringify(i3)) : wx$1.removeStorageSync(r3);
        } catch (e3) {
        }
      }, c2 = function() {
        if (!i3) {
          i3 = function() {
            try {
              var e4 = JSON.parse(wx$1.getStorageSync(r3));
            } catch (e5) {
            }
            return e4 || (e4 = []), e4;
          }();
          for (var e3 = false, t3 = Math.round(Date.now() / 1e3), n3 = i3.length - 1; n3 >= 0; n3--) {
            var o3 = i3[n3][2];
            (!o3 || o3 + 2592e3 < t3) && (i3.splice(n3, 1), e3 = true);
          }
          e3 && s3();
        }
      }, l2 = function() {
        o2 || (o2 = setTimeout(function() {
          s3(), o2 = null;
        }, 400));
      }, p3 = { using: {}, setUsing: function(e3) {
        p3.using[e3] = true;
      }, removeUsing: function(e3) {
        delete p3.using[e3];
      }, getFileId: function(e3, t3, n3, i4) {
        return e3.FilePath && e3.size && e3.lastModifiedTime && t3 ? a2.md5([e3.FilePath].join("::")) + "-" + a2.md5([e3.size, e3.mode, e3.lastAccessedTime, e3.lastModifiedTime, t3, n3, i4].join("::")) : null;
      }, getCopyFileId: function(e3, t3, n3, i4, o3) {
        var r4 = t3["content-length"], s4 = t3.etag || "", c3 = t3["last-modified"];
        return e3 && n3 ? a2.md5([e3, r4, s4, c3, n3, i4, o3].join("::")) : null;
      }, getUploadIdList: function(e3) {
        if (!e3)
          return null;
        c2();
        for (var t3 = [], n3 = 0; n3 < i3.length; n3++)
          i3[n3][0] === e3 && t3.push(i3[n3][1]);
        return t3.length ? t3 : null;
      }, saveUploadId: function(e3, t3, n3) {
        if (c2(), e3) {
          for (var o3 = e3.substr(0, e3.indexOf("-") + 1), a3 = i3.length - 1; a3 >= 0; a3--) {
            var r4 = i3[a3];
            (r4[0] === e3 && r4[1] === t3 || e3 !== r4[0] && 0 === r4[0].indexOf(o3)) && i3.splice(a3, 1);
          }
          i3.unshift([e3, t3, Math.round(Date.now() / 1e3)]), i3.length > n3 && i3.splice(n3), l2();
        }
      }, removeUploadId: function(e3) {
        c2(), delete p3.using[e3];
        for (var t3 = i3.length - 1; t3 >= 0; t3--)
          i3[t3][1] === e3 && i3.splice(t3, 1);
        l2();
      } };
      e2.exports = p3;
    }, function(e2, t2, n2) {
      var i3 = n2(9);
      e2.exports = i3;
    }, function(e2, t2, n2) {
      var i3 = n2(0), o2 = n2(6), a2 = n2(25), r3 = n2(26), s3 = n2(32), c2 = n2(3), l2 = { SecretId: "", SecretKey: "", SecurityToken: "", StartTime: 0, ExpiredTime: 0, ChunkRetryTimes: 2, FileParallelLimit: 3, ChunkParallelLimit: 3, ChunkSize: 1048576, SliceSize: 1048576, CopyChunkParallelLimit: 20, CopyChunkSize: 10485760, CopySliceSize: 10485760, MaxPartNumber: 1e4, ProgressInterval: 1e3, UploadQueueSize: 1e4, Domain: "", ServiceDomain: "", Protocol: "", CompatibilityMode: false, ForcePathStyle: false, Timeout: 0, CorrectClockSkew: true, SystemClockOffset: 0, UploadCheckContentMd5: false, UploadAddMetaMd5: false, UploadIdCacheLimit: 50, UseAccelerate: false, ForceSignHost: true, HttpDNSServiceId: "", SimpleUploadMethod: "postObject", AutoSwitchHost: false, CopySourceParser: null, ObjectKeySimplifyCheck: true, DeepTracker: false, TrackerDelay: 5e3, CustomId: "", BeaconReporter: null, ClsReporter: null }, p3 = function(e3) {
        if (this.options = i3.extend(i3.clone(l2), e3 || {}), this.options.FileParallelLimit = Math.max(1, this.options.FileParallelLimit), this.options.ChunkParallelLimit = Math.max(1, this.options.ChunkParallelLimit), this.options.ChunkRetryTimes = Math.max(0, this.options.ChunkRetryTimes), this.options.ChunkSize = Math.max(1048576, this.options.ChunkSize), this.options.CopyChunkParallelLimit = Math.max(1, this.options.CopyChunkParallelLimit), this.options.CopyChunkSize = Math.max(1048576, this.options.CopyChunkSize), this.options.CopySliceSize = Math.max(0, this.options.CopySliceSize), this.options.MaxPartNumber = Math.max(1024, Math.min(1e4, this.options.MaxPartNumber)), this.options.Timeout = Math.max(0, this.options.Timeout), this.options.EnableReporter = this.options.BeaconReporter || this.options.ClsReporter, this.options.AppId, this.options.SecretId && this.options.SecretId.indexOf(" "), this.options.SecretKey && this.options.SecretKey.indexOf(" "), this.options.ForcePathStyle)
          throw new Error("ForcePathStyle is not supported");
        o2.init(this), a2.init(this);
      };
      r3.init(p3, a2), s3.init(p3, a2), p3.util = { md5: i3.md5, xml2json: i3.xml2json, json2xml: i3.json2xml, encodeBase64: i3.encodeBase64 }, p3.getAuthorization = i3.getAuth, p3.version = c2.version, e2.exports = p3;
    }, function(e2, t2, n2) {
      (function(e3) {
        var t3;
        function i3(e4) {
          return i3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e5) {
            return typeof e5;
          } : function(e5) {
            return e5 && "function" == typeof Symbol && e5.constructor === Symbol && e5 !== Symbol.prototype ? "symbol" : typeof e5;
          }, i3(e4);
        }
        !function() {
          var o2 = "input is invalid type", a2 = "object" === ("undefined" == typeof window ? "undefined" : i3(window)), r3 = a2 ? window : {};
          r3.JS_MD5_NO_WINDOW && (a2 = false), !a2 && "object" === ("undefined" == typeof self ? "undefined" : i3(self)) && (r3 = self);
          var s3, c2 = !r3.JS_MD5_NO_COMMON_JS && "object" === i3(e3) && e3.exports, l2 = n2(12), p3 = !r3.JS_MD5_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer, u2 = "0123456789abcdef".split(""), d2 = [128, 32768, 8388608, -2147483648], f2 = [0, 8, 16, 24], m2 = ["hex", "array", "digest", "buffer", "arrayBuffer", "base64"], h2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), g2 = [];
          if (p3) {
            var v3 = new ArrayBuffer(68);
            s3 = new Uint8Array(v3), g2 = new Uint32Array(v3);
          }
          !r3.JS_MD5_NO_NODE_JS && Array.isArray || (Array.isArray = function(e4) {
            return "[object Array]" === Object.prototype.toString.call(e4);
          }), !p3 || !r3.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function(e4) {
            return "object" === i3(e4) && e4.buffer && e4.buffer.constructor === ArrayBuffer;
          });
          var y2 = function(e4) {
            return function(t4) {
              return new x2(true).update(t4)[e4]();
            };
          };
          function x2(e4) {
            if (e4)
              g2[0] = g2[16] = g2[1] = g2[2] = g2[3] = g2[4] = g2[5] = g2[6] = g2[7] = g2[8] = g2[9] = g2[10] = g2[11] = g2[12] = g2[13] = g2[14] = g2[15] = 0, this.blocks = g2, this.buffer8 = s3;
            else if (p3) {
              var t4 = new ArrayBuffer(68);
              this.buffer8 = new Uint8Array(t4), this.blocks = new Uint32Array(t4);
            } else
              this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
            this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = false, this.first = true;
          }
          x2.prototype.update = function(e4) {
            if (!this.finalized) {
              var t4, n3 = i3(e4);
              if ("string" !== n3) {
                if ("object" !== n3)
                  throw o2;
                if (null === e4)
                  throw o2;
                if (!p3 || e4.constructor !== ArrayBuffer && "ArrayBuffer" !== e4.constructor.name) {
                  if (!(Array.isArray(e4) || p3 && ArrayBuffer.isView(e4)))
                    throw o2;
                } else
                  e4 = new Uint8Array(e4);
                t4 = true;
              }
              for (var a3, r4, s4 = 0, c3 = e4.length, l3 = this.blocks, u3 = this.buffer8; s4 < c3; ) {
                if (this.hashed && (this.hashed = false, l3[0] = l3[16], l3[16] = l3[1] = l3[2] = l3[3] = l3[4] = l3[5] = l3[6] = l3[7] = l3[8] = l3[9] = l3[10] = l3[11] = l3[12] = l3[13] = l3[14] = l3[15] = 0), t4)
                  if (p3)
                    for (r4 = this.start; s4 < c3 && r4 < 64; ++s4)
                      u3[r4++] = e4[s4];
                  else
                    for (r4 = this.start; s4 < c3 && r4 < 64; ++s4)
                      l3[r4 >> 2] |= e4[s4] << f2[3 & r4++];
                else if (p3)
                  for (r4 = this.start; s4 < c3 && r4 < 64; ++s4)
                    (a3 = e4.charCodeAt(s4)) < 128 ? u3[r4++] = a3 : a3 < 2048 ? (u3[r4++] = 192 | a3 >> 6, u3[r4++] = 128 | 63 & a3) : a3 < 55296 || a3 >= 57344 ? (u3[r4++] = 224 | a3 >> 12, u3[r4++] = 128 | a3 >> 6 & 63, u3[r4++] = 128 | 63 & a3) : (a3 = 65536 + ((1023 & a3) << 10 | 1023 & e4.charCodeAt(++s4)), u3[r4++] = 240 | a3 >> 18, u3[r4++] = 128 | a3 >> 12 & 63, u3[r4++] = 128 | a3 >> 6 & 63, u3[r4++] = 128 | 63 & a3);
                else
                  for (r4 = this.start; s4 < c3 && r4 < 64; ++s4)
                    (a3 = e4.charCodeAt(s4)) < 128 ? l3[r4 >> 2] |= a3 << f2[3 & r4++] : a3 < 2048 ? (l3[r4 >> 2] |= (192 | a3 >> 6) << f2[3 & r4++], l3[r4 >> 2] |= (128 | 63 & a3) << f2[3 & r4++]) : a3 < 55296 || a3 >= 57344 ? (l3[r4 >> 2] |= (224 | a3 >> 12) << f2[3 & r4++], l3[r4 >> 2] |= (128 | a3 >> 6 & 63) << f2[3 & r4++], l3[r4 >> 2] |= (128 | 63 & a3) << f2[3 & r4++]) : (a3 = 65536 + ((1023 & a3) << 10 | 1023 & e4.charCodeAt(++s4)), l3[r4 >> 2] |= (240 | a3 >> 18) << f2[3 & r4++], l3[r4 >> 2] |= (128 | a3 >> 12 & 63) << f2[3 & r4++], l3[r4 >> 2] |= (128 | a3 >> 6 & 63) << f2[3 & r4++], l3[r4 >> 2] |= (128 | 63 & a3) << f2[3 & r4++]);
                this.lastByteIndex = r4, this.bytes += r4 - this.start, r4 >= 64 ? (this.start = r4 - 64, this.hash(), this.hashed = true) : this.start = r4;
              }
              return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
            }
          }, x2.prototype.finalize = function() {
            if (!this.finalized) {
              this.finalized = true;
              var e4 = this.blocks, t4 = this.lastByteIndex;
              e4[t4 >> 2] |= d2[3 & t4], t4 >= 56 && (this.hashed || this.hash(), e4[0] = e4[16], e4[16] = e4[1] = e4[2] = e4[3] = e4[4] = e4[5] = e4[6] = e4[7] = e4[8] = e4[9] = e4[10] = e4[11] = e4[12] = e4[13] = e4[14] = e4[15] = 0), e4[14] = this.bytes << 3, e4[15] = this.hBytes << 3 | this.bytes >>> 29, this.hash();
            }
          }, x2.prototype.hash = function() {
            var e4, t4, n3, i4, o3, a3, r4 = this.blocks;
            this.first ? t4 = ((t4 = ((e4 = ((e4 = r4[0] - 680876937) << 7 | e4 >>> 25) - 271733879 << 0) ^ (n3 = ((n3 = (-271733879 ^ (i4 = ((i4 = (-1732584194 ^ 2004318071 & e4) + r4[1] - 117830708) << 12 | i4 >>> 20) + e4 << 0) & (-271733879 ^ e4)) + r4[2] - 1126478375) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e4)) + r4[3] - 1316259209) << 22 | t4 >>> 10) + n3 << 0 : (e4 = this.h0, t4 = this.h1, n3 = this.h2, t4 = ((t4 += ((e4 = ((e4 += ((i4 = this.h3) ^ t4 & (n3 ^ i4)) + r4[0] - 680876936) << 7 | e4 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e4 & (t4 ^ n3)) + r4[1] - 389564586) << 12 | i4 >>> 20) + e4 << 0) & (e4 ^ t4)) + r4[2] + 606105819) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e4)) + r4[3] - 1044525330) << 22 | t4 >>> 10) + n3 << 0), t4 = ((t4 += ((e4 = ((e4 += (i4 ^ t4 & (n3 ^ i4)) + r4[4] - 176418897) << 7 | e4 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e4 & (t4 ^ n3)) + r4[5] + 1200080426) << 12 | i4 >>> 20) + e4 << 0) & (e4 ^ t4)) + r4[6] - 1473231341) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e4)) + r4[7] - 45705983) << 22 | t4 >>> 10) + n3 << 0, t4 = ((t4 += ((e4 = ((e4 += (i4 ^ t4 & (n3 ^ i4)) + r4[8] + 1770035416) << 7 | e4 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e4 & (t4 ^ n3)) + r4[9] - 1958414417) << 12 | i4 >>> 20) + e4 << 0) & (e4 ^ t4)) + r4[10] - 42063) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e4)) + r4[11] - 1990404162) << 22 | t4 >>> 10) + n3 << 0, t4 = ((t4 += ((e4 = ((e4 += (i4 ^ t4 & (n3 ^ i4)) + r4[12] + 1804603682) << 7 | e4 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e4 & (t4 ^ n3)) + r4[13] - 40341101) << 12 | i4 >>> 20) + e4 << 0) & (e4 ^ t4)) + r4[14] - 1502002290) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e4)) + r4[15] + 1236535329) << 22 | t4 >>> 10) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e4 = ((e4 += (n3 ^ i4 & (t4 ^ n3)) + r4[1] - 165796510) << 5 | e4 >>> 27) + t4 << 0) ^ t4)) + r4[6] - 1069501632) << 9 | i4 >>> 23) + e4 << 0) ^ e4 & ((n3 = ((n3 += (e4 ^ t4 & (i4 ^ e4)) + r4[11] + 643717713) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r4[0] - 373897302) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e4 = ((e4 += (n3 ^ i4 & (t4 ^ n3)) + r4[5] - 701558691) << 5 | e4 >>> 27) + t4 << 0) ^ t4)) + r4[10] + 38016083) << 9 | i4 >>> 23) + e4 << 0) ^ e4 & ((n3 = ((n3 += (e4 ^ t4 & (i4 ^ e4)) + r4[15] - 660478335) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r4[4] - 405537848) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e4 = ((e4 += (n3 ^ i4 & (t4 ^ n3)) + r4[9] + 568446438) << 5 | e4 >>> 27) + t4 << 0) ^ t4)) + r4[14] - 1019803690) << 9 | i4 >>> 23) + e4 << 0) ^ e4 & ((n3 = ((n3 += (e4 ^ t4 & (i4 ^ e4)) + r4[3] - 187363961) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r4[8] + 1163531501) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e4 = ((e4 += (n3 ^ i4 & (t4 ^ n3)) + r4[13] - 1444681467) << 5 | e4 >>> 27) + t4 << 0) ^ t4)) + r4[2] - 51403784) << 9 | i4 >>> 23) + e4 << 0) ^ e4 & ((n3 = ((n3 += (e4 ^ t4 & (i4 ^ e4)) + r4[7] + 1735328473) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r4[12] - 1926607734) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((a3 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e4 = ((e4 += (o3 ^ i4) + r4[5] - 378558) << 4 | e4 >>> 28) + t4 << 0)) + r4[8] - 2022574463) << 11 | i4 >>> 21) + e4 << 0) ^ e4) ^ (n3 = ((n3 += (a3 ^ t4) + r4[11] + 1839030562) << 16 | n3 >>> 16) + i4 << 0)) + r4[14] - 35309556) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((a3 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e4 = ((e4 += (o3 ^ i4) + r4[1] - 1530992060) << 4 | e4 >>> 28) + t4 << 0)) + r4[4] + 1272893353) << 11 | i4 >>> 21) + e4 << 0) ^ e4) ^ (n3 = ((n3 += (a3 ^ t4) + r4[7] - 155497632) << 16 | n3 >>> 16) + i4 << 0)) + r4[10] - 1094730640) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((a3 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e4 = ((e4 += (o3 ^ i4) + r4[13] + 681279174) << 4 | e4 >>> 28) + t4 << 0)) + r4[0] - 358537222) << 11 | i4 >>> 21) + e4 << 0) ^ e4) ^ (n3 = ((n3 += (a3 ^ t4) + r4[3] - 722521979) << 16 | n3 >>> 16) + i4 << 0)) + r4[6] + 76029189) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((a3 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e4 = ((e4 += (o3 ^ i4) + r4[9] - 640364487) << 4 | e4 >>> 28) + t4 << 0)) + r4[12] - 421815835) << 11 | i4 >>> 21) + e4 << 0) ^ e4) ^ (n3 = ((n3 += (a3 ^ t4) + r4[15] + 530742520) << 16 | n3 >>> 16) + i4 << 0)) + r4[2] - 995338651) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e4 = ((e4 += (n3 ^ (t4 | ~i4)) + r4[0] - 198630844) << 6 | e4 >>> 26) + t4 << 0) | ~n3)) + r4[7] + 1126891415) << 10 | i4 >>> 22) + e4 << 0) ^ ((n3 = ((n3 += (e4 ^ (i4 | ~t4)) + r4[14] - 1416354905) << 15 | n3 >>> 17) + i4 << 0) | ~e4)) + r4[5] - 57434055) << 21 | t4 >>> 11) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e4 = ((e4 += (n3 ^ (t4 | ~i4)) + r4[12] + 1700485571) << 6 | e4 >>> 26) + t4 << 0) | ~n3)) + r4[3] - 1894986606) << 10 | i4 >>> 22) + e4 << 0) ^ ((n3 = ((n3 += (e4 ^ (i4 | ~t4)) + r4[10] - 1051523) << 15 | n3 >>> 17) + i4 << 0) | ~e4)) + r4[1] - 2054922799) << 21 | t4 >>> 11) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e4 = ((e4 += (n3 ^ (t4 | ~i4)) + r4[8] + 1873313359) << 6 | e4 >>> 26) + t4 << 0) | ~n3)) + r4[15] - 30611744) << 10 | i4 >>> 22) + e4 << 0) ^ ((n3 = ((n3 += (e4 ^ (i4 | ~t4)) + r4[6] - 1560198380) << 15 | n3 >>> 17) + i4 << 0) | ~e4)) + r4[13] + 1309151649) << 21 | t4 >>> 11) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e4 = ((e4 += (n3 ^ (t4 | ~i4)) + r4[4] - 145523070) << 6 | e4 >>> 26) + t4 << 0) | ~n3)) + r4[11] - 1120210379) << 10 | i4 >>> 22) + e4 << 0) ^ ((n3 = ((n3 += (e4 ^ (i4 | ~t4)) + r4[2] + 718787259) << 15 | n3 >>> 17) + i4 << 0) | ~e4)) + r4[9] - 343485551) << 21 | t4 >>> 11) + n3 << 0, this.first ? (this.h0 = e4 + 1732584193 << 0, this.h1 = t4 - 271733879 << 0, this.h2 = n3 - 1732584194 << 0, this.h3 = i4 + 271733878 << 0, this.first = false) : (this.h0 = this.h0 + e4 << 0, this.h1 = this.h1 + t4 << 0, this.h2 = this.h2 + n3 << 0, this.h3 = this.h3 + i4 << 0);
          }, x2.prototype.hex = function() {
            this.finalize();
            var e4 = this.h0, t4 = this.h1, n3 = this.h2, i4 = this.h3;
            return u2[e4 >> 4 & 15] + u2[15 & e4] + u2[e4 >> 12 & 15] + u2[e4 >> 8 & 15] + u2[e4 >> 20 & 15] + u2[e4 >> 16 & 15] + u2[e4 >> 28 & 15] + u2[e4 >> 24 & 15] + u2[t4 >> 4 & 15] + u2[15 & t4] + u2[t4 >> 12 & 15] + u2[t4 >> 8 & 15] + u2[t4 >> 20 & 15] + u2[t4 >> 16 & 15] + u2[t4 >> 28 & 15] + u2[t4 >> 24 & 15] + u2[n3 >> 4 & 15] + u2[15 & n3] + u2[n3 >> 12 & 15] + u2[n3 >> 8 & 15] + u2[n3 >> 20 & 15] + u2[n3 >> 16 & 15] + u2[n3 >> 28 & 15] + u2[n3 >> 24 & 15] + u2[i4 >> 4 & 15] + u2[15 & i4] + u2[i4 >> 12 & 15] + u2[i4 >> 8 & 15] + u2[i4 >> 20 & 15] + u2[i4 >> 16 & 15] + u2[i4 >> 28 & 15] + u2[i4 >> 24 & 15];
          }, x2.prototype.toString = x2.prototype.hex, x2.prototype.digest = function() {
            this.finalize();
            var e4 = this.h0, t4 = this.h1, n3 = this.h2, i4 = this.h3;
            return [255 & e4, e4 >> 8 & 255, e4 >> 16 & 255, e4 >> 24 & 255, 255 & t4, t4 >> 8 & 255, t4 >> 16 & 255, t4 >> 24 & 255, 255 & n3, n3 >> 8 & 255, n3 >> 16 & 255, n3 >> 24 & 255, 255 & i4, i4 >> 8 & 255, i4 >> 16 & 255, i4 >> 24 & 255];
          }, x2.prototype.array = x2.prototype.digest, x2.prototype.arrayBuffer = function() {
            this.finalize();
            var e4 = new ArrayBuffer(16), t4 = new Uint32Array(e4);
            return t4[0] = this.h0, t4[1] = this.h1, t4[2] = this.h2, t4[3] = this.h3, e4;
          }, x2.prototype.buffer = x2.prototype.arrayBuffer, x2.prototype.base64 = function() {
            for (var e4, t4, n3, i4 = "", o3 = this.array(), a3 = 0; a3 < 15; )
              e4 = o3[a3++], t4 = o3[a3++], n3 = o3[a3++], i4 += h2[e4 >>> 2] + h2[63 & (e4 << 4 | t4 >>> 4)] + h2[63 & (t4 << 2 | n3 >>> 6)] + h2[63 & n3];
            return e4 = o3[a3], i4 += h2[e4 >>> 2] + h2[e4 << 4 & 63] + "==";
          };
          var k2 = function() {
            var e4 = y2("hex");
            e4.getCtx = e4.create = function() {
              return new x2();
            }, e4.update = function(t5) {
              return e4.create().update(t5);
            };
            for (var t4 = 0; t4 < m2.length; ++t4) {
              var n3 = m2[t4];
              e4[n3] = y2(n3);
            }
            return e4;
          }();
          c2 ? e3.exports = k2 : (r3.md5 = k2, l2 && (void 0 === (t3 = (function() {
            return k2;
          }).call(k2, n2, k2, e3)) || (e3.exports = t3)));
        }();
      }).call(this, n2(11)(e2));
    }, function(e2, t2) {
      e2.exports = function(e3) {
        return e3.webpackPolyfill || (e3.deprecate = function() {
        }, e3.paths = [], e3.children || (e3.children = []), Object.defineProperty(e3, "loaded", { enumerable: true, get: function() {
          return e3.l;
        } }), Object.defineProperty(e3, "id", { enumerable: true, get: function() {
          return e3.i;
        } }), e3.webpackPolyfill = 1), e3;
      };
    }, function(e2, t2) {
      (function(t3) {
        e2.exports = t3;
      }).call(this, {});
    }, function(e2, t2) {
      var n2, i3, o2, a2, r3, s3, c2, l2 = l2 || function(e3, t3) {
        var n3 = {}, i4 = n3.lib = {}, o3 = function() {
        }, a3 = i4.Base = { extend: function(e4) {
          o3.prototype = this;
          var t4 = new o3();
          return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") || (t4.init = function() {
            t4.$super.init.apply(this, arguments);
          }), t4.init.prototype = t4, t4.$super = this, t4;
        }, create: function() {
          var e4 = this.extend();
          return e4.init.apply(e4, arguments), e4;
        }, init: function() {
        }, mixIn: function(e4) {
          for (var t4 in e4)
            e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
          e4.hasOwnProperty("toString") && (this.toString = e4.toString);
        }, clone: function() {
          return this.init.prototype.extend(this);
        } }, r4 = i4.WordArray = a3.extend({ init: function(e4, t4) {
          e4 = this.words = e4 || [], this.sigBytes = null != t4 ? t4 : 4 * e4.length;
        }, toString: function(e4) {
          return (e4 || c3).stringify(this);
        }, concat: function(e4) {
          var t4 = this.words, n4 = e4.words, i5 = this.sigBytes;
          if (e4 = e4.sigBytes, this.clamp(), i5 % 4)
            for (var o4 = 0; o4 < e4; o4++)
              t4[i5 + o4 >>> 2] |= (n4[o4 >>> 2] >>> 24 - o4 % 4 * 8 & 255) << 24 - (i5 + o4) % 4 * 8;
          else if (65535 < n4.length)
            for (o4 = 0; o4 < e4; o4 += 4)
              t4[i5 + o4 >>> 2] = n4[o4 >>> 2];
          else
            t4.push.apply(t4, n4);
          return this.sigBytes += e4, this;
        }, clamp: function() {
          var t4 = this.words, n4 = this.sigBytes;
          t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
        }, clone: function() {
          var e4 = a3.clone.call(this);
          return e4.words = this.words.slice(0), e4;
        }, random: function(t4) {
          for (var n4 = [], i5 = 0; i5 < t4; i5 += 4)
            n4.push(4294967296 * e3.random() | 0);
          return new r4.init(n4, t4);
        } }), s4 = n3.enc = {}, c3 = s4.Hex = { stringify: function(e4) {
          var t4 = e4.words;
          e4 = e4.sigBytes;
          for (var n4 = [], i5 = 0; i5 < e4; i5++) {
            var o4 = t4[i5 >>> 2] >>> 24 - i5 % 4 * 8 & 255;
            n4.push((o4 >>> 4).toString(16)), n4.push((15 & o4).toString(16));
          }
          return n4.join("");
        }, parse: function(e4) {
          for (var t4 = e4.length, n4 = [], i5 = 0; i5 < t4; i5 += 2)
            n4[i5 >>> 3] |= parseInt(e4.substr(i5, 2), 16) << 24 - i5 % 8 * 4;
          return new r4.init(n4, t4 / 2);
        } }, l3 = s4.Latin1 = { stringify: function(e4) {
          var t4 = e4.words;
          e4 = e4.sigBytes;
          for (var n4 = [], i5 = 0; i5 < e4; i5++)
            n4.push(String.fromCharCode(t4[i5 >>> 2] >>> 24 - i5 % 4 * 8 & 255));
          return n4.join("");
        }, parse: function(e4) {
          for (var t4 = e4.length, n4 = [], i5 = 0; i5 < t4; i5++)
            n4[i5 >>> 2] |= (255 & e4.charCodeAt(i5)) << 24 - i5 % 4 * 8;
          return new r4.init(n4, t4);
        } }, p3 = s4.Utf8 = { stringify: function(e4) {
          try {
            return decodeURIComponent(escape(l3.stringify(e4)));
          } catch (e5) {
            throw Error("Malformed UTF-8 data");
          }
        }, parse: function(e4) {
          return l3.parse(unescape(encodeURIComponent(e4)));
        } }, u2 = i4.BufferedBlockAlgorithm = a3.extend({ reset: function() {
          this._data = new r4.init(), this._nDataBytes = 0;
        }, _append: function(e4) {
          "string" == typeof e4 && (e4 = p3.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
        }, _process: function(t4) {
          var n4 = this._data, i5 = n4.words, o4 = n4.sigBytes, a4 = this.blockSize, s5 = o4 / (4 * a4);
          if (t4 = (s5 = t4 ? e3.ceil(s5) : e3.max((0 | s5) - this._minBufferSize, 0)) * a4, o4 = e3.min(4 * t4, o4), t4) {
            for (var c4 = 0; c4 < t4; c4 += a4)
              this._doProcessBlock(i5, c4);
            c4 = i5.splice(0, t4), n4.sigBytes -= o4;
          }
          return new r4.init(c4, o4);
        }, clone: function() {
          var e4 = a3.clone.call(this);
          return e4._data = this._data.clone(), e4;
        }, _minBufferSize: 0 });
        i4.Hasher = u2.extend({ cfg: a3.extend(), init: function(e4) {
          this.cfg = this.cfg.extend(e4), this.reset();
        }, reset: function() {
          u2.reset.call(this), this._doReset();
        }, update: function(e4) {
          return this._append(e4), this._process(), this;
        }, finalize: function(e4) {
          return e4 && this._append(e4), this._doFinalize();
        }, blockSize: 16, _createHelper: function(e4) {
          return function(t4, n4) {
            return new e4.init(n4).finalize(t4);
          };
        }, _createHmacHelper: function(e4) {
          return function(t4, n4) {
            return new d2.HMAC.init(e4, n4).finalize(t4);
          };
        } });
        var d2 = n3.algo = {};
        return n3;
      }(Math);
      i3 = (r3 = (n2 = l2).lib).WordArray, o2 = r3.Hasher, a2 = [], r3 = n2.algo.SHA1 = o2.extend({ _doReset: function() {
        this._hash = new i3.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
      }, _doProcessBlock: function(e3, t3) {
        for (var n3 = this._hash.words, i4 = n3[0], o3 = n3[1], r4 = n3[2], s4 = n3[3], c3 = n3[4], l3 = 0; 80 > l3; l3++) {
          if (16 > l3)
            a2[l3] = 0 | e3[t3 + l3];
          else {
            var p3 = a2[l3 - 3] ^ a2[l3 - 8] ^ a2[l3 - 14] ^ a2[l3 - 16];
            a2[l3] = p3 << 1 | p3 >>> 31;
          }
          p3 = (i4 << 5 | i4 >>> 27) + c3 + a2[l3], p3 = 20 > l3 ? p3 + (1518500249 + (o3 & r4 | ~o3 & s4)) : 40 > l3 ? p3 + (1859775393 + (o3 ^ r4 ^ s4)) : 60 > l3 ? p3 + ((o3 & r4 | o3 & s4 | r4 & s4) - 1894007588) : p3 + ((o3 ^ r4 ^ s4) - 899497514), c3 = s4, s4 = r4, r4 = o3 << 30 | o3 >>> 2, o3 = i4, i4 = p3;
        }
        n3[0] = n3[0] + i4 | 0, n3[1] = n3[1] + o3 | 0, n3[2] = n3[2] + r4 | 0, n3[3] = n3[3] + s4 | 0, n3[4] = n3[4] + c3 | 0;
      }, _doFinalize: function() {
        var e3 = this._data, t3 = e3.words, n3 = 8 * this._nDataBytes, i4 = 8 * e3.sigBytes;
        return t3[i4 >>> 5] |= 128 << 24 - i4 % 32, t3[14 + (i4 + 64 >>> 9 << 4)] = Math.floor(n3 / 4294967296), t3[15 + (i4 + 64 >>> 9 << 4)] = n3, e3.sigBytes = 4 * t3.length, this._process(), this._hash;
      }, clone: function() {
        var e3 = o2.clone.call(this);
        return e3._hash = this._hash.clone(), e3;
      } }), n2.SHA1 = o2._createHelper(r3), n2.HmacSHA1 = o2._createHmacHelper(r3), function() {
        var e3 = l2, t3 = e3.enc.Utf8;
        e3.algo.HMAC = e3.lib.Base.extend({ init: function(e4, n3) {
          e4 = this._hasher = new e4.init(), "string" == typeof n3 && (n3 = t3.parse(n3));
          var i4 = e4.blockSize, o3 = 4 * i4;
          n3.sigBytes > o3 && (n3 = e4.finalize(n3)), n3.clamp();
          for (var a3 = this._oKey = n3.clone(), r4 = this._iKey = n3.clone(), s4 = a3.words, c3 = r4.words, l3 = 0; l3 < i4; l3++)
            s4[l3] ^= 1549556828, c3[l3] ^= 909522486;
          a3.sigBytes = r4.sigBytes = o3, this.reset();
        }, reset: function() {
          var e4 = this._hasher;
          e4.reset(), e4.update(this._iKey);
        }, update: function(e4) {
          return this._hasher.update(e4), this;
        }, finalize: function(e4) {
          var t4 = this._hasher;
          return e4 = t4.finalize(e4), t4.reset(), t4.finalize(this._oKey.clone().concat(e4));
        } });
      }(), c2 = (s3 = l2).lib.WordArray, s3.enc.Base64 = { stringify: function(e3) {
        var t3 = e3.words, n3 = e3.sigBytes, i4 = this._map;
        e3.clamp();
        for (var o3 = [], a3 = 0; a3 < n3; a3 += 3)
          for (var r4 = (t3[a3 >>> 2] >>> 24 - a3 % 4 * 8 & 255) << 16 | (t3[a3 + 1 >>> 2] >>> 24 - (a3 + 1) % 4 * 8 & 255) << 8 | t3[a3 + 2 >>> 2] >>> 24 - (a3 + 2) % 4 * 8 & 255, s4 = 0; s4 < 4 && a3 + 0.75 * s4 < n3; s4++)
            o3.push(i4.charAt(r4 >>> 6 * (3 - s4) & 63));
        var c3 = i4.charAt(64);
        if (c3)
          for (; o3.length % 4; )
            o3.push(c3);
        return o3.join("");
      }, parse: function(e3) {
        var t3 = e3.length, n3 = this._map, i4 = n3.charAt(64);
        if (i4) {
          var o3 = e3.indexOf(i4);
          -1 != o3 && (t3 = o3);
        }
        for (var a3 = [], r4 = 0, s4 = 0; s4 < t3; s4++)
          if (s4 % 4) {
            var l3 = n3.indexOf(e3.charAt(s4 - 1)) << s4 % 4 * 2, p3 = n3.indexOf(e3.charAt(s4)) >>> 6 - s4 % 4 * 2;
            a3[r4 >>> 2] |= (l3 | p3) << 24 - r4 % 4 * 8, r4++;
          }
        return c2.create(a3, r4);
      }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" }, e2.exports = l2;
    }, function(e2, t2) {
      var n2 = function(e3) {
        var t3 = (e3 = e3 || {}).Base64, n3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i3 = function(e4) {
          for (var t4 = {}, n4 = 0, i4 = e4.length; n4 < i4; n4++)
            t4[e4.charAt(n4)] = n4;
          return t4;
        }(n3), o2 = String.fromCharCode, a2 = function(e4) {
          if (e4.length < 2)
            return (t4 = e4.charCodeAt(0)) < 128 ? e4 : t4 < 2048 ? o2(192 | t4 >>> 6) + o2(128 | 63 & t4) : o2(224 | t4 >>> 12 & 15) + o2(128 | t4 >>> 6 & 63) + o2(128 | 63 & t4);
          var t4 = 65536 + 1024 * (e4.charCodeAt(0) - 55296) + (e4.charCodeAt(1) - 56320);
          return o2(240 | t4 >>> 18 & 7) + o2(128 | t4 >>> 12 & 63) + o2(128 | t4 >>> 6 & 63) + o2(128 | 63 & t4);
        }, r3 = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, s3 = function(e4) {
          return e4.replace(r3, a2);
        }, c2 = function(e4) {
          var t4 = [0, 2, 1][e4.length % 3], i4 = e4.charCodeAt(0) << 16 | (e4.length > 1 ? e4.charCodeAt(1) : 0) << 8 | (e4.length > 2 ? e4.charCodeAt(2) : 0);
          return [n3.charAt(i4 >>> 18), n3.charAt(i4 >>> 12 & 63), t4 >= 2 ? "=" : n3.charAt(i4 >>> 6 & 63), t4 >= 1 ? "=" : n3.charAt(63 & i4)].join("");
        }, l2 = e3.btoa ? function(t4) {
          return e3.btoa(t4);
        } : function(e4) {
          return e4.replace(/[\s\S]{1,3}/g, c2);
        }, p3 = function(e4) {
          return l2(s3(e4));
        }, u2 = function(e4, t4) {
          return t4 ? p3(String(e4)).replace(/[+\/]/g, function(e5) {
            return "+" == e5 ? "-" : "_";
          }).replace(/=/g, "") : p3(String(e4));
        }, d2 = new RegExp(["[À-ß][-¿]", "[à-ï][-¿]{2}", "[ð-÷][-¿]{3}"].join("|"), "g"), f2 = function(e4) {
          switch (e4.length) {
            case 4:
              var t4 = ((7 & e4.charCodeAt(0)) << 18 | (63 & e4.charCodeAt(1)) << 12 | (63 & e4.charCodeAt(2)) << 6 | 63 & e4.charCodeAt(3)) - 65536;
              return o2(55296 + (t4 >>> 10)) + o2(56320 + (1023 & t4));
            case 3:
              return o2((15 & e4.charCodeAt(0)) << 12 | (63 & e4.charCodeAt(1)) << 6 | 63 & e4.charCodeAt(2));
            default:
              return o2((31 & e4.charCodeAt(0)) << 6 | 63 & e4.charCodeAt(1));
          }
        }, m2 = function(e4) {
          return e4.replace(d2, f2);
        }, h2 = function(e4) {
          var t4 = e4.length, n4 = t4 % 4, a3 = (t4 > 0 ? i3[e4.charAt(0)] << 18 : 0) | (t4 > 1 ? i3[e4.charAt(1)] << 12 : 0) | (t4 > 2 ? i3[e4.charAt(2)] << 6 : 0) | (t4 > 3 ? i3[e4.charAt(3)] : 0), r4 = [o2(a3 >>> 16), o2(a3 >>> 8 & 255), o2(255 & a3)];
          return r4.length -= [0, 0, 2, 1][n4], r4.join("");
        }, g2 = e3.atob ? function(t4) {
          return e3.atob(t4);
        } : function(e4) {
          return e4.replace(/[\s\S]{1,4}/g, h2);
        }, v3 = function(e4) {
          return m2(g2(e4));
        }, y2 = function(e4) {
          return v3(String(e4).replace(/[-_]/g, function(e5) {
            return "-" == e5 ? "+" : "/";
          }).replace(/[^A-Za-z0-9\+\/]/g, ""));
        };
        return { VERSION: "2.1.9", atob: g2, btoa: l2, fromBase64: y2, toBase64: u2, utob: s3, encode: u2, encodeURI: function(e4) {
          return u2(e4, true);
        }, btou: m2, decode: y2, noConflict: function() {
          var n4 = e3.Base64;
          return e3.Base64 = t3, n4;
        } };
      }();
      e2.exports = n2;
    }, function(e2, t2, n2) {
      const i3 = n2(4), o2 = n2(16), a2 = n2(23);
      e2.exports = { XMLParser: o2, XMLValidator: i3, XMLBuilder: a2 };
    }, function(e2, t2, n2) {
      const { buildOptions: i3 } = n2(17), o2 = n2(18), { prettify: a2 } = n2(22), r3 = n2(4);
      e2.exports = class {
        constructor(e3) {
          this.externalEntities = {}, this.options = i3(e3);
        }
        parse(e3, t3) {
          if ("string" == typeof e3)
            ;
          else {
            if (!e3.toString)
              throw new Error("XML data is accepted in String or Bytes[] form.");
            e3 = e3.toString();
          }
          if (t3) {
            true === t3 && (t3 = {});
            const n4 = r3.validate(e3, t3);
            if (true !== n4)
              throw Error(`${n4.err.msg}:${n4.err.line}:${n4.err.col}`);
          }
          const n3 = new o2(this.options);
          n3.addExternalEntities(this.externalEntities);
          const i4 = n3.parseXml(e3);
          return this.options.preserveOrder || void 0 === i4 ? i4 : a2(i4, this.options);
        }
        addEntity(e3, t3) {
          if (-1 !== t3.indexOf("&"))
            throw new Error("Entity value can't have '&'");
          if (-1 !== e3.indexOf("&") || -1 !== e3.indexOf(";"))
            throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
          if ("&" === t3)
            throw new Error("An entity with value '&' is not permitted");
          this.externalEntities[e3] = t3;
        }
      };
    }, function(e2, t2) {
      const n2 = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(e3, t3) {
        return t3;
      }, attributeValueProcessor: function(e3, t3) {
        return t3;
      }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(e3, t3, n3) {
        return e3;
      } };
      t2.buildOptions = function(e3) {
        return Object.assign({}, n2, e3);
      }, t2.defaultOptions = n2;
    }, function(e2, t2, n2) {
      const i3 = n2(1), o2 = n2(19), a2 = n2(20), r3 = n2(21), s3 = n2(5);
      function c2(e3) {
        const t3 = Object.keys(e3);
        for (let n3 = 0; n3 < t3.length; n3++) {
          const i4 = t3[n3];
          this.lastEntities[i4] = { regex: new RegExp("&" + i4 + ";", "g"), val: e3[i4] };
        }
      }
      function l2(e3, t3, n3, i4, o3, a3, r4) {
        if (void 0 !== e3 && (this.options.trimValues && !i4 && (e3 = e3.trim()), e3.length > 0)) {
          r4 || (e3 = this.replaceEntitiesValue(e3));
          const i5 = this.options.tagValueProcessor(t3, e3, n3, o3, a3);
          if (null == i5)
            return e3;
          if (typeof i5 != typeof e3 || i5 !== e3)
            return i5;
          if (this.options.trimValues)
            return b2(e3, this.options.parseTagValue, this.options.numberParseOptions);
          return e3.trim() === e3 ? b2(e3, this.options.parseTagValue, this.options.numberParseOptions) : e3;
        }
      }
      function p3(e3) {
        if (this.options.removeNSPrefix) {
          const t3 = e3.split(":"), n3 = "/" === e3.charAt(0) ? "/" : "";
          if ("xmlns" === t3[0])
            return "";
          2 === t3.length && (e3 = n3 + t3[1]);
        }
        return e3;
      }
      const u2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
      function d2(e3, t3, n3) {
        if (true !== this.options.ignoreAttributes && "string" == typeof e3) {
          const n4 = i3.getAllMatches(e3, u2), o3 = n4.length, a3 = {};
          for (let e4 = 0; e4 < o3; e4++) {
            const i4 = this.resolveNameSpace(n4[e4][1]);
            if (this.ignoreAttributesFn(i4, t3))
              continue;
            let o4 = n4[e4][4], r4 = this.options.attributeNamePrefix + i4;
            if (i4.length)
              if (this.options.transformAttributeName && (r4 = this.options.transformAttributeName(r4)), "__proto__" === r4 && (r4 = "#__proto__"), void 0 !== o4) {
                this.options.trimValues && (o4 = o4.trim()), o4 = this.replaceEntitiesValue(o4);
                const e5 = this.options.attributeValueProcessor(i4, o4, t3);
                a3[r4] = null == e5 ? o4 : typeof e5 != typeof o4 || e5 !== o4 ? e5 : b2(o4, this.options.parseAttributeValue, this.options.numberParseOptions);
              } else
                this.options.allowBooleanAttributes && (a3[r4] = true);
          }
          if (!Object.keys(a3).length)
            return;
          if (this.options.attributesGroupName) {
            const e4 = {};
            return e4[this.options.attributesGroupName] = a3, e4;
          }
          return a3;
        }
      }
      const f2 = function(e3) {
        const t3 = new o2("!xml");
        let n3 = t3, i4 = "", r4 = "";
        for (let s4 = 0; s4 < e3.length; s4++) {
          if ("<" === e3[s4])
            if ("/" === e3[s4 + 1]) {
              const t4 = y2(e3, ">", s4, "Closing Tag is not closed.");
              let o3 = e3.substring(s4 + 2, t4).trim();
              if (this.options.removeNSPrefix) {
                const e4 = o3.indexOf(":");
                -1 !== e4 && (o3 = o3.substr(e4 + 1));
              }
              this.options.transformTagName && (o3 = this.options.transformTagName(o3)), n3 && (i4 = this.saveTextToParentTag(i4, n3, r4));
              const a3 = r4.substring(r4.lastIndexOf(".") + 1);
              if (o3 && -1 !== this.options.unpairedTags.indexOf(o3))
                throw new Error(`Unpaired tag can not be used as closing tag: </${o3}>`);
              let c3 = 0;
              a3 && -1 !== this.options.unpairedTags.indexOf(a3) ? (c3 = r4.lastIndexOf(".", r4.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : c3 = r4.lastIndexOf("."), r4 = r4.substring(0, c3), n3 = this.tagsNodeStack.pop(), i4 = "", s4 = t4;
            } else if ("?" === e3[s4 + 1]) {
              let t4 = x2(e3, s4, false, "?>");
              if (!t4)
                throw new Error("Pi Tag is not closed.");
              if (i4 = this.saveTextToParentTag(i4, n3, r4), this.options.ignoreDeclaration && "?xml" === t4.tagName || this.options.ignorePiTags)
                ;
              else {
                const e4 = new o2(t4.tagName);
                e4.add(this.options.textNodeName, ""), t4.tagName !== t4.tagExp && t4.attrExpPresent && (e4[":@"] = this.buildAttributesMap(t4.tagExp, r4, t4.tagName)), this.addChild(n3, e4, r4);
              }
              s4 = t4.closeIndex + 1;
            } else if ("!--" === e3.substr(s4 + 1, 3)) {
              const t4 = y2(e3, "-->", s4 + 4, "Comment is not closed.");
              if (this.options.commentPropName) {
                const o3 = e3.substring(s4 + 4, t4 - 2);
                i4 = this.saveTextToParentTag(i4, n3, r4), n3.add(this.options.commentPropName, [{ [this.options.textNodeName]: o3 }]);
              }
              s4 = t4;
            } else if ("!D" === e3.substr(s4 + 1, 2)) {
              const t4 = a2(e3, s4);
              this.docTypeEntities = t4.entities, s4 = t4.i;
            } else if ("![" === e3.substr(s4 + 1, 2)) {
              const t4 = y2(e3, "]]>", s4, "CDATA is not closed.") - 2, o3 = e3.substring(s4 + 9, t4);
              i4 = this.saveTextToParentTag(i4, n3, r4);
              let a3 = this.parseTextData(o3, n3.tagname, r4, true, false, true, true);
              null == a3 && (a3 = ""), this.options.cdataPropName ? n3.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o3 }]) : n3.add(this.options.textNodeName, a3), s4 = t4 + 2;
            } else {
              let a3 = x2(e3, s4, this.options.removeNSPrefix), c3 = a3.tagName;
              const l3 = a3.rawTagName;
              let p4 = a3.tagExp, u3 = a3.attrExpPresent, d3 = a3.closeIndex;
              this.options.transformTagName && (c3 = this.options.transformTagName(c3)), n3 && i4 && "!xml" !== n3.tagname && (i4 = this.saveTextToParentTag(i4, n3, r4, false));
              const f3 = n3;
              if (f3 && -1 !== this.options.unpairedTags.indexOf(f3.tagname) && (n3 = this.tagsNodeStack.pop(), r4 = r4.substring(0, r4.lastIndexOf("."))), c3 !== t3.tagname && (r4 += r4 ? "." + c3 : c3), this.isItStopNode(this.options.stopNodes, r4, c3)) {
                let t4 = "";
                if (p4.length > 0 && p4.lastIndexOf("/") === p4.length - 1)
                  "/" === c3[c3.length - 1] ? (c3 = c3.substr(0, c3.length - 1), r4 = r4.substr(0, r4.length - 1), p4 = c3) : p4 = p4.substr(0, p4.length - 1), s4 = a3.closeIndex;
                else if (-1 !== this.options.unpairedTags.indexOf(c3))
                  s4 = a3.closeIndex;
                else {
                  const n4 = this.readStopNodeData(e3, l3, d3 + 1);
                  if (!n4)
                    throw new Error(`Unexpected end of ${l3}`);
                  s4 = n4.i, t4 = n4.tagContent;
                }
                const i5 = new o2(c3);
                c3 !== p4 && u3 && (i5[":@"] = this.buildAttributesMap(p4, r4, c3)), t4 && (t4 = this.parseTextData(t4, c3, r4, true, u3, true, true)), r4 = r4.substr(0, r4.lastIndexOf(".")), i5.add(this.options.textNodeName, t4), this.addChild(n3, i5, r4);
              } else {
                if (p4.length > 0 && p4.lastIndexOf("/") === p4.length - 1) {
                  "/" === c3[c3.length - 1] ? (c3 = c3.substr(0, c3.length - 1), r4 = r4.substr(0, r4.length - 1), p4 = c3) : p4 = p4.substr(0, p4.length - 1), this.options.transformTagName && (c3 = this.options.transformTagName(c3));
                  const e4 = new o2(c3);
                  c3 !== p4 && u3 && (e4[":@"] = this.buildAttributesMap(p4, r4, c3)), this.addChild(n3, e4, r4), r4 = r4.substr(0, r4.lastIndexOf("."));
                } else {
                  const e4 = new o2(c3);
                  this.tagsNodeStack.push(n3), c3 !== p4 && u3 && (e4[":@"] = this.buildAttributesMap(p4, r4, c3)), this.addChild(n3, e4, r4), n3 = e4;
                }
                i4 = "", s4 = d3;
              }
            }
          else
            i4 += e3[s4];
        }
        return t3.child;
      };
      function m2(e3, t3, n3) {
        const i4 = this.options.updateTag(t3.tagname, n3, t3[":@"]);
        false === i4 || ("string" == typeof i4 ? (t3.tagname = i4, e3.addChild(t3)) : e3.addChild(t3));
      }
      const h2 = function(e3) {
        if (this.options.processEntities) {
          for (let t3 in this.docTypeEntities) {
            const n3 = this.docTypeEntities[t3];
            e3 = e3.replace(n3.regx, n3.val);
          }
          for (let t3 in this.lastEntities) {
            const n3 = this.lastEntities[t3];
            e3 = e3.replace(n3.regex, n3.val);
          }
          if (this.options.htmlEntities)
            for (let t3 in this.htmlEntities) {
              const n3 = this.htmlEntities[t3];
              e3 = e3.replace(n3.regex, n3.val);
            }
          e3 = e3.replace(this.ampEntity.regex, this.ampEntity.val);
        }
        return e3;
      };
      function g2(e3, t3, n3, i4) {
        return e3 && (void 0 === i4 && (i4 = 0 === Object.keys(t3.child).length), void 0 !== (e3 = this.parseTextData(e3, t3.tagname, n3, false, !!t3[":@"] && 0 !== Object.keys(t3[":@"]).length, i4)) && "" !== e3 && t3.add(this.options.textNodeName, e3), e3 = ""), e3;
      }
      function v3(e3, t3, n3) {
        const i4 = "*." + n3;
        for (const n4 in e3) {
          const o3 = e3[n4];
          if (i4 === o3 || t3 === o3)
            return true;
        }
        return false;
      }
      function y2(e3, t3, n3, i4) {
        const o3 = e3.indexOf(t3, n3);
        if (-1 === o3)
          throw new Error(i4);
        return o3 + t3.length - 1;
      }
      function x2(e3, t3, n3, i4 = ">") {
        const o3 = function(e4, t4, n4 = ">") {
          let i5, o4 = "";
          for (let a4 = t4; a4 < e4.length; a4++) {
            let t5 = e4[a4];
            if (i5)
              t5 === i5 && (i5 = "");
            else if ('"' === t5 || "'" === t5)
              i5 = t5;
            else if (t5 === n4[0]) {
              if (!n4[1])
                return { data: o4, index: a4 };
              if (e4[a4 + 1] === n4[1])
                return { data: o4, index: a4 };
            } else
              "	" === t5 && (t5 = " ");
            o4 += t5;
          }
        }(e3, t3 + 1, i4);
        if (!o3)
          return;
        let a3 = o3.data;
        const r4 = o3.index, s4 = a3.search(/\s/);
        let c3 = a3, l3 = true;
        -1 !== s4 && (c3 = a3.substring(0, s4), a3 = a3.substring(s4 + 1).trimStart());
        const p4 = c3;
        if (n3) {
          const e4 = c3.indexOf(":");
          -1 !== e4 && (c3 = c3.substr(e4 + 1), l3 = c3 !== o3.data.substr(e4 + 1));
        }
        return { tagName: c3, tagExp: a3, closeIndex: r4, attrExpPresent: l3, rawTagName: p4 };
      }
      function k2(e3, t3, n3) {
        const i4 = n3;
        let o3 = 1;
        for (; n3 < e3.length; n3++)
          if ("<" === e3[n3])
            if ("/" === e3[n3 + 1]) {
              const a3 = y2(e3, ">", n3, `${t3} is not closed`);
              if (e3.substring(n3 + 2, a3).trim() === t3 && (o3--, 0 === o3))
                return { tagContent: e3.substring(i4, n3), i: a3 };
              n3 = a3;
            } else if ("?" === e3[n3 + 1]) {
              n3 = y2(e3, "?>", n3 + 1, "StopNode is not closed.");
            } else if ("!--" === e3.substr(n3 + 1, 3)) {
              n3 = y2(e3, "-->", n3 + 3, "StopNode is not closed.");
            } else if ("![" === e3.substr(n3 + 1, 2)) {
              n3 = y2(e3, "]]>", n3, "StopNode is not closed.") - 2;
            } else {
              const i5 = x2(e3, n3, ">");
              if (i5) {
                (i5 && i5.tagName) === t3 && "/" !== i5.tagExp[i5.tagExp.length - 1] && o3++, n3 = i5.closeIndex;
              }
            }
      }
      function b2(e3, t3, n3) {
        if (t3 && "string" == typeof e3) {
          const t4 = e3.trim();
          return "true" === t4 || "false" !== t4 && r3(e3, n3);
        }
        return i3.isExist(e3) ? e3 : "";
      }
      e2.exports = class {
        constructor(e3) {
          this.options = e3, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (e4, t3) => String.fromCharCode(Number.parseInt(t3, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (e4, t3) => String.fromCharCode(Number.parseInt(t3, 16)) } }, this.addExternalEntities = c2, this.parseXml = f2, this.parseTextData = l2, this.resolveNameSpace = p3, this.buildAttributesMap = d2, this.isItStopNode = v3, this.replaceEntitiesValue = h2, this.readStopNodeData = k2, this.saveTextToParentTag = g2, this.addChild = m2, this.ignoreAttributesFn = s3(this.options.ignoreAttributes);
        }
      };
    }, function(e2, t2, n2) {
      e2.exports = class {
        constructor(e3) {
          this.tagname = e3, this.child = [], this[":@"] = {};
        }
        add(e3, t3) {
          "__proto__" === e3 && (e3 = "#__proto__"), this.child.push({ [e3]: t3 });
        }
        addChild(e3) {
          "__proto__" === e3.tagname && (e3.tagname = "#__proto__"), e3[":@"] && Object.keys(e3[":@"]).length > 0 ? this.child.push({ [e3.tagname]: e3.child, ":@": e3[":@"] }) : this.child.push({ [e3.tagname]: e3.child });
        }
      };
    }, function(e2, t2, n2) {
      const i3 = n2(1);
      function o2(e3, t3) {
        let n3 = "";
        for (; t3 < e3.length && "'" !== e3[t3] && '"' !== e3[t3]; t3++)
          n3 += e3[t3];
        if (n3 = n3.trim(), -1 !== n3.indexOf(" "))
          throw new Error("External entites are not supported");
        const i4 = e3[t3++];
        let o3 = "";
        for (; t3 < e3.length && e3[t3] !== i4; t3++)
          o3 += e3[t3];
        return [n3, o3, t3];
      }
      function a2(e3, t3) {
        return "!" === e3[t3 + 1] && "-" === e3[t3 + 2] && "-" === e3[t3 + 3];
      }
      function r3(e3, t3) {
        return "!" === e3[t3 + 1] && "E" === e3[t3 + 2] && "N" === e3[t3 + 3] && "T" === e3[t3 + 4] && "I" === e3[t3 + 5] && "T" === e3[t3 + 6] && "Y" === e3[t3 + 7];
      }
      function s3(e3, t3) {
        return "!" === e3[t3 + 1] && "E" === e3[t3 + 2] && "L" === e3[t3 + 3] && "E" === e3[t3 + 4] && "M" === e3[t3 + 5] && "E" === e3[t3 + 6] && "N" === e3[t3 + 7] && "T" === e3[t3 + 8];
      }
      function c2(e3, t3) {
        return "!" === e3[t3 + 1] && "A" === e3[t3 + 2] && "T" === e3[t3 + 3] && "T" === e3[t3 + 4] && "L" === e3[t3 + 5] && "I" === e3[t3 + 6] && "S" === e3[t3 + 7] && "T" === e3[t3 + 8];
      }
      function l2(e3, t3) {
        return "!" === e3[t3 + 1] && "N" === e3[t3 + 2] && "O" === e3[t3 + 3] && "T" === e3[t3 + 4] && "A" === e3[t3 + 5] && "T" === e3[t3 + 6] && "I" === e3[t3 + 7] && "O" === e3[t3 + 8] && "N" === e3[t3 + 9];
      }
      function p3(e3) {
        if (i3.isName(e3))
          return e3;
        throw new Error(`Invalid entity name ${e3}`);
      }
      e2.exports = function(e3, t3) {
        const n3 = {};
        if ("O" !== e3[t3 + 3] || "C" !== e3[t3 + 4] || "T" !== e3[t3 + 5] || "Y" !== e3[t3 + 6] || "P" !== e3[t3 + 7] || "E" !== e3[t3 + 8])
          throw new Error("Invalid Tag instead of DOCTYPE");
        {
          t3 += 9;
          let i4 = 1, u2 = false, d2 = false, f2 = "";
          for (; t3 < e3.length; t3++)
            if ("<" !== e3[t3] || d2)
              if (">" === e3[t3]) {
                if (d2 ? "-" === e3[t3 - 1] && "-" === e3[t3 - 2] && (d2 = false, i4--) : i4--, 0 === i4)
                  break;
              } else
                "[" === e3[t3] ? u2 = true : f2 += e3[t3];
            else {
              if (u2 && r3(e3, t3))
                t3 += 7, [entityName, val, t3] = o2(e3, t3 + 1), -1 === val.indexOf("&") && (n3[p3(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val });
              else if (u2 && s3(e3, t3))
                t3 += 8;
              else if (u2 && c2(e3, t3))
                t3 += 8;
              else if (u2 && l2(e3, t3))
                t3 += 9;
              else {
                if (!a2)
                  throw new Error("Invalid DOCTYPE");
                d2 = true;
              }
              i4++, f2 = "";
            }
          if (0 !== i4)
            throw new Error("Unclosed DOCTYPE");
        }
        return { entities: n3, i: t3 };
      };
    }, function(e2, t2) {
      const n2 = /^[-+]?0x[a-fA-F0-9]+$/, i3 = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
      !Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt), !Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
      const o2 = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true };
      e2.exports = function(e3, t3 = {}) {
        if (t3 = Object.assign({}, o2, t3), !e3 || "string" != typeof e3)
          return e3;
        let a2 = e3.trim();
        if (void 0 !== t3.skipLike && t3.skipLike.test(a2))
          return e3;
        if (t3.hex && n2.test(a2))
          return Number.parseInt(a2, 16);
        {
          const n3 = i3.exec(a2);
          if (n3) {
            const i4 = n3[1], o3 = n3[2];
            let r3 = function(e4) {
              if (e4 && -1 !== e4.indexOf("."))
                return "." === (e4 = e4.replace(/0+$/, "")) ? e4 = "0" : "." === e4[0] ? e4 = "0" + e4 : "." === e4[e4.length - 1] && (e4 = e4.substr(0, e4.length - 1)), e4;
              return e4;
            }(n3[3]);
            const s3 = n3[4] || n3[6];
            if (!t3.leadingZeros && o3.length > 0 && i4 && "." !== a2[2])
              return e3;
            if (!t3.leadingZeros && o3.length > 0 && !i4 && "." !== a2[1])
              return e3;
            {
              const n4 = Number(a2), c2 = "" + n4;
              return -1 !== c2.search(/[eE]/) || s3 ? t3.eNotation ? n4 : e3 : -1 !== a2.indexOf(".") ? "0" === c2 && "" === r3 || c2 === r3 || i4 && c2 === "-" + r3 ? n4 : e3 : o3 ? r3 === c2 || i4 + r3 === c2 ? n4 : e3 : a2 === c2 || a2 === i4 + c2 ? n4 : e3;
            }
          }
          return e3;
        }
      };
    }, function(e2, t2, n2) {
      function i3(e3, t3, n3) {
        let s3;
        const c2 = {};
        for (let l2 = 0; l2 < e3.length; l2++) {
          const p3 = e3[l2], u2 = o2(p3);
          let d2 = "";
          if (d2 = void 0 === n3 ? u2 : n3 + "." + u2, u2 === t3.textNodeName)
            void 0 === s3 ? s3 = p3[u2] : s3 += "" + p3[u2];
          else {
            if (void 0 === u2)
              continue;
            if (p3[u2]) {
              let e4 = i3(p3[u2], t3, d2);
              const n4 = r3(e4, t3);
              p3[":@"] ? a2(e4, p3[":@"], d2, t3) : 1 !== Object.keys(e4).length || void 0 === e4[t3.textNodeName] || t3.alwaysCreateTextNode ? 0 === Object.keys(e4).length && (t3.alwaysCreateTextNode ? e4[t3.textNodeName] = "" : e4 = "") : e4 = e4[t3.textNodeName], void 0 !== c2[u2] && c2.hasOwnProperty(u2) ? (Array.isArray(c2[u2]) || (c2[u2] = [c2[u2]]), c2[u2].push(e4)) : t3.isArray(u2, d2, n4) ? c2[u2] = [e4] : c2[u2] = e4;
            }
          }
        }
        return "string" == typeof s3 ? s3.length > 0 && (c2[t3.textNodeName] = s3) : void 0 !== s3 && (c2[t3.textNodeName] = s3), c2;
      }
      function o2(e3) {
        const t3 = Object.keys(e3);
        for (let e4 = 0; e4 < t3.length; e4++) {
          const n3 = t3[e4];
          if (":@" !== n3)
            return n3;
        }
      }
      function a2(e3, t3, n3, i4) {
        if (t3) {
          const o3 = Object.keys(t3), a3 = o3.length;
          for (let r4 = 0; r4 < a3; r4++) {
            const a4 = o3[r4];
            i4.isArray(a4, n3 + "." + a4, true, true) ? e3[a4] = [t3[a4]] : e3[a4] = t3[a4];
          }
        }
      }
      function r3(e3, t3) {
        const { textNodeName: n3 } = t3, i4 = Object.keys(e3).length;
        return 0 === i4 || !(1 !== i4 || !e3[n3] && "boolean" != typeof e3[n3] && 0 !== e3[n3]);
      }
      t2.prettify = function(e3, t3) {
        return i3(e3, t3);
      };
    }, function(e2, t2, n2) {
      const i3 = n2(24), o2 = n2(5), a2 = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: "  ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(e3, t3) {
        return t3;
      }, attributeValueProcessor: function(e3, t3) {
        return t3;
      }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&amp;" }, { regex: new RegExp(">", "g"), val: "&gt;" }, { regex: new RegExp("<", "g"), val: "&lt;" }, { regex: new RegExp("'", "g"), val: "&apos;" }, { regex: new RegExp('"', "g"), val: "&quot;" }], processEntities: true, stopNodes: [], oneListGroup: false };
      function r3(e3) {
        this.options = Object.assign({}, a2, e3), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
          return false;
        } : (this.ignoreAttributesFn = o2(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = l2), this.processTextOrObjNode = s3, this.options.format ? (this.indentate = c2, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
          return "";
        }, this.tagEndChar = ">", this.newLine = "");
      }
      function s3(e3, t3, n3, i4) {
        const o3 = this.j2x(e3, n3 + 1, i4.concat(t3));
        return void 0 !== e3[this.options.textNodeName] && 1 === Object.keys(e3).length ? this.buildTextValNode(e3[this.options.textNodeName], t3, o3.attrStr, n3) : this.buildObjectNode(o3.val, t3, o3.attrStr, n3);
      }
      function c2(e3) {
        return this.options.indentBy.repeat(e3);
      }
      function l2(e3) {
        return !(!e3.startsWith(this.options.attributeNamePrefix) || e3 === this.options.textNodeName) && e3.substr(this.attrPrefixLen);
      }
      r3.prototype.build = function(e3) {
        return this.options.preserveOrder ? i3(e3, this.options) : (Array.isArray(e3) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e3 = { [this.options.arrayNodeName]: e3 }), this.j2x(e3, 0, []).val);
      }, r3.prototype.j2x = function(e3, t3, n3) {
        let i4 = "", o3 = "";
        const a3 = n3.join(".");
        for (let r4 in e3)
          if (Object.prototype.hasOwnProperty.call(e3, r4))
            if (void 0 === e3[r4])
              this.isAttribute(r4) && (o3 += "");
            else if (null === e3[r4])
              this.isAttribute(r4) ? o3 += "" : "?" === r4[0] ? o3 += this.indentate(t3) + "<" + r4 + "?" + this.tagEndChar : o3 += this.indentate(t3) + "<" + r4 + "/" + this.tagEndChar;
            else if (e3[r4] instanceof Date)
              o3 += this.buildTextValNode(e3[r4], r4, "", t3);
            else if ("object" != typeof e3[r4]) {
              const n4 = this.isAttribute(r4);
              if (n4 && !this.ignoreAttributesFn(n4, a3))
                i4 += this.buildAttrPairStr(n4, "" + e3[r4]);
              else if (!n4)
                if (r4 === this.options.textNodeName) {
                  let t4 = this.options.tagValueProcessor(r4, "" + e3[r4]);
                  o3 += this.replaceEntitiesValue(t4);
                } else
                  o3 += this.buildTextValNode(e3[r4], r4, "", t3);
            } else if (Array.isArray(e3[r4])) {
              const i5 = e3[r4].length;
              let a4 = "", s4 = "";
              for (let c3 = 0; c3 < i5; c3++) {
                const i6 = e3[r4][c3];
                if (void 0 === i6)
                  ;
                else if (null === i6)
                  "?" === r4[0] ? o3 += this.indentate(t3) + "<" + r4 + "?" + this.tagEndChar : o3 += this.indentate(t3) + "<" + r4 + "/" + this.tagEndChar;
                else if ("object" == typeof i6)
                  if (this.options.oneListGroup) {
                    const e4 = this.j2x(i6, t3 + 1, n3.concat(r4));
                    a4 += e4.val, this.options.attributesGroupName && i6.hasOwnProperty(this.options.attributesGroupName) && (s4 += e4.attrStr);
                  } else
                    a4 += this.processTextOrObjNode(i6, r4, t3, n3);
                else if (this.options.oneListGroup) {
                  let e4 = this.options.tagValueProcessor(r4, i6);
                  e4 = this.replaceEntitiesValue(e4), a4 += e4;
                } else
                  a4 += this.buildTextValNode(i6, r4, "", t3);
              }
              this.options.oneListGroup && (a4 = this.buildObjectNode(a4, r4, s4, t3)), o3 += a4;
            } else if (this.options.attributesGroupName && r4 === this.options.attributesGroupName) {
              const t4 = Object.keys(e3[r4]), n4 = t4.length;
              for (let o4 = 0; o4 < n4; o4++)
                i4 += this.buildAttrPairStr(t4[o4], "" + e3[r4][t4[o4]]);
            } else
              o3 += this.processTextOrObjNode(e3[r4], r4, t3, n3);
        return { attrStr: i4, val: o3 };
      }, r3.prototype.buildAttrPairStr = function(e3, t3) {
        return t3 = this.options.attributeValueProcessor(e3, "" + t3), t3 = this.replaceEntitiesValue(t3), this.options.suppressBooleanAttributes && "true" === t3 ? " " + e3 : " " + e3 + '="' + t3 + '"';
      }, r3.prototype.buildObjectNode = function(e3, t3, n3, i4) {
        if ("" === e3)
          return "?" === t3[0] ? this.indentate(i4) + "<" + t3 + n3 + "?" + this.tagEndChar : this.indentate(i4) + "<" + t3 + n3 + this.closeTag(t3) + this.tagEndChar;
        {
          let o3 = "</" + t3 + this.tagEndChar, a3 = "";
          return "?" === t3[0] && (a3 = "?", o3 = ""), !n3 && "" !== n3 || -1 !== e3.indexOf("<") ? false !== this.options.commentPropName && t3 === this.options.commentPropName && 0 === a3.length ? this.indentate(i4) + `<!--${e3}-->` + this.newLine : this.indentate(i4) + "<" + t3 + n3 + a3 + this.tagEndChar + e3 + this.indentate(i4) + o3 : this.indentate(i4) + "<" + t3 + n3 + a3 + ">" + e3 + o3;
        }
      }, r3.prototype.closeTag = function(e3) {
        let t3 = "";
        return -1 !== this.options.unpairedTags.indexOf(e3) ? this.options.suppressUnpairedNode || (t3 = "/") : t3 = this.options.suppressEmptyNode ? "/" : `></${e3}`, t3;
      }, r3.prototype.buildTextValNode = function(e3, t3, n3, i4) {
        if (false !== this.options.cdataPropName && t3 === this.options.cdataPropName)
          return this.indentate(i4) + `<![CDATA[${e3}]]>` + this.newLine;
        if (false !== this.options.commentPropName && t3 === this.options.commentPropName)
          return this.indentate(i4) + `<!--${e3}-->` + this.newLine;
        if ("?" === t3[0])
          return this.indentate(i4) + "<" + t3 + n3 + "?" + this.tagEndChar;
        {
          let o3 = this.options.tagValueProcessor(t3, e3);
          return o3 = this.replaceEntitiesValue(o3), "" === o3 ? this.indentate(i4) + "<" + t3 + n3 + this.closeTag(t3) + this.tagEndChar : this.indentate(i4) + "<" + t3 + n3 + ">" + o3 + "</" + t3 + this.tagEndChar;
        }
      }, r3.prototype.replaceEntitiesValue = function(e3) {
        if (e3 && e3.length > 0 && this.options.processEntities)
          for (let t3 = 0; t3 < this.options.entities.length; t3++) {
            const n3 = this.options.entities[t3];
            e3 = e3.replace(n3.regex, n3.val);
          }
        return e3;
      }, e2.exports = r3;
    }, function(e2, t2) {
      function n2(e3, t3, s3, c2) {
        let l2 = "", p3 = false;
        for (let u2 = 0; u2 < e3.length; u2++) {
          const d2 = e3[u2], f2 = i3(d2);
          if (void 0 === f2)
            continue;
          let m2 = "";
          if (m2 = 0 === s3.length ? f2 : `${s3}.${f2}`, f2 === t3.textNodeName) {
            let e4 = d2[f2];
            a2(m2, t3) || (e4 = t3.tagValueProcessor(f2, e4), e4 = r3(e4, t3)), p3 && (l2 += c2), l2 += e4, p3 = false;
            continue;
          }
          if (f2 === t3.cdataPropName) {
            p3 && (l2 += c2), l2 += `<![CDATA[${d2[f2][0][t3.textNodeName]}]]>`, p3 = false;
            continue;
          }
          if (f2 === t3.commentPropName) {
            l2 += c2 + `<!--${d2[f2][0][t3.textNodeName]}-->`, p3 = true;
            continue;
          }
          if ("?" === f2[0]) {
            const e4 = o2(d2[":@"], t3), n3 = "?xml" === f2 ? "" : c2;
            let i4 = d2[f2][0][t3.textNodeName];
            i4 = 0 !== i4.length ? " " + i4 : "", l2 += n3 + `<${f2}${i4}${e4}?>`, p3 = true;
            continue;
          }
          let h2 = c2;
          "" !== h2 && (h2 += t3.indentBy);
          const g2 = c2 + `<${f2}${o2(d2[":@"], t3)}`, v3 = n2(d2[f2], t3, m2, h2);
          -1 !== t3.unpairedTags.indexOf(f2) ? t3.suppressUnpairedNode ? l2 += g2 + ">" : l2 += g2 + "/>" : v3 && 0 !== v3.length || !t3.suppressEmptyNode ? v3 && v3.endsWith(">") ? l2 += g2 + `>${v3}${c2}</${f2}>` : (l2 += g2 + ">", v3 && "" !== c2 && (v3.includes("/>") || v3.includes("</")) ? l2 += c2 + t3.indentBy + v3 + c2 : l2 += v3, l2 += `</${f2}>`) : l2 += g2 + "/>", p3 = true;
        }
        return l2;
      }
      function i3(e3) {
        const t3 = Object.keys(e3);
        for (let n3 = 0; n3 < t3.length; n3++) {
          const i4 = t3[n3];
          if (e3.hasOwnProperty(i4) && ":@" !== i4)
            return i4;
        }
      }
      function o2(e3, t3) {
        let n3 = "";
        if (e3 && !t3.ignoreAttributes)
          for (let i4 in e3) {
            if (!e3.hasOwnProperty(i4))
              continue;
            let o3 = t3.attributeValueProcessor(i4, e3[i4]);
            o3 = r3(o3, t3), true === o3 && t3.suppressBooleanAttributes ? n3 += ` ${i4.substr(t3.attributeNamePrefix.length)}` : n3 += ` ${i4.substr(t3.attributeNamePrefix.length)}="${o3}"`;
          }
        return n3;
      }
      function a2(e3, t3) {
        let n3 = (e3 = e3.substr(0, e3.length - t3.textNodeName.length - 1)).substr(e3.lastIndexOf(".") + 1);
        for (let i4 in t3.stopNodes)
          if (t3.stopNodes[i4] === e3 || t3.stopNodes[i4] === "*." + n3)
            return true;
        return false;
      }
      function r3(e3, t3) {
        if (e3 && e3.length > 0 && t3.processEntities)
          for (let n3 = 0; n3 < t3.entities.length; n3++) {
            const i4 = t3.entities[n3];
            e3 = e3.replace(i4.regex, i4.val);
          }
        return e3;
      }
      e2.exports = function(e3, t3) {
        let i4 = "";
        return t3.format && t3.indentBy.length > 0 && (i4 = "\n"), n2(e3, t3, "", i4);
      };
    }, function(e2, t2, n2) {
      var i3 = n2(7), o2 = n2(0), a2 = {};
      e2.exports.transferToTaskMethod = function(e3, t3) {
        a2[t3] = e3[t3], e3[t3] = function(e4, n3) {
          e4.SkipTask ? a2[t3].call(this, e4, n3) : this._addTask(t3, e4, n3);
        };
      }, e2.exports.init = function(e3) {
        var t3, n3, r3 = [], s3 = {}, c2 = 0, l2 = 0, p3 = function(e4) {
          var t4 = { id: e4.id, Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, FilePath: e4.FilePath, state: e4.state, loaded: e4.loaded, size: e4.size, speed: e4.speed, percent: e4.percent, hashPercent: e4.hashPercent, error: e4.error };
          return e4.FilePath && (t4.FilePath = e4.FilePath), t4;
        }, u2 = (n3 = function() {
          t3 = 0, e3.emit("task-list-update", { list: o2.map(r3, p3) }), e3.emit("list-update", { list: o2.map(r3, p3) });
        }, function() {
          t3 || (t3 = setTimeout(n3));
        }), d2 = function() {
          if (!(r3.length <= e3.options.UploadQueueSize)) {
            for (var t4 = 0; t4 < l2 && t4 < r3.length && r3.length > e3.options.UploadQueueSize; ) {
              var n4 = "waiting" === r3[t4].state || "checking" === r3[t4].state || "uploading" === r3[t4].state;
              r3[t4] && n4 ? t4++ : (s3[r3[t4].id] && delete s3[r3[t4].id], r3.splice(t4, 1), l2--);
            }
            u2();
          }
        }, f2 = function t4() {
          if (!(c2 >= e3.options.FileParallelLimit)) {
            for (; r3[l2] && "waiting" !== r3[l2].state; )
              l2++;
            if (!(l2 >= r3.length)) {
              var n4 = r3[l2];
              l2++, c2++, n4.state = "checking", n4.params.onTaskStart && n4.params.onTaskStart(p3(n4)), !n4.params.UploadData && (n4.params.UploadData = {});
              var i4 = o2.formatParams(n4.api, n4.params);
              a2[n4.api].call(e3, i4, function(i5, o3) {
                e3._isRunningTask(n4.id) && ("checking" !== n4.state && "uploading" !== n4.state || (n4.state = i5 ? "error" : "success", i5 && (n4.error = i5), c2--, u2(), t4(), n4.callback && n4.callback(i5, o3), "success" === n4.state && (n4.params && (delete n4.params.UploadData, delete n4.params.Body, delete n4.params), delete n4.callback)), d2());
              }), u2(), setTimeout(t4);
            }
          }
        }, m2 = function(t4, n4) {
          var o3 = s3[t4];
          if (o3) {
            var a3 = o3 && "waiting" === o3.state, r4 = o3 && ("checking" === o3.state || "uploading" === o3.state);
            if ("canceled" === n4 && "canceled" !== o3.state || "paused" === n4 && a3 || "paused" === n4 && r4) {
              if ("paused" === n4 && o3.params.Body && "function" == typeof o3.params.Body.pipe)
                return;
              o3.state = n4, e3.emit("inner-kill-task", { TaskId: t4, toState: n4 });
              try {
                var l3 = o3 && o3.params && o3.params.UploadData.UploadId;
              } catch (e4) {
              }
              "canceled" === n4 && l3 && i3.removeUsing(l3), u2(), r4 && (c2--, f2()), "canceled" === n4 && (o3.params && (delete o3.params.UploadData, delete o3.params.Body, delete o3.params), delete o3.callback);
            }
            d2();
          }
        };
        e3._addTasks = function(t4) {
          o2.each(t4, function(t5) {
            e3._addTask(t5.api, t5.params, t5.callback, true);
          }), u2();
        }, e3._addTask = function(t4, n4, i4, a3) {
          var c3 = "postObject" === e3.options.SimpleUploadMethod ? "postObject" : "putObject";
          "sliceUploadFile" !== t4 || o2.canFileSlice() || (t4 = c3), n4 = o2.formatParams(t4, n4);
          var l3 = o2.uuid();
          n4.TaskId = l3, n4.onTaskReady && n4.onTaskReady(l3);
          var p4 = { params: n4, callback: i4, api: t4, index: r3.length, id: l3, Bucket: n4.Bucket, Region: n4.Region, Key: n4.Key, FilePath: n4.FilePath || "", state: "waiting", loaded: 0, size: 0, speed: 0, percent: 0, hashPercent: 0, error: null }, m3 = n4.onHashProgress;
          n4.onHashProgress = function(t5) {
            e3._isRunningTask(p4.id) && (p4.hashPercent = t5.percent, m3 && m3(t5), u2());
          };
          var h2 = n4.onProgress;
          return n4.onProgress = function(t5) {
            e3._isRunningTask(p4.id) && ("checking" === p4.state && (p4.state = "uploading"), p4.loaded = t5.loaded, p4.size = t5.total, p4.speed = t5.speed, p4.percent = t5.percent, h2 && h2(t5), u2());
          }, o2.getFileSize(t4, n4, function(e4, t5) {
            e4 ? i4(e4) : (s3[l3] = p4, r3.push(p4), p4.size = t5, !a3 && u2(), f2(), d2());
          }), l3;
        }, e3._isRunningTask = function(e4) {
          var t4 = s3[e4];
          return !(!t4 || "checking" !== t4.state && "uploading" !== t4.state);
        }, e3.getTaskList = function() {
          return o2.map(r3, p3);
        }, e3.cancelTask = function(e4) {
          m2(e4, "canceled");
        }, e3.pauseTask = function(e4) {
          m2(e4, "paused");
        }, e3.restartTask = function(e4) {
          var t4 = s3[e4];
          !t4 || "paused" !== t4.state && "error" !== t4.state || (t4.state = "waiting", u2(), l2 = Math.min(l2, t4.index), f2());
        }, e3.isUploadRunning = function() {
          return c2 || l2 < r3.length;
        };
      };
    }, function(e2, t2, n2) {
      var i3 = n2(27), o2 = n2(0), a2 = n2(28);
      function r3(e3) {
        var t3 = { GrantFullControl: [], GrantWrite: [], GrantRead: [], GrantReadAcp: [], GrantWriteAcp: [], ACL: "" }, n3 = { FULL_CONTROL: "GrantFullControl", WRITE: "GrantWrite", READ: "GrantRead", READ_ACP: "GrantReadAcp", WRITE_ACP: "GrantWriteAcp" }, i4 = (e3 && e3.AccessControlList || {}).Grant;
        i4 && (i4 = o2.isArray(i4) ? i4 : [i4]);
        var a3 = { READ: 0, WRITE: 0, FULL_CONTROL: 0 };
        return i4 && i4.length && o2.each(i4, function(i5) {
          "qcs::cam::anyone:anyone" === i5.Grantee.ID || "http://cam.qcloud.com/groups/global/AllUsers" === i5.Grantee.URI ? a3[i5.Permission] = 1 : i5.Grantee.ID !== e3.Owner.ID && t3[n3[i5.Permission]].push('id="' + i5.Grantee.ID + '"');
        }), a3.FULL_CONTROL || a3.WRITE && a3.READ ? t3.ACL = "public-read-write" : a3.READ ? t3.ACL = "public-read" : t3.ACL = "private", o2.each(n3, function(e4) {
          t3[e4] = s3(t3[e4].join(","));
        }), t3;
      }
      function s3(e3) {
        var t3, n3, i4 = e3.split(","), o3 = {};
        for (t3 = 0; t3 < i4.length; )
          o3[n3 = i4[t3].trim()] ? i4.splice(t3, 1) : (o3[n3] = true, i4[t3] = n3, t3++);
        return i4.join(",");
      }
      function c2(e3) {
        var t3 = e3.bucket, n3 = t3.substr(0, t3.lastIndexOf("-")), i4 = t3.substr(t3.lastIndexOf("-") + 1), a3 = e3.domain, r4 = e3.region, s4 = e3.object;
        a3 || (a3 = ["cn-south", "cn-south-2", "cn-north", "cn-east", "cn-southwest", "sg"].indexOf(r4) > -1 ? "{Region}.myqcloud.com" : "cos.{Region}.myqcloud.com", e3.ForcePathStyle || (a3 = "{Bucket}." + a3)), a3 = (a3 = a3.replace(/\{\{AppId\}\}/gi, i4).replace(/\{\{Bucket\}\}/gi, n3).replace(/\{\{Region\}\}/gi, r4).replace(/\{\{.*?\}\}/gi, "")).replace(/\{AppId\}/gi, i4).replace(/\{BucketName\}/gi, n3).replace(/\{Bucket\}/gi, t3).replace(/\{Region\}/gi, r4).replace(/\{.*?\}/gi, ""), /^[a-zA-Z]+:\/\//.test(a3) || (a3 = "https://" + a3), "/" === a3.slice(-1) && (a3 = a3.slice(0, -1));
        var c3 = a3;
        return e3.ForcePathStyle && (c3 += "/" + t3), c3 += "/", s4 && (c3 += o2.camSafeUrlEncode(s4).replace(/%2F/g, "/")), e3.isLocation && (c3 = c3.replace(/^https?:\/\//, "")), c3;
      }
      var l2 = function(e3) {
        if (!e3.Bucket || !e3.Region)
          return "";
        var t3 = void 0 === e3.UseAccelerate ? this.options.UseAccelerate : e3.UseAccelerate;
        return (e3.Url || c2({ ForcePathStyle: this.options.ForcePathStyle, protocol: this.options.Protocol, domain: this.options.Domain, bucket: e3.Bucket, region: t3 ? "accelerate" : e3.Region })).replace(/^https?:\/\/([^/]+)(\/.*)?$/, "$1");
      };
      function p3(e3, t3) {
        var n3 = o2.clone(e3.Headers), i4 = "";
        o2.each(n3, function(e4, t4) {
          ("" === e4 || ["content-type", "cache-control"].indexOf(t4.toLowerCase()) > -1) && delete n3[t4], "host" === t4.toLowerCase() && (i4 = e4);
        });
        var a3 = false !== e3.ForceSignHost;
        !i4 && e3.SignHost && a3 && (n3.Host = e3.SignHost);
        var r4 = false, s4 = function(e4, n4) {
          r4 || (r4 = true, n4 && n4.XCosSecurityToken && !n4.SecurityToken && ((n4 = o2.clone(n4)).SecurityToken = n4.XCosSecurityToken, delete n4.XCosSecurityToken), t3 && t3(e4, n4));
        }, c3 = this, l3 = e3.Bucket || "", p4 = e3.Region || "", u3 = "name/cos:PostObject" !== e3.Action && e3.Key ? e3.Key : "";
        c3.options.ForcePathStyle && l3 && (u3 = l3 + "/" + u3);
        var d3 = "/" + u3, f3 = {}, m3 = e3.Scope;
        if (!m3) {
          var h3 = e3.Action || "", g2 = e3.ResourceKey || e3.Key || "";
          m3 = e3.Scope || [{ action: h3, bucket: l3, region: p4, prefix: g2 }];
        }
        var v3 = o2.md5(JSON.stringify(m3));
        c3._StsCache = c3._StsCache || [], function() {
          var e4, t4;
          for (e4 = c3._StsCache.length - 1; e4 >= 0; e4--) {
            t4 = c3._StsCache[e4];
            var n4 = Math.round(o2.getSkewTime(c3.options.SystemClockOffset) / 1e3) + 30;
            if (t4.StartTime && n4 < t4.StartTime || n4 >= t4.ExpiredTime)
              c3._StsCache.splice(e4, 1);
            else if (!t4.ScopeLimit || t4.ScopeLimit && t4.ScopeKey === v3) {
              f3 = t4;
              break;
            }
          }
        }();
        var y2 = function() {
          var t4 = "";
          f3.StartTime && e3.Expires ? t4 = f3.StartTime + ";" + (f3.StartTime + 1 * e3.Expires) : f3.StartTime && f3.ExpiredTime && (t4 = f3.StartTime + ";" + f3.ExpiredTime);
          var i5 = { Authorization: o2.getAuth({ SecretId: f3.TmpSecretId, SecretKey: f3.TmpSecretKey, Method: e3.Method, Pathname: d3, Query: e3.Query, Headers: n3, Expires: e3.Expires, SystemClockOffset: c3.options.SystemClockOffset, KeyTime: t4, ForceSignHost: a3 }), SecurityToken: f3.SecurityToken || f3.XCosSecurityToken || "", Token: f3.Token || "", ClientIP: f3.ClientIP || "", ClientUA: f3.ClientUA || "", SignFrom: "client" };
          s4(null, i5);
        }, x2 = function(e4) {
          if (e4.Authorization) {
            var t4 = false, n4 = e4.Authorization;
            if (n4)
              if (n4.indexOf(" ") > -1)
                t4 = false;
              else if (n4.indexOf("q-sign-algorithm=") > -1 && n4.indexOf("q-ak=") > -1 && n4.indexOf("q-sign-time=") > -1 && n4.indexOf("q-key-time=") > -1 && n4.indexOf("q-url-param-list=") > -1)
                t4 = true;
              else
                try {
                  (n4 = atob(n4)).indexOf("a=") > -1 && n4.indexOf("k=") > -1 && n4.indexOf("t=") > -1 && n4.indexOf("r=") > -1 && n4.indexOf("b=") > -1 && (t4 = true);
                } catch (e5) {
                }
            if (!t4)
              return o2.error(new Error("getAuthorization callback params format error"));
          } else {
            if (!e4.TmpSecretId)
              return o2.error(new Error('getAuthorization callback params missing "TmpSecretId"'));
            if (!e4.TmpSecretKey)
              return o2.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));
            if (!e4.SecurityToken && !e4.XCosSecurityToken)
              return o2.error(new Error('getAuthorization callback params missing "SecurityToken"'));
            if (!e4.ExpiredTime)
              return o2.error(new Error('getAuthorization callback params missing "ExpiredTime"'));
            if (e4.ExpiredTime && 10 !== e4.ExpiredTime.toString().length)
              return o2.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));
            if (e4.StartTime && 10 !== e4.StartTime.toString().length)
              return o2.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'));
          }
          return false;
        };
        if (f3.ExpiredTime && f3.ExpiredTime - o2.getSkewTime(c3.options.SystemClockOffset) / 1e3 > 60)
          y2();
        else if (c3.options.getAuthorization)
          c3.options.getAuthorization.call(c3, { Bucket: l3, Region: p4, Method: e3.Method, Key: u3, Pathname: d3, Query: e3.Query, Headers: n3, Scope: m3, SystemClockOffset: c3.options.SystemClockOffset, ForceSignHost: a3 }, function(e4) {
            "string" == typeof e4 && (e4 = { Authorization: e4 });
            var t4 = x2(e4);
            if (t4)
              return s4(t4);
            e4.Authorization ? s4(null, e4) : ((f3 = e4 || {}).Scope = m3, f3.ScopeKey = v3, c3._StsCache.push(f3), y2());
          });
        else {
          if (!c3.options.getSTS)
            return function() {
              var t4 = "";
              if (c3.options.StartTime && e3.Expires) {
                if (10 !== c3.options.StartTime.toString().length)
                  return s4(o2.error(new Error('params "StartTime" should be 10 digits')));
                t4 = c3.options.StartTime + ";" + (c3.options.StartTime + 1 * e3.Expires);
              } else if (c3.options.StartTime && c3.options.ExpiredTime) {
                if (10 !== c3.options.StartTime.toString().length)
                  return s4(o2.error(new Error('params "StartTime" should be 10 digits')));
                if (10 !== c3.options.ExpiredTime.toString().length)
                  return s4(o2.error(new Error('params "ExpiredTime" should be 10 digits')));
                t4 = c3.options.StartTime + ";" + 1 * c3.options.ExpiredTime;
              }
              var i5 = { Authorization: o2.getAuth({ SecretId: e3.SecretId || c3.options.SecretId, SecretKey: e3.SecretKey || c3.options.SecretKey, Method: e3.Method, Pathname: d3, Query: e3.Query, Headers: n3, Expires: e3.Expires, KeyTime: t4, SystemClockOffset: c3.options.SystemClockOffset, ForceSignHost: a3 }), SecurityToken: c3.options.SecurityToken || c3.options.XCosSecurityToken, SignFrom: "client" };
              return s4(null, i5), i5;
            }();
          c3.options.getSTS.call(c3, { Bucket: l3, Region: p4 }, function(e4) {
            (f3 = e4 || {}).Scope = m3, f3.ScopeKey = v3, f3.TmpSecretId || (f3.TmpSecretId = f3.SecretId), f3.TmpSecretKey || (f3.TmpSecretKey = f3.SecretKey);
            var t4 = x2(f3);
            if (t4)
              return s4(t4);
            c3._StsCache.push(f3), y2();
          });
        }
        return "";
      }
      function u2(e3) {
        var t3 = this, n3 = false, i4 = false, a3 = false, r4 = e3.headers && (e3.headers.date || e3.headers.Date) || e3.error && e3.error.ServerTime;
        try {
          var s4 = e3.error.Code, c3 = e3.error.Message;
          ("RequestTimeTooSkewed" === s4 || "AccessDenied" === s4 && "Request has expired" === c3) && (a3 = true);
        } catch (e4) {
        }
        if (e3) {
          if (a3 && r4) {
            var l3 = Date.parse(r4);
            this.options.CorrectClockSkew && Math.abs(o2.getSkewTime(this.options.SystemClockOffset) - l3) >= 3e4 && (this.options.SystemClockOffset = l3 - Date.now(), n3 = true);
          } else {
            if (5 === Math.floor(e3.statusCode / 100))
              return { canRetry: true, networkError: false };
            if ("timeout" === e3.message)
              return { canRetry: true, networkError: t3.options.AutoSwitchHost };
          }
          if (e3.statusCode) {
            var p4 = Math.floor(e3.statusCode / 100), u3 = (null == e3 ? void 0 : e3.headers) && (null == e3 ? void 0 : e3.headers["x-cos-request-id"]);
            [3, 4, 5].includes(p4) && !u3 && (n3 = t3.options.AutoSwitchHost, i4 = true);
          } else
            n3 = true, i4 = t3.options.AutoSwitchHost;
        }
        return { canRetry: n3, networkError: i4 };
      }
      function d2(e3) {
        var t3 = e3.requestUrl, n3 = e3.clientCalcSign, i4 = e3.networkError;
        if (!this.options.AutoSwitchHost)
          return false;
        if (!t3)
          return false;
        if (!n3)
          return false;
        if (!i4)
          return false;
        return /^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t3) && !/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t3);
      }
      function f2(e3, t3) {
        var n3 = this;
        !e3.headers && (e3.headers = {}), !e3.qs && (e3.qs = {}), e3.VersionId && (e3.qs.versionId = e3.VersionId), e3.qs = o2.clearKey(e3.qs), e3.headers && (e3.headers = o2.clearKey(e3.headers)), e3.qs && (e3.qs = o2.clearKey(e3.qs));
        var i4 = o2.clone(e3.qs);
        e3.action && (i4[e3.action] = "");
        var a3 = e3.url || e3.Url, r4 = e3.SignHost || l2.call(this, { Bucket: e3.Bucket, Region: e3.Region, Url: a3 }), s4 = e3.tracker;
        !function o3(a4) {
          var c3 = n3.options.SystemClockOffset;
          e3.SwitchHost && (r4 = r4.replace(/myqcloud.com/, "tencentcos.cn")), s4 && s4.setParams({ signStartTime: (/* @__PURE__ */ new Date()).getTime(), httpRetryTimes: a4 - 1 }), p3.call(n3, { Bucket: e3.Bucket || "", Region: e3.Region || "", Method: e3.method, Key: e3.Key, Query: i4, Headers: e3.headers, SignHost: r4, Action: e3.Action, ResourceKey: e3.ResourceKey, Scope: e3.Scope, ForceSignHost: n3.options.ForceSignHost }, function(i5, r5) {
            i5 ? t3(i5) : (s4 && s4.setParams({ signEndTime: (/* @__PURE__ */ new Date()).getTime(), httpStartTime: (/* @__PURE__ */ new Date()).getTime() }), e3.AuthData = r5, m2.call(n3, e3, function(i6, l3) {
              var p4 = false, f3 = false;
              if (i6) {
                var m3 = u2.call(n3, i6);
                p4 = m3.canRetry || c3 !== n3.options.SystemClockOffset, f3 = m3.networkError;
              }
              if (s4 && s4.setParams({ httpEndTime: (/* @__PURE__ */ new Date()).getTime() }), i6 && a4 < 4 && p4) {
                e3.headers && (delete e3.headers.Authorization, delete e3.headers.token, delete e3.headers.clientIP, delete e3.headers.clientUA, e3.headers["x-cos-security-token"] && delete e3.headers["x-cos-security-token"], e3.headers["x-ci-security-token"] && delete e3.headers["x-ci-security-token"]);
                var h3 = d2.call(n3, { requestUrl: (null == i6 ? void 0 : i6.url) || "", clientCalcSign: "client" === (null == r5 ? void 0 : r5.SignFrom), networkError: f3 });
                e3.SwitchHost = h3, e3.headers["x-cos-sdk-retry"] = "true", o3(a4 + 1);
              } else
                t3(i6, l3);
            }));
          });
        }(1);
      }
      function m2(e3, t3) {
        var n3 = this, a3 = e3.TaskId;
        if (!a3 || n3._isRunningTask(a3)) {
          var r4 = e3.Bucket, s4 = e3.Region, l3 = e3.Key, p4 = e3.method || "GET", u3 = e3.url || e3.Url, d3 = e3.body, f3 = e3.json, m3 = e3.rawBody, h3 = e3.dataType, g2 = n3.options.HttpDNSServiceId;
          n3.options.UseAccelerate && (s4 = "accelerate"), u3 = u3 || c2({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: r4, region: s4, object: l3 }), e3.SwitchHost && (u3 = u3.replace(/myqcloud.com/, "tencentcos.cn"));
          var v3 = l3 ? u3 : "";
          e3.action && (u3 = u3 + "?" + e3.action), e3.qsStr && (u3 = u3.indexOf("?") > -1 ? u3 + "&" + e3.qsStr : u3 + "?" + e3.qsStr);
          var y2 = { method: p4, url: u3, headers: e3.headers, qs: e3.qs, filePath: e3.filePath, body: d3, json: f3, httpDNSServiceId: g2, dataType: h3 }, x2 = "x-cos-security-token";
          o2.isCIHost(u3) && (x2 = "x-ci-security-token"), y2.headers.Authorization = e3.AuthData.Authorization, e3.AuthData.Token && (y2.headers.token = e3.AuthData.Token), e3.AuthData.ClientIP && (y2.headers.clientIP = e3.AuthData.ClientIP), e3.AuthData.ClientUA && (y2.headers.clientUA = e3.AuthData.ClientUA), e3.AuthData.SecurityToken && (y2.headers[x2] = e3.AuthData.SecurityToken), y2.headers && (y2.headers = o2.clearKey(y2.headers)), y2 = o2.clearKey(y2), e3.onProgress && "function" == typeof e3.onProgress && (y2.onProgress = function(t4) {
            if (!a3 || n3._isRunningTask(a3)) {
              var i4 = t4 ? t4.loaded : 0;
              e3.onProgress({ loaded: i4, total: t4.total });
            }
          }), this.options.Timeout && (y2.timeout = this.options.Timeout), n3.options.ForcePathStyle && (y2.pathStyle = n3.options.ForcePathStyle), n3.emit("before-send", y2);
          var k2, b2 = y2.url.includes("accelerate."), C2 = y2.qs ? Object.keys(y2.qs).map(function(e4) {
            return "".concat(e4, "=").concat(y2.qs[e4]);
          }).join("&") : "", S2 = C2 ? y2.url + "?" + C2 : y2.url;
          if (e3.tracker)
            e3.tracker.setParams({ url: S2, httpMethod: y2.method, accelerate: b2, httpSize: (null === (k2 = y2.body) || void 0 === k2 ? void 0 : k2.size) || 0 }), e3.tracker.parent && !e3.tracker.parent.params.url && e3.tracker.parent.setParams({ url: v3, accelerate: b2 });
          var w2 = i3(y2, function(e4, i4, r5) {
            if ("abort" !== e4) {
              var s5, c3 = function(e5, r6) {
                if (a3 && n3.off("inner-kill-task", T2), !s5) {
                  s5 = true;
                  var c4 = {};
                  i4 && i4.statusCode && (c4.statusCode = i4.statusCode), i4 && i4.headers && (c4.headers = i4.headers), e5 ? (y2.url && (c4.url = y2.url), y2.method && (c4.method = y2.method), e5 = o2.extend(e5 || {}, c4), t3(e5, null)) : (r6 = o2.extend(r6 || {}, c4), t3(null, r6)), w2 = null;
                }
              };
              if (e4)
                c3({ error: e4 });
              else {
                var l4 = i4.statusCode, p5 = 2 === Math.floor(l4 / 100);
                if (m3) {
                  if (p5)
                    return c3(null, { body: r5 });
                  if (r5 instanceof ArrayBuffer) {
                    var u4 = o2.arrayBufferToString(r5), d4 = o2.parseResBody(u4);
                    return c3({ error: d4.Error || d4 });
                  }
                }
                var f4 = o2.parseResBody(r5);
                p5 ? f4.Error ? c3({ error: f4.Error }) : c3(null, f4) : c3({ error: f4.Error || f4 });
              }
            }
          }), T2 = function e4(t4) {
            t4.TaskId === a3 && (w2 && w2.abort && w2.abort(), n3.off("inner-kill-task", e4));
          };
          a3 && n3.on("inner-kill-task", T2);
        }
      }
      var h2 = { getService: function(e3, t3) {
        "function" == typeof e3 && (t3 = e3, e3 = {});
        var n3 = "https:", i4 = this.options.ServiceDomain, a3 = e3.Region;
        i4 ? (i4 = i4.replace(/\{\{Region\}\}/gi, a3 || "").replace(/\{\{.*?\}\}/gi, ""), /^[a-zA-Z]+:\/\//.test(i4) || (i4 = n3 + "//" + i4), "/" === i4.slice(-1) && (i4 = i4.slice(0, -1))) : i4 = a3 ? n3 + "//cos." + a3 + ".myqcloud.com" : n3 + "//service.cos.myqcloud.com";
        i4.replace(/^https?:\/\/([^/]+)(\/.*)?$/, "$1"), f2.call(this, { Action: "name/cos:GetService", url: i4, method: "GET", headers: e3.Headers, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          var i5 = n4 && n4.ListAllMyBucketsResult && n4.ListAllMyBucketsResult.Buckets && n4.ListAllMyBucketsResult.Buckets.Bucket || [];
          i5 = o2.isArray(i5) ? i5 : [i5];
          var a4 = n4 && n4.ListAllMyBucketsResult && n4.ListAllMyBucketsResult.Owner || {};
          t3(null, { Buckets: i5, Owner: a4, statusCode: n4.statusCode, headers: n4.headers });
        });
      }, putBucket: function(e3, t3) {
        var n3 = this, i4 = "";
        if (e3.BucketAZConfig) {
          var a3 = { BucketAZConfig: e3.BucketAZConfig };
          i4 = o2.json2xml({ CreateBucketConfiguration: a3 });
        }
        f2.call(this, { Action: "name/cos:PutBucket", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, body: i4, tracker: e3.tracker }, function(i5, o3) {
          if (i5)
            return t3(i5);
          var a4 = c2({ protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e3.Bucket, region: e3.Region, isLocation: true });
          t3(null, { Location: a4, statusCode: o3.statusCode, headers: o3.headers });
        });
      }, headBucket: function(e3, t3) {
        f2.call(this, { Action: "name/cos:HeadBucket", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, method: "HEAD", tracker: e3.tracker }, function(e4, n3) {
          t3(e4, n3);
        });
      }, getBucket: function(e3, t3) {
        var n3 = {};
        n3.prefix = e3.Prefix || "", n3.delimiter = e3.Delimiter, n3.marker = e3.Marker, n3["max-keys"] = e3.MaxKeys, n3["encoding-type"] = e3.EncodingType, f2.call(this, { Action: "name/cos:GetBucket", ResourceKey: n3.prefix, method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, qs: n3, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          var i4 = n4.ListBucketResult || {}, a3 = i4.Contents || [], r4 = i4.CommonPrefixes || [];
          a3 = o2.isArray(a3) ? a3 : [a3], r4 = o2.isArray(r4) ? r4 : [r4];
          var s4 = o2.clone(i4);
          o2.extend(s4, { Contents: a3, CommonPrefixes: r4, statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, deleteBucket: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucket", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, method: "DELETE", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketAcl: function(e3, t3) {
        var n3 = e3.Headers, i4 = "";
        if (e3.AccessControlPolicy) {
          var a3 = o2.clone(e3.AccessControlPolicy || {}), r4 = a3.Grants || a3.Grant;
          r4 = o2.isArray(r4) ? r4 : [r4], delete a3.Grant, delete a3.Grants, a3.AccessControlList = { Grant: r4 }, i4 = o2.json2xml({ AccessControlPolicy: a3 }), n3["Content-Type"] = "application/xml", n3["Content-MD5"] = o2.binaryBase64(o2.md5(i4));
        }
        o2.each(n3, function(e4, t4) {
          0 === t4.indexOf("x-cos-grant-") && (n3[t4] = s3(n3[t4]));
        }), f2.call(this, { Action: "name/cos:PutBucketACL", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, headers: n3, action: "acl", body: i4, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketAcl: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketACL", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "acl", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          var i4 = n3.AccessControlPolicy || {}, a3 = i4.Owner || {}, s4 = i4.AccessControlList.Grant || [];
          s4 = o2.isArray(s4) ? s4 : [s4];
          var c3 = r3(i4);
          n3.headers && n3.headers["x-cos-acl"] && (c3.ACL = n3.headers["x-cos-acl"]), c3 = o2.extend(c3, { Owner: a3, Grants: s4, statusCode: n3.statusCode, headers: n3.headers }), t3(null, c3);
        });
      }, putBucketCors: function(e3, t3) {
        var n3 = (e3.CORSConfiguration || {}).CORSRules || e3.CORSRules || [];
        n3 = o2.clone(o2.isArray(n3) ? n3 : [n3]), o2.each(n3, function(e4) {
          o2.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function(t4) {
            var n4 = t4 + "s", i5 = e4[n4] || e4[t4] || [];
            delete e4[n4], e4[t4] = o2.isArray(i5) ? i5 : [i5];
          });
        });
        var i4 = { CORSRule: n3 };
        e3.ResponseVary && (i4.ResponseVary = e3.ResponseVary);
        var a3 = o2.json2xml({ CORSConfiguration: i4 }), r4 = e3.Headers;
        r4["Content-Type"] = "application/xml", r4["Content-MD5"] = o2.binaryBase64(o2.md5(a3)), f2.call(this, { Action: "name/cos:PutBucketCORS", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: a3, action: "cors", headers: r4, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketCors: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketCORS", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "cors", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            if (404 === e4.statusCode && e4.error && "NoSuchCORSConfiguration" === e4.error.Code) {
              var i4 = { CORSRules: [], statusCode: e4.statusCode };
              e4.headers && (i4.headers = e4.headers), t3(null, i4);
            } else
              t3(e4);
          else {
            var a3 = n3.CORSConfiguration || {}, r4 = a3.CORSRules || a3.CORSRule || [];
            r4 = o2.clone(o2.isArray(r4) ? r4 : [r4]);
            var s4 = a3.ResponseVary;
            o2.each(r4, function(e5) {
              o2.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function(t4) {
                var n4 = t4 + "s", i5 = e5[n4] || e5[t4] || [];
                delete e5[t4], e5[n4] = o2.isArray(i5) ? i5 : [i5];
              });
            }), t3(null, { CORSRules: r4, ResponseVary: s4, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketCors: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketCORS", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "cors", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode || e4.statusCode, headers: n3.headers });
        });
      }, getBucketLocation: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketLocation", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "location", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          t3(null, n3);
        });
      }, getBucketPolicy: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketPolicy", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "policy", rawBody: true, tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return e4.statusCode && 403 === e4.statusCode ? t3({ ErrorStatus: "Access Denied" }) : e4.statusCode && 405 === e4.statusCode ? t3({ ErrorStatus: "Method Not Allowed" }) : e4.statusCode && 404 === e4.statusCode ? t3({ ErrorStatus: "Policy Not Found" }) : t3(e4);
          var i4 = {};
          try {
            i4 = JSON.parse(n3.body);
          } catch (e5) {
          }
          t3(null, { Policy: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketPolicy: function(e3, t3) {
        var n3 = e3.Policy, i4 = n3;
        try {
          "string" == typeof n3 ? n3 = JSON.parse(i4) : i4 = JSON.stringify(n3);
        } catch (e4) {
          t3({ error: "Policy format error" });
        }
        var a3 = e3.Headers;
        a3["Content-Type"] = "application/json", a3["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f2.call(this, { Action: "name/cos:PutBucketPolicy", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, action: "policy", body: i4, headers: a3, json: true, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, deleteBucketPolicy: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketPolicy", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "policy", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode || e4.statusCode, headers: n3.headers });
        });
      }, putBucketTagging: function(e3, t3) {
        var n3 = e3.Tagging || {}, i4 = n3.TagSet || n3.Tags || e3.Tags || [];
        i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]);
        var a3 = o2.json2xml({ Tagging: { TagSet: { Tag: i4 } } }), r4 = e3.Headers;
        r4["Content-Type"] = "application/xml", r4["Content-MD5"] = o2.binaryBase64(o2.md5(a3)), f2.call(this, { Action: "name/cos:PutBucketTagging", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: a3, action: "tagging", headers: r4, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketTagging: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketTagging", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "tagging", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            if (404 !== e4.statusCode || !e4.error || "Not Found" !== e4.error && "NoSuchTagSet" !== e4.error.Code)
              t3(e4);
            else {
              var i4 = { Tags: [], statusCode: e4.statusCode };
              e4.headers && (i4.headers = e4.headers), t3(null, i4);
            }
          else {
            var a3 = [];
            try {
              a3 = n3.Tagging.TagSet.Tag || [];
            } catch (e5) {
            }
            a3 = o2.clone(o2.isArray(a3) ? a3 : [a3]), t3(null, { Tags: a3, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketTagging: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketTagging", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "tagging", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketLifecycle: function(e3, t3) {
        var n3 = (e3.LifecycleConfiguration || {}).Rules || e3.Rules || [];
        n3 = o2.clone(n3);
        var i4 = o2.json2xml({ LifecycleConfiguration: { Rule: n3 } }), a3 = e3.Headers;
        a3["Content-Type"] = "application/xml", a3["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f2.call(this, { Action: "name/cos:PutBucketLifecycle", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: i4, action: "lifecycle", headers: a3, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketLifecycle: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketLifecycle", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "lifecycle", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            if (404 === e4.statusCode && e4.error && "NoSuchLifecycleConfiguration" === e4.error.Code) {
              var i4 = { Rules: [], statusCode: e4.statusCode };
              e4.headers && (i4.headers = e4.headers), t3(null, i4);
            } else
              t3(e4);
          else {
            var a3 = [];
            try {
              a3 = n3.LifecycleConfiguration.Rule || [];
            } catch (e5) {
            }
            a3 = o2.clone(o2.isArray(a3) ? a3 : [a3]), t3(null, { Rules: a3, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketLifecycle: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketLifecycle", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "lifecycle", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketVersioning: function(e3, t3) {
        if (e3.VersioningConfiguration) {
          var n3 = e3.VersioningConfiguration || {}, i4 = o2.json2xml({ VersioningConfiguration: n3 }), a3 = e3.Headers;
          a3["Content-Type"] = "application/xml", a3["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f2.call(this, { Action: "name/cos:PutBucketVersioning", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: i4, action: "versioning", headers: a3, tracker: e3.tracker }, function(e4, n4) {
            return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param VersioningConfiguration" });
      }, getBucketVersioning: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketVersioning", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "versioning", tracker: e3.tracker }, function(e4, n3) {
          e4 || !n3.VersioningConfiguration && (n3.VersioningConfiguration = {}), t3(e4, n3);
        });
      }, putBucketReplication: function(e3, t3) {
        var n3 = o2.clone(e3.ReplicationConfiguration), i4 = o2.json2xml({ ReplicationConfiguration: n3 });
        i4 = (i4 = i4.replace(/<(\/?)Rules>/gi, "<$1Rule>")).replace(/<(\/?)Tags>/gi, "<$1Tag>");
        var a3 = e3.Headers;
        a3["Content-Type"] = "application/xml", a3["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f2.call(this, { Action: "name/cos:PutBucketReplication", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: i4, action: "replication", headers: a3, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketReplication: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketReplication", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "replication", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            if (404 !== e4.statusCode || !e4.error || "Not Found" !== e4.error && "ReplicationConfigurationnotFoundError" !== e4.error.Code)
              t3(e4);
            else {
              var i4 = { ReplicationConfiguration: { Rules: [] }, statusCode: e4.statusCode };
              e4.headers && (i4.headers = e4.headers), t3(null, i4);
            }
          else
            e4 || !n3.ReplicationConfiguration && (n3.ReplicationConfiguration = {}), n3.ReplicationConfiguration.Rule && (n3.ReplicationConfiguration.Rules = n3.ReplicationConfiguration.Rule, delete n3.ReplicationConfiguration.Rule), t3(e4, n3);
        });
      }, deleteBucketReplication: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketReplication", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "replication", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketWebsite: function(e3, t3) {
        if (e3.WebsiteConfiguration) {
          var n3 = o2.clone(e3.WebsiteConfiguration || {}), i4 = n3.RoutingRules || n3.RoutingRule || [];
          i4 = o2.isArray(i4) ? i4 : [i4], delete n3.RoutingRule, delete n3.RoutingRules, i4.length && (n3.RoutingRules = { RoutingRule: i4 });
          var a3 = o2.json2xml({ WebsiteConfiguration: n3 }), r4 = e3.Headers;
          r4["Content-Type"] = "application/xml", r4["Content-MD5"] = o2.binaryBase64(o2.md5(a3)), f2.call(this, { Action: "name/cos:PutBucketWebsite", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: a3, action: "website", headers: r4, tracker: e3.tracker }, function(e4, n4) {
            return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param WebsiteConfiguration" });
      }, getBucketWebsite: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketWebsite", method: "GET", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, action: "website", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            if (404 === e4.statusCode && "NoSuchWebsiteConfiguration" === e4.error.Code) {
              var i4 = { WebsiteConfiguration: {}, statusCode: e4.statusCode };
              e4.headers && (i4.headers = e4.headers), t3(null, i4);
            } else
              t3(e4);
          else {
            var a3 = n3.WebsiteConfiguration || {};
            if (a3.RoutingRules) {
              var r4 = o2.clone(a3.RoutingRules.RoutingRule || []);
              r4 = o2.makeArray(r4), a3.RoutingRules = r4;
            }
            t3(null, { WebsiteConfiguration: a3, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketWebsite: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketWebsite", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "website", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketReferer: function(e3, t3) {
        if (e3.RefererConfiguration) {
          var n3 = o2.clone(e3.RefererConfiguration || {}), i4 = n3.DomainList || {}, a3 = i4.Domains || i4.Domain || [];
          (a3 = o2.isArray(a3) ? a3 : [a3]).length && (n3.DomainList = { Domain: a3 });
          var r4 = o2.json2xml({ RefererConfiguration: n3 }), s4 = e3.Headers;
          s4["Content-Type"] = "application/xml", s4["Content-MD5"] = o2.binaryBase64(o2.md5(r4)), f2.call(this, { Action: "name/cos:PutBucketReferer", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: r4, action: "referer", headers: s4, tracker: e3.tracker }, function(e4, n4) {
            return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param RefererConfiguration" });
      }, getBucketReferer: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketReferer", method: "GET", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, action: "referer", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            if (404 === e4.statusCode && "NoSuchRefererConfiguration" === e4.error.Code) {
              var i4 = { WebsiteConfiguration: {}, statusCode: e4.statusCode };
              e4.headers && (i4.headers = e4.headers), t3(null, i4);
            } else
              t3(e4);
          else {
            var a3 = n3.RefererConfiguration || {};
            if (a3.DomainList) {
              var r4 = o2.makeArray(a3.DomainList.Domain || []);
              a3.DomainList = { Domains: r4 };
            }
            t3(null, { RefererConfiguration: a3, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, putBucketDomain: function(e3, t3) {
        var n3 = (e3.DomainConfiguration || {}).DomainRule || e3.DomainRule || [];
        n3 = o2.clone(n3);
        var i4 = o2.json2xml({ DomainConfiguration: { DomainRule: n3 } }), a3 = e3.Headers;
        a3["Content-Type"] = "application/xml", a3["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f2.call(this, { Action: "name/cos:PutBucketDomain", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: i4, action: "domain", headers: a3, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketDomain: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketDomain", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "domain", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          var i4 = [];
          try {
            i4 = n3.DomainConfiguration.DomainRule || [];
          } catch (e5) {
          }
          i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]), t3(null, { DomainRule: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, deleteBucketDomain: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketDomain", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "domain", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketOrigin: function(e3, t3) {
        var n3 = (e3.OriginConfiguration || {}).OriginRule || e3.OriginRule || [];
        n3 = o2.clone(n3);
        var i4 = o2.json2xml({ OriginConfiguration: { OriginRule: n3 } }), a3 = e3.Headers;
        a3["Content-Type"] = "application/xml", a3["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f2.call(this, { Action: "name/cos:PutBucketOrigin", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: i4, action: "origin", headers: a3, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketOrigin: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketOrigin", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "origin", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          var i4 = [];
          try {
            i4 = n3.OriginConfiguration.OriginRule || [];
          } catch (e5) {
          }
          i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]), t3(null, { OriginRule: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, deleteBucketOrigin: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketOrigin", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "origin", tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketLogging: function(e3, t3) {
        var n3 = o2.json2xml({ BucketLoggingStatus: e3.BucketLoggingStatus || "" }), i4 = e3.Headers;
        i4["Content-Type"] = "application/xml", i4["Content-MD5"] = o2.binaryBase64(o2.md5(n3)), f2.call(this, { Action: "name/cos:PutBucketLogging", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: n3, action: "logging", headers: i4, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketLogging: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketLogging", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "logging", tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          delete n3.BucketLoggingStatus._xmlns, t3(null, { BucketLoggingStatus: n3.BucketLoggingStatus, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketInventory: function(e3, t3) {
        var n3 = o2.clone(e3.InventoryConfiguration);
        if (n3.OptionalFields) {
          var i4 = n3.OptionalFields || [];
          n3.OptionalFields = { Field: i4 };
        }
        if (n3.Destination && n3.Destination.COSBucketDestination && n3.Destination.COSBucketDestination.Encryption) {
          var a3 = n3.Destination.COSBucketDestination.Encryption;
          Object.keys(a3).indexOf("SSECOS") > -1 && (a3["SSE-COS"] = a3.SSECOS, delete a3.SSECOS);
        }
        var r4 = o2.json2xml({ InventoryConfiguration: n3 }), s4 = e3.Headers;
        s4["Content-Type"] = "application/xml", s4["Content-MD5"] = o2.binaryBase64(o2.md5(r4)), f2.call(this, { Action: "name/cos:PutBucketInventory", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: r4, action: "inventory", qs: { id: e3.Id }, headers: s4, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketInventory: function(e3, t3) {
        f2.call(this, { Action: "name/cos:GetBucketInventory", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "inventory", qs: { id: e3.Id }, tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          var i4 = n3.InventoryConfiguration;
          if (i4 && i4.OptionalFields && i4.OptionalFields.Field) {
            var a3 = i4.OptionalFields.Field;
            o2.isArray(a3) || (a3 = [a3]), i4.OptionalFields = a3;
          }
          if (i4.Destination && i4.Destination.COSBucketDestination && i4.Destination.COSBucketDestination.Encryption) {
            var r4 = i4.Destination.COSBucketDestination.Encryption;
            Object.keys(r4).indexOf("SSE-COS") > -1 && (r4.SSECOS = r4["SSE-COS"], delete r4["SSE-COS"]);
          }
          t3(null, { InventoryConfiguration: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, listBucketInventory: function(e3, t3) {
        f2.call(this, { Action: "name/cos:ListBucketInventory", method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "inventory", qs: { "continuation-token": e3.ContinuationToken }, tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          var i4 = n3.ListInventoryConfigurationResult, a3 = i4.InventoryConfiguration || [];
          a3 = o2.isArray(a3) ? a3 : [a3], delete i4.InventoryConfiguration, o2.each(a3, function(e5) {
            if (e5 && e5.OptionalFields && e5.OptionalFields.Field) {
              var t4 = e5.OptionalFields.Field;
              o2.isArray(t4) || (t4 = [t4]), e5.OptionalFields = t4;
            }
            if (e5.Destination && e5.Destination.COSBucketDestination && e5.Destination.COSBucketDestination.Encryption) {
              var n4 = e5.Destination.COSBucketDestination.Encryption;
              Object.keys(n4).indexOf("SSE-COS") > -1 && (n4.SSECOS = n4["SSE-COS"], delete n4["SSE-COS"]);
            }
          }), i4.InventoryConfigurations = a3, o2.extend(i4, { statusCode: n3.statusCode, headers: n3.headers }), t3(null, i4);
        });
      }, deleteBucketInventory: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteBucketInventory", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "inventory", qs: { id: e3.Id }, tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketAccelerate: function(e3, t3) {
        if (e3.AccelerateConfiguration) {
          var n3 = { AccelerateConfiguration: e3.AccelerateConfiguration || {} }, i4 = o2.json2xml(n3), a3 = { "Content-Type": "application/xml" };
          a3["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f2.call(this, { Interface: "putBucketAccelerate", Action: "name/cos:PutBucketAccelerate", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, body: i4, action: "accelerate", headers: a3, tracker: e3.tracker }, function(e4, n4) {
            if (e4)
              return t3(e4);
            t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param AccelerateConfiguration" });
      }, getBucketAccelerate: function(e3, t3) {
        f2.call(this, { Interface: "getBucketAccelerate", Action: "name/cos:GetBucketAccelerate", method: "GET", Bucket: e3.Bucket, Region: e3.Region, action: "accelerate", tracker: e3.tracker }, function(e4, n3) {
          e4 || !n3.AccelerateConfiguration && (n3.AccelerateConfiguration = {}), t3(e4, n3);
        });
      }, getObject: function(e3, t3) {
        if (this.options.ObjectKeySimplifyCheck && "/" === o2.simplifyPath(e3.Key))
          return void t3(o2.error(new Error("The Getobject Key is illegal")));
        var n3 = e3.Query || {}, i4 = e3.QueryString || "", a3 = e3.tracker;
        a3 && a3.setParams({ signStartTime: (/* @__PURE__ */ new Date()).getTime() }), n3["response-content-type"] = e3.ResponseContentType, n3["response-content-language"] = e3.ResponseContentLanguage, n3["response-expires"] = e3.ResponseExpires, n3["response-cache-control"] = e3.ResponseCacheControl, n3["response-content-disposition"] = e3.ResponseContentDisposition, n3["response-content-encoding"] = e3.ResponseContentEncoding, f2.call(this, { Action: "name/cos:GetObject", method: "GET", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, VersionId: e3.VersionId, headers: e3.Headers, qs: n3, qsStr: i4, rawBody: true, dataType: e3.DataType, tracker: a3 }, function(n4, i5) {
          if (n4) {
            var a4 = n4.statusCode;
            return e3.Headers["If-Modified-Since"] && a4 && 304 === a4 ? t3(null, { NotModified: true }) : t3(n4);
          }
          t3(null, { Body: i5.body, ETag: o2.attr(i5.headers, "etag", ""), statusCode: i5.statusCode, headers: i5.headers });
        });
      }, headObject: function(e3, t3) {
        f2.call(this, { Action: "name/cos:HeadObject", method: "HEAD", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, VersionId: e3.VersionId, headers: e3.Headers, tracker: e3.tracker }, function(n3, i4) {
          if (n3) {
            var a3 = n3.statusCode;
            return e3.Headers["If-Modified-Since"] && a3 && 304 === a3 ? t3(null, { NotModified: true, statusCode: a3 }) : t3(n3);
          }
          i4.ETag = o2.attr(i4.headers, "etag", ""), t3(null, i4);
        });
      }, listObjectVersions: function(e3, t3) {
        var n3 = {};
        n3.prefix = e3.Prefix || "", n3.delimiter = e3.Delimiter, n3["key-marker"] = e3.KeyMarker, n3["version-id-marker"] = e3.VersionIdMarker, n3["max-keys"] = e3.MaxKeys, n3["encoding-type"] = e3.EncodingType, f2.call(this, { Action: "name/cos:GetBucketObjectVersions", ResourceKey: n3.prefix, method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, qs: n3, action: "versions", tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          var i4 = n4.ListVersionsResult || {}, a3 = i4.DeleteMarker || [];
          a3 = o2.isArray(a3) ? a3 : [a3];
          var r4 = i4.Version || [];
          r4 = o2.isArray(r4) ? r4 : [r4];
          var s4 = o2.clone(i4);
          delete s4.DeleteMarker, delete s4.Version, o2.extend(s4, { DeleteMarkers: a3, Versions: r4, statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, putObject: function(e3, t3) {
        var n3 = this, i4 = e3.ContentLength, r4 = o2.throttleOnProgress.call(n3, i4, e3.onProgress), s4 = e3.Headers;
        s4["Cache-Control"] || s4["cache-control"] || (s4["Cache-Control"] = ""), s4["Content-Type"] || s4["content-type"] || (s4["Content-Type"] = a2.getType(e3.Key) || "application/octet-stream");
        var l3 = e3.UploadAddMetaMd5 || n3.options.UploadAddMetaMd5 || n3.options.UploadCheckContentMd5, p4 = e3.tracker;
        l3 && p4 && p4.setParams({ md5StartTime: (/* @__PURE__ */ new Date()).getTime() }), o2.getBodyMd5(l3, e3.Body, function(a3) {
          a3 && (p4 && p4.setParams({ md5EndTime: (/* @__PURE__ */ new Date()).getTime() }), n3.options.UploadCheckContentMd5 && (s4["Content-MD5"] = o2.binaryBase64(a3)), (e3.UploadAddMetaMd5 || n3.options.UploadAddMetaMd5) && (s4["x-cos-meta-md5"] = a3)), void 0 !== e3.ContentLength && (s4["Content-Length"] = e3.ContentLength), r4(null, true), f2.call(n3, { Action: "name/cos:PutObject", TaskId: e3.TaskId, method: "PUT", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, qs: e3.Query, body: e3.Body, onProgress: r4, tracker: p4 }, function(a4, s5) {
            if (a4)
              return r4(null, true), t3(a4);
            r4({ loaded: i4, total: i4 }, true);
            var l4 = c2({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e3.Bucket, region: n3.options.UseAccelerate ? "accelerate" : e3.Region, object: e3.Key });
            l4 = l4.substr(l4.indexOf("://") + 3), s5.Location = l4, s5.ETag = o2.attr(s5.headers, "etag", ""), t3(null, s5);
          });
        });
      }, postObject: function(e3, t3) {
        var n3 = this, i4 = {}, a3 = e3.FilePath;
        if (a3) {
          for (var r4 in i4["Cache-Control"] = e3.CacheControl, i4["Content-Disposition"] = e3.ContentDisposition, i4["Content-Encoding"] = e3.ContentEncoding, i4["Content-MD5"] = e3.ContentMD5, i4["Content-Length"] = e3.ContentLength, i4["Content-Type"] = e3.ContentType, i4.Expect = e3.Expect, i4.Expires = e3.Expires, i4["x-cos-acl"] = e3.ACL, i4["x-cos-grant-read"] = e3.GrantRead, i4["x-cos-grant-write"] = e3.GrantWrite, i4["x-cos-grant-full-control"] = e3.GrantFullControl, i4["x-cos-storage-class"] = e3.StorageClass, i4["x-cos-mime-limit"] = e3.MimeLimit, i4["x-cos-traffic-limit"] = e3.TrafficLimit, i4["x-cos-forbid-overwrite"] = e3.ForbidOverwrite, i4["x-cos-server-side-encryption-customer-algorithm"] = e3.SSECustomerAlgorithm, i4["x-cos-server-side-encryption-customer-key"] = e3.SSECustomerKey, i4["x-cos-server-side-encryption-customer-key-MD5"] = e3.SSECustomerKeyMD5, i4["x-cos-server-side-encryption"] = e3.ServerSideEncryption, i4["x-cos-server-side-encryption-cos-kms-key-id"] = e3.SSEKMSKeyId, i4["x-cos-server-side-encryption-context"] = e3.SSEContext, delete i4["Content-Length"], delete i4["content-length"], e3)
            r4.indexOf("x-cos-meta-") > -1 && (i4[r4] = e3[r4]);
          var s4 = o2.throttleOnProgress.call(n3, i4["Content-Length"], e3.onProgress);
          f2.call(this, { Action: "name/cos:PostObject", method: "POST", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: i4, qs: e3.Query, filePath: a3, TaskId: e3.TaskId, onProgress: s4, tracker: e3.tracker }, function(i5, o3) {
            if (s4(null, true), i5)
              return t3(i5);
            if (o3 && o3.headers) {
              var r5 = o3.headers, l3 = r5.etag || r5.Etag || r5.ETag || "", p4 = a3.substr(a3.lastIndexOf("/") + 1), u3 = c2({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e3.Bucket, region: e3.Region, object: e3.Key.replace(/\$\{filename\}/g, p4), isLocation: true });
              return t3(null, { Location: u3, statusCode: o3.statusCode, headers: r5, ETag: l3 });
            }
            t3(null, o3);
          });
        } else
          t3({ error: "missing param FilePath" });
      }, deleteObject: function(e3, t3) {
        f2.call(this, { Action: "name/cos:DeleteObject", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, VersionId: e3.VersionId, tracker: e3.tracker }, function(e4, n3) {
          if (e4) {
            var i4 = e4.statusCode;
            return i4 && 204 === i4 ? t3(null, { statusCode: i4 }) : i4 && 404 === i4 ? t3(null, { BucketNotFound: true, statusCode: i4 }) : t3(e4);
          }
          t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, getObjectAcl: function(e3, t3) {
        var n3 = {};
        e3.VersionId && (n3.versionId = e3.VersionId), f2.call(this, { Action: "name/cos:GetObjectACL", method: "GET", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, qs: n3, action: "acl", tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          var i4 = n4.AccessControlPolicy || {}, a3 = i4.Owner || {}, s4 = i4.AccessControlList && i4.AccessControlList.Grant || [];
          s4 = o2.isArray(s4) ? s4 : [s4];
          var c3 = r3(i4);
          n4.headers && n4.headers["x-cos-acl"] && (c3.ACL = n4.headers["x-cos-acl"]), c3 = o2.extend(c3, { Owner: a3, Grants: s4, statusCode: n4.statusCode, headers: n4.headers }), t3(null, c3);
        });
      }, putObjectAcl: function(e3, t3) {
        var n3 = e3.Headers, i4 = "";
        if (e3.AccessControlPolicy) {
          var a3 = o2.clone(e3.AccessControlPolicy || {}), r4 = a3.Grants || a3.Grant;
          r4 = o2.isArray(r4) ? r4 : [r4], delete a3.Grant, delete a3.Grants, a3.AccessControlList = { Grant: r4 }, i4 = o2.json2xml({ AccessControlPolicy: a3 }), n3["Content-Type"] = "application/xml", n3["Content-MD5"] = o2.binaryBase64(o2.md5(i4));
        }
        o2.each(n3, function(e4, t4) {
          0 === t4.indexOf("x-cos-grant-") && (n3[t4] = s3(n3[t4]));
        }), f2.call(this, { Action: "name/cos:PutObjectACL", method: "PUT", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, action: "acl", headers: n3, body: i4, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, optionsObject: function(e3, t3) {
        var n3 = e3.Headers;
        n3.Origin = e3.Origin, n3["Access-Control-Request-Method"] = e3.AccessControlRequestMethod, n3["Access-Control-Request-Headers"] = e3.AccessControlRequestHeaders, f2.call(this, { Action: "name/cos:OptionsObject", method: "OPTIONS", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: n3, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return e4.statusCode && 403 === e4.statusCode ? t3(null, { OptionsForbidden: true, statusCode: e4.statusCode }) : t3(e4);
          var i4 = n4.headers || {};
          t3(null, { AccessControlAllowOrigin: i4["access-control-allow-origin"], AccessControlAllowMethods: i4["access-control-allow-methods"], AccessControlAllowHeaders: i4["access-control-allow-headers"], AccessControlExposeHeaders: i4["access-control-expose-headers"], AccessControlMaxAge: i4["access-control-max-age"], statusCode: n4.statusCode, headers: n4.headers });
        });
      }, putObjectCopy: function(e3, t3) {
        var n3 = e3.Headers;
        !n3["Cache-Control"] && n3["cache-control"] && (n3["Cache-Control"] = "");
        var i4 = e3.CopySource || "", a3 = o2.getSourceParams.call(this, i4);
        if (a3) {
          var r4 = a3.Bucket, s4 = a3.Region, c3 = decodeURIComponent(a3.Key);
          f2.call(this, { Scope: [{ action: "name/cos:GetObject", bucket: r4, region: s4, prefix: c3 }, { action: "name/cos:PutObject", bucket: e3.Bucket, region: e3.Region, prefix: e3.Key }], method: "PUT", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, VersionId: e3.VersionId, headers: e3.Headers, tracker: e3.tracker }, function(e4, n4) {
            if (e4)
              return t3(e4);
            var i5 = o2.clone(n4.CopyObjectResult || {});
            o2.extend(i5, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, i5);
          });
        } else
          t3({ error: "CopySource format error" });
      }, deleteMultipleObject: function(e3, t3) {
        var n3 = e3.Objects || [], i4 = e3.Quiet;
        n3 = o2.isArray(n3) ? n3 : [n3];
        var a3 = o2.json2xml({ Delete: { Object: n3, Quiet: i4 || false } }), r4 = e3.Headers;
        r4["Content-Type"] = "application/xml", r4["Content-MD5"] = o2.binaryBase64(o2.md5(a3));
        var s4 = o2.map(n3, function(t4) {
          return { action: "name/cos:DeleteObject", bucket: e3.Bucket, region: e3.Region, prefix: t4.Key };
        });
        f2.call(this, { Scope: s4, method: "POST", Bucket: e3.Bucket, Region: e3.Region, body: a3, action: "delete", headers: r4, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          var i5 = n4.DeleteResult || {}, a4 = i5.Deleted || [], r5 = i5.Error || [];
          a4 = o2.isArray(a4) ? a4 : [a4], r5 = o2.isArray(r5) ? r5 : [r5];
          var s5 = o2.clone(i5);
          o2.extend(s5, { Error: r5, Deleted: a4, statusCode: n4.statusCode, headers: n4.headers }), t3(null, s5);
        });
      }, restoreObject: function(e3, t3) {
        var n3 = e3.Headers;
        if (e3.RestoreRequest) {
          var i4 = e3.RestoreRequest || {}, a3 = o2.json2xml({ RestoreRequest: i4 });
          n3["Content-Type"] = "application/xml", n3["Content-MD5"] = o2.binaryBase64(o2.md5(a3)), f2.call(this, { Action: "name/cos:RestoreObject", method: "POST", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, VersionId: e3.VersionId, body: a3, action: "restore", headers: n3, tracker: e3.tracker }, function(e4, n4) {
            t3(e4, n4);
          });
        } else
          t3({ error: "missing param RestoreRequest" });
      }, putObjectTagging: function(e3, t3) {
        var n3 = e3.Tagging || {}, i4 = n3.TagSet || n3.Tags || e3.Tags || [];
        i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]);
        var a3 = o2.json2xml({ Tagging: { TagSet: { Tag: i4 } } }), r4 = e3.Headers;
        r4["Content-Type"] = "application/xml", r4["Content-MD5"] = o2.binaryBase64(o2.md5(a3)), f2.call(this, { Interface: "putObjectTagging", Action: "name/cos:PutObjectTagging", method: "PUT", Bucket: e3.Bucket, Key: e3.Key, Region: e3.Region, body: a3, action: "tagging", headers: r4, VersionId: e3.VersionId, tracker: e3.tracker }, function(e4, n4) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getObjectTagging: function(e3, t3) {
        f2.call(this, { Interface: "getObjectTagging", Action: "name/cos:GetObjectTagging", method: "GET", Key: e3.Key, Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, action: "tagging", VersionId: e3.VersionId, tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            if (404 !== e4.statusCode || !e4.error || "Not Found" !== e4.error && "NoSuchTagSet" !== e4.error.Code)
              t3(e4);
            else {
              var i4 = { Tags: [], statusCode: e4.statusCode };
              e4.headers && (i4.headers = e4.headers), t3(null, i4);
            }
          else {
            var a3 = [];
            try {
              a3 = n3.Tagging.TagSet.Tag || [];
            } catch (e5) {
            }
            a3 = o2.clone(o2.isArray(a3) ? a3 : [a3]), t3(null, { Tags: a3, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteObjectTagging: function(e3, t3) {
        f2.call(this, { Interface: "deleteObjectTagging", Action: "name/cos:DeleteObjectTagging", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, action: "tagging", VersionId: e3.VersionId, tracker: e3.tracker }, function(e4, n3) {
          return e4 && 204 === e4.statusCode ? t3(null, { statusCode: e4.statusCode }) : e4 ? t3(e4) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, appendObject: function(e3, t3) {
        f2.call(this, { Action: "name/cos:AppendObject", method: "POST", Bucket: e3.Bucket, Region: e3.Region, action: "append", Key: e3.Key, body: e3.Body, qs: { position: e3.Position }, headers: e3.Headers, tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          t3(null, n3);
        });
      }, uploadPartCopy: function(e3, t3) {
        var n3 = e3.CopySource || "", i4 = o2.getSourceParams.call(this, n3);
        if (i4) {
          var a3 = i4.Bucket, r4 = i4.Region, s4 = decodeURIComponent(i4.Key);
          f2.call(this, { Scope: [{ action: "name/cos:GetObject", bucket: a3, region: r4, prefix: s4 }, { action: "name/cos:PutObject", bucket: e3.Bucket, region: e3.Region, prefix: e3.Key }], method: "PUT", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, VersionId: e3.VersionId, qs: { partNumber: e3.PartNumber, uploadId: e3.UploadId }, headers: e3.Headers, tracker: e3.tracker }, function(e4, n4) {
            if (e4)
              return t3(e4);
            var i5 = o2.clone(n4.CopyPartResult || {});
            o2.extend(i5, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, i5);
          });
        } else
          t3({ error: "CopySource format error" });
      }, multipartInit: function(e3, t3) {
        var n3 = e3.Headers, i4 = e3.tracker;
        n3["Cache-Control"] || n3["cache-control"] || (n3["Cache-Control"] = ""), n3["Content-Type"] || n3["content-type"] || (n3["Content-Type"] = a2.getType(e3.Key) || "application/octet-stream"), f2.call(this, { Action: "name/cos:InitiateMultipartUpload", method: "POST", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, action: "uploads", headers: e3.Headers, qs: e3.Query, tracker: i4 }, function(e4, n4) {
          return e4 ? (i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartInit" }), t3(e4)) : (n4 = o2.clone(n4 || {})) && n4.InitiateMultipartUploadResult ? t3(null, o2.extend(n4.InitiateMultipartUploadResult, { statusCode: n4.statusCode, headers: n4.headers })) : void t3(null, n4);
        });
      }, multipartUpload: function(e3, t3) {
        var n3 = this;
        o2.getFileSize("multipartUpload", e3, function() {
          var i4 = e3.tracker, a3 = n3.options.UploadCheckContentMd5;
          a3 && i4 && i4.setParams({ md5StartTime: (/* @__PURE__ */ new Date()).getTime() }), o2.getBodyMd5(a3, e3.Body, function(r4) {
            r4 && (e3.Headers["Content-MD5"] = o2.binaryBase64(r4), a3 && i4 && i4.setParams({ md5EndTime: (/* @__PURE__ */ new Date()).getTime() })), i4 && i4.setParams({ partNumber: e3.PartNumber }), f2.call(n3, { Action: "name/cos:UploadPart", TaskId: e3.TaskId, method: "PUT", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, qs: { partNumber: e3.PartNumber, uploadId: e3.UploadId }, headers: e3.Headers, onProgress: e3.onProgress, body: e3.Body || null, tracker: i4 }, function(e4, n4) {
              if (e4)
                return i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartUpload" }), t3(e4);
              t3(null, { ETag: o2.attr(n4.headers, "etag", {}), statusCode: n4.statusCode, headers: n4.headers });
            });
          });
        });
      }, multipartComplete: function(e3, t3) {
        for (var n3 = this, i4 = e3.UploadId, a3 = e3.Parts, r4 = e3.tracker, s4 = 0, l3 = a3.length; s4 < l3; s4++)
          0 !== a3[s4].ETag.indexOf('"') && (a3[s4].ETag = '"' + a3[s4].ETag + '"');
        var p4 = o2.json2xml({ CompleteMultipartUpload: { Part: a3 } }), u3 = e3.Headers;
        u3["Content-Type"] = "application/xml", u3["Content-MD5"] = o2.binaryBase64(o2.md5(p4)), f2.call(this, { Action: "name/cos:CompleteMultipartUpload", method: "POST", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, qs: { uploadId: i4 }, body: p4, headers: u3, tracker: r4 }, function(i5, a4) {
          if (i5)
            return r4 && r4.parent && r4.parent.setParams({ errorNode: "multipartComplete" }), t3(i5);
          var s5 = c2({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e3.Bucket, region: n3.options.UseAccelerate ? "accelerate" : e3.Region, object: e3.Key, isLocation: true }), l4 = a4.CompleteMultipartUploadResult || {}, p5 = o2.extend(l4, { Location: s5, statusCode: a4.statusCode, headers: a4.headers });
          t3(null, p5);
        });
      }, multipartList: function(e3, t3) {
        var n3 = {};
        n3.delimiter = e3.Delimiter, n3["encoding-type"] = e3.EncodingType, n3.prefix = e3.Prefix || "", n3["max-uploads"] = e3.MaxUploads, n3["key-marker"] = e3.KeyMarker, n3["upload-id-marker"] = e3.UploadIdMarker, n3 = o2.clearKey(n3);
        var i4 = e3.tracker;
        i4 && i4.setParams({ signStartTime: (/* @__PURE__ */ new Date()).getTime() }), f2.call(this, { Action: "name/cos:ListMultipartUploads", ResourceKey: n3.prefix, method: "GET", Bucket: e3.Bucket, Region: e3.Region, headers: e3.Headers, qs: n3, action: "uploads", tracker: i4 }, function(e4, n4) {
          if (e4)
            return i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartList" }), t3(e4);
          if (n4 && n4.ListMultipartUploadsResult) {
            var a3 = n4.ListMultipartUploadsResult.Upload || [], r4 = n4.ListMultipartUploadsResult.CommonPrefixes || [];
            r4 = o2.isArray(r4) ? r4 : [r4], a3 = o2.isArray(a3) ? a3 : [a3], n4.ListMultipartUploadsResult.Upload = a3, n4.ListMultipartUploadsResult.CommonPrefixes = r4;
          }
          var s4 = o2.clone(n4.ListMultipartUploadsResult || {});
          o2.extend(s4, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, multipartListPart: function(e3, t3) {
        var n3 = {}, i4 = e3.tracker;
        n3.uploadId = e3.UploadId, n3["encoding-type"] = e3.EncodingType, n3["max-parts"] = e3.MaxParts, n3["part-number-marker"] = e3.PartNumberMarker, f2.call(this, { Action: "name/cos:ListParts", method: "GET", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, qs: n3, tracker: i4 }, function(e4, n4) {
          if (e4)
            return i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartListPart" }), t3(e4);
          var a3 = n4.ListPartsResult || {}, r4 = a3.Part || [];
          r4 = o2.isArray(r4) ? r4 : [r4], a3.Part = r4;
          var s4 = o2.clone(a3);
          o2.extend(s4, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, multipartAbort: function(e3, t3) {
        var n3 = {};
        n3.uploadId = e3.UploadId, f2.call(this, { Action: "name/cos:AbortMultipartUpload", method: "DELETE", Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, headers: e3.Headers, qs: n3, tracker: e3.tracker }, function(e4, n4) {
          if (e4)
            return t3(e4);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, request: function(e3, t3) {
        f2.call(this, { method: e3.Method, Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, action: e3.Action, headers: e3.Headers, qs: e3.Query, body: e3.Body, Url: e3.Url, rawBody: e3.RawBody, dataType: e3.DataType, tracker: e3.tracker }, function(e4, n3) {
          if (e4)
            return t3(e4);
          n3 && n3.body && (n3.Body = n3.body, delete n3.body), t3(e4, n3);
        });
      }, getObjectUrl: function(e3, t3) {
        var n3 = this, i4 = void 0 === e3.UseAccelerate ? n3.options.UseAccelerate : e3.UseAccelerate, a3 = c2({ ForcePathStyle: n3.options.ForcePathStyle, protocol: e3.Protocol || n3.options.Protocol, domain: e3.Domain || n3.options.Domain, bucket: e3.Bucket, region: i4 ? "accelerate" : e3.Region, object: e3.Key }), r4 = "";
        e3.Query && (r4 += o2.obj2str(e3.Query)), e3.QueryString && (r4 += (r4 ? "&" : "") + e3.QueryString);
        var s4 = a3;
        if (void 0 !== e3.Sign && !e3.Sign)
          return r4 && (s4 += "?" + r4), t3(null, { Url: s4 }), s4;
        var u3 = l2.call(this, { Bucket: e3.Bucket, Region: e3.Region, UseAccelerate: e3.UseAccelerate, Url: a3 }), d3 = p3.call(this, { Action: "PUT" === (e3.Method || "").toUpperCase() ? "name/cos:PutObject" : "name/cos:GetObject", Bucket: e3.Bucket || "", Region: e3.Region || "", Method: e3.Method || "get", Key: e3.Key, Expires: e3.Expires, Headers: e3.Headers, Query: e3.Query, SignHost: u3, ForceSignHost: false !== e3.ForceSignHost && n3.options.ForceSignHost }, function(e4, n4) {
          if (t3)
            if (e4)
              t3(e4);
            else {
              var i5 = a3;
              i5 += "?" + (n4.Authorization.indexOf("q-signature") > -1 ? function(e5) {
                var t4 = e5.match(/q-url-param-list.*?(?=&)/g)[0], n5 = "q-url-param-list=" + encodeURIComponent(t4.replace(/q-url-param-list=/, "")).toLowerCase(), i6 = new RegExp(t4, "g");
                return e5.replace(i6, n5);
              }(n4.Authorization) : "sign=" + encodeURIComponent(n4.Authorization)), n4.SecurityToken && (i5 += "&x-cos-security-token=" + n4.SecurityToken), n4.ClientIP && (i5 += "&clientIP=" + n4.ClientIP), n4.ClientUA && (i5 += "&clientUA=" + n4.ClientUA), n4.Token && (i5 += "&token=" + n4.Token), r4 && (i5 += "&" + r4), setTimeout(function() {
                t3(null, { Url: i5 });
              });
            }
        });
        return d3 ? (s4 += "?" + d3.Authorization + (d3.SecurityToken ? "&x-cos-security-token=" + d3.SecurityToken : ""), r4 && (s4 += "&" + r4)) : r4 && (s4 += "?" + r4), s4;
      }, getAuth: function(e3) {
        return o2.getAuth({ SecretId: e3.SecretId || this.options.SecretId || "", SecretKey: e3.SecretKey || this.options.SecretKey || "", Bucket: e3.Bucket, Region: e3.Region, Method: e3.Method, Key: e3.Key, Query: e3.Query, Headers: e3.Headers, Expires: e3.Expires, SystemClockOffset: this.options.SystemClockOffset });
      } };
      e2.exports.init = function(e3, t3) {
        t3.transferToTaskMethod(h2, "postObject"), t3.transferToTaskMethod(h2, "putObject"), o2.each(h2, function(t4, n3) {
          e3.prototype[n3] = o2.apiWrapper(n3, t4);
        });
      };
    }, function(e2, t2) {
      function n2(e3) {
        return encodeURIComponent(e3).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
      }
      var i3 = function(e3, t3) {
        var i4, o2, a2, r3 = [], s3 = function(e4, t4) {
          var i5 = [];
          for (var o3 in e4)
            e4.hasOwnProperty(o3) && i5.push(t4 ? n2(o3).toLowerCase() : o3);
          return i5.sort(function(e5, t5) {
            return (e5 = e5.toLowerCase()) === (t5 = t5.toLowerCase()) ? 0 : e5 > t5 ? 1 : -1;
          });
        }(e3);
        for (i4 = 0; i4 < s3.length; i4++)
          a2 = void 0 === e3[o2 = s3[i4]] || null === e3[o2] ? "" : "" + e3[o2], o2 = t3 ? n2(o2).toLowerCase() : n2(o2), a2 = n2(a2) || "", r3.push(o2 + "=" + a2);
        return r3.join("&");
      };
      e2.exports = function(e3, t3) {
        var n3, o2 = e3.filePath, a2 = e3.headers || {}, r3 = e3.url || e3.Url, s3 = e3.method, c2 = e3.onProgress, l2 = e3.httpDNSServiceId, p3 = function(e4, n4) {
          var i4 = n4.header, o3 = {};
          if (i4)
            for (var a3 in i4)
              i4.hasOwnProperty(a3) && (o3[a3.toLowerCase()] = i4[a3]);
          t3(e4, { statusCode: n4.statusCode, headers: o3 }, n4.data);
        };
        if (o2) {
          var u2, d2 = r3.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/);
          e3.pathStyle ? (u2 = decodeURIComponent(d2[3] || ""), r3 = d2[1] + d2[2]) : (u2 = decodeURIComponent(d2[2] + d2[3] || ""), r3 = d2[1]);
          var f2 = { key: u2, success_action_status: 200, Signature: a2.Authorization }, m2 = ["Cache-Control", "Content-Type", "Content-Disposition", "Content-Encoding", "Expires", "x-cos-storage-class", "x-cos-security-token", "x-ci-security-token"];
          for (var h2 in e3.headers)
            e3.headers.hasOwnProperty(h2) && (h2.indexOf("x-cos-meta-") > -1 || m2.indexOf(h2) > -1) && (f2[h2] = e3.headers[h2]);
          a2["x-cos-acl"] && (f2.acl = a2["x-cos-acl"]), !f2["Content-Type"] && (f2["Content-Type"] = ""), (n3 = wx$1.uploadFile({ url: r3, method: s3, name: "file", header: a2, filePath: o2, formData: f2, timeout: e3.timeout, success: function(e4) {
            p3(null, e4);
          }, fail: function(e4) {
            p3(e4.errMsg, e4);
          } })).onProgressUpdate(function(e4) {
            c2 && c2({ loaded: e4.totalBytesSent, total: e4.totalBytesExpectedToSend, progress: e4.progress / 100 });
          });
        } else {
          var g2 = e3.qs && i3(e3.qs) || "";
          g2 && (r3 += (r3.indexOf("?") > -1 ? "&" : "?") + g2), a2["Content-Length"] && delete a2["Content-Length"];
          var v3 = { url: r3, method: s3, header: a2, dataType: "text", data: e3.body, responseType: e3.dataType || "text", timeout: e3.timeout, redirect: "manual", success: function(e4) {
            p3(null, e4);
          }, fail: function(e4) {
            p3(e4.errMsg, e4);
          } };
          l2 && Object.assign(v3, { enableHttpDNS: true, httpDNSServiceId: l2 }), n3 = wx$1.request(v3);
        }
        return n3;
      };
    }, function(e2, t2, n2) {
      let i3 = n2(29);
      e2.exports = new i3(n2(30), n2(31));
    }, function(e2, t2, n2) {
      function i3() {
        this._types = /* @__PURE__ */ Object.create(null), this._extensions = /* @__PURE__ */ Object.create(null);
        for (let e3 = 0; e3 < arguments.length; e3++)
          this.define(arguments[e3]);
        this.define = this.define.bind(this), this.getType = this.getType.bind(this), this.getExtension = this.getExtension.bind(this);
      }
      i3.prototype.define = function(e3, t3) {
        for (let n3 in e3) {
          let i4 = e3[n3].map(function(e4) {
            return e4.toLowerCase();
          });
          n3 = n3.toLowerCase();
          for (let e4 = 0; e4 < i4.length; e4++) {
            const o2 = i4[e4];
            if ("*" !== o2[0]) {
              if (!t3 && o2 in this._types)
                throw new Error('Attempt to change mapping for "' + o2 + '" extension from "' + this._types[o2] + '" to "' + n3 + '". Pass `force=true` to allow this, otherwise remove "' + o2 + '" from the list of extensions for "' + n3 + '".');
              this._types[o2] = n3;
            }
          }
          if (t3 || !this._extensions[n3]) {
            const e4 = i4[0];
            this._extensions[n3] = "*" !== e4[0] ? e4 : e4.substr(1);
          }
        }
      }, i3.prototype.getType = function(e3) {
        let t3 = (e3 = String(e3)).replace(/^.*[/\\]/, "").toLowerCase(), n3 = t3.replace(/^.*\./, "").toLowerCase(), i4 = t3.length < e3.length;
        return (n3.length < t3.length - 1 || !i4) && this._types[n3] || null;
      }, i3.prototype.getExtension = function(e3) {
        return (e3 = /^\s*([^;\s]*)/.test(e3) && RegExp.$1) && this._extensions[e3.toLowerCase()] || null;
      }, e2.exports = i3;
    }, function(e2, t2) {
      e2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
    }, function(e2, t2) {
      e2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
    }, function(e2, t2, n2) {
      function i3() {
        /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
        i3 = function() {
          return t3;
        };
        var e3, t3 = {}, n3 = Object.prototype, a3 = n3.hasOwnProperty, r4 = Object.defineProperty || function(e4, t4, n4) {
          e4[t4] = n4.value;
        }, s4 = "function" == typeof Symbol ? Symbol : {}, c3 = s4.iterator || "@@iterator", l3 = s4.asyncIterator || "@@asyncIterator", p4 = s4.toStringTag || "@@toStringTag";
        function u3(e4, t4, n4) {
          return Object.defineProperty(e4, t4, { value: n4, enumerable: true, configurable: true, writable: true }), e4[t4];
        }
        try {
          u3({}, "");
        } catch (e4) {
          u3 = function(e5, t4, n4) {
            return e5[t4] = n4;
          };
        }
        function d3(e4, t4, n4, i4) {
          var o3 = t4 && t4.prototype instanceof x3 ? t4 : x3, a4 = Object.create(o3.prototype), s5 = new j2(i4 || []);
          return r4(a4, "_invoke", { value: A2(e4, n4, s5) }), a4;
        }
        function f3(e4, t4, n4) {
          try {
            return { type: "normal", arg: e4.call(t4, n4) };
          } catch (e5) {
            return { type: "throw", arg: e5 };
          }
        }
        t3.wrap = d3;
        var m3 = "suspendedStart", h3 = "suspendedYield", g3 = "executing", v4 = "completed", y3 = {};
        function x3() {
        }
        function k3() {
        }
        function b3() {
        }
        var C3 = {};
        u3(C3, c3, function() {
          return this;
        });
        var S2 = Object.getPrototypeOf, w2 = S2 && S2(S2(I2([])));
        w2 && w2 !== n3 && a3.call(w2, c3) && (C3 = w2);
        var T2 = b3.prototype = x3.prototype = Object.create(C3);
        function R2(e4) {
          ["next", "throw", "return"].forEach(function(t4) {
            u3(e4, t4, function(e5) {
              return this._invoke(t4, e5);
            });
          });
        }
        function B2(e4, t4) {
          function n4(i5, r5, s5, c4) {
            var l4 = f3(e4[i5], e4, r5);
            if ("throw" !== l4.type) {
              var p5 = l4.arg, u4 = p5.value;
              return u4 && "object" == o2(u4) && a3.call(u4, "__await") ? t4.resolve(u4.__await).then(function(e5) {
                n4("next", e5, s5, c4);
              }, function(e5) {
                n4("throw", e5, s5, c4);
              }) : t4.resolve(u4).then(function(e5) {
                p5.value = e5, s5(p5);
              }, function(e5) {
                return n4("throw", e5, s5, c4);
              });
            }
            c4(l4.arg);
          }
          var i4;
          r4(this, "_invoke", { value: function(e5, o3) {
            function a4() {
              return new t4(function(t5, i5) {
                n4(e5, o3, t5, i5);
              });
            }
            return i4 = i4 ? i4.then(a4, a4) : a4();
          } });
        }
        function A2(t4, n4, i4) {
          var o3 = m3;
          return function(a4, r5) {
            if (o3 === g3)
              throw Error("Generator is already running");
            if (o3 === v4) {
              if ("throw" === a4)
                throw r5;
              return { value: e3, done: true };
            }
            for (i4.method = a4, i4.arg = r5; ; ) {
              var s5 = i4.delegate;
              if (s5) {
                var c4 = P2(s5, i4);
                if (c4) {
                  if (c4 === y3)
                    continue;
                  return c4;
                }
              }
              if ("next" === i4.method)
                i4.sent = i4._sent = i4.arg;
              else if ("throw" === i4.method) {
                if (o3 === m3)
                  throw o3 = v4, i4.arg;
                i4.dispatchException(i4.arg);
              } else
                "return" === i4.method && i4.abrupt("return", i4.arg);
              o3 = g3;
              var l4 = f3(t4, n4, i4);
              if ("normal" === l4.type) {
                if (o3 = i4.done ? v4 : h3, l4.arg === y3)
                  continue;
                return { value: l4.arg, done: i4.done };
              }
              "throw" === l4.type && (o3 = v4, i4.method = "throw", i4.arg = l4.arg);
            }
          };
        }
        function P2(t4, n4) {
          var i4 = n4.method, o3 = t4.iterator[i4];
          if (o3 === e3)
            return n4.delegate = null, "throw" === i4 && t4.iterator.return && (n4.method = "return", n4.arg = e3, P2(t4, n4), "throw" === n4.method) || "return" !== i4 && (n4.method = "throw", n4.arg = new TypeError("The iterator does not provide a '" + i4 + "' method")), y3;
          var a4 = f3(o3, t4.iterator, n4.arg);
          if ("throw" === a4.type)
            return n4.method = "throw", n4.arg = a4.arg, n4.delegate = null, y3;
          var r5 = a4.arg;
          return r5 ? r5.done ? (n4[t4.resultName] = r5.value, n4.next = t4.nextLoc, "return" !== n4.method && (n4.method = "next", n4.arg = e3), n4.delegate = null, y3) : r5 : (n4.method = "throw", n4.arg = new TypeError("iterator result is not an object"), n4.delegate = null, y3);
        }
        function E2(e4) {
          var t4 = { tryLoc: e4[0] };
          1 in e4 && (t4.catchLoc = e4[1]), 2 in e4 && (t4.finallyLoc = e4[2], t4.afterLoc = e4[3]), this.tryEntries.push(t4);
        }
        function O2(e4) {
          var t4 = e4.completion || {};
          t4.type = "normal", delete t4.arg, e4.completion = t4;
        }
        function j2(e4) {
          this.tryEntries = [{ tryLoc: "root" }], e4.forEach(E2, this), this.reset(true);
        }
        function I2(t4) {
          if (t4 || "" === t4) {
            var n4 = t4[c3];
            if (n4)
              return n4.call(t4);
            if ("function" == typeof t4.next)
              return t4;
            if (!isNaN(t4.length)) {
              var i4 = -1, r5 = function n5() {
                for (; ++i4 < t4.length; )
                  if (a3.call(t4, i4))
                    return n5.value = t4[i4], n5.done = false, n5;
                return n5.value = e3, n5.done = true, n5;
              };
              return r5.next = r5;
            }
          }
          throw new TypeError(o2(t4) + " is not iterable");
        }
        return k3.prototype = b3, r4(T2, "constructor", { value: b3, configurable: true }), r4(b3, "constructor", { value: k3, configurable: true }), k3.displayName = u3(b3, p4, "GeneratorFunction"), t3.isGeneratorFunction = function(e4) {
          var t4 = "function" == typeof e4 && e4.constructor;
          return !!t4 && (t4 === k3 || "GeneratorFunction" === (t4.displayName || t4.name));
        }, t3.mark = function(e4) {
          return Object.setPrototypeOf ? Object.setPrototypeOf(e4, b3) : (e4.__proto__ = b3, u3(e4, p4, "GeneratorFunction")), e4.prototype = Object.create(T2), e4;
        }, t3.awrap = function(e4) {
          return { __await: e4 };
        }, R2(B2.prototype), u3(B2.prototype, l3, function() {
          return this;
        }), t3.AsyncIterator = B2, t3.async = function(e4, n4, i4, o3, a4) {
          void 0 === a4 && (a4 = Promise);
          var r5 = new B2(d3(e4, n4, i4, o3), a4);
          return t3.isGeneratorFunction(n4) ? r5 : r5.next().then(function(e5) {
            return e5.done ? e5.value : r5.next();
          });
        }, R2(T2), u3(T2, p4, "Generator"), u3(T2, c3, function() {
          return this;
        }), u3(T2, "toString", function() {
          return "[object Generator]";
        }), t3.keys = function(e4) {
          var t4 = Object(e4), n4 = [];
          for (var i4 in t4)
            n4.push(i4);
          return n4.reverse(), function e5() {
            for (; n4.length; ) {
              var i5 = n4.pop();
              if (i5 in t4)
                return e5.value = i5, e5.done = false, e5;
            }
            return e5.done = true, e5;
          };
        }, t3.values = I2, j2.prototype = { constructor: j2, reset: function(t4) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = e3, this.done = false, this.delegate = null, this.method = "next", this.arg = e3, this.tryEntries.forEach(O2), !t4)
            for (var n4 in this)
              "t" === n4.charAt(0) && a3.call(this, n4) && !isNaN(+n4.slice(1)) && (this[n4] = e3);
        }, stop: function() {
          this.done = true;
          var e4 = this.tryEntries[0].completion;
          if ("throw" === e4.type)
            throw e4.arg;
          return this.rval;
        }, dispatchException: function(t4) {
          if (this.done)
            throw t4;
          var n4 = this;
          function i4(i5, o4) {
            return s5.type = "throw", s5.arg = t4, n4.next = i5, o4 && (n4.method = "next", n4.arg = e3), !!o4;
          }
          for (var o3 = this.tryEntries.length - 1; o3 >= 0; --o3) {
            var r5 = this.tryEntries[o3], s5 = r5.completion;
            if ("root" === r5.tryLoc)
              return i4("end");
            if (r5.tryLoc <= this.prev) {
              var c4 = a3.call(r5, "catchLoc"), l4 = a3.call(r5, "finallyLoc");
              if (c4 && l4) {
                if (this.prev < r5.catchLoc)
                  return i4(r5.catchLoc, true);
                if (this.prev < r5.finallyLoc)
                  return i4(r5.finallyLoc);
              } else if (c4) {
                if (this.prev < r5.catchLoc)
                  return i4(r5.catchLoc, true);
              } else {
                if (!l4)
                  throw Error("try statement without catch or finally");
                if (this.prev < r5.finallyLoc)
                  return i4(r5.finallyLoc);
              }
            }
          }
        }, abrupt: function(e4, t4) {
          for (var n4 = this.tryEntries.length - 1; n4 >= 0; --n4) {
            var i4 = this.tryEntries[n4];
            if (i4.tryLoc <= this.prev && a3.call(i4, "finallyLoc") && this.prev < i4.finallyLoc) {
              var o3 = i4;
              break;
            }
          }
          o3 && ("break" === e4 || "continue" === e4) && o3.tryLoc <= t4 && t4 <= o3.finallyLoc && (o3 = null);
          var r5 = o3 ? o3.completion : {};
          return r5.type = e4, r5.arg = t4, o3 ? (this.method = "next", this.next = o3.finallyLoc, y3) : this.complete(r5);
        }, complete: function(e4, t4) {
          if ("throw" === e4.type)
            throw e4.arg;
          return "break" === e4.type || "continue" === e4.type ? this.next = e4.arg : "return" === e4.type ? (this.rval = this.arg = e4.arg, this.method = "return", this.next = "end") : "normal" === e4.type && t4 && (this.next = t4), y3;
        }, finish: function(e4) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.finallyLoc === e4)
              return this.complete(n4.completion, n4.afterLoc), O2(n4), y3;
          }
        }, catch: function(e4) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.tryLoc === e4) {
              var i4 = n4.completion;
              if ("throw" === i4.type) {
                var o3 = i4.arg;
                O2(n4);
              }
              return o3;
            }
          }
          throw Error("illegal catch attempt");
        }, delegateYield: function(t4, n4, i4) {
          return this.delegate = { iterator: I2(t4), resultName: n4, nextLoc: i4 }, "next" === this.method && (this.arg = e3), y3;
        } }, t3;
      }
      function o2(e3) {
        return o2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
          return typeof e4;
        } : function(e4) {
          return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
        }, o2(e3);
      }
      function a2(e3, t3, n3, i4, o3, a3, r4) {
        try {
          var s4 = e3[a3](r4), c3 = s4.value;
        } catch (e4) {
          return void n3(e4);
        }
        s4.done ? t3(c3) : Promise.resolve(c3).then(i4, o3);
      }
      function r3(e3) {
        return function() {
          var t3 = this, n3 = arguments;
          return new Promise(function(i4, o3) {
            var r4 = e3.apply(t3, n3);
            function s4(e4) {
              a2(r4, i4, o3, s4, c3, "next", e4);
            }
            function c3(e4) {
              a2(r4, i4, o3, s4, c3, "throw", e4);
            }
            s4(void 0);
          });
        };
      }
      var s3 = n2(7), c2 = n2(33), l2 = n2(6).EventProxy, p3 = n2(0), u2 = n2(2);
      function d2(e3, t3) {
        var n3 = e3.TaskId, i4 = e3.Bucket, o3 = e3.Region, a3 = e3.Key, r4 = e3.StorageClass, u3 = this, d3 = {}, h3 = e3.FileSize, g3 = e3.SliceSize, v4 = Math.ceil(h3 / g3), y3 = 0, x3 = p3.throttleOnProgress.call(u3, h3, e3.onHashProgress), k3 = function(t4, n4) {
          var i5 = t4.length;
          if (0 === i5)
            return n4(null, true);
          if (i5 > v4)
            return n4(null, false);
          if (i5 > 1 && Math.max(t4[0].Size, t4[1].Size) !== g3)
            return n4(null, false);
          !function o4(a4) {
            if (a4 < i5) {
              var r5 = t4[a4];
              !function(t5, n5) {
                var i6 = g3 * (t5 - 1), o5 = Math.min(i6 + g3, h3), a5 = o5 - i6;
                d3[t5] ? n5(null, { PartNumber: t5, ETag: d3[t5], Size: a5 }) : p3.fileSlice(e3.FilePath, i6, o5, function(e4) {
                  try {
                    var i7 = p3.getFileMd5(e4);
                  } catch (e5) {
                    return n5(e5);
                  }
                  var o6 = '"' + i7 + '"';
                  d3[t5] = o6, y3 += a5, n5(null, { PartNumber: t5, ETag: o6, Size: a5 }), x3({ loaded: y3, total: h3 });
                });
              }(r5.PartNumber, function(e4, t5) {
                t5 && t5.ETag === r5.ETag && t5.Size === r5.Size ? o4(a4 + 1) : n4(null, false);
              });
            } else
              n4(null, true);
          }(0);
        }, b3 = new l2();
        b3.on("error", function(e4) {
          if (u3._isRunningTask(n3))
            return t3(e4);
        }), b3.on("upload_id_available", function(e4) {
          var n4 = {}, i5 = [];
          p3.each(e4.PartList, function(e5) {
            n4[e5.PartNumber] = e5;
          });
          for (var o4 = 1; o4 <= v4; o4++) {
            var a4 = n4[o4];
            a4 ? (a4.PartNumber = o4, a4.Uploaded = true) : a4 = { PartNumber: o4, ETag: null, Uploaded: false }, i5.push(a4);
          }
          e4.PartList = i5, t3(null, e4);
        }), b3.on("no_available_upload_id", function() {
          if (u3._isRunningTask(n3)) {
            var s4 = p3.extend({ Bucket: i4, Region: o3, Key: a3, Headers: p3.clone(e3.Headers), Query: p3.clone(e3.Query), StorageClass: r4, calledBySdk: "sliceUploadFile", tracker: e3.tracker }, e3);
            u3.multipartInit(s4, function(e4, i5) {
              if (u3._isRunningTask(n3)) {
                if (e4)
                  return b3.emit("error", e4);
                var o4 = i5.UploadId;
                if (!o4)
                  return t3({ Message: "no upload id" });
                b3.emit("upload_id_available", { UploadId: o4, PartList: [] });
              }
            });
          }
        }), b3.on("has_and_check_upload_id", function(t4) {
          t4 = t4.reverse(), c2.eachLimit(t4, 1, function(t5, r5) {
            u3._isRunningTask(n3) && (s3.using[t5] ? r5() : m2.call(u3, { Bucket: i4, Region: o3, Key: a3, UploadId: t5, tracker: e3.tracker }, function(e4, i5) {
              if (u3._isRunningTask(n3)) {
                if (e4)
                  return s3.removeUsing(t5), b3.emit("error", e4);
                var o4 = i5.PartList;
                o4.forEach(function(e5) {
                  e5.PartNumber *= 1, e5.Size *= 1, e5.ETag = e5.ETag || "";
                }), k3(o4, function(e5, i6) {
                  if (u3._isRunningTask(n3))
                    return e5 ? b3.emit("error", e5) : void (i6 ? r5({ UploadId: t5, PartList: o4 }) : r5());
                });
              }
            }));
          }, function(e4) {
            u3._isRunningTask(n3) && (x3(null, true), e4 && e4.UploadId ? b3.emit("upload_id_available", e4) : b3.emit("no_available_upload_id"));
          });
        }), b3.on("seek_local_avail_upload_id", function(t4) {
          var r5 = s3.getFileId(e3.FileStat, e3.ChunkSize, i4, a3), c3 = s3.getUploadIdList(r5);
          if (r5 && c3) {
            !function r6(l3) {
              if (l3 >= c3.length)
                b3.emit("has_and_check_upload_id", t4);
              else {
                var d4 = c3[l3];
                if (!p3.isInArray(t4, d4))
                  return s3.removeUploadId(d4), void r6(l3 + 1);
                s3.using[d4] ? r6(l3 + 1) : m2.call(u3, { Bucket: i4, Region: o3, Key: a3, UploadId: d4, tracker: e3.tracker }, function(e4, t5) {
                  u3._isRunningTask(n3) && (e4 ? (s3.removeUploadId(d4), r6(l3 + 1)) : b3.emit("upload_id_available", { UploadId: d4, PartList: t5.PartList }));
                });
              }
            }(0);
          } else
            b3.emit("has_and_check_upload_id", t4);
        }), b3.on("get_remote_upload_id_list", function() {
          f2.call(u3, { Bucket: i4, Region: o3, Key: a3, tracker: e3.tracker }, function(t4, o4) {
            if (u3._isRunningTask(n3)) {
              if (t4)
                return b3.emit("error", t4);
              var c3 = p3.filter(o4.UploadList, function(e4) {
                return e4.Key === a3 && (!r4 || e4.StorageClass.toUpperCase() === r4.toUpperCase());
              }).reverse().map(function(e4) {
                return e4.UploadId || e4.UploadID;
              });
              if (c3.length)
                b3.emit("seek_local_avail_upload_id", c3);
              else {
                var l3, d4 = s3.getFileId(e3.FileStat, e3.ChunkSize, i4, a3);
                d4 && (l3 = s3.getUploadIdList(d4)) && p3.each(l3, function(e4) {
                  s3.removeUploadId(e4);
                }), b3.emit("no_available_upload_id");
              }
            }
          });
        }), b3.emit("get_remote_upload_id_list");
      }
      function f2(e3, t3) {
        var n3 = this, i4 = [], o3 = { Bucket: e3.Bucket, Region: e3.Region, Prefix: e3.Key, calledBySdk: e3.calledBySdk || "sliceUploadFile", tracker: e3.tracker };
        !function e4() {
          n3.multipartList(o3, function(n4, a3) {
            if (n4)
              return t3(n4);
            i4.push.apply(i4, a3.Upload || []), "true" === a3.IsTruncated ? (o3.KeyMarker = a3.NextKeyMarker, o3.UploadIdMarker = a3.NextUploadIdMarker, e4()) : t3(null, { UploadList: i4 });
          });
        }();
      }
      function m2(e3, t3) {
        var n3 = this, i4 = [], o3 = { Bucket: e3.Bucket, Region: e3.Region, Key: e3.Key, UploadId: e3.UploadId, calledBySdk: "sliceUploadFile", tracker: e3.tracker };
        !function e4() {
          n3.multipartListPart(o3, function(n4, a3) {
            if (n4)
              return t3(n4);
            i4.push.apply(i4, a3.Part || []), "true" === a3.IsTruncated ? (o3.PartNumberMarker = a3.NextPartNumberMarker, e4()) : t3(null, { PartList: i4 });
          });
        }();
      }
      function h2(e3, t3) {
        var n3 = this, i4 = e3.TaskId, o3 = e3.Bucket, a3 = e3.Region, r4 = e3.Key, s4 = e3.UploadData, l3 = e3.FileSize, u3 = e3.SliceSize, d3 = Math.min(e3.AsyncLimit || n3.options.ChunkParallelLimit || 1, 256), f3 = e3.FilePath, m3 = Math.ceil(l3 / u3), h3 = 0, v4 = e3.ServerSideEncryption, y3 = p3.filter(s4.PartList, function(e4) {
          return e4.Uploaded && (h3 += e4.PartNumber >= m3 && l3 % u3 || u3), !e4.Uploaded;
        }), x3 = e3.onProgress;
        c2.eachLimit(y3, d3, function(t4, c3) {
          if (n3._isRunningTask(i4)) {
            var p4 = t4.PartNumber, d4 = Math.min(l3, t4.PartNumber * u3) - (t4.PartNumber - 1) * u3, m4 = 0;
            g2.call(n3, { TaskId: i4, Bucket: o3, Region: a3, Key: r4, SliceSize: u3, FileSize: l3, PartNumber: p4, ServerSideEncryption: v4, FilePath: f3, UploadData: s4, onProgress: function(e4) {
              h3 += e4.loaded - m4, m4 = e4.loaded, x3({ loaded: h3, total: l3 });
            }, tracker: e3.tracker }, function(e4, o4) {
              n3._isRunningTask(i4) && (e4 ? h3 -= m4 : (h3 += d4 - m4, t4.ETag = o4.ETag), x3({ loaded: h3, total: l3 }), c3(e4 || null, o4));
            });
          }
        }, function(e4) {
          if (n3._isRunningTask(i4))
            return e4 ? t3(e4) : void t3(null, { UploadId: s4.UploadId, SliceList: s4.PartList });
        });
      }
      function g2(e3, t3) {
        var n3 = this, i4 = e3.TaskId, o3 = e3.Bucket, a3 = e3.Region, r4 = e3.Key, s4 = e3.FileSize, l3 = e3.FilePath, u3 = 1 * e3.PartNumber, d3 = e3.SliceSize, f3 = e3.ServerSideEncryption, m3 = e3.UploadData, h3 = n3.options.ChunkRetryTimes + 1, g3 = e3.Headers || {}, v4 = d3 * (u3 - 1), y3 = d3, x3 = v4 + d3;
        x3 > s4 && (y3 = (x3 = s4) - v4);
        var k3 = ["x-cos-traffic-limit", "x-cos-mime-limit"], b3 = {};
        p3.each(g3, function(e4, t4) {
          k3.indexOf(t4) > -1 && (b3[t4] = e4);
        }), p3.fileSlice(l3, v4, x3, function(s5) {
          var l4 = p3.getFileMd5(s5), d4 = l4 ? p3.binaryBase64(l4) : null, g4 = m3.PartList[u3 - 1];
          c2.retry(h3, function(t4) {
            n3._isRunningTask(i4) && n3.multipartUpload({ TaskId: i4, Bucket: o3, Region: a3, Key: r4, ContentLength: y3, PartNumber: u3, UploadId: m3.UploadId, ServerSideEncryption: f3, Body: s5, Headers: b3, onProgress: e3.onProgress, ContentMD5: d4, calledBySdk: "sliceUploadFile", tracker: e3.tracker }, function(e4, o4) {
              if (n3._isRunningTask(i4))
                return e4 ? t4(e4) : (g4.Uploaded = true, t4(null, o4));
            });
          }, function(e4, o4) {
            if (n3._isRunningTask(i4))
              return t3(e4, o4);
          });
        });
      }
      function v3(e3, t3) {
        var n3 = e3.Bucket, i4 = e3.Region, o3 = e3.Key, a3 = e3.UploadId, r4 = e3.SliceList, s4 = this, l3 = this.options.ChunkRetryTimes + 1, p4 = r4.map(function(e4) {
          return { PartNumber: e4.PartNumber, ETag: e4.ETag };
        });
        c2.retry(l3, function(t4) {
          s4.multipartComplete({ Bucket: n3, Region: i4, Key: o3, UploadId: a3, Parts: p4, calledBySdk: "sliceUploadFile", Headers: e3.Headers || {}, tracker: e3.tracker }, t4);
        }, function(e4, n4) {
          t3(e4, n4);
        });
      }
      function y2(e3, t3) {
        var n3 = e3.Bucket, i4 = e3.Region, o3 = e3.Key, a3 = e3.AbortArray, r4 = e3.AsyncLimit || 1, s4 = this, l3 = 0, p4 = new Array(a3.length);
        c2.eachLimit(a3, r4, function(t4, a4) {
          var r5 = l3;
          if (o3 && o3 !== t4.Key)
            return p4[r5] = { error: { KeyNotMatch: true } }, void a4(null);
          var c3 = t4.UploadId || t4.UploadID;
          s4.multipartAbort({ Bucket: n3, Region: i4, Key: t4.Key, Headers: e3.Headers, UploadId: c3 }, function(e4) {
            var o4 = { Bucket: n3, Region: i4, Key: t4.Key, UploadId: c3 };
            p4[r5] = { error: e4, task: o4 }, a4(null);
          }), l3++;
        }, function(e4) {
          if (e4)
            return t3(e4);
          for (var n4 = [], i5 = [], o4 = 0, a4 = p4.length; o4 < a4; o4++) {
            var r5 = p4[o4];
            r5.task && (r5.error ? i5.push(r5.task) : n4.push(r5.task));
          }
          return t3(null, { successList: n4, errorList: i5 });
        });
      }
      function x2() {
        return (x2 = r3(i3().mark(function e3(t3, n3) {
          var a3, r4, s4, c3, l3, d3, f3, m3, h3, g3, v4, y3;
          return i3().wrap(function(e4) {
            for (; ; )
              switch (e4.prev = e4.next) {
                case 0:
                  return a3 = this, r4 = void 0 === t3.SliceSize ? a3.options.SliceSize : t3.SliceSize, s4 = [], e4.prev = 3, e4.next = 6, p3.getFileSizeByPath(t3.FilePath);
                case 6:
                  c3 = e4.sent, e4.next = 13;
                  break;
                case 9:
                  return e4.prev = 9, e4.t0 = e4.catch(3), n3({ error: e4.t0 }), e4.abrupt("return");
                case 13:
                  l3 = { TaskId: "" }, a3.options.EnableReporter && (d3 = a3.options.UseAccelerate || "string" == typeof a3.options.Domain && a3.options.Domain.includes("accelerate."), f3 = c3 > r4 ? "sliceUploadFile" : "putObject", t3.tracker = new u2({ Beacon: a3.options.BeaconReporter, clsReporter: a3.options.ClsReporter, bucket: t3.Bucket, region: t3.Region, apiName: "uploadFile", realApi: f3, fileKey: t3.Key, fileSize: c3, accelerate: d3, deepTracker: a3.options.DeepTracker, customId: a3.options.CustomId, delay: a3.options.TrackerDelay })), p3.each(t3, function(e5, t4) {
                    "object" !== o2(e5) && "function" != typeof e5 && (l3[t4] = e5);
                  }), m3 = t3.onTaskReady, t3.onTaskReady = function(e5) {
                    l3.TaskId = e5, m3 && m3(e5);
                  }, h3 = t3.onFileFinish, g3 = function(e5, i4) {
                    t3.tracker && t3.tracker.report(e5, i4), h3 && h3(e5, i4, l3), n3 && n3(e5, i4);
                  }, v4 = "postObject" === a3.options.SimpleUploadMethod ? "postObject" : "putObject", y3 = c3 > r4 ? "sliceUploadFile" : v4, s4.push({ api: y3, params: t3, callback: g3 }), a3._addTasks(s4);
                case 24:
                case "end":
                  return e4.stop();
              }
          }, e3, this, [[3, 9]]);
        }))).apply(this, arguments);
      }
      function k2() {
        return k2 = r3(i3().mark(function e3(t3, n3) {
          var a3, s4, c3, l3, d3, f3, m3, h3, g3, v4, y3;
          return i3().wrap(function(e4) {
            for (; ; )
              switch (e4.prev = e4.next) {
                case 0:
                  return a3 = this, s4 = void 0 === t3.SliceSize ? a3.options.SliceSize : t3.SliceSize, c3 = 0, l3 = 0, d3 = p3.throttleOnProgress.call(a3, l3, t3.onProgress), f3 = t3.files.length, m3 = t3.onFileFinish, h3 = Array(f3), g3 = function(e5, t4, i4) {
                    d3(null, true), m3 && m3(e5, t4, i4), h3[i4.Index] = { options: i4, error: e5, data: t4 }, --f3 <= 0 && n3 && n3(null, { files: h3 });
                  }, v4 = [], y3 = function() {
                    return t3.files.map(function(e5, t4) {
                      return new Promise(function() {
                        var n4 = r3(i3().mark(function n5(r4) {
                          var f4, m4, h4, y4, x3, k3, b3, C3, S2, w2, T2;
                          return i3().wrap(function(n6) {
                            for (; ; )
                              switch (n6.prev = n6.next) {
                                case 0:
                                  return f4 = 0, n6.prev = 1, n6.next = 4, p3.getFileSizeByPath(e5.FilePath);
                                case 4:
                                  f4 = n6.sent, n6.next = 9;
                                  break;
                                case 7:
                                  n6.prev = 7, n6.t0 = n6.catch(1);
                                case 9:
                                  m4 = { Index: t4, TaskId: "" }, c3 += f4, a3.options.EnableReporter && (h4 = a3.options.UseAccelerate || "string" == typeof a3.options.Domain && a3.options.Domain.includes("accelerate."), y4 = f4 > s4 ? "sliceUploadFile" : "putObject", e5.tracker = new u2({ Beacon: a3.options.BeaconReporter, clsReporter: a3.options.ClsReporter, bucket: e5.Bucket, region: e5.Region, apiName: "uploadFiles", realApi: y4, fileKey: e5.Key, fileSize: f4, accelerate: h4, deepTracker: a3.options.DeepTracker, customId: a3.options.CustomId, delay: a3.options.TrackerDelay })), p3.each(e5, function(e6, t5) {
                                    "object" !== o2(e6) && "function" != typeof e6 && (m4[t5] = e6);
                                  }), x3 = e5.onTaskReady, e5.onTaskReady = function(e6) {
                                    m4.TaskId = e6, x3 && x3(e6);
                                  }, k3 = 0, b3 = e5.onProgress, e5.onProgress = function(e6) {
                                    l3 = l3 - k3 + e6.loaded, k3 = e6.loaded, b3 && b3(e6), d3({ loaded: l3, total: c3 });
                                  }, C3 = e5.onFileFinish, S2 = function(t5, n7) {
                                    e5.tracker && e5.tracker.report(t5, n7), C3 && C3(t5, n7), g3 && g3(t5, n7, m4);
                                  }, w2 = "postObject" === a3.options.SimpleUploadMethod ? "postObject" : "putObject", T2 = f4 > s4 ? "sliceUploadFile" : w2, v4.push({ api: T2, params: e5, callback: S2 }), r4(true);
                                case 24:
                                case "end":
                                  return n6.stop();
                              }
                          }, n5, null, [[1, 7]]);
                        }));
                        return function(e6) {
                          return n4.apply(this, arguments);
                        };
                      }());
                    });
                  }, e4.next = 13, Promise.all(y3());
                case 13:
                  a3._addTasks(v4);
                case 14:
                case "end":
                  return e4.stop();
              }
          }, e3, this);
        })), k2.apply(this, arguments);
      }
      function b2(e3, t3) {
        var n3 = e3.TaskId, i4 = e3.Bucket, o3 = e3.Region, a3 = e3.Key, r4 = e3.CopySource, s4 = e3.UploadId, l3 = 1 * e3.PartNumber, p4 = e3.CopySourceRange, u3 = this.options.ChunkRetryTimes + 1, d3 = this;
        c2.retry(u3, function(t4) {
          d3.uploadPartCopy({ TaskId: n3, Bucket: i4, Region: o3, Key: a3, CopySource: r4, UploadId: s4, PartNumber: l3, CopySourceRange: p4, onProgress: e3.onProgress, tracker: e3.tracker, calledBySdk: e3.calledBySdk }, function(e4, n4) {
            t4(e4 || null, n4);
          });
        }, function(e4, n4) {
          return t3(e4, n4);
        });
      }
      var C2 = { sliceUploadFile: function(e3, t3) {
        var n3 = this;
        if (!p3.canFileSlice())
          return e3.SkipTask = true, void ("postObject" === n3.options.SimpleUploadMethod ? n3.postObject(e3, t3) : n3.putObject(e3, t3));
        var i4, o3, a3 = new l2(), r4 = e3.TaskId, c3 = e3.Bucket, u3 = e3.Region, f3 = e3.Key, m3 = e3.FilePath, g3 = e3.ChunkSize || e3.SliceSize || n3.options.ChunkSize, y3 = e3.AsyncLimit, x3 = e3.StorageClass, k3 = e3.ServerSideEncryption, b3 = e3.onHashProgress, C3 = e3.tracker;
        C3 && C3.setParams({ chunkSize: g3 }), a3.on("error", function(i5) {
          if (n3._isRunningTask(r4)) {
            var o4 = { UploadId: e3.UploadData.UploadId || "", err: i5, error: i5 };
            return t3(o4);
          }
        }), a3.on("upload_complete", function(n4) {
          var i5 = p3.extend({ UploadId: e3.UploadData.UploadId || "" }, n4);
          t3(null, i5);
        }), a3.on("upload_slice_complete", function(t4) {
          var l3 = {};
          p3.each(e3.Headers, function(e4, t5) {
            var n4 = t5.toLowerCase();
            0 !== n4.indexOf("x-cos-meta-") && "pic-operations" !== n4 || (l3[t5] = e4);
          }), v3.call(n3, { Bucket: c3, Region: u3, Key: f3, UploadId: t4.UploadId, SliceList: t4.SliceList, Headers: l3, tracker: C3 }, function(e4, c4) {
            if (n3._isRunningTask(r4)) {
              if (s3.removeUsing(t4.UploadId), e4)
                return o3(null, true), a3.emit("error", e4);
              s3.removeUploadId(t4.UploadId), o3({ loaded: i4, total: i4 }, true), a3.emit("upload_complete", c4);
            }
          });
        }), a3.on("get_upload_data_finish", function(t4) {
          var l3 = s3.getFileId(e3.FileStat, e3.ChunkSize, c3, f3);
          l3 && s3.saveUploadId(l3, t4.UploadId, n3.options.UploadIdCacheLimit), s3.setUsing(t4.UploadId), o3(null, true), h2.call(n3, { TaskId: r4, Bucket: c3, Region: u3, Key: f3, FilePath: m3, FileSize: i4, SliceSize: g3, AsyncLimit: y3, ServerSideEncryption: k3, UploadData: t4, onProgress: o3, tracker: C3 }, function(e4, t5) {
            if (n3._isRunningTask(r4))
              return e4 ? (o3(null, true), a3.emit("error", e4)) : void a3.emit("upload_slice_complete", t5);
          });
        }), a3.on("get_file_size_finish", function() {
          if (o3 = p3.throttleOnProgress.call(n3, i4, e3.onProgress), e3.UploadData.UploadId)
            a3.emit("get_upload_data_finish", e3.UploadData);
          else {
            var t4 = p3.extend({ TaskId: r4, Bucket: c3, Region: u3, Key: f3, Headers: e3.Headers, StorageClass: x3, FilePath: m3, FileSize: i4, SliceSize: g3, onHashProgress: b3, tracker: C3 }, e3);
            t4.FileSize = i4, d2.call(n3, t4, function(t5, i5) {
              if (n3._isRunningTask(r4)) {
                if (t5)
                  return a3.emit("error", t5);
                e3.UploadData.UploadId = i5.UploadId, e3.UploadData.PartList = i5.PartList, a3.emit("get_upload_data_finish", e3.UploadData);
              }
            });
          }
        }), i4 = e3.ContentLength, delete e3.ContentLength, !e3.Headers && (e3.Headers = {}), p3.each(e3.Headers, function(t4, n4) {
          "content-length" === n4.toLowerCase() && delete e3.Headers[n4];
        }), function() {
          for (var t4 = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], o4 = 1048576, a4 = 0; a4 < t4.length && !(i4 / (o4 = 1024 * t4[a4] * 1024) <= n3.options.MaxPartNumber); a4++)
            ;
          e3.ChunkSize = e3.SliceSize = g3 = Math.max(g3, o4);
        }(), 0 === i4 ? (e3.Body = "", e3.ContentLength = 0, e3.SkipTask = true, n3.putObject(e3, function(e4, n4) {
          if (e4)
            return t3(e4);
          t3(null, n4);
        })) : a3.emit("get_file_size_finish");
      }, abortUploadTask: function(e3, t3) {
        var n3 = e3.Bucket, i4 = e3.Region, o3 = e3.Key, a3 = e3.UploadId, r4 = e3.Level || "task", s4 = e3.AsyncLimit, c3 = this, p4 = new l2();
        if (p4.on("error", function(e4) {
          return t3(e4);
        }), p4.on("get_abort_array", function(a4) {
          y2.call(c3, { Bucket: n3, Region: i4, Key: o3, Headers: e3.Headers, AsyncLimit: s4, AbortArray: a4 }, function(e4, n4) {
            if (e4)
              return t3(e4);
            t3(null, n4);
          });
        }), "bucket" === r4)
          f2.call(c3, { Bucket: n3, Region: i4, calledBySdk: "abortUploadTask" }, function(e4, n4) {
            if (e4)
              return t3(e4);
            p4.emit("get_abort_array", n4.UploadList || []);
          });
        else if ("file" === r4) {
          if (!o3)
            return t3({ error: "abort_upload_task_no_key" });
          f2.call(c3, { Bucket: n3, Region: i4, Key: o3, calledBySdk: "abortUploadTask" }, function(e4, n4) {
            if (e4)
              return t3(e4);
            p4.emit("get_abort_array", n4.UploadList || []);
          });
        } else {
          if ("task" !== r4)
            return t3({ error: "abort_unknown_level" });
          if (!a3)
            return t3({ error: "abort_upload_task_no_id" });
          if (!o3)
            return t3({ error: "abort_upload_task_no_key" });
          p4.emit("get_abort_array", [{ Key: o3, UploadId: a3 }]);
        }
      }, uploadFile: function(e3, t3) {
        return x2.apply(this, arguments);
      }, uploadFiles: function(e3, t3) {
        return k2.apply(this, arguments);
      }, sliceCopyFile: function(e3, t3) {
        var n3 = new l2(), i4 = this, o3 = e3.Bucket, a3 = e3.Region, r4 = e3.Key, u3 = e3.CopySource, d3 = p3.getSourceParams.call(this, u3);
        if (d3) {
          var f3 = d3.Bucket, h3 = d3.Region, g3 = decodeURIComponent(d3.Key), v4 = void 0 === e3.CopySliceSize ? i4.options.CopySliceSize : e3.CopySliceSize;
          v4 = Math.max(0, v4);
          var y3, x3, k3 = e3.CopyChunkSize || this.options.CopyChunkSize, C3 = this.options.CopyChunkParallelLimit, S2 = this.options.ChunkRetryTimes + 1, w2 = 0, T2 = 0, R2 = {}, B2 = {}, A2 = {};
          n3.on("copy_slice_complete", function(n4) {
            p3.each(e3.Headers, function(e4, t4) {
              0 === t4.toLowerCase().indexOf("x-cos-meta-") && e4;
            });
            var u4 = p3.map(n4.PartList, function(e4) {
              return { PartNumber: e4.PartNumber, ETag: e4.ETag };
            });
            c2.retry(S2, function(t4) {
              i4.multipartComplete({ Bucket: o3, Region: a3, Key: r4, UploadId: n4.UploadId, Parts: u4, tracker: e3.tracker, calledBySdk: "sliceCopyFile" }, t4);
            }, function(e4, i5) {
              if (s3.removeUsing(n4.UploadId), e4)
                return x3(null, true), t3(e4);
              s3.removeUploadId(n4.UploadId), x3({ loaded: y3, total: y3 }, true), t3(null, i5);
            });
          }), n3.on("get_copy_data_finish", function(l3) {
            var d4 = s3.getCopyFileId(u3, R2, k3, o3, r4);
            d4 && s3.saveUploadId(d4, l3.UploadId, i4.options.UploadIdCacheLimit), s3.setUsing(l3.UploadId);
            var f4 = p3.filter(l3.PartList, function(e4) {
              return e4.Uploaded && (T2 += e4.PartNumber >= w2 && y3 % k3 || k3), !e4.Uploaded;
            });
            c2.eachLimit(f4, C3, function(t4, n4) {
              var s4 = t4.PartNumber, p4 = t4.CopySourceRange, d5 = t4.end - t4.start, f5 = 0;
              c2.retry(S2, function(t5) {
                b2.call(i4, { Bucket: o3, Region: a3, Key: r4, CopySource: u3, UploadId: l3.UploadId, PartNumber: s4, CopySourceRange: p4, tracker: e3.tracker, calledBySdk: "sliceCopyFile", onProgress: function(e4) {
                  T2 += e4.loaded - f5, f5 = e4.loaded, x3({ loaded: T2, total: y3 });
                } }, t5);
              }, function(e4, i5) {
                if (e4)
                  return n4(e4);
                x3({ loaded: T2, total: y3 }), T2 += d5 - f5, t4.ETag = i5.ETag, n4(e4 || null, i5);
              });
            }, function(e4) {
              if (e4)
                return s3.removeUsing(l3.UploadId), x3(null, true), t3(e4);
              n3.emit("copy_slice_complete", l3);
            });
          }), n3.on("get_chunk_size_finish", function() {
            var c3 = function() {
              i4.multipartInit({ Bucket: o3, Region: a3, Key: r4, Headers: A2, tracker: e3.tracker, calledBySdk: "sliceCopyFile" }, function(i5, o4) {
                if (i5)
                  return t3(i5);
                e3.UploadId = o4.UploadId, n3.emit("get_copy_data_finish", { UploadId: e3.UploadId, PartList: e3.PartList });
              });
            }, l3 = s3.getCopyFileId(u3, R2, k3, o3, r4), d4 = s3.getUploadIdList(l3);
            if (!l3 || !d4)
              return c3();
            !function t4(l4) {
              if (l4 >= d4.length)
                return c3();
              var u4 = d4[l4];
              if (s3.using[u4])
                return t4(l4 + 1);
              m2.call(i4, { Bucket: o3, Region: a3, Key: r4, UploadId: u4, tracker: e3.tracker, calledBySdk: "sliceCopyFile" }, function(i5, o4) {
                if (i5)
                  s3.removeUploadId(u4), t4(l4 + 1);
                else {
                  if (s3.using[u4])
                    return t4(l4 + 1);
                  var a4 = {}, r5 = 0;
                  p3.each(o4.PartList, function(e4) {
                    var t5 = parseInt(e4.Size), n4 = r5 + t5 - 1;
                    a4[e4.PartNumber + "|" + r5 + "|" + n4] = e4.ETag, r5 += t5;
                  }), p3.each(e3.PartList, function(e4) {
                    var t5 = a4[e4.PartNumber + "|" + e4.start + "|" + e4.end];
                    t5 && (e4.ETag = t5, e4.Uploaded = true);
                  }), n3.emit("get_copy_data_finish", { UploadId: u4, PartList: e3.PartList });
                }
              });
            }(0);
          }), n3.on("get_file_size_finish", function() {
            var o4;
            if (function() {
              for (var t4 = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], n4 = 1048576, o5 = 0; o5 < t4.length && !(y3 / (n4 = 1024 * t4[o5] * 1024) <= i4.options.MaxPartNumber); o5++)
                ;
              e3.ChunkSize = k3 = Math.max(k3, n4), w2 = Math.ceil(y3 / k3);
              for (var a5 = [], r5 = 1; r5 <= w2; r5++) {
                var s4 = (r5 - 1) * k3, c3 = r5 * k3 < y3 ? r5 * k3 - 1 : y3 - 1, l3 = { PartNumber: r5, start: s4, end: c3, CopySourceRange: "bytes=" + s4 + "-" + c3 };
                a5.push(l3);
              }
              e3.PartList = a5;
            }(), (o4 = "Replaced" === e3.Headers["x-cos-metadata-directive"] ? e3.Headers : B2)["x-cos-storage-class"] = e3.Headers["x-cos-storage-class"] || B2["x-cos-storage-class"], o4 = p3.clearKey(o4), "ARCHIVE" === B2["x-cos-storage-class"] || "DEEP_ARCHIVE" === B2["x-cos-storage-class"]) {
              var a4 = B2["x-cos-restore"];
              if (!a4 || 'ongoing-request="true"' === a4)
                return void t3({ error: "Unrestored archive object is not allowed to be copied" });
            }
            delete o4["x-cos-copy-source"], delete o4["x-cos-metadata-directive"], delete o4["x-cos-copy-source-If-Modified-Since"], delete o4["x-cos-copy-source-If-Unmodified-Since"], delete o4["x-cos-copy-source-If-Match"], delete o4["x-cos-copy-source-If-None-Match"], n3.emit("get_chunk_size_finish");
          }), i4.headObject({ Bucket: f3, Region: h3, Key: g3, tracker: e3.tracker, calledBySdk: "sliceCopyFile" }, function(o4, a4) {
            if (o4)
              o4.statusCode && 404 === o4.statusCode ? t3({ ErrorStatus: g3 + " Not Exist" }) : t3(o4);
            else if (void 0 !== (y3 = e3.FileSize = a4.headers["content-length"]) && y3)
              if (e3.tracker && e3.tracker.setParams({ httpSize: y3 }), x3 = p3.throttleOnProgress.call(i4, y3, e3.onProgress), y3 <= v4)
                e3.Headers["x-cos-metadata-directive"] || (e3.Headers["x-cos-metadata-directive"] = "Copy"), i4.putObjectCopy(Object.assign(e3, { calledBySdk: "sliceCopyFile" }), function(e4, n4) {
                  if (e4)
                    return x3(null, true), t3(e4);
                  x3({ loaded: y3, total: y3 }, true), t3(e4, n4);
                });
              else {
                var r5 = a4.headers;
                R2 = r5, B2 = { "Cache-Control": r5["cache-control"], "Content-Disposition": r5["content-disposition"], "Content-Encoding": r5["content-encoding"], "Content-Type": r5["content-type"], Expires: r5.expires, "x-cos-storage-class": r5["x-cos-storage-class"] }, p3.each(r5, function(e4, t4) {
                  var n4 = "x-cos-meta-";
                  0 === t4.indexOf(n4) && t4.length > 11 && (B2[t4] = e4);
                }), n3.emit("get_file_size_finish");
              }
            else
              t3({ error: 'get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.' });
          });
        } else
          t3({ error: "CopySource format error" });
      } };
      e2.exports.init = function(e3, t3) {
        t3.transferToTaskMethod(C2, "sliceUploadFile"), p3.each(C2, function(t4, n3) {
          e3.prototype[n3] = p3.apiWrapper(n3, t4);
        });
      };
    }, function(e2, t2) {
      var n2 = { eachLimit: function(e3, t3, n3, i3) {
        if (i3 = i3 || function() {
        }, !e3.length || t3 <= 0)
          return i3();
        var o2 = 0, a2 = 0, r3 = 0;
        !function s3() {
          if (o2 >= e3.length)
            return i3();
          for (; r3 < t3 && a2 < e3.length; )
            r3 += 1, n3(e3[(a2 += 1) - 1], function(t4) {
              t4 ? (i3(t4), i3 = function() {
              }) : (r3 -= 1, (o2 += 1) >= e3.length ? i3() : s3());
            });
        }();
      }, retry: function(e3, t3, n3) {
        e3 < 1 ? n3() : function i3(o2) {
          t3(function(t4, a2) {
            t4 && o2 < e3 ? i3(o2 + 1) : n3(t4, a2);
          });
        }(1);
      } };
      e2.exports = n2;
    }]);
  });
})(cosWxSdkV5_min);
var cosWxSdkV5_minExports = cosWxSdkV5_min.exports;
const COS = /* @__PURE__ */ getDefaultExportFromCjs(cosWxSdkV5_minExports);
function n$1(e2, t2) {
  var s3 = {};
  for (var n2 in e2)
    Object.prototype.hasOwnProperty.call(e2, n2) && t2.indexOf(n2) < 0 && (s3[n2] = e2[n2]);
  if (null != e2 && "function" == typeof Object.getOwnPropertySymbols) {
    var i3 = 0;
    for (n2 = Object.getOwnPropertySymbols(e2); i3 < n2.length; i3++)
      t2.indexOf(n2[i3]) < 0 && Object.prototype.propertyIsEnumerable.call(e2, n2[i3]) && (s3[n2[i3]] = e2[n2[i3]]);
  }
  return s3;
}
function i$1(e2, t2, s3, n2) {
  return new (s3 || (s3 = Promise))(function(i3, r3) {
    function a2(e3) {
      try {
        u2(n2.next(e3));
      } catch (e4) {
        r3(e4);
      }
    }
    function o2(e3) {
      try {
        u2(n2.throw(e3));
      } catch (e4) {
        r3(e4);
      }
    }
    function u2(e3) {
      var t3;
      e3.done ? i3(e3.value) : (t3 = e3.value, t3 instanceof s3 ? t3 : new s3(function(e4) {
        e4(t3);
      })).then(a2, o2);
    }
    u2((n2 = n2.apply(e2, t2 || [])).next());
  });
}
"function" == typeof SuppressedError && SuppressedError;
let r$1 = class r {
  constructor(e2) {
    return r.instance || (r.instance = this, this.engine = e2, this.events = {}, this.bindIMEvents()), r.instance;
  }
  addEvent(e2, t2) {
    this.events[e2] || (this.events[e2] = /* @__PURE__ */ new Map()), this.events[e2].set(t2, 1);
  }
  removeEvents() {
    Object.keys(this.events).forEach((e2) => {
      this.events[e2].clear();
    }), this.events = {};
  }
  dispatch(e2, t2) {
    if (this.events[e2])
      for (const s3 of this.events[e2].keys())
        s3.call(this, t2);
  }
  bindIMEvents() {
    this.engine.chat.on(this.engine.EVENT.SDK_READY, this.onSDKReady, this), this.engine.chat.on(this.engine.EVENT.SDK_NOT_READY, this.onSDKNotReady, this), this.engine.chat.on(this.engine.EVENT.KICKED_OUT, this.onKickedOut, this), this.engine.chat.on(this.engine.EVENT.NET_STATE_CHANGE, this.onNetStateChange, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_MODIFIED, this.onMessageModified, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_REVOKED, this.onMessageRevoked, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_BY_PEER, this.onMessageReadByPeer, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, this.onMessageReadReceiptReceived, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED, this.onMessageReactionsUpdated, this), this.engine.chat.on(this.engine.EVENT.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated, this), this.engine.chat.on(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalMessageCountUpdated, this), this.engine.chat.on(this.engine.EVENT.PROFILE_UPDATED, this.onProfileUpdated, this), this.engine.chat.on(this.engine.EVENT.BLACKLIST_UPDATED, this.onBlacklistUpdated, this), this.engine.chat.on(this.engine.EVENT.USER_STATUS_UPDATED, this.onUserStatusUpdated, this), this.engine.chat.on(this.engine.EVENT.GROUP_LIST_UPDATED, this.onGroupListUpdated, this), this.engine.chat.on(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED, this.onGroupAttributesUpdated, this), this.engine.chat.on(this.engine.EVENT.GROUP_COUNTER_UPDATED, this.onGroupCounterUpdated, this), this.engine.chat.on(this.engine.EVENT.FRIEND_LIST_UPDATED, this.onFriendListUpdated, this), this.engine.chat.on(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED, this.onFriendApplicationListUpdated, this);
  }
  unbindIMEvents() {
    this.engine.chat.off(this.engine.EVENT.SDK_READY, this.onSDKReady, this), this.engine.chat.off(this.engine.EVENT.SDK_NOT_READY, this.onSDKNotReady, this), this.engine.chat.off(this.engine.EVENT.KICKED_OUT, this.onKickedOut, this), this.engine.chat.off(this.engine.EVENT.NET_STATE_CHANGE, this.onNetStateChange, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_MODIFIED, this.onMessageModified, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_REVOKED, this.onMessageRevoked, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_BY_PEER, this.onMessageReadByPeer, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, this.onMessageReadReceiptReceived, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED, this.onMessageReactionsUpdated, this), this.engine.chat.off(this.engine.EVENT.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated, this), this.engine.chat.off(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalMessageCountUpdated, this), this.engine.chat.off(this.engine.EVENT.PROFILE_UPDATED, this.onProfileUpdated, this), this.engine.chat.off(this.engine.EVENT.BLACKLIST_UPDATED, this.onBlacklistUpdated, this), this.engine.chat.off(this.engine.EVENT.USER_STATUS_UPDATED, this.onUserStatusUpdated, this), this.engine.chat.off(this.engine.EVENT.GROUP_LIST_UPDATED, this.onGroupListUpdated, this), this.engine.chat.off(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED, this.onGroupAttributesUpdated, this), this.engine.chat.off(this.engine.EVENT.GROUP_COUNTER_UPDATED, this.onGroupCounterUpdated, this), this.engine.chat.off(this.engine.EVENT.FRIEND_LIST_UPDATED, this.onFriendListUpdated, this), this.engine.chat.off(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED, this.onFriendApplicationListUpdated, this), r.instance = null;
  }
  onSDKReady(e2) {
    this.dispatch(this.engine.EVENT.SDK_READY, e2.data);
  }
  onSDKNotReady(e2) {
    this.dispatch(this.engine.EVENT.SDK_NOT_READY, e2.data);
  }
  onKickedOut(e2) {
    this.dispatch(this.engine.EVENT.KICKED_OUT, e2.data);
  }
  onNetStateChange(e2) {
    this.dispatch(this.engine.EVENT.NET_STATE_CHANGE, e2.data);
  }
  onReceiveMessage(e2) {
    this.dispatch(this.engine.EVENT.MESSAGE_RECEIVED, e2.data);
  }
  onMessageModified(e2) {
    this.dispatch(this.engine.EVENT.MESSAGE_MODIFIED, e2.data);
  }
  onMessageRevoked(e2) {
    this.dispatch(this.engine.EVENT.MESSAGE_REVOKED, e2.data);
  }
  onMessageReadByPeer(e2) {
    this.dispatch(this.engine.EVENT.MESSAGE_READ_BY_PEER, e2.data);
  }
  onMessageReadReceiptReceived(e2) {
    this.dispatch(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, e2.data);
  }
  onMessageReactionsUpdated(e2) {
    this.dispatch(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED, e2.data);
  }
  onConversationListUpdated(e2) {
    this.dispatch(this.engine.EVENT.CONVERSATION_LIST_UPDATED, e2.data);
  }
  onTotalMessageCountUpdated(e2) {
    this.dispatch(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, e2.data);
  }
  onProfileUpdated(e2) {
    this.dispatch(this.engine.EVENT.PROFILE_UPDATED, e2.data);
  }
  onBlacklistUpdated(e2) {
    this.dispatch(this.engine.EVENT.BLACKLIST_UPDATED, e2.data);
  }
  onUserStatusUpdated(e2) {
    this.dispatch(this.engine.EVENT.USER_STATUS_UPDATED, e2.data);
  }
  onGroupListUpdated(e2) {
    this.dispatch(this.engine.EVENT.GROUP_LIST_UPDATED, e2.data);
  }
  onGroupAttributesUpdated(e2) {
    this.dispatch(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED, e2.data);
  }
  onGroupCounterUpdated(e2) {
    this.dispatch(this.engine.EVENT.GROUP_COUNTER_UPDATED, e2.data);
  }
  onFriendListUpdated(e2) {
    this.dispatch(this.engine.EVENT.FRIEND_LIST_UPDATED, e2.data);
  }
  onFriendApplicationListUpdated(e2) {
    this.dispatch(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED, e2.data);
  }
};
var a$1;
exports.o = void 0;
var u$1, c$1, g$1, l$1, h$1, p$1, d$1;
!function(e2) {
  e2.TUIStore = "TUIStore", e2.TUITranslate = "TUITranslate", e2.TUIConversation = "TUIConversation", e2.TUIChat = "TUIChat", e2.TUIGroup = "TUIGroup", e2.TUIUser = "TUIUser", e2.TUIFriend = "TUIFriend", e2.TUIReport = "TUIReport";
}(a$1 || (a$1 = {})), function(e2) {
  e2.APP = "application", e2.CONV = "conversation", e2.CHAT = "chat", e2.GRP = "group", e2.USER = "user", e2.FRIEND = "friend", e2.SEARCH = "search", e2.CUSTOM = "custom";
}(exports.o || (exports.o = {})), function(e2) {
  e2[e2.UNSUB_USER = -1] = "UNSUB_USER";
}(u$1 || (u$1 = {})), function(e2) {
  e2.BUSINESS_ID = "user_typing_status", e2[e2.STATUS_START = 1] = "STATUS_START", e2[e2.STATUS_END = 0] = "STATUS_END", e2[e2.VERSION = 1] = "VERSION", e2[e2.ACTION_START_ID = 14] = "ACTION_START_ID", e2[e2.ACTION_END_ID = 0] = "ACTION_END_ID", e2.ACTION_START = "EIMAMSG_InputStatus_Ing", e2.ACTION_END = "EIMAMSG_InputStatus_End", e2[e2.NEED_TYPING = 1] = "NEED_TYPING";
}(c$1 || (c$1 = {})), function(e2) {
  e2.ADD = "add", e2.REMOVE = "remove";
}(g$1 || (g$1 = {})), function(e2) {
  e2[e2.MSG_MODIFY_CONFLICT = 2480] = "MSG_MODIFY_CONFLICT", e2[e2.MSG_MODIFY_DISABLED_IN_AVCHATROOM = 2481] = "MSG_MODIFY_DISABLED_IN_AVCHATROOM", e2[e2.MODIFY_MESSAGE_NOT_EXIST = 20026] = "MODIFY_MESSAGE_NOT_EXIST";
}(l$1 || (l$1 = {})), function(e2) {
  e2[e2.NOT_INIT = -1e5] = "NOT_INIT", e2[e2.INVALID_CONV_ID = -100001] = "INVALID_CONV_ID", e2[e2.CONV_ID_SAME = -100002] = "CONV_ID_SAME", e2[e2.CONV_NOT_EXIST = -100003] = "CONV_NOT_EXIST", e2[e2.GET_MSG_LIST_ERROR = -100004] = "GET_MSG_LIST_ERROR", e2[e2.MISMATCH_TYPE_AND_PAYLOAD = -100005] = "MISMATCH_TYPE_AND_PAYLOAD";
}(h$1 || (h$1 = {})), function(e2) {
  e2.MSG_MODIFY_CONFLICT = "MODIFY_MESSAGE_ERROR,修改消息发生冲突, data.message 是最新的消息", e2.MSG_MODIFY_DISABLED_IN_AVCHATROOM = "MODIFY_MESSAGE_ERROR,不支持修改直播群消息.", e2.MODIFY_MESSAGE_NOT_EXIST = "MODIFY_MESSAGE_ERROR,消息不存在.";
}(p$1 || (p$1 = {})), function(e2) {
  e2.NOT_INIT = "TUIChatEngine 初始化未完成，请确认 TUIChatEngine.login 接口调用是否正常。", e2.INVALID_CONV_ID = "会话 ID 无效", e2.CONV_ID_SAME = "您切换的是同一个会话 ID", e2.CONV_NOT_EXIST = "会话不存在", e2.GET_MSG_LIST_ERROR = "Chat SDK is not ready.", e2.MISMATCH_TYPE_AND_PAYLOAD = "type 与 payload 不匹配.";
}(d$1 || (d$1 = {}));
const f$1 = { logout: 1, destroy: 1 }, m$1 = { deleteConversation: 1, pinConversation: 1, muteConversation: 1, switchConversation: 1, getConversationProfile: 1, clearHistoryMessage: 1 }, v$1 = { modifyMessage: 1, revokeMessage: 1, resendMessage: 1, deleteMessage: 1, quoteMessage: 1, replyMessage: 1, setMessageExtensions: 1, deleteMessageExtensions: 1, getMessageExtensions: 1, sendTextMessage: 1, sendTextAtMessage: 1, sendImageMessage: 1, sendAudioMessage: 1, sendVideoMessage: 1, sendFileMessage: 1, sendCustomMessage: 1, sendFaceMessage: 1, sendLocationMessage: 1, sendForwardMessage: 1, enterTypingState: 1, leaveTypingState: 1, sendMessageReadReceipt: 1, getGroupMessageReadMemberList: 1, getMessageList: 1, downloadMergedMessages: 1, setTranslationLanguage: 1, translateText: 1, searchCloudMessages: 1, addMessageReaction: 1, removeMessageReaction: 1, getMessageReactions: 1, getAllUserListOfMessageReaction: 1 }, T$1 = { switchGroup: 1, getGroupProfile: 1, updateGroupProfile: 1, createGroup: 1, dismissGroup: 1, searchGroupByID: 1, joinGroup: 1, quitGroup: 1, getGroupApplicationList: 1, handleGroupApplication: 1, getGroupOnlineMemberCount: 1, changeGroupOwner: 1, initGroupAttributes: 1, setGroupAttributes: 1, deleteGroupAttributes: 1, getGroupAttributes: 1, setGroupCounters: 1, increaseGroupCounter: 1, decreaseGroupCounter: 1, getGroupCounters: 1, getGroupMemberList: 1, getGroupMemberProfile: 1, addGroupMember: 1, deleteGroupMember: 1, setGroupMemberMuteTime: 1, setGroupMemberRole: 1, setGroupMemberNameCard: 1, setGroupMemberCustomField: 1, markGroupMemberList: 1 }, E$1 = { switchUserStatus: 1, switchMessageReadStatus: 1, getUserProfile: 1, updateMyProfile: 1, addToBlacklist: 1, removeFromBlacklist: 1 }, I$1 = { getFriendList: 1, addFriend: 1, deleteFriend: 1, checkFriend: 1, getFriendProfile: 1, updateFriend: 1, acceptFriendApplication: 1, refuseFriendApplication: 1, deleteFriendApplication: 1, setFriendApplicationRead: 1 }, S = function(e2) {
  return void 0 === e2;
}, y = function(e2) {
  return e2.startsWith("_");
}, b = function(e2) {
  return /^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e2);
};
const U = function(e2) {
  return e2 && function(e3) {
    if ("string" == typeof e3)
      try {
        return !!JSON.parse(e3);
      } catch (e4) {
        return false;
      }
    return false;
  }(e2) ? JSON.parse(e2) : e2;
}, C = function(e2) {
  let t2 = "";
  return t2 = e2 >= 1048576 ? `${(e2 / 1048576).toFixed(2)} Mb` : e2 >= 1024 ? `${(e2 / 1024).toFixed(2)} Kb` : `${e2.toFixed(2)}B`, t2;
}, M = "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_16.png", O$1 = "https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.png", _ = "https://web.sdk.qcloud.com/component/TUIKit/assets/group_avatar.png", D = "https://web.sdk.qcloud.com/im/assets/emoji-plugin/", P$1 = "https://web.sdk.qcloud.com/im/assets/face-elem/", R = "https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&", L$1 = "https://apis.map.qq.com/ws/staticmap/v2/?", A$1 = { "[TUIEmoji_Expect]": "emoji_0@2x.png", "[TUIEmoji_Blink]": "emoji_1@2x.png", "[TUIEmoji_Guffaw]": "emoji_2@2x.png", "[TUIEmoji_KindSmile]": "emoji_3@2x.png", "[TUIEmoji_Haha]": "emoji_4@2x.png", "[TUIEmoji_Cheerful]": "emoji_5@2x.png", "[TUIEmoji_Smile]": "emoji_6@2x.png", "[TUIEmoji_Sorrow]": "emoji_7@2x.png", "[TUIEmoji_Speechless]": "emoji_8@2x.png", "[TUIEmoji_Amazed]": "emoji_9@2x.png", "[TUIEmoji_Complacent]": "emoji_10@2x.png", "[TUIEmoji_Lustful]": "emoji_11@2x.png", "[TUIEmoji_Stareyes]": "emoji_12@2x.png", "[TUIEmoji_Giggle]": "emoji_13@2x.png", "[TUIEmoji_Daemon]": "emoji_14@2x.png", "[TUIEmoji_Rage]": "emoji_15@2x.png", "[TUIEmoji_Yawn]": "emoji_16@2x.png", "[TUIEmoji_TearsLaugh]": "emoji_17@2x.png", "[TUIEmoji_Silly]": "emoji_18@2x.png", "[TUIEmoji_Wail]": "emoji_19@2x.png", "[TUIEmoji_Kiss]": "emoji_20@2x.png", "[TUIEmoji_Trapped]": "emoji_21@2x.png", "[TUIEmoji_Fear]": "emoji_22@2x.png", "[TUIEmoji_BareTeeth]": "emoji_23@2x.png", "[TUIEmoji_FlareUp]": "emoji_24@2x.png", "[TUIEmoji_Tact]": "emoji_25@2x.png", "[TUIEmoji_Shit]": "emoji_26@2x.png", "[TUIEmoji_ShutUp]": "emoji_27@2x.png", "[TUIEmoji_Sigh]": "emoji_28@2x.png", "[TUIEmoji_Hehe]": "emoji_29@2x.png", "[TUIEmoji_Silent]": "emoji_30@2x.png", "[TUIEmoji_Skull]": "emoji_31@2x.png", "[TUIEmoji_Mask]": "emoji_32@2x.png", "[TUIEmoji_Beer]": "emoji_33@2x.png", "[TUIEmoji_Cake]": "emoji_34@2x.png", "[TUIEmoji_RedPacket]": "emoji_35@2x.png", "[TUIEmoji_Bombs]": "emoji_36@2x.png", "[TUIEmoji_Ai]": "emoji_37@2x.png", "[TUIEmoji_Celebrate]": "emoji_38@2x.png", "[TUIEmoji_Bless]": "emoji_39@2x.png", "[TUIEmoji_Flower]": "emoji_40@2x.png", "[TUIEmoji_Watermelon]": "emoji_41@2x.png", "[TUIEmoji_Cow]": "emoji_42@2x.png", "[TUIEmoji_Fool]": "emoji_43@2x.png", "[TUIEmoji_Surprised]": "emoji_44@2x.png", "[TUIEmoji_Askance]": "emoji_45@2x.png", "[TUIEmoji_Monster]": "emoji_46@2x.png", "[TUIEmoji_Pig]": "emoji_47@2x.png", "[TUIEmoji_Coffee]": "emoji_48@2x.png", "[TUIEmoji_Ok]": "emoji_49@2x.png", "[TUIEmoji_Heart]": "emoji_50@2x.png", "[TUIEmoji_Sun]": "emoji_51@2x.png", "[TUIEmoji_Moon]": "emoji_52@2x.png", "[TUIEmoji_Star]": "emoji_53@2x.png", "[TUIEmoji_Rich]": "emoji_54@2x.png", "[TUIEmoji_Fortune]": "emoji_55@2x.png", "[TUIEmoji_857]": "emoji_56@2x.png", "[TUIEmoji_666]": "emoji_57@2x.png", "[TUIEmoji_Prohibit]": "emoji_58@2x.png", "[TUIEmoji_Convinced]": "emoji_59@2x.png", "[TUIEmoji_Knife]": "emoji_60@2x.png", "[TUIEmoji_Like]": "emoji_61@2x.png" }, j$1 = { "[TUIEmoji_Smile]": "[微笑]", "[TUIEmoji_Expect]": "[期待]", "[TUIEmoji_Blink]": "[眨眼]", "[TUIEmoji_Guffaw]": "[大笑]", "[TUIEmoji_KindSmile]": "[姨母笑]", "[TUIEmoji_Haha]": "[哈哈哈]", "[TUIEmoji_Cheerful]": "[愉快]", "[TUIEmoji_Speechless]": "[无语]", "[TUIEmoji_Amazed]": "[惊讶]", "[TUIEmoji_Sorrow]": "[悲伤]", "[TUIEmoji_Complacent]": "[得意]", "[TUIEmoji_Silly]": "[傻了]", "[TUIEmoji_Lustful]": "[色]", "[TUIEmoji_Giggle]": "[憨笑]", "[TUIEmoji_Kiss]": "[亲亲]", "[TUIEmoji_Wail]": "[大哭]", "[TUIEmoji_TearsLaugh]": "[哭笑]", "[TUIEmoji_Trapped]": "[困]", "[TUIEmoji_Mask]": "[口罩]", "[TUIEmoji_Fear]": "[恐惧]", "[TUIEmoji_BareTeeth]": "[龇牙]", "[TUIEmoji_FlareUp]": "[发怒]", "[TUIEmoji_Yawn]": "[打哈欠]", "[TUIEmoji_Tact]": "[机智]", "[TUIEmoji_Stareyes]": "[星星眼]", "[TUIEmoji_ShutUp]": "[闭嘴]", "[TUIEmoji_Sigh]": "[叹气]", "[TUIEmoji_Hehe]": "[呵呵]", "[TUIEmoji_Silent]": "[收声]", "[TUIEmoji_Surprised]": "[惊喜]", "[TUIEmoji_Askance]": "[白眼]", "[TUIEmoji_Ok]": "[OK]", "[TUIEmoji_Shit]": "[便便]", "[TUIEmoji_Monster]": "[怪兽]", "[TUIEmoji_Daemon]": "[恶魔]", "[TUIEmoji_Rage]": "[恶魔怒]", "[TUIEmoji_Fool]": "[衰]", "[TUIEmoji_Pig]": "[猪]", "[TUIEmoji_Cow]": "[牛]", "[TUIEmoji_Ai]": "[AI]", "[TUIEmoji_Skull]": "[骷髅]", "[TUIEmoji_Bombs]": "[炸弹]", "[TUIEmoji_Coffee]": "[咖啡]", "[TUIEmoji_Cake]": "[蛋糕]", "[TUIEmoji_Beer]": "[啤酒]", "[TUIEmoji_Flower]": "[花]", "[TUIEmoji_Watermelon]": "[瓜]", "[TUIEmoji_Rich]": "[壕]", "[TUIEmoji_Heart]": "[爱心]", "[TUIEmoji_Moon]": "[月亮]", "[TUIEmoji_Sun]": "[太阳]", "[TUIEmoji_Star]": "[星星]", "[TUIEmoji_RedPacket]": "[红包]", "[TUIEmoji_Celebrate]": "[庆祝]", "[TUIEmoji_Bless]": "[福]", "[TUIEmoji_Fortune]": "[发]", "[TUIEmoji_Convinced]": "[服]", "[TUIEmoji_Prohibit]": "[禁]", "[TUIEmoji_666]": "[666]", "[TUIEmoji_857]": "[857]", "[TUIEmoji_Knife]": "[刀]", "[TUIEmoji_Like]": "[赞]" }, k$1 = { enabledMessageReadReceipt: Math.pow(2, 5), enabledEmojiPlugin: Math.pow(2, 48), enabledOnlineStatus: Math.pow(2, 7), enabledCustomerServicePlugin: Math.pow(2, 40), enabledTranslationPlugin: Math.pow(2, 38), enabledVoiceToText: Math.pow(2, 39) }, N2 = ["messageList", "conversationList", "newMessageList"], x = ["translateTextInfo", "voiceToTextInfo"], G = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), w$1 = "undefined" != typeof index && "undefined" == typeof window, V = G || w$1, F = "undefined" != typeof index, $ = ("undefined" != typeof index || "undefined" != typeof window) && !V, H = G ? wx$1 : F ? index : window, Y = $ && window && window.navigator && window.navigator.userAgent || "", B = /Android/i.test(Y), K = /(?:Windows Phone)/.test(Y), q = /(?:SymbianOS)/.test(Y), z = /iPad/i.test(Y) || /iPhone/i.test(Y) || /iPod/i.test(Y), J = B || K || q || z, W = $ && !J;
class X {
  constructor() {
    this.global = H, this.isOfficial = false;
  }
  static getInstance() {
    return X.instance || (X.instance = new X()), X.instance;
  }
  initOfficial(e2) {
    this.isOfficial = e2;
  }
  getPlatform() {
    let e2 = "";
    return W ? e2 = "pc" : J ? e2 = "h5" : G ? e2 = "wechat" : w$1 && !G && (e2 = "app"), e2;
  }
}
const Z = "group-module", Q = "relationship-module";
class ee {
  constructor() {
    this.EVENT = e$1.EVENT, this.TYPES = e$1.TYPES, this.loginStatusPromise = /* @__PURE__ */ new Map(), this.userID = "", this.isInited = false;
  }
  static getInstance() {
    return ee.instance || (ee.instance = new ee()), ee.instance;
  }
  mount(e2, t2) {
    this[e2] = t2;
  }
  login(t2) {
    const { chat: s3, SDKAppID: n2, userID: i3 } = t2, a2 = 1400187352 === n2 || 1400188366 === n2;
    return this.createChat(t2), this.userID = i3, X.getInstance().initOfficial(a2), this.TUIStore.update(exports.o.APP, "isOfficial", a2), this.TUIStore.update(exports.o.APP, "SDKVersion", e$1.VERSION), this.eventCenter = new r$1(this), this.eventCenter.removeEvents(), this.resetStore(), this.initService(), s3 && s3.isReady() ? (index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.login ok, from TUICore."), this.TUIUser.getUserProfile(), this.checkCommercialAbility(), Promise.resolve({})) : (this.registerPlugin(t2), this.eventCenter.addEvent(this.EVENT.SDK_READY, () => {
      this.onSDKReady();
    }), this.eventCenter.addEvent(this.EVENT.SDK_NOT_READY, () => {
      this.onSDKNotReady();
    }), this.loginChat(t2));
  }
  logout() {
    return this.userID = "", this.isInited = false, this.resetStore(), this.chat.logout();
  }
  isReady() {
    var e2;
    return (null === (e2 = this.chat) || void 0 === e2 ? void 0 : e2.isReady()) || false;
  }
  setLogLevel(e2) {
    this.chat ? this.chat.setLogLevel(e2) : index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine 初始化未完成，请确认 TUIChatEngine.login 接口调用是否正常。");
  }
  destroy() {
    return this.eventCenter.unbindIMEvents(), this.isInited = false, this.resetStore(), this.chat.destroy();
  }
  getMyUserID() {
    return this.userID;
  }
  resetStore() {
    this.TUIStore.reset(exports.o.CHAT), this.TUIStore.reset(exports.o.CONV), this.TUIStore.reset(exports.o.GRP), this.TUIStore.reset(exports.o.USER), this.TUIStore.reset(exports.o.SEARCH), this.TUIStore.reset(exports.o.FRIEND), this.TUIStore.reset(exports.o.CUSTOM), index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.resetStore ok.");
  }
  initService() {
    this.TUIChat.init(), this.TUIConversation.init(), this.TUIUser.init(), this.initOptionalServices(), this.isInited = true, index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.initService ok.");
  }
  initOptionalServices() {
    const t2 = e$1.VERSION.split(".");
    t2[0] > 3 || 3 === t2[0] && t2[1] >= 3 && t2[2] > 0 ? (true === this.chat.callExperimentalAPI("canIUseModule", [Z]) && this.TUIGroup.init(), true === this.chat.callExperimentalAPI("canIUseModule", [Q]) && this.TUIFriend.init()) : (this.TUIGroup.init(), this.TUIFriend.init());
  }
  createChat(t2) {
    const { chat: s3 } = t2, i3 = n$1(t2, ["chat"]);
    S(s3) ? this.chat = e$1.create(Object.assign(Object.assign({}, i3), { scene: "chat-uikit-engine" })) : this.chat = s3;
  }
  loginChat(e2) {
    const { userID: t2, userSig: s3 } = e2;
    return new Promise((e3, n2) => {
      this.chat.login({ userID: t2, userSig: s3 }).then((t3) => {
        index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.loginChat ok."), this.checkCommercialAbility(), t3.data.repeatLogin && this.chat.isReady() && e3(t3), this.loginStatusPromise.set("login", { resolve: e3, reject: n2, imResponse: t3 });
      }).catch((e4) => {
        n2(e4);
      });
    });
  }
  registerPlugin(e2) {
    const { useUploadPlugin: n2 = false, useProfanityFilterPlugin: i3 = false, TIMPush: r3, pushConfig: a2, TUIOfflinePush: o2, offlinePushConfig: u2 } = e2;
    true === n2 && this.chat.registerPlugin({ "tim-upload-plugin": t$1 }), true === i3 && this.chat.registerPlugin({ "tim-profanity-filter-plugin": s$2 }), !w$1 || G || S(r3) || S(a2) || this.chat.registerPlugin({ "tim-push": r3, pushConfig: a2 }), !w$1 || G || S(o2) || S(u2) || this.chat.registerPlugin({ "tim-offline-push-plugin": o2, offlinePushConfig: u2 });
  }
  onSDKReady() {
    if (this.loginStatusPromise.has("login")) {
      const e2 = this.loginStatusPromise.get("login");
      e2.resolve(e2.imResponse), this.TUIUser.getUserProfile();
    }
    this.loginStatusPromise.delete("login");
  }
  onSDKNotReady() {
    if (this.loginStatusPromise.has("login")) {
      this.loginStatusPromise.get("login").reject(new Error("sdk not ready"));
    }
    this.loginStatusPromise.delete("login"), this.resetStore();
  }
  checkCommercialAbility() {
    Object.keys(k$1).forEach((e2) => {
      const t2 = k$1[e2];
      this.chat.callExperimentalAPI("isCommercialAbilityEnabled", t2).then((t3) => {
        const { enabled: s3 = false } = t3.data;
        this.TUIStore.update(exports.o.APP, e2, s3);
      });
    });
  }
}
class te {
  constructor() {
    this.defaultStore = { enabledMessageReadReceipt: false, enabledEmojiPlugin: false, enabledOnlineStatus: false, enabledCustomerServicePlugin: false, enabledTranslationPlugin: false, enabledVoiceToText: false, enableTyping: true, enableConversationDraft: true, isOfficial: false, SDKVersion: "3.0.0", tasks: { sendMessage: false, revokeMessage: false, modifyNickName: false, groupChat: false, muteGroup: false, dismissGroup: false, call: false, searchCloudMessage: false, customerService: false, translateTextMessage: false } }, this.store = { enabledEmojiPlugin: false, enabledMessageReadReceipt: false, enabledOnlineStatus: false, enabledCustomerServicePlugin: false, enabledTranslationPlugin: false, enabledVoiceToText: false, enableTyping: true, enableConversationDraft: true, isOfficial: false, SDKVersion: "3.0.0", tasks: { sendMessage: false, revokeMessage: false, modifyNickName: false, groupChat: false, muteGroup: false, dismissGroup: false, call: false, searchCloudMessage: false, customerService: false, translateTextMessage: false } };
  }
  update(e2, t2) {
    this.store[e2] = t2;
  }
  getData(e2) {
    return this.store[e2];
  }
  reset(e2 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e2.reduce((e3, t2) => Object.assign(Object.assign({}, e3), { [t2]: this.defaultStore[t2] }), {}));
  }
}
class se {
  constructor() {
    this.defaultStore = { userProfile: {}, displayOnlineStatus: false, displayMessageReadReceipt: true, userStatusList: /* @__PURE__ */ new Map(), kickedOut: "", netStateChange: "", userBlacklist: [], targetLanguage: "zh" }, this.store = { userProfile: {}, displayOnlineStatus: false, displayMessageReadReceipt: true, userStatusList: /* @__PURE__ */ new Map(), kickedOut: "", netStateChange: "", userBlacklist: [], targetLanguage: "zh" };
  }
  update(e2, t2) {
    if ("userStatusList" === e2)
      this.updateUserStatusList(t2);
    else
      this.store[e2] = t2;
  }
  getData(e2) {
    return this.store[e2];
  }
  reset(e2 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e2.reduce((e3, t2) => Object.assign(Object.assign({}, e3), { [t2]: this.defaultStore[t2] }), {}));
  }
  updateUserStatusList(e2) {
    0 !== e2.length ? e2.forEach((e3) => {
      const { userID: t2, statusType: s3 = 0, customStatus: n2 = "" } = e3;
      s3 === u$1.UNSUB_USER ? this.store.userStatusList.delete(t2) : this.store.userStatusList.set(t2, { statusType: s3, customStatus: n2 });
    }) : this.store.userStatusList.clear();
  }
}
class ne {
  getEngine() {
    return ee.getInstance();
  }
}
const ie = function(e2) {
  if (null == e2)
    return true;
  if ("boolean" == typeof e2)
    return false;
  if ("number" == typeof e2)
    return 0 === e2;
  if ("string" == typeof e2)
    return 0 === e2.length;
  if ("function" == typeof e2)
    return 0 === e2.length;
  if (Array.isArray(e2))
    return 0 === e2.length;
  if (e2 instanceof Error)
    return "" === e2.message;
  if (function(e3) {
    if ("object" != typeof e3 || null === e3)
      return false;
    const t2 = Object.getPrototypeOf(e3);
    if (null === t2)
      return true;
    let s3 = t2;
    for (; null !== Object.getPrototypeOf(s3); )
      s3 = Object.getPrototypeOf(s3);
    return t2 === s3;
  }(e2)) {
    for (const t2 in e2)
      if (Object.prototype.hasOwnProperty.call(e2, t2))
        return false;
    return true;
  }
  return false;
}, re = ["[图片]", "[语音]", "[视频]", "[文件]", "[位置]", "[地理位置]", "[动画表情]", "[自定义消息]", "[群提示消息]", "[聊天记录]"];
class ae extends ne {
  constructor(e2) {
    super(), this.initProxy(e2), this.isMuted = this.messageRemindType === this.getEngine().TYPES.MSG_REMIND_ACPT_NOT_NOTE || this.messageRemindType === this.getEngine().TYPES.MSG_REMIND_DISCARD, this.operationType = 0, this._conversation = e2;
  }
  initProxy(e2) {
    Object.keys(e2).forEach((t2) => {
      y(t2) || (this[t2] = e2[t2]);
    });
  }
  updateProperties(e2) {
    Object.keys(e2).forEach((t2) => {
      y(t2) || (this[t2] = e2[t2]);
    });
  }
  updateOperationType(e2) {
    this.operationType = e2;
  }
  getConversation() {
    return this._conversation;
  }
  deleteConversation() {
    return this.getEngine().TUIConversation.deleteConversation(this.conversationID);
  }
  pinConversation() {
    return this.getEngine().TUIConversation.pinConversation({ conversationID: this.conversationID, isPinned: !this.isPinned });
  }
  muteConversation() {
    const e2 = this.getEngine(), t2 = { messageRemindType: true === this.isMuted ? e2.TYPES.MSG_REMIND_ACPT_AND_NOTE : e2.TYPES.MSG_REMIND_ACPT_NOT_NOTE };
    if (this.type === e2.TYPES.CONV_C2C) {
      const s3 = this.conversationID.replace(e2.TYPES.CONV_C2C, "");
      t2.userIDList = [s3];
    } else if (this.type === e2.TYPES.CONV_GROUP) {
      const s3 = this.conversationID.replace(e2.TYPES.CONV_GROUP, "");
      t2.groupID = s3;
    }
    return e2.TUIConversation.muteConversation(t2);
  }
  getAvatar() {
    var e2, t2, s3, n2, i3, r3;
    const a2 = this.getEngine();
    let o2 = "";
    switch (this.type) {
      case a2.TYPES.CONV_C2C:
        o2 = b(null === (e2 = this.userProfile) || void 0 === e2 ? void 0 : e2.avatar) ? null === (t2 = this.userProfile) || void 0 === t2 ? void 0 : t2.avatar : M;
        break;
      case a2.TYPES.CONV_GROUP:
        o2 = b(null === (s3 = this.groupProfile) || void 0 === s3 ? void 0 : s3.avatar) ? null === (n2 = this.groupProfile) || void 0 === n2 ? void 0 : n2.avatar : O$1;
        break;
      case a2.TYPES.CONV_SYSTEM:
        o2 = b(null === (i3 = this.groupProfile) || void 0 === i3 ? void 0 : i3.avatar) ? null === (r3 = this.groupProfile) || void 0 === r3 ? void 0 : r3.avatar : _;
    }
    return o2;
  }
  getShowName() {
    var e2, t2, s3, n2;
    const i3 = this.getEngine();
    let r3 = "";
    switch (this.type) {
      case i3.TYPES.CONV_C2C:
        r3 = this.remark || (null === (e2 = this.userProfile) || void 0 === e2 ? void 0 : e2.nick) || (null === (t2 = this.userProfile) || void 0 === t2 ? void 0 : t2.userID) || "";
        break;
      case i3.TYPES.CONV_GROUP:
        r3 = (null === (s3 = this.groupProfile) || void 0 === s3 ? void 0 : s3.name) || (null === (n2 = this.groupProfile) || void 0 === n2 ? void 0 : n2.groupID) || "";
        break;
      case i3.TYPES.CONV_SYSTEM:
        r3 = i3.TUITranslate.t("系统通知");
    }
    return r3;
  }
  getGroupAtInfo() {
    const e2 = this.getEngine(), t2 = e2.TUITranslate.t.bind(e2.TUITranslate), s3 = [`[${t2("TUIConversation.有人@我")}]`, `[${t2("TUIConversation.@所有人")}]`, `[${t2("TUIConversation.@所有人")}][${t2("TUIConversation.有人@我")}]`];
    let n2 = "";
    for (let e3 = 0; e3 < this.groupAtInfoList.length; e3++)
      this.groupAtInfoList[e3].atTypeArray[0] && this.unreadCount > 0 && (n2 = s3[this.groupAtInfoList[e3].atTypeArray[0] - 1]);
    return n2;
  }
  getLastMessage(e2) {
    return "time" === e2 ? this.getLastMessageTime() : "text" === e2 ? this.getLastMessageText() : (index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `ConversationModel.getLastMessage key:${e2} is invalid.`), null);
  }
  getLastMessageTime() {
    var e2;
    const t2 = this.getEngine();
    let s3 = "";
    return (null === (e2 = this.lastMessage) || void 0 === e2 ? void 0 : e2.lastTime) > 0 && (s3 = function(e3, t3) {
      const s4 = 6e4, n2 = 36e5, i3 = 24 * n2, r3 = 7 * i3, a2 = (/* @__PURE__ */ new Date()).getTime() - e3;
      let o2 = "";
      if (a2 < 0)
        return o2;
      const u2 = a2 / s4, c2 = a2 / n2, g2 = a2 / i3, l2 = a2 / r3;
      if (l2 >= 1 && l2 <= 4)
        o2 = ` ${parseInt(`${l2}`, 10)} ${t3("time.周")}${t3("time.前")}`;
      else if (g2 >= 1 && g2 <= 6)
        o2 = ` ${parseInt(`${g2}`, 10)} ${t3("time.天")}${t3("time.前")}`;
      else if (c2 >= 1 && c2 <= 23)
        o2 = ` ${parseInt(`${c2}`, 10)} ${t3("time.小时")}${t3("time.前")}`;
      else if (u2 >= 1 && u2 <= 59)
        o2 = ` ${parseInt(`${u2}`, 10)} ${t3("time.分钟")}${t3("time.前")}`;
      else if (a2 >= 0 && a2 <= s4)
        o2 = `${t3("time.刚刚")}`;
      else {
        const t4 = /* @__PURE__ */ new Date();
        t4.setTime(e3), o2 = `${t4.getFullYear()}-${t4.getMonth() + 1 < 10 ? `0${t4.getMonth() + 1}` : t4.getMonth() + 1}-${t4.getDate() < 10 ? `0${t4.getDate()}` : t4.getDate()}`;
      }
      return o2;
    }(1e3 * this.lastMessage.lastTime, t2.TUITranslate.t.bind(t2.TUITranslate))), s3;
  }
  getLastMessageText() {
    var e2;
    if (this.draftText) {
      return U(this.draftText).abstract;
    }
    const t2 = this.getEngine(), s3 = t2.TUITranslate.t.bind(t2.TUITranslate);
    if (4 === this.operationType)
      return s3("TUIConversation.您已被群管理员移出群聊");
    if (5 === this.operationType)
      return s3("TUIConversation.该群聊已被解散");
    if (8 === this.operationType)
      return s3("TUIConversation.您已退出该群聊");
    const n2 = this._conversation, { lastMessage: i3 } = this;
    let r3 = "", a2 = "";
    const o2 = n2.unreadCount > 0 && n2.messageRemindType === t2.TYPES.MSG_REMIND_ACPT_NOT_NOTE ? `[${n2.unreadCount > 99 ? "99+" : n2.unreadCount}${s3("TUIConversation.条")}]` : "";
    if (n2.type === t2.TYPES.CONV_GROUP)
      if (i3.fromAccount === t2.getMyUserID())
        r3 = s3("TUIConversation.我");
      else {
        const e3 = i3.fromAccount;
        r3 = t2.TUIFriend.getFriendRemark([e3])[e3] || i3.nameCard || i3.nick || e3;
      }
    if (i3.type === t2.TYPES.MSG_TEXT)
      a2 = this.decodeTextMessage(i3.payload.text);
    else if (i3.type === t2.TYPES.MSG_CUSTOM) {
      const n3 = U(null === (e2 = null == i3 ? void 0 : i3.payload) || void 0 === e2 ? void 0 : e2.data);
      if (1 === (null == n3 ? void 0 : n3.businessID))
        return a2 = t2.TUIChat.messageHandler.handleCallKitSignaling(i3), a2;
      a2 = re.includes(i3.messageForShow) ? s3(`TUIChat.${i3.messageForShow}`) : i3.messageForShow;
    } else
      a2 = re.includes(i3.messageForShow) ? s3(`TUIChat.${i3.messageForShow}`) : i3.messageForShow;
    return i3.isRevoked && (a2 = s3("TUIChat.撤回了一条消息")), n2.type === t2.TYPES.CONV_GROUP && i3.type === t2.TYPES.MSG_GRP_TIP ? a2 : `${o2}${r3 ? `${r3}:` : ""}${a2}`;
  }
  decodeTextMessage(e2) {
    if (ie(e2))
      return e2;
    const t2 = /(\[.+?\])/g;
    let s3 = e2;
    if (t2.test(e2)) {
      const n2 = this.getEngine(), i3 = n2.TUITranslate.t.bind(n2.TUITranslate);
      s3 = e2.replace(t2, (e3) => {
        const t3 = i3(`Emoji.${e3}`);
        return G || !t3 || t3.startsWith("Emoji.") ? j$1[e3] || e3 : t3;
      });
    }
    return s3;
  }
}
class oe {
  constructor() {
    this.defaultStore = { currentConversationID: "", totalUnreadCount: 0, conversationList: [], currentConversation: null, operationTypeMap: /* @__PURE__ */ new Map() }, this.store = { currentConversationID: "", totalUnreadCount: 0, conversationList: [], currentConversation: null, operationTypeMap: /* @__PURE__ */ new Map() };
  }
  update(e2, t2) {
    switch (e2) {
      case "conversationList":
        this.updateConversationList(t2);
        break;
      case "operationTypeMap":
        this.updateOperationTypeMap(t2);
        break;
      default:
        this.store[e2] = t2;
    }
  }
  getData(e2) {
    return this.store[e2];
  }
  getModel(e2) {
    return this.store.conversationList.find((t2) => t2.conversationID === e2);
  }
  reset(e2 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e2.reduce((e3, t2) => Object.assign(Object.assign({}, e3), { [t2]: this.defaultStore[t2] }), {}));
  }
  updateConversationList(e2) {
    const t2 = [];
    e2.forEach((e3) => {
      let s3 = e3;
      e3 instanceof ae ? s3.updateProperties(e3) : s3 = new ae(e3);
      const n2 = this.getOperationType(e3);
      s3.updateOperationType(n2), t2.push(s3);
    }), this.store.conversationList = t2;
  }
  updateOperationTypeMap(e2) {
    const { conversationID: t2, operationType: s3 = 0 } = e2;
    this.store.operationTypeMap.set(t2, s3);
  }
  getOperationType(e2) {
    const { conversationID: t2 } = e2;
    return this.store.operationTypeMap.get(t2) || 0;
  }
}
class ue extends ne {
  constructor(e2) {
    super(), this.messageHandlers = { [this.getEngine().TYPES.MSG_TEXT]: (e3) => this.getEngine().TUIChat.messageHandler.handleTextMessage(e3), [this.getEngine().TYPES.MSG_FACE]: (e3) => this.getEngine().TUIChat.messageHandler.handleFaceMessage(e3), [this.getEngine().TYPES.MSG_LOCATION]: (e3) => this.getEngine().TUIChat.messageHandler.handleLocationMessage(e3), [this.getEngine().TYPES.MSG_IMAGE]: (e3) => this.getEngine().TUIChat.messageHandler.handleImageMessage(e3), [this.getEngine().TYPES.MSG_AUDIO]: (e3) => this.getEngine().TUIChat.messageHandler.handleAudioMessage(e3), [this.getEngine().TYPES.MSG_VIDEO]: (e3) => this.getEngine().TUIChat.messageHandler.handleVideoMessage(e3), [this.getEngine().TYPES.MSG_FILE]: (e3) => this.getEngine().TUIChat.messageHandler.handleFileMessage(e3), [this.getEngine().TYPES.MSG_CUSTOM]: (e3) => this.getEngine().TUIChat.messageHandler.handleCustomMessage(e3), [this.getEngine().TYPES.MSG_MERGER]: (e3) => this.getEngine().TUIChat.messageHandler.handleMergeMessage(e3), [this.getEngine().TYPES.MSG_GRP_TIP]: (e3) => this.getEngine().TUIChat.messageHandler.handleGroupTipsMessage(e3) }, this._message = e2, this._signalingInfo = void 0, this.progress = 0, this.reactionList = [], this.initProperties(e2);
  }
  initProperties(e2) {
    Object.keys(e2).forEach((t2) => {
      y(t2) || (this[t2] = e2[t2]);
    });
  }
  updateProperties(e2) {
    this._message = e2, Object.keys(e2).forEach((t2) => {
      y(t2) || (this[t2] = e2[t2]);
    });
  }
  getMessage() {
    return this._message;
  }
  modifyMessage(e2) {
    return e2.type && this._message.type !== e2.type && !e2.payload ? Promise.reject({ code: h$1.MISMATCH_TYPE_AND_PAYLOAD, message: d$1.MISMATCH_TYPE_AND_PAYLOAD }) : (this._message.type = e2.type || this._message.type, this._message.payload = e2.payload || this._message.payload, this._message.cloudCustomData = e2.cloudCustomData || this._message.cloudCustomData, this.getEngine().TUIChat.modifyMessage(this._message));
  }
  revokeMessage() {
    return this.getEngine().TUIChat.revokeMessage(this._message);
  }
  resendMessage() {
    return this.getEngine().TUIChat.resendMessage(this._message);
  }
  deleteMessage() {
    return this.getEngine().TUIChat.deleteMessage([this._message]);
  }
  quoteMessage() {
    return this.getEngine().TUIChat.quoteMessage(this._message);
  }
  replyMessage() {
    return this.getEngine().TUIChat.replyMessage(this._message);
  }
  setMessageExtensions(e2) {
    return this.getEngine().TUIChat.setMessageExtensions(this._message, e2);
  }
  getMessageExtensions() {
    return this.getEngine().TUIChat.getMessageExtensions(this._message);
  }
  deleteMessageExtensions(e2) {
    return this.getEngine().TUIChat.deleteMessageExtensions(this._message, e2);
  }
  getSignalingInfo() {
    return this.type !== this.getEngine().TYPES.MSG_CUSTOM ? null : S(this._signalingInfo) ? (this._signalingInfo = this.getEngine().chat.getSignalingInfo(this._message), this._signalingInfo) : this._signalingInfo;
  }
  getMessageContent() {
    const e2 = this.messageHandlers[this.type];
    if (S(e2))
      return {};
    if (this.type === this.getEngine().TYPES.MSG_GRP_TIP)
      return e2(this._message);
    const t2 = this.getEngine().TUIFriend.getFriendRemark([this.from]);
    return Object.assign(Object.assign({}, e2(this._message)), { showName: t2[this.from] || this.nameCard || this.nick || this.from });
  }
  sendForwardMessage(e2) {
    return this.getEngine().TUIChat.sendForwardMessage(e2, [this._message]);
  }
}
class ce {
  constructor() {
    this.defaultStore = { messageList: [], isCompleted: false, nextReqMessageID: "", quoteMessage: {}, newMessageList: [], typingStatus: false, messageSource: void 0, translateTextInfo: void 0, voiceToTextInfo: void 0, userInfo: {} }, this.store = { messageList: [], isCompleted: false, nextReqMessageID: "", quoteMessage: {}, newMessageList: [], typingStatus: false, messageSource: void 0, translateTextInfo: void 0, voiceToTextInfo: void 0, userInfo: {} };
  }
  update(e2, t2) {
    switch (e2) {
      case "messageList":
        this.updateMessageList(t2);
        break;
      case "translateTextInfo":
        this.updateTranslateTextInfo(t2);
        break;
      case "voiceToTextInfo":
        this.updateVoiceToTextInfo(t2);
        break;
      default:
        this.store[e2] = t2;
    }
  }
  getData(e2) {
    return this.store[e2];
  }
  getModel(e2) {
    return this.store.messageList.find((t2) => t2.ID === e2);
  }
  reset(e2 = []) {
    const t2 = e2.filter((e3) => !x.includes(e3));
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), null == t2 ? void 0 : t2.reduce((e3, t3) => Object.assign(Object.assign({}, e3), { [t3]: this.defaultStore[t3] }), {}));
  }
  updateMessageList(e2) {
    const t2 = [];
    e2.forEach((e3) => {
      let s3 = e3;
      e3 instanceof ue || (s3 = this.getModel(e3.ID), s3 ? s3.updateProperties(e3) : s3 = new ue(e3)), t2.push(s3);
    }), this.store.messageList = t2;
  }
  updateTranslateTextInfo(e2) {
    this.updateBykey("translateTextInfo", e2);
  }
  updateVoiceToTextInfo(e2) {
    this.updateBykey("voiceToTextInfo", e2);
  }
  updateBykey(e2, t2) {
    const { conversationID: s3, messageID: n2, visible: i3 = false } = t2;
    this.store[e2] || (this.store[e2] = /* @__PURE__ */ new Map()), this.store[e2].has(s3) || this.store[e2].set(s3, []);
    const r3 = this.store[e2].get(s3) || [];
    let a2 = true;
    for (let e3 = 0; e3 < r3.length; e3++)
      if (r3[e3].messageID === n2) {
        r3[e3].visible = i3, a2 = false;
        break;
      }
    a2 && r3.push({ messageID: n2, visible: i3 }), this.store[e2].set(s3, r3);
  }
}
class ge {
  constructor(e2) {
    this.groupAttributes = {}, this.groupCounters = {}, this.initProxy(e2);
  }
  initProxy(e2) {
    Object.keys(e2).forEach((t2) => {
      y(t2) || (this[t2] = e2[t2]);
    });
  }
}
class le {
  constructor() {
    this.defaultStore = { currentGroupID: "", currentGroup: {}, currentGroupAttributes: {}, currentGroupCounters: {}, currentGroupMemberList: [], groupList: [], groupSystemNoticeList: [], isCompleted: false, offset: 0 }, this.store = { currentGroupID: "", currentGroup: void 0, currentGroupAttributes: {}, currentGroupCounters: {}, currentGroupMemberList: [], groupList: [], groupSystemNoticeList: [], isCompleted: false, offset: 0 };
  }
  update(e2, t2) {
    switch (e2) {
      case "groupList":
        this.updateGroupList(t2);
        break;
      case "currentGroup":
        this.store.currentGroup = t2 instanceof ge ? t2 : new ge(t2);
        break;
      default:
        this.store[e2] = t2;
    }
  }
  getData(e2) {
    if ("groupSystemNoticeList" === e2) {
      const e3 = [...this.store.groupSystemNoticeList];
      return this.store.groupSystemNoticeList.length = 0, e3;
    }
    return this.store[e2];
  }
  reset(e2 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e2.reduce((e3, t2) => Object.assign(Object.assign({}, e3), { [t2]: this.defaultStore[t2] }), {}));
  }
  updateGroupList(e2) {
    this.store.groupList = e2.map((e3) => e3 instanceof ge ? e3 : new ge(e3));
  }
}
class he {
  constructor() {
    this.store = {};
  }
  update(e2, t2) {
    this.store[e2] = t2;
  }
  getData(e2) {
    return this.store[e2];
  }
  reset(e2 = []) {
    0 === e2.length && (this.store = {}), this.store = Object.assign(Object.assign({}, this.store), e2.reduce((e3, t2) => Object.assign(Object.assign({}, e3), { [t2]: void 0 }), {}));
  }
}
class pe {
  constructor() {
    this.defaultStore = { friendList: [], friendApplicationList: [], friendApplicationUnreadCount: 0 }, this.store = { friendList: [], friendApplicationList: [], friendApplicationUnreadCount: 0 };
  }
  update(e2, t2) {
    this.store[e2] = t2;
  }
  getData(e2) {
    return this.store[e2];
  }
  reset(e2 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e2.reduce((e3, t2) => Object.assign(Object.assign({}, e3), { [t2]: this.defaultStore[t2] }), {}));
  }
}
class de {
  constructor() {
    this.defaultStore = { currentSearchInputValue: { value: "", searchType: "global" }, currentSearchMessageType: { value: { key: "", label: "", value: "" }, searchType: "global" }, currentSearchMessageTime: { value: { key: "", label: "", value: { timePosition: 0, timePeriod: 0 } }, searchType: "global" }, currentSearchingStatus: { isSearching: false, searchType: "global" }, isShowInConversationSearch: false }, this.store = { currentSearchInputValue: { value: "", searchType: "global" }, currentSearchMessageType: { value: { key: "", label: "", value: "" }, searchType: "global" }, currentSearchMessageTime: { value: { key: "", label: "", value: { timePosition: 0, timePeriod: 0 } }, searchType: "global" }, currentSearchingStatus: { isSearching: false, searchType: "global" }, isShowInConversationSearch: false };
  }
  update(e2, t2) {
    this.store[e2] = t2;
  }
  getData(e2) {
    return this.store[e2];
  }
  reset(e2 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), null == e2 ? void 0 : e2.reduce((e3, t2) => Object.assign(Object.assign({}, e3), { [t2]: this.defaultStore[t2] }), {}));
  }
}
class fe {
  constructor() {
    this.storeMap = { [exports.o.APP]: new te(), [exports.o.USER]: new se(), [exports.o.CONV]: new oe(), [exports.o.CHAT]: new ce(), [exports.o.GRP]: new le(), [exports.o.FRIEND]: new pe(), [exports.o.SEARCH]: new de() }, this.task = {};
  }
  static getInstance() {
    return fe.instance || (fe.instance = new fe()), fe.instance;
  }
  watch(e2, t2) {
    this.task[e2] || (this.task[e2] = {});
    const s3 = this.task[e2];
    Object.keys(t2).forEach((n2) => {
      const i3 = t2[n2];
      s3[n2] || (s3[n2] = /* @__PURE__ */ new Map()), s3[n2].set(i3, 1), this.notifyOnWatch(e2, n2, i3);
    });
  }
  unwatch(e2, t2) {
    if (!this.task[e2])
      return;
    const s3 = this.task[e2];
    Object.keys(t2).forEach((e3) => {
      var n2;
      null === (n2 = s3[e3]) || void 0 === n2 || n2.delete(t2[e3]);
    });
  }
  update(e2, t2, s3) {
    var n2;
    e2 !== exports.o.CUSTOM || this.storeMap[e2] || (this.storeMap[e2] = new he()), null === (n2 = this.storeMap[e2]) || void 0 === n2 || n2.update(t2, s3), this.notify(e2, t2);
  }
  getData(e2, t2) {
    var s3;
    return e2 !== exports.o.CUSTOM || this.storeMap[e2] || (this.storeMap[e2] = new he()), null === (s3 = this.storeMap[e2]) || void 0 === s3 ? void 0 : s3.getData(t2);
  }
  getConversationModel(e2) {
    var t2;
    return null === (t2 = this.storeMap[exports.o.CONV]) || void 0 === t2 ? void 0 : t2.getModel(e2);
  }
  getMessageModel(e2) {
    var t2;
    return null === (t2 = this.storeMap[exports.o.CHAT]) || void 0 === t2 ? void 0 : t2.getModel(e2);
  }
  reset(e2, t2 = [], s3 = false) {
    if (e2 in this.storeMap) {
      const n2 = this.storeMap[e2];
      0 === t2.length && (t2 = Object.keys(null == n2 ? void 0 : n2.store)), n2.reset(t2), s3 && t2.forEach((t3) => {
        this.notify(e2, t3);
      });
    }
  }
  notifyOnWatch(e2, t2, s3) {
    const n2 = this.getData(e2, t2);
    N2.indexOf(t2) > -1 && 0 === n2.length || s3 && s3.call(this, n2);
  }
  notify(e2, t2) {
    if (!this.task[e2])
      return;
    const s3 = this.task[e2];
    if (s3[t2]) {
      const n2 = s3[t2], i3 = this.getData(e2, t2);
      for (const [e3] of n2.entries())
        e3.call(this, i3);
    }
  }
}
function me(e2) {
  return me = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) {
    return typeof e3;
  } : function(e3) {
    return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
  }, me(e2);
}
function ve(e2, t2) {
  if (!(e2 instanceof t2))
    throw new TypeError("Cannot call a class as a function");
}
function Te(e2) {
  var t2 = function(e3, t3) {
    if ("object" != me(e3) || !e3)
      return e3;
    var s3 = e3[Symbol.toPrimitive];
    if (void 0 !== s3) {
      var n2 = s3.call(e3, t3 || "default");
      if ("object" != me(n2))
        return n2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t3 ? String : Number)(e3);
  }(e2, "string");
  return "symbol" == me(t2) ? t2 : t2 + "";
}
function Ee(e2, t2) {
  for (var s3 = 0; s3 < t2.length; s3++) {
    var n2 = t2[s3];
    n2.enumerable = n2.enumerable || false, n2.configurable = true, "value" in n2 && (n2.writable = true), Object.defineProperty(e2, Te(n2.key), n2);
  }
}
function Ie(e2, t2, s3) {
  return t2 && Ee(e2.prototype, t2), s3 && Ee(e2, s3), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function Se(e2) {
  if (void 0 === e2)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e2;
}
function ye(e2, t2) {
  return ye = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e3, t3) {
    return e3.__proto__ = t3, e3;
  }, ye(e2, t2);
}
function be(e2, t2) {
  if ("function" != typeof t2 && null !== t2)
    throw new TypeError("Super expression must either be null or a function");
  e2.prototype = Object.create(t2 && t2.prototype, { constructor: { value: e2, writable: true, configurable: true } }), Object.defineProperty(e2, "prototype", { writable: false }), t2 && ye(e2, t2);
}
function Ue(e2, t2) {
  if (t2 && ("object" == me(t2) || "function" == typeof t2))
    return t2;
  if (void 0 !== t2)
    throw new TypeError("Derived constructors may only return object or undefined");
  return Se(e2);
}
function Ce(e2) {
  return Ce = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e3) {
    return e3.__proto__ || Object.getPrototypeOf(e3);
  }, Ce(e2);
}
function Me(e2, t2, s3) {
  return (t2 = Te(t2)) in e2 ? Object.defineProperty(e2, t2, { value: s3, enumerable: true, configurable: true, writable: true }) : e2[t2] = s3, e2;
}
function Oe(e2, t2) {
  (null == t2 || t2 > e2.length) && (t2 = e2.length);
  for (var s3 = 0, n2 = Array(t2); s3 < t2; s3++)
    n2[s3] = e2[s3];
  return n2;
}
function _e(e2) {
  return function(e3) {
    if (Array.isArray(e3))
      return e3;
  }(e2) || function(e3) {
    if ("undefined" != typeof Symbol && null != e3[Symbol.iterator] || null != e3["@@iterator"])
      return Array.from(e3);
  }(e2) || function(e3, t2) {
    if (e3) {
      if ("string" == typeof e3)
        return Oe(e3, t2);
      var s3 = {}.toString.call(e3).slice(8, -1);
      return "Object" === s3 && e3.constructor && (s3 = e3.constructor.name), "Map" === s3 || "Set" === s3 ? Array.from(e3) : "Arguments" === s3 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s3) ? Oe(e3, t2) : void 0;
    }
  }(e2) || function() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }();
}
function De(e2, t2) {
  var s3 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e2);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Pe(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? De(Object(s3), true).forEach(function(t3) {
      Me(e2, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(s3)) : De(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e2;
}
var Re = { type: "logger", log: function(e2) {
  this.output("log", e2);
}, warn: function(e2) {
  this.output("warn", e2);
}, error: function(e2) {
  this.output("error", e2);
}, output: function(e2, t2) {
  console && console[e2] && console[e2].apply(console, t2);
} }, Le = new (function() {
  function e2(t2) {
    var s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    ve(this, e2), this.init(t2, s3);
  }
  return Ie(e2, [{ key: "init", value: function(e3) {
    var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    this.prefix = t2.prefix || "i18next:", this.logger = e3 || Re, this.options = t2, this.debug = t2.debug;
  } }, { key: "setDebug", value: function(e3) {
    this.debug = e3;
  } }, { key: "log", value: function() {
    for (var e3 = arguments.length, t2 = new Array(e3), s3 = 0; s3 < e3; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "log", "", true);
  } }, { key: "warn", value: function() {
    for (var e3 = arguments.length, t2 = new Array(e3), s3 = 0; s3 < e3; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "warn", "", true);
  } }, { key: "error", value: function() {
    for (var e3 = arguments.length, t2 = new Array(e3), s3 = 0; s3 < e3; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "error", "");
  } }, { key: "deprecate", value: function() {
    for (var e3 = arguments.length, t2 = new Array(e3), s3 = 0; s3 < e3; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "warn", "WARNING DEPRECATED: ", true);
  } }, { key: "forward", value: function(e3, t2, s3, n2) {
    return n2 && !this.debug ? null : ("string" == typeof e3[0] && (e3[0] = "".concat(s3).concat(this.prefix, " ").concat(e3[0])), this.logger[t2](e3));
  } }, { key: "create", value: function(t2) {
    return new e2(this.logger, Pe(Pe({}, { prefix: "".concat(this.prefix, ":").concat(t2, ":") }), this.options));
  } }, { key: "clone", value: function(t2) {
    return (t2 = t2 || this.options).prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
  } }]), e2;
}())(), Ae = function() {
  function e2() {
    ve(this, e2), this.observers = {};
  }
  return Ie(e2, [{ key: "on", value: function(e3, t2) {
    var s3 = this;
    return e3.split(" ").forEach(function(e4) {
      s3.observers[e4] = s3.observers[e4] || [], s3.observers[e4].push(t2);
    }), this;
  } }, { key: "off", value: function(e3, t2) {
    this.observers[e3] && (t2 ? this.observers[e3] = this.observers[e3].filter(function(e4) {
      return e4 !== t2;
    }) : delete this.observers[e3]);
  } }, { key: "emit", value: function(e3) {
    for (var t2 = arguments.length, s3 = new Array(t2 > 1 ? t2 - 1 : 0), n2 = 1; n2 < t2; n2++)
      s3[n2 - 1] = arguments[n2];
    this.observers[e3] && [].concat(this.observers[e3]).forEach(function(e4) {
      e4.apply(void 0, s3);
    });
    this.observers["*"] && [].concat(this.observers["*"]).forEach(function(t3) {
      t3.apply(t3, [e3].concat(s3));
    });
  } }]), e2;
}();
function je() {
  var e2, t2, s3 = new Promise(function(s4, n2) {
    e2 = s4, t2 = n2;
  });
  return s3.resolve = e2, s3.reject = t2, s3;
}
function ke(e2) {
  return null == e2 ? "" : "" + e2;
}
function Ne(e2, t2, s3) {
  function n2(e3) {
    return e3 && e3.indexOf("###") > -1 ? e3.replace(/###/g, ".") : e3;
  }
  function i3() {
    return !e2 || "string" == typeof e2;
  }
  for (var r3 = "string" != typeof t2 ? [].concat(t2) : t2.split("."); r3.length > 1; ) {
    if (i3())
      return {};
    var a2 = n2(r3.shift());
    !e2[a2] && s3 && (e2[a2] = new s3()), e2 = Object.prototype.hasOwnProperty.call(e2, a2) ? e2[a2] : {};
  }
  return i3() ? {} : { obj: e2, k: n2(r3.shift()) };
}
function xe(e2, t2, s3) {
  var n2 = Ne(e2, t2, Object);
  n2.obj[n2.k] = s3;
}
function Ge(e2, t2) {
  var s3 = Ne(e2, t2), n2 = s3.obj, i3 = s3.k;
  if (n2)
    return n2[i3];
}
function we(e2, t2, s3) {
  for (var n2 in t2)
    "__proto__" !== n2 && "constructor" !== n2 && (n2 in e2 ? "string" == typeof e2[n2] || e2[n2] instanceof String || "string" == typeof t2[n2] || t2[n2] instanceof String ? s3 && (e2[n2] = t2[n2]) : we(e2[n2], t2[n2], s3) : e2[n2] = t2[n2]);
  return e2;
}
function Ve(e2) {
  return e2.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var Fe = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;", "/": "&#x2F;" };
function $e(e2) {
  return "string" == typeof e2 ? e2.replace(/[&<>"'\/]/g, function(e3) {
    return Fe[e3];
  }) : e2;
}
var He = "undefined" != typeof window && window.navigator && void 0 === window.navigator.userAgentData && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1, Ye = [" ", ",", "?", "!", ";"];
function Be(e2, t2) {
  var s3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ".";
  if (e2) {
    if (e2[t2])
      return e2[t2];
    for (var n2 = t2.split(s3), i3 = e2, r3 = 0; r3 < n2.length; ++r3) {
      if (!i3)
        return;
      if ("string" == typeof i3[n2[r3]] && r3 + 1 < n2.length)
        return;
      if (void 0 === i3[n2[r3]]) {
        for (var a2 = 2, o2 = n2.slice(r3, r3 + a2).join(s3), u2 = i3[o2]; void 0 === u2 && n2.length > r3 + a2; )
          a2++, u2 = i3[o2 = n2.slice(r3, r3 + a2).join(s3)];
        if (void 0 === u2)
          return;
        if (null === u2)
          return null;
        if (t2.endsWith(o2)) {
          if ("string" == typeof u2)
            return u2;
          if (o2 && "string" == typeof u2[o2])
            return u2[o2];
        }
        var c2 = n2.slice(r3 + a2).join(s3);
        return c2 ? Be(u2, c2, s3) : void 0;
      }
      i3 = i3[n2[r3]];
    }
    return i3;
  }
}
function Ke(e2, t2) {
  var s3 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e2);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function qe(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? Ke(Object(s3), true).forEach(function(t3) {
      Me(e2, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(s3)) : Ke(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e2;
}
function ze(e2) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e3) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce(e2);
    if (t2) {
      var i3 = Ce(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
var Je = function() {
  be(t2, Ae);
  var e2 = ze(t2);
  function t2(s3) {
    var n2, i3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { ns: ["translation"], defaultNS: "translation" };
    return ve(this, t2), n2 = e2.call(this), He && Ae.call(Se(n2)), n2.data = s3 || {}, n2.options = i3, void 0 === n2.options.keySeparator && (n2.options.keySeparator = "."), void 0 === n2.options.ignoreJSONStructure && (n2.options.ignoreJSONStructure = true), n2;
  }
  return Ie(t2, [{ key: "addNamespaces", value: function(e3) {
    this.options.ns.indexOf(e3) < 0 && this.options.ns.push(e3);
  } }, { key: "removeNamespaces", value: function(e3) {
    var t3 = this.options.ns.indexOf(e3);
    t3 > -1 && this.options.ns.splice(t3, 1);
  } }, { key: "getResource", value: function(e3, t3, s3) {
    var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, i3 = void 0 !== n2.keySeparator ? n2.keySeparator : this.options.keySeparator, r3 = void 0 !== n2.ignoreJSONStructure ? n2.ignoreJSONStructure : this.options.ignoreJSONStructure, a2 = [e3, t3];
    s3 && "string" != typeof s3 && (a2 = a2.concat(s3)), s3 && "string" == typeof s3 && (a2 = a2.concat(i3 ? s3.split(i3) : s3)), e3.indexOf(".") > -1 && (a2 = e3.split("."));
    var o2 = Ge(this.data, a2);
    return o2 || !r3 || "string" != typeof s3 ? o2 : Be(this.data && this.data[e3] && this.data[e3][t3], s3, i3);
  } }, { key: "addResource", value: function(e3, t3, s3, n2) {
    var i3 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : { silent: false }, r3 = void 0 !== i3.keySeparator ? i3.keySeparator : this.options.keySeparator, a2 = [e3, t3];
    s3 && (a2 = a2.concat(r3 ? s3.split(r3) : s3)), e3.indexOf(".") > -1 && (n2 = t3, t3 = (a2 = e3.split("."))[1]), this.addNamespaces(t3), xe(this.data, a2, n2), i3.silent || this.emit("added", e3, t3, s3, n2);
  } }, { key: "addResources", value: function(e3, t3, s3) {
    var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : { silent: false };
    for (var i3 in s3)
      "string" != typeof s3[i3] && "[object Array]" !== Object.prototype.toString.apply(s3[i3]) || this.addResource(e3, t3, i3, s3[i3], { silent: true });
    n2.silent || this.emit("added", e3, t3, s3);
  } }, { key: "addResourceBundle", value: function(e3, t3, s3, n2, i3) {
    var r3 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : { silent: false }, a2 = [e3, t3];
    e3.indexOf(".") > -1 && (n2 = s3, s3 = t3, t3 = (a2 = e3.split("."))[1]), this.addNamespaces(t3);
    var o2 = Ge(this.data, a2) || {};
    n2 ? we(o2, s3, i3) : o2 = qe(qe({}, o2), s3), xe(this.data, a2, o2), r3.silent || this.emit("added", e3, t3, s3);
  } }, { key: "removeResourceBundle", value: function(e3, t3) {
    this.hasResourceBundle(e3, t3) && delete this.data[e3][t3], this.removeNamespaces(t3), this.emit("removed", e3, t3);
  } }, { key: "hasResourceBundle", value: function(e3, t3) {
    return void 0 !== this.getResource(e3, t3);
  } }, { key: "getResourceBundle", value: function(e3, t3) {
    return t3 || (t3 = this.options.defaultNS), "v1" === this.options.compatibilityAPI ? qe(qe({}, {}), this.getResource(e3, t3)) : this.getResource(e3, t3);
  } }, { key: "getDataByLanguage", value: function(e3) {
    return this.data[e3];
  } }, { key: "hasLanguageSomeTranslations", value: function(e3) {
    var t3 = this.getDataByLanguage(e3);
    return !!(t3 && Object.keys(t3) || []).find(function(e4) {
      return t3[e4] && Object.keys(t3[e4]).length > 0;
    });
  } }, { key: "toJSON", value: function() {
    return this.data;
  } }]), t2;
}(), We = { processors: {}, addPostProcessor: function(e2) {
  this.processors[e2.name] = e2;
}, handle: function(e2, t2, s3, n2, i3) {
  var r3 = this;
  return e2.forEach(function(e3) {
    r3.processors[e3] && (t2 = r3.processors[e3].process(t2, s3, n2, i3));
  }), t2;
} };
function Xe(e2, t2) {
  var s3 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e2);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Ze(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? Xe(Object(s3), true).forEach(function(t3) {
      Me(e2, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(s3)) : Xe(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e2;
}
function Qe(e2) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e3) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce(e2);
    if (t2) {
      var i3 = Ce(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
var et = {}, tt$1 = function() {
  be(t2, Ae);
  var e2 = Qe(t2);
  function t2(s3) {
    var n2, i3, r3, a2, o2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    return ve(this, t2), n2 = e2.call(this), He && Ae.call(Se(n2)), i3 = ["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], r3 = s3, a2 = Se(n2), i3.forEach(function(e3) {
      r3[e3] && (a2[e3] = r3[e3]);
    }), n2.options = o2, void 0 === n2.options.keySeparator && (n2.options.keySeparator = "."), n2.logger = Le.create("translator"), n2;
  }
  return Ie(t2, [{ key: "changeLanguage", value: function(e3) {
    e3 && (this.language = e3);
  } }, { key: "exists", value: function(e3) {
    var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
    if (null == e3)
      return false;
    var s3 = this.resolve(e3, t3);
    return s3 && void 0 !== s3.res;
  } }, { key: "extractFromKey", value: function(e3, t3) {
    var s3 = void 0 !== t3.nsSeparator ? t3.nsSeparator : this.options.nsSeparator;
    void 0 === s3 && (s3 = ":");
    var n2 = void 0 !== t3.keySeparator ? t3.keySeparator : this.options.keySeparator, i3 = t3.ns || this.options.defaultNS || [], r3 = s3 && e3.indexOf(s3) > -1, a2 = !(this.options.userDefinedKeySeparator || t3.keySeparator || this.options.userDefinedNsSeparator || t3.nsSeparator || function(e4, t4, s4) {
      t4 = t4 || "", s4 = s4 || "";
      var n3 = Ye.filter(function(e5) {
        return t4.indexOf(e5) < 0 && s4.indexOf(e5) < 0;
      });
      if (0 === n3.length)
        return true;
      var i4 = new RegExp("(".concat(n3.map(function(e5) {
        return "?" === e5 ? "\\?" : e5;
      }).join("|"), ")")), r4 = !i4.test(e4);
      if (!r4) {
        var a3 = e4.indexOf(s4);
        a3 > 0 && !i4.test(e4.substring(0, a3)) && (r4 = true);
      }
      return r4;
    }(e3, s3, n2));
    if (r3 && !a2) {
      var o2 = e3.match(this.interpolator.nestingRegexp);
      if (o2 && o2.length > 0)
        return { key: e3, namespaces: i3 };
      var u2 = e3.split(s3);
      (s3 !== n2 || s3 === n2 && this.options.ns.indexOf(u2[0]) > -1) && (i3 = u2.shift()), e3 = u2.join(n2);
    }
    return "string" == typeof i3 && (i3 = [i3]), { key: e3, namespaces: i3 };
  } }, { key: "translate", value: function(e3, s3, n2) {
    var i3 = this;
    if ("object" !== me(s3) && this.options.overloadTranslationOptionHandler && (s3 = this.options.overloadTranslationOptionHandler(arguments)), "object" === me(s3) && (s3 = Ze({}, s3)), s3 || (s3 = {}), null == e3)
      return "";
    Array.isArray(e3) || (e3 = [String(e3)]);
    var r3 = void 0 !== s3.returnDetails ? s3.returnDetails : this.options.returnDetails, a2 = void 0 !== s3.keySeparator ? s3.keySeparator : this.options.keySeparator, o2 = this.extractFromKey(e3[e3.length - 1], s3), u2 = o2.key, c2 = o2.namespaces, g2 = c2[c2.length - 1], l2 = s3.lng || this.language, h2 = s3.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
    if (l2 && "cimode" === l2.toLowerCase()) {
      if (h2) {
        var p3 = s3.nsSeparator || this.options.nsSeparator;
        return r3 ? { res: "".concat(g2).concat(p3).concat(u2), usedKey: u2, exactUsedKey: u2, usedLng: l2, usedNS: g2 } : "".concat(g2).concat(p3).concat(u2);
      }
      return r3 ? { res: u2, usedKey: u2, exactUsedKey: u2, usedLng: l2, usedNS: g2 } : u2;
    }
    var d2 = this.resolve(e3, s3), f2 = d2 && d2.res, m2 = d2 && d2.usedKey || u2, v3 = d2 && d2.exactUsedKey || u2, T2 = Object.prototype.toString.apply(f2), E2 = void 0 !== s3.joinArrays ? s3.joinArrays : this.options.joinArrays, I2 = !this.i18nFormat || this.i18nFormat.handleAsObject;
    if (I2 && f2 && ("string" != typeof f2 && "boolean" != typeof f2 && "number" != typeof f2) && ["[object Number]", "[object Function]", "[object RegExp]"].indexOf(T2) < 0 && ("string" != typeof E2 || "[object Array]" !== T2)) {
      if (!s3.returnObjects && !this.options.returnObjects) {
        this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
        var S2 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m2, f2, Ze(Ze({}, s3), {}, { ns: c2 })) : "key '".concat(u2, " (").concat(this.language, ")' returned an object instead of string.");
        return r3 ? (d2.res = S2, d2) : S2;
      }
      if (a2) {
        var y2 = "[object Array]" === T2, b2 = y2 ? [] : {}, U2 = y2 ? v3 : m2;
        for (var C2 in f2)
          if (Object.prototype.hasOwnProperty.call(f2, C2)) {
            var M2 = "".concat(U2).concat(a2).concat(C2);
            b2[C2] = this.translate(M2, Ze(Ze({}, s3), { joinArrays: false, ns: c2 })), b2[C2] === M2 && (b2[C2] = f2[C2]);
          }
        f2 = b2;
      }
    } else if (I2 && "string" == typeof E2 && "[object Array]" === T2)
      (f2 = f2.join(E2)) && (f2 = this.extendTranslation(f2, e3, s3, n2));
    else {
      var O2 = false, _2 = false, D2 = void 0 !== s3.count && "string" != typeof s3.count, P2 = t2.hasDefaultValue(s3), R2 = D2 ? this.pluralResolver.getSuffix(l2, s3.count, s3) : "", L2 = s3["defaultValue".concat(R2)] || s3.defaultValue;
      !this.isValidLookup(f2) && P2 && (O2 = true, f2 = L2), this.isValidLookup(f2) || (_2 = true, f2 = u2);
      var A2 = (s3.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && _2 ? void 0 : f2, j2 = P2 && L2 !== f2 && this.options.updateMissing;
      if (_2 || O2 || j2) {
        if (this.logger.log(j2 ? "updateKey" : "missingKey", l2, g2, u2, j2 ? L2 : f2), a2) {
          var k2 = this.resolve(u2, Ze(Ze({}, s3), {}, { keySeparator: false }));
          k2 && k2.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
        }
        var N3 = [], x2 = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s3.lng || this.language);
        if ("fallback" === this.options.saveMissingTo && x2 && x2[0])
          for (var G2 = 0; G2 < x2.length; G2++)
            N3.push(x2[G2]);
        else
          "all" === this.options.saveMissingTo ? N3 = this.languageUtils.toResolveHierarchy(s3.lng || this.language) : N3.push(s3.lng || this.language);
        var w2 = function(e4, t3, n3) {
          var r4 = P2 && n3 !== f2 ? n3 : A2;
          i3.options.missingKeyHandler ? i3.options.missingKeyHandler(e4, g2, t3, r4, j2, s3) : i3.backendConnector && i3.backendConnector.saveMissing && i3.backendConnector.saveMissing(e4, g2, t3, r4, j2, s3), i3.emit("missingKey", e4, g2, t3, f2);
        };
        this.options.saveMissing && (this.options.saveMissingPlurals && D2 ? N3.forEach(function(e4) {
          i3.pluralResolver.getSuffixes(e4, s3).forEach(function(t3) {
            w2([e4], u2 + t3, s3["defaultValue".concat(t3)] || L2);
          });
        }) : w2(N3, u2, L2));
      }
      f2 = this.extendTranslation(f2, e3, s3, d2, n2), _2 && f2 === u2 && this.options.appendNamespaceToMissingKey && (f2 = "".concat(g2, ":").concat(u2)), (_2 || O2) && this.options.parseMissingKeyHandler && (f2 = "v1" !== this.options.compatibilityAPI ? this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(g2, ":").concat(u2) : u2, O2 ? f2 : void 0) : this.options.parseMissingKeyHandler(f2));
    }
    return r3 ? (d2.res = f2, d2) : f2;
  } }, { key: "extendTranslation", value: function(e3, t3, s3, n2, i3) {
    var r3 = this;
    if (this.i18nFormat && this.i18nFormat.parse)
      e3 = this.i18nFormat.parse(e3, Ze(Ze({}, this.options.interpolation.defaultVariables), s3), n2.usedLng, n2.usedNS, n2.usedKey, { resolved: n2 });
    else if (!s3.skipInterpolation) {
      s3.interpolation && this.interpolator.init(Ze(Ze({}, s3), { interpolation: Ze(Ze({}, this.options.interpolation), s3.interpolation) }));
      var a2, o2 = "string" == typeof e3 && (s3 && s3.interpolation && void 0 !== s3.interpolation.skipOnVariables ? s3.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
      if (o2) {
        var u2 = e3.match(this.interpolator.nestingRegexp);
        a2 = u2 && u2.length;
      }
      var c2 = s3.replace && "string" != typeof s3.replace ? s3.replace : s3;
      if (this.options.interpolation.defaultVariables && (c2 = Ze(Ze({}, this.options.interpolation.defaultVariables), c2)), e3 = this.interpolator.interpolate(e3, c2, s3.lng || this.language, s3), o2) {
        var g2 = e3.match(this.interpolator.nestingRegexp);
        a2 < (g2 && g2.length) && (s3.nest = false);
      }
      !s3.lng && "v1" !== this.options.compatibilityAPI && n2 && n2.res && (s3.lng = n2.usedLng), false !== s3.nest && (e3 = this.interpolator.nest(e3, function() {
        for (var e4 = arguments.length, n3 = new Array(e4), a3 = 0; a3 < e4; a3++)
          n3[a3] = arguments[a3];
        return i3 && i3[0] === n3[0] && !s3.context ? (r3.logger.warn("It seems you are nesting recursively key: ".concat(n3[0], " in key: ").concat(t3[0])), null) : r3.translate.apply(r3, n3.concat([t3]));
      }, s3)), s3.interpolation && this.interpolator.reset();
    }
    var l2 = s3.postProcess || this.options.postProcess, h2 = "string" == typeof l2 ? [l2] : l2;
    return null != e3 && h2 && h2.length && false !== s3.applyPostProcessor && (e3 = We.handle(h2, e3, t3, this.options && this.options.postProcessPassResolved ? Ze({ i18nResolved: n2 }, s3) : s3, this)), e3;
  } }, { key: "resolve", value: function(e3) {
    var t3, s3, n2, i3, r3, a2 = this, o2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    return "string" == typeof e3 && (e3 = [e3]), e3.forEach(function(e4) {
      if (!a2.isValidLookup(t3)) {
        var u2 = a2.extractFromKey(e4, o2), c2 = u2.key;
        s3 = c2;
        var g2 = u2.namespaces;
        a2.options.fallbackNS && (g2 = g2.concat(a2.options.fallbackNS));
        var l2 = void 0 !== o2.count && "string" != typeof o2.count, h2 = l2 && !o2.ordinal && 0 === o2.count && a2.pluralResolver.shouldUseIntlApi(), p3 = void 0 !== o2.context && ("string" == typeof o2.context || "number" == typeof o2.context) && "" !== o2.context, d2 = o2.lngs ? o2.lngs : a2.languageUtils.toResolveHierarchy(o2.lng || a2.language, o2.fallbackLng);
        g2.forEach(function(e5) {
          a2.isValidLookup(t3) || (r3 = e5, !et["".concat(d2[0], "-").concat(e5)] && a2.utils && a2.utils.hasLoadedNamespace && !a2.utils.hasLoadedNamespace(r3) && (et["".concat(d2[0], "-").concat(e5)] = true, a2.logger.warn('key "'.concat(s3, '" for languages "').concat(d2.join(", "), `" won't get resolved as namespace "`).concat(r3, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), d2.forEach(function(s4) {
            if (!a2.isValidLookup(t3)) {
              i3 = s4;
              var r4, u3 = [c2];
              if (a2.i18nFormat && a2.i18nFormat.addLookupKeys)
                a2.i18nFormat.addLookupKeys(u3, c2, s4, e5, o2);
              else {
                var g3;
                l2 && (g3 = a2.pluralResolver.getSuffix(s4, o2.count, o2));
                var d3 = "".concat(a2.options.pluralSeparator, "zero");
                if (l2 && (u3.push(c2 + g3), h2 && u3.push(c2 + d3)), p3) {
                  var f2 = "".concat(c2).concat(a2.options.contextSeparator).concat(o2.context);
                  u3.push(f2), l2 && (u3.push(f2 + g3), h2 && u3.push(f2 + d3));
                }
              }
              for (; r4 = u3.pop(); )
                a2.isValidLookup(t3) || (n2 = r4, t3 = a2.getResource(s4, e5, r4, o2));
            }
          }));
        });
      }
    }), { res: t3, usedKey: s3, exactUsedKey: n2, usedLng: i3, usedNS: r3 };
  } }, { key: "isValidLookup", value: function(e3) {
    return !(void 0 === e3 || !this.options.returnNull && null === e3 || !this.options.returnEmptyString && "" === e3);
  } }, { key: "getResource", value: function(e3, t3, s3) {
    var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e3, t3, s3, n2) : this.resourceStore.getResource(e3, t3, s3, n2);
  } }], [{ key: "hasDefaultValue", value: function(e3) {
    var t3 = "defaultValue";
    for (var s3 in e3)
      if (Object.prototype.hasOwnProperty.call(e3, s3) && t3 === s3.substring(0, 12) && void 0 !== e3[s3])
        return true;
    return false;
  } }]), t2;
}();
function st(e2) {
  return e2.charAt(0).toUpperCase() + e2.slice(1);
}
var nt = function() {
  function e2(t2) {
    ve(this, e2), this.options = t2, this.supportedLngs = this.options.supportedLngs || false, this.logger = Le.create("languageUtils");
  }
  return Ie(e2, [{ key: "getScriptPartFromCode", value: function(e3) {
    if (!e3 || e3.indexOf("-") < 0)
      return null;
    var t2 = e3.split("-");
    return 2 === t2.length ? null : (t2.pop(), "x" === t2[t2.length - 1].toLowerCase() ? null : this.formatLanguageCode(t2.join("-")));
  } }, { key: "getLanguagePartFromCode", value: function(e3) {
    if (!e3 || e3.indexOf("-") < 0)
      return e3;
    var t2 = e3.split("-");
    return this.formatLanguageCode(t2[0]);
  } }, { key: "formatLanguageCode", value: function(e3) {
    if ("string" == typeof e3 && e3.indexOf("-") > -1) {
      var t2 = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"], s3 = e3.split("-");
      return this.options.lowerCaseLng ? s3 = s3.map(function(e4) {
        return e4.toLowerCase();
      }) : 2 === s3.length ? (s3[0] = s3[0].toLowerCase(), s3[1] = s3[1].toUpperCase(), t2.indexOf(s3[1].toLowerCase()) > -1 && (s3[1] = st(s3[1].toLowerCase()))) : 3 === s3.length && (s3[0] = s3[0].toLowerCase(), 2 === s3[1].length && (s3[1] = s3[1].toUpperCase()), "sgn" !== s3[0] && 2 === s3[2].length && (s3[2] = s3[2].toUpperCase()), t2.indexOf(s3[1].toLowerCase()) > -1 && (s3[1] = st(s3[1].toLowerCase())), t2.indexOf(s3[2].toLowerCase()) > -1 && (s3[2] = st(s3[2].toLowerCase()))), s3.join("-");
    }
    return this.options.cleanCode || this.options.lowerCaseLng ? e3.toLowerCase() : e3;
  } }, { key: "isSupportedCode", value: function(e3) {
    return ("languageOnly" === this.options.load || this.options.nonExplicitSupportedLngs) && (e3 = this.getLanguagePartFromCode(e3)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e3) > -1;
  } }, { key: "getBestMatchFromCodes", value: function(e3) {
    var t2, s3 = this;
    return e3 ? (e3.forEach(function(e4) {
      if (!t2) {
        var n2 = s3.formatLanguageCode(e4);
        s3.options.supportedLngs && !s3.isSupportedCode(n2) || (t2 = n2);
      }
    }), !t2 && this.options.supportedLngs && e3.forEach(function(e4) {
      if (!t2) {
        var n2 = s3.getLanguagePartFromCode(e4);
        if (s3.isSupportedCode(n2))
          return t2 = n2;
        t2 = s3.options.supportedLngs.find(function(e5) {
          return e5 === n2 ? e5 : e5.indexOf("-") < 0 && n2.indexOf("-") < 0 ? void 0 : 0 === e5.indexOf(n2) ? e5 : void 0;
        });
      }
    }), t2 || (t2 = this.getFallbackCodes(this.options.fallbackLng)[0]), t2) : null;
  } }, { key: "getFallbackCodes", value: function(e3, t2) {
    if (!e3)
      return [];
    if ("function" == typeof e3 && (e3 = e3(t2)), "string" == typeof e3 && (e3 = [e3]), "[object Array]" === Object.prototype.toString.apply(e3))
      return e3;
    if (!t2)
      return e3.default || [];
    var s3 = e3[t2];
    return s3 || (s3 = e3[this.getScriptPartFromCode(t2)]), s3 || (s3 = e3[this.formatLanguageCode(t2)]), s3 || (s3 = e3[this.getLanguagePartFromCode(t2)]), s3 || (s3 = e3.default), s3 || [];
  } }, { key: "toResolveHierarchy", value: function(e3, t2) {
    var s3 = this, n2 = this.getFallbackCodes(t2 || this.options.fallbackLng || [], e3), i3 = [], r3 = function(e4) {
      e4 && (s3.isSupportedCode(e4) ? i3.push(e4) : s3.logger.warn("rejecting language code not found in supportedLngs: ".concat(e4)));
    };
    return "string" == typeof e3 && e3.indexOf("-") > -1 ? ("languageOnly" !== this.options.load && r3(this.formatLanguageCode(e3)), "languageOnly" !== this.options.load && "currentOnly" !== this.options.load && r3(this.getScriptPartFromCode(e3)), "currentOnly" !== this.options.load && r3(this.getLanguagePartFromCode(e3))) : "string" == typeof e3 && r3(this.formatLanguageCode(e3)), n2.forEach(function(e4) {
      i3.indexOf(e4) < 0 && r3(s3.formatLanguageCode(e4));
    }), i3;
  } }]), e2;
}(), it = [{ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], nr: [1, 2], fc: 1 }, { lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"], nr: [1, 2], fc: 2 }, { lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], nr: [1], fc: 3 }, { lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], nr: [1, 2, 5], fc: 4 }, { lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 }, { lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 }, { lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ["fr"], nr: [1, 2], fc: 9 }, { lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ["is"], nr: [1, 2], fc: 12 }, { lngs: ["jv"], nr: [0, 1], fc: 13 }, { lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ["lt"], nr: [1, 2, 10], fc: 15 }, { lngs: ["lv"], nr: [1, 2, 0], fc: 16 }, { lngs: ["mk"], nr: [1, 2], fc: 17 }, { lngs: ["mnk"], nr: [0, 1, 2], fc: 18 }, { lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ["or"], nr: [2, 1], fc: 2 }, { lngs: ["ro"], nr: [1, 2, 20], fc: 20 }, { lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 }, { lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 }], rt = { 1: function(e2) {
  return Number(e2 > 1);
}, 2: function(e2) {
  return Number(1 != e2);
}, 3: function(e2) {
  return 0;
}, 4: function(e2) {
  return Number(e2 % 10 == 1 && e2 % 100 != 11 ? 0 : e2 % 10 >= 2 && e2 % 10 <= 4 && (e2 % 100 < 10 || e2 % 100 >= 20) ? 1 : 2);
}, 5: function(e2) {
  return Number(0 == e2 ? 0 : 1 == e2 ? 1 : 2 == e2 ? 2 : e2 % 100 >= 3 && e2 % 100 <= 10 ? 3 : e2 % 100 >= 11 ? 4 : 5);
}, 6: function(e2) {
  return Number(1 == e2 ? 0 : e2 >= 2 && e2 <= 4 ? 1 : 2);
}, 7: function(e2) {
  return Number(1 == e2 ? 0 : e2 % 10 >= 2 && e2 % 10 <= 4 && (e2 % 100 < 10 || e2 % 100 >= 20) ? 1 : 2);
}, 8: function(e2) {
  return Number(1 == e2 ? 0 : 2 == e2 ? 1 : 8 != e2 && 11 != e2 ? 2 : 3);
}, 9: function(e2) {
  return Number(e2 >= 2);
}, 10: function(e2) {
  return Number(1 == e2 ? 0 : 2 == e2 ? 1 : e2 < 7 ? 2 : e2 < 11 ? 3 : 4);
}, 11: function(e2) {
  return Number(1 == e2 || 11 == e2 ? 0 : 2 == e2 || 12 == e2 ? 1 : e2 > 2 && e2 < 20 ? 2 : 3);
}, 12: function(e2) {
  return Number(e2 % 10 != 1 || e2 % 100 == 11);
}, 13: function(e2) {
  return Number(0 !== e2);
}, 14: function(e2) {
  return Number(1 == e2 ? 0 : 2 == e2 ? 1 : 3 == e2 ? 2 : 3);
}, 15: function(e2) {
  return Number(e2 % 10 == 1 && e2 % 100 != 11 ? 0 : e2 % 10 >= 2 && (e2 % 100 < 10 || e2 % 100 >= 20) ? 1 : 2);
}, 16: function(e2) {
  return Number(e2 % 10 == 1 && e2 % 100 != 11 ? 0 : 0 !== e2 ? 1 : 2);
}, 17: function(e2) {
  return Number(1 == e2 || e2 % 10 == 1 && e2 % 100 != 11 ? 0 : 1);
}, 18: function(e2) {
  return Number(0 == e2 ? 0 : 1 == e2 ? 1 : 2);
}, 19: function(e2) {
  return Number(1 == e2 ? 0 : 0 == e2 || e2 % 100 > 1 && e2 % 100 < 11 ? 1 : e2 % 100 > 10 && e2 % 100 < 20 ? 2 : 3);
}, 20: function(e2) {
  return Number(1 == e2 ? 0 : 0 == e2 || e2 % 100 > 0 && e2 % 100 < 20 ? 1 : 2);
}, 21: function(e2) {
  return Number(e2 % 100 == 1 ? 1 : e2 % 100 == 2 ? 2 : e2 % 100 == 3 || e2 % 100 == 4 ? 3 : 0);
}, 22: function(e2) {
  return Number(1 == e2 ? 0 : 2 == e2 ? 1 : (e2 < 0 || e2 > 10) && e2 % 10 == 0 ? 2 : 3);
} }, at = ["v1", "v2", "v3"], ot = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
var ut = function() {
  function e2(t2) {
    var s3, n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    ve(this, e2), this.languageUtils = t2, this.options = n2, this.logger = Le.create("pluralResolver"), this.options.compatibilityJSON && "v4" !== this.options.compatibilityJSON || "undefined" != typeof Intl && Intl.PluralRules || (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = (s3 = {}, it.forEach(function(e3) {
      e3.lngs.forEach(function(t3) {
        s3[t3] = { numbers: e3.nr, plurals: rt[e3.fc] };
      });
    }), s3);
  }
  return Ie(e2, [{ key: "addRule", value: function(e3, t2) {
    this.rules[e3] = t2;
  } }, { key: "getRule", value: function(e3) {
    var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    if (this.shouldUseIntlApi())
      try {
        return new Intl.PluralRules(e3, { type: t2.ordinal ? "ordinal" : "cardinal" });
      } catch (e4) {
        return;
      }
    return this.rules[e3] || this.rules[this.languageUtils.getLanguagePartFromCode(e3)];
  } }, { key: "needsPlural", value: function(e3) {
    var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, s3 = this.getRule(e3, t2);
    return this.shouldUseIntlApi() ? s3 && s3.resolvedOptions().pluralCategories.length > 1 : s3 && s3.numbers.length > 1;
  } }, { key: "getPluralFormsOfKey", value: function(e3, t2) {
    var s3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    return this.getSuffixes(e3, s3).map(function(e4) {
      return "".concat(t2).concat(e4);
    });
  } }, { key: "getSuffixes", value: function(e3) {
    var t2 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n2 = this.getRule(e3, s3);
    return n2 ? this.shouldUseIntlApi() ? n2.resolvedOptions().pluralCategories.sort(function(e4, t3) {
      return ot[e4] - ot[t3];
    }).map(function(e4) {
      return "".concat(t2.options.prepend).concat(e4);
    }) : n2.numbers.map(function(n3) {
      return t2.getSuffix(e3, n3, s3);
    }) : [];
  } }, { key: "getSuffix", value: function(e3, t2) {
    var s3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n2 = this.getRule(e3, s3);
    return n2 ? this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(n2.select(t2)) : this.getSuffixRetroCompatible(n2, t2) : (this.logger.warn("no plural rule found for: ".concat(e3)), "");
  } }, { key: "getSuffixRetroCompatible", value: function(e3, t2) {
    var s3 = this, n2 = e3.noAbs ? e3.plurals(t2) : e3.plurals(Math.abs(t2)), i3 = e3.numbers[n2];
    this.options.simplifyPluralSuffix && 2 === e3.numbers.length && 1 === e3.numbers[0] && (2 === i3 ? i3 = "plural" : 1 === i3 && (i3 = ""));
    var r3 = function() {
      return s3.options.prepend && i3.toString() ? s3.options.prepend + i3.toString() : i3.toString();
    };
    return "v1" === this.options.compatibilityJSON ? 1 === i3 ? "" : "number" == typeof i3 ? "_plural_".concat(i3.toString()) : r3() : "v2" === this.options.compatibilityJSON || this.options.simplifyPluralSuffix && 2 === e3.numbers.length && 1 === e3.numbers[0] ? r3() : this.options.prepend && n2.toString() ? this.options.prepend + n2.toString() : n2.toString();
  } }, { key: "shouldUseIntlApi", value: function() {
    return !at.includes(this.options.compatibilityJSON);
  } }]), e2;
}();
function ct(e2, t2) {
  var s3 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e2);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function gt(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? ct(Object(s3), true).forEach(function(t3) {
      Me(e2, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(s3)) : ct(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e2;
}
function lt(e2, t2, s3) {
  var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ".", i3 = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], r3 = function(e3, t3, s4) {
    var n3 = Ge(e3, s4);
    return void 0 !== n3 ? n3 : Ge(t3, s4);
  }(e2, t2, s3);
  return !r3 && i3 && "string" == typeof s3 && void 0 === (r3 = Be(e2, s3, n2)) && (r3 = Be(t2, s3, n2)), r3;
}
var ht = function() {
  function e2() {
    var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    ve(this, e2), this.logger = Le.create("interpolator"), this.options = t2, this.format = t2.interpolation && t2.interpolation.format || function(e3) {
      return e3;
    }, this.init(t2);
  }
  return Ie(e2, [{ key: "init", value: function() {
    var e3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    e3.interpolation || (e3.interpolation = { escapeValue: true });
    var t2 = e3.interpolation;
    this.escape = void 0 !== t2.escape ? t2.escape : $e, this.escapeValue = void 0 === t2.escapeValue || t2.escapeValue, this.useRawValueToEscape = void 0 !== t2.useRawValueToEscape && t2.useRawValueToEscape, this.prefix = t2.prefix ? Ve(t2.prefix) : t2.prefixEscaped || "{{", this.suffix = t2.suffix ? Ve(t2.suffix) : t2.suffixEscaped || "}}", this.formatSeparator = t2.formatSeparator ? t2.formatSeparator : t2.formatSeparator || ",", this.unescapePrefix = t2.unescapeSuffix ? "" : t2.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t2.unescapeSuffix || "", this.nestingPrefix = t2.nestingPrefix ? Ve(t2.nestingPrefix) : t2.nestingPrefixEscaped || Ve("$t("), this.nestingSuffix = t2.nestingSuffix ? Ve(t2.nestingSuffix) : t2.nestingSuffixEscaped || Ve(")"), this.nestingOptionsSeparator = t2.nestingOptionsSeparator ? t2.nestingOptionsSeparator : t2.nestingOptionsSeparator || ",", this.maxReplaces = t2.maxReplaces ? t2.maxReplaces : 1e3, this.alwaysFormat = void 0 !== t2.alwaysFormat && t2.alwaysFormat, this.resetRegExp();
  } }, { key: "reset", value: function() {
    this.options && this.init(this.options);
  } }, { key: "resetRegExp", value: function() {
    var e3 = "".concat(this.prefix, "(.+?)").concat(this.suffix);
    this.regexp = new RegExp(e3, "g");
    var t2 = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
    this.regexpUnescape = new RegExp(t2, "g");
    var s3 = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
    this.nestingRegexp = new RegExp(s3, "g");
  } }, { key: "interpolate", value: function(e3, t2, s3, n2) {
    var i3, r3, a2, o2 = this, u2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
    function c2(e4) {
      return e4.replace(/\$/g, "$$$$");
    }
    var g2 = function(e4) {
      if (e4.indexOf(o2.formatSeparator) < 0) {
        var i4 = lt(t2, u2, e4, o2.options.keySeparator, o2.options.ignoreJSONStructure);
        return o2.alwaysFormat ? o2.format(i4, void 0, s3, gt(gt(gt({}, n2), t2), {}, { interpolationkey: e4 })) : i4;
      }
      var r4 = e4.split(o2.formatSeparator), a3 = r4.shift().trim(), c3 = r4.join(o2.formatSeparator).trim();
      return o2.format(lt(t2, u2, a3, o2.options.keySeparator, o2.options.ignoreJSONStructure), c3, s3, gt(gt(gt({}, n2), t2), {}, { interpolationkey: a3 }));
    };
    this.resetRegExp();
    var l2 = n2 && n2.missingInterpolationHandler || this.options.missingInterpolationHandler, h2 = n2 && n2.interpolation && void 0 !== n2.interpolation.skipOnVariables ? n2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
    return [{ regex: this.regexpUnescape, safeValue: function(e4) {
      return c2(e4);
    } }, { regex: this.regexp, safeValue: function(e4) {
      return o2.escapeValue ? c2(o2.escape(e4)) : c2(e4);
    } }].forEach(function(t3) {
      for (a2 = 0; i3 = t3.regex.exec(e3); ) {
        var s4 = i3[1].trim();
        if (void 0 === (r3 = g2(s4)))
          if ("function" == typeof l2) {
            var u3 = l2(e3, i3, n2);
            r3 = "string" == typeof u3 ? u3 : "";
          } else if (n2 && Object.prototype.hasOwnProperty.call(n2, s4))
            r3 = "";
          else {
            if (h2) {
              r3 = i3[0];
              continue;
            }
            o2.logger.warn("missed to pass in variable ".concat(s4, " for interpolating ").concat(e3)), r3 = "";
          }
        else
          "string" == typeof r3 || o2.useRawValueToEscape || (r3 = ke(r3));
        var c3 = t3.safeValue(r3);
        if (e3 = e3.replace(i3[0], c3), h2 ? (t3.regex.lastIndex += r3.length, t3.regex.lastIndex -= i3[0].length) : t3.regex.lastIndex = 0, ++a2 >= o2.maxReplaces)
          break;
      }
    }), e3;
  } }, { key: "nest", value: function(e3, t2) {
    var s3, n2, i3, r3 = this, a2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    function o2(e4, t3) {
      var s4 = this.nestingOptionsSeparator;
      if (e4.indexOf(s4) < 0)
        return e4;
      var n3 = e4.split(new RegExp("".concat(s4, "[ ]*{"))), r4 = "{".concat(n3[1]);
      e4 = n3[0];
      var a3 = (r4 = this.interpolate(r4, i3)).match(/'/g), o3 = r4.match(/"/g);
      (a3 && a3.length % 2 == 0 && !o3 || o3.length % 2 != 0) && (r4 = r4.replace(/'/g, '"'));
      try {
        i3 = JSON.parse(r4), t3 && (i3 = gt(gt({}, t3), i3));
      } catch (t4) {
        return this.logger.warn("failed parsing options string in nesting for key ".concat(e4), t4), "".concat(e4).concat(s4).concat(r4);
      }
      return delete i3.defaultValue, e4;
    }
    for (; s3 = this.nestingRegexp.exec(e3); ) {
      var u2 = [];
      (i3 = (i3 = gt({}, a2)).replace && "string" != typeof i3.replace ? i3.replace : i3).applyPostProcessor = false, delete i3.defaultValue;
      var c2 = false;
      if (-1 !== s3[0].indexOf(this.formatSeparator) && !/{.*}/.test(s3[1])) {
        var g2 = s3[1].split(this.formatSeparator).map(function(e4) {
          return e4.trim();
        });
        s3[1] = g2.shift(), u2 = g2, c2 = true;
      }
      if ((n2 = t2(o2.call(this, s3[1].trim(), i3), i3)) && s3[0] === e3 && "string" != typeof n2)
        return n2;
      "string" != typeof n2 && (n2 = ke(n2)), n2 || (this.logger.warn("missed to resolve ".concat(s3[1], " for nesting ").concat(e3)), n2 = ""), c2 && (n2 = u2.reduce(function(e4, t3) {
        return r3.format(e4, t3, a2.lng, gt(gt({}, a2), {}, { interpolationkey: s3[1].trim() }));
      }, n2.trim())), e3 = e3.replace(s3[0], n2), this.regexp.lastIndex = 0;
    }
    return e3;
  } }]), e2;
}();
function pt(e2, t2) {
  var s3 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e2);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function dt(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? pt(Object(s3), true).forEach(function(t3) {
      Me(e2, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(s3)) : pt(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e2;
}
function ft(e2) {
  var t2 = {};
  return function(s3, n2, i3) {
    var r3 = n2 + JSON.stringify(i3), a2 = t2[r3];
    return a2 || (a2 = e2(n2, i3), t2[r3] = a2), a2(s3);
  };
}
var mt = function() {
  function e2() {
    var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    ve(this, e2), this.logger = Le.create("formatter"), this.options = t2, this.formats = { number: ft(function(e3, t3) {
      var s3 = new Intl.NumberFormat(e3, dt({}, t3));
      return function(e4) {
        return s3.format(e4);
      };
    }), currency: ft(function(e3, t3) {
      var s3 = new Intl.NumberFormat(e3, dt(dt({}, t3), {}, { style: "currency" }));
      return function(e4) {
        return s3.format(e4);
      };
    }), datetime: ft(function(e3, t3) {
      var s3 = new Intl.DateTimeFormat(e3, dt({}, t3));
      return function(e4) {
        return s3.format(e4);
      };
    }), relativetime: ft(function(e3, t3) {
      var s3 = new Intl.RelativeTimeFormat(e3, dt({}, t3));
      return function(e4) {
        return s3.format(e4, t3.range || "day");
      };
    }), list: ft(function(e3, t3) {
      var s3 = new Intl.ListFormat(e3, dt({}, t3));
      return function(e4) {
        return s3.format(e4);
      };
    }) }, this.init(t2);
  }
  return Ie(e2, [{ key: "init", value: function(e3) {
    var t2 = (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} }).interpolation;
    this.formatSeparator = t2.formatSeparator ? t2.formatSeparator : t2.formatSeparator || ",";
  } }, { key: "add", value: function(e3, t2) {
    this.formats[e3.toLowerCase().trim()] = t2;
  } }, { key: "addCached", value: function(e3, t2) {
    this.formats[e3.toLowerCase().trim()] = ft(t2);
  } }, { key: "format", value: function(e3, t2, s3) {
    var n2 = this, i3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return t2.split(this.formatSeparator).reduce(function(e4, t3) {
      var r3 = function(e5) {
        var t4 = e5.toLowerCase().trim(), s4 = {};
        if (e5.indexOf("(") > -1) {
          var n3 = e5.split("(");
          t4 = n3[0].toLowerCase().trim();
          var i4 = n3[1].substring(0, n3[1].length - 1);
          "currency" === t4 && i4.indexOf(":") < 0 ? s4.currency || (s4.currency = i4.trim()) : "relativetime" === t4 && i4.indexOf(":") < 0 ? s4.range || (s4.range = i4.trim()) : i4.split(";").forEach(function(e6) {
            if (e6) {
              var t5 = _e(e6.split(":")), n4 = t5[0], i5 = t5.slice(1).join(":").trim().replace(/^'+|'+$/g, "");
              s4[n4.trim()] || (s4[n4.trim()] = i5), "false" === i5 && (s4[n4.trim()] = false), "true" === i5 && (s4[n4.trim()] = true), isNaN(i5) || (s4[n4.trim()] = parseInt(i5, 10));
            }
          });
        }
        return { formatName: t4, formatOptions: s4 };
      }(t3), a2 = r3.formatName, o2 = r3.formatOptions;
      if (n2.formats[a2]) {
        var u2 = e4;
        try {
          var c2 = i3 && i3.formatParams && i3.formatParams[i3.interpolationkey] || {}, g2 = c2.locale || c2.lng || i3.locale || i3.lng || s3;
          u2 = n2.formats[a2](e4, g2, dt(dt(dt({}, o2), i3), c2));
        } catch (e5) {
          n2.logger.warn(e5);
        }
        return u2;
      }
      return n2.logger.warn("there was no format function for ".concat(a2)), e4;
    }, e3);
  } }]), e2;
}();
function vt(e2, t2) {
  var s3 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e2);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Tt(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? vt(Object(s3), true).forEach(function(t3) {
      Me(e2, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(s3)) : vt(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e2;
}
function Et(e2) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e3) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce(e2);
    if (t2) {
      var i3 = Ce(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
var It = function() {
  be(t2, Ae);
  var e2 = Et(t2);
  function t2(s3, n2, i3) {
    var r3, a2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return ve(this, t2), r3 = e2.call(this), He && Ae.call(Se(r3)), r3.backend = s3, r3.store = n2, r3.services = i3, r3.languageUtils = i3.languageUtils, r3.options = a2, r3.logger = Le.create("backendConnector"), r3.waitingReads = [], r3.maxParallelReads = a2.maxParallelReads || 10, r3.readingCalls = 0, r3.maxRetries = a2.maxRetries >= 0 ? a2.maxRetries : 5, r3.retryTimeout = a2.retryTimeout >= 1 ? a2.retryTimeout : 350, r3.state = {}, r3.queue = [], r3.backend && r3.backend.init && r3.backend.init(i3, a2.backend, a2), r3;
  }
  return Ie(t2, [{ key: "queueLoad", value: function(e3, t3, s3, n2) {
    var i3 = this, r3 = {}, a2 = {}, o2 = {}, u2 = {};
    return e3.forEach(function(e4) {
      var n3 = true;
      t3.forEach(function(t4) {
        var o3 = "".concat(e4, "|").concat(t4);
        !s3.reload && i3.store.hasResourceBundle(e4, t4) ? i3.state[o3] = 2 : i3.state[o3] < 0 || (1 === i3.state[o3] ? void 0 === a2[o3] && (a2[o3] = true) : (i3.state[o3] = 1, n3 = false, void 0 === a2[o3] && (a2[o3] = true), void 0 === r3[o3] && (r3[o3] = true), void 0 === u2[t4] && (u2[t4] = true)));
      }), n3 || (o2[e4] = true);
    }), (Object.keys(r3).length || Object.keys(a2).length) && this.queue.push({ pending: a2, pendingCount: Object.keys(a2).length, loaded: {}, errors: [], callback: n2 }), { toLoad: Object.keys(r3), pending: Object.keys(a2), toLoadLanguages: Object.keys(o2), toLoadNamespaces: Object.keys(u2) };
  } }, { key: "loaded", value: function(e3, t3, s3) {
    var n2 = e3.split("|"), i3 = n2[0], r3 = n2[1];
    t3 && this.emit("failedLoading", i3, r3, t3), s3 && this.store.addResourceBundle(i3, r3, s3), this.state[e3] = t3 ? -1 : 2;
    var a2 = {};
    this.queue.forEach(function(s4) {
      var n3, o2, c2, g2, l2;
      n3 = s4.loaded, o2 = r3, c2 = Ne(n3, [i3], Object), g2 = c2.obj, l2 = c2.k, g2[l2] = g2[l2] || [], g2[l2].push(o2), function(e4, t4) {
        void 0 !== e4.pending[t4] && (delete e4.pending[t4], e4.pendingCount--);
      }(s4, e3), t3 && s4.errors.push(t3), 0 !== s4.pendingCount || s4.done || (Object.keys(s4.loaded).forEach(function(e4) {
        a2[e4] || (a2[e4] = {});
        var t4 = s4.loaded[e4];
        t4.length && t4.forEach(function(t5) {
          void 0 === a2[e4][t5] && (a2[e4][t5] = true);
        });
      }), s4.done = true, s4.errors.length ? s4.callback(s4.errors) : s4.callback());
    }), this.emit("loaded", a2), this.queue = this.queue.filter(function(e4) {
      return !e4.done;
    });
  } }, { key: "read", value: function(e3, t3, s3) {
    var n2 = this, i3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, r3 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.retryTimeout, a2 = arguments.length > 5 ? arguments[5] : void 0;
    if (!e3.length)
      return a2(null, {});
    if (this.readingCalls >= this.maxParallelReads)
      this.waitingReads.push({ lng: e3, ns: t3, fcName: s3, tried: i3, wait: r3, callback: a2 });
    else {
      this.readingCalls++;
      var o2 = function(o3, u3) {
        if (n2.readingCalls--, n2.waitingReads.length > 0) {
          var c3 = n2.waitingReads.shift();
          n2.read(c3.lng, c3.ns, c3.fcName, c3.tried, c3.wait, c3.callback);
        }
        o3 && u3 && i3 < n2.maxRetries ? setTimeout(function() {
          n2.read.call(n2, e3, t3, s3, i3 + 1, 2 * r3, a2);
        }, r3) : a2(o3, u3);
      }, u2 = this.backend[s3].bind(this.backend);
      if (2 !== u2.length)
        return u2(e3, t3, o2);
      try {
        var c2 = u2(e3, t3);
        c2 && "function" == typeof c2.then ? c2.then(function(e4) {
          return o2(null, e4);
        }).catch(o2) : o2(null, c2);
      } catch (e4) {
        o2(e4);
      }
    }
  } }, { key: "prepareLoading", value: function(e3, t3) {
    var s3 = this, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i3 = arguments.length > 3 ? arguments[3] : void 0;
    if (!this.backend)
      return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i3 && i3();
    "string" == typeof e3 && (e3 = this.languageUtils.toResolveHierarchy(e3)), "string" == typeof t3 && (t3 = [t3]);
    var r3 = this.queueLoad(e3, t3, n2, i3);
    if (!r3.toLoad.length)
      return r3.pending.length || i3(), null;
    r3.toLoad.forEach(function(e4) {
      s3.loadOne(e4);
    });
  } }, { key: "load", value: function(e3, t3, s3) {
    this.prepareLoading(e3, t3, {}, s3);
  } }, { key: "reload", value: function(e3, t3, s3) {
    this.prepareLoading(e3, t3, { reload: true }, s3);
  } }, { key: "loadOne", value: function(e3) {
    var t3 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", n2 = e3.split("|"), i3 = n2[0], r3 = n2[1];
    this.read(i3, r3, "read", void 0, void 0, function(n3, a2) {
      n3 && t3.logger.warn("".concat(s3, "loading namespace ").concat(r3, " for language ").concat(i3, " failed"), n3), !n3 && a2 && t3.logger.log("".concat(s3, "loaded namespace ").concat(r3, " for language ").concat(i3), a2), t3.loaded(e3, n3, a2);
    });
  } }, { key: "saveMissing", value: function(e3, t3, s3, n2, i3) {
    var r3 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}, a2 = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : function() {
    };
    if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t3))
      this.logger.warn('did not save key "'.concat(s3, '" as the namespace "').concat(t3, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
    else if (null != s3 && "" !== s3) {
      if (this.backend && this.backend.create) {
        var o2 = Tt(Tt({}, r3), {}, { isUpdate: i3 }), u2 = this.backend.create.bind(this.backend);
        if (u2.length < 6)
          try {
            var c2;
            (c2 = 5 === u2.length ? u2(e3, t3, s3, n2, o2) : u2(e3, t3, s3, n2)) && "function" == typeof c2.then ? c2.then(function(e4) {
              return a2(null, e4);
            }).catch(a2) : a2(null, c2);
          } catch (e4) {
            a2(e4);
          }
        else
          u2(e3, t3, s3, n2, a2, o2);
      }
      e3 && e3[0] && this.store.addResource(e3[0], t3, s3, n2);
    }
  } }]), t2;
}();
function St() {
  return { debug: false, initImmediate: true, ns: ["translation"], defaultNS: ["translation"], fallbackLng: ["dev"], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: "all", preload: false, simplifyPluralSuffix: true, keySeparator: ".", nsSeparator: ":", pluralSeparator: "_", contextSeparator: "_", partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: "fallback", saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: true, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: function(e2) {
    var t2 = {};
    if ("object" === me(e2[1]) && (t2 = e2[1]), "string" == typeof e2[1] && (t2.defaultValue = e2[1]), "string" == typeof e2[2] && (t2.tDescription = e2[2]), "object" === me(e2[2]) || "object" === me(e2[3])) {
      var s3 = e2[3] || e2[2];
      Object.keys(s3).forEach(function(e3) {
        t2[e3] = s3[e3];
      });
    }
    return t2;
  }, interpolation: { escapeValue: true, format: function(e2, t2, s3, n2) {
    return e2;
  }, prefix: "{{", suffix: "}}", formatSeparator: ",", unescapePrefix: "-", nestingPrefix: "$t(", nestingSuffix: ")", nestingOptionsSeparator: ",", maxReplaces: 1e3, skipOnVariables: true } };
}
function yt(e2) {
  return "string" == typeof e2.ns && (e2.ns = [e2.ns]), "string" == typeof e2.fallbackLng && (e2.fallbackLng = [e2.fallbackLng]), "string" == typeof e2.fallbackNS && (e2.fallbackNS = [e2.fallbackNS]), e2.supportedLngs && e2.supportedLngs.indexOf("cimode") < 0 && (e2.supportedLngs = e2.supportedLngs.concat(["cimode"])), e2;
}
function bt(e2, t2) {
  var s3 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e2);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Ut(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? bt(Object(s3), true).forEach(function(t3) {
      Me(e2, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(s3)) : bt(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e2;
}
function Ct(e2) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e3) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce(e2);
    if (t2) {
      var i3 = Ce(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
function Mt() {
}
var Ot = function() {
  be(t2, Ae);
  var e2 = Ct(t2);
  function t2() {
    var s3, n2, i3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, r3 = arguments.length > 1 ? arguments[1] : void 0;
    if (ve(this, t2), s3 = e2.call(this), He && Ae.call(Se(s3)), s3.options = yt(i3), s3.services = {}, s3.logger = Le, s3.modules = { external: [] }, n2 = Se(s3), Object.getOwnPropertyNames(Object.getPrototypeOf(n2)).forEach(function(e3) {
      "function" == typeof n2[e3] && (n2[e3] = n2[e3].bind(n2));
    }), r3 && !s3.isInitialized && !i3.isClone) {
      if (!s3.options.initImmediate)
        return s3.init(i3, r3), Ue(s3, Se(s3));
      setTimeout(function() {
        s3.init(i3, r3);
      }, 0);
    }
    return s3;
  }
  return Ie(t2, [{ key: "init", value: function() {
    var e3 = this, t3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, s3 = arguments.length > 1 ? arguments[1] : void 0;
    "function" == typeof t3 && (s3 = t3, t3 = {}), !t3.defaultNS && false !== t3.defaultNS && t3.ns && ("string" == typeof t3.ns ? t3.defaultNS = t3.ns : t3.ns.indexOf("translation") < 0 && (t3.defaultNS = t3.ns[0]));
    var n2 = St();
    function i3(e4) {
      return e4 ? "function" == typeof e4 ? new e4() : e4 : null;
    }
    if (this.options = Ut(Ut(Ut({}, n2), this.options), yt(t3)), "v1" !== this.options.compatibilityAPI && (this.options.interpolation = Ut(Ut({}, n2.interpolation), this.options.interpolation)), void 0 !== t3.keySeparator && (this.options.userDefinedKeySeparator = t3.keySeparator), void 0 !== t3.nsSeparator && (this.options.userDefinedNsSeparator = t3.nsSeparator), !this.options.isClone) {
      var r3;
      this.modules.logger ? Le.init(i3(this.modules.logger), this.options) : Le.init(null, this.options), this.modules.formatter ? r3 = this.modules.formatter : "undefined" != typeof Intl && (r3 = mt);
      var a2 = new nt(this.options);
      this.store = new Je(this.options.resources, this.options);
      var o2 = this.services;
      o2.logger = Le, o2.resourceStore = this.store, o2.languageUtils = a2, o2.pluralResolver = new ut(a2, { prepend: this.options.pluralSeparator, compatibilityJSON: this.options.compatibilityJSON, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), !r3 || this.options.interpolation.format && this.options.interpolation.format !== n2.interpolation.format || (o2.formatter = i3(r3), o2.formatter.init(o2, this.options), this.options.interpolation.format = o2.formatter.format.bind(o2.formatter)), o2.interpolator = new ht(this.options), o2.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, o2.backendConnector = new It(i3(this.modules.backend), o2.resourceStore, o2, this.options), o2.backendConnector.on("*", function(t4) {
        for (var s4 = arguments.length, n3 = new Array(s4 > 1 ? s4 - 1 : 0), i4 = 1; i4 < s4; i4++)
          n3[i4 - 1] = arguments[i4];
        e3.emit.apply(e3, [t4].concat(n3));
      }), this.modules.languageDetector && (o2.languageDetector = i3(this.modules.languageDetector), o2.languageDetector.init && o2.languageDetector.init(o2, this.options.detection, this.options)), this.modules.i18nFormat && (o2.i18nFormat = i3(this.modules.i18nFormat), o2.i18nFormat.init && o2.i18nFormat.init(this)), this.translator = new tt$1(this.services, this.options), this.translator.on("*", function(t4) {
        for (var s4 = arguments.length, n3 = new Array(s4 > 1 ? s4 - 1 : 0), i4 = 1; i4 < s4; i4++)
          n3[i4 - 1] = arguments[i4];
        e3.emit.apply(e3, [t4].concat(n3));
      }), this.modules.external.forEach(function(t4) {
        t4.init && t4.init(e3);
      });
    }
    if (this.format = this.options.interpolation.format, s3 || (s3 = Mt), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
      var u2 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
      u2.length > 0 && "dev" !== u2[0] && (this.options.lng = u2[0]);
    }
    this.services.languageDetector || this.options.lng || this.logger.warn("init: no languageDetector is used and no lng is defined");
    ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach(function(t4) {
      e3[t4] = function() {
        var s4;
        return (s4 = e3.store)[t4].apply(s4, arguments);
      };
    });
    ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach(function(t4) {
      e3[t4] = function() {
        var s4;
        return (s4 = e3.store)[t4].apply(s4, arguments), e3;
      };
    });
    var c2 = je(), g2 = function() {
      var t4 = function(t5, n3) {
        e3.isInitialized && !e3.initializedStoreOnce && e3.logger.warn("init: i18next is already initialized. You should call init just once!"), e3.isInitialized = true, e3.options.isClone || e3.logger.log("initialized", e3.options), e3.emit("initialized", e3.options), c2.resolve(n3), s3(t5, n3);
      };
      if (e3.languages && "v1" !== e3.options.compatibilityAPI && !e3.isInitialized)
        return t4(null, e3.t.bind(e3));
      e3.changeLanguage(e3.options.lng, t4);
    };
    return this.options.resources || !this.options.initImmediate ? g2() : setTimeout(g2, 0), c2;
  } }, { key: "loadResources", value: function(e3) {
    var t3 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Mt, n2 = "string" == typeof e3 ? e3 : this.language;
    if ("function" == typeof e3 && (s3 = e3), !this.options.resources || this.options.partialBundledLanguages) {
      if (n2 && "cimode" === n2.toLowerCase())
        return s3();
      var i3 = [], r3 = function(e4) {
        e4 && t3.services.languageUtils.toResolveHierarchy(e4).forEach(function(e5) {
          i3.indexOf(e5) < 0 && i3.push(e5);
        });
      };
      if (n2)
        r3(n2);
      else
        this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e4) {
          return r3(e4);
        });
      this.options.preload && this.options.preload.forEach(function(e4) {
        return r3(e4);
      }), this.services.backendConnector.load(i3, this.options.ns, function(e4) {
        e4 || t3.resolvedLanguage || !t3.language || t3.setResolvedLanguage(t3.language), s3(e4);
      });
    } else
      s3(null);
  } }, { key: "reloadResources", value: function(e3, t3, s3) {
    var n2 = je();
    return e3 || (e3 = this.languages), t3 || (t3 = this.options.ns), s3 || (s3 = Mt), this.services.backendConnector.reload(e3, t3, function(e4) {
      n2.resolve(), s3(e4);
    }), n2;
  } }, { key: "use", value: function(e3) {
    if (!e3)
      throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
    if (!e3.type)
      throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
    return "backend" === e3.type && (this.modules.backend = e3), ("logger" === e3.type || e3.log && e3.warn && e3.error) && (this.modules.logger = e3), "languageDetector" === e3.type && (this.modules.languageDetector = e3), "i18nFormat" === e3.type && (this.modules.i18nFormat = e3), "postProcessor" === e3.type && We.addPostProcessor(e3), "formatter" === e3.type && (this.modules.formatter = e3), "3rdParty" === e3.type && this.modules.external.push(e3), this;
  } }, { key: "setResolvedLanguage", value: function(e3) {
    if (e3 && this.languages && !(["cimode", "dev"].indexOf(e3) > -1))
      for (var t3 = 0; t3 < this.languages.length; t3++) {
        var s3 = this.languages[t3];
        if (!(["cimode", "dev"].indexOf(s3) > -1) && this.store.hasLanguageSomeTranslations(s3)) {
          this.resolvedLanguage = s3;
          break;
        }
      }
  } }, { key: "changeLanguage", value: function(e3, t3) {
    var s3 = this;
    this.isLanguageChangingTo = e3;
    var n2 = je();
    this.emit("languageChanging", e3);
    var i3 = function(e4) {
      s3.language = e4, s3.languages = s3.services.languageUtils.toResolveHierarchy(e4), s3.resolvedLanguage = void 0, s3.setResolvedLanguage(e4);
    }, r3 = function(r4) {
      e3 || r4 || !s3.services.languageDetector || (r4 = []);
      var a2 = "string" == typeof r4 ? r4 : s3.services.languageUtils.getBestMatchFromCodes(r4);
      a2 && (s3.language || i3(a2), s3.translator.language || s3.translator.changeLanguage(a2), s3.services.languageDetector && s3.services.languageDetector.cacheUserLanguage && s3.services.languageDetector.cacheUserLanguage(a2)), s3.loadResources(a2, function(e4) {
        !function(e5, r5) {
          r5 ? (i3(r5), s3.translator.changeLanguage(r5), s3.isLanguageChangingTo = void 0, s3.emit("languageChanged", r5), s3.logger.log("languageChanged", r5)) : s3.isLanguageChangingTo = void 0, n2.resolve(function() {
            return s3.t.apply(s3, arguments);
          }), t3 && t3(e5, function() {
            return s3.t.apply(s3, arguments);
          });
        }(e4, a2);
      });
    };
    return e3 || !this.services.languageDetector || this.services.languageDetector.async ? !e3 && this.services.languageDetector && this.services.languageDetector.async ? 0 === this.services.languageDetector.detect.length ? this.services.languageDetector.detect().then(r3) : this.services.languageDetector.detect(r3) : r3(e3) : r3(this.services.languageDetector.detect()), n2;
  } }, { key: "getFixedT", value: function(e3, t3, s3) {
    var n2 = this, i3 = function e4(t4, i4) {
      var r3;
      if ("object" !== me(i4)) {
        for (var a2 = arguments.length, o2 = new Array(a2 > 2 ? a2 - 2 : 0), u2 = 2; u2 < a2; u2++)
          o2[u2 - 2] = arguments[u2];
        r3 = n2.options.overloadTranslationOptionHandler([t4, i4].concat(o2));
      } else
        r3 = Ut({}, i4);
      r3.lng = r3.lng || e4.lng, r3.lngs = r3.lngs || e4.lngs, r3.ns = r3.ns || e4.ns, r3.keyPrefix = r3.keyPrefix || s3 || e4.keyPrefix;
      var c2, g2 = n2.options.keySeparator || ".";
      return c2 = r3.keyPrefix && Array.isArray(t4) ? t4.map(function(e5) {
        return "".concat(r3.keyPrefix).concat(g2).concat(e5);
      }) : r3.keyPrefix ? "".concat(r3.keyPrefix).concat(g2).concat(t4) : t4, n2.t(c2, r3);
    };
    return "string" == typeof e3 ? i3.lng = e3 : i3.lngs = e3, i3.ns = t3, i3.keyPrefix = s3, i3;
  } }, { key: "t", value: function() {
    var e3;
    return this.translator && (e3 = this.translator).translate.apply(e3, arguments);
  } }, { key: "exists", value: function() {
    var e3;
    return this.translator && (e3 = this.translator).exists.apply(e3, arguments);
  } }, { key: "setDefaultNamespace", value: function(e3) {
    this.options.defaultNS = e3;
  } }, { key: "hasLoadedNamespace", value: function(e3) {
    var t3 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    if (!this.isInitialized)
      return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), false;
    if (!this.languages || !this.languages.length)
      return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), false;
    var n2 = s3.lng || this.resolvedLanguage || this.languages[0], i3 = !!this.options && this.options.fallbackLng, r3 = this.languages[this.languages.length - 1];
    if ("cimode" === n2.toLowerCase())
      return true;
    var a2 = function(e4, s4) {
      var n3 = t3.services.backendConnector.state["".concat(e4, "|").concat(s4)];
      return -1 === n3 || 2 === n3;
    };
    if (s3.precheck) {
      var o2 = s3.precheck(this, a2);
      if (void 0 !== o2)
        return o2;
    }
    return !!this.hasResourceBundle(n2, e3) || (!(this.services.backendConnector.backend && (!this.options.resources || this.options.partialBundledLanguages)) || !(!a2(n2, e3) || i3 && !a2(r3, e3)));
  } }, { key: "loadNamespaces", value: function(e3, t3) {
    var s3 = this, n2 = je();
    return this.options.ns ? ("string" == typeof e3 && (e3 = [e3]), e3.forEach(function(e4) {
      s3.options.ns.indexOf(e4) < 0 && s3.options.ns.push(e4);
    }), this.loadResources(function(e4) {
      n2.resolve(), t3 && t3(e4);
    }), n2) : (t3 && t3(), Promise.resolve());
  } }, { key: "loadLanguages", value: function(e3, t3) {
    var s3 = je();
    "string" == typeof e3 && (e3 = [e3]);
    var n2 = this.options.preload || [], i3 = e3.filter(function(e4) {
      return n2.indexOf(e4) < 0;
    });
    return i3.length ? (this.options.preload = n2.concat(i3), this.loadResources(function(e4) {
      s3.resolve(), t3 && t3(e4);
    }), s3) : (t3 && t3(), Promise.resolve());
  } }, { key: "dir", value: function(e3) {
    if (e3 || (e3 = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e3)
      return "rtl";
    var t3 = this.services && this.services.languageUtils || new nt(St());
    return ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"].indexOf(t3.getLanguagePartFromCode(e3)) > -1 || e3.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
  } }, { key: "cloneInstance", value: function() {
    var e3 = this, s3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Mt, i3 = Ut(Ut(Ut({}, this.options), s3), { isClone: true }), r3 = new t2(i3);
    void 0 === s3.debug && void 0 === s3.prefix || (r3.logger = r3.logger.clone(s3));
    return ["store", "services", "language"].forEach(function(t3) {
      r3[t3] = e3[t3];
    }), r3.services = Ut({}, this.services), r3.services.utils = { hasLoadedNamespace: r3.hasLoadedNamespace.bind(r3) }, r3.translator = new tt$1(r3.services, r3.options), r3.translator.on("*", function(e4) {
      for (var t3 = arguments.length, s4 = new Array(t3 > 1 ? t3 - 1 : 0), n3 = 1; n3 < t3; n3++)
        s4[n3 - 1] = arguments[n3];
      r3.emit.apply(r3, [e4].concat(s4));
    }), r3.init(i3, n2), r3.translator.options = r3.options, r3.translator.backendConnector.services.utils = { hasLoadedNamespace: r3.hasLoadedNamespace.bind(r3) }, r3;
  } }, { key: "toJSON", value: function() {
    return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
  } }]), t2;
}();
Me(Ot, "createInstance", function() {
  return new Ot(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, arguments.length > 1 ? arguments[1] : void 0);
});
var _t = Ot.createInstance();
_t.createInstance = Ot.createInstance, _t.createInstance, _t.dir, _t.init, _t.loadResources, _t.reloadResources, _t.use, _t.changeLanguage, _t.getFixedT, _t.t, _t.exists, _t.setDefaultNamespace, _t.hasLoadedNamespace, _t.loadNamespaces, _t.loadLanguages;
class Dt extends ne {
  constructor() {
    super(), this.languages = null, this.keyMap = {};
  }
  static getInstance() {
    return Dt.instance || (Dt.instance = new Dt()), Dt.instance;
  }
  provideLanguages(e2) {
    var t2;
    G || (this.languages = e2, (null === (t2 = e2["zh-CN"]) || void 0 === t2 ? void 0 : t2.Chat) && this.setKeyMap(e2["zh-CN"]), index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUITranslateService.provideLanguages ok."));
  }
  useI18n(e2) {
    var t2;
    if (G)
      return;
    if (!this.languages)
      return void index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUITranslateService.useI18next not have messages.");
    const s3 = {};
    for (const [e3, t3] of Object.entries(this.languages)) {
      s3["zh_cn" === e3 ? "zh" : e3] = { translation: t3 };
    }
    _t.init({ compatibilityJSON: "v3", lng: e2 || "zh", fallbackLng: "zh", detection: { order: ["querystring", "navigator"], caches: ["localStorage", "cookie"] }, resources: s3 });
    let n2 = this.normalizeLanguageKey(e2 || "zh");
    null === (t2 = this.getEngine().TUIReport) || void 0 === t2 || t2.reportFeature(201, n2);
  }
  changeLanguage(e2) {
    let t2 = this.normalizeLanguageKey(e2);
    return this.getEngine().TUIReport.reportFeature(201, t2), _t.changeLanguage(e2);
  }
  normalizeLanguageKey(e2) {
    return e2.includes("en") ? "en-us" : e2.includes("tw") ? "zh-tw" : e2.includes("zh") || e2.includes("cn") ? "zh-cn" : e2.includes("ko") || e2.includes("kr") ? "ko-kr" : e2.includes("ja") || e2.includes("jp") ? "ja-jp" : "other-" + e2;
  }
  t(e2) {
    if (!this.languages) {
      let t3 = e2;
      return !S(e2) && e2.indexOf(".") > -1 && (t3 = e2.split(".").pop() || ""), t3;
    }
    const t2 = this.keyMap[e2];
    return t2 ? _t.t(t2) : _t.t(e2);
  }
  setKeyMap(e2, t2) {
    for (const s3 in e2)
      if (Object.prototype.hasOwnProperty.call(e2, s3)) {
        const n2 = t2 ? `${t2}.${s3}` : s3;
        if (e2[s3] && "object" == typeof e2[s3] && !Array.isArray(e2[s3]) && null !== e2[s3])
          this.setKeyMap(e2[s3], n2);
        else {
          let n3 = t2 ? `${t2}.${e2[s3]}` : e2[s3];
          n3 = this.replaceKey(n3), this.keyMap[n3] = `${t2}.${s3}`;
        }
      }
  }
  replaceKey(e2) {
    return e2.startsWith("Chat") ? e2.replace("Chat", "TUIChat") : e2.startsWith("Conversation") ? e2.replace("Conversation", "TUIConversation") : e2.startsWith("Message") ? e2.replace("Message", "message.tip") : e2.startsWith("Call") ? e2.replace("Call", "message.custom") : e2;
  }
}
class Pt extends ne {
  constructor() {
    super(), this.serv = "TUIConversationService";
  }
  static getInstance() {
    return Pt.instance || (Pt.instance = new Pt()), Pt.instance;
  }
  init() {
    const e2 = this.getEngine();
    e2.eventCenter.addEvent(e2.EVENT.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated.bind(this)), e2.eventCenter.addEvent(e2.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalUnreadCountUpdated.bind(this)), e2.eventCenter.addEvent(e2.EVENT.MESSAGE_RECEIVED, this.onMessageReceived.bind(this)), this.getConversationInitData();
  }
  onConversationListUpdated(e2) {
    const t2 = this.filterSystemConversation(e2);
    this.getEngine().TUIStore.update(exports.o.CONV, "conversationList", t2), this.updateCurrentConversation();
  }
  onTotalUnreadCountUpdated(e2) {
    this.getEngine().TUIStore.update(exports.o.CONV, "totalUnreadCount", e2);
  }
  onMessageReceived(e2) {
    const t2 = this.getEngine(), s3 = this.getEngine().TUIStore.getData(exports.o.CONV, "conversationList");
    let n2 = false;
    for (let i3 = 0; i3 < e2.length; i3++) {
      if (e2[i3].type !== t2.TYPES.MSG_GRP_SYS_NOTICE)
        continue;
      const { operationType: r3 } = e2[i3].payload, a2 = `GROUP${e2[i3].to}`, u2 = 4 === r3 || 5 === r3 || 8 === r3, c2 = 2 === r3 || 6 === r3 || 7 === r3;
      if (u2 || c2) {
        for (let e3 = 0; e3 < s3.length; e3++)
          if (s3[e3].type !== t2.TYPES.CONV_C2C && s3[e3].conversationID === a2) {
            if (u2) {
              this.getEngine().TUIStore.update(exports.o.CONV, "operationTypeMap", { conversationID: a2, operationType: r3 }), n2 = true;
              break;
            }
            if (c2 && s3[e3].operationType > 0) {
              this.getEngine().TUIStore.update(exports.o.CONV, "operationTypeMap", { conversationID: a2, operationType: 0 }), n2 = true;
              break;
            }
          }
      }
    }
    if (n2) {
      this.getEngine().TUIStore.update(exports.o.CONV, "conversationList", s3);
      const e3 = this.getEngine().TUIStore.getData(exports.o.CONV, "currentConversationID") || "", t3 = this.findConversation(e3);
      t3 && this.getEngine().TUIStore.update(exports.o.CONV, "currentConversation", t3);
    }
  }
  getConversationInitData() {
    const e2 = this.getEngine();
    e2.chat.isReady() && e2.chat.getConversationList().then((t2) => {
      const { conversationList: s3, isSyncCompleted: n2 } = t2.data;
      if (index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${this.serv}.init, getConversationList count:${s3.length} isSyncCompleted:${n2}`), s3.length > 0) {
        this.onConversationListUpdated(s3);
        const t3 = e2.chat.getTotalUnreadMessageCount();
        this.onTotalUnreadCountUpdated(t3);
      }
    });
  }
  switchConversation(e2) {
    return i$1(this, void 0, void 0, function* () {
      const t2 = `${this.serv}.switchConversation`, s3 = this.getEngine();
      if (!e2)
        return s3.TUIStore.reset(exports.o.CHAT, ["messageList", "isCompleted", "nextReqMessageID"]), s3.TUIStore.update(exports.o.CONV, "currentConversationID", ""), s3.TUIStore.update(exports.o.CONV, "currentConversation", null), index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} conversationID is empty, conversationID:${e2}`), Promise.resolve({});
      if (!e2.startsWith(s3.TYPES.CONV_C2C) && !e2.startsWith(s3.TYPES.CONV_GROUP))
        return index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} conversationID is invalid, conversationID:${e2}`), Promise.reject({ code: h$1.INVALID_CONV_ID, message: d$1.INVALID_CONV_ID });
      const n2 = s3.TUIStore.getData(exports.o.CONV, "currentConversationID");
      if (n2 && n2 === e2)
        return this.setMessageRead(n2), index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} please check conversationID, conversationID:${e2}`), Promise.resolve({ code: h$1.CONV_ID_SAME, message: d$1.CONV_ID_SAME });
      const i3 = yield this.getConversationModel(e2);
      return S(i3) ? (index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} target conversation is not exist, conversationID:${e2}`), Promise.reject({ code: h$1.CONV_NOT_EXIST, message: d$1.CONV_NOT_EXIST })) : (n2 && this.setMessageRead(n2), e2 && this.setMessageRead(e2), s3.TUIStore.reset(exports.o.CHAT, ["messageList", "isCompleted", "nextReqMessageID"]), s3.TUIStore.update(exports.o.CONV, "currentConversationID", e2), s3.TUIStore.update(exports.o.CONV, "currentConversation", i3), Promise.resolve(i3));
    });
  }
  getConversationModel(e2) {
    return i$1(this, void 0, void 0, function* () {
      let t2 = this.findConversation(e2);
      if (S(t2))
        try {
          const s3 = yield this.getConversationProfile(e2);
          s3.data && s3.data.conversation && (t2 = new ae(s3.data.conversation));
        } catch (e3) {
          t2 = void 0;
        }
      return t2;
    });
  }
  findConversation(e2) {
    let t2;
    const s3 = this.getEngine().TUIStore.getData(exports.o.CONV, "conversationList");
    for (let n2 = 0; n2 < s3.length; n2++)
      if (s3[n2].conversationID === e2) {
        t2 = s3[n2];
        break;
      }
    return t2;
  }
  updateCurrentConversation() {
    const e2 = this.getEngine(), t2 = e2.TUIStore.getData(exports.o.CONV, "currentConversationID"), s3 = this.findConversation(t2);
    s3 && e2.TUIStore.update(exports.o.CONV, "currentConversation", s3);
  }
  getConversationList() {
    return this.getEngine().chat.getConversationList();
  }
  getConversationProfile(e2) {
    return this.getEngine().chat.getConversationProfile(e2);
  }
  deleteConversation(e2) {
    return this.getEngine().chat.deleteConversation(e2).then((t2) => {
      const s3 = this.getEngine().TUIStore.getData(exports.o.CONV, "currentConversationID");
      return index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${this.serv}.deleteConversation conversationID:${e2} currentConversationID:${s3}`), e2 === s3 && (this.getEngine().TUIStore.update(exports.o.CONV, "currentConversationID", ""), this.getEngine().TUIStore.update(exports.o.CONV, "currentConversation", null)), t2;
    });
  }
  pinConversation(e2) {
    return this.getEngine().chat.pinConversation(e2);
  }
  muteConversation(e2) {
    return this.getEngine().chat.setMessageRemindType(e2);
  }
  clearHistoryMessage(e2) {
    return this.getEngine().chat.clearHistoryMessage(e2).then((e3) => (this.getEngine().TUIStore.update(exports.o.CHAT, "messageList", []), this.getEngine().TUIStore.update(exports.o.CHAT, "nextReqMessageID", ""), this.getEngine().TUIStore.update(exports.o.CHAT, "isCompleted", true), e3));
  }
  setMessageRead(e2) {
    return this.getEngine().chat.setMessageRead({ conversationID: e2 });
  }
  setConversationDraft(e2) {
    const { conversationID: t2, draftInfo: s3 } = e2;
    let n2 = "";
    return s3 && (n2 = JSON.stringify(s3)), this.getEngine().chat.setConversationDraft({ conversationID: t2, draftText: n2 }).then((e3) => {
      const { conversation: t3 } = e3.data;
      this.updateConversation(t3);
    });
  }
  updateConversation(e2) {
    let t2 = false;
    const s3 = this.getEngine().TUIStore.getData(exports.o.CONV, "conversationList");
    for (let n2 = 0; n2 < s3.length; n2++)
      if (s3[n2].conversationID === e2.conversationID) {
        s3[n2] = e2, t2 = true;
        break;
      }
    t2 && this.getEngine().TUIStore.update(exports.o.CONV, "conversationList", s3);
  }
  filterSystemConversation(e2) {
    return e2.filter((e3) => e3.type !== this.getEngine().TYPES.CONV_SYSTEM);
  }
}
class Rt {
  constructor(e2) {
    this.TUIUserService = e2;
  }
  getEngine() {
    return this.TUIUserService.getEngine();
  }
  init() {
    this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.PROFILE_UPDATED, this.onProfileUpdated.bind(this)), this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.BLACKLIST_UPDATED, this.onBlacklistUpdated.bind(this)), this.getUserProfileInitData();
  }
  onProfileUpdated(e2) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(exports.o.USER, "userProfile");
    e2.forEach((e3) => {
      e3.userID === s3.userID && t2.TUIStore.update(exports.o.USER, "userProfile", e3);
    });
  }
  onBlacklistUpdated(e2) {
    const t2 = this.getEngine();
    this.getBlacklistProfile(e2).then((e3) => {
      t2.TUIStore.update(exports.o.USER, "userBlacklist", e3);
    });
  }
  getUserProfileInitData() {
    const e2 = this.getEngine();
    e2.chat.isReady() && e2.chat.getBlacklist().then((e3) => {
      const t2 = e3.data || [];
      index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIUserProfileHandler.init, getBlacklist count:${t2.length}`), t2.length > 0 && this.onBlacklistUpdated(t2);
    });
  }
  getBlacklistProfile(e2) {
    const t2 = [];
    let s3 = 0;
    for (; s3 < e2.length; )
      t2.push(e2.slice(s3, s3 += 100));
    const n2 = [];
    t2.forEach((e3) => {
      n2.push(this.TUIUserService.getUserProfile({ userIDList: e3 }));
    });
    const i3 = [];
    return Promise.all(n2).then((e3) => (e3.forEach((e4) => {
      const t3 = e4.data.map((e5) => {
        const { userID: t4, nick: s4, avatar: n3 } = e5;
        return { userID: t4, nick: s4, avatar: n3 };
      });
      i3.push(...t3);
    }), i3));
  }
  getUserProfile(e2) {
    const t2 = this.getEngine();
    return S(e2) ? t2.chat.getMyProfile().then((e3) => (t2.TUIStore.update(exports.o.USER, "userProfile", e3.data), e3)).catch((e3) => Promise.reject(e3)) : t2.chat.getUserProfile(e2);
  }
  updateMyProfile(e2) {
    return this.getEngine().chat.updateMyProfile(e2);
  }
  addToBlacklist(e2) {
    return this.getEngine().chat.addToBlacklist(e2);
  }
  removeFromBlacklist(e2) {
    return this.getEngine().chat.removeFromBlacklist(e2);
  }
}
function Lt(e2, t2, s3 = true) {
  !function(e3, t3) {
    V ? H.setStorageSync(e3, t3) : kt() && localStorage.setItem(e3, JSON.stringify(t3));
  }(s3 ? jt(e2) : e2, t2);
}
function At(e2, t2 = true) {
  try {
    return function(e3) {
      if (V)
        return H.getStorageSync(e3);
      if (kt()) {
        const t3 = localStorage.getItem(e3);
        if ("undefined" !== t3)
          return JSON.parse(t3);
      }
      return;
    }(t2 ? jt(e2) : e2);
  } catch (e3) {
    return void index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "Storage.getStorageItem error:", e3);
  }
}
function jt(e2) {
  return `chat_engine_${e2}`;
}
function kt() {
  return navigator && navigator.cookieEnabled && localStorage;
}
class Nt {
  constructor(e2) {
    this.TUIUserService = e2;
  }
  getEngine() {
    return this.TUIUserService.getEngine();
  }
  init() {
    const e2 = this.getEngine(), t2 = At("displayOnlineStatus") || false;
    e2.TUIStore.update(exports.o.USER, "displayOnlineStatus", t2), e2.eventCenter.addEvent(e2.EVENT.USER_STATUS_UPDATED, this.onUserStatusUpdated.bind(this)), this.onConversationListUpdated();
  }
  onConversationListUpdated() {
    const e2 = this.getEngine();
    e2.TUIStore.watch(exports.o.CONV, { conversationList: () => {
      const t2 = e2.TUIStore.getData(exports.o.APP, "enabledOnlineStatus"), s3 = e2.TUIStore.getData(exports.o.USER, "displayOnlineStatus");
      t2 && s3 && this.startToSubscribe();
    } });
  }
  onUserStatusUpdated(e2) {
    this.getEngine().TUIStore.update(exports.o.USER, "userStatusList", e2);
  }
  switchUserStatus(e2) {
    const t2 = this.getEngine(), { displayOnlineStatus: s3 = false } = e2;
    t2.TUIStore.update(exports.o.USER, "displayOnlineStatus", s3), Lt("displayOnlineStatus", s3);
    const n2 = t2.TUIStore.getData(exports.o.APP, "enabledOnlineStatus");
    n2 ? true === s3 ? this.startToSubscribe() : this.unsubscribeUserStatus() : index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `UserStatusHandler.switchUserStatus enabledOnlineStatus:${n2} displayOnlineStatus:${s3}`);
  }
  getUserStatus(e2) {
    const t2 = this.getEngine();
    return t2.chat.getUserStatus(e2).then((e3) => {
      const { successUserList: s3 } = e3.data;
      return s3.length > 0 && t2.TUIStore.update(exports.o.USER, "userStatusList", s3), e3;
    }).catch((e3) => Promise.reject(e3));
  }
  subscribeUserStatus(e2) {
    var t2;
    const s3 = (null === (t2 = null == e2 ? void 0 : e2.userIDList) || void 0 === t2 ? void 0 : t2.length) || 0;
    return 0 === s3 ? (index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `UserStatusHandler.subscribeUserStatus userID count:${s3}`), Promise.resolve()) : this.getEngine().chat.subscribeUserStatus(e2);
  }
  unsubscribeUserStatus(e2) {
    const t2 = this.getEngine(), { userIDList: s3 = [] } = e2 || {};
    return t2.chat.unsubscribeUserStatus({ userIDList: s3 }).then((e3) => {
      const { failureUserList: n2 } = e3.data, i3 = [];
      return s3.forEach((e4) => {
        n2.includes(e4) || i3.push({ userID: e4, statusType: u$1.UNSUB_USER });
      }), t2.TUIStore.update(exports.o.USER, "userStatusList", i3), e3;
    }).catch((e3) => Promise.reject(e3));
  }
  startToSubscribe() {
    const e2 = this.getEngine(), t2 = e2.TUIStore.getData(exports.o.CONV, "conversationList"), s3 = e2.TUIStore.getData(exports.o.USER, "userStatusList"), n2 = [];
    t2.forEach((t3) => {
      if (t3.type === e2.TYPES.CONV_C2C) {
        const i3 = t3.conversationID.replace(e2.TYPES.CONV_C2C, "");
        s3.has(i3) || n2.push(i3);
      }
    }), 0 !== n2.length && e2.chat.isReady() && (this.subscribeUserStatus({ userIDList: n2 }), this.getUserStatus({ userIDList: n2 }));
  }
}
class xt extends ne {
  constructor() {
    super(), this.userProfileHandler = new Rt(this), this.userStatusHandler = new Nt(this);
  }
  static getInstance() {
    return xt.instance || (xt.instance = new xt()), xt.instance;
  }
  init() {
    const e2 = this.getEngine();
    e2.eventCenter.addEvent(e2.EVENT.KICKED_OUT, this.onKickedOut.bind(this)), e2.eventCenter.addEvent(e2.EVENT.NET_STATE_CHANGE, this.onNetStateChange.bind(this)), this.userProfileHandler.init(), this.userStatusHandler.init(), this.initMessageReadReceipt();
  }
  onKickedOut(e2) {
    this.getEngine().TUIStore.update(exports.o.USER, "kickedOut", e2.type);
  }
  onNetStateChange(e2) {
    this.getEngine().TUIStore.update(exports.o.USER, "netStateChange", e2.state);
  }
  initMessageReadReceipt() {
    const e2 = At("displayMessageReadReceipt") || true;
    this.getEngine().TUIStore.update(exports.o.USER, "displayMessageReadReceipt", e2);
  }
  switchUserStatus(e2) {
    return this.userStatusHandler.switchUserStatus(e2);
  }
  switchMessageReadStatus(e2) {
    this.getEngine().TUIStore.update(exports.o.USER, "displayMessageReadReceipt", e2), Lt("displayMessageReadReceipt", e2);
  }
  getUserProfile(e2) {
    return this.userProfileHandler.getUserProfile(e2);
  }
  updateMyProfile(e2) {
    return this.userProfileHandler.updateMyProfile(e2);
  }
  addToBlacklist(e2) {
    return this.userProfileHandler.addToBlacklist(e2);
  }
  removeFromBlacklist(e2) {
    return this.userProfileHandler.removeFromBlacklist(e2);
  }
  getUserStatus(e2) {
    return this.userStatusHandler.getUserStatus(e2);
  }
  subscribeUserStatus(e2) {
    return this.userStatusHandler.subscribeUserStatus(e2);
  }
  unsubscribeUserStatus(e2) {
    return this.userStatusHandler.unsubscribeUserStatus(e2);
  }
}
class Gt {
  constructor(e2) {
    this.TUIChatService = e2, this.userShowNameMap = /* @__PURE__ */ new Map(), this.requestedUserMap = /* @__PURE__ */ new Map();
  }
  getEngine() {
    return this.TUIChatService.getEngine();
  }
  t(e2) {
    return this.getEngine().TUITranslate.t(e2);
  }
  handleTextMessage(e2) {
    return { text: this.decodeText(e2.payload) };
  }
  handleFaceMessage(e2) {
    const t2 = { name: "", url: "", type: "" };
    return e2.payload.data.indexOf("@custom") > -1 ? (t2.name = e2.payload.data, t2.type = "custom", t2) : (t2.name = e2.payload.data.indexOf("@2x") < 0 ? `${e2.payload.data}@2x` : e2.payload.data, t2.url = `${P$1}${t2.name}.png`, t2);
  }
  handleLocationMessage(e2) {
    const t2 = { lon: "", lat: "", href: "", url: "", description: "" };
    return t2.lon = e2.payload.longitude.toFixed(6), t2.lat = e2.payload.latitude.toFixed(6), t2.href = `${R}pointx=${t2.lon}&pointy=${t2.lat}&name=${e2.payload.description}`, t2.url = `${L$1}center=${t2.lat},${t2.lon}&zoom=10&size=300*150&maptype=roadmap&markers=size:large|color:0xFFCCFF|label:k|${t2.lat},${t2.lon}&key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD`, t2.description = e2.payload.description, t2;
  }
  handleImageMessage(e2) {
    return { url: e2.payload.imageInfoArray[0].url, width: e2.payload.imageInfoArray[0].width, height: e2.payload.imageInfoArray[0].height };
  }
  handleAudioMessage(e2) {
    return { url: e2.payload.url, second: e2.payload.second };
  }
  handleVideoMessage(e2) {
    return { url: e2.payload.videoUrl, snapshotUrl: e2.payload.snapshotUrl, snapshotWidth: e2.payload.snapshotWidth, snapshotHeight: e2.payload.snapshotHeight };
  }
  handleFileMessage(e2) {
    return { url: e2.payload.fileUrl, name: e2.payload.fileName, size: C(e2.payload.fileSize) };
  }
  handleCustomMessage(e2) {
    var t2;
    const s3 = this.handleCreateGroupCustomMessage(e2);
    return { custom: this.handleCallKitSignaling(e2) || s3 || (null === (t2 = null == e2 ? void 0 : e2.payload) || void 0 === t2 ? void 0 : t2.extension) || `${this.t("TUIChat.[自定义消息]")}`, businessID: s3 ? "group_create" : "" };
  }
  handleMergeMessage(e2) {
    return Object.assign({}, e2.payload);
  }
  handleGroupTipsMessage(e2) {
    var t2, s3, n2, i3, r3, a2;
    const o2 = this.getEngine(), u2 = { text: "" };
    let c2 = (null == e2 ? void 0 : e2.nick) || (null === (s3 = null === (t2 = null == e2 ? void 0 : e2.payload) || void 0 === t2 ? void 0 : t2.userIDList) || void 0 === s3 ? void 0 : s3.join(","));
    switch ((null === (i3 = null === (n2 = null == e2 ? void 0 : e2.payload) || void 0 === n2 ? void 0 : n2.memberList) || void 0 === i3 ? void 0 : i3.length) > 0 && (c2 = "", null === (a2 = null === (r3 = null == e2 ? void 0 : e2.payload) || void 0 === r3 ? void 0 : r3.memberList) || void 0 === a2 || a2.map((e3) => {
      const t3 = (null == e3 ? void 0 : e3.nick) || (null == e3 ? void 0 : e3.userID);
      return c2 += `${this.substringByLength(t3)},`, e3;
    }), c2 = null == c2 ? void 0 : c2.slice(0, -1)), e2.payload.operationType) {
      case o2.TYPES.GRP_TIP_MBR_JOIN:
        u2.text = `${c2} ${this.t("message.tip.加入群组")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_QUIT:
        u2.text = `${this.t("message.tip.群成员")}：${c2} ${this.t("message.tip.退出群组")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_KICKED_OUT:
        u2.text = `${this.t("message.tip.群成员")}：${c2} ${this.t("message.tip.被")}${this.t("message.tip.踢出群组")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_SET_ADMIN:
        u2.text = `${this.t("message.tip.群成员")}：${c2} ${this.t("message.tip.成为管理员")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:
        u2.text = `${this.t("message.tip.群成员")}：${c2} ${this.t("message.tip.被撤销管理员")}`;
        break;
      case o2.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:
        u2.text = this.handleGroupProfileUpdated(e2);
        break;
      case o2.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:
        for (const t3 of e2.payload.memberList)
          t3.muteTime > 0 ? u2.text = `${this.t("message.tip.群成员")}：${c2} ${this.t("message.tip.被禁言")}` : u2.text = `${this.t("message.tip.群成员")}：${c2} ${this.t("message.tip.被取消禁言")}`;
        break;
      default:
        u2.text = `[${this.t("message.tip.群提示消息")}]`;
    }
    return u2;
  }
  handleGroupSystemMessage(e2) {
    const t2 = e2.payload.groupProfile.name || e2.payload.groupProfile.groupID, s3 = { text: "" };
    switch (e2.payload.operationType) {
      case 1:
        s3.text = `${e2.payload.operatorID} ${this.t("message.tip.申请加入群组")}：${t2}`;
        break;
      case 2:
        s3.text = `${this.t("message.tip.成功加入群组")}：${t2}`;
        break;
      case 3:
        s3.text = `${this.t("message.tip.申请加入群组")}：${t2} ${this.t("message.tip.被拒绝")}`;
        break;
      case 4:
        s3.text = `${this.t("message.tip.你被管理员")}${e2.payload.operatorID} ${this.t("message.tip.踢出群组")}：${t2}`;
        break;
      case 5:
        s3.text = `${this.t("message.tip.群")}：${t2} ${this.t("message.tip.被")} ${e2.payload.operatorID} ${this.t("message.tip.解散")}`;
        break;
      case 6:
        s3.text = `${e2.payload.operatorID} ${this.t("message.tip.创建群")}：${t2}`;
        break;
      case 7:
      case 12:
        s3.text = `${e2.payload.operatorID} ${this.t("message.tip.邀请你加群")}：${t2}`;
        break;
      case 8:
        s3.text = `${this.t("message.tip.你退出群组")}：${t2}`;
        break;
      case 9:
        s3.text = `${this.t("message.tip.你被")}${e2.payload.operatorID} ${this.t("message.tip.设置为群")}：${t2} ${this.t("message.tip.的管理员")}`;
        break;
      case 10:
        s3.text = `${this.t("message.tip.你被")}${e2.payload.operatorID} ${this.t("message.tip.撤销群")}：${t2} ${this.t("message.tip.的管理员身份")}`;
        break;
      case 13:
        s3.text = `${e2.payload.operatorID} ${this.t("message.tip.同意加群")}：${t2}`;
        break;
      case 14:
        s3.text = `${e2.payload.operatorID} ${this.t("message.tip.拒接加群")}：${t2}`;
        break;
      case 255:
        s3.text = `${this.t("message.tip.自定义群系统通知")}: ${e2.payload.userDefinedField}`;
        break;
      default:
        s3.text = "未解析的群系统通知";
    }
    return s3;
  }
  handleCallKitSignaling(e2) {
    var t2, s3, n2, i3, r3, a2, o2, u2, c2, g2;
    const l2 = U(e2.payload.data);
    if (1 !== (null == l2 ? void 0 : l2.businessID))
      return "";
    const h2 = U(null == l2 ? void 0 : l2.data), p3 = e2.fromAccount || e2.from, d2 = this.getEngine().TUIFriend.getFriendRemark([p3]), f2 = this.getEngine().getMyUserID();
    let m2 = d2[p3] || e2.nameCard || e2.nick || p3;
    switch (m2 = this.substringByLength(m2), null == l2 ? void 0 : l2.actionType) {
      case 1:
        return "audioCall" !== (null === (t2 = null == h2 ? void 0 : h2.data) || void 0 === t2 ? void 0 : t2.cmd) && "videoCall" !== (null === (s3 = null == h2 ? void 0 : h2.data) || void 0 === s3 ? void 0 : s3.cmd) || !(null == l2 ? void 0 : l2.groupID) ? "hangup" === (null === (n2 = null == h2 ? void 0 : h2.data) || void 0 === n2 ? void 0 : n2.cmd) ? (null == l2 ? void 0 : l2.groupID) ? `${this.t("message.custom.通话结束")}` : `${this.t("message.custom.通话时长")}：${function(e3) {
          const t3 = e3;
          let s4, n3, i4, r4 = "";
          return t3 >= 3600 ? (s4 = parseInt("" + t3 / 3600, 10) < 10 ? `0${parseInt("" + t3 / 3600, 10)}` : parseInt("" + t3 / 3600, 10), n3 = parseInt("" + t3 % 60 / 60, 10) < 10 ? `0${parseInt("" + t3 % 60 / 60, 10)}` : parseInt("" + t3 % 60 / 60, 10), i4 = t3 % 3600 < 10 ? "0" + t3 % 3600 : t3 % 3600, i4 > 60 && (n3 = parseInt("" + i4 / 60, 10) < 10 ? `0${parseInt("" + i4 / 60, 10)}` : parseInt("" + i4 / 60, 10), i4 = i4 % 60 < 10 ? "0" + i4 % 60 : i4 % 60), r4 = `${s4}:${n3}:${i4}`) : t3 >= 60 && t3 < 3600 ? (n3 = parseInt("" + t3 / 60, 10) < 10 ? `0${parseInt("" + t3 / 60, 10)}` : parseInt("" + t3 / 60, 10), i4 = t3 % 60 < 10 ? "0" + t3 % 60 : t3 % 60, r4 = `00:${n3}:${i4}`) : t3 < 60 && (i4 = t3 < 10 ? `0${t3}` : t3, r4 = `00:00:${i4}`), r4;
        }(null == h2 ? void 0 : h2.call_end)}` : "switchToAudio" === (null === (i3 = null == h2 ? void 0 : h2.data) || void 0 === i3 ? void 0 : i3.cmd) ? `${this.t("message.custom.切换语音通话")}` : "switchToVideo" === (null === (r3 = null == h2 ? void 0 : h2.data) || void 0 === r3 ? void 0 : r3.cmd) ? `${this.t("message.custom.切换视频通话")}` : `${this.t("message.custom.发起通话")}` : `${m2} ${this.t("message.custom.发起通话")}`;
      case 2:
        return (null == l2 ? void 0 : l2.groupID) ? `${m2} ${this.t("message.custom.取消通话")}` : this.isOldUIKit("message.custom.已取消") ? this.t("message.custom.取消通话") : (null == l2 ? void 0 : l2.inviter) === f2 ? this.t("message.custom.已取消") : this.t("message.custom.对方已取消");
      case 3:
        return "switchToAudio" === (null === (a2 = null == h2 ? void 0 : h2.data) || void 0 === a2 ? void 0 : a2.cmd) ? `${this.t("message.custom.切换语音通话")}` : "switchToVideo" === (null === (o2 = null == h2 ? void 0 : h2.data) || void 0 === o2 ? void 0 : o2.cmd) ? `${this.t("message.custom.切换视频通话")}` : (null == l2 ? void 0 : l2.groupID) ? `${m2} ${this.t("message.custom.已接听")}` : this.t("message.custom.已接听");
      case 4:
        return (null == l2 ? void 0 : l2.groupID) ? `${m2} ${this.t("message.custom.拒绝通话")}` : this.isOldUIKit("message.custom.已拒绝") ? this.t("message.custom.拒绝通话") : "line_busy" === (null == h2 ? void 0 : h2.line_busy) || "lineBusy" === (null == h2 ? void 0 : h2.data.message) ? (null == l2 ? void 0 : l2.inviter) === f2 ? this.t("message.custom.对方忙线中") : this.t("message.custom.忙线未接听") : (null == l2 ? void 0 : l2.inviter) === f2 ? this.t("message.custom.对方已拒绝") : this.t("message.custom.已拒绝");
      case 5:
        if ("switchToAudio" === (null === (u2 = null == h2 ? void 0 : h2.data) || void 0 === u2 ? void 0 : u2.cmd))
          return `${this.t("message.custom.切换语音通话")}`;
        if ("switchToVideo" === (null === (c2 = null == h2 ? void 0 : h2.data) || void 0 === c2 ? void 0 : c2.cmd))
          return `${this.t("message.custom.切换视频通话")}`;
        if (null == l2 ? void 0 : l2.groupID) {
          if (p3 === (null == l2 ? void 0 : l2.inviter)) {
            this.handleCallkitTimeoutSignaling(l2.inviteeList);
            let e3 = "";
            return null === (g2 = l2.inviteeList) || void 0 === g2 || g2.forEach((t3) => {
              const s4 = this.userShowNameMap.get(t3) || t3;
              e3 += `${this.substringByLength(s4)}、`;
            }), e3 = e3.substring(0, e3.lastIndexOf("、")), `${e3} ${this.t("message.custom.无应答")}`;
          }
          return `${m2} ${this.t("message.custom.无应答")}`;
        }
        return this.isOldUIKit("message.custom.对方无应答") ? this.t("message.custom.无应答") : (null == l2 ? void 0 : l2.inviter) === f2 ? this.t("message.custom.对方无应答") : this.t("message.custom.超时无应答");
      default:
        return "";
    }
  }
  handleCreateGroupCustomMessage(e2) {
    let t2;
    const s3 = U(e2.payload.data);
    return "group_create" === (null == s3 ? void 0 : s3.businessID) && (t2 = `${s3.opUser} ${s3.content}`), t2;
  }
  decodeText(e2) {
    const t2 = [];
    let s3 = e2.text, n2 = -1, i3 = -1;
    for (; "" !== s3; )
      switch (n2 = s3.indexOf("["), i3 = s3.indexOf("]"), n2) {
        case 0:
          if (-1 === i3)
            t2.push({ name: "text", text: s3 }), s3 = "";
          else {
            const e3 = s3.slice(0, i3 + 1);
            e3.indexOf("@custom") > -1 ? (t2.push({ name: "img", src: "", type: "custom", emojiKey: e3 }), s3 = s3.substring(i3 + 1)) : A$1[e3] ? (t2.push({ name: "img", src: D + A$1[e3], emojiKey: e3 }), s3 = s3.substring(i3 + 1)) : (t2.push({ name: "text", text: "[" }), s3 = s3.slice(1));
          }
          break;
        case -1:
          t2.push({ name: "text", text: s3 }), s3 = "";
          break;
        default:
          t2.push({ name: "text", text: s3.slice(0, n2) }), s3 = s3.substring(n2);
      }
    return t2;
  }
  handleGroupProfileUpdated(e2) {
    const { nick: t2, payload: s3 } = e2, { newGroupProfile: n2, memberList: i3, operatorID: r3 } = s3;
    let a2 = "";
    const o2 = t2 || r3, u2 = Object.keys(n2)[0];
    switch (u2) {
      case "muteAllMembers":
        a2 = n2[u2] ? `${this.t("message.tip.管理员")} ${o2} ${this.t("message.tip.开启全员禁言")}` : `${this.t("message.tip.管理员")} ${o2} ${this.t("message.tip.取消全员禁言")}`;
        break;
      case "ownerID":
        a2 = `${i3[0].nick || i3[0].userID} ${this.t("message.tip.成为新的群主")}`;
        break;
      case "groupName":
        a2 = `${o2} ${this.t("message.tip.修改群名为")} ${n2[u2]}`;
        break;
      case "notification":
        a2 = this.isOldUIKit("message.tip.把群公告修改为") ? `${o2} ${this.t("message.tip.发布新公告")}` : `${o2} ${this.t("message.tip.把群公告修改为")} "${n2[u2]}"`;
    }
    return a2;
  }
  handleCallkitTimeoutSignaling(e2 = []) {
    if (0 === e2.length)
      return;
    const t2 = this.getEngine().TUIFriend.getFriendRemark(e2), s3 = [];
    e2.forEach((e3) => {
      const n2 = t2[e3];
      n2 ? this.userShowNameMap.set(e3, n2) : this.requestedUserMap.has(e3) || (s3.push(e3), this.requestedUserMap.set(e3, 1));
    }), s3.length > 0 && this.getEngine().TUIUser.getUserProfile({ userIDList: s3 }).then((e3) => {
      (e3.data || []).forEach((e4) => {
        const { userID: t3, nick: s4 } = e4, n2 = s4 || t3;
        this.userShowNameMap.set(t3, n2);
      });
    }).catch(() => {
    });
  }
  substringByLength(e2, t2 = 12) {
    return e2.length > t2 ? `${e2.slice(0, t2)}...` : e2;
  }
  isOldUIKit(e2) {
    var t2;
    const s3 = e2.lastIndexOf("."), n2 = e2.slice(0, s3 + 1);
    return null === (t2 = this.t(e2)) || void 0 === t2 ? void 0 : t2.startsWith(n2);
  }
}
class wt {
  constructor(e2) {
    this.TUIChatService = e2, this.typingTo = "", this.timer = null;
  }
  getEngine() {
    return this.TUIChatService.getEngine();
  }
  clearTypingStatus() {
    this.getEngine().TUIStore.getData(exports.o.CHAT, "typingStatus") && this.getEngine().TUIStore.update(exports.o.CHAT, "typingStatus", false), this.timer && clearTimeout(this.timer), this.timer = null;
  }
  handleLastMessage(e2) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(exports.o.CHAT, "typingStatus");
    if (e2.type === this.getEngine().TYPES.MSG_CUSTOM && "in" === e2.flow) {
      const n2 = U(e2.payload.data);
      if (n2.businessID === c$1.BUSINESS_ID) {
        const { typingStatus: e3, userAction: i3 } = n2;
        if (e3 === c$1.STATUS_START || i3 === c$1.ACTION_START_ID)
          return s3 ? (this.timer && clearTimeout(this.timer), this.timer = null) : t2.TUIStore.update(exports.o.CHAT, "typingStatus", true), this.timer = setTimeout(() => {
            this.clearTypingStatus();
          }, 3e4), t2.TUIStore.getData(exports.o.CHAT, "typingStatus");
        e3 !== c$1.STATUS_END && i3 !== c$1.ACTION_END_ID || this.clearTypingStatus();
      }
    }
  }
  filterTypingMessage(e2 = []) {
    if (0 === e2.length)
      return [];
    return this.getEngine().TUIStore.getData(exports.o.APP, "enableTyping") && this.handleLastMessage(e2[e2.length - 1]), e2.filter((e3) => {
      if (e3.type === this.getEngine().TYPES.MSG_CUSTOM) {
        return U(e3.payload.data).businessID !== c$1.BUSINESS_ID;
      }
      return true;
    });
  }
  createTypingMessage(e2 = c$1.STATUS_END, t2 = "") {
    const { BUSINESS_ID: s3, STATUS_START: n2, VERSION: i3, ACTION_START_ID: r3, ACTION_END_ID: a2, ACTION_START: o2, ACTION_END: u2, NEED_TYPING: g2 } = c$1;
    return { to: t2, conversationType: this.getEngine().TYPES.CONV_C2C, payload: { data: JSON.stringify({ businessID: s3, typingStatus: e2, version: i3, userAction: e2 === n2 ? r3 : a2, actionParam: e2 === n2 ? o2 : u2 }), description: "", extension: "" }, cloudCustomData: JSON.stringify({ messageFeature: { needTyping: g2, version: i3 } }) };
  }
  sendTyping(e2 = false, t2 = "") {
    if (e2) {
      this.typingTo = t2;
      const e3 = this.createTypingMessage(c$1.STATUS_START, t2);
      this.getEngine().TUIChat.sendCustomMessage(e3, { onlineUserOnly: true });
    } else
      this.sendTypingEnd();
  }
  sendTypingEnd() {
    if (this.typingTo) {
      const e2 = this.createTypingMessage(c$1.STATUS_END, this.typingTo);
      this.getEngine().TUIChat.sendCustomMessage(e2, { onlineUserOnly: true });
    }
    this.typingTo = "";
  }
}
class Vt {
  constructor(e2) {
    this.TUIChatService = e2;
  }
  getEngine() {
    return this.TUIChatService.getEngine();
  }
  init() {
    const e2 = this.getEngine();
    e2.eventCenter.addEvent(e2.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, this.onMessageReadReceiptReceived.bind(this));
  }
  onMessageReadReceiptReceived(e2) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(exports.o.CONV, "currentConversationID"), n2 = [];
    e2.forEach((e3) => {
      const { messageID: i3 } = e3, r3 = t2.chat.findMessage(i3);
      r3 && s3 === r3.conversationID && n2.push(r3);
    }), n2.length > 0 && t2.TUIChat.updateMessageList(n2, "edit");
  }
  sendMessageReadReceipt(e2) {
    const t2 = [];
    return e2.forEach((e3) => {
      const s3 = e3.getMessage();
      t2.push(s3);
    }), this.getEngine().chat.sendMessageReadReceipt(t2);
  }
  getGroupMessageReadMemberList(e2) {
    const t2 = e2.message.getMessage(), s3 = Object.assign(Object.assign({}, e2), { message: t2 });
    return this.getEngine().chat.getGroupMessageReadMemberList(s3);
  }
  getMessageReadReceiptList(e2) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(exports.o.APP, "enabledMessageReadReceipt"), n2 = t2.TUIStore.getData(exports.o.USER, "displayMessageReadReceipt");
    !s3 || !n2 || 0 === e2.length || e2[0].conversationType !== t2.TYPES.CONV_GROUP || t2.chat.getMessageReadReceiptList(e2).then((e3) => {
      const { messageList: t3 } = e3.data;
      this.TUIChatService.updateMessageList(t3, "edit");
    }).catch((e3) => {
      index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `ReadReceiptHandler.getMessageReadReceiptList error:${e3.message}`);
    });
  }
}
class Ft extends ne {
  constructor() {
    super(), this.serv = "TUIChatService", this.messageHandler = new Gt(this), this.typingHandler = new wt(this), this.readReceiptHandler = new Vt(this), this.isSwitching = true, this.delayGetHoppingFunction = void 0, this.hoppingConfigMap = /* @__PURE__ */ new Map();
  }
  static getInstance() {
    return Ft.instance || (Ft.instance = new Ft()), Ft.instance;
  }
  init() {
    const e2 = this.getEngine();
    e2.eventCenter.addEvent(e2.EVENT.MESSAGE_RECEIVED, this.onMessageReceived.bind(this)), e2.eventCenter.addEvent(e2.EVENT.MESSAGE_MODIFIED, this.onMessageModified.bind(this)), e2.eventCenter.addEvent(e2.EVENT.MESSAGE_REVOKED, this.onMessageRevoked.bind(this)), e2.eventCenter.addEvent(e2.EVENT.MESSAGE_READ_BY_PEER, this.onMessageReadByPeer.bind(this)), e2.eventCenter.addEvent(e2.EVENT.MESSAGE_REACTIONS_UPDATED, this.onMessageReactionsUpdated.bind(this)), this.onCurrentConversationIDUpdated(), this.onMessageSource(), this.readReceiptHandler.init();
  }
  onMessageReceived(e2) {
    this.updateMessageList(e2, "received"), this.getEngine().TUIStore.update(exports.o.CHAT, "newMessageList", e2);
  }
  onMessageModified(e2) {
    this.updateMessageList(e2, "edit");
  }
  onMessageRevoked(e2) {
    this.updateMessageList(e2, "edit");
  }
  onMessageReadByPeer(e2) {
    this.updateMessageList(e2, "edit");
  }
  onMessageReactionsUpdated(e2) {
    this.updateMessageReactionList([e2]);
  }
  onCurrentConversationIDUpdated() {
    const e2 = this.getEngine();
    e2.TUIStore.watch(exports.o.CONV, { currentConversationID: (t2) => {
      this.isSwitching = true, this.delayGetHoppingFunction = void 0, this.hoppingConfigMap.clear(), e2.TUIStore.reset(exports.o.CHAT), this.typingHandler.clearTypingStatus(), this.typingHandler.sendTypingEnd(), ie(t2) || this.getMessageList().finally(() => {
        this.isSwitching = false, this.delayGetHoppingFunction && this.delayGetHoppingFunction();
      });
    } });
  }
  onMessageSource() {
    const e2 = this.getEngine();
    e2.TUIStore.watch(exports.o.CHAT, { messageSource: (t2) => {
      const s3 = this.getStoreData(exports.o.CONV, "currentConversationID");
      if (!s3 || t2 && t2.conversationID !== s3)
        return;
      if (S(t2))
        return this.hoppingConfigMap.clear(), e2.TUIStore.update(exports.o.CHAT, "messageList", []), e2.TUIStore.update(exports.o.CHAT, "nextReqMessageID", ""), e2.TUIStore.update(exports.o.CHAT, "isCompleted", false), void this.getMessageList();
      const n2 = this.getStoreData(exports.o.CHAT, "messageList");
      n2 && n2.find((e3) => t2 && e3.ID === t2.ID) || (this.isSwitching ? this.delayGetHoppingFunction = this.getMessageListHoppingForDown : this.getMessageListHoppingForDown());
    } });
  }
  getMessageListHoppingForDown() {
    const e2 = this.getStoreData(exports.o.CHAT, "messageList"), { conversationID: t2, sequence: s3, time: n2, ID: i3 } = this.getStoreData(exports.o.CHAT, "messageSource");
    if (e2 && e2.find((e3) => i3 && e3.ID === i3))
      return;
    const r3 = this.getEngine();
    r3.TUIStore.update(exports.o.CHAT, "messageList", []), r3.TUIStore.update(exports.o.CHAT, "nextReqMessageID", ""), r3.TUIStore.update(exports.o.CHAT, "isCompleted", false), this.getMessageListHopping({ conversationID: t2, sequence: s3, time: n2, direction: 1 });
  }
  getStoreData(e2, t2) {
    return this.getEngine().TUIStore.getData(e2, t2);
  }
  sendMessage(e2, t2) {
    this.updateMessageList([e2], "send");
    const s3 = this.getEngine().chat.sendMessage(e2, t2);
    return this.getResponse(s3);
  }
  getResponse(e2, t2 = true, s3 = true) {
    return e2.then((e3) => {
      const s4 = e3.data.messageList ? e3.data.messageList : [e3.data.message];
      return t2 && this.updateMessageList(s4, "edit"), e3;
    }).catch((e3) => {
      var t3;
      return s3 && (null === (t3 = null == e3 ? void 0 : e3.data) || void 0 === t3 ? void 0 : t3.message) && this.updateMessageList([e3.data.message], "edit"), Promise.reject(e3);
    });
  }
  updateMessageList(e2, t2 = "") {
    if (this.getStoreData(exports.o.CHAT, "messageSource") && "unshift" !== t2 && "edit" !== t2)
      return;
    const s3 = this.getStoreData(exports.o.CHAT, "messageList"), n2 = this.updateTargetMessageList(e2, s3, t2);
    this.getEngine().TUIStore.update(exports.o.CHAT, "messageList", n2);
  }
  updateTargetMessageList(e2, t2, s3 = "") {
    const n2 = this.getStoreData(exports.o.CONV, "currentConversationID");
    let i3 = e2.filter((e3) => e3.conversationID === n2);
    if (i3 = this.handleC2CCallSignaling(i3), !s3 || 0 === i3.length)
      return t2;
    const r3 = t2 || [];
    let a2 = [];
    if ("send" === s3 || "push" === s3) {
      const e3 = this.getStoreData(exports.o.CHAT, "userInfo");
      Object.keys(e3).length > 0 && this.updateLocalMessage(i3, e3);
    }
    switch (s3) {
      case "edit":
        for (const e3 of t2) {
          const t3 = i3.find((t4) => t4.ID === e3.ID);
          a2.push(t3 || e3);
        }
        break;
      case "resend":
        a2 = r3.filter((e3) => e3.ID !== i3[0].ID).concat(i3);
        break;
      case "send":
        a2 = r3.concat(this.typingHandler.filterTypingMessage(i3));
        break;
      case "push":
        a2 = r3.concat(this.typingHandler.filterTypingMessage(i3)), this.getEngine().chat.setMessageRead({ conversationID: n2 });
        break;
      case "received":
        a2 = r3.concat(this.typingHandler.filterTypingMessage(i3)), a2 = this.sortMessageList(a2), this.getEngine().chat.setMessageRead({ conversationID: n2 });
        break;
      case "unshift":
        a2 = i3.filter((e3) => 0 === r3.length || !r3.find((t3) => t3.ID === e3.ID)), a2.push(...r3), a2 = this.sortMessageList(a2);
    }
    return a2;
  }
  enterTypingState() {
    this.getStoreData(exports.o.APP, "enableTyping") && this.sendTyping(true);
  }
  leaveTypingState() {
    this.getStoreData(exports.o.APP, "enableTyping") && this.sendTyping(false);
  }
  sendTyping(e2) {
    const t2 = this.getEngine(), s3 = this.getStoreData(exports.o.CONV, "currentConversationID");
    if (!s3.startsWith(t2.TYPES.CONV_C2C))
      return;
    const n2 = s3.replace(t2.TYPES.CONV_C2C, "");
    if (e2) {
      const e3 = this.getStoreData(exports.o.CHAT, "messageList").filter((e4) => "in" === e4.flow);
      if (0 === e3.length)
        return;
      const t3 = 1e3 * e3[e3.length - 1].time;
      if ((/* @__PURE__ */ new Date()).getTime() - t3 > 3e4)
        return;
    }
    this.typingHandler.sendTyping(e2, n2);
  }
  quoteMessage(e2) {
    var t2;
    return this.getEngine().TUIStore.update(exports.o.CHAT, "quoteMessage", { message: e2, type: "quote" }), null === (t2 = this.getEngine().TUIReport) || void 0 === t2 || t2.reportFeature(205), e2;
  }
  replyMessage(e2) {
    return this.getEngine().TUIStore.update(exports.o.CHAT, "quoteMessage", { message: e2, type: "reply" }), e2;
  }
  getCurrentConvInfo() {
    const { conversationID: e2 = "", type: t2 } = this.getStoreData(exports.o.CONV, "currentConversation") || {};
    return { to: e2.replace(t2, ""), conversationType: t2 };
  }
  t(e2) {
    return this.getEngine().TUITranslate.t(e2) || e2;
  }
  getMessageAbstractAndType(e2) {
    var t2, s3;
    const n2 = this.getEngine(), i3 = { abstract: "", type: 0 };
    switch (e2.type) {
      case n2.TYPES.MSG_TEXT:
        i3.abstract = null === (t2 = null == e2 ? void 0 : e2.payload) || void 0 === t2 ? void 0 : t2.text, i3.type = 1;
        break;
      case n2.TYPES.MSG_CUSTOM:
        i3.abstract = "[自定义消息]", i3.type = 2;
        break;
      case n2.TYPES.MSG_IMAGE:
        i3.abstract = "[图片]", i3.type = 3;
        break;
      case n2.TYPES.MSG_AUDIO:
        i3.abstract = "[语音]", i3.type = 4;
        break;
      case n2.TYPES.MSG_VIDEO:
        i3.abstract = "[视频]", i3.type = 5;
        break;
      case n2.TYPES.MSG_FILE:
        i3.abstract = "[文件]", i3.type = 6;
        break;
      case n2.TYPES.MSG_LOCATION:
        i3.type = 7;
        break;
      case n2.TYPES.MSG_FACE:
        i3.abstract = "[表情]", i3.type = 8;
        break;
      case n2.TYPES.MSG_GRP_TIP:
        i3.type = 9;
        break;
      case n2.TYPES.MSG_MERGER:
        i3.abstract = null === (s3 = null == e2 ? void 0 : e2.payload) || void 0 === s3 ? void 0 : s3.title, i3.type = 10;
    }
    return i3;
  }
  genMessageReply(e2, t2) {
    if ("reply" !== t2 && "quote" !== t2)
      return {};
    const { abstract: s3, type: n2 } = this.getMessageAbstractAndType(e2), i3 = { messageAbstract: s3, messageSender: e2.nick || e2.from, messageID: e2.ID }, r3 = Object.assign(Object.assign({}, i3), { messageType: n2, messageTime: null == e2 ? void 0 : e2.time, messageSequence: null == e2 ? void 0 : e2.sequence, version: 1 });
    if ("reply" === t2 && (r3.messageRootID = e2.ID, e2.cloudCustomData)) {
      const t3 = U(e2.cloudCustomData);
      t3.messageReply && t3.messageReply.messageRootID && (r3.messageRootID = t3.messageReply.messageRootID);
    }
    return { messageReply: r3, messageReplyRoot: i3 };
  }
  getMessageInfo(e2, t2, s3) {
    const { messageReply: n2, messageReplyRoot: i3 } = this.genMessageReply(t2, s3), r3 = e2.cloudCustomData ? U(e2.cloudCustomData) : {};
    let a2;
    if (r3.messageReply ? r3.messageReply = Object.assign(Object.assign({}, n2), r3.messageReply) : r3.messageReply = n2, "reply" === s3) {
      const { messageRootID: e3 } = n2;
      a2 = this.getEngine().chat.findMessage(e3);
      const t3 = (null == a2 ? void 0 : a2.cloudCustomData) ? U(a2.cloudCustomData) : {};
      t3.messageReplies || (t3.messageReplies = {}), o2 = t3.messageReplies.replies, ("function" == typeof Array.isArray ? Array.isArray(o2) : "array" === Object.prototype.toString.call(o2).match(/^\[object (.*)\]$/)[1].toLowerCase()) || (t3.messageReplies.replies = []), t3.messageReplies.replies.push(i3), a2.cloudCustomData = JSON.stringify(t3);
    }
    var o2;
    return { cloudCustomData: JSON.stringify(r3), rootMessage: a2 };
  }
  sendTextMessage(e2, t2) {
    const s3 = this.getEngine(), { message: n2, type: i3 } = this.getStoreData(exports.o.CHAT, "quoteMessage");
    let r3 = { cloudCustomData: e2.cloudCustomData || "", rootMessage: void 0 };
    n2 && (r3 = this.getMessageInfo(e2, n2, i3));
    const a2 = s3.chat.createTextMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2), { cloudCustomData: r3.cloudCustomData }));
    return this.sendMessage(a2, t2).then((e3) => (r3.rootMessage && this.modifyMessage(r3.rootMessage), s3.TUIStore.reset(exports.o.CHAT, ["quoteMessage"], true), e3));
  }
  sendTextAtMessage(e2, t2) {
    const s3 = this.getEngine(), { message: n2, type: i3 } = this.getStoreData(exports.o.CHAT, "quoteMessage");
    let r3 = { cloudCustomData: e2.cloudCustomData || "", rootMessage: void 0 };
    n2 && (r3 = this.getMessageInfo(e2, n2, i3));
    const a2 = s3.chat.createTextAtMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2), { cloudCustomData: r3.cloudCustomData }));
    return this.sendMessage(a2, t2).then((e3) => (r3.rootMessage && this.modifyMessage(r3.rootMessage), s3.TUIStore.reset(exports.o.CHAT, ["quoteMessage"], true), e3));
  }
  sendImageMessage(e2, t2) {
    const s3 = this.getEngine().chat.createImageMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2), { onProgress: (e3) => {
      this.onProgress(s3.ID, e3);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendAudioMessage(e2, t2) {
    const s3 = this.getEngine().chat.createAudioMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2), { onProgress: (e3) => {
      this.onProgress(s3.ID, e3);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendVideoMessage(e2, t2) {
    const s3 = this.getEngine().chat.createVideoMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2), { onProgress: (e3) => {
      this.onProgress(s3.ID, e3);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendCustomMessage(e2, t2) {
    const s3 = this.getEngine().chat.createCustomMessage(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2));
    return this.sendMessage(s3, t2);
  }
  sendFaceMessage(e2, t2) {
    const s3 = this.getEngine().chat.createFaceMessage(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2));
    return this.sendMessage(s3, t2);
  }
  sendFileMessage(e2, t2) {
    const s3 = this.getEngine().chat.createFileMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2), { onProgress: (e3) => {
      this.onProgress(s3.ID, e3);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendLocationMessage(e2, t2) {
    const s3 = this.getEngine().chat.createLocationMessage(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e2));
    return this.sendMessage(s3, t2);
  }
  onProgress(e2, t2) {
    const s3 = this.getEngine().TUIStore.getMessageModel(e2);
    if (s3) {
      (t2 - s3.progress >= 0.1 || 1 === t2) && (s3.progress = t2, this.updateMessageList([s3], "edit"));
    }
  }
  setAbstractList(e2) {
    const t2 = this.getEngine(), s3 = e2.nick || e2.from;
    let n2 = "";
    switch (e2.type) {
      case t2.TYPES.MSG_TEXT:
        n2 = e2.payload.text || "", n2.length > 20 && (n2 = n2.slice(0, 20));
        break;
      case t2.TYPES.MSG_MERGER:
        n2 = `${this.t("TUIChat.[聊天记录]")}`;
        break;
      case t2.TYPES.MSG_IMAGE:
        n2 = `${this.t("TUIChat.[图片]")}`;
        break;
      case t2.TYPES.MSG_AUDIO:
        n2 = `${this.t("TUIChat.[音频]")}`;
        break;
      case t2.TYPES.MSG_VIDEO:
        n2 = `${this.t("TUIChat.[视频]")}`;
        break;
      case t2.TYPES.MSG_CUSTOM:
        n2 = `${this.t("TUIChat.[自定义消息]")}`;
        break;
      case t2.TYPES.MSG_FILE:
        n2 = `${this.t("TUIChat.[文件]")}`;
        break;
      case t2.TYPES.MSG_FACE:
        n2 = `${this.t("TUIChat.[动画表情]")}`;
    }
    return `${s3}: ${n2}`;
  }
  genMergerForwardPayload(e2, t2) {
    const { abstractList: s3 = [], compatibleText: n2 = "", title: i3 } = t2;
    return 0 === s3.length && e2.forEach((e3) => {
      s3.push(this.setAbstractList(e3));
    }), { messageList: e2, title: i3, abstractList: s3, compatibleText: n2 || this.t("TUIChat.请升级IMSDK到v2.10.1或更高版本查看此消息") };
  }
  genSendMergerForwardMessage(e2) {
    const { conversationList: t2, messageList: s3, params: n2, mergeInfo: i3, sendMessageOptions: r3 } = e2, a2 = [];
    for (let e3 = 0; e3 < t2.length; e3++) {
      const { conversationID: o2, type: u2 } = t2[e3], c2 = Object.assign({ to: o2.replace(`${u2}`, ""), conversationType: u2, payload: this.genMergerForwardPayload(s3, i3) }, n2), g2 = this.getEngine().chat.createMergerMessage(c2);
      a2.push(this.sendMessage(g2, r3));
    }
    return a2;
  }
  genTitle(e2, t2) {
    const { nick: s3, from: n2, to: i3 } = e2;
    return `${s3 || n2} ${this.t("TUIChat.和")} ${t2 || i3} ${this.t("TUIChat.的聊天记录")}`;
  }
  genMergeInfo(e2) {
    var t2;
    return i$1(this, void 0, void 0, function* () {
      const { messageList: s3, mergeInfo: n2 } = e2;
      if (n2.title)
        return n2;
      if (s3[0].conversationType === this.getEngine().TYPES.CONV_GROUP)
        return n2.title = this.t("TUIChat.群聊的聊天记录"), n2;
      try {
        const { data: e3 = [] } = yield this.getEngine().TUIUser.getUserProfile({ userIDList: [s3[0].to] });
        n2.title = this.genTitle(s3[0], null === (t2 = e3[0]) || void 0 === t2 ? void 0 : t2.nick);
      } catch (e3) {
        n2.title = this.genTitle(s3[0]);
      }
      return n2;
    });
  }
  sendMergerForwardMessage(e2) {
    return i$1(this, void 0, void 0, function* () {
      return e2.mergeInfo = yield this.genMergeInfo(e2), Promise.all(this.genSendMergerForwardMessage(e2));
    });
  }
  getOriginMessageList(e2) {
    return e2.map((e3) => e3 instanceof ue ? e3.getMessage() : e3);
  }
  sendForwardMessage(e2, t2, s3) {
    t2 = this.getOriginMessageList(t2);
    const i3 = s3 || {}, { needMerge: r3 = false, params: a2 = {}, mergeInfo: o2 = {} } = i3, u2 = n$1(i3, ["needMerge", "params", "mergeInfo"]);
    if (r3)
      return this.sendMergerForwardMessage({ conversationList: e2, messageList: t2, params: a2, mergeInfo: o2, sendMessageOptions: u2 });
    const c2 = [];
    for (let s4 = 0; s4 < e2.length; s4++) {
      const { conversationID: n2, type: i4 } = e2[s4], r4 = Object.assign({ to: n2.replace(`${i4}`, ""), conversationType: i4 }, a2), o3 = u2[n2] || u2;
      for (let e3 = 0; e3 < t2.length; e3++) {
        Reflect.set(r4, "payload", t2[e3]);
        const s5 = this.getEngine().chat.createForwardMessage(r4);
        c2.push(this.sendMessage(s5, o3));
      }
    }
    return Promise.all(c2);
  }
  revokeMessage(e2) {
    const t2 = this.getEngine().chat.revokeMessage(e2);
    return this.getResponse(t2, true, false);
  }
  resendMessage(e2) {
    e2.status = "unSend", this.updateMessageList([e2], "resend");
    const t2 = this.getEngine().chat.resendMessage(e2);
    return this.getResponse(t2, true, true);
  }
  deleteMessage(e2) {
    const t2 = this.getEngine().chat.deleteMessage(e2);
    return this.getResponse(t2, true, false);
  }
  setMessageExtensions(e2, t2) {
    return this.getEngine().chat.setMessageExtensions(e2, t2);
  }
  getMessageExtensions(e2) {
    return this.getEngine().chat.getMessageExtensions(e2);
  }
  deleteMessageExtensions(e2, t2) {
    return this.getEngine().chat.deleteMessageExtensions(e2, t2);
  }
  modifyMessage(e2) {
    const t2 = this.getEngine().chat.modifyMessage(e2);
    return this.getResponse(t2, true, false).catch((e3) => {
      const { code: t3 = 0, data: s3 = {} } = e3.code;
      throw t3 === l$1.MSG_MODIFY_CONFLICT ? index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${p$1.MSG_MODIFY_CONFLICT} data.message: ${null == s3 ? void 0 : s3.message}`) : t3 === l$1.MSG_MODIFY_DISABLED_IN_AVCHATROOM ? index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", p$1.MSG_MODIFY_DISABLED_IN_AVCHATROOM) : t3 === l$1.MODIFY_MESSAGE_NOT_EXIST && index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", p$1.MODIFY_MESSAGE_NOT_EXIST), e3;
    });
  }
  getMessageList(e2 = { conversationID: this.getStoreData(exports.o.CONV, "currentConversationID"), nextReqMessageID: this.getStoreData(exports.o.CHAT, "nextReqMessageID") }) {
    const t2 = this.getEngine();
    if (!t2.chat.isReady())
      return Promise.reject({ code: h$1.GET_MSG_LIST_ERROR, message: d$1.GET_MSG_LIST_ERROR });
    if (this.getStoreData(exports.o.CHAT, "isCompleted"))
      return Promise.resolve({ data: { messageList: [], nextReqMessageID: "", isCompleted: true } });
    const s3 = this.getStoreData(exports.o.CHAT, "messageSource"), n2 = this.hoppingConfigMap.get("nextMessageSeq"), i3 = this.hoppingConfigMap.get("nextMessageTime"), r3 = n2 || i3;
    return s3 && s3.conversationID === (null == e2 ? void 0 : e2.conversationID) && r3 ? this.getMessageListHopping() : t2.chat.getMessageList(e2).then((e3) => {
      var s4;
      const { messageList: n3, nextReqMessageID: i4, isCompleted: r4 } = e3.data, a2 = this.getStoreData(exports.o.CHAT, "userInfo");
      Object.keys(a2).length > 0 && this.updateLocalMessage(n3, a2), this.updateMessageList(n3, "unshift"), t2.TUIStore.update(exports.o.CHAT, "nextReqMessageID", i4), t2.TUIStore.update(exports.o.CHAT, "isCompleted", r4);
      const u2 = null === (s4 = n3[0]) || void 0 === s4 ? void 0 : s4.conversationID, { operationType: c2 = 0 } = this.getEngine().TUIStore.getConversationModel(u2) || {};
      return 0 === c2 && (this.getMessageReactions({ messageList: n3 }), this.readReceiptHandler.getMessageReadReceiptList(n3)), e3;
    }).catch((e3) => Promise.reject(e3));
  }
  getMessageListHopping(e2) {
    var t2;
    void 0 === e2 && (e2 = { conversationID: null === (t2 = this.getStoreData(exports.o.CHAT, "messageSource")) || void 0 === t2 ? void 0 : t2.conversationID, sequence: this.hoppingConfigMap.get("nextMessageSeq"), time: this.hoppingConfigMap.get("nextMessageTime") });
    const s3 = this.getEngine();
    return s3.chat.getMessageListHopping(e2).then((t3) => {
      const { messageList: n2, nextMessageSeq: i3, nextMessageTime: r3, isCompleted: a2 } = t3.data, u2 = 1 === e2.direction ? e2.sequence : i3, c2 = 1 === e2.direction ? e2.time : r3;
      return this.updateMessageList(n2, "unshift"), this.delayGetHoppingFunction = void 0, this.hoppingConfigMap.set("nextMessageSeq", u2), this.hoppingConfigMap.set("nextMessageTime", c2), s3.TUIStore.update(exports.o.CHAT, "isCompleted", a2), t3;
    }).catch((e3) => Promise.reject(e3));
  }
  sendMessageReadReceipt(e2) {
    return this.readReceiptHandler.sendMessageReadReceipt(e2);
  }
  getGroupMessageReadMemberList(e2) {
    return this.readReceiptHandler.getGroupMessageReadMemberList(e2).then((e3) => {
      const { isCompleted: t2, cursor: s3, messageID: n2, unreadUserIDList: i3, readUserIDList: r3 } = e3.data, a2 = { code: 0, data: { cursor: s3, isCompleted: t2, messageID: n2, unreadUserInfoList: [], readUserInfoList: [] } }, o2 = [...i3, ...r3];
      return 0 === o2.length ? a2 : this.getEngine().TUIUser.getUserProfile({ userIDList: o2 }).then((e4) => (i3.length > 0 ? e4.data.forEach((e5) => {
        const { userID: t3, nick: s4 = "", avatar: n3 = "" } = e5;
        a2.data.unreadUserInfoList.push({ userID: t3, nick: s4, avatar: n3 });
      }) : e4.data.forEach((e5) => {
        const { userID: t3, nick: s4 = "", avatar: n3 = "" } = e5;
        a2.data.readUserInfoList.push({ userID: t3, nick: s4, avatar: n3 });
      }), a2));
    });
  }
  downloadMergedMessages(e2) {
    return this.getEngine().chat.downloadMergerMessage(e2);
  }
  setTranslationLanguage(e2) {
    this.getEngine().TUIStore.update(exports.o.USER, "targetLanguage", e2);
  }
  translateText(e2) {
    const t2 = this.getStoreData(exports.o.USER, "targetLanguage"), s3 = Object.assign({ targetLanguage: t2, sourceLanguage: "auto" }, e2);
    return this.getEngine().chat.translateText(s3);
  }
  searchCloudMessages(e2) {
    const t2 = this.getStoreData(exports.o.CONV, "conversationList");
    return this.getEngine().chat.searchCloudMessages(e2).then((e3) => {
      const { searchResultList: s3 } = e3.data;
      return e3.data.searchResultList = s3.map((e4) => {
        const { messageList: s4, conversationID: i3 } = e4, r3 = n$1(e4, ["messageList", "conversationID"]), a2 = s4.map((e5) => new ue(e5)), o2 = t2.find((e5) => e5.conversationID === i3);
        return Object.assign(Object.assign({}, r3), { messageList: a2.sort((e5, t3) => t3.time - e5.time), conversation: o2 });
      }), e3;
    });
  }
  addMessageReaction(e2, t2) {
    return this.getEngine().chat.addMessageReaction(e2.getMessage(), t2);
  }
  removeMessageReaction(e2, t2) {
    return this.getEngine().chat.removeMessageReaction(e2.getMessage(), t2);
  }
  getMessageReactions(e2) {
    const { messageList: t2 = [] } = e2, s3 = this.getStoreData(exports.o.APP, "enabledEmojiPlugin");
    index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIChatService.getMessageReactions enabledEmojiPlugin:${s3} messageList length:${t2.length}`), s3 && t2.length > 0 && this.getEngine().chat.getMessageReactions(e2).then((e3) => {
      const t3 = e3.data.resultList || e3.data;
      this.updateMessageReactionList(t3);
    }).catch(() => {
    });
  }
  getAllUserListOfMessageReaction(e2) {
    var t2;
    return this.getEngine().chat.getAllUserListOfMessageReaction(Object.assign(Object.assign({}, e2), { message: null === (t2 = null == e2 ? void 0 : e2.message) || void 0 === t2 ? void 0 : t2.getMessage() }));
  }
  updateMessageReactionList(e2) {
    const t2 = [];
    e2.forEach((e3) => {
      const { messageID: s3, reactionList: n2 } = e3, i3 = this.getEngine().TUIStore.getMessageModel(s3);
      if (i3) {
        const e4 = [];
        for (let t3 = 0; t3 < n2.length; t3++) {
          let s4 = true;
          for (let e5 = 0; e5 < i3.reactionList.length; e5++)
            if (n2[t3].reactionID === i3.reactionList[e5].reactionID) {
              i3.reactionList[e5] = n2[t3], s4 = false;
              break;
            }
          s4 && e4.push(n2[t3]);
        }
        i3.reactionList.push(...e4), e4.length = 0, t2.push(i3);
      }
    }), t2.length > 0 && this.updateMessageList(t2, "edit");
  }
  convertVoiceToText(e2) {
    const { message: t2, language: s3 = "zh" } = e2, n2 = t2.getMessage();
    return this.getEngine().chat.convertVoiceToText({ message: n2, language: s3 });
  }
  clearHistoryMessage(e2) {
    const t2 = this.getEngine();
    return t2.chat.clearHistoryMessage(e2).then((e3) => (t2.TUIStore.update(exports.o.CHAT, "messageList", []), t2.TUIStore.update(exports.o.CHAT, "nextReqMessageID", ""), t2.TUIStore.update(exports.o.CHAT, "isCompleted", false), e3));
  }
  updateMessageInfo(e2) {
    const t2 = this.getStoreData(exports.o.CHAT, "userInfo");
    this.getEngine().TUIStore.update(exports.o.CHAT, "userInfo", Object.assign(t2, e2));
    const s3 = this.getStoreData(exports.o.CHAT, "messageList");
    if (s3.length > 0) {
      this.updateLocalMessage(s3, e2) && this.getEngine().TUIStore.update(exports.o.CHAT, "messageList", s3);
    }
  }
  updateLocalMessage(e2, t2) {
    let s3 = false;
    return e2.forEach((e3) => {
      if (t2[e3.from]) {
        const { nick: n2, nameCard: i3, avatar: r3 } = t2[e3.from];
        n2 && (e3.nick = n2, s3 = true), i3 && (e3.nameCard = i3, s3 = true), r3 && (e3.avatar = r3, s3 = true);
      }
    }), s3;
  }
  handleC2CCallSignaling(e2) {
    const t2 = this.getEngine(), s3 = t2.getMyUserID();
    return e2.filter((e3) => {
      var n2, i3, r3, a2, u2;
      const { conversationType: c2, type: g2, payload: l2 } = e3;
      let h2 = true;
      if (c2 === t2.TYPES.CONV_C2C && g2 === t2.TYPES.MSG_CUSTOM) {
        if (t2.chat.getSignalingInfo(e3)) {
          const t3 = U(l2.data);
          if (1 === (null == t3 ? void 0 : t3.businessID)) {
            const c3 = U(t3.data);
            if (h2 = !(e3._isExcludedFromUnreadCount && e3._isExcludedFromLastMessage), h2 && true !== (null === (n2 = null == c3 ? void 0 : c3.data) || void 0 === n2 ? void 0 : n2.consumed)) {
              let n3 = null === (i3 = null == c3 ? void 0 : c3.data) || void 0 === i3 ? void 0 : i3.inviter;
              "line_busy" !== (null == c3 ? void 0 : c3.line_busy) && "lineBusy" !== (null === (r3 = null == c3 ? void 0 : c3.data) || void 0 === r3 ? void 0 : r3.message) || (n3 = t3.inviter);
              const { from: g3, to: l3 } = e3;
              if (n3 !== s3 && e3.from === s3) {
                const t4 = this.getStoreData(exports.o.CONV, "currentConversation");
                e3.from = l3, e3.to = g3, e3.flow = "in", e3.avatar = (null === (a2 = null == t4 ? void 0 : t4.userProfile) || void 0 === a2 ? void 0 : a2.avatar) || "";
              }
              if (n3 === s3 && e3.from !== s3) {
                const t4 = this.getStoreData(exports.o.USER, "userProfile");
                e3.from = l3, e3.to = g3, e3.flow = "out", e3.avatar = null == t4 ? void 0 : t4.avatar;
              }
              index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${this.serv}.handleC2CCallSignaling myUserID:${s3} callSignaling.inviter:${t3.inviter} customData.data.inviter:${null === (u2 = null == c3 ? void 0 : c3.data) || void 0 === u2 ? void 0 : u2.inviter}`);
            }
          }
        }
      }
      return h2;
    });
  }
  sortMessageList(e2) {
    const { conversationType: t2 } = e2[0];
    if (t2 === this.getEngine().TYPES.CONV_C2C)
      return e2.sort((e3, t3) => e3.time - t3.time);
    const s3 = e2.filter((e3) => "success" === e3.status).sort((e3, t3) => e3.sequence - t3.sequence);
    for (let t3 = 0; t3 < e2.length; t3++)
      "success" !== e2[t3].status && s3.splice(t3, 0, e2[t3]);
    return s3;
  }
}
class $t extends ne {
  constructor() {
    super(), this.groupMap = /* @__PURE__ */ new Map();
  }
  static getInstance() {
    return $t.instance || ($t.instance = new $t()), $t.instance;
  }
  init() {
    const e2 = this.getEngine();
    e2.eventCenter.addEvent(e2.EVENT.GROUP_LIST_UPDATED, this.onGroupListUpdated.bind(this)), e2.eventCenter.addEvent(e2.EVENT.GROUP_ATTRIBUTES_UPDATED, this.onGroupAttributesUpdated.bind(this)), e2.eventCenter.addEvent(e2.EVENT.GROUP_COUNTER_UPDATED, this.onGroupCounterUpdated.bind(this)), e2.eventCenter.addEvent(e2.EVENT.MESSAGE_RECEIVED, this.onMessageReceived.bind(this)), this.getGroupInitData();
  }
  onGroupListUpdated(e2) {
    const t2 = this.getEngine();
    t2.TUIStore.update(exports.o.GRP, "groupList", e2);
    const s3 = t2.TUIStore.getData(exports.o.GRP, "currentGroupID");
    e2.forEach((e3) => {
      e3.groupID === s3 && t2.TUIStore.update(exports.o.GRP, "currentGroup", e3);
    });
  }
  onGroupAttributesUpdated(e2) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(exports.o.GRP, "currentGroupID");
    let n2 = t2.TUIStore.getData(exports.o.GRP, "groupList");
    const { groupID: i3, groupAttributes: r3 } = e2;
    s3 === i3 && t2.TUIStore.update(exports.o.GRP, "currentGroupAttributes", r3), n2 = n2.map((e3) => (e3.groupID === i3 && (e3.groupAttributes = r3), e3)), t2.TUIStore.update(exports.o.GRP, "groupList", n2);
  }
  onGroupCounterUpdated(e2) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(exports.o.GRP, "currentGroupID"), n2 = t2.TUIStore.getData(exports.o.GRP, "currentGroupCounters") || {};
    let i3 = t2.TUIStore.getData(exports.o.GRP, "groupList");
    const { groupID: r3, key: a2, value: u2 } = e2;
    s3 === r3 && (n2[a2] = u2, t2.TUIStore.update(exports.o.GRP, "currentGroupCounters", n2)), i3 = i3.map((e3) => (e3.groupID === r3 && (e3.groupCounters = Object.assign(Object.assign({}, e3.groupCounters), { [a2]: u2 })), e3)), t2.TUIStore.update(exports.o.GRP, "groupList", i3);
  }
  onMessageReceived(e2) {
    const t2 = this.getEngine(), s3 = [];
    e2.forEach((e3) => {
      if (e3.type === t2.TYPES.MSG_GRP_TIP) {
        const { payload: s4 } = e3, { operationType: n2, userIDList: i3 } = s4;
        switch (n2) {
          case t2.TYPES.GRP_TIP_MBR_JOIN:
            this.addMemberList(i3);
            break;
          case t2.TYPES.GRP_TIP_MBR_QUIT:
          case t2.TYPES.GRP_TIP_MBR_KICKED_OUT:
            this.removeMemberList(i3);
            break;
          case t2.TYPES.GRP_TIP_MBR_SET_ADMIN:
          case t2.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:
            this.updateGroupMember(i3);
            break;
          case t2.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:
            break;
          case t2.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:
          case t2.TYPES.GRP_TIP_BAN_AVCHATROOM_MEMBER:
          case t2.TYPES.GRP_TIP_UNBAN_AVCHATROOM_MEMBER:
            this.updateGroupMember(i3);
        }
      }
      e3.type === t2.TYPES.MSG_GRP_SYS_NOTICE && s3.push(e3);
    }), s3.length > 0 && t2.TUIStore.update(exports.o.GRP, "groupSystemNoticeList", s3);
  }
  getGroupInitData() {
    const e2 = this.getEngine();
    e2.chat.isReady() && e2.chat.getGroupList().then((e3) => {
      const { groupList: t2 = [] } = e3.data;
      index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIGroupService.init, getGroupList count:${t2.length}`), t2.length > 0 && this.onGroupListUpdated(t2);
    });
  }
  updateGroupMember(e2) {
    return i$1(this, void 0, void 0, function* () {
      const t2 = this.getEngine().TUIStore.getData(exports.o.GRP, "currentGroupID");
      if (t2) {
        const s3 = yield this.getGroupMemberProfile({ groupID: t2, userIDList: e2 }), { memberList: n2 } = s3.data;
        this.updateMemberList(n2);
      }
    });
  }
  resetCurrentStore() {
    this.getEngine().TUIStore.reset(exports.o.GRP, ["currentGroupID", "currentGroup", "currentGroupAttributes", "currentGroupCounters", "currentGroupMemberList"], true);
  }
  switchGroup(e2) {
    return i$1(this, void 0, void 0, function* () {
      const t2 = this.getEngine();
      t2.TUIStore.update(exports.o.GRP, "offset", 0), t2.TUIStore.update(exports.o.GRP, "isCompleted", false);
      const s3 = t2.TUIStore.getConversationModel(`GROUP${e2}`);
      if ((null == s3 ? void 0 : s3.operationType) > 0) {
        const e3 = t2.TUIStore.getData(exports.o.GRP, "currentGroup");
        return Promise.resolve(e3);
      }
      const n2 = t2.TUIStore.getData(exports.o.GRP, "currentGroupID");
      if (!e2)
        return this.resetCurrentStore(), Promise.resolve({});
      if (n2 === e2) {
        const e3 = t2.TUIStore.getData(exports.o.GRP, "currentGroup");
        return Promise.resolve(e3);
      }
      this.resetCurrentStore(), t2.TUIStore.update(exports.o.GRP, "currentGroupID", e2);
      try {
        yield this.getGroupInfo(e2);
      } catch (e3) {
        Promise.reject(e3);
      }
      const i3 = setTimeout(() => {
        this.groupMap.delete(e2), clearTimeout(i3);
      }, 5e3), r3 = t2.TUIStore.getData(exports.o.GRP, "currentGroup");
      return Promise.resolve(r3);
    });
  }
  getGroupInfo(e2) {
    return i$1(this, void 0, void 0, function* () {
      const t2 = this.getEngine(), s3 = this.groupMap.get(e2);
      if (s3)
        return this.updateMemberList((null == s3 ? void 0 : s3.memberList) || []), t2.TUIStore.update(exports.o.GRP, "currentGroup", s3.group), t2.TUIStore.update(exports.o.GRP, "currentGroupAttributes", s3.groupAttributes || {}), void t2.TUIStore.update(exports.o.GRP, "currentGroupCounters", s3.counters || {});
      const n2 = { group: {}, memberList: [], groupAttributes: void 0, counters: void 0 }, { data: { group: i3 } } = yield this.getGroupProfile({ groupID: e2 });
      n2.group = i3;
      const { data: { memberList: r3 } } = yield this.getGroupMemberList({ groupID: e2 });
      n2.memberList = r3;
      const a2 = yield this.getGroupAttributes({ groupID: e2, keyList: [] }), { groupAttributes: u2 } = a2.data;
      n2.groupAttributes = u2, t2.TUIStore.update(exports.o.GRP, "currentGroupAttributes", u2);
      try {
        const s4 = yield this.getGroupCounters({ groupID: e2, keyList: [] }), { counters: i4 } = s4.data;
        n2.counters = i4, t2.TUIStore.update(exports.o.GRP, "currentGroupCounters", i4);
      } catch (e3) {
        index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", null == e3 ? void 0 : e3.message);
      }
      this.groupMap.set(e2, n2);
    });
  }
  getGroupProfile(e2) {
    const t2 = this.getEngine();
    return t2.chat.getGroupProfile(e2).then((s3) => i$1(this, void 0, void 0, function* () {
      if (t2.TUIStore.getData(exports.o.GRP, "currentGroupID") === e2.groupID) {
        const { group: e3 } = s3.data;
        t2.TUIStore.update(exports.o.GRP, "currentGroup", e3);
      }
      return s3;
    }));
  }
  updateGroupProfile(e2) {
    return this.getEngine().chat.updateGroupProfile(e2);
  }
  createGroup(e2) {
    return this.getEngine().chat.createGroup(e2);
  }
  dismissGroup(e2) {
    return this.getEngine().chat.dismissGroup(e2);
  }
  searchGroupByID(e2) {
    const t2 = this.getEngine();
    return t2.chat.searchGroupByID(e2).then((e3) => {
      const { group: s3 } = e3.data, n2 = t2.TUIStore.getData(exports.o.GRP, "groupList");
      return e3.data.group.isJoinedGroup = n2.some((e4) => e4.groupID === s3.groupID), e3;
    });
  }
  joinGroup(e2) {
    return this.getEngine().chat.joinGroup(e2);
  }
  quitGroup(e2) {
    return this.getEngine().chat.quitGroup(e2);
  }
  getGroupApplicationList() {
    return this.getEngine().chat.getGroupApplicationList();
  }
  handleGroupApplication(e2) {
    return this.getEngine().chat.handleGroupApplication(e2);
  }
  getGroupOnlineMemberCount(e2) {
    return this.getEngine().chat.getGroupOnlineMemberCount(e2);
  }
  changeGroupOwner(e2) {
    return this.getEngine().chat.changeGroupOwner(e2);
  }
  initGroupAttributes(e2) {
    return this.getEngine().chat.initGroupAttributes(e2);
  }
  setGroupAttributes(e2) {
    return this.getEngine().chat.setGroupAttributes(e2);
  }
  deleteGroupAttributes(e2) {
    return this.getEngine().chat.deleteGroupAttributes(e2);
  }
  getGroupAttributes(e2) {
    return this.getEngine().chat.getGroupAttributes(e2);
  }
  setGroupCounters(e2) {
    return this.getEngine().chat.setGroupCounters(e2);
  }
  increaseGroupCounter(e2) {
    return this.getEngine().chat.increaseGroupCounter(e2);
  }
  decreaseGroupCounter(e2) {
    return this.getEngine().chat.decreaseGroupCounter(e2);
  }
  getGroupCounters(e2) {
    return this.getEngine().chat.getGroupCounters(e2);
  }
  updateMemberList(e2) {
    const t2 = this.getEngine(), s3 = [...(t2.TUIStore.getData(exports.o.GRP, "currentGroupMemberList") || []).filter((t3) => !e2.find((e3) => e3.userID === t3.userID)), ...e2];
    t2.TUIStore.update(exports.o.GRP, "currentGroupMemberList", s3);
  }
  addMemberList(e2) {
    return i$1(this, void 0, void 0, function* () {
      const t2 = this.getEngine().TUIStore.getData(exports.o.GRP, "currentGroupID");
      if (t2)
        try {
          const s3 = yield this.getGroupMemberProfile({ groupID: t2, userIDList: e2 }), { memberList: n2 } = s3.data;
          this.updateMemberList(n2);
        } catch (t3) {
          const s3 = e2.map((e3) => ({ userID: e3, avatar: "", nick: "", role: "", joinTime: 0, nameCard: "", muteUntil: 0, memberCustomField: [] }));
          this.updateMemberList(s3);
        }
    });
  }
  removeMemberList(e2) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(exports.o.GRP, "currentGroupMemberList").filter((t3) => -1 === e2.indexOf(t3.userID));
    t2.TUIStore.update(exports.o.GRP, "currentGroupMemberList", s3);
  }
  getGroupMemberList(e2) {
    const t2 = this.getEngine();
    if (S(e2.offset)) {
      const s3 = t2.TUIStore.getData(exports.o.GRP, "offset");
      e2.offset = s3;
    }
    return t2.chat.getGroupMemberList(e2).then((s3) => {
      if (t2.TUIStore.getData(exports.o.GRP, "currentGroupID") === e2.groupID) {
        const { memberList: e3, offset: n2 = 0 } = s3.data;
        this.updateMemberList(e3), t2.TUIStore.update(exports.o.GRP, "offset", n2), 0 === n2 && t2.TUIStore.update(exports.o.GRP, "isCompleted", true);
      }
      return s3;
    });
  }
  getGroupMemberProfile(e2) {
    return this.getEngine().chat.getGroupMemberProfile(e2);
  }
  addGroupMember(e2) {
    const t2 = this.getEngine();
    return t2.chat.addGroupMember(e2).then((s3) => i$1(this, void 0, void 0, function* () {
      if (t2.TUIStore.getData(exports.o.GRP, "currentGroupID") === e2.groupID) {
        const { successUserIDList: e3, group: n2 } = s3.data;
        t2.TUIStore.update(exports.o.GRP, "currentGroup", n2), this.addMemberList(e3);
      }
      return s3;
    }));
  }
  deleteGroupMember(e2) {
    const t2 = this.getEngine();
    return t2.chat.deleteGroupMember(e2).then((s3) => {
      if (t2.TUIStore.getData(exports.o.GRP, "currentGroupID") === e2.groupID) {
        const { userIDList: e3, group: n2 } = s3.data;
        this.removeMemberList(e3), t2.TUIStore.update(exports.o.GRP, "currentGroup", n2);
      }
      return s3;
    });
  }
  setGroupMemberMuteTime(e2) {
    return this.getEngine().chat.setGroupMemberMuteTime(e2);
  }
  setGroupMemberRole(e2) {
    return this.getEngine().chat.setGroupMemberRole(e2);
  }
  setGroupMemberNameCard(e2) {
    return this.getEngine().chat.setGroupMemberNameCard(e2);
  }
  setGroupMemberCustomField(e2) {
    return this.getEngine().chat.setGroupMemberCustomField(e2);
  }
  markGroupMemberList(e2) {
    return this.getEngine().chat.markGroupMemberList(e2);
  }
}
class Ht extends ne {
  constructor() {
    super();
  }
  static getInstance() {
    return Ht.instance || (Ht.instance = new Ht()), Ht.instance;
  }
  init() {
    const e2 = this.getEngine();
    e2.eventCenter.addEvent(e2.EVENT.FRIEND_LIST_UPDATED, this.onFriendListUpdated.bind(this)), e2.eventCenter.addEvent(e2.EVENT.FRIEND_APPLICATION_LIST_UPDATED, this.onFriendApplicationListUpdated.bind(this)), this.getFriendInitData();
  }
  onFriendListUpdated(e2) {
    this.getEngine().TUIStore.update(exports.o.FRIEND, "friendList", e2);
  }
  onFriendApplicationListUpdated(e2) {
    const { friendApplicationList: t2, unreadCount: s3 = 0 } = e2, n2 = this.getEngine();
    n2.TUIStore.update(exports.o.FRIEND, "friendApplicationList", t2), n2.TUIStore.update(exports.o.FRIEND, "friendApplicationUnreadCount", s3);
  }
  getFriendInitData() {
    const e2 = this.getEngine();
    e2.chat.isReady() && (e2.chat.getFriendList().then((e3) => {
      const t2 = e3.data || [];
      index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIFriendService.init, getFriendList count:${t2.length}`), t2.length > 0 && this.onFriendListUpdated(t2);
    }), e2.chat.getFriendApplicationList().then((e3) => {
      this.onFriendApplicationListUpdated(e3.data);
    }));
  }
  getFriendList() {
    return this.getEngine().chat.getFriendList();
  }
  getFriendRemark(e2) {
    const t2 = this.getEngine().TUIStore.getData(exports.o.FRIEND, "friendList"), s3 = {};
    return e2.forEach((e3) => {
      for (let n2 = 0; n2 < t2.length; n2++)
        t2[n2].userID !== e3 || (s3[e3] = t2[n2].remark);
    }), s3;
  }
  addFriend(e2) {
    return this.getEngine().chat.addFriend(e2);
  }
  deleteFriend(e2) {
    return this.getEngine().chat.deleteFriend(e2);
  }
  checkFriend(e2) {
    return this.getEngine().chat.checkFriend(e2);
  }
  getFriendProfile(e2) {
    return this.getEngine().chat.getFriendProfile(e2);
  }
  updateFriend(e2) {
    return this.getEngine().chat.updateFriend(e2);
  }
  acceptFriendApplication(e2) {
    return this.getEngine().chat.acceptFriendApplication(e2);
  }
  refuseFriendApplication(e2) {
    return this.getEngine().chat.refuseFriendApplication({ userID: e2 });
  }
  deleteFriendApplication(e2) {
    return this.getEngine().chat.deleteFriendApplication(e2);
  }
  setFriendApplicationRead() {
    return this.getEngine().chat.setFriendApplicationRead();
  }
}
class Yt extends ne {
  static getInstance() {
    return Yt.instance || (Yt.instance = new Yt()), Yt.instance;
  }
  reportFeature(e2, t2) {
    var s3;
    return null === (s3 = this.getEngine().chat) || void 0 === s3 ? void 0 : s3.callExperimentalAPI("statTUIKeyFeatures", { code: e2, msg: t2 ? `${e2}-${t2}` : "" });
  }
}
class Bt {
  constructor() {
    this.cache = [], this.middlewares = [], this.options = null;
  }
  use(e2) {
    return "function" != typeof e2 && index.__f__("error", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "middleware must be a function"), this.cache.push(e2), this;
  }
  next() {
    if (this.middlewares && this.middlewares.length > 0) {
      return this.middlewares.shift().call(this, this.options, this.next.bind(this));
    }
  }
  run(e2) {
    return this.middlewares = this.cache.map((e3) => e3), this.options = e2, this.next();
  }
}
function Kt(e2, t2, s3) {
  const n2 = /* @__PURE__ */ Object.create(null);
  Object.keys(s3).forEach((s4) => {
    if (!t2[s4])
      return;
    n2[s4] = t2[s4];
    const i3 = new Bt();
    t2[s4] = function() {
      const r3 = Array.from(arguments);
      return i3.use((t3, n3) => e2.isInited ? n3() : Promise.reject({ code: h$1.NOT_INIT, message: `${s4} | ${d$1.NOT_INIT}` })).use((e3) => n2[s4].apply(t2, e3)), i3.run(r3);
    };
  });
}
index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.VERSION:2.4.4");
const qt = ee.getInstance();
X.getInstance();
const Jt = fe.getInstance(), Wt = Dt.getInstance(), Xt = Pt.getInstance(), Zt = xt.getInstance(), Qt = Ft.getInstance(), es = $t.getInstance(), ts = Ht.getInstance(), ss = Yt.getInstance();
qt.mount(a$1.TUIStore, Jt), qt.mount(a$1.TUITranslate, Wt), qt.mount(a$1.TUIConversation, Xt), qt.mount(a$1.TUIUser, Zt), qt.mount(a$1.TUIChat, Qt), qt.mount(a$1.TUIGroup, es), qt.mount(a$1.TUIFriend, ts), qt.mount(a$1.TUIReport, ss), Kt(qt, qt, f$1), Kt(qt, Xt, m$1), Kt(qt, Qt, v$1), Kt(qt, es, T$1), Kt(qt, Zt, E$1), Kt(qt, ts, I$1), Kt(qt, ss, f$1);
const e = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), t = "undefined" != typeof index && "undefined" == typeof window, n = e || t, o = "undefined" != typeof index, r2 = ("undefined" != typeof index || "undefined" != typeof window) && !n, i2 = e ? wx$1 : o ? index : "undefined" != typeof window ? window : {}, s2 = r2 && window && window.navigator && window.navigator.userAgent || "", c = /Android/i.test(s2), l = /(?:Windows Phone)/.test(s2), a = /(?:SymbianOS)/.test(s2), u = /OpenHarmony/i.test(s2), d = r2 && ("ontouchstart" in window || navigator.maxTouchPoints > 0) && function() {
  if (r2) {
    if (/Tablet|Pad/i.test(s2))
      return true;
    if (180 === window.orientation || 0 === window.orientation)
      return window.innerWidth >= 768 && window.innerHeight >= 1024;
    if (90 === window.orientation || -90 === window.orientation)
      return window.innerWidth >= 1024 && window.innerHeight >= 768;
  }
  return false;
}(), f = /iPhone/i.test(s2) || /iPod/i.test(s2), w = e, h = c || l || a || f || d || u, m = r2 && !h, p2 = t && !e;
function g() {
  let e2 = "";
  return m ? e2 = "pc" : h ? e2 = "h5" : w ? e2 = "wechat" : p2 && (e2 = "app"), e2;
}
const E = /* @__PURE__ */ new Map();
function v2(e2, t2) {
  E.set(e2, t2);
}
function T(e2, t2) {
  if (!e2)
    return Promise.reject(new Error(`getBoundingClientRect get error selector ${typeof e2}.`));
  if (window || document) {
    const t3 = "object" == typeof e2 ? e2 : document.querySelector(e2);
    if (!t3)
      return Promise.reject(new Error(`getBoundingClientRect can't find ${e2} dom.`));
    const n2 = t3.getBoundingClientRect();
    return Promise.resolve({ id: t3.id, top: n2.top, left: n2.left, right: n2.right, bottom: n2.bottom, width: n2.width, height: n2.height, x: n2.x, y: n2.y });
  }
  if (o) {
    if (!t2)
      return Promise.reject(new Error("getBoundingClientRect need instanceName in params."));
    const n2 = index.createSelectorQuery().in(E.get(t2));
    return new Promise((t3, o2) => {
      n2.select(e2).boundingClientRect((e3) => {
        e3 && t3(e3);
      }).exec(), setTimeout(() => o2(new Error(`getBoundingClientRect ${e2} timeout.`)), 500);
    });
  }
  return Promise.reject(new Error("getBoundingClientRect occur error"));
}
function P(e2, t2) {
  if (!e2)
    return Promise.reject(new Error(`getScrollInfo get error selector ${typeof e2}.`));
  if (!o && window) {
    const t3 = "object" == typeof e2 ? e2 : document.querySelector(e2);
    return t3 ? Promise.resolve({ id: t3.id, scrollTop: t3.scrollTop, scrollLeft: t3.scrollLeft, scrollWidth: t3.scrollWidth, scrollHeight: t3.scrollHeight }) : Promise.reject(new Error(`getScrollInfo can't find ${e2} dom.`));
  }
  if (o) {
    if (!t2)
      return Promise.reject(new Error("getScrollInfo need instanceName in params."));
    const n2 = index.createSelectorQuery().in(E.get(t2));
    return new Promise((t3, o2) => {
      n2.select(e2).scrollOffset((e3) => {
        e3 && t3(e3);
      }).exec(), setTimeout(() => o2(new Error(`getScrollInfo ${e2} timeout.`)), 500);
    });
  }
  return Promise.reject(new Error("getScrollInfo occur error"));
}
class L {
  constructor() {
    if (L.instance)
      return L.instance;
    L.instance = this, this.eventCallback = null, this.listener = null, this.button = 0, this.init();
  }
  init() {
    r2 && (this.eventCallback = (e2) => {
      this.listener && this.listener(e2);
    }, document.addEventListener("mousedown", this.eventCallback));
  }
  listen(e2) {
    if (r2) {
      const { domRefs: t2, ignoreDomRefs: n2, handler: o2, button: r3 = 0 } = e2;
      this.button = r3, this.listener = (e3) => {
        const r4 = Array.isArray(n2) ? n2 : [n2];
        for (const t3 of r4)
          if (t3 && t3.contains(e3.target))
            return;
        const i3 = Array.isArray(t2) ? t2 : [t2];
        for (const t3 of i3)
          if (t3 && t3.contains(e3.target) && this.button === e3.button)
            return;
        o2(e3), this.remove();
      };
    }
  }
  remove() {
    this.listener = null, this.button = -1;
  }
}
function k(e2) {
  const { element: t2, onLongPress: n2, options: o2 = {} } = e2;
  if (!t2 || !n2)
    throw new Error("addLongPressEventListener missing arguments");
  const { duration: r3 = 800, eventDelegation: i3 } = o2;
  let s3;
  function c2() {
    clearTimeout(s3), a2();
  }
  function l2() {
    clearTimeout(s3), a2();
  }
  function a2() {
    t2.removeEventListener("pointerup", c2), t2.removeEventListener("pointermove", l2);
  }
  t2.addEventListener("pointerdown", (e3) => {
    const o3 = e3.target, a3 = (null == i3 ? void 0 : i3.subSelector) ? o3.closest(i3.subSelector) || void 0 : o3, u2 = e3.currentTarget;
    s3 = setTimeout(() => n2(e3, a3, u2), r3), t2.addEventListener("pointerup", c2), t2.addEventListener("pointermove", l2);
  });
}
const I = { PROTOCOLS: ["javascript:", "vbscript:", "file:", "about:", "ftp:", "ws:", "wss:", "mailto:", "tel:", "sms:", "gopher:", "data:", "blob:"], HTML_TAGS: ["<script", "<img", "<iframe", "<object", "<embed", "<video", "<audio", "<link", "<meta", "<style", "<form", "<input", "<svg", "<xml", "<xmp", "<xsl", "<base"], EVENT_HANDLERS: ["onclick", "onload", "onerror", "onmouseover", "onmouseout", "onfocus", "onblur", "onsubmit", "onreset", "onselect", "onchange", "onkeyup", "onkeydown", "onkeypress", "ondblclick", "oncontextmenu", "ondrag", "ondrop", "onmouseenter", "onmouseleave", "onanimation", "onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "ononline", "onpagehide", "onpageshow", "onpopstate", "onresize", "onstorage", "onunload"], JS_FUNCTIONS: ["eval(", "setTimeout(", "setInterval(", "Function(", "constructor", "prototype", "__proto__", "window.", "document.", "location.", "alert(", "confirm(", "prompt(", "fetch(", "XMLHttpRequest"], CSS_PATTERNS: ["expression(", "url(", "@import", "behavior:", "-moz-binding"], ENCODING_SEQUENCES: ["&#", "\\", "fromCharCode", "String.fromCharCode", "unescape(", "escape(", "encodeURI(", "decodeURI(", "atob(", "btoa("], SPECIAL_MARKERS: ["<!--", "-->", "*/>", "]]>", "<!ENTITY", "<!DOCTYPE"], DATA_MARKERS: ["base64,", "0x", "%0", "U+", "\\u", "\\x"], OTHER_PATTERNS: ["null", "undefined", "NaN", "true", "false", "instanceof"] };
function j(e2, t2 = {}) {
  const { maxLength: n2 = 2083, allowedProtocols: o2 = ["http:", "https:", "mailto:"], allowCredentials: r3 = false, allowDataUrl: i3 = false } = t2;
  if (!e2 || "string" != typeof e2)
    return "about:blank";
  if (e2.length > n2)
    return "about:blank";
  try {
    let t3 = e2.replace(/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/g, "");
    t3 = t3.normalize("NFKC"), t3 = t3.replace(/\s+/g, " ").trim();
    let n3 = t3;
    const s3 = /* @__PURE__ */ new Set();
    let c2 = 0;
    for (; c2 < 5; )
      try {
        const e3 = decodeURIComponent(n3);
        if (s3.has(e3))
          break;
        s3.add(e3), n3 = e3, c2++;
      } catch (e3) {
        break;
      }
    const l2 = function() {
      const e3 = [], t4 = Object.keys(I);
      for (let n4 = 0; n4 < t4.length; n4++) {
        const o3 = I[t4[n4]];
        for (let t5 = 0; t5 < o3.length; t5++)
          e3.push(o3[t5]);
      }
      return e3;
    }();
    for (const e3 of s3) {
      const t4 = e3.toLowerCase();
      for (let e4 = 0; e4 < l2.length; e4++)
        if (-1 !== t4.indexOf(l2[e4]))
          return "about:blank";
    }
    const a2 = function(e3) {
      const t4 = /^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, n4 = e3.match(t4);
      if (!n4)
        throw new Error("Invalid URL");
      const o3 = (n4[4] || "").split("@"), r4 = o3[o3.length - 1];
      let i4 = "", s4 = "";
      if (o3.length > 1) {
        const e4 = o3[0].split(":");
        i4 = e4[0] || "", s4 = e4[1] || "";
      }
      const c3 = r4.split(":"), l3 = c3[0], a3 = c3[1] || "";
      return { href: e3, protocol: (n4[1] || "").toLowerCase(), host: r4, hostname: l3, port: a3, pathname: n4[5] || "", search: n4[6] || "", hash: n4[8] || "", username: i4, password: s4 };
    }(t3), u2 = a2.protocol.replace(":", "").toLowerCase() + ":";
    let d2 = false;
    for (let e3 = 0; e3 < o2.length; e3++)
      if (o2[e3] === u2) {
        d2 = true;
        break;
      }
    if (!d2)
      return "about:blank";
    if (!r3 && (a2.username || a2.password))
      return "about:blank";
    if (!i3 && "data:" === u2)
      return "about:blank";
    if (!/^[\w\-.]+(:\d+)?$/.test(a2.host))
      return "about:blank";
    const f2 = a2.pathname + a2.search + a2.hash;
    return /^[\w\-./=?#&%+@,:()[\]]+$/.test(f2) ? t3 : "about:blank";
  } catch (e3) {
    return "about:blank";
  }
}
function A(e2) {
  const t2 = function(e3) {
    const t3 = /(?:https?:\/\/|mailto:|www\.)(?:localhost(?::\d{1,5})?|[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b)(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi, n2 = [], o2 = e3.split(t3), r3 = e3.match(t3) || [];
    let i3 = 0;
    return o2.forEach((e4) => {
      if (e4 && n2.push({ type: "text", text: e4 }), r3[i3]) {
        const e5 = r3[i3];
        let t4 = e5;
        e5.toLowerCase().startsWith("www.") && (t4 = "https://" + e5), n2.push({ type: "url", text: e5, url: t4 }), i3++;
      }
    }), n2;
  }(e2);
  return t2.map((e3) => {
    if ("url" === e3.type) {
      const t3 = j(e3.url);
      return "about:blank" === t3 ? { type: "text", text: e3.text } : Object.assign(Object.assign({}, e3), { url: t3 });
    }
    return e3;
  });
}
index.__f__("log", "at node_modules/@tencentcloud/universal-api/index.js:1", "UniversalAPI.VERSION:2.4.0");
const O = new L();
const createHook = (lifecycle) => (hook, target = getCurrentInstance$1()) => {
  !exports.isInSSRComponentSetup && injectHook(lifecycle, hook, target);
};
const onHide = /* @__PURE__ */ createHook(ON_HIDE);
const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
const onReady = /* @__PURE__ */ createHook(ON_READY);
const onUnload = /* @__PURE__ */ createHook(ON_UNLOAD);
var dayjs_min = { exports: {} };
(function(module2, exports2) {
  !function(t2, e2) {
    module2.exports = e2();
  }(commonjsGlobal, function() {
    var t2 = 1e3, e2 = 6e4, n2 = 36e5, r3 = "millisecond", i3 = "second", s3 = "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+)?$/, y2 = /\[([^\]]+)]|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(t3) {
      var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
      return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
    } }, m2 = function(t3, e3, n3) {
      var r4 = String(t3);
      return !r4 || r4.length >= e3 ? t3 : "" + Array(e3 + 1 - r4.length).join(n3) + t3;
    }, v3 = { s: m2, z: function(t3) {
      var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r4 = Math.floor(n3 / 60), i4 = n3 % 60;
      return (e3 <= 0 ? "+" : "-") + m2(r4, 2, "0") + ":" + m2(i4, 2, "0");
    }, m: function t3(e3, n3) {
      if (e3.date() < n3.date())
        return -t3(n3, e3);
      var r4 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i4 = e3.clone().add(r4, c2), s4 = n3 - i4 < 0, u3 = e3.clone().add(r4 + (s4 ? -1 : 1), c2);
      return +(-(r4 + (n3 - i4) / (s4 ? i4 - u3 : u3 - i4)) || 0);
    }, a: function(t3) {
      return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
    }, p: function(t3) {
      return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s3, s: i3, ms: r3, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
    }, u: function(t3) {
      return void 0 === t3;
    } }, g2 = "en", D2 = {};
    D2[g2] = M2;
    var p3 = "$isDayjsObject", S2 = function(t3) {
      return t3 instanceof _2 || !(!t3 || !t3[p3]);
    }, w2 = function t3(e3, n3, r4) {
      var i4;
      if (!e3)
        return g2;
      if ("string" == typeof e3) {
        var s4 = e3.toLowerCase();
        D2[s4] && (i4 = s4), n3 && (D2[s4] = n3, i4 = s4);
        var u3 = e3.split("-");
        if (!i4 && u3.length > 1)
          return t3(u3[0]);
      } else {
        var a3 = e3.name;
        D2[a3] = e3, i4 = a3;
      }
      return !r4 && i4 && (g2 = i4), i4 || !r4 && g2;
    }, O2 = function(t3, e3) {
      if (S2(t3))
        return t3.clone();
      var n3 = "object" == typeof e3 ? e3 : {};
      return n3.date = t3, n3.args = arguments, new _2(n3);
    }, b2 = v3;
    b2.l = w2, b2.i = S2, b2.w = function(t3, e3) {
      return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
    };
    var _2 = function() {
      function M3(t3) {
        this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p3] = true;
      }
      var m3 = M3.prototype;
      return m3.parse = function(t3) {
        this.$d = function(t4) {
          var e3 = t4.date, n3 = t4.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 r4 = e3.match($2);
            if (r4) {
              var i4 = r4[2] - 1 || 0, s4 = (r4[7] || "0").substring(0, 3);
              return n3 ? new Date(Date.UTC(r4[1], i4, r4[3] || 1, r4[4] || 0, r4[5] || 0, r4[6] || 0, s4)) : new Date(r4[1], i4, r4[3] || 1, r4[4] || 0, r4[5] || 0, r4[6] || 0, s4);
            }
          }
          return new Date(e3);
        }(t3), this.init();
      }, m3.init = function() {
        var t3 = this.$d;
        this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
      }, m3.$utils = function() {
        return b2;
      }, m3.isValid = function() {
        return !(this.$d.toString() === l2);
      }, m3.isSame = function(t3, e3) {
        var n3 = O2(t3);
        return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
      }, m3.isAfter = function(t3, e3) {
        return O2(t3) < this.startOf(e3);
      }, m3.isBefore = function(t3, e3) {
        return this.endOf(e3) < O2(t3);
      }, m3.$g = function(t3, e3, n3) {
        return b2.u(t3) ? this[e3] : this.set(n3, t3);
      }, m3.unix = function() {
        return Math.floor(this.valueOf() / 1e3);
      }, m3.valueOf = function() {
        return this.$d.getTime();
      }, m3.startOf = function(t3, e3) {
        var n3 = this, r4 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
          var i4 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
          return r4 ? i4 : i4.endOf(a2);
        }, $3 = function(t4, e4) {
          return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r4 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
        }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v4 = "set" + (this.$u ? "UTC" : "");
        switch (f3) {
          case h2:
            return r4 ? l3(1, 0) : l3(31, 11);
          case c2:
            return r4 ? l3(1, M4) : l3(0, M4 + 1);
          case o2:
            var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
            return l3(r4 ? m4 - D3 : m4 + (6 - D3), M4);
          case a2:
          case d2:
            return $3(v4 + "Hours", 0);
          case u2:
            return $3(v4 + "Minutes", 1);
          case s3:
            return $3(v4 + "Seconds", 2);
          case i3:
            return $3(v4 + "Milliseconds", 3);
          default:
            return this.clone();
        }
      }, m3.endOf = function(t3) {
        return this.startOf(t3, false);
      }, m3.$set = function(t3, e3) {
        var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s3] = f3 + "Minutes", n3[i3] = f3 + "Seconds", n3[r3] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3;
        if (o3 === c2 || o3 === h2) {
          var y3 = this.clone().set(d2, 1);
          y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
        } else
          l3 && this.$d[l3]($3);
        return this.init(), this;
      }, m3.set = function(t3, e3) {
        return this.clone().$set(t3, e3);
      }, m3.get = function(t3) {
        return this[b2.p(t3)]();
      }, m3.add = function(r4, f3) {
        var d3, l3 = this;
        r4 = Number(r4);
        var $3 = b2.p(f3), y3 = function(t3) {
          var e3 = O2(l3);
          return b2.w(e3.date(e3.date() + Math.round(t3 * r4)), l3);
        };
        if ($3 === c2)
          return this.set(c2, this.$M + r4);
        if ($3 === h2)
          return this.set(h2, this.$y + r4);
        if ($3 === a2)
          return y3(1);
        if ($3 === o2)
          return y3(7);
        var M4 = (d3 = {}, d3[s3] = e2, d3[u2] = n2, d3[i3] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r4 * M4;
        return b2.w(m4, this);
      }, m3.subtract = function(t3, e3) {
        return this.add(-1 * t3, e3);
      }, m3.format = function(t3) {
        var e3 = this, n3 = this.$locale();
        if (!this.isValid())
          return n3.invalidDate || l2;
        var r4 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i4 = b2.z(this), s4 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i5, s5) {
          return t4 && (t4[n4] || t4(e3, r4)) || i5[n4].slice(0, s5);
        }, d3 = function(t4) {
          return b2.s(s4 % 12 || 12, t4, "0");
        }, $3 = f3 || function(t4, e4, n4) {
          var r5 = t4 < 12 ? "AM" : "PM";
          return n4 ? r5.toLowerCase() : r5;
        };
        return r4.replace(y2, function(t4, r5) {
          return r5 || function(t5) {
            switch (t5) {
              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(n3.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(n3.weekdaysMin, e3.$W, o3, 2);
              case "ddd":
                return h3(n3.weekdaysShort, e3.$W, o3, 3);
              case "dddd":
                return o3[e3.$W];
              case "H":
                return String(s4);
              case "HH":
                return b2.s(s4, 2, "0");
              case "h":
                return d3(1);
              case "hh":
                return d3(2);
              case "a":
                return $3(s4, u3, true);
              case "A":
                return $3(s4, 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 i4;
            }
            return null;
          }(t4) || i4.replace(":", "");
        });
      }, m3.utcOffset = function() {
        return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
      }, m3.diff = function(r4, d3, l3) {
        var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r4), v4 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() {
          return b2.m(y3, m4);
        };
        switch (M4) {
          case h2:
            $3 = D3() / 12;
            break;
          case c2:
            $3 = D3();
            break;
          case f2:
            $3 = D3() / 3;
            break;
          case o2:
            $3 = (g3 - v4) / 6048e5;
            break;
          case a2:
            $3 = (g3 - v4) / 864e5;
            break;
          case u2:
            $3 = g3 / n2;
            break;
          case s3:
            $3 = g3 / e2;
            break;
          case i3:
            $3 = g3 / t2;
            break;
          default:
            $3 = g3;
        }
        return l3 ? $3 : b2.a($3);
      }, m3.daysInMonth = function() {
        return this.endOf(c2).$D;
      }, m3.$locale = function() {
        return D2[this.$L];
      }, m3.locale = function(t3, e3) {
        if (!t3)
          return this.$L;
        var n3 = this.clone(), r4 = w2(t3, e3, true);
        return r4 && (n3.$L = r4), n3;
      }, 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", r3], ["$s", i3], ["$m", s3], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
      k2[t3[1]] = function(e3) {
        return this.$g(e3, t3[0], t3[1]);
      };
    }), O2.extend = function(t3, e3) {
      return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2;
    }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
      return O2(1e3 * t3);
    }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
  });
})(dayjs_min);
var dayjs_minExports = dayjs_min.exports;
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
var localeData$1 = { exports: {} };
(function(module2, exports2) {
  !function(n2, e2) {
    module2.exports = e2();
  }(commonjsGlobal, function() {
    return function(n2, e2, t2) {
      var r3 = e2.prototype, o2 = function(n3) {
        return n3 && (n3.indexOf ? n3 : n3.s);
      }, u2 = function(n3, e3, t3, r4, u3) {
        var i4 = n3.name ? n3 : n3.$locale(), a3 = o2(i4[e3]), s4 = o2(i4[t3]), f2 = a3 || s4.map(function(n4) {
          return n4.slice(0, r4);
        });
        if (!u3)
          return f2;
        var d2 = i4.weekStart;
        return f2.map(function(n4, e4) {
          return f2[(e4 + (d2 || 0)) % 7];
        });
      }, i3 = function() {
        return t2.Ls[t2.locale()];
      }, a2 = function(n3, e3) {
        return n3.formats[e3] || function(n4) {
          return n4.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(n5, e4, t3) {
            return e4 || t3.slice(1);
          });
        }(n3.formats[e3.toUpperCase()]);
      }, s3 = function() {
        var n3 = this;
        return { months: function(e3) {
          return e3 ? e3.format("MMMM") : u2(n3, "months");
        }, monthsShort: function(e3) {
          return e3 ? e3.format("MMM") : u2(n3, "monthsShort", "months", 3);
        }, firstDayOfWeek: function() {
          return n3.$locale().weekStart || 0;
        }, weekdays: function(e3) {
          return e3 ? e3.format("dddd") : u2(n3, "weekdays");
        }, weekdaysMin: function(e3) {
          return e3 ? e3.format("dd") : u2(n3, "weekdaysMin", "weekdays", 2);
        }, weekdaysShort: function(e3) {
          return e3 ? e3.format("ddd") : u2(n3, "weekdaysShort", "weekdays", 3);
        }, longDateFormat: function(e3) {
          return a2(n3.$locale(), e3);
        }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
      };
      r3.localeData = function() {
        return s3.bind(this)();
      }, t2.localeData = function() {
        var n3 = i3();
        return { firstDayOfWeek: function() {
          return n3.weekStart || 0;
        }, weekdays: function() {
          return t2.weekdays();
        }, weekdaysShort: function() {
          return t2.weekdaysShort();
        }, weekdaysMin: function() {
          return t2.weekdaysMin();
        }, months: function() {
          return t2.months();
        }, monthsShort: function() {
          return t2.monthsShort();
        }, longDateFormat: function(e3) {
          return a2(n3, e3);
        }, meridiem: n3.meridiem, ordinal: n3.ordinal };
      }, t2.months = function() {
        return u2(i3(), "months");
      }, t2.monthsShort = function() {
        return u2(i3(), "monthsShort", "months", 3);
      }, t2.weekdays = function(n3) {
        return u2(i3(), "weekdays", null, null, n3);
      }, t2.weekdaysShort = function(n3) {
        return u2(i3(), "weekdaysShort", "weekdays", 3, n3);
      }, t2.weekdaysMin = function(n3) {
        return u2(i3(), "weekdaysMin", "weekdays", 2, n3);
      };
    };
  });
})(localeData$1);
var localeDataExports = localeData$1.exports;
const localeData = /* @__PURE__ */ getDefaultExportFromCjs(localeDataExports);
var isSameOrAfter$1 = { exports: {} };
(function(module2, exports2) {
  !function(e2, t2) {
    module2.exports = t2();
  }(commonjsGlobal, function() {
    return function(e2, t2) {
      t2.prototype.isSameOrAfter = function(e3, t3) {
        return this.isSame(e3, t3) || this.isAfter(e3, t3);
      };
    };
  });
})(isSameOrAfter$1);
var isSameOrAfterExports = isSameOrAfter$1.exports;
const isSameOrAfter = /* @__PURE__ */ getDefaultExportFromCjs(isSameOrAfterExports);
var isSameOrBefore$1 = { exports: {} };
(function(module2, exports2) {
  !function(e2, i3) {
    module2.exports = i3();
  }(commonjsGlobal, function() {
    return function(e2, i3) {
      i3.prototype.isSameOrBefore = function(e3, i4) {
        return this.isSame(e3, i4) || this.isBefore(e3, i4);
      };
    };
  });
})(isSameOrBefore$1);
var isSameOrBeforeExports = isSameOrBefore$1.exports;
const isSameOrBefore = /* @__PURE__ */ getDefaultExportFromCjs(isSameOrBeforeExports);
var zhCn = { exports: {} };
(function(module2, exports2) {
  !function(e2, _2) {
    module2.exports = _2(dayjs_minExports);
  }(commonjsGlobal, function(e2) {
    function _2(e3) {
      return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
    }
    var t2 = _2(e2), d2 = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e3, _3) {
      return "W" === _3 ? e3 + "周" : e3 + "日";
    }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e3, _3) {
      var t3 = 100 * e3 + _3;
      return t3 < 600 ? "凌晨" : t3 < 900 ? "早上" : t3 < 1100 ? "上午" : t3 < 1300 ? "中午" : t3 < 1800 ? "下午" : "晚上";
    } };
    return t2.default.locale(d2, null, true), d2;
  });
})(zhCn);
var extendStatics = function(d2, b2) {
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d22, b22) {
    d22.__proto__ = b22;
  } || function(d22, b22) {
    for (var p3 in b22)
      if (Object.prototype.hasOwnProperty.call(b22, p3))
        d22[p3] = b22[p3];
  };
  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(t2) {
    for (var s3, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
      s3 = arguments[i3];
      for (var p3 in s3)
        if (Object.prototype.hasOwnProperty.call(s3, p3))
          t2[p3] = s3[p3];
    }
    return t2;
  };
  return __assign.apply(this, arguments);
};
function __values(o2) {
  var s3 = typeof Symbol === "function" && Symbol.iterator, m2 = s3 && o2[s3], i3 = 0;
  if (m2)
    return m2.call(o2);
  if (o2 && typeof o2.length === "number")
    return {
      next: function() {
        if (o2 && i3 >= o2.length)
          o2 = void 0;
        return { value: o2 && o2[i3++], done: !o2 };
      }
    };
  throw new TypeError(s3 ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o2, n2) {
  var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
  if (!m2)
    return o2;
  var i3 = m2.call(o2), r3, ar = [], e2;
  try {
    while ((n2 === void 0 || n2-- > 0) && !(r3 = i3.next()).done)
      ar.push(r3.value);
  } catch (error) {
    e2 = { error };
  } finally {
    try {
      if (r3 && !r3.done && (m2 = i3["return"]))
        m2.call(i3);
    } finally {
      if (e2)
        throw e2.error;
    }
  }
  return ar;
}
function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2)
    for (var i3 = 0, l2 = from.length, ar; i3 < l2; i3++) {
      if (ar || !(i3 in from)) {
        if (!ar)
          ar = Array.prototype.slice.call(from, 0, i3);
        ar[i3] = from[i3];
      }
    }
  return to.concat(ar || Array.prototype.slice.call(from));
}
function warn$1(message) {
  var _a;
  warn(message, (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy);
}
var activeEffectScope;
var effectScopeStack = [];
var EffectScopeImpl = (
  /** @class */
  function() {
    function EffectScopeImpl2(vm) {
      this.active = true;
      this.effects = [];
      this.cleanups = [];
      this.vm = vm;
    }
    EffectScopeImpl2.prototype.run = function(fn) {
      if (this.active) {
        try {
          this.on();
          return fn();
        } finally {
          this.off();
        }
      } else {
        warn$1("cannot run an inactive effect scope.");
      }
      return;
    };
    EffectScopeImpl2.prototype.on = function() {
      if (this.active) {
        effectScopeStack.push(this);
        activeEffectScope = this;
      }
    };
    EffectScopeImpl2.prototype.off = function() {
      if (this.active) {
        effectScopeStack.pop();
        activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
      }
    };
    EffectScopeImpl2.prototype.stop = function() {
      if (this.active) {
        this.vm.$destroy();
        this.effects.forEach(function(e2) {
          return e2.stop();
        });
        this.cleanups.forEach(function(cleanup) {
          return cleanup();
        });
        this.active = false;
      }
    };
    return EffectScopeImpl2;
  }()
);
var EffectScope2 = (
  /** @class */
  function(_super) {
    __extends(EffectScope22, _super);
    function EffectScope22(detached) {
      if (detached === void 0) {
        detached = false;
      }
      var _this = this;
      var vm = void 0;
      withCurrentInstanceTrackingDisabled(function() {
        vm = defineComponentInstance(getVueConstructor());
      });
      _this = _super.call(this, vm) || this;
      if (!detached) {
        recordEffectScope(_this);
      }
      return _this;
    }
    return EffectScope22;
  }(EffectScopeImpl)
);
function recordEffectScope(effect2, scope) {
  var _a;
  scope = scope || activeEffectScope;
  if (scope && scope.active) {
    scope.effects.push(effect2);
    return;
  }
  var vm = (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy;
  vm && vm.$on("hook:destroyed", function() {
    return effect2.stop();
  });
}
function effectScope(detached) {
  return new EffectScope2(detached);
}
function getCurrentScope() {
  return activeEffectScope;
}
function onScopeDispose(fn) {
  if (activeEffectScope) {
    activeEffectScope.cleanups.push(fn);
  } else {
    warn$1("onScopeDispose() is called when there is no active effect scope to be associated with.");
  }
}
function getCurrentScopeVM() {
  var _a, _b;
  return ((_a = getCurrentScope()) === null || _a === void 0 ? void 0 : _a.vm) || ((_b = getCurrentInstance()) === null || _b === void 0 ? void 0 : _b.proxy);
}
function bindCurrentScopeToVM(vm) {
  if (!vm.scope) {
    var scope_1 = new EffectScopeImpl(vm.proxy);
    vm.scope = scope_1;
    vm.proxy.$on("hook:destroyed", function() {
      return scope_1.stop();
    });
  }
  return vm.scope;
}
var vueDependency = void 0;
try {
  var requiredVue = require("vue");
  if (requiredVue && isVue(requiredVue)) {
    vueDependency = requiredVue;
  } else if (requiredVue && "default" in requiredVue && isVue(requiredVue.default)) {
    vueDependency = requiredVue.default;
  }
} catch (_a) {
}
var vueConstructor = null;
var currentInstance = null;
var currentInstanceTracking = true;
var PluginInstalledFlag = "__composition_api_installed__";
function isVue(obj) {
  return obj && isFunction(obj) && obj.name === "Vue";
}
function isVueRegistered(Vue) {
  return vueConstructor && hasOwn(Vue, PluginInstalledFlag);
}
function getVueConstructor() {
  {
    assert(vueConstructor, "must call Vue.use(VueCompositionAPI) before using any function.");
  }
  return vueConstructor;
}
function getRegisteredVueOrDefault() {
  var constructor = vueConstructor || vueDependency;
  {
    assert(constructor, "No vue dependency found.");
  }
  return constructor;
}
function setVueConstructor(Vue) {
  if (vueConstructor && Vue.__proto__ !== vueConstructor.__proto__) {
    warn("[vue-composition-api] another instance of Vue installed");
  }
  vueConstructor = Vue;
  Object.defineProperty(Vue, PluginInstalledFlag, {
    configurable: true,
    writable: true,
    value: true
  });
}
function withCurrentInstanceTrackingDisabled(fn) {
  var prev = currentInstanceTracking;
  currentInstanceTracking = false;
  try {
    fn();
  } finally {
    currentInstanceTracking = prev;
  }
}
function setCurrentInstance(instance) {
  if (!currentInstanceTracking)
    return;
  var prev = currentInstance;
  prev === null || prev === void 0 ? void 0 : prev.scope.off();
  currentInstance = instance;
  currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope.on();
}
function getCurrentInstance() {
  return currentInstance;
}
var instanceMapCache = /* @__PURE__ */ new WeakMap();
function toVue3ComponentInstance(vm) {
  if (instanceMapCache.has(vm)) {
    return instanceMapCache.get(vm);
  }
  var instance = {
    proxy: vm,
    update: vm.$forceUpdate,
    type: vm.$options,
    uid: vm._uid,
    // $emit is defined on prototype and it expected to be bound
    emit: vm.$emit.bind(vm),
    parent: null,
    root: null
    // to be immediately set
  };
  bindCurrentScopeToVM(instance);
  var instanceProps = [
    "data",
    "props",
    "attrs",
    "refs",
    "vnode",
    "slots"
  ];
  instanceProps.forEach(function(prop) {
    proxy(instance, prop, {
      get: function() {
        return vm["$".concat(prop)];
      }
    });
  });
  proxy(instance, "isMounted", {
    get: function() {
      return vm._isMounted;
    }
  });
  proxy(instance, "isUnmounted", {
    get: function() {
      return vm._isDestroyed;
    }
  });
  proxy(instance, "isDeactivated", {
    get: function() {
      return vm._inactive;
    }
  });
  proxy(instance, "emitted", {
    get: function() {
      return vm._events;
    }
  });
  instanceMapCache.set(vm, instance);
  if (vm.$parent) {
    instance.parent = toVue3ComponentInstance(vm.$parent);
  }
  if (vm.$root) {
    instance.root = toVue3ComponentInstance(vm.$root);
  }
  return instance;
}
var toString = function(x2) {
  return Object.prototype.toString.call(x2);
};
function isNative(Ctor) {
  return typeof Ctor === "function" && /native code/.test(Ctor.toString());
}
var hasSymbol = typeof Symbol !== "undefined" && isNative(Symbol) && typeof Reflect !== "undefined" && isNative(Reflect.ownKeys);
var noopFn = function(_2) {
  return _2;
};
function proxy(target, key, _a) {
  var get2 = _a.get, set2 = _a.set;
  Object.defineProperty(target, key, {
    enumerable: true,
    configurable: true,
    get: get2 || noopFn,
    set: set2 || noopFn
  });
}
function def(obj, key, val2, enumerable) {
  Object.defineProperty(obj, key, {
    value: val2,
    enumerable: !!enumerable,
    writable: true,
    configurable: true
  });
}
function hasOwn(obj, key) {
  return Object.hasOwnProperty.call(obj, key);
}
function assert(condition, msg) {
  if (!condition) {
    throw new Error("[vue-composition-api] ".concat(msg));
  }
}
function isPrimitive(value) {
  return typeof value === "string" || typeof value === "number" || // $flow-disable-line
  typeof value === "symbol" || typeof value === "boolean";
}
function isArray(x2) {
  return Array.isArray(x2);
}
var objectToString = Object.prototype.toString;
var toTypeString = function(value) {
  return objectToString.call(value);
};
var isMap = function(val2) {
  return toTypeString(val2) === "[object Map]";
};
var isSet = function(val2) {
  return toTypeString(val2) === "[object Set]";
};
var MAX_VALID_ARRAY_LENGTH = 4294967295;
function isValidArrayIndex(val2) {
  var n2 = parseFloat(String(val2));
  return n2 >= 0 && Math.floor(n2) === n2 && isFinite(val2) && n2 <= MAX_VALID_ARRAY_LENGTH;
}
function isObject(val2) {
  return val2 !== null && typeof val2 === "object";
}
function isPlainObject(x2) {
  return toString(x2) === "[object Object]";
}
function isFunction(x2) {
  return typeof x2 === "function";
}
function isUndef(v3) {
  return v3 === void 0 || v3 === null;
}
function warn(msg, vm) {
  var Vue = getRegisteredVueOrDefault();
  if (!Vue || !Vue.util)
    index.__f__("warn", "at node_modules/@vue/composition-api/dist/vue-composition-api.mjs:421", "[vue-composition-api] ".concat(msg));
  else
    Vue.util.warn(msg, vm);
}
function logError(err, vm, info) {
  {
    warn("Error in ".concat(info, ': "').concat(err.toString(), '"'), vm);
  }
  if (typeof window !== "undefined" && typeof console !== "undefined") {
    index.__f__("error", "at node_modules/@vue/composition-api/dist/vue-composition-api.mjs:430", err);
  } else {
    throw err;
  }
}
function isSame(value1, value2) {
  if (value1 === value2) {
    return value1 !== 0 || 1 / value1 === 1 / value2;
  } else {
    return value1 !== value1 && value2 !== value2;
  }
}
function getCurrentInstanceForFn(hook, target) {
  target = target || getCurrentInstance();
  if (!target) {
    warn("".concat(hook, " is called when there is no active component instance to be ") + "associated with. Lifecycle injection APIs can only be used during execution of setup().");
  }
  return target;
}
function defineComponentInstance(Ctor, options) {
  if (options === void 0) {
    options = {};
  }
  var silent = Ctor.config.silent;
  Ctor.config.silent = true;
  var vm = new Ctor(options);
  Ctor.config.silent = silent;
  return vm;
}
function isComponentInstance(obj) {
  var Vue = getVueConstructor();
  return Vue && obj instanceof Vue;
}
function createSlotProxy(vm, slotName) {
  return function() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
      args[_i] = arguments[_i];
    }
    if (!vm.$scopedSlots[slotName]) {
      return warn("slots.".concat(slotName, '() got called outside of the "render()" scope'), vm);
    }
    return vm.$scopedSlots[slotName].apply(vm, args);
  };
}
function resolveSlots(slots, normalSlots) {
  var res;
  if (!slots) {
    res = {};
  } else if (slots._normalized) {
    return slots._normalized;
  } else {
    res = {};
    for (var key in slots) {
      if (slots[key] && key[0] !== "$") {
        res[key] = true;
      }
    }
  }
  for (var key in normalSlots) {
    if (!(key in res)) {
      res[key] = true;
    }
  }
  return res;
}
var vueInternalClasses;
var getVueInternalClasses = function() {
  if (!vueInternalClasses) {
    var vm = defineComponentInstance(getVueConstructor(), {
      computed: {
        value: function() {
          return 0;
        }
      }
    });
    var Watcher = vm._computedWatchers.value.constructor;
    var Dep = vm._data.__ob__.dep.constructor;
    vueInternalClasses = {
      Watcher,
      Dep
    };
    vm.$destroy();
  }
  return vueInternalClasses;
};
function createSymbol(name) {
  return hasSymbol ? Symbol.for(name) : name;
}
var WatcherPreFlushQueueKey = createSymbol("composition-api.preFlushQueue");
var WatcherPostFlushQueueKey = createSymbol("composition-api.postFlushQueue");
var RefKey = "composition-api.refKey";
var accessModifiedSet = /* @__PURE__ */ new WeakMap();
var rawSet = /* @__PURE__ */ new WeakMap();
var readonlySet = /* @__PURE__ */ new WeakMap();
function set$1(target, key, val2) {
  var Vue = getVueConstructor();
  var _a = Vue.util, warn2 = _a.warn, defineReactive = _a.defineReactive;
  if (isUndef(target) || isPrimitive(target)) {
    warn2("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
  }
  var ob = target.__ob__;
  function ssrMockReactivity() {
    if (ob && isObject(val2) && !hasOwn(val2, "__ob__")) {
      mockReactivityDeep(val2);
    }
  }
  if (isArray(target)) {
    if (isValidArrayIndex(key)) {
      target.length = Math.max(target.length, key);
      target.splice(key, 1, val2);
      ssrMockReactivity();
      return val2;
    } else if (key === "length" && val2 !== target.length) {
      target.length = val2;
      ob === null || ob === void 0 ? void 0 : ob.dep.notify();
      return val2;
    }
  }
  if (key in target && !(key in Object.prototype)) {
    target[key] = val2;
    ssrMockReactivity();
    return val2;
  }
  if (target._isVue || ob && ob.vmCount) {
    warn2("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option.");
    return val2;
  }
  if (!ob) {
    target[key] = val2;
    return val2;
  }
  defineReactive(ob.value, key, val2);
  defineAccessControl(target, key, val2);
  ssrMockReactivity();
  ob.dep.notify();
  return val2;
}
var _isForceTrigger = false;
function isForceTrigger() {
  return _isForceTrigger;
}
function setForceTrigger(v3) {
  _isForceTrigger = v3;
}
var RefImpl2 = (
  /** @class */
  /* @__PURE__ */ function() {
    function RefImpl22(_a) {
      var get2 = _a.get, set2 = _a.set;
      proxy(this, "value", {
        get: get2,
        set: set2
      });
    }
    return RefImpl22;
  }()
);
function createRef(options, isReadonly2, isComputed) {
  if (isReadonly2 === void 0) {
    isReadonly2 = false;
  }
  if (isComputed === void 0) {
    isComputed = false;
  }
  var r3 = new RefImpl2(options);
  if (isComputed)
    r3.effect = true;
  var sealed = Object.seal(r3);
  if (isReadonly2)
    readonlySet.set(sealed, true);
  return sealed;
}
function ref(raw) {
  var _a;
  if (isRef(raw)) {
    return raw;
  }
  var value = reactive((_a = {}, _a[RefKey] = raw, _a));
  return createRef({
    get: function() {
      return value[RefKey];
    },
    set: function(v3) {
      return value[RefKey] = v3;
    }
  });
}
function isRef(value) {
  return value instanceof RefImpl2;
}
function unref(ref2) {
  return isRef(ref2) ? ref2.value : ref2;
}
function toRefs(obj) {
  if (!isReactive(obj)) {
    warn("toRefs() expects a reactive object but received a plain one.");
  }
  if (!isPlainObject(obj))
    return obj;
  var ret = {};
  for (var key in obj) {
    ret[key] = toRef(obj, key);
  }
  return ret;
}
function customRef(factory) {
  var version2 = ref(0);
  return createRef(factory(function() {
    return void version2.value;
  }, function() {
    ++version2.value;
  }));
}
function toRef(object, key) {
  if (!(key in object))
    set$1(object, key, void 0);
  var v3 = object[key];
  if (isRef(v3))
    return v3;
  return createRef({
    get: function() {
      return object[key];
    },
    set: function(v22) {
      return object[key] = v22;
    }
  });
}
function shallowRef(raw) {
  var _a;
  if (isRef(raw)) {
    return raw;
  }
  var value = shallowReactive((_a = {}, _a[RefKey] = raw, _a));
  return createRef({
    get: function() {
      return value[RefKey];
    },
    set: function(v3) {
      return value[RefKey] = v3;
    }
  });
}
function triggerRef(value) {
  if (!isRef(value))
    return;
  setForceTrigger(true);
  value.value = value.value;
  setForceTrigger(false);
}
function proxyRefs(objectWithRefs) {
  var _a, e_1, _b;
  if (isReactive(objectWithRefs)) {
    return objectWithRefs;
  }
  var value = reactive((_a = {}, _a[RefKey] = objectWithRefs, _a));
  def(value, RefKey, value[RefKey], false);
  var _loop_1 = function(key2) {
    proxy(value, key2, {
      get: function() {
        if (isRef(value[RefKey][key2])) {
          return value[RefKey][key2].value;
        }
        return value[RefKey][key2];
      },
      set: function(v3) {
        if (isRef(value[RefKey][key2])) {
          return value[RefKey][key2].value = unref(v3);
        }
        value[RefKey][key2] = unref(v3);
      }
    });
  };
  try {
    for (var _c = __values(Object.keys(objectWithRefs)), _d = _c.next(); !_d.done; _d = _c.next()) {
      var key = _d.value;
      _loop_1(key);
    }
  } catch (e_1_1) {
    e_1 = { error: e_1_1 };
  } finally {
    try {
      if (_d && !_d.done && (_b = _c.return))
        _b.call(_c);
    } finally {
      if (e_1)
        throw e_1.error;
    }
  }
  return value;
}
var SKIPFLAG = "__v_skip";
function isRaw(obj) {
  var _a;
  return Boolean(obj && hasOwn(obj, "__ob__") && typeof obj.__ob__ === "object" && ((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a[SKIPFLAG]));
}
function isReactive(obj) {
  var _a;
  return Boolean(obj && hasOwn(obj, "__ob__") && typeof obj.__ob__ === "object" && !((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a[SKIPFLAG]));
}
function setupAccessControl(target) {
  if (!isPlainObject(target) || isRaw(target) || isArray(target) || isRef(target) || isComponentInstance(target) || accessModifiedSet.has(target))
    return;
  accessModifiedSet.set(target, true);
  var keys = Object.keys(target);
  for (var i3 = 0; i3 < keys.length; i3++) {
    defineAccessControl(target, keys[i3]);
  }
}
function defineAccessControl(target, key, val2) {
  if (key === "__ob__")
    return;
  if (isRaw(target[key]))
    return;
  var getter;
  var setter;
  var property = Object.getOwnPropertyDescriptor(target, key);
  if (property) {
    if (property.configurable === false) {
      return;
    }
    getter = property.get;
    setter = property.set;
    if ((!getter || setter) && arguments.length === 2) {
      val2 = target[key];
    }
  }
  setupAccessControl(val2);
  proxy(target, key, {
    get: function getterHandler() {
      var value = getter ? getter.call(target) : val2;
      if (key !== RefKey && isRef(value)) {
        return value.value;
      } else {
        return value;
      }
    },
    set: function setterHandler(newVal) {
      if (getter && !setter)
        return;
      if (key !== RefKey && isRef(val2) && !isRef(newVal)) {
        val2.value = newVal;
      } else if (setter) {
        setter.call(target, newVal);
        val2 = newVal;
      } else {
        val2 = newVal;
      }
      setupAccessControl(newVal);
    }
  });
}
function observe(obj) {
  var Vue = getRegisteredVueOrDefault();
  var observed;
  if (Vue.observable) {
    observed = Vue.observable(obj);
  } else {
    var vm = defineComponentInstance(Vue, {
      data: {
        $$state: obj
      }
    });
    observed = vm._data.$$state;
  }
  if (!hasOwn(observed, "__ob__")) {
    mockReactivityDeep(observed);
  }
  return observed;
}
function mockReactivityDeep(obj, seen) {
  var e_1, _a;
  if (seen === void 0) {
    seen = /* @__PURE__ */ new Set();
  }
  if (seen.has(obj) || hasOwn(obj, "__ob__") || !Object.isExtensible(obj))
    return;
  def(obj, "__ob__", mockObserver(obj));
  seen.add(obj);
  try {
    for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
      var key = _c.value;
      var value = obj[key];
      if (!(isPlainObject(value) || isArray(value)) || isRaw(value) || !Object.isExtensible(value)) {
        continue;
      }
      mockReactivityDeep(value, seen);
    }
  } catch (e_1_1) {
    e_1 = { error: e_1_1 };
  } finally {
    try {
      if (_c && !_c.done && (_a = _b.return))
        _a.call(_b);
    } finally {
      if (e_1)
        throw e_1.error;
    }
  }
}
function mockObserver(value) {
  if (value === void 0) {
    value = {};
  }
  return {
    value,
    dep: {
      notify: noopFn,
      depend: noopFn,
      addSub: noopFn,
      removeSub: noopFn
    }
  };
}
function createObserver() {
  return observe({}).__ob__;
}
function shallowReactive(obj) {
  var e_2, _a;
  if (!isObject(obj)) {
    {
      warn('"shallowReactive()" must be called on an object.');
    }
    return obj;
  }
  if (!(isPlainObject(obj) || isArray(obj)) || isRaw(obj) || !Object.isExtensible(obj)) {
    return obj;
  }
  var observed = observe(isArray(obj) ? [] : {});
  var ob = observed.__ob__;
  var _loop_1 = function(key2) {
    var val2 = obj[key2];
    var getter;
    var setter;
    var property = Object.getOwnPropertyDescriptor(obj, key2);
    if (property) {
      if (property.configurable === false) {
        return "continue";
      }
      getter = property.get;
      setter = property.set;
    }
    proxy(observed, key2, {
      get: function getterHandler() {
        var _a2;
        (_a2 = ob.dep) === null || _a2 === void 0 ? void 0 : _a2.depend();
        return val2;
      },
      set: function setterHandler(newVal) {
        var _a2;
        if (getter && !setter)
          return;
        if (!isForceTrigger() && val2 === newVal)
          return;
        if (setter) {
          setter.call(obj, newVal);
        } else {
          val2 = newVal;
        }
        (_a2 = ob.dep) === null || _a2 === void 0 ? void 0 : _a2.notify();
      }
    });
  };
  try {
    for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
      var key = _c.value;
      _loop_1(key);
    }
  } catch (e_2_1) {
    e_2 = { error: e_2_1 };
  } finally {
    try {
      if (_c && !_c.done && (_a = _b.return))
        _a.call(_b);
    } finally {
      if (e_2)
        throw e_2.error;
    }
  }
  return observed;
}
function reactive(obj) {
  if (!isObject(obj)) {
    {
      warn('"reactive()" must be called on an object.');
    }
    return obj;
  }
  if (!(isPlainObject(obj) || isArray(obj)) || isRaw(obj) || !Object.isExtensible(obj)) {
    return obj;
  }
  var observed = observe(obj);
  setupAccessControl(observed);
  return observed;
}
function markRaw(obj) {
  if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {
    return obj;
  }
  var ob = createObserver();
  ob[SKIPFLAG] = true;
  def(obj, "__ob__", ob);
  rawSet.set(obj, true);
  return obj;
}
function toRaw(observed) {
  var _a;
  if (isRaw(observed) || !Object.isExtensible(observed)) {
    return observed;
  }
  return ((_a = observed === null || observed === void 0 ? void 0 : observed.__ob__) === null || _a === void 0 ? void 0 : _a.value) || observed;
}
function isReadonly(obj) {
  return readonlySet.has(obj);
}
function readonly(target) {
  if (!isObject(target)) {
    warn("value cannot be made reactive: ".concat(String(target)));
  } else {
    readonlySet.set(target, true);
  }
  return target;
}
function shallowReadonly(obj) {
  var e_1, _a;
  if (!isObject(obj)) {
    {
      warn("value cannot be made reactive: ".concat(String(obj)));
    }
    return obj;
  }
  if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj) && !isRef(obj)) {
    return obj;
  }
  var readonlyObj = isRef(obj) ? new RefImpl2({}) : isReactive(obj) ? observe({}) : {};
  var source = reactive({});
  var ob = source.__ob__;
  var _loop_1 = function(key2) {
    var val2 = obj[key2];
    var getter;
    var property = Object.getOwnPropertyDescriptor(obj, key2);
    if (property) {
      if (property.configurable === false && !isRef(obj)) {
        return "continue";
      }
      getter = property.get;
    }
    proxy(readonlyObj, key2, {
      get: function getterHandler() {
        var value = getter ? getter.call(obj) : val2;
        ob.dep.depend();
        return value;
      },
      set: function(v3) {
        {
          warn('Set operation on key "'.concat(key2, '" failed: target is readonly.'));
        }
      }
    });
  };
  try {
    for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
      var key = _c.value;
      _loop_1(key);
    }
  } catch (e_1_1) {
    e_1 = { error: e_1_1 };
  } finally {
    try {
      if (_c && !_c.done && (_a = _b.return))
        _a.call(_b);
    } finally {
      if (e_1)
        throw e_1.error;
    }
  }
  readonlySet.set(readonlyObj, true);
  return readonlyObj;
}
function del(target, key) {
  var Vue = getVueConstructor();
  var warn2 = Vue.util.warn;
  if (isUndef(target) || isPrimitive(target)) {
    warn2("Cannot delete reactive property on undefined, null, or primitive value: ".concat(target));
  }
  if (isArray(target) && isValidArrayIndex(key)) {
    target.splice(key, 1);
    return;
  }
  var ob = target.__ob__;
  if (target._isVue || ob && ob.vmCount) {
    warn2("Avoid deleting properties on a Vue instance or its root $data - just set it to null.");
    return;
  }
  if (!hasOwn(target, key)) {
    return;
  }
  delete target[key];
  if (!ob) {
    return;
  }
  ob.dep.notify();
}
var genName = function(name) {
  return "on".concat(name[0].toUpperCase() + name.slice(1));
};
function createLifeCycle(lifeCyclehook) {
  return function(callback, target) {
    var instance = getCurrentInstanceForFn(genName(lifeCyclehook), target);
    return instance && injectHookOption(getVueConstructor(), instance, lifeCyclehook, callback);
  };
}
function injectHookOption(Vue, instance, hook, val2) {
  var options = instance.proxy.$options;
  var mergeFn = Vue.config.optionMergeStrategies[hook];
  var wrappedHook = wrapHookCall(instance, val2);
  options[hook] = mergeFn(options[hook], wrappedHook);
  return wrappedHook;
}
function wrapHookCall(instance, fn) {
  return function() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
      args[_i] = arguments[_i];
    }
    var prev = getCurrentInstance();
    setCurrentInstance(instance);
    try {
      return fn.apply(void 0, __spreadArray([], __read(args), false));
    } finally {
      setCurrentInstance(prev);
    }
  };
}
var onBeforeMount = createLifeCycle("beforeMount");
var onMounted = createLifeCycle("mounted");
var onBeforeUpdate = createLifeCycle("beforeUpdate");
var onUpdated = createLifeCycle("updated");
var onBeforeUnmount = createLifeCycle("beforeDestroy");
var onUnmounted = createLifeCycle("destroyed");
var onErrorCaptured = createLifeCycle("errorCaptured");
var onActivated = createLifeCycle("activated");
var onDeactivated = createLifeCycle("deactivated");
var onServerPrefetch = createLifeCycle("serverPrefetch");
var fallbackVM;
function flushPreQueue() {
  flushQueue(this, WatcherPreFlushQueueKey);
}
function flushPostQueue() {
  flushQueue(this, WatcherPostFlushQueueKey);
}
function hasWatchEnv(vm) {
  return vm[WatcherPreFlushQueueKey] !== void 0;
}
function installWatchEnv(vm) {
  vm[WatcherPreFlushQueueKey] = [];
  vm[WatcherPostFlushQueueKey] = [];
  vm.$on("hook:beforeUpdate", flushPreQueue);
  vm.$on("hook:updated", flushPostQueue);
}
function getWatcherOption(options) {
  return __assign({
    immediate: false,
    deep: false,
    flush: "pre"
  }, options);
}
function getWatchEffectOption(options) {
  return __assign({
    flush: "pre"
  }, options);
}
function getWatcherVM() {
  var vm = getCurrentScopeVM();
  if (!vm) {
    if (!fallbackVM) {
      fallbackVM = defineComponentInstance(getVueConstructor());
    }
    vm = fallbackVM;
  } else if (!hasWatchEnv(vm)) {
    installWatchEnv(vm);
  }
  return vm;
}
function flushQueue(vm, key) {
  var queue2 = vm[key];
  for (var index2 = 0; index2 < queue2.length; index2++) {
    queue2[index2]();
  }
  queue2.length = 0;
}
function queueFlushJob(vm, fn, mode) {
  var fallbackFlush = function() {
    vm.$nextTick(function() {
      if (vm[WatcherPreFlushQueueKey].length) {
        flushQueue(vm, WatcherPreFlushQueueKey);
      }
      if (vm[WatcherPostFlushQueueKey].length) {
        flushQueue(vm, WatcherPostFlushQueueKey);
      }
    });
  };
  switch (mode) {
    case "pre":
      fallbackFlush();
      vm[WatcherPreFlushQueueKey].push(fn);
      break;
    case "post":
      fallbackFlush();
      vm[WatcherPostFlushQueueKey].push(fn);
      break;
    default:
      assert(false, 'flush must be one of ["post", "pre", "sync"], but got '.concat(mode));
      break;
  }
}
function createVueWatcher(vm, getter, callback, options) {
  var index2 = vm._watchers.length;
  vm.$watch(getter, callback, {
    immediate: options.immediateInvokeCallback,
    deep: options.deep,
    lazy: options.noRun,
    sync: options.sync,
    before: options.before
  });
  return vm._watchers[index2];
}
function patchWatcherTeardown(watcher, runCleanup) {
  var _teardown = watcher.teardown;
  watcher.teardown = function() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
      args[_i] = arguments[_i];
    }
    _teardown.apply(watcher, args);
    runCleanup();
  };
}
function createWatcher(vm, source, cb, options) {
  var _a;
  if (!cb) {
    if (options.immediate !== void 0) {
      warn('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.');
    }
    if (options.deep !== void 0) {
      warn('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.');
    }
  }
  var flushMode = options.flush;
  var isSync = flushMode === "sync";
  var cleanup;
  var registerCleanup = function(fn) {
    cleanup = function() {
      try {
        fn();
      } catch (error) {
        logError(error, vm, "onCleanup()");
      }
    };
  };
  var runCleanup = function() {
    if (cleanup) {
      cleanup();
      cleanup = null;
    }
  };
  var createScheduler = function(fn) {
    if (isSync || /* without a current active instance, ignore pre|post mode */
    vm === fallbackVM) {
      return fn;
    }
    return function() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      return queueFlushJob(vm, function() {
        fn.apply(void 0, __spreadArray([], __read(args), false));
      }, flushMode);
    };
  };
  if (cb === null) {
    var running_1 = false;
    var getter_1 = function() {
      if (running_1) {
        return;
      }
      try {
        running_1 = true;
        source(registerCleanup);
      } finally {
        running_1 = false;
      }
    };
    var watcher_1 = createVueWatcher(vm, getter_1, noopFn, {
      deep: options.deep || false,
      sync: isSync,
      before: runCleanup
    });
    patchWatcherTeardown(watcher_1, runCleanup);
    watcher_1.lazy = false;
    var originGet = watcher_1.get.bind(watcher_1);
    watcher_1.get = createScheduler(originGet);
    return function() {
      watcher_1.teardown();
    };
  }
  var deep = options.deep;
  var isMultiSource = false;
  var getter;
  if (isRef(source)) {
    getter = function() {
      return source.value;
    };
  } else if (isReactive(source)) {
    getter = function() {
      return source;
    };
    deep = true;
  } else if (isArray(source)) {
    isMultiSource = true;
    getter = function() {
      return source.map(function(s3) {
        if (isRef(s3)) {
          return s3.value;
        } else if (isReactive(s3)) {
          return traverse(s3);
        } else if (isFunction(s3)) {
          return s3();
        } else {
          warn("Invalid watch source: ".concat(JSON.stringify(s3), ".\n          A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."), vm);
          return noopFn;
        }
      });
    };
  } else if (isFunction(source)) {
    getter = source;
  } else {
    getter = noopFn;
    warn("Invalid watch source: ".concat(JSON.stringify(source), ".\n      A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."), vm);
  }
  if (deep) {
    var baseGetter_1 = getter;
    getter = function() {
      return traverse(baseGetter_1());
    };
  }
  var applyCb = function(n2, o2) {
    if (!deep && isMultiSource && n2.every(function(v3, i3) {
      return isSame(v3, o2[i3]);
    }))
      return;
    runCleanup();
    return cb(n2, o2, registerCleanup);
  };
  var callback = createScheduler(applyCb);
  if (options.immediate) {
    var originalCallback_1 = callback;
    var shiftCallback_1 = function(n2, o2) {
      shiftCallback_1 = originalCallback_1;
      return applyCb(n2, isArray(n2) ? [] : o2);
    };
    callback = function(n2, o2) {
      return shiftCallback_1(n2, o2);
    };
  }
  var stop2 = vm.$watch(getter, callback, {
    immediate: options.immediate,
    deep,
    sync: isSync
  });
  var watcher = vm._watchers[vm._watchers.length - 1];
  if (isReactive(watcher.value) && ((_a = watcher.value.__ob__) === null || _a === void 0 ? void 0 : _a.dep) && deep) {
    watcher.value.__ob__.dep.addSub({
      update: function() {
        watcher.run();
      }
    });
  }
  patchWatcherTeardown(watcher, runCleanup);
  return function() {
    stop2();
  };
}
function watchEffect(effect2, options) {
  var opts = getWatchEffectOption(options);
  var vm = getWatcherVM();
  return createWatcher(vm, effect2, null, opts);
}
function watchPostEffect(effect2) {
  return watchEffect(effect2, { flush: "post" });
}
function watchSyncEffect(effect2) {
  return watchEffect(effect2, { flush: "sync" });
}
function watch(source, cb, options) {
  var callback = null;
  if (isFunction(cb)) {
    callback = cb;
  } else {
    {
      warn("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature.");
    }
    options = cb;
    callback = null;
  }
  var opts = getWatcherOption(options);
  var vm = getWatcherVM();
  return createWatcher(vm, source, callback, opts);
}
function traverse(value, seen) {
  if (seen === void 0) {
    seen = /* @__PURE__ */ new Set();
  }
  if (!isObject(value) || seen.has(value) || rawSet.has(value)) {
    return value;
  }
  seen.add(value);
  if (isRef(value)) {
    traverse(value.value, seen);
  } else if (isArray(value)) {
    for (var i3 = 0; i3 < value.length; i3++) {
      traverse(value[i3], seen);
    }
  } else if (isSet(value) || isMap(value)) {
    value.forEach(function(v3) {
      traverse(v3, seen);
    });
  } else if (isPlainObject(value)) {
    for (var key in value) {
      traverse(value[key], seen);
    }
  }
  return value;
}
function computed(getterOrOptions) {
  var vm = getCurrentScopeVM();
  var getter;
  var setter;
  if (isFunction(getterOrOptions)) {
    getter = getterOrOptions;
  } else {
    getter = getterOrOptions.get;
    setter = getterOrOptions.set;
  }
  var computedSetter;
  var computedGetter;
  if (vm && !vm.$isServer) {
    var _a = getVueInternalClasses(), Watcher_1 = _a.Watcher, Dep_1 = _a.Dep;
    var watcher_1;
    computedGetter = function() {
      if (!watcher_1) {
        watcher_1 = new Watcher_1(vm, getter, noopFn, { lazy: true });
      }
      if (watcher_1.dirty) {
        watcher_1.evaluate();
      }
      if (Dep_1.target) {
        watcher_1.depend();
      }
      return watcher_1.value;
    };
    computedSetter = function(v3) {
      if (!setter) {
        warn("Write operation failed: computed value is readonly.", vm);
        return;
      }
      if (setter) {
        setter(v3);
      }
    };
  } else {
    var computedHost_1 = defineComponentInstance(getVueConstructor(), {
      computed: {
        $$state: {
          get: getter,
          set: setter
        }
      }
    });
    vm && vm.$on("hook:destroyed", function() {
      return computedHost_1.$destroy();
    });
    computedGetter = function() {
      return computedHost_1.$$state;
    };
    computedSetter = function(v3) {
      if (!setter) {
        warn("Write operation failed: computed value is readonly.", vm);
        return;
      }
      computedHost_1.$$state = v3;
    };
  }
  return createRef({
    get: computedGetter,
    set: computedSetter
  }, !setter, true);
}
var NOT_FOUND = {};
function resolveInject(provideKey, vm) {
  var source = vm;
  while (source) {
    if (source._provided && hasOwn(source._provided, provideKey)) {
      return source._provided[provideKey];
    }
    source = source.$parent;
  }
  return NOT_FOUND;
}
function provide(key, value) {
  var _a;
  var vm = (_a = getCurrentInstanceForFn("provide")) === null || _a === void 0 ? void 0 : _a.proxy;
  if (!vm)
    return;
  if (!vm._provided) {
    var provideCache_1 = {};
    proxy(vm, "_provided", {
      get: function() {
        return provideCache_1;
      },
      set: function(v3) {
        return Object.assign(provideCache_1, v3);
      }
    });
  }
  vm._provided[key] = value;
}
function inject(key, defaultValue, treatDefaultAsFactory) {
  var _a;
  if (treatDefaultAsFactory === void 0) {
    treatDefaultAsFactory = false;
  }
  var vm = (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy;
  if (!vm) {
    warn("inject() can only be used inside setup() or functional components.");
    return;
  }
  if (!key) {
    warn('injection "'.concat(String(key), '" not found.'), vm);
    return defaultValue;
  }
  var val2 = resolveInject(key, vm);
  if (val2 !== NOT_FOUND) {
    return val2;
  } else if (arguments.length > 1) {
    return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue() : defaultValue;
  } else {
    warn('Injection "'.concat(String(key), '" not found.'), vm);
  }
}
var EMPTY_OBJ = Object.freeze({});
var useCssModule = function(name) {
  var _a;
  if (name === void 0) {
    name = "$style";
  }
  var instance = getCurrentInstance();
  if (!instance) {
    warn("useCssModule must be called inside setup()");
    return EMPTY_OBJ;
  }
  var mod = (_a = instance.proxy) === null || _a === void 0 ? void 0 : _a[name];
  if (!mod) {
    warn('Current instance does not have CSS module named "'.concat(name, '".'));
    return EMPTY_OBJ;
  }
  return mod;
};
var useCSSModule = useCssModule;
function createApp(rootComponent, rootProps) {
  if (rootProps === void 0) {
    rootProps = void 0;
  }
  var V2 = getVueConstructor();
  var mountedVM = void 0;
  var provide2 = {};
  var app = {
    config: V2.config,
    use: V2.use.bind(V2),
    mixin: V2.mixin.bind(V2),
    component: V2.component.bind(V2),
    provide: function(key, value) {
      provide2[key] = value;
      return this;
    },
    directive: function(name, dir) {
      if (dir) {
        V2.directive(name, dir);
        return app;
      } else {
        return V2.directive(name);
      }
    },
    mount: function(el, hydrating) {
      if (!mountedVM) {
        mountedVM = new V2(__assign(__assign({ propsData: rootProps }, rootComponent), { provide: __assign(__assign({}, provide2), rootComponent.provide) }));
        mountedVM.$mount(el, hydrating);
        return mountedVM;
      } else {
        {
          warn("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");
        }
        return mountedVM;
      }
    },
    unmount: function() {
      if (mountedVM) {
        mountedVM.$destroy();
        mountedVM = void 0;
      } else {
        warn("Cannot unmount an app that is not mounted.");
      }
    }
  };
  return app;
}
var nextTick = function nextTick2() {
  var _a;
  var args = [];
  for (var _i = 0; _i < arguments.length; _i++) {
    args[_i] = arguments[_i];
  }
  return (_a = getVueConstructor()) === null || _a === void 0 ? void 0 : _a.nextTick.apply(this, args);
};
var fallbackCreateElement;
var createElement = function createElement2() {
  var _a;
  var args = [];
  for (var _i = 0; _i < arguments.length; _i++) {
    args[_i] = arguments[_i];
  }
  var instance = (this === null || this === void 0 ? void 0 : this.proxy) || ((_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy);
  if (!instance) {
    warn("`createElement()` has been called outside of render function.");
    if (!fallbackCreateElement) {
      fallbackCreateElement = defineComponentInstance(getVueConstructor()).$createElement;
    }
    return fallbackCreateElement.apply(fallbackCreateElement, args);
  }
  return instance.$createElement.apply(instance, args);
};
function useSlots() {
  return getContext().slots;
}
function useAttrs() {
  return getContext().attrs;
}
function getContext() {
  var i3 = getCurrentInstance();
  if (!i3) {
    warn("useContext() called without active instance.");
  }
  return i3.setupContext;
}
function set(vm, key, value) {
  var state = vm.__composition_api_state__ = vm.__composition_api_state__ || {};
  state[key] = value;
}
function get(vm, key) {
  return (vm.__composition_api_state__ || {})[key];
}
var vmStateManager = {
  set,
  get
};
function asVmProperty(vm, propName, propValue) {
  var props = vm.$options.props;
  if (!(propName in vm) && !(props && hasOwn(props, propName))) {
    if (isRef(propValue)) {
      proxy(vm, propName, {
        get: function() {
          return propValue.value;
        },
        set: function(val2) {
          propValue.value = val2;
        }
      });
    } else {
      proxy(vm, propName, {
        get: function() {
          if (isReactive(propValue)) {
            propValue.__ob__.dep.depend();
          }
          return propValue;
        },
        set: function(val2) {
          propValue = val2;
        }
      });
    }
    {
      vm.$nextTick(function() {
        if (Object.keys(vm._data).indexOf(propName) !== -1) {
          return;
        }
        if (isRef(propValue)) {
          proxy(vm._data, propName, {
            get: function() {
              return propValue.value;
            },
            set: function(val2) {
              propValue.value = val2;
            }
          });
        } else {
          proxy(vm._data, propName, {
            get: function() {
              return propValue;
            },
            set: function(val2) {
              propValue = val2;
            }
          });
        }
      });
    }
  } else {
    if (props && hasOwn(props, propName)) {
      warn('The setup binding property "'.concat(propName, '" is already declared as a prop.'), vm);
    } else {
      warn('The setup binding property "'.concat(propName, '" is already declared.'), vm);
    }
  }
}
function updateTemplateRef(vm) {
  var rawBindings = vmStateManager.get(vm, "rawBindings") || {};
  if (!rawBindings || !Object.keys(rawBindings).length)
    return;
  var refs = vm.$refs;
  var oldRefKeys = vmStateManager.get(vm, "refs") || [];
  for (var index2 = 0; index2 < oldRefKeys.length; index2++) {
    var key = oldRefKeys[index2];
    var setupValue = rawBindings[key];
    if (!refs[key] && setupValue && isRef(setupValue)) {
      setupValue.value = null;
    }
  }
  var newKeys = Object.keys(refs);
  var validNewKeys = [];
  for (var index2 = 0; index2 < newKeys.length; index2++) {
    var key = newKeys[index2];
    var setupValue = rawBindings[key];
    if (refs[key] && setupValue && isRef(setupValue)) {
      setupValue.value = refs[key];
      validNewKeys.push(key);
    }
  }
  vmStateManager.set(vm, "refs", validNewKeys);
}
function afterRender(vm) {
  var stack2 = [vm._vnode];
  while (stack2.length) {
    var vnode = stack2.pop();
    if (vnode) {
      if (vnode.context)
        updateTemplateRef(vnode.context);
      if (vnode.children) {
        for (var i3 = 0; i3 < vnode.children.length; ++i3) {
          stack2.push(vnode.children[i3]);
        }
      }
    }
  }
}
function updateVmAttrs(vm, ctx) {
  var e_1, _a;
  if (!vm) {
    return;
  }
  var attrBindings = vmStateManager.get(vm, "attrBindings");
  if (!attrBindings && !ctx) {
    return;
  }
  if (!attrBindings) {
    var observedData = reactive({});
    attrBindings = { ctx, data: observedData };
    vmStateManager.set(vm, "attrBindings", attrBindings);
    proxy(ctx, "attrs", {
      get: function() {
        return attrBindings === null || attrBindings === void 0 ? void 0 : attrBindings.data;
      },
      set: function() {
        warn("Cannot assign to '$attrs' because it is a read-only property", vm);
      }
    });
  }
  var source = vm.$attrs;
  var _loop_1 = function(attr2) {
    if (!hasOwn(attrBindings.data, attr2)) {
      proxy(attrBindings.data, attr2, {
        get: function() {
          return vm.$attrs[attr2];
        }
      });
    }
  };
  try {
    for (var _b = __values(Object.keys(source)), _c = _b.next(); !_c.done; _c = _b.next()) {
      var attr = _c.value;
      _loop_1(attr);
    }
  } catch (e_1_1) {
    e_1 = { error: e_1_1 };
  } finally {
    try {
      if (_c && !_c.done && (_a = _b.return))
        _a.call(_b);
    } finally {
      if (e_1)
        throw e_1.error;
    }
  }
}
function resolveScopedSlots(vm, slotsProxy) {
  var parentVNode = vm.$options._parentVnode;
  if (!parentVNode)
    return;
  var prevSlots = vmStateManager.get(vm, "slots") || [];
  var curSlots = resolveSlots(parentVNode.data.scopedSlots, vm.$slots);
  for (var index2 = 0; index2 < prevSlots.length; index2++) {
    var key = prevSlots[index2];
    if (!curSlots[key]) {
      delete slotsProxy[key];
    }
  }
  var slotNames = Object.keys(curSlots);
  for (var index2 = 0; index2 < slotNames.length; index2++) {
    var key = slotNames[index2];
    if (!slotsProxy[key]) {
      slotsProxy[key] = createSlotProxy(vm, key);
    }
  }
  vmStateManager.set(vm, "slots", slotNames);
}
function activateCurrentInstance(instance, fn, onError2) {
  var preVm = getCurrentInstance();
  setCurrentInstance(instance);
  try {
    return fn(instance);
  } catch (err) {
    if (onError2) {
      onError2(err);
    } else {
      throw err;
    }
  } finally {
    setCurrentInstance(preVm);
  }
}
function mixin(Vue) {
  Vue.mixin({
    beforeCreate: functionApiInit,
    mounted: function() {
      afterRender(this);
    },
    beforeUpdate: function() {
      updateVmAttrs(this);
    },
    updated: function() {
      afterRender(this);
    }
  });
  function functionApiInit() {
    var vm = this;
    var $options = vm.$options;
    var setup = $options.setup, render = $options.render;
    if (render) {
      $options.render = function() {
        var _this = this;
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        return activateCurrentInstance(toVue3ComponentInstance(vm), function() {
          return render.apply(_this, args);
        });
      };
    }
    if (!setup) {
      return;
    }
    if (!isFunction(setup)) {
      {
        warn('The "setup" option should be a function that returns a object in component definitions.', vm);
      }
      return;
    }
    var data = $options.data;
    $options.data = function wrappedData() {
      initSetup(vm, vm.$props);
      return isFunction(data) ? data.call(vm, vm) : data || {};
    };
  }
  function initSetup(vm, props) {
    if (props === void 0) {
      props = {};
    }
    var setup = vm.$options.setup;
    var ctx = createSetupContext2(vm);
    var instance = toVue3ComponentInstance(vm);
    instance.setupContext = ctx;
    def(props, "__ob__", createObserver());
    resolveScopedSlots(vm, ctx.slots);
    var binding;
    activateCurrentInstance(instance, function() {
      binding = setup(props, ctx);
    });
    if (!binding)
      return;
    if (isFunction(binding)) {
      var bindingFunc_1 = binding;
      vm.$options.render = function() {
        resolveScopedSlots(vm, ctx.slots);
        return activateCurrentInstance(instance, function() {
          return bindingFunc_1();
        });
      };
      return;
    } else if (isObject(binding)) {
      if (isReactive(binding)) {
        binding = toRefs(binding);
      }
      vmStateManager.set(vm, "rawBindings", binding);
      var bindingObj_1 = binding;
      Object.keys(bindingObj_1).forEach(function(name) {
        var bindingValue = bindingObj_1[name];
        if (!isRef(bindingValue)) {
          if (!isReactive(bindingValue)) {
            if (isFunction(bindingValue)) {
              var copy_1 = bindingValue;
              bindingValue = bindingValue.bind(vm);
              Object.keys(copy_1).forEach(function(ele) {
                bindingValue[ele] = copy_1[ele];
              });
            } else if (!isObject(bindingValue)) {
              bindingValue = ref(bindingValue);
            } else if (hasReactiveArrayChild(bindingValue)) {
              customReactive(bindingValue);
            }
          } else if (isArray(bindingValue)) {
            bindingValue = ref(bindingValue);
          }
        }
        asVmProperty(vm, name, bindingValue);
      });
      return;
    }
    {
      assert(false, '"setup" must return a "Object" or a "Function", got "'.concat(Object.prototype.toString.call(binding).slice(8, -1), '"'));
    }
  }
  function customReactive(target, seen) {
    if (seen === void 0) {
      seen = /* @__PURE__ */ new Set();
    }
    if (seen.has(target))
      return;
    if (!isPlainObject(target) || isRef(target) || isReactive(target) || isRaw(target))
      return;
    var Vue2 = getVueConstructor();
    var defineReactive = Vue2.util.defineReactive;
    Object.keys(target).forEach(function(k2) {
      var val2 = target[k2];
      defineReactive(target, k2, val2);
      if (val2) {
        seen.add(val2);
        customReactive(val2, seen);
      }
      return;
    });
  }
  function hasReactiveArrayChild(target, visited) {
    if (visited === void 0) {
      visited = /* @__PURE__ */ new Map();
    }
    if (visited.has(target)) {
      return visited.get(target);
    }
    visited.set(target, false);
    if (isArray(target) && isReactive(target)) {
      visited.set(target, true);
      return true;
    }
    if (!isPlainObject(target) || isRaw(target) || isRef(target)) {
      return false;
    }
    return Object.keys(target).some(function(x2) {
      return hasReactiveArrayChild(target[x2], visited);
    });
  }
  function createSetupContext2(vm) {
    var ctx = { slots: {} };
    var propsPlain = [
      "root",
      "parent",
      "refs",
      "listeners",
      "isServer",
      "ssrContext"
    ];
    var methodReturnVoid = ["emit"];
    propsPlain.forEach(function(key) {
      var srcKey = "$".concat(key);
      proxy(ctx, key, {
        get: function() {
          return vm[srcKey];
        },
        set: function() {
          warn("Cannot assign to '".concat(key, "' because it is a read-only property"), vm);
        }
      });
    });
    updateVmAttrs(vm, ctx);
    methodReturnVoid.forEach(function(key) {
      var srcKey = "$".concat(key);
      proxy(ctx, key, {
        get: function() {
          return function() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args[_i] = arguments[_i];
            }
            var fn = vm[srcKey];
            fn.apply(vm, args);
          };
        }
      });
    });
    return ctx;
  }
}
function mergeData(from, to) {
  if (!from)
    return to;
  if (!to)
    return from;
  var key;
  var toVal;
  var fromVal;
  var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from);
  for (var i3 = 0; i3 < keys.length; i3++) {
    key = keys[i3];
    if (key === "__ob__")
      continue;
    toVal = to[key];
    fromVal = from[key];
    if (!hasOwn(to, key)) {
      to[key] = fromVal;
    } else if (toVal !== fromVal && isPlainObject(toVal) && !isRef(toVal) && isPlainObject(fromVal) && !isRef(fromVal)) {
      mergeData(fromVal, toVal);
    }
  }
  return to;
}
function install(Vue) {
  if (isVueRegistered(Vue)) {
    {
      warn("[vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once.");
    }
    return;
  }
  {
    if (Vue.version) {
      if (Vue.version[0] !== "2" || Vue.version[1] !== ".") {
        warn("[vue-composition-api] only works with Vue 2, v".concat(Vue.version, " found."));
      }
    } else {
      warn("[vue-composition-api] no Vue version found");
    }
  }
  Vue.config.optionMergeStrategies.setup = function(parent, child) {
    return function mergedSetupFn(props, context) {
      return mergeData(isFunction(parent) ? parent(props, context) || {} : void 0, isFunction(child) ? child(props, context) || {} : void 0);
    };
  };
  setVueConstructor(Vue);
  mixin(Vue);
}
var Plugin = {
  install: function(Vue) {
    return install(Vue);
  }
};
function defineComponent(options) {
  return options;
}
function defineAsyncComponent(source) {
  if (isFunction(source)) {
    source = { loader: source };
  }
  var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, _b = source.suspensible, suspensible = _b === void 0 ? false : _b, userOnError = source.onError;
  if (suspensible) {
    warn("The suspensiblbe option for async components is not supported in Vue2. It is ignored.");
  }
  var pendingRequest = null;
  var retries = 0;
  var retry = function() {
    retries++;
    pendingRequest = null;
    return load();
  };
  var load = function() {
    var thisRequest;
    return pendingRequest || (thisRequest = pendingRequest = loader().catch(function(err) {
      err = err instanceof Error ? err : new Error(String(err));
      if (userOnError) {
        return new Promise(function(resolve2, reject) {
          var userRetry = function() {
            return resolve2(retry());
          };
          var userFail = function() {
            return reject(err);
          };
          userOnError(err, userRetry, userFail, retries + 1);
        });
      } else {
        throw err;
      }
    }).then(function(comp) {
      if (thisRequest !== pendingRequest && pendingRequest) {
        return pendingRequest;
      }
      if (!comp) {
        warn("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.");
      }
      if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
        comp = comp.default;
      }
      if (comp && !isObject(comp) && !isFunction(comp)) {
        throw new Error("Invalid async component load result: ".concat(comp));
      }
      return comp;
    }));
  };
  return function() {
    var component = load();
    return {
      component,
      delay,
      timeout,
      error: errorComponent,
      loading: loadingComponent
    };
  };
}
var version = "1.7.2";
if (typeof window !== "undefined" && window.Vue) {
  window.Vue.use(Plugin);
}
const VueApi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  EffectScope: EffectScope2,
  computed,
  createApp,
  createRef,
  customRef,
  default: Plugin,
  defineAsyncComponent,
  defineComponent,
  del,
  effectScope,
  getCurrentInstance,
  getCurrentScope,
  h: createElement,
  inject,
  isRaw,
  isReactive,
  isReadonly,
  isRef,
  markRaw,
  nextTick,
  onActivated,
  onBeforeMount,
  onBeforeUnmount,
  onBeforeUpdate,
  onDeactivated,
  onErrorCaptured,
  onMounted,
  onScopeDispose,
  onServerPrefetch,
  onUnmounted,
  onUpdated,
  provide,
  proxyRefs,
  reactive,
  readonly,
  ref,
  set: set$1,
  shallowReactive,
  shallowReadonly,
  shallowRef,
  toRaw,
  toRef,
  toRefs,
  triggerRef,
  unref,
  useAttrs,
  useCSSModule,
  useCssModule,
  useSlots,
  version,
  warn: warn$1,
  watch,
  watchEffect,
  watchPostEffect,
  watchSyncEffect
}, Symbol.toStringTag, { value: "Module" }));
function getDefaults() {
  return {
    baseUrl: null,
    breaks: false,
    extensions: null,
    gfm: true,
    headerIds: true,
    headerPrefix: "",
    highlight: null,
    langPrefix: "language-",
    mangle: true,
    pedantic: false,
    renderer: null,
    sanitize: false,
    sanitizer: null,
    silent: false,
    smartLists: false,
    smartypants: false,
    tokenizer: null,
    walkTokens: null,
    xhtml: false
  };
}
let defaults = getDefaults();
function changeDefaults(newDefaults) {
  defaults = newDefaults;
}
const escapeTest = /[&<>"']/;
const escapeReplace = /[&<>"']/g;
const escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
const escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
const escapeReplacements = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
};
const getEscapeReplacement = (ch) => escapeReplacements[ch];
function escape$1(html, encode2) {
  if (encode2) {
    if (escapeTest.test(html)) {
      return html.replace(escapeReplace, getEscapeReplacement);
    }
  } else {
    if (escapeTestNoEncode.test(html)) {
      return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
    }
  }
  return html;
}
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function unescape$1(html) {
  return html.replace(unescapeTest, (_2, n2) => {
    n2 = n2.toLowerCase();
    if (n2 === "colon")
      return ":";
    if (n2.charAt(0) === "#") {
      return n2.charAt(1) === "x" ? String.fromCharCode(parseInt(n2.substring(2), 16)) : String.fromCharCode(+n2.substring(1));
    }
    return "";
  });
}
const caret = /(^|[^\[])\^/g;
function edit(regex, opt) {
  regex = regex.source || regex;
  opt = opt || "";
  const obj = {
    replace: (name, val2) => {
      val2 = val2.source || val2;
      val2 = val2.replace(caret, "$1");
      regex = regex.replace(name, val2);
      return obj;
    },
    getRegex: () => {
      return new RegExp(regex, opt);
    }
  };
  return obj;
}
const nonWordAndColonTest = /[^\w:]/g;
const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
function cleanUrl(sanitize, base, href) {
  if (sanitize) {
    let prot;
    try {
      prot = decodeURIComponent(unescape$1(href)).replace(nonWordAndColonTest, "").toLowerCase();
    } catch (e2) {
      return null;
    }
    if (prot.indexOf("javascript:") === 0 || prot.indexOf("vbscript:") === 0 || prot.indexOf("data:") === 0) {
      return null;
    }
  }
  if (base && !originIndependentUrl.test(href)) {
    href = resolveUrl(base, href);
  }
  try {
    href = encodeURI(href).replace(/%25/g, "%");
  } catch (e2) {
    return null;
  }
  return href;
}
const baseUrls = {};
const justDomain = /^[^:]+:\/*[^/]*$/;
const protocol = /^([^:]+:)[\s\S]*$/;
const domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
function resolveUrl(base, href) {
  if (!baseUrls[" " + base]) {
    if (justDomain.test(base)) {
      baseUrls[" " + base] = base + "/";
    } else {
      baseUrls[" " + base] = rtrim(base, "/", true);
    }
  }
  base = baseUrls[" " + base];
  const relativeBase = base.indexOf(":") === -1;
  if (href.substring(0, 2) === "//") {
    if (relativeBase) {
      return href;
    }
    return base.replace(protocol, "$1") + href;
  } else if (href.charAt(0) === "/") {
    if (relativeBase) {
      return href;
    }
    return base.replace(domain, "$1") + href;
  } else {
    return base + href;
  }
}
const noopTest = { exec: function noopTest2() {
} };
function merge(obj) {
  let i3 = 1, target, key;
  for (; i3 < arguments.length; i3++) {
    target = arguments[i3];
    for (key in target) {
      if (Object.prototype.hasOwnProperty.call(target, key)) {
        obj[key] = target[key];
      }
    }
  }
  return obj;
}
function splitCells(tableRow, count) {
  const row = tableRow.replace(/\|/g, (match, offset, str) => {
    let escaped = false, curr = offset;
    while (--curr >= 0 && str[curr] === "\\")
      escaped = !escaped;
    if (escaped) {
      return "|";
    } else {
      return " |";
    }
  }), cells = row.split(/ \|/);
  let i3 = 0;
  if (!cells[0].trim()) {
    cells.shift();
  }
  if (!cells[cells.length - 1].trim()) {
    cells.pop();
  }
  if (cells.length > count) {
    cells.splice(count);
  } else {
    while (cells.length < count)
      cells.push("");
  }
  for (; i3 < cells.length; i3++) {
    cells[i3] = cells[i3].trim().replace(/\\\|/g, "|");
  }
  return cells;
}
function rtrim(str, c2, invert) {
  const l2 = str.length;
  if (l2 === 0) {
    return "";
  }
  let suffLen = 0;
  while (suffLen < l2) {
    const currChar = str.charAt(l2 - suffLen - 1);
    if (currChar === c2 && !invert) {
      suffLen++;
    } else if (currChar !== c2 && invert) {
      suffLen++;
    } else {
      break;
    }
  }
  return str.substr(0, l2 - suffLen);
}
function findClosingBracket(str, b2) {
  if (str.indexOf(b2[1]) === -1) {
    return -1;
  }
  const l2 = str.length;
  let level = 0, i3 = 0;
  for (; i3 < l2; i3++) {
    if (str[i3] === "\\") {
      i3++;
    } else if (str[i3] === b2[0]) {
      level++;
    } else if (str[i3] === b2[1]) {
      level--;
      if (level < 0) {
        return i3;
      }
    }
  }
  return -1;
}
function checkSanitizeDeprecation(opt) {
  if (opt && opt.sanitize && !opt.silent) {
    index.__f__("warn", "at node_modules/marked/lib/marked.esm.js:272", "marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");
  }
}
function repeatString(pattern, count) {
  if (count < 1) {
    return "";
  }
  let result = "";
  while (count > 1) {
    if (count & 1) {
      result += pattern;
    }
    count >>= 1;
    pattern += pattern;
  }
  return result + pattern;
}
function outputLink(cap, link, raw, lexer) {
  const href = link.href;
  const title = link.title ? escape$1(link.title) : null;
  const text = cap[1].replace(/\\([\[\]])/g, "$1");
  if (cap[0].charAt(0) !== "!") {
    lexer.state.inLink = true;
    const token = {
      type: "link",
      raw,
      href,
      title,
      text,
      tokens: lexer.inlineTokens(text, [])
    };
    lexer.state.inLink = false;
    return token;
  } else {
    return {
      type: "image",
      raw,
      href,
      title,
      text: escape$1(text)
    };
  }
}
function indentCodeCompensation(raw, text) {
  const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
  if (matchIndentToCode === null) {
    return text;
  }
  const indentToCode = matchIndentToCode[1];
  return text.split("\n").map((node) => {
    const matchIndentInNode = node.match(/^\s+/);
    if (matchIndentInNode === null) {
      return node;
    }
    const [indentInNode] = matchIndentInNode;
    if (indentInNode.length >= indentToCode.length) {
      return node.slice(indentToCode.length);
    }
    return node;
  }).join("\n");
}
class Tokenizer {
  constructor(options) {
    this.options = options || defaults;
  }
  space(src) {
    const cap = this.rules.block.newline.exec(src);
    if (cap) {
      if (cap[0].length > 1) {
        return {
          type: "space",
          raw: cap[0]
        };
      }
      return { raw: "\n" };
    }
  }
  code(src) {
    const cap = this.rules.block.code.exec(src);
    if (cap) {
      const text = cap[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: cap[0],
        codeBlockStyle: "indented",
        text: !this.options.pedantic ? rtrim(text, "\n") : text
      };
    }
  }
  fences(src) {
    const cap = this.rules.block.fences.exec(src);
    if (cap) {
      const raw = cap[0];
      const text = indentCodeCompensation(raw, cap[3] || "");
      return {
        type: "code",
        raw,
        lang: cap[2] ? cap[2].trim() : cap[2],
        text
      };
    }
  }
  heading(src) {
    const cap = this.rules.block.heading.exec(src);
    if (cap) {
      let text = cap[2].trim();
      if (/#$/.test(text)) {
        const trimmed = rtrim(text, "#");
        if (this.options.pedantic) {
          text = trimmed.trim();
        } else if (!trimmed || / $/.test(trimmed)) {
          text = trimmed.trim();
        }
      }
      const token = {
        type: "heading",
        raw: cap[0],
        depth: cap[1].length,
        text,
        tokens: []
      };
      this.lexer.inline(token.text, token.tokens);
      return token;
    }
  }
  hr(src) {
    const cap = this.rules.block.hr.exec(src);
    if (cap) {
      return {
        type: "hr",
        raw: cap[0]
      };
    }
  }
  blockquote(src) {
    const cap = this.rules.block.blockquote.exec(src);
    if (cap) {
      const text = cap[0].replace(/^ *> ?/gm, "");
      return {
        type: "blockquote",
        raw: cap[0],
        tokens: this.lexer.blockTokens(text, []),
        text
      };
    }
  }
  list(src) {
    let cap = this.rules.block.list.exec(src);
    if (cap) {
      let raw, istask, ischecked, indent, i3, blankLine, endsWithBlankLine, line, lines, itemContents;
      let bull = cap[1].trim();
      const isordered = bull.length > 1;
      const list = {
        type: "list",
        raw: "",
        ordered: isordered,
        start: isordered ? +bull.slice(0, -1) : "",
        loose: false,
        items: []
      };
      bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
      if (this.options.pedantic) {
        bull = isordered ? bull : "[*+-]";
      }
      const itemRegex = new RegExp(`^( {0,3}${bull})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);
      while (src) {
        if (this.rules.block.hr.test(src)) {
          break;
        }
        if (!(cap = itemRegex.exec(src))) {
          break;
        }
        lines = cap[2].split("\n");
        if (this.options.pedantic) {
          indent = 2;
          itemContents = lines[0].trimLeft();
        } else {
          indent = cap[2].search(/[^ ]/);
          indent = cap[1].length + (indent > 4 ? 1 : indent);
          itemContents = lines[0].slice(indent - cap[1].length);
        }
        blankLine = false;
        raw = cap[0];
        if (!lines[0] && /^ *$/.test(lines[1])) {
          raw = cap[1] + lines.slice(0, 2).join("\n") + "\n";
          list.loose = true;
          lines = [];
        }
        const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])`);
        for (i3 = 1; i3 < lines.length; i3++) {
          line = lines[i3];
          if (this.options.pedantic) {
            line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ");
          }
          if (nextBulletRegex.test(line)) {
            raw = cap[1] + lines.slice(0, i3).join("\n") + "\n";
            break;
          }
          if (!blankLine) {
            if (!line.trim()) {
              blankLine = true;
            }
            if (line.search(/[^ ]/) >= indent) {
              itemContents += "\n" + line.slice(indent);
            } else {
              itemContents += "\n" + line;
            }
            continue;
          }
          if (line.search(/[^ ]/) >= indent || !line.trim()) {
            itemContents += "\n" + line.slice(indent);
            continue;
          } else {
            raw = cap[1] + lines.slice(0, i3).join("\n") + "\n";
            break;
          }
        }
        if (!list.loose) {
          if (endsWithBlankLine) {
            list.loose = true;
          } else if (/\n *\n *$/.test(raw)) {
            endsWithBlankLine = true;
          }
        }
        if (this.options.gfm) {
          istask = /^\[[ xX]\] /.exec(itemContents);
          if (istask) {
            ischecked = istask[0] !== "[ ] ";
            itemContents = itemContents.replace(/^\[[ xX]\] +/, "");
          }
        }
        list.items.push({
          type: "list_item",
          raw,
          task: !!istask,
          checked: ischecked,
          loose: false,
          text: itemContents
        });
        list.raw += raw;
        src = src.slice(raw.length);
      }
      list.items[list.items.length - 1].raw = raw.trimRight();
      list.items[list.items.length - 1].text = itemContents.trimRight();
      list.raw = list.raw.trimRight();
      const l2 = list.items.length;
      for (i3 = 0; i3 < l2; i3++) {
        this.lexer.state.top = false;
        list.items[i3].tokens = this.lexer.blockTokens(list.items[i3].text, []);
        if (list.items[i3].tokens.some((t2) => t2.type === "space")) {
          list.loose = true;
          list.items[i3].loose = true;
        }
      }
      return list;
    }
  }
  html(src) {
    const cap = this.rules.block.html.exec(src);
    if (cap) {
      const token = {
        type: "html",
        raw: cap[0],
        pre: !this.options.sanitizer && (cap[1] === "pre" || cap[1] === "script" || cap[1] === "style"),
        text: cap[0]
      };
      if (this.options.sanitize) {
        token.type = "paragraph";
        token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0]);
        token.tokens = [];
        this.lexer.inline(token.text, token.tokens);
      }
      return token;
    }
  }
  def(src) {
    const cap = this.rules.block.def.exec(src);
    if (cap) {
      if (cap[3])
        cap[3] = cap[3].substring(1, cap[3].length - 1);
      const tag = cap[1].toLowerCase().replace(/\s+/g, " ");
      return {
        type: "def",
        tag,
        raw: cap[0],
        href: cap[2],
        title: cap[3]
      };
    }
  }
  table(src) {
    const cap = this.rules.block.table.exec(src);
    if (cap) {
      const item = {
        type: "table",
        header: splitCells(cap[1]).map((c2) => {
          return { text: c2 };
        }),
        align: cap[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
        rows: cap[3] ? cap[3].replace(/\n$/, "").split("\n") : []
      };
      if (item.header.length === item.align.length) {
        item.raw = cap[0];
        let l2 = item.align.length;
        let i3, j2, k2, row;
        for (i3 = 0; i3 < l2; i3++) {
          if (/^ *-+: *$/.test(item.align[i3])) {
            item.align[i3] = "right";
          } else if (/^ *:-+: *$/.test(item.align[i3])) {
            item.align[i3] = "center";
          } else if (/^ *:-+ *$/.test(item.align[i3])) {
            item.align[i3] = "left";
          } else {
            item.align[i3] = null;
          }
        }
        l2 = item.rows.length;
        for (i3 = 0; i3 < l2; i3++) {
          item.rows[i3] = splitCells(item.rows[i3], item.header.length).map((c2) => {
            return { text: c2 };
          });
        }
        l2 = item.header.length;
        for (j2 = 0; j2 < l2; j2++) {
          item.header[j2].tokens = [];
          this.lexer.inlineTokens(item.header[j2].text, item.header[j2].tokens);
        }
        l2 = item.rows.length;
        for (j2 = 0; j2 < l2; j2++) {
          row = item.rows[j2];
          for (k2 = 0; k2 < row.length; k2++) {
            row[k2].tokens = [];
            this.lexer.inlineTokens(row[k2].text, row[k2].tokens);
          }
        }
        return item;
      }
    }
  }
  lheading(src) {
    const cap = this.rules.block.lheading.exec(src);
    if (cap) {
      const token = {
        type: "heading",
        raw: cap[0],
        depth: cap[2].charAt(0) === "=" ? 1 : 2,
        text: cap[1],
        tokens: []
      };
      this.lexer.inline(token.text, token.tokens);
      return token;
    }
  }
  paragraph(src) {
    const cap = this.rules.block.paragraph.exec(src);
    if (cap) {
      const token = {
        type: "paragraph",
        raw: cap[0],
        text: cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1],
        tokens: []
      };
      this.lexer.inline(token.text, token.tokens);
      return token;
    }
  }
  text(src) {
    const cap = this.rules.block.text.exec(src);
    if (cap) {
      const token = {
        type: "text",
        raw: cap[0],
        text: cap[0],
        tokens: []
      };
      this.lexer.inline(token.text, token.tokens);
      return token;
    }
  }
  escape(src) {
    const cap = this.rules.inline.escape.exec(src);
    if (cap) {
      return {
        type: "escape",
        raw: cap[0],
        text: escape$1(cap[1])
      };
    }
  }
  tag(src) {
    const cap = this.rules.inline.tag.exec(src);
    if (cap) {
      if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
        this.lexer.state.inLink = true;
      } else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
        this.lexer.state.inLink = false;
      }
      if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
        this.lexer.state.inRawBlock = true;
      } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
        this.lexer.state.inRawBlock = false;
      }
      return {
        type: this.options.sanitize ? "text" : "html",
        raw: cap[0],
        inLink: this.lexer.state.inLink,
        inRawBlock: this.lexer.state.inRawBlock,
        text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0]) : cap[0]
      };
    }
  }
  link(src) {
    const cap = this.rules.inline.link.exec(src);
    if (cap) {
      const trimmedUrl = cap[2].trim();
      if (!this.options.pedantic && /^</.test(trimmedUrl)) {
        if (!/>$/.test(trimmedUrl)) {
          return;
        }
        const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
        if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
          return;
        }
      } else {
        const lastParenIndex = findClosingBracket(cap[2], "()");
        if (lastParenIndex > -1) {
          const start = cap[0].indexOf("!") === 0 ? 5 : 4;
          const linkLen = start + cap[1].length + lastParenIndex;
          cap[2] = cap[2].substring(0, lastParenIndex);
          cap[0] = cap[0].substring(0, linkLen).trim();
          cap[3] = "";
        }
      }
      let href = cap[2];
      let title = "";
      if (this.options.pedantic) {
        const link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
        if (link) {
          href = link[1];
          title = link[3];
        }
      } else {
        title = cap[3] ? cap[3].slice(1, -1) : "";
      }
      href = href.trim();
      if (/^</.test(href)) {
        if (this.options.pedantic && !/>$/.test(trimmedUrl)) {
          href = href.slice(1);
        } else {
          href = href.slice(1, -1);
        }
      }
      return outputLink(cap, {
        href: href ? href.replace(this.rules.inline._escapes, "$1") : href,
        title: title ? title.replace(this.rules.inline._escapes, "$1") : title
      }, cap[0], this.lexer);
    }
  }
  reflink(src, links) {
    let cap;
    if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
      let link = (cap[2] || cap[1]).replace(/\s+/g, " ");
      link = links[link.toLowerCase()];
      if (!link || !link.href) {
        const text = cap[0].charAt(0);
        return {
          type: "text",
          raw: text,
          text
        };
      }
      return outputLink(cap, link, cap[0], this.lexer);
    }
  }
  emStrong(src, maskedSrc, prevChar = "") {
    let match = this.rules.inline.emStrong.lDelim.exec(src);
    if (!match)
      return;
    if (match[3] && prevChar.match(/[\p{L}\p{N}]/u))
      return;
    const nextChar = match[1] || match[2] || "";
    if (!nextChar || nextChar && (prevChar === "" || this.rules.inline.punctuation.exec(prevChar))) {
      const lLength = match[0].length - 1;
      let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
      const endReg = match[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
      endReg.lastIndex = 0;
      maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
      while ((match = endReg.exec(maskedSrc)) != null) {
        rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
        if (!rDelim)
          continue;
        rLength = rDelim.length;
        if (match[3] || match[4]) {
          delimTotal += rLength;
          continue;
        } else if (match[5] || match[6]) {
          if (lLength % 3 && !((lLength + rLength) % 3)) {
            midDelimTotal += rLength;
            continue;
          }
        }
        delimTotal -= rLength;
        if (delimTotal > 0)
          continue;
        rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
        if (Math.min(lLength, rLength) % 2) {
          const text2 = src.slice(1, lLength + match.index + rLength);
          return {
            type: "em",
            raw: src.slice(0, lLength + match.index + rLength + 1),
            text: text2,
            tokens: this.lexer.inlineTokens(text2, [])
          };
        }
        const text = src.slice(2, lLength + match.index + rLength - 1);
        return {
          type: "strong",
          raw: src.slice(0, lLength + match.index + rLength + 1),
          text,
          tokens: this.lexer.inlineTokens(text, [])
        };
      }
    }
  }
  codespan(src) {
    const cap = this.rules.inline.code.exec(src);
    if (cap) {
      let text = cap[2].replace(/\n/g, " ");
      const hasNonSpaceChars = /[^ ]/.test(text);
      const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);
      if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
        text = text.substring(1, text.length - 1);
      }
      text = escape$1(text, true);
      return {
        type: "codespan",
        raw: cap[0],
        text
      };
    }
  }
  br(src) {
    const cap = this.rules.inline.br.exec(src);
    if (cap) {
      return {
        type: "br",
        raw: cap[0]
      };
    }
  }
  del(src) {
    const cap = this.rules.inline.del.exec(src);
    if (cap) {
      return {
        type: "del",
        raw: cap[0],
        text: cap[2],
        tokens: this.lexer.inlineTokens(cap[2], [])
      };
    }
  }
  autolink(src, mangle2) {
    const cap = this.rules.inline.autolink.exec(src);
    if (cap) {
      let text, href;
      if (cap[2] === "@") {
        text = escape$1(this.options.mangle ? mangle2(cap[1]) : cap[1]);
        href = "mailto:" + text;
      } else {
        text = escape$1(cap[1]);
        href = text;
      }
      return {
        type: "link",
        raw: cap[0],
        text,
        href,
        tokens: [
          {
            type: "text",
            raw: text,
            text
          }
        ]
      };
    }
  }
  url(src, mangle2) {
    let cap;
    if (cap = this.rules.inline.url.exec(src)) {
      let text, href;
      if (cap[2] === "@") {
        text = escape$1(this.options.mangle ? mangle2(cap[0]) : cap[0]);
        href = "mailto:" + text;
      } else {
        let prevCapZero;
        do {
          prevCapZero = cap[0];
          cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
        } while (prevCapZero !== cap[0]);
        text = escape$1(cap[0]);
        if (cap[1] === "www.") {
          href = "http://" + text;
        } else {
          href = text;
        }
      }
      return {
        type: "link",
        raw: cap[0],
        text,
        href,
        tokens: [
          {
            type: "text",
            raw: text,
            text
          }
        ]
      };
    }
  }
  inlineText(src, smartypants2) {
    const cap = this.rules.inline.text.exec(src);
    if (cap) {
      let text;
      if (this.lexer.state.inRawBlock) {
        text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0]) : cap[0];
      } else {
        text = escape$1(this.options.smartypants ? smartypants2(cap[0]) : cap[0]);
      }
      return {
        type: "text",
        raw: cap[0],
        text
      };
    }
  }
}
const block = {
  newline: /^(?: *(?:\n|$))+/,
  code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
  fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
  hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
  heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
  blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
  list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,
  html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",
  def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
  table: noopTest,
  lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
  // regex template, placeholders will be replaced according to different paragraph
  // interruption rules of commonmark and the original markdown spec:
  _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,
  text: /^[^\n]+/
};
block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
block.def = edit(block.def).replace("label", block._label).replace("title", block._title).getRegex();
block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
block.listItemStart = edit(/^( *)(bull) */).replace("bull", block.bullet).getRegex();
block.list = edit(block.list).replace(/bull/g, block.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + block.def.source + ")").getRegex();
block._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
block.html = edit(block.html, "i").replace("comment", block._comment).replace("tag", block._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
block.paragraph = edit(block._paragraph).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
block.blockquote = edit(block.blockquote).replace("paragraph", block.paragraph).getRegex();
block.normal = merge({}, block);
block.gfm = merge({}, block.normal, {
  table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
  // Cells
});
block.gfm.table = edit(block.gfm.table).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
block.pedantic = merge({}, block.normal, {
  html: edit(
    `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
  ).replace("comment", block._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
  fences: noopTest,
  // fences not supported
  paragraph: edit(block.normal._paragraph).replace("hr", block.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", block.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
});
const inline = {
  escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
  autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
  url: noopTest,
  tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
  // CDATA section
  link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
  reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
  nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
  reflinkSearch: "reflink|nolink(?!\\()",
  emStrong: {
    lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
    //        (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left.  (5) and (6) can be either Left or Right.
    //        () Skip orphan delim inside strong    (1) #***                (2) a***#, a***                   (3) #***a, ***a                 (4) ***#              (5) #***#                 (6) a***a
    rDelimAst: /^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,
    rDelimUnd: /^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/
    // ^- Not allowed for _
  },
  code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
  br: /^( {2,}|\\)\n(?!\s*$)/,
  del: noopTest,
  text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
  punctuation: /^([\spunctuation])/
};
inline._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();
inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
inline.escapedEmSt = /\\\*|\\_/g;
inline._comment = edit(block._comment).replace("(?:-->|$)", "-->").getRegex();
inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex();
inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, "g").replace(/punct/g, inline._punctuation).getRegex();
inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, "g").replace(/punct/g, inline._punctuation).getRegex();
inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
inline.autolink = edit(inline.autolink).replace("scheme", inline._scheme).replace("email", inline._email).getRegex();
inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
inline.tag = edit(inline.tag).replace("comment", inline._comment).replace("attribute", inline._attribute).getRegex();
inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
inline.link = edit(inline.link).replace("label", inline._label).replace("href", inline._href).replace("title", inline._title).getRegex();
inline.reflink = edit(inline.reflink).replace("label", inline._label).getRegex();
inline.reflinkSearch = edit(inline.reflinkSearch, "g").replace("reflink", inline.reflink).replace("nolink", inline.nolink).getRegex();
inline.normal = merge({}, inline);
inline.pedantic = merge({}, inline.normal, {
  strong: {
    start: /^__|\*\*/,
    middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
    endAst: /\*\*(?!\*)/g,
    endUnd: /__(?!_)/g
  },
  em: {
    start: /^_|\*/,
    middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
    endAst: /\*(?!\*)/g,
    endUnd: /_(?!_)/g
  },
  link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", inline._label).getRegex(),
  reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", inline._label).getRegex()
});
inline.gfm = merge({}, inline.normal, {
  escape: edit(inline.escape).replace("])", "~|])").getRegex(),
  _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
  url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
  _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
});
inline.gfm.url = edit(inline.gfm.url, "i").replace("email", inline.gfm._extended_email).getRegex();
inline.breaks = merge({}, inline.gfm, {
  br: edit(inline.br).replace("{2,}", "*").getRegex(),
  text: edit(inline.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
});
function smartypants(text) {
  return text.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
}
function mangle(text) {
  let out = "", i3, ch;
  const l2 = text.length;
  for (i3 = 0; i3 < l2; i3++) {
    ch = text.charCodeAt(i3);
    if (Math.random() > 0.5) {
      ch = "x" + ch.toString(16);
    }
    out += "&#" + ch + ";";
  }
  return out;
}
class Lexer {
  constructor(options) {
    this.tokens = [];
    this.tokens.links = /* @__PURE__ */ Object.create(null);
    this.options = options || defaults;
    this.options.tokenizer = this.options.tokenizer || new Tokenizer();
    this.tokenizer = this.options.tokenizer;
    this.tokenizer.options = this.options;
    this.tokenizer.lexer = this;
    this.inlineQueue = [];
    this.state = {
      inLink: false,
      inRawBlock: false,
      top: true
    };
    const rules = {
      block: block.normal,
      inline: inline.normal
    };
    if (this.options.pedantic) {
      rules.block = block.pedantic;
      rules.inline = inline.pedantic;
    } else if (this.options.gfm) {
      rules.block = block.gfm;
      if (this.options.breaks) {
        rules.inline = inline.breaks;
      } else {
        rules.inline = inline.gfm;
      }
    }
    this.tokenizer.rules = rules;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block,
      inline
    };
  }
  /**
   * Static Lex Method
   */
  static lex(src, options) {
    const lexer = new Lexer(options);
    return lexer.lex(src);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(src, options) {
    const lexer = new Lexer(options);
    return lexer.inlineTokens(src);
  }
  /**
   * Preprocessing
   */
  lex(src) {
    src = src.replace(/\r\n|\r/g, "\n").replace(/\t/g, "    ");
    this.blockTokens(src, this.tokens);
    let next;
    while (next = this.inlineQueue.shift()) {
      this.inlineTokens(next.src, next.tokens);
    }
    return this.tokens;
  }
  /**
   * Lexing
   */
  blockTokens(src, tokens = []) {
    if (this.options.pedantic) {
      src = src.replace(/^ +$/gm, "");
    }
    let token, lastToken, cutSrc, lastParagraphClipped;
    while (src) {
      if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((extTokenizer) => {
        if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
          src = src.substring(token.raw.length);
          tokens.push(token);
          return true;
        }
        return false;
      })) {
        continue;
      }
      if (token = this.tokenizer.space(src)) {
        src = src.substring(token.raw.length);
        if (token.type) {
          tokens.push(token);
        }
        continue;
      }
      if (token = this.tokenizer.code(src)) {
        src = src.substring(token.raw.length);
        lastToken = tokens[tokens.length - 1];
        if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
          lastToken.raw += "\n" + token.raw;
          lastToken.text += "\n" + token.text;
          this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
        } else {
          tokens.push(token);
        }
        continue;
      }
      if (token = this.tokenizer.fences(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.heading(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.hr(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.blockquote(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.list(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.html(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.def(src)) {
        src = src.substring(token.raw.length);
        lastToken = tokens[tokens.length - 1];
        if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
          lastToken.raw += "\n" + token.raw;
          lastToken.text += "\n" + token.raw;
          this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
        } else if (!this.tokens.links[token.tag]) {
          this.tokens.links[token.tag] = {
            href: token.href,
            title: token.title
          };
        }
        continue;
      }
      if (token = this.tokenizer.table(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.lheading(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      cutSrc = src;
      if (this.options.extensions && this.options.extensions.startBlock) {
        let startIndex = Infinity;
        const tempSrc = src.slice(1);
        let tempStart;
        this.options.extensions.startBlock.forEach(function(getStartIndex) {
          tempStart = getStartIndex.call({ lexer: this }, tempSrc);
          if (typeof tempStart === "number" && tempStart >= 0) {
            startIndex = Math.min(startIndex, tempStart);
          }
        });
        if (startIndex < Infinity && startIndex >= 0) {
          cutSrc = src.substring(0, startIndex + 1);
        }
      }
      if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
        lastToken = tokens[tokens.length - 1];
        if (lastParagraphClipped && lastToken.type === "paragraph") {
          lastToken.raw += "\n" + token.raw;
          lastToken.text += "\n" + token.text;
          this.inlineQueue.pop();
          this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
        } else {
          tokens.push(token);
        }
        lastParagraphClipped = cutSrc.length !== src.length;
        src = src.substring(token.raw.length);
        continue;
      }
      if (token = this.tokenizer.text(src)) {
        src = src.substring(token.raw.length);
        lastToken = tokens[tokens.length - 1];
        if (lastToken && lastToken.type === "text") {
          lastToken.raw += "\n" + token.raw;
          lastToken.text += "\n" + token.text;
          this.inlineQueue.pop();
          this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
        } else {
          tokens.push(token);
        }
        continue;
      }
      if (src) {
        const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
        if (this.options.silent) {
          index.__f__("error", "at node_modules/marked/lib/marked.esm.js:1611", errMsg);
          break;
        } else {
          throw new Error(errMsg);
        }
      }
    }
    this.state.top = true;
    return tokens;
  }
  inline(src, tokens) {
    this.inlineQueue.push({ src, tokens });
  }
  /**
   * Lexing/Compiling
   */
  inlineTokens(src, tokens = []) {
    let token, lastToken, cutSrc;
    let maskedSrc = src;
    let match;
    let keepPrevChar, prevChar;
    if (this.tokens.links) {
      const links = Object.keys(this.tokens.links);
      if (links.length > 0) {
        while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
          if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
            maskedSrc = maskedSrc.slice(0, match.index) + "[" + repeatString("a", match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
          }
        }
      }
    }
    while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
      maskedSrc = maskedSrc.slice(0, match.index) + "[" + repeatString("a", match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    }
    while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {
      maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);
    }
    while (src) {
      if (!keepPrevChar) {
        prevChar = "";
      }
      keepPrevChar = false;
      if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((extTokenizer) => {
        if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
          src = src.substring(token.raw.length);
          tokens.push(token);
          return true;
        }
        return false;
      })) {
        continue;
      }
      if (token = this.tokenizer.escape(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.tag(src)) {
        src = src.substring(token.raw.length);
        lastToken = tokens[tokens.length - 1];
        if (lastToken && token.type === "text" && lastToken.type === "text") {
          lastToken.raw += token.raw;
          lastToken.text += token.text;
        } else {
          tokens.push(token);
        }
        continue;
      }
      if (token = this.tokenizer.link(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.reflink(src, this.tokens.links)) {
        src = src.substring(token.raw.length);
        lastToken = tokens[tokens.length - 1];
        if (lastToken && token.type === "text" && lastToken.type === "text") {
          lastToken.raw += token.raw;
          lastToken.text += token.text;
        } else {
          tokens.push(token);
        }
        continue;
      }
      if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.codespan(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.br(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.del(src)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (token = this.tokenizer.autolink(src, mangle)) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
        src = src.substring(token.raw.length);
        tokens.push(token);
        continue;
      }
      cutSrc = src;
      if (this.options.extensions && this.options.extensions.startInline) {
        let startIndex = Infinity;
        const tempSrc = src.slice(1);
        let tempStart;
        this.options.extensions.startInline.forEach(function(getStartIndex) {
          tempStart = getStartIndex.call({ lexer: this }, tempSrc);
          if (typeof tempStart === "number" && tempStart >= 0) {
            startIndex = Math.min(startIndex, tempStart);
          }
        });
        if (startIndex < Infinity && startIndex >= 0) {
          cutSrc = src.substring(0, startIndex + 1);
        }
      }
      if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
        src = src.substring(token.raw.length);
        if (token.raw.slice(-1) !== "_") {
          prevChar = token.raw.slice(-1);
        }
        keepPrevChar = true;
        lastToken = tokens[tokens.length - 1];
        if (lastToken && lastToken.type === "text") {
          lastToken.raw += token.raw;
          lastToken.text += token.text;
        } else {
          tokens.push(token);
        }
        continue;
      }
      if (src) {
        const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
        if (this.options.silent) {
          index.__f__("error", "at node_modules/marked/lib/marked.esm.js:1795", errMsg);
          break;
        } else {
          throw new Error(errMsg);
        }
      }
    }
    return tokens;
  }
}
class Renderer {
  constructor(options) {
    this.options = options || defaults;
  }
  code(code, infostring, escaped) {
    const lang = (infostring || "").match(/\S*/)[0];
    if (this.options.highlight) {
      const out = this.options.highlight(code, lang);
      if (out != null && out !== code) {
        escaped = true;
        code = out;
      }
    }
    code = code.replace(/\n$/, "") + "\n";
    if (!lang) {
      return "<pre><code>" + (escaped ? code : escape$1(code, true)) + "</code></pre>\n";
    }
    return '<pre><code class="' + this.options.langPrefix + escape$1(lang, true) + '">' + (escaped ? code : escape$1(code, true)) + "</code></pre>\n";
  }
  blockquote(quote) {
    return "<blockquote>\n" + quote + "</blockquote>\n";
  }
  html(html) {
    return html;
  }
  heading(text, level, raw, slugger) {
    if (this.options.headerIds) {
      return "<h" + level + ' id="' + this.options.headerPrefix + slugger.slug(raw) + '">' + text + "</h" + level + ">\n";
    }
    return "<h" + level + ">" + text + "</h" + level + ">\n";
  }
  hr() {
    return this.options.xhtml ? "<hr/>\n" : "<hr>\n";
  }
  list(body, ordered, start) {
    const type = ordered ? "ol" : "ul", startatt = ordered && start !== 1 ? ' start="' + start + '"' : "";
    return "<" + type + startatt + ">\n" + body + "</" + type + ">\n";
  }
  listitem(text) {
    return "<li>" + text + "</li>\n";
  }
  checkbox(checked) {
    return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
  }
  paragraph(text) {
    return "<p>" + text + "</p>\n";
  }
  table(header, body) {
    if (body)
      body = "<tbody>" + body + "</tbody>";
    return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
  }
  tablerow(content) {
    return "<tr>\n" + content + "</tr>\n";
  }
  tablecell(content, flags) {
    const type = flags.header ? "th" : "td";
    const tag = flags.align ? "<" + type + ' align="' + flags.align + '">' : "<" + type + ">";
    return tag + content + "</" + type + ">\n";
  }
  // span level renderer
  strong(text) {
    return "<strong>" + text + "</strong>";
  }
  em(text) {
    return "<em>" + text + "</em>";
  }
  codespan(text) {
    return "<code>" + text + "</code>";
  }
  br() {
    return this.options.xhtml ? "<br/>" : "<br>";
  }
  del(text) {
    return "<del>" + text + "</del>";
  }
  link(href, title, text) {
    href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
    if (href === null) {
      return text;
    }
    let out = '<a href="' + escape$1(href) + '"';
    if (title) {
      out += ' title="' + title + '"';
    }
    out += ">" + text + "</a>";
    return out;
  }
  image(href, title, text) {
    href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
    if (href === null) {
      return text;
    }
    let out = '<img src="' + href + '" alt="' + text + '"';
    if (title) {
      out += ' title="' + title + '"';
    }
    out += this.options.xhtml ? "/>" : ">";
    return out;
  }
  text(text) {
    return text;
  }
}
class TextRenderer {
  // no need for block level renderers
  strong(text) {
    return text;
  }
  em(text) {
    return text;
  }
  codespan(text) {
    return text;
  }
  del(text) {
    return text;
  }
  html(text) {
    return text;
  }
  text(text) {
    return text;
  }
  link(href, title, text) {
    return "" + text;
  }
  image(href, title, text) {
    return "" + text;
  }
  br() {
    return "";
  }
}
class Slugger {
  constructor() {
    this.seen = {};
  }
  serialize(value) {
    return value.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
  }
  /**
   * Finds the next safe (unique) slug to use
   */
  getNextSafeSlug(originalSlug, isDryRun) {
    let slug = originalSlug;
    let occurenceAccumulator = 0;
    if (this.seen.hasOwnProperty(slug)) {
      occurenceAccumulator = this.seen[originalSlug];
      do {
        occurenceAccumulator++;
        slug = originalSlug + "-" + occurenceAccumulator;
      } while (this.seen.hasOwnProperty(slug));
    }
    if (!isDryRun) {
      this.seen[originalSlug] = occurenceAccumulator;
      this.seen[slug] = 0;
    }
    return slug;
  }
  /**
   * Convert string to unique id
   * @param {object} options
   * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.
   */
  slug(value, options = {}) {
    const slug = this.serialize(value);
    return this.getNextSafeSlug(slug, options.dryrun);
  }
}
class Parser {
  constructor(options) {
    this.options = options || defaults;
    this.options.renderer = this.options.renderer || new Renderer();
    this.renderer = this.options.renderer;
    this.renderer.options = this.options;
    this.textRenderer = new TextRenderer();
    this.slugger = new Slugger();
  }
  /**
   * Static Parse Method
   */
  static parse(tokens, options) {
    const parser = new Parser(options);
    return parser.parse(tokens);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(tokens, options) {
    const parser = new Parser(options);
    return parser.parseInline(tokens);
  }
  /**
   * Parse Loop
   */
  parse(tokens, top = true) {
    let out = "", i3, j2, k2, l2, l3, row, cell, header, body, token, ordered, start, loose, itemBody, item, checked, task, checkbox, ret;
    const l4 = tokens.length;
    for (i3 = 0; i3 < l4; i3++) {
      token = tokens[i3];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
        ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
        if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(token.type)) {
          out += ret || "";
          continue;
        }
      }
      switch (token.type) {
        case "space": {
          continue;
        }
        case "hr": {
          out += this.renderer.hr();
          continue;
        }
        case "heading": {
          out += this.renderer.heading(
            this.parseInline(token.tokens),
            token.depth,
            unescape$1(this.parseInline(token.tokens, this.textRenderer)),
            this.slugger
          );
          continue;
        }
        case "code": {
          out += this.renderer.code(
            token.text,
            token.lang,
            token.escaped
          );
          continue;
        }
        case "table": {
          header = "";
          cell = "";
          l2 = token.header.length;
          for (j2 = 0; j2 < l2; j2++) {
            cell += this.renderer.tablecell(
              this.parseInline(token.header[j2].tokens),
              { header: true, align: token.align[j2] }
            );
          }
          header += this.renderer.tablerow(cell);
          body = "";
          l2 = token.rows.length;
          for (j2 = 0; j2 < l2; j2++) {
            row = token.rows[j2];
            cell = "";
            l3 = row.length;
            for (k2 = 0; k2 < l3; k2++) {
              cell += this.renderer.tablecell(
                this.parseInline(row[k2].tokens),
                { header: false, align: token.align[k2] }
              );
            }
            body += this.renderer.tablerow(cell);
          }
          out += this.renderer.table(header, body);
          continue;
        }
        case "blockquote": {
          body = this.parse(token.tokens);
          out += this.renderer.blockquote(body);
          continue;
        }
        case "list": {
          ordered = token.ordered;
          start = token.start;
          loose = token.loose;
          l2 = token.items.length;
          body = "";
          for (j2 = 0; j2 < l2; j2++) {
            item = token.items[j2];
            checked = item.checked;
            task = item.task;
            itemBody = "";
            if (item.task) {
              checkbox = this.renderer.checkbox(checked);
              if (loose) {
                if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") {
                  item.tokens[0].text = checkbox + " " + item.tokens[0].text;
                  if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
                    item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text;
                  }
                } else {
                  item.tokens.unshift({
                    type: "text",
                    text: checkbox
                  });
                }
              } else {
                itemBody += checkbox;
              }
            }
            itemBody += this.parse(item.tokens, loose);
            body += this.renderer.listitem(itemBody, task, checked);
          }
          out += this.renderer.list(body, ordered, start);
          continue;
        }
        case "html": {
          out += this.renderer.html(token.text);
          continue;
        }
        case "paragraph": {
          out += this.renderer.paragraph(this.parseInline(token.tokens));
          continue;
        }
        case "text": {
          body = token.tokens ? this.parseInline(token.tokens) : token.text;
          while (i3 + 1 < l4 && tokens[i3 + 1].type === "text") {
            token = tokens[++i3];
            body += "\n" + (token.tokens ? this.parseInline(token.tokens) : token.text);
          }
          out += top ? this.renderer.paragraph(body) : body;
          continue;
        }
        default: {
          const errMsg = 'Token with "' + token.type + '" type was not found.';
          if (this.options.silent) {
            index.__f__("error", "at node_modules/marked/lib/marked.esm.js:2249", errMsg);
            return;
          } else {
            throw new Error(errMsg);
          }
        }
      }
    }
    return out;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(tokens, renderer) {
    renderer = renderer || this.renderer;
    let out = "", i3, token, ret;
    const l2 = tokens.length;
    for (i3 = 0; i3 < l2; i3++) {
      token = tokens[i3];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
        ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
        if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(token.type)) {
          out += ret || "";
          continue;
        }
      }
      switch (token.type) {
        case "escape": {
          out += renderer.text(token.text);
          break;
        }
        case "html": {
          out += renderer.html(token.text);
          break;
        }
        case "link": {
          out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
          break;
        }
        case "image": {
          out += renderer.image(token.href, token.title, token.text);
          break;
        }
        case "strong": {
          out += renderer.strong(this.parseInline(token.tokens, renderer));
          break;
        }
        case "em": {
          out += renderer.em(this.parseInline(token.tokens, renderer));
          break;
        }
        case "codespan": {
          out += renderer.codespan(token.text);
          break;
        }
        case "br": {
          out += renderer.br();
          break;
        }
        case "del": {
          out += renderer.del(this.parseInline(token.tokens, renderer));
          break;
        }
        case "text": {
          out += renderer.text(token.text);
          break;
        }
        default: {
          const errMsg = 'Token with "' + token.type + '" type was not found.';
          if (this.options.silent) {
            index.__f__("error", "at node_modules/marked/lib/marked.esm.js:2328", errMsg);
            return;
          } else {
            throw new Error(errMsg);
          }
        }
      }
    }
    return out;
  }
}
function marked(src, opt, callback) {
  if (typeof src === "undefined" || src === null) {
    throw new Error("marked(): input parameter is undefined or null");
  }
  if (typeof src !== "string") {
    throw new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected");
  }
  if (typeof opt === "function") {
    callback = opt;
    opt = null;
  }
  opt = merge({}, marked.defaults, opt || {});
  checkSanitizeDeprecation(opt);
  if (callback) {
    const highlight = opt.highlight;
    let tokens;
    try {
      tokens = Lexer.lex(src, opt);
    } catch (e2) {
      return callback(e2);
    }
    const done = function(err) {
      let out;
      if (!err) {
        try {
          if (opt.walkTokens) {
            marked.walkTokens(tokens, opt.walkTokens);
          }
          out = Parser.parse(tokens, opt);
        } catch (e2) {
          err = e2;
        }
      }
      opt.highlight = highlight;
      return err ? callback(err) : callback(null, out);
    };
    if (!highlight || highlight.length < 3) {
      return done();
    }
    delete opt.highlight;
    if (!tokens.length)
      return done();
    let pending = 0;
    marked.walkTokens(tokens, function(token) {
      if (token.type === "code") {
        pending++;
        setTimeout(() => {
          highlight(token.text, token.lang, function(err, code) {
            if (err) {
              return done(err);
            }
            if (code != null && code !== token.text) {
              token.text = code;
              token.escaped = true;
            }
            pending--;
            if (pending === 0) {
              done();
            }
          });
        }, 0);
      }
    });
    if (pending === 0) {
      done();
    }
    return;
  }
  try {
    const tokens = Lexer.lex(src, opt);
    if (opt.walkTokens) {
      marked.walkTokens(tokens, opt.walkTokens);
    }
    return Parser.parse(tokens, opt);
  } catch (e2) {
    e2.message += "\nPlease report this to https://github.com/markedjs/marked.";
    if (opt.silent) {
      return "<p>An error occurred:</p><pre>" + escape$1(e2.message + "", true) + "</pre>";
    }
    throw e2;
  }
}
marked.options = marked.setOptions = function(opt) {
  merge(marked.defaults, opt);
  changeDefaults(marked.defaults);
  return marked;
};
marked.getDefaults = getDefaults;
marked.defaults = defaults;
marked.use = function(...args) {
  const opts = merge({}, ...args);
  const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };
  let hasExtensions;
  args.forEach((pack) => {
    if (pack.extensions) {
      hasExtensions = true;
      pack.extensions.forEach((ext) => {
        if (!ext.name) {
          throw new Error("extension name required");
        }
        if (ext.renderer) {
          const prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;
          if (prevRenderer) {
            extensions.renderers[ext.name] = function(...args2) {
              let ret = ext.renderer.apply(this, args2);
              if (ret === false) {
                ret = prevRenderer.apply(this, args2);
              }
              return ret;
            };
          } else {
            extensions.renderers[ext.name] = ext.renderer;
          }
        }
        if (ext.tokenizer) {
          if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
            throw new Error("extension level must be 'block' or 'inline'");
          }
          if (extensions[ext.level]) {
            extensions[ext.level].unshift(ext.tokenizer);
          } else {
            extensions[ext.level] = [ext.tokenizer];
          }
          if (ext.start) {
            if (ext.level === "block") {
              if (extensions.startBlock) {
                extensions.startBlock.push(ext.start);
              } else {
                extensions.startBlock = [ext.start];
              }
            } else if (ext.level === "inline") {
              if (extensions.startInline) {
                extensions.startInline.push(ext.start);
              } else {
                extensions.startInline = [ext.start];
              }
            }
          }
        }
        if (ext.childTokens) {
          extensions.childTokens[ext.name] = ext.childTokens;
        }
      });
    }
    if (pack.renderer) {
      const renderer = marked.defaults.renderer || new Renderer();
      for (const prop in pack.renderer) {
        const prevRenderer = renderer[prop];
        renderer[prop] = (...args2) => {
          let ret = pack.renderer[prop].apply(renderer, args2);
          if (ret === false) {
            ret = prevRenderer.apply(renderer, args2);
          }
          return ret;
        };
      }
      opts.renderer = renderer;
    }
    if (pack.tokenizer) {
      const tokenizer = marked.defaults.tokenizer || new Tokenizer();
      for (const prop in pack.tokenizer) {
        const prevTokenizer = tokenizer[prop];
        tokenizer[prop] = (...args2) => {
          let ret = pack.tokenizer[prop].apply(tokenizer, args2);
          if (ret === false) {
            ret = prevTokenizer.apply(tokenizer, args2);
          }
          return ret;
        };
      }
      opts.tokenizer = tokenizer;
    }
    if (pack.walkTokens) {
      const walkTokens = marked.defaults.walkTokens;
      opts.walkTokens = function(token) {
        pack.walkTokens.call(this, token);
        if (walkTokens) {
          walkTokens.call(this, token);
        }
      };
    }
    if (hasExtensions) {
      opts.extensions = extensions;
    }
    marked.setOptions(opts);
  });
};
marked.walkTokens = function(tokens, callback) {
  for (const token of tokens) {
    callback.call(marked, token);
    switch (token.type) {
      case "table": {
        for (const cell of token.header) {
          marked.walkTokens(cell.tokens, callback);
        }
        for (const row of token.rows) {
          for (const cell of row) {
            marked.walkTokens(cell.tokens, callback);
          }
        }
        break;
      }
      case "list": {
        marked.walkTokens(token.items, callback);
        break;
      }
      default: {
        if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) {
          marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {
            marked.walkTokens(token[childTokens], callback);
          });
        } else if (token.tokens) {
          marked.walkTokens(token.tokens, callback);
        }
      }
    }
  }
};
marked.parseInline = function(src, opt) {
  if (typeof src === "undefined" || src === null) {
    throw new Error("marked.parseInline(): input parameter is undefined or null");
  }
  if (typeof src !== "string") {
    throw new Error("marked.parseInline(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected");
  }
  opt = merge({}, marked.defaults, opt || {});
  checkSanitizeDeprecation(opt);
  try {
    const tokens = Lexer.lexInline(src, opt);
    if (opt.walkTokens) {
      marked.walkTokens(tokens, opt.walkTokens);
    }
    return Parser.parseInline(tokens, opt);
  } catch (e2) {
    e2.message += "\nPlease report this to https://github.com/markedjs/marked.";
    if (opt.silent) {
      return "<p>An error occurred:</p><pre>" + escape$1(e2.message + "", true) + "</pre>";
    }
    throw e2;
  }
};
marked.Parser = Parser;
marked.parser = Parser.parse;
marked.Renderer = Renderer;
marked.TextRenderer = TextRenderer;
marked.Lexer = Lexer;
marked.lexer = Lexer.lex;
marked.Tokenizer = Tokenizer;
marked.Slugger = Slugger;
marked.parse = marked;
marked.options;
marked.setOptions;
marked.use;
marked.walkTokens;
marked.parseInline;
Parser.parse;
Lexer.lex;
exports.A = A$2;
exports.A$1 = A;
exports.COS = COS;
exports.E = E$2;
exports.EMPTY_OBJ = EMPTY_OBJ$1;
exports.EffectScope = EffectScope$1;
exports.Fragment = Fragment;
exports.Jt = Jt;
exports.O = O;
exports.P = P;
exports.Qt = Qt;
exports.R = R$1;
exports.ReactiveEffect = ReactiveEffect;
exports.T = T;
exports.Text = Text;
exports.VueApi = VueApi;
exports.Wt = Wt;
exports.Xt = Xt;
exports.Zt = Zt;
exports._Vue = _Vue;
exports._export_sfc = _export_sfc;
exports.c = c$3;
exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
exports.callWithErrorHandling = callWithErrorHandling;
exports.camelize = camelize;
exports.computed = computed$2;
exports.createApp = createApp$2;
exports.createPropsRestProxy = createPropsRestProxy;
exports.createSSRApp = createSSRApp;
exports.createVNode = createVNode;
exports.createVueApp = createVueApp;
exports.customRef = customRef$1;
exports.d = d$2;
exports.dayjs = dayjs;
exports.dayjs_minExports = dayjs_minExports;
exports.defineAsyncComponent = defineAsyncComponent$1;
exports.defineComponent = defineComponent$1;
exports.defineEmits = defineEmits;
exports.defineExpose = defineExpose;
exports.defineProps = defineProps;
exports.devtoolsComponentAdded = devtoolsComponentAdded;
exports.devtoolsComponentRemoved = devtoolsComponentRemoved;
exports.devtoolsComponentUpdated = devtoolsComponentUpdated;
exports.diff = diff;
exports.e = e$2;
exports.effect = effect;
exports.effectScope = effectScope$1;
exports.es = es;
exports.f = f$2;
exports.f$1 = f;
exports.findComponentPropsData = findComponentPropsData;
exports.g = g;
exports.gei = gei;
exports.getCurrentInstance = getCurrentInstance$1;
exports.getCurrentScope = getCurrentScope$1;
exports.getExposeProxy = getExposeProxy;
exports.guardReactiveProps = guardReactiveProps;
exports.h = h$3;
exports.hasInjectionContext = hasInjectionContext;
exports.hasQueueJob = hasQueueJob;
exports.i = i2;
exports.index = index;
exports.inject = inject$1;
exports.injectHook = injectHook;
exports.invalidateJob = invalidateJob;
exports.isProxy = isProxy;
exports.isReactive = isReactive$1;
exports.isReadonly = isReadonly$1;
exports.isRef = isRef$1;
exports.isSameOrAfter = isSameOrAfter;
exports.isSameOrBefore = isSameOrBefore;
exports.isShallow = isShallow;
exports.j = j$2;
exports.k = k;
exports.localeData = localeData;
exports.logError = logError$1;
exports.m = m$2;
exports.markRaw = markRaw$1;
exports.marked = marked;
exports.mergeDefaults = mergeDefaults;
exports.mergeModels = mergeModels;
exports.mergeProps = mergeProps;
exports.n = n$2;
exports.nextTick$1 = nextTick$1;
exports.normalizeClass = normalizeClass;
exports.normalizeProps = normalizeProps;
exports.normalizeStyle = normalizeStyle;
exports.o$1 = o$2;
exports.onActivated = onActivated$1;
exports.onBeforeMount = onBeforeMount$1;
exports.onBeforeUnmount = onBeforeUnmount$1;
exports.onBeforeUpdate = onBeforeUpdate$1;
exports.onDeactivated = onDeactivated$1;
exports.onErrorCaptured = onErrorCaptured$1;
exports.onHide = onHide;
exports.onLoad = onLoad;
exports.onMounted = onMounted$1;
exports.onReady = onReady;
exports.onRenderTracked = onRenderTracked;
exports.onRenderTriggered = onRenderTriggered;
exports.onScopeDispose = onScopeDispose$1;
exports.onServerPrefetch = onServerPrefetch$1;
exports.onUnload = onUnload;
exports.onUnmounted = onUnmounted$1;
exports.onUpdated = onUpdated$1;
exports.p = p$3;
exports.patch = patch;
exports.provide = provide$1;
exports.proxyRefs = proxyRefs$1;
exports.pruneComponentPropsCache = pruneComponentPropsCache;
exports.qt = qt;
exports.queuePostFlushCb = queuePostFlushCb;
exports.r = r$3;
exports.reactive = reactive$1;
exports.readonly = readonly$1;
exports.ref = ref$1;
exports.resolveComponent = resolveComponent;
exports.resolveDirective = resolveDirective;
exports.resolveFilter = resolveFilter;
exports.s = s$3;
exports.setCurrentRenderingInstance = setCurrentRenderingInstance;
exports.setTemplateRef = setTemplateRef;
exports.setupDevtoolsPlugin = setupDevtoolsPlugin;
exports.shallowReactive = shallowReactive$1;
exports.shallowReadonly = shallowReadonly$1;
exports.shallowRef = shallowRef$1;
exports.sr = sr;
exports.ss = ss;
exports.stop = stop;
exports.t = t$2;
exports.toDisplayString = toDisplayString;
exports.toHandlerKey = toHandlerKey;
exports.toHandlers = toHandlers;
exports.toRaw = toRaw$1;
exports.toRef = toRef$1;
exports.toRefs = toRefs$1;
exports.toValue = toValue;
exports.triggerRef = triggerRef$1;
exports.ts = ts;
exports.unref = unref$1;
exports.updateProps = updateProps;
exports.useAttrs = useAttrs$1;
exports.useCssModule = useCssModule$1;
exports.useCssVars = useCssVars;
exports.useModel = useModel;
exports.useSSRContext = useSSRContext;
exports.useSlots = useSlots$1;
exports.v = v2;
exports.version = version$1;
exports.w = w$2;
exports.warn = warn$3;
exports.watch = watch$1;
exports.watchEffect = watchEffect$1;
exports.watchPostEffect = watchPostEffect$1;
exports.watchSyncEffect = watchSyncEffect$1;
exports.withAsyncContext = withAsyncContext;
exports.withCtx = withCtx;
exports.withDefaults = withDefaults;
exports.withDirectives = withDirectives;
exports.withModifiers = withModifiers;
exports.withScopeId = withScopeId;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
