/*! For license information please see uga-cdp-jssdk.window.js.LICENSE.txt */
!(function () {
  var e = {
      970: function (e, t, n) {
        var r, o;
        !(function () {
          'use strict';
          (r = function () {
            var e = function () {},
              t = 'undefined',
              n =
                typeof window !== t &&
                typeof window.navigator !== t &&
                /Trident\/|MSIE /.test(window.navigator.userAgent),
              r = ['trace', 'debug', 'info', 'warn', 'error'],
              o = {},
              i = null;
            function a(e, t) {
              var n = e[t];
              if ('function' == typeof n.bind) return n.bind(e);
              try {
                return Function.prototype.bind.call(n, e);
              } catch (t) {
                return function () {
                  return Function.prototype.apply.apply(n, [e, arguments]);
                };
              }
            }
            function s() {
              console.log &&
                (console.log.apply
                  ? console.log.apply(console, arguments)
                  : Function.prototype.apply.apply(console.log, [
                      console,
                      arguments
                    ])),
                console.trace && console.trace();
            }
            function u(r) {
              return (
                'debug' === r && (r = 'log'),
                typeof console !== t &&
                  ('trace' === r && n
                    ? s
                    : void 0 !== console[r]
                    ? a(console, r)
                    : void 0 !== console.log
                    ? a(console, 'log')
                    : e)
              );
            }
            function c() {
              for (var n = this.getLevel(), o = 0; o < r.length; o++) {
                var i = r[o];
                this[i] = o < n ? e : this.methodFactory(i, n, this.name);
              }
              if (
                ((this.log = this.debug),
                typeof console === t && n < this.levels.SILENT)
              )
                return 'No console available for logging';
            }
            function l(e) {
              return function () {
                typeof console !== t &&
                  (c.call(this), this[e].apply(this, arguments));
              };
            }
            function h(e, t, n) {
              return u(e) || l.apply(this, arguments);
            }
            function p(e, n) {
              var a,
                s,
                u,
                l = this,
                p = 'loglevel';
              function f(e) {
                var n = (r[e] || 'silent').toUpperCase();
                if (typeof window !== t && p) {
                  try {
                    return void (window.localStorage[p] = n);
                  } catch (e) {}
                  try {
                    window.document.cookie =
                      encodeURIComponent(p) + '=' + n + ';';
                  } catch (e) {}
                }
              }
              function d() {
                var e;
                if (typeof window !== t && p) {
                  try {
                    e = window.localStorage[p];
                  } catch (e) {}
                  if (typeof e === t)
                    try {
                      var n = window.document.cookie,
                        r = encodeURIComponent(p),
                        o = n.indexOf(r + '=');
                      -1 !== o &&
                        (e = /^([^;]+)/.exec(n.slice(o + r.length + 1))[1]);
                    } catch (e) {}
                  return void 0 === l.levels[e] && (e = void 0), e;
                }
              }
              function g() {
                if (typeof window !== t && p) {
                  try {
                    window.localStorage.removeItem(p);
                  } catch (e) {}
                  try {
                    window.document.cookie =
                      encodeURIComponent(p) +
                      '=; expires=Thu, 01 Jan 1970 00:00:00 UTC';
                  } catch (e) {}
                }
              }
              function m(e) {
                var t = e;
                if (
                  ('string' == typeof t &&
                    void 0 !== l.levels[t.toUpperCase()] &&
                    (t = l.levels[t.toUpperCase()]),
                  'number' == typeof t && t >= 0 && t <= l.levels.SILENT)
                )
                  return t;
                throw new TypeError(
                  'log.setLevel() called with invalid level: ' + e
                );
              }
              'string' == typeof e
                ? (p += ':' + e)
                : 'symbol' == typeof e && (p = void 0),
                (l.name = e),
                (l.levels = {
                  TRACE: 0,
                  DEBUG: 1,
                  INFO: 2,
                  WARN: 3,
                  ERROR: 4,
                  SILENT: 5
                }),
                (l.methodFactory = n || h),
                (l.getLevel = function () {
                  return null != u ? u : null != s ? s : a;
                }),
                (l.setLevel = function (e, t) {
                  return (u = m(e)), !1 !== t && f(u), c.call(l);
                }),
                (l.setDefaultLevel = function (e) {
                  (s = m(e)), d() || l.setLevel(e, !1);
                }),
                (l.resetLevel = function () {
                  (u = null), g(), c.call(l);
                }),
                (l.enableAll = function (e) {
                  l.setLevel(l.levels.TRACE, e);
                }),
                (l.disableAll = function (e) {
                  l.setLevel(l.levels.SILENT, e);
                }),
                (l.rebuild = function () {
                  if ((i !== l && (a = m(i.getLevel())), c.call(l), i === l))
                    for (var e in o) o[e].rebuild();
                }),
                (a = m(i ? i.getLevel() : 'WARN'));
              var v = d();
              null != v && (u = m(v)), c.call(l);
            }
            (i = new p()).getLogger = function (e) {
              if (('symbol' != typeof e && 'string' != typeof e) || '' === e)
                throw new TypeError(
                  'You must supply a name when creating a logger.'
                );
              var t = o[e];
              return t || (t = o[e] = new p(e, i.methodFactory)), t;
            };
            var f = typeof window !== t ? window.log : void 0;
            return (
              (i.noConflict = function () {
                return (
                  typeof window !== t && window.log === i && (window.log = f), i
                );
              }),
              (i.getLoggers = function () {
                return o;
              }),
              (i.default = i),
              i
            );
          }),
            void 0 === (o = 'function' == typeof r ? r.call(t, n, t, e) : r) ||
              (e.exports = o);
        })();
      }
    },
    t = {};
  function n(r) {
    var o = t[r];
    if (void 0 !== o) return o.exports;
    var i = (t[r] = { exports: {} });
    return e[r].call(i.exports, i, i.exports, n), i.exports;
  }
  (n.n = function (e) {
    var t =
      e && e.__esModule
        ? function () {
            return e.default;
          }
        : function () {
            return e;
          };
    return n.d(t, { a: t }), t;
  }),
    (n.d = function (e, t) {
      for (var r in t)
        n.o(t, r) &&
          !n.o(e, r) &&
          Object.defineProperty(e, r, { enumerable: !0, get: t[r] });
    }),
    (n.o = function (e, t) {
      return Object.prototype.hasOwnProperty.call(e, t);
    }),
    (n.r = function (e) {
      'undefined' != typeof Symbol &&
        Symbol.toStringTag &&
        Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
        Object.defineProperty(e, '__esModule', { value: !0 });
    });
  var r = {};
  !(function () {
    'use strict';
    n.d(r, {
      default: function () {
        return Ar;
      }
    });
    var e = {};
    n.r(e),
      n.d(e, {
        addCollectAttrs: function () {
          return Dn;
        },
        addCollectClasses: function () {
          return On;
        },
        addCollectTags: function () {
          return $n;
        },
        getAAID: function () {
          return kr;
        },
        getPlugin: function () {
          return $r;
        },
        initOptions: function () {
          return fr;
        },
        initSDK: function () {
          return pr;
        },
        installAdpater: function () {
          return Or;
        },
        installPlugin: function () {
          return Ir;
        },
        onEvent: function () {
          return gr;
        },
        push: function () {
          return sr;
        },
        registerCommonProp: function () {
          return ur;
        },
        sendClickData: function () {
          return Gn;
        },
        sendData: function () {
          return dr;
        },
        sendPageClose: function () {
          return Xn;
        },
        sendPageEnd: function () {
          return ar;
        },
        sendPageInfo: function () {
          return Bn;
        },
        sendPageStart: function () {
          return ir;
        },
        setAppId: function () {
          return Mn;
        },
        setAutoReportPageEnd: function () {
          return or;
        },
        setAutoReportPageStart: function () {
          return rr;
        },
        setAutoTrack: function () {
          return kn;
        },
        setAutoTrackOption: function () {
          return Pn;
        },
        setBaseinfotypeSwitch: function () {
          return Wn;
        },
        setCXX: function () {
          return zn;
        },
        setClickDebounceTime: function () {
          return Tr;
        },
        setCommonProp: function () {
          return Er;
        },
        setCookieEnable: function () {
          return An;
        },
        setCustomUrlParams: function () {
          return nr;
        },
        setDebugMode: function () {
          return tr;
        },
        setDefaultPageData: function () {
          return Yn;
        },
        setDomainId: function () {
          return xn;
        },
        setHttpHeader: function () {
          return Jn;
        },
        setIdsite: function () {
          return Hn;
        },
        setIsUseAuth: function () {
          return mr;
        },
        setIsUseCookie: function () {
          return er;
        },
        setIsUseDebugMode: function () {
          return wr;
        },
        setIsUseEncrypt: function () {
          return vr;
        },
        setIsUseUrl: function () {
          return Zn;
        },
        setLogLevel: function () {
          return Pr;
        },
        setMobile: function () {
          return Sr;
        },
        setOnReportUrl: function () {
          return Un;
        },
        setOptions: function () {
          return hr;
        },
        setPageData: function () {
          return Nn;
        },
        setReportDelay: function () {
          return Dr;
        },
        setReportEnable: function () {
          return yr;
        },
        setReportServer: function () {
          return jn;
        },
        setSessionDuration: function () {
          return br;
        },
        setSessionMode: function () {
          return Lr;
        },
        setSessionTimeoutDuration: function () {
          return Vn;
        },
        setSourceTypeOption: function () {
          return In;
        },
        setStorageConfig: function () {
          return Ln;
        },
        setTechStack: function () {
          return Cn;
        },
        setTitle: function () {
          return qn;
        },
        setUid: function () {
          return En;
        },
        setUserAccount: function () {
          return Qn;
        },
        setUserIdentity: function () {
          return Fn;
        },
        setUserProfile: function () {
          return _r;
        },
        setVisibleAsView: function () {
          return Rn;
        },
        setWindowCloseSwitch: function () {
          return Kn;
        },
        version: function () {
          return cr;
        }
      });
    var t,
      o = '2.8.1',
      i = 1e3,
      a = 31536e6,
      s = 'sid',
      u = 'aaid',
      c = 'open_id',
      l = 'union_id',
      h = 'pre_page_url',
      p = 'pre_page_title',
      f = 'fvt',
      d = {},
      g = a,
      m =
        (Number(i),
        [
          'utm_campaign',
          'utm_content',
          'utm_matching_type',
          'utm_medium',
          'utm_source',
          'utm_term'
        ]);
    !(function (e) {
      (e.REQUEST_START = 'requestStart'),
        (e.REQUEST_LOAD = 'requestLoad'),
        (e.REQUEST_ERROR = 'requestError');
    })(t || (t = {}));
    var v = 'Web_Page_Load',
      w = 'Page_View',
      y = 'Web_Stay',
      b = 'Web_Click',
      T = 'Page_View_Leave',
      S = 'webLoad',
      _ = 'webShow',
      E = 'webStay',
      k = 'webClick',
      P = 'webLeave',
      I = 'webChannel',
      $ = 'MP_Click',
      O = 'ugaactiveid';
    function D(e) {
      return {
        '[object Boolean]': 'boolean',
        '[object Number]': 'number',
        '[object String]': 'string',
        '[object Function]': 'function',
        '[object Array]': 'array',
        '[object Date]': 'date',
        '[object RegExp]': 'regExp',
        '[object Undefined]': 'undefined',
        '[object Null]': 'null',
        '[object Object]': 'object'
      }[Object.prototype.toString.call(e)];
    }
    function C(e) {
      return 'function' === D(e);
    }
    function L(e) {
      return 'object' === D(e);
    }
    function R(e) {
      return 'array' === D(e);
    }
    function A(e) {
      return 'number' === D(e);
    }
    function j(e) {
      return 'string' === D(e);
    }
    function U(e) {
      return 'boolean' === D(e);
    }
    function x(e) {
      return null === e;
    }
    function M() {
      M = function (e, t) {
        return new n(e, void 0, t);
      };
      var e = RegExp.prototype,
        t = new WeakMap();
      function n(e, r, o) {
        var i = RegExp(e, r);
        return t.set(i, o || t.get(e)), H(i, n.prototype);
      }
      function r(e, n) {
        var r = t.get(n);
        return Object.keys(r).reduce(function (t, n) {
          var o = r[n];
          if ('number' == typeof o) t[n] = e[o];
          else {
            for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length; ) i++;
            t[n] = e[o[i]];
          }
          return t;
        }, Object.create(null));
      }
      return (
        (function (e, t) {
          if ('function' != typeof t && null !== t)
            throw new TypeError(
              'Super expression must either be null or a function'
            );
          (e.prototype = Object.create(t && t.prototype, {
            constructor: { value: e, writable: !0, configurable: !0 }
          })),
            Object.defineProperty(e, 'prototype', { writable: !1 }),
            t && H(e, t);
        })(n, RegExp),
        (n.prototype.exec = function (t) {
          var n = e.exec.call(this, t);
          if (n) {
            n.groups = r(n, this);
            var o = n.indices;
            o && (o.groups = r(o, this));
          }
          return n;
        }),
        (n.prototype[Symbol.replace] = function (n, o) {
          if ('string' == typeof o) {
            var i = t.get(this);
            return e[Symbol.replace].call(
              this,
              n,
              o.replace(/\$<([^>]+)(>|$)/g, function (e, t, n) {
                if ('' === n) return e;
                var r = i[t];
                return Array.isArray(r)
                  ? '$' + r.join('$')
                  : 'number' == typeof r
                  ? '$' + r
                  : '';
              })
            );
          }
          if ('function' == typeof o) {
            var a = this;
            return e[Symbol.replace].call(this, n, function () {
              var e = arguments;
              return (
                'object' != typeof e[e.length - 1] &&
                  (e = [].slice.call(e)).push(r(e, a)),
                o.apply(this, e)
              );
            });
          }
          return e[Symbol.replace].call(this, n, o);
        }),
        M.apply(this, arguments)
      );
    }
    function H(e, t) {
      return (
        (H = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        H(e, t)
      );
    }
    function q(e, t) {
      return (function (e) {
        var t = [];
        if (0 === e.length) return '';
        if ('string' != typeof e[0])
          throw new TypeError('Url must be a string. Received ' + e[0]);
        e[0].match(/^[^/:]+:\/*$/) && e.length > 1 && (e[0] = e.shift() + e[0]),
          e[0].match(/^file:\/\/\//)
            ? (e[0] = e[0].replace(/^([^/:]+):\/*/, '$1:///'))
            : (e[0] = e[0].replace(/^([^/:]+):\/*/, '$1://'));
        for (var n = 0; n < e.length; n++) {
          var r = e[n];
          if ('string' != typeof r)
            throw new TypeError('Url must be a string. Received ' + r);
          '' !== r &&
            (n > 0 && (r = r.replace(/^[/]+/, '')),
            (r =
              n < e.length - 1
                ? r.replace(/[/]+$/, '')
                : r.replace(/[/]+$/, '/')),
            t.push(r));
        }
        return t.join('/');
      })([e, t]);
    }
    var N,
      V,
      Q,
      F = {
        href: '',
        protocol: '',
        host: '',
        hostname: '',
        port: '',
        pathname: '',
        search: '',
        hash: '',
        hashPath: '',
        hashQuery: '',
        origin: ''
      };
    function W(e) {
      var t,
        n,
        r,
        o,
        i,
        a,
        s,
        u = e.match(
          M(
            /^(https?:)\/\/(([^:/?#]*)(?::([0-9]+))?)([/]?[^?#]*)(\?[^#]*|)(#.*|)$/,
            {
              protocol: 1,
              host: 2,
              hostname: 3,
              port: 4,
              pathname: 5,
              search: 6,
              hash: 7
            }
          )
        ),
        c = (function (e) {
          var t = (e.split('#') || ['', ''])[1];
          if (t) {
            var n = t.split('?');
            return [n[0], n[1]];
          }
          return ['', ''];
        })(e),
        l = c[0],
        h = c[1];
      return u
        ? {
            href: e,
            protocol: null !== (t = u[1]) && void 0 !== t ? t : '',
            host: null !== (n = u[2]) && void 0 !== n ? n : '',
            hostname: null !== (r = u[3]) && void 0 !== r ? r : '',
            port: null !== (o = u[4]) && void 0 !== o ? o : '',
            pathname: null !== (i = u[5]) && void 0 !== i ? i : '',
            search: null !== (a = u[6]) && void 0 !== a ? a : '',
            hash: null !== (s = u[7]) && void 0 !== s ? s : '',
            hashPath: l,
            hashQuery: h,
            origin: u[1] + '//' + u[2]
          }
        : F;
    }
    function K(e) {
      var t = e;
      e.startsWith('http') || (t = q('http://localhost/', e));
      try {
        if ('function' == typeof URL) return new URL(e), W(e);
        var n = W(e);
        return n.host ? n : W(t);
      } catch (e) {
        return W(t);
      }
    }
    function B(e, t) {
      if (!j(e)) throw new Error('originUrl must be string');
      return q(e, t);
    }
    function X(e, t) {
      return e.some(function (e) {
        return t.startsWith(e);
      });
    }
    function G() {
      return (
        (G = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        G.apply(null, arguments)
      );
    }
    function z(e) {
      var t = e.options.serverUrl,
        n = {};
      e.config.useDebugMode && (n.x_hasdk_debug = !0);
      var r = (function (e) {
          if (!L(e)) throw new Error('params must by object');
          return Object.entries(e)
            .map(function (e) {
              var t = e[0],
                n = e[1];
              return A(n) || j(n) || U(n) ? t + '=' + String(n) : '';
            })
            .filter(function (e) {
              return e;
            })
            .join('&');
        })(n),
        o = B(t, '/hianalytics/recommend/datacollection/import/totaldatainfo');
      return r ? o + '?' + r : o;
    }
    function Y(e, t) {
      var n = t.options.serverUrl,
        r = t.platform.network.HTTP.sendByAjax,
        o = B(n, '/Adschannel/api/adsWebClick'),
        i = {};
      return (
        t.plugins.forEach(function (t) {
          if (t.customHeaders) {
            var n = t.customHeaders(e);
            i = G({}, i, n);
          }
        }),
        r(o, JSON.stringify(e), i)
      );
    }
    !(function (e) {
      (e.PATH = 'path'), (e.HASH = 'hash');
    })(N || (N = {})),
      (function (e) {
        (e.PUSH = 'pushState'), (e.REPLACE = 'replaceState');
      })(V || (V = {})),
      (function (e) {
        (e.PUSH = 'pushState'), (e.REPLACE = 'replaceState');
      })(Q || (Q = {}));
    const J = (function () {
      function e() {
        (this.maxLength = 1e3), (this.maxPatchCount = 200), (this.queue = []);
      }
      var t = e.prototype;
      return (
        (t.isEmpty = function () {
          return 0 === this.queue.length;
        }),
        (t.isFull = function () {
          return this.queue.length === this.maxLength;
        }),
        (t.getLength = function () {
          return this.queue.length;
        }),
        (t.enqueue = function (e) {
          return !this.isFull() && (this.queue.push(e), !0);
        }),
        (t.dequeue = function () {
          return !this.isEmpty() && this.queue.shift();
        }),
        (t.patchDequeue = function () {
          if (this.isEmpty()) return [[]];
          var e = this.queue.length,
            t = this.maxPatchCount,
            n = parseInt((e / t).toString()),
            r = e % t,
            o = [];
          if (n >= 1)
            for (var i = 0; i < n; i++) {
              var a = i * t,
                s = (i + 1) * t,
                u = this.queue.slice(a, s);
              o.push(u);
            }
          if (r > 0) {
            var c = n * t,
              l = e,
              h = this.queue.slice(c, l);
            o.push(h);
          }
          return this.clear(), o;
        }),
        (t.clear = function () {
          this.queue.length = 0;
        }),
        e
      );
    })();
    var Z = (function () {
      function e(e) {
        this.$storage = e;
      }
      var t = e.prototype;
      return (
        (t.get = function (e, t) {
          if ((void 0 === t && (t = {}), !e))
            throw new Error('storage get name is empty.');
          var n = this._getFullname(e),
            r = t.domain,
            o = void 0 === r ? '' : r;
          return this.$storage.get(n, { domain: o });
        }),
        (t.set = function (e, t, n) {
          if ((void 0 === n && (n = {}), !e))
            throw new Error('storage set name is empty.');
          var r = this._getFullname(e),
            o = n,
            i = o.expires,
            a = o.domain,
            s = void 0 === a ? '' : a;
          return this.$storage.set(r, t, { expires: i, domain: s });
        }),
        (t.remove = function (e, t) {
          if ((void 0 === t && (t = {}), !e))
            throw new Error('storage get name is empty.');
          var n = this._getFullname(e),
            r = t.domain,
            o = void 0 === r ? '' : r;
          this.$storage.remove(n, { domain: o });
        }),
        (t._getFullname = function (e) {
          return 'koocdp_' + e;
        }),
        e
      );
    })();
    const ee = Z;
    function te() {
      te = function (e, t) {
        return new n(e, void 0, t);
      };
      var e = RegExp.prototype,
        t = new WeakMap();
      function n(e, r, o) {
        var i = RegExp(e, r);
        return t.set(i, o || t.get(e)), ne(i, n.prototype);
      }
      function r(e, n) {
        var r = t.get(n);
        return Object.keys(r).reduce(function (t, n) {
          var o = r[n];
          if ('number' == typeof o) t[n] = e[o];
          else {
            for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length; ) i++;
            t[n] = e[o[i]];
          }
          return t;
        }, Object.create(null));
      }
      return (
        (function (e, t) {
          if ('function' != typeof t && null !== t)
            throw new TypeError(
              'Super expression must either be null or a function'
            );
          (e.prototype = Object.create(t && t.prototype, {
            constructor: { value: e, writable: !0, configurable: !0 }
          })),
            Object.defineProperty(e, 'prototype', { writable: !1 }),
            t && ne(e, t);
        })(n, RegExp),
        (n.prototype.exec = function (t) {
          var n = e.exec.call(this, t);
          if (n) {
            n.groups = r(n, this);
            var o = n.indices;
            o && (o.groups = r(o, this));
          }
          return n;
        }),
        (n.prototype[Symbol.replace] = function (n, o) {
          if ('string' == typeof o) {
            var i = t.get(this);
            return e[Symbol.replace].call(
              this,
              n,
              o.replace(/\$<([^>]+)(>|$)/g, function (e, t, n) {
                if ('' === n) return e;
                var r = i[t];
                return Array.isArray(r)
                  ? '$' + r.join('$')
                  : 'number' == typeof r
                  ? '$' + r
                  : '';
              })
            );
          }
          if ('function' == typeof o) {
            var a = this;
            return e[Symbol.replace].call(this, n, function () {
              var e = arguments;
              return (
                'object' != typeof e[e.length - 1] &&
                  (e = [].slice.call(e)).push(r(e, a)),
                o.apply(this, e)
              );
            });
          }
          return e[Symbol.replace].call(this, n, o);
        }),
        te.apply(this, arguments)
      );
    }
    function ne(e, t) {
      return (
        (ne = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        ne(e, t)
      );
    }
    function re(e) {
      try {
        return JSON.parse(e);
      } catch (e) {
        return !1;
      }
    }
    function oe(e) {
      return (function (e) {
        return e
          .replace(te(/([A-Z])/g, { upper: 1 }), '_$<upper>')
          .toLowerCase();
      })(
        (function (e) {
          return e.charAt(0).toLowerCase() + e.slice(1);
        })(e)
      );
    }
    var ie = (function () {
      function e(e) {
        (this.STORES = {}),
          (this.STORES_KEY = ''),
          (this.STORES_KEY_V0 = 'hw_jssdk'),
          (this.STORES_KEY_V1 = 'koocdp_store'),
          (this.$storage = e),
          this.v1();
      }
      var t = e.prototype;
      return (
        (t.set = function (e, t, n) {
          if (!e) throw new Error('storage set name is empty.');
          return this._setPair(e, t, n);
        }),
        (t.get = function (e) {
          if (!e) throw new Error('storage get name is empty.');
          return this._getValue(e);
        }),
        (t.remove = function (e, t) {
          if (!e) throw new Error('storage remove name is empty.');
          return this._delPair(e);
        }),
        (t.write = function () {
          this.$storage.set(this.STORES_KEY, JSON.stringify(this.STORES));
        }),
        (t.isExist = function (e) {
          return this._check(e);
        }),
        (t.isFresh = function (e) {
          var t = this.STORES[e],
            n = new Date().getTime();
          if (!t) return !1;
          var r = t.writeTs,
            o = t.expires;
          if (o <= 0) return !1;
          var i = (n - r) / o < 0.8;
          return i;
        }),
        (t.getAll = function () {
          return Object.values(this.STORES);
        }),
        (t._delPair = function (e) {
          this.STORES[e] = void 0;
        }),
        (t._checkItem = function (e, t) {
          var n = new Date().getTime();
          return !(e.expiresTs && e.expiresTs <= n) || (this._delPair(t), !1);
        }),
        (t._check = function (e) {
          var t = this.STORES[e];
          return !!t && this._checkItem(t, e);
        }),
        (t._getValue = function (e) {
          var t = this.STORES[e];
          if (t && this._checkItem(t, e)) return t.value;
        }),
        (t._setPair = function (e, t, n) {
          void 0 === n && (n = {});
          var r = n.expires;
          if ((null == r && (r = g), r <= 0)) return this._delPair(e), !1;
          var o = new Date().getTime(),
            i = new Date(o).toLocaleString().replace(/\//g, '-'),
            a = new Date().getTime() + r,
            s = {
              name: e,
              value: t,
              writeTs: o,
              writeDate: i,
              expires: r || 0,
              expiresTs: a,
              expiresDate: new Date(a).toLocaleString().replace(/\//g, '-')
            };
          return (this.STORES[e] = s), !0;
        }),
        (t.getStoreByKey = function (e) {
          try {
            var t = re(this.$storage.get(e));
            return L(t) ? t : null;
          } catch (e) {
            return null;
          }
        }),
        (t.updateVersion = function (e, t) {
          this.STORES_KEY = t;
          var n = this.getStoreByKey(e),
            r = this.getStoreByKey(t),
            o = null != r ? r : n;
          o
            ? ((this.STORES = o), this.write(), this.$storage.remove(e))
            : (this.STORES = {});
        }),
        (t.v1 = function () {
          var e = this.STORES_KEY_V0,
            t = this.STORES_KEY_V1;
          this.updateVersion(e, t);
        }),
        e
      );
    })();
    const ae = ie;
    function se(e) {
      return e < 10 ? '0' + e : '' + e;
    }
    function ue(e) {
      var t = e ? new Date(e) : new Date();
      return (
        se(t.getHours()) + ':' + se(t.getMinutes()) + ':' + se(t.getSeconds())
      );
    }
    var ce = n(970),
      le = n.n(ce),
      he = (function () {
        function e(e) {
          (this.prefix = ''), (this.prefix = e);
        }
        var t = e.prototype;
        return (
          (t.setLevel = function (e) {
            le().setLevel(e);
          }),
          (t.error = function () {
            for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
              t[n] = arguments[n];
            le().error.apply(
              le(),
              [ue(), '[' + this.prefix + '][' + o + '][error]'].concat(t)
            );
          }),
          (t.warn = function () {
            for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
              t[n] = arguments[n];
            le().warn.apply(
              le(),
              [ue(), '[' + this.prefix + '][' + o + '][warn]'].concat(t)
            );
          }),
          (t.info = function () {
            for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
              t[n] = arguments[n];
            le().info.apply(
              le(),
              [ue(), '[' + this.prefix + '][' + o + '][info]'].concat(t)
            );
          }),
          (t.debug = function () {
            for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
              t[n] = arguments[n];
            le().debug.apply(
              le(),
              [ue(), '[' + this.prefix + '][' + o + '][debug]'].concat(t)
            );
          }),
          (t.trace = function () {
            for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
              t[n] = arguments[n];
            le().trace.apply(
              le(),
              [ue(), '[' + this.prefix + '][' + o + '][trace]'].concat(t)
            );
          }),
          e
        );
      })(),
      pe = new he('ugasdk');
    pe.setLevel('warn');
    const fe = pe;
    function de() {
      return (
        (de = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        de.apply(null, arguments)
      );
    }
    function ge(e, t) {
      var n = t.options,
        r = n.appId,
        i = n.domainId,
        a = t.trackInfo,
        s = a.aaid,
        u = a.sid,
        c = a.uid,
        l = t.profile,
        h = (function (e) {
          if (R(e))
            return e.map(function (e) {
              return {
                ot: e.eventTime,
                data: { en: e.eventCode, cd: e.eventData }
              };
            });
          var t = e;
          return [
            { ot: t.eventTime, data: { en: t.eventCode, cd: t.eventData } }
          ];
        })(e);
      return {
        header: { hsv: o, _domainid: i, _appid: r, _encrypt: !1, chifex: '' },
        body: de({ _id: c || s, _uid: c, _aaid: s, _sid: u }, d, {
          user: l,
          data: h
        })
      };
    }
    function me() {
      return window && window.crypto
        ? ((e = new Int32Array(1)), crypto.getRandomValues(e), e[0])
        : Math.floor(-Math.pow(2, 31) + Math.random() * Math.pow(2, 32));
      var e;
    }
    function ve() {
      return window && window.crypto
        ? (function () {
            var e = window.crypto,
              t = new Uint8Array(16);
            return (
              e.getRandomValues(t),
              Array.from(t, function (e) {
                return ('0' + e.toString(16)).substr(-2);
              }).join('')
            );
          })()
        : (function () {
            for (var e = '', t = 0; t < 32; t++)
              e += '0123456789abcdef'[Math.floor(16 * Math.random())];
            return e;
          })();
    }
    function we(e) {
      return !(!j(e) || 32 !== e.length);
    }
    var ye = (function () {
      function e() {}
      return (
        (e.generateAAID = function (e) {
          var t,
            n = e.config.cookieDomain || '',
            r =
              null !== (t = e.$cookieStore.get(u, { domain: n })) &&
              void 0 !== t
                ? t
                : e.$localStore.get(u);
          we(r) || (r = ve()), (e.trackInfo.aaid = r);
        }),
        (e.flushAAID = function (e) {
          var t = 'cookie' === e.config.aaidLocation,
            n = e.config.cookieDomain || '',
            r = e.trackInfo.aaid;
          return (
            !!r &&
            (t
              ? e.config.cookieEnable &&
                e.$cookieStore.set(u, r, { expires: g, domain: n })
              : e.$cookieStore.remove(u),
            e.$localStore.set(u, r, { expires: g }),
            e.$localStore.write(),
            !0)
          );
        }),
        (e.generateSessionID = function (e) {
          var t = e.config.cookieDomain || '',
            n = e.$cookieStore.get(s, { domain: t }) || '';
          e.config.cookieEnable ? we(n) || (n = ve()) : (n = ''),
            (e.trackInfo.sid = n);
        }),
        (e.flushSessionID = function (e) {
          var t = e.config.cookieDomain || '',
            n = e.trackInfo.sid;
          e.config.cookieEnable && n && e.$cookieStore.set(s, n, { domain: t });
        }),
        (e.refreshSession = function (e) {
          var t = e.config.cookieDomain || '',
            n = ve();
          e.config.cookieEnable &&
            (e.$cookieStore.set(s, n, { domain: t }), (e.trackInfo.sid = n));
        }),
        (e.generateOpenId = function (e) {
          var t = e.$localStore.get(c);
          t && (e.trackInfo.openid = t);
        }),
        (e.generateUnionId = function (e) {
          var t = e.$localStore.get(l);
          t && (e.trackInfo.unionid = t);
        }),
        (e.generate = function (e) {
          this.generateAAID(e),
            this.generateSessionID(e),
            this.generateOpenId(e),
            this.generateUnionId(e);
        }),
        (e.flush = function (e) {
          this.flushAAID(e), this.flushSessionID(e);
        }),
        (e.clear = function (e) {
          var t = e.config.cookieDomain || '';
          e.$cookieStore.remove(u, { domain: t }),
            e.$cookieStore.remove(s, { domain: t }),
            e.$cookieStore.remove(c, { domain: t }),
            e.$cookieStore.remove(l, { domain: t });
        }),
        e
      );
    })();
    function be(e, t) {
      return (
        (be = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        be(e, t)
      );
    }
    const Te = (function (e) {
      function t(t) {
        return e.call(this, t) || this;
      }
      var n, r;
      (r = e),
        ((n = t).prototype = Object.create(r.prototype)),
        (n.prototype.constructor = n),
        be(n, r);
      var o = t.prototype;
      return (
        (o.createItem = function () {
          return { url: '', title: '' };
        }),
        (o.enqueue = function (e) {
          var t = this.getRear();
          return (
            !(function (e, t, n) {
              if ((void 0 === n && (n = 'full'), 'full' === n)) return e === t;
              var r = K(e),
                o = K(t);
              return (
                'origin+path' === n &&
                r.origin + r.pathname === o.origin + o.pathname
              );
            })(e.url, t.url) &&
            (this.list.length >= this.maxLength && this.dequeue(),
            this.list.push(e),
            !0)
          );
        }),
        t
      );
    })(
      (function () {
        function e(e) {
          (this.list = []), (this.maxLength = e);
        }
        var t = e.prototype;
        return (
          (t.enqueue = function (e) {
            this.list.length >= this.maxLength && this.dequeue(),
              this.list.push(e);
          }),
          (t.dequeue = function () {
            return this.isEmpty() ? this.createItem() : this.list.shift();
          }),
          (t.isEmpty = function () {
            return 0 === this.list.length;
          }),
          (t.getFront = function () {
            return this.isEmpty() ? this.createItem() : this.list[0];
          }),
          (t.createItem = function () {
            return '';
          }),
          (t.getRear = function () {
            return this.isEmpty()
              ? this.createItem()
              : this.list[this.list.length - 1];
          }),
          (t.getSecond = function () {
            return this.list.length >= 2
              ? this.list[this.list.length - 2]
              : this.createItem();
          }),
          (t.getList = function () {
            return [].concat(this.list);
          }),
          e
        );
      })()
    );
    function Se() {
      return (
        (Se = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        Se.apply(null, arguments)
      );
    }
    var _e = (function () {
      function e() {
        (this.isInited = !1),
          (this.isHeatmap = !1),
          (this.logger = fe),
          (this.options = { serverUrl: '', domainId: '', appId: '' }),
          (this.techStack = { isSpa: !1, history: N.PATH }),
          (this.autoTrack = {
            webLoad: !1,
            webShow: !1,
            webStay: !1,
            webLeave: !1,
            webClick: !1,
            webChannel: !1,
            mpAppLaunch: !1,
            mpAppShow: !1,
            mpAppHide: !1,
            mpPageShow: !1,
            mpPageHide: !1,
            mpClick: !1,
            mpShare: !1,
            mpFavorite: !1,
            mpChannel: !1
          }),
          (this.autoTrackOption = {}),
          (this.config = {
            useAuth: !1,
            useEncrypt: !1,
            useDebugMode: !1,
            cookieEnable: !1,
            sessionMode: 0,
            sessionTime: 18e5,
            reportEnable: !0,
            defaultHeaders: {
              'Content-Type': 'application/json;charset=utf-8'
            },
            clickDebounceTime: 200,
            aaidLocation: 'localStorage',
            cookieDomain: '',
            visibleAsView: !1
          }),
          (this.trackInfo = {
            aaid: '',
            sid: '',
            uid: '',
            openid: '',
            unionid: '',
            oaid: '',
            caid: '',
            imei: '',
            idfa: '',
            mobile: '',
            urlPrev: '',
            titlePrev: '',
            url: '',
            title: ''
          }),
          (this.platform = { network: null, storage: null, collect: null }),
          (this.plugins = []),
          (this.pluginMap = {}),
          (this.pluginInitMap = {}),
          (this.initTimestamp = Date.now()),
          (this.reportDelay = 0),
          (this.reportLinkDelay = 0),
          (this.pageQueue = new Te(3)),
          (this.timer = null),
          (this.commonProps = {}),
          (this.profile = {}),
          (this.sourceTypeOption = { search: [], social: [] }),
          (this.bootHooks = []),
          (this.clickTime = 0),
          (this.clickHash = ''),
          (this.eventQueue = new J()),
          (this.reachQueue = []);
      }
      var t = e.prototype;
      return (
        (t.installPlatform = function (e) {
          var t = e.network,
            n = e.storage,
            r = e.collect;
          (this.platform.network = t),
            (this.platform.storage = n),
            (this.platform.collect = r);
          var o = this.platform.storage,
            i = o.localStorage,
            a = o.sessionStorage,
            s = o.cookieStorage,
            u = o.memoryStorage;
          (this.$localStore = new ae(i)),
            (this.$sessionStore = new ae(a)),
            (this.$memoryStore = new ae(u)),
            (this.$cookieStore = new ee(s)),
            fe.debug('install platform success');
        }),
        (t.isInstalledPlugin = function (e) {
          return Boolean(this.pluginMap[e.name]);
        }),
        (t.installPlugin = function (e) {
          return this.pluginMap[e.name]
            ? (fe.warn('plugin is already installed:', e.name), !1)
            : (this.plugins.push(e),
              (this.pluginMap[e.name] = e),
              fe.debug('install plugin success:', e.name),
              !0);
        }),
        (t.initPlugin = function (e) {
          var t;
          return this.pluginInitMap[e.name]
            ? (fe.warn('plugin is already init:', e.name), !1)
            : (null === (t = null == e ? void 0 : e.init) ||
                void 0 === t ||
                t.call(e, this),
              (this.pluginInitMap[e.name] = !0),
              fe.debug('init plugin success:', e.name),
              !0);
        }),
        (t.initPlugins = function () {
          var e = this;
          this.plugins.forEach(function (t) {
            e.initPlugin(t);
          });
        }),
        (t.installPage = function (e) {
          var t;
          return (
            null === (t = null == e ? void 0 : e.init) ||
              void 0 === t ||
              t.call(e, this),
            !0
          );
        }),
        (t.initOptions = function (e) {
          this.setOptions(e), this.init();
        }),
        (t.setOptions = function (e) {
          var t = e.serverUrl,
            n = e.domainId,
            r = e.appId;
          (this.options.serverUrl = t),
            (this.options.domainId = n),
            (this.options.appId = r),
            this.executeInitHook();
        }),
        (t.setReportDelay = function (e) {
          void 0 === e && (e = 0), (this.reportDelay = e);
        }),
        (t.setReportLinkDelay = function (e) {
          void 0 === e && (e = 0), (this.reportLinkDelay = e);
        }),
        (t.checkCurrentOptions = function () {
          return this.options.serverUrl
            ? !!this.options.appId || (fe.error('appId is not set'), !1)
            : (fe.error('serverUrl is not set'), !1);
        }),
        (t.registerInitHook = function (e) {
          this.bootHooks.push(e);
        }),
        (t.executeInitHook = function () {
          this.bootHooks.forEach(function (e) {
            C(e) && e();
          });
        }),
        (t.init = function () {
          return (
            !!this.checkCurrentOptions() &&
            (this.isInited
              ? (fe.warn("It's already initialized."), !1)
              : ((this.isInited = !0),
                this.initCache(),
                this.initPlugins(),
                this.initTask(),
                (this.initTimestamp = Date.now()),
                fe.info('Welcome to use koocdp sdk'),
                fe.info('init success'),
                !0))
          );
        }),
        (t.initCache = function () {
          ye.generate(this);
        }),
        (t.initTask = function () {
          this.createInterVal();
        }),
        (t.createInterVal = function () {
          var e = this;
          this.timer && clearInterval(this.timer),
            this.interValTask(),
            (this.timer = setInterval(function () {
              e.interValTask();
            }, 3e3));
        }),
        (t.interValTask = function () {
          return (
            !!this.options.serverUrl &&
            (this.clearLinkQueue(), this.clearEventQueue(), !0)
          );
        }),
        (t.checkQueue = function () {
          this.eventQueue.getLength() >= 200 && this.clearEventQueue(),
            this.clearLinkQueue();
        }),
        (t.track = function (e, t) {
          return (
            !!this.isInited &&
            !this.isHeatmap &&
            (this.insertData({
              eventTime: new Date().getTime(),
              eventCode: e,
              eventData: t
            }),
            !0)
          );
        }),
        (t.trackLinkReaching = function (e) {
          return (
            !!this.isInited &&
            !this.isHeatmap &&
            (fe.info('Reporter.trackLink', e),
            this.reachQueue.push(e),
            this.clearLinkQueue(),
            !0)
          );
        }),
        (t.insertData = function (e) {
          return (
            this.plugins.forEach(function (t) {
              t.onDataProduced && t.onDataProduced(e);
            }),
            this.checkMpClickEvent(e) &&
              (fe.info('Reporter.trackEvent', e), this.eventQueue.enqueue(e)),
            this.checkQueue(),
            !0
          );
        }),
        (t.checkMpClickEvent = function (e) {
          if (e.eventCode !== $) return !0;
          var t = Date.now(),
            n = (function (e) {
              var t = Se({}, e.eventData, {
                element_content: '',
                element_id: '',
                element_index: '',
                element_name: '',
                element_type: '',
                hashcode: 0
              });
              return JSON.stringify(t);
            })(e);
          return (
            !(
              t - this.clickTime < this.config.clickDebounceTime &&
              n === this.clickHash
            ) && ((this.clickTime = t), (this.clickHash = n), !0)
          );
        }),
        (t.clearEventQueue = function (e) {
          var t = this;
          void 0 === e && (e = !1);
          var n = Date.now();
          return (
            !(!e && n - this.initTimestamp < this.reportDelay) &&
            !!this.isInited &&
            !!this.config.reportEnable &&
            !this.eventQueue.isEmpty() &&
            !!this.plugins.every(function (e) {
              return !e.controlDataConsume || e.controlDataConsume();
            }) &&
            (this.eventQueue.patchDequeue().forEach(function (e) {
              t.plugins.forEach(function (t) {
                e.forEach(function (e) {
                  t.onDataConsume && t.onDataConsume(e);
                });
              });
              var n = t.mergeData(e);
              t.reportMessage(n);
            }),
            !0)
          );
        }),
        (t.clearLinkQueue = function (e) {
          var t = this;
          void 0 === e && (e = !1);
          var n = Date.now();
          return (
            !(!e && n - this.initTimestamp < this.reportLinkDelay) &&
            !!this.isInited &&
            !!this.config.reportEnable &&
            0 !== this.reachQueue.length &&
            !!this.plugins.every(function (e) {
              return !e.controlLinkConsume || e.controlLinkConsume();
            }) &&
            (this.reachQueue.forEach(function (e) {
              t.plugins.forEach(function (t) {
                t.onLinkConsume && t.onLinkConsume(e);
              }),
                t.reportLinkMessage(e);
            }),
            (this.reachQueue = []),
            !0)
          );
        }),
        (t.mergeData = function (e) {
          var t = ge(e, this);
          return (
            this.plugins.forEach(function (e) {
              var n = e.onDataMerged && e.onDataMerged(t);
              t = n || t;
            }),
            t
          );
        }),
        (t.reportMessage = function (e) {
          var t = this,
            n = this.getConfigInfoOneline();
          fe.info('Reporter.sendConfig:', n),
            fe.info('Reporter.sendEvent', e),
            (function (e, t) {
              var n = t.platform.network.HTTP.sendByAjax,
                r = z(t),
                o = {
                  header: JSON.stringify(e.header),
                  body:
                    'string' == typeof e.body ? e.body : JSON.stringify(e.body)
                },
                i = {};
              return (
                t.plugins.forEach(function (e) {
                  if (e.customHeaders) {
                    var t = e.customHeaders(o);
                    i = G({}, i, t);
                  }
                }),
                n(r, JSON.stringify(o), i)
              );
            })(e, this)
              .then(function (e) {
                fe.info('Reporter.sendEvent.success', e),
                  t.plugins.forEach(function (e) {
                    e.onSendSuccess && e.onSendSuccess();
                  });
              })
              .catch(function (e) {
                fe.info('Reporter.sendEvent.failure', e),
                  t.plugins.forEach(function (e) {
                    e.onSendFailure && e.onSendFailure();
                  });
              });
        }),
        (t.reportLinkMessage = function (e) {
          var t = this,
            n = this.getConfigInfoOneline();
          fe.info('Reporter.sendConfig:', n),
            fe.info('Reporter.sendLink', e),
            Y(e, this)
              .then(function (e) {
                fe.info('Reporter.sendLink.success', e),
                  t.plugins.forEach(function (e) {
                    e.onSendSuccess && e.onSendSuccess();
                  });
              })
              .catch(function (e) {
                fe.info('Reporter.sendLink.failure', e),
                  t.plugins.forEach(function (e) {
                    e.onSendFailure && e.onSendFailure();
                  });
              });
        }),
        (t.getConfigInfoOneline = function () {
          var e = [];
          return (
            this.config.useAuth && e.push('auth'),
            this.config.useDebugMode && e.push('debug'),
            e.join(',')
          );
        }),
        (t.checkVisitInfo = function (e, t, n) {
          if (!e[t]) {
            var r = {};
            t && (r[t] = n);
            var o = Se({}, e, r);
            this.$localStore.set(f, o, { expires: g });
          }
        }),
        (t.getVisitInfo = function (e) {
          var t = e.eventCode,
            n = e.eventTime,
            r = this.trackInfo.uid,
            o = null,
            i = null,
            a = { is_login: j(r) && '' !== r ? 0 : 1 };
          if (r) {
            var s = this.$localStore.get(f) || {},
              u = s[r];
            if (
              (u || ((u = n), this.checkVisitInfo(s, r, n)),
              (o = (function (e, t) {
                var n = new Date(e),
                  r = n.getFullYear(),
                  o = n.getMonth(),
                  i = n.getDate(),
                  a = new Date(t),
                  s = a.getFullYear(),
                  u = a.getMonth(),
                  c = a.getDate();
                return r === s && o === u && i === c;
              })(u, n)
                ? 'new'
                : 'old'),
              (a.$new_user_flag = o),
              t)
            ) {
              var c = r + '_' + t;
              (u = s[c]) || this.checkVisitInfo(s, c, 1),
                (i = u ? 'N' : 'Y'),
                (a.$is_first_time = i);
            }
          }
          return a;
        }),
        (t.onSetUserInfo = function () {
          var e = this;
          this.eventQueue.queue.forEach(function (t) {
            t.eventData.uid || (t.eventData.uid = e.trackInfo.uid),
              t.eventData.mobile || (t.eventData.mobile = e.trackInfo.mobile);
            var n = j(t.eventData.uid) && '' !== t.eventData.uid;
            n && (t.eventData.is_login = n ? 0 : 1);
            var r = e.getVisitInfo(t),
              o = t.eventData;
            t.eventData = Se({}, o, r);
          });
        }),
        e
      );
    })();
    const Ee = new _e();
    function ke() {
      return window.OriginXMLHttpRequestKoocdp || XMLHttpRequest;
    }
    function Pe(e, t) {
      for (var n in t)
        Object.prototype.hasOwnProperty.call(t, n) &&
          e.setRequestHeader(n, t[n]);
    }
    function Ie(e) {
      return (e.status >= 200 && e.status < 300) || 304 === e.status;
    }
    const $e = {
      HTTP: {
        getByAjax: function (e, t, n) {
          var r = ke() && 'withCredentials' in new (ke())();
          return new Promise(
            r
              ? function (r) {
                  var o = new (ke())();
                  o.open('POST', e, !0),
                    (o.timeout = 3e3),
                    o.setRequestHeader(
                      'Content-Type',
                      'application/json;charset=utf-8'
                    ),
                    Pe(o, n),
                    o.send(t),
                    (o.onreadystatechange = function () {
                      if (4 === o.readyState)
                        if (Ie(o)) {
                          var e = re(o.response);
                          r(e);
                        } else fe.debug('xhr error');
                    }),
                    (o.onerror = function (e) {
                      fe.debug(null == e ? void 0 : e.message);
                    });
                }
              : function (e) {
                  e();
                }
          );
        },
        sendByAjax: function (e, t, n) {
          return window.XMLHttpRequest &&
            'withCredentials' in new XMLHttpRequest()
            ? (function (e, t, n) {
                var r = ke() && 'withCredentials' in new (ke())();
                return new Promise(
                  r
                    ? function (r) {
                        var o = new (ke())();
                        o.open('POST', e, !0),
                          (o.timeout = 1e3),
                          o.setRequestHeader(
                            'Content-Type',
                            'application/json;charset=utf-8'
                          ),
                          Pe(o, n),
                          o.send(t),
                          (o.onreadystatechange = function () {
                            if (4 === o.readyState)
                              if (Ie(o)) {
                                var e = re(o.response);
                                r(e);
                              } else fe.debug('xhr error');
                          }),
                          (o.onerror = function (e) {
                            fe.debug(null == e ? void 0 : e.message);
                          });
                      }
                    : function (e) {
                        e();
                      }
                );
              })(e, t, n)
            : new Promise(function (e) {
                e();
              });
        }
      }
    };
    function Oe(e) {
      return void 0 === e
        ? 'undefined'
        : null === e
        ? 'null'
        : !0 === e
        ? 'true'
        : !1 === e
        ? 'false'
        : String(e);
    }
    function De(e) {
      if (null !== e) return e;
    }
    var Ce = function (e, t) {
      var n = e;
      return (
        '"' === n[0] && (n = n.slice(1, -1)),
        n.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent(t))
      );
    };
    const Le = {
      get: function (e) {
        if ('undefined' != typeof document && e) {
          for (
            var t = document.cookie ? document.cookie.split('; ') : [],
              n = {},
              r = 0;
            r < t.length;
            r++
          ) {
            var o = t[r].split('='),
              i = o.slice(1).join('=');
            try {
              var a = decodeURIComponent(o[0]);
              if (((n[a] = Ce(i, a)), e === a)) break;
            } catch (e) {
              break;
            }
          }
          return e ? n[e] : n;
        }
      },
      set: function (e, t, n) {
        if (
          (void 0 === n && (n = {}),
          !e || /^(?:expires|max-age|path|domain|secure)$/i.test(e))
        )
          return !1;
        var r = '',
          o = n,
          i = o.expires,
          a = o.path,
          s = void 0 === a ? '/' : a,
          u = o.domain,
          c = void 0 === u ? '' : u,
          l = o.secure,
          h = void 0 !== l && l;
        A(i)
          ? (r =
              i === 1 / 0
                ? 'expires=Fri, 31 Dec 9999 23:59:59 GMT'
                : 'max-age=' + Math.ceil(i / 1e3))
          : j(i) && (r = 'expires=' + i);
        var p = [
          encodeURIComponent(String(t)),
          r,
          c ? 'domain=' + c : '',
          s ? 'path=' + s : '',
          h ? 'secure' : ''
        ]
          .filter(function (e) {
            return e;
          })
          .join(';');
        return (document.cookie = encodeURIComponent(e) + '=' + p + ';'), !0;
      },
      remove: function (e) {
        return (
          !!e &&
          ((document.cookie =
            encodeURIComponent(e) + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT'),
          !0)
        );
      }
    };
    const Re = {
      localStorage: {
        get: function (e) {
          return De(window.localStorage.getItem(e));
        },
        set: function (e, t) {
          window.localStorage.setItem(e, Oe(t));
        },
        remove: function (e) {
          window.localStorage.removeItem(e);
        }
      },
      sessionStorage: {
        get: function (e) {
          return De(window.sessionStorage.getItem(e));
        },
        set: function (e, t) {
          window.sessionStorage.setItem(e, Oe(t));
        },
        remove: function (e) {
          window.sessionStorage.removeItem(e);
        }
      },
      cookieStorage: {
        get: function (e) {
          return De(Le.get(e));
        },
        set: function (e, t, n) {
          Le.set(e, Oe(t), n);
        },
        remove: function (e) {
          Le.remove(e);
        }
      },
      memoryStorage: {
        _data: {},
        get: function (e) {
          return De(this._data[e]);
        },
        set: function (e, t) {
          var n = Oe(t);
          this._data[e] = n;
        },
        remove: function (e) {
          this._data[e] = void 0;
        }
      }
    };
    function Ae() {
      return (
        (Ae = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        Ae.apply(null, arguments)
      );
    }
    function je(e, t) {
      var n =
        ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator'];
      if (n) return (n = n.call(e)).next.bind(n);
      if (
        Array.isArray(e) ||
        (n = (function (e, t) {
          if (e) {
            if ('string' == typeof e) return Ue(e, t);
            var n = {}.toString.call(e).slice(8, -1);
            return (
              'Object' === n && e.constructor && (n = e.constructor.name),
              'Map' === n || 'Set' === n
                ? Array.from(e)
                : 'Arguments' === n ||
                  /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
                ? Ue(e, t)
                : void 0
            );
          }
        })(e)) ||
        (t && e && 'number' == typeof e.length)
      ) {
        n && (e = n);
        var r = 0;
        return function () {
          return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
        };
      }
      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 Ue(e, t) {
      (null == t || t > e.length) && (t = e.length);
      for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
      return r;
    }
    function xe(e) {
      try {
        return decodeURIComponent(e);
      } catch (t) {
        return e;
      }
    }
    function Me(e) {
      var t = {};
      if (!j(e)) return {};
      for (var n, r = je(e.split('&')); !(n = r()).done; ) {
        var o = n.value;
        if (o) {
          var i = o.split('='),
            a = i[0],
            s = i[1],
            u = void 0 === s ? '' : s;
          (a = xe(a)),
            (u = xe(u)),
            t[a]
              ? (Array.isArray(t[a]) || (t[a] = [t[a]]), t[a].push(u))
              : (t[a] = u);
        }
      }
      return t;
    }
    function He(e) {
      var t,
        n,
        r = K(e);
      return Ae(
        {},
        Me(
          null === (t = r.search) || void 0 === t
            ? void 0
            : t.replace(/^\?/, '')
        ) || {},
        Me(
          null === (n = r.hashQuery) || void 0 === n
            ? void 0
            : n.replace(/^\?/, '')
        ) || {}
      );
    }
    function qe(e) {
      var t = K(e);
      return {
        $url: t.href,
        $url_host: t.host,
        $url_path: t.pathname,
        $url_query: t.search
      };
    }
    function Ne(e) {
      return (function (e, t) {
        var n = He(e),
          r = {};
        return (
          t.forEach(function (e) {
            var t = n[e];
            r['$' + e] = null != t ? t : '';
          }),
          r
        );
      })(e, [
        'utm_campaign',
        'utm_content',
        'utm_matching_type',
        'utm_medium',
        'utm_source',
        'utm_term'
      ]);
    }
    function Ve() {
      return (
        (Ve = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        Ve.apply(null, arguments)
      );
    }
    function Qe(e) {
      var t = e;
      if (t && t.id) return '//*[@id="' + t.id + '"]';
      for (
        var n = [];
        t && t.nodeType === Node.ELEMENT_NODE;
        t = t.parentElement
      ) {
        for (var r = 0, o = !1, i = t.previousSibling; i; i = i.previousSibling)
          i.nodeType !== Node.DOCUMENT_TYPE_NODE &&
            i.nodeName === t.nodeName &&
            ++r;
        for (var a = t.nextSibling; a && !o; a = a.nextSibling)
          a.nodeName === t.nodeName && (o = !0);
        var s = (t.prefix ? t.prefix + ':' : '') + t.localName,
          u = r || o ? '[' + (r + 1) + ']' : '';
        n.splice(0, 0, s + u);
      }
      return n.length ? '/' + n.join('/') : null;
    }
    function Fe(e) {
      for (
        var t = e.localName.toLowerCase(), n = 1, r = e;
        r.previousElementSibling;

      )
        t === (r = r.previousElementSibling).localName.toLowerCase() && n++;
      return n;
    }
    function We(e) {
      var t = e;
      if (!t) return '';
      if ('body' === t.localName.toLowerCase()) return 'body';
      for (
        var n = [];
        t.parentElement && 'body' !== t.localName.toLowerCase();

      ) {
        var r = t.localName.toLowerCase(),
          o = Fe(t);
        n.unshift(r + ':nth-of-type(' + o + ')'), (t = t.parentElement);
      }
      return n.join(' > ');
    }
    function Ke(e) {
      var t = e;
      if ('previousElementSibling' in document.documentElement)
        return t.previousElementSibling;
      for (; t.previousSibling; )
        if (1 === (t = t.previousSibling).nodeType) return t;
      return null;
    }
    function Be(e) {
      if (!e.parentNode) return 0;
      var t = (function (e) {
        var t = e.parentNode;
        if (!t) return [];
        for (
          var n = e.localName.toLowerCase(), r = [], o = 0;
          o < t.children.length;
          o++
        ) {
          var i = t.children[o];
          1 === i.nodeType &&
            i.localName.toLowerCase() === n &&
            r.push(t.children[o]);
        }
        return r;
      })(e);
      if (1 === t.length) return 0;
      for (var n = 0, r = e; Ke(r); n++) r = Ke(r);
      return n;
    }
    function Xe(e, t) {
      var n = '',
        r = [];
      r.push(e),
        Array.from(e.children).forEach(function (e) {
          e instanceof HTMLElement && r.push(e);
        }),
        e.parentElement && r.push(e.parentElement);
      for (var o = 0; o < r.length; o++) {
        var i = r[o],
          a = null == i ? void 0 : i.getAttribute(t);
        if (a) {
          n = a;
          break;
        }
      }
      return n;
    }
    function Ge(e) {
      var t = {};
      return (
        Object.keys(e).forEach(function (n) {
          n.includes('clickProperty') &&
            (t[
              (function (e) {
                return oe(e.replace('clickProperty', ''));
              })(n)
            ] = e[n]);
        }),
        t
      );
    }
    function ze(e) {
      var t,
        n,
        r,
        o = e,
        i =
          (null == o ? void 0 : o.getAttribute('href')) ||
          (null == o ? void 0 : o.getAttribute('data-href'));
      if (!i) {
        var a = Array.from(o.childNodes),
          s =
            null === (t = null == a ? void 0 : a.find) || void 0 === t
              ? void 0
              : t.call(a, function (e) {
                  var t, n;
                  return (
                    (null === (t = null == e ? void 0 : e.getAttribute) ||
                    void 0 === t
                      ? void 0
                      : t.call(e, 'href')) ||
                    (null === (n = null == e ? void 0 : e.getAttribute) ||
                    void 0 === n
                      ? void 0
                      : n.call(e, 'data-href'))
                  );
                });
        i =
          (null === (n = null == s ? void 0 : s.getAttribute) || void 0 === n
            ? void 0
            : n.call(s, 'href')) ||
          (null === (r = null == s ? void 0 : s.getAttribute) || void 0 === r
            ? void 0
            : r.call(s, 'data-href')) ||
          '';
      }
      return i;
    }
    function Ye() {
      Ye = function (e, t) {
        return new n(e, void 0, t);
      };
      var e = RegExp.prototype,
        t = new WeakMap();
      function n(e, r, o) {
        var i = RegExp(e, r);
        return t.set(i, o || t.get(e)), Je(i, n.prototype);
      }
      function r(e, n) {
        var r = t.get(n);
        return Object.keys(r).reduce(function (t, n) {
          var o = r[n];
          if ('number' == typeof o) t[n] = e[o];
          else {
            for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length; ) i++;
            t[n] = e[o[i]];
          }
          return t;
        }, Object.create(null));
      }
      return (
        (function (e, t) {
          if ('function' != typeof t && null !== t)
            throw new TypeError(
              'Super expression must either be null or a function'
            );
          (e.prototype = Object.create(t && t.prototype, {
            constructor: { value: e, writable: !0, configurable: !0 }
          })),
            Object.defineProperty(e, 'prototype', { writable: !1 }),
            t && Je(e, t);
        })(n, RegExp),
        (n.prototype.exec = function (t) {
          var n = e.exec.call(this, t);
          if (n) {
            n.groups = r(n, this);
            var o = n.indices;
            o && (o.groups = r(o, this));
          }
          return n;
        }),
        (n.prototype[Symbol.replace] = function (n, o) {
          if ('string' == typeof o) {
            var i = t.get(this);
            return e[Symbol.replace].call(
              this,
              n,
              o.replace(/\$<([^>]+)(>|$)/g, function (e, t, n) {
                if ('' === n) return e;
                var r = i[t];
                return Array.isArray(r)
                  ? '$' + r.join('$')
                  : 'number' == typeof r
                  ? '$' + r
                  : '';
              })
            );
          }
          if ('function' == typeof o) {
            var a = this;
            return e[Symbol.replace].call(this, n, function () {
              var e = arguments;
              return (
                'object' != typeof e[e.length - 1] &&
                  (e = [].slice.call(e)).push(r(e, a)),
                o.apply(this, e)
              );
            });
          }
          return e[Symbol.replace].call(this, n, o);
        }),
        Ye.apply(this, arguments)
      );
    }
    function Je(e, t) {
      return (
        (Je = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        Je(e, t)
      );
    }
    function Ze(e, t) {
      var n = e.match(t);
      return n ? n[1] : 'Unknown';
    }
    function et(e) {
      var t = { name: 'Others', version: 'Unknown' },
        n = e.toLowerCase();
      return (
        n.includes('harmonyos')
          ? ((t.name = 'HarmonyOS'),
            (t.version = Ze(n, Ye(/harmonyos[/\s]?([.\d]*)/, { version: 1 }))),
            ('' !== t.version && 'Unknown' !== t.version) ||
              (t.version = Ze(n, Ye(/hmscore[/\s]?([.\d]*)/, { version: 1 }))))
          : n.includes('openharmony')
          ? ((t.name = 'OpenHarmony'),
            (t.version = Ze(
              n,
              Ye(/openharmony[/\s]?([.\d]*)/, { version: 1 })
            )))
          : n.includes('mac')
          ? ((t.name = 'Mac'),
            (t.version = Ze(n, Ye(/os[/\s]?x?[/\s]?([.\d]*)/, { version: 1 }))))
          : n.includes('windows')
          ? ((t.name = 'Windows'),
            (t.version = Ze(n, Ye(/windows nt[/\s]?([.\d]*)/, { version: 1 }))))
          : n.includes('android')
          ? ((t.name = 'Android'),
            (t.version = Ze(n, Ye(/android[/\s]?([.\d]*)/, { version: 1 }))))
          : n.includes('linux')
          ? (t.name = 'Linux')
          : (t.name = 'Others'),
        t
      );
    }
    function tt(e) {
      var t = { name: 'Others', version: 'Unknown' },
        n = e.toLowerCase(),
        r = {
          Safari: n.match(Ye(/safari\/([\d.]+)/, { version: 1 })),
          Chrome: n.match(Ye(/chrome\/([\d.]+)/, { version: 1 })),
          Firefox: n.match(Ye(/firefox\/([\d.]+)/, { version: 1 })),
          Edge: n.match(Ye(/(?:edg|edge)\/([\d.]+)/, { version: 1 })),
          Opera: n.match(Ye(/(?:opera|opr).([\d.]+)/, { version: 1 })),
          IE:
            n.match(Ye(/rv:([\d.]+)\) like gecko/, { version: 1 })) ||
            n.match(Ye(/msie ([\d.]+)/, { version: 1 })),
          UCBrowser: n.match(
            Ye(/(?:ucbrowser|ubrowser)\/([\d.]+)/, { version: 1 })
          ),
          QQBrowser: n.match(Ye(/qqbrowser\/([\d.]+)/, { version: 1 })),
          MicroMessenger: n.match(
            Ye(/micromessenger\/([\d.]+)/, { version: 1 })
          ),
          HuaweiBrowser: n.match(
            Ye(/(?:huaweibrowser|hbpc)\/([\d.]+)/, { version: 1 })
          )
        };
      for (var o in r)
        r[o] && ((t.name = o), (t.version = r[o][1] || 'Unknown'));
      return t;
    }
    var nt = 0,
      rt = 1,
      ot = 2;
    function it() {
      var e, t;
      return null !==
        (t =
          null ===
            (e =
              null === navigator || void 0 === navigator
                ? void 0
                : navigator.connection) || void 0 === e
            ? void 0
            : e.effectiveType) && void 0 !== t
        ? t
        : 'unknown';
    }
    var at = {
      getUserAgentInfo: function (e) {
        return (function (e) {
          return {
            brand: '',
            model: '',
            manufacturer: '',
            os: et(e),
            browser: tt(e)
          };
        })(e || window.navigator.userAgent);
      },
      getUserAgentType: function (e) {
        var t = e || window.navigator.userAgent,
          n = /AppleWebKit.*Mobile.*/.test(t) || /Android/.test(t),
          r = /(MicroMessenger|WebBrowser)/.test(t);
        return n ? (r ? ot : rt) : nt;
      },
      getUserAgentLang: function () {
        var e;
        return null !==
          (e =
            null === navigator || void 0 === navigator
              ? void 0
              : navigator.language) && void 0 !== e
          ? e
          : 'unknown';
      },
      getNetworkType: it
    };
    const st = {
      page: {
        getTitle: function () {
          return document.title;
        },
        getUrl: function () {
          return document.URL;
        },
        getUrlPath: function () {
          try {
            return new URL(document.URL).pathname;
          } catch (e) {
            return '';
          }
        },
        getReferrer: function () {
          return document.referrer;
        }
      },
      screen: {
        getScreenWidth: function () {
          return screen.width;
        },
        getScreenHeight: function () {
          return screen.height;
        },
        getViewportWidth: function () {
          return Math.round(window.innerWidth);
        },
        getViewportHeight: function () {
          return Math.round(window.innerHeight);
        },
        getViewportPosition: function () {
          return Math.round(window.scrollY + window.innerHeight);
        },
        getPageWidth: function () {
          var e =
              window.innerWidth ||
              document.documentElement.clientWidth ||
              document.body.clientWidth ||
              0,
            t = document.documentElement.scrollWidth || 0;
          return Math.max(e, t) || 0;
        },
        getPageHeight: function () {
          var e =
              window.innerHeight ||
              document.documentElement.clientHeight ||
              document.body.clientHeight ||
              0,
            t = document.documentElement.scrollHeight || 0;
          return Math.max(e, t) || 0;
        }
      },
      UA: at
    };
    function ut() {
      var e = new Date().toString().match(/\(.+\)/);
      return R(e) && e[0] ? e[0].replace('(', '').replace(')', '') : '';
    }
    function ct() {
      return (
        (ct = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        ct.apply(null, arguments)
      );
    }
    var lt,
      ht,
      pt,
      ft,
      dt = st.screen,
      gt = st.page,
      mt = st.UA,
      vt = mt.getUserAgentInfo(),
      wt =
        null === (lt = null == vt ? void 0 : vt.os) || void 0 === lt
          ? void 0
          : lt.name,
      yt =
        null === (ht = null == vt ? void 0 : vt.os) || void 0 === ht
          ? void 0
          : ht.version,
      bt =
        null === (pt = null == vt ? void 0 : vt.browser) || void 0 === pt
          ? void 0
          : pt.name,
      Tt =
        null === (ft = null == vt ? void 0 : vt.browser) || void 0 === ft
          ? void 0
          : ft.version,
      St = (function () {
        function e() {
          (this.page = gt), (this.screen = dt), (this.UA = mt);
        }
        var t = e.prototype;
        return (
          (t.getLibraryInfo = function () {
            return { $lib: 'js', $lib_version: o };
          }),
          (t.getBrowserInfo = function () {
            return {
              $timezone_offset: new Date().getTimezoneOffset(),
              $timezone:
                ((e = new Date().toString().match(/GMT[+-]\d{4}/)),
                R(e) ? e[0] : ''),
              $timezone_name: ut(),
              $os: wt,
              $os_version: yt,
              $browser: bt,
              $browser_version: Tt,
              $network_type: mt.getNetworkType(),
              $language: mt.getUserAgentLang()
            };
            var e;
          }),
          (t.getScreenInfo = function () {
            return {
              $screen_width: dt.getScreenWidth(),
              $screen_height: dt.getScreenHeight(),
              $viewport_width: dt.getViewportWidth(),
              $viewport_height: dt.getViewportHeight(),
              $viewport_position: dt.getViewportPosition(),
              $page_width: dt.getPageWidth(),
              $page_height: dt.getPageHeight()
            };
          }),
          (t.getElementInfo = function (e) {
            var t,
              n,
              r,
              o,
              i,
              a,
              s,
              u = (function (e) {
                var t = {},
                  n = [];
                n.push(e),
                  Array.from(e.children).forEach(function (e) {
                    e instanceof HTMLElement && n.push(e);
                  }),
                  e.parentElement && n.push(e.parentElement);
                for (var r = 0; r < n.length; r++)
                  t = Ve({}, Ge(n[r].dataset), t);
                return t;
              })(e);
            return ct(
              {
                element_id:
                  null !== (t = null == e ? void 0 : e.id) && void 0 !== t
                    ? t
                    : '',
                element_class_name:
                  null !== (n = null == e ? void 0 : e.className) &&
                  void 0 !== n
                    ? n
                    : '',
                element_name:
                  Xe(e, 'data-name') ||
                  (null == e ? void 0 : e.getAttribute('name')) ||
                  '',
                element_type:
                  Xe(e, 'data-type') ||
                  (null === (r = null == e ? void 0 : e.tagName) || void 0 === r
                    ? void 0
                    : r.toLowerCase()) ||
                  '',
                element_content: ((s = e),
                s instanceof SVGElement ? '' : s.innerText).slice(0, 256),
                element_path: null !== (o = Qe(e)) && void 0 !== o ? o : '',
                element_position: Be(e) || 0,
                element_index:
                  null !== (i = Xe(e, 'data-index')) && void 0 !== i ? i : '',
                element_selector: null !== (a = We(e)) && void 0 !== a ? a : '',
                element_target_url: ze(e)
              },
              u
            );
          }),
          (t.getEventInfo = function (e) {
            return { page_x: e.pageX, page_y: e.pageY };
          }),
          (t.getReferInfo = function (e) {
            var t = qe(e);
            return { $referrer: t.$url, $referrer_host: t.$url_host };
          }),
          (t.getUrlInfo = function () {
            return qe(gt.getUrl());
          }),
          (t.getUtmInfo = function () {
            return Ne(gt.getUrl());
          }),
          e
        );
      })();
    const _t = { network: $e, storage: Re, collect: new St() };
    function Et(e, t) {
      var n = t - e;
      return (isNaN(n) || n < 0) && (n = 0), n;
    }
    var kt = (function () {
      function e() {
        (this.pageTimeInfo = {
          startTime: Date.now(),
          endTime: Date.now(),
          duration: 0
        }),
          (this.stayTimeInfo = {
            startTime: Date.now(),
            endTime: Date.now(),
            duration: 0
          }),
          (this.appTimeInfo = {
            startTime: Date.now(),
            endTime: Date.now(),
            duration: 0
          }),
          (this.tempTimeInfo = {
            startTime: Date.now(),
            endTime: Date.now(),
            duration: 0
          });
      }
      var t = e.prototype;
      return (
        (t.appEnter = function () {
          var e = new Date().getTime();
          this.appTimeInfo.startTime = e;
          return { start_time: this.appTimeInfo.startTime, duration: 0 };
        }),
        (t.appLeave = function () {
          var e = new Date().getTime();
          this.appTimeInfo.endTime = e;
          var t = Et(this.appTimeInfo.startTime, this.appTimeInfo.endTime);
          return { start_time: this.appTimeInfo.startTime, duration: t };
        }),
        (t.pageEnter = function () {
          var e = new Date().getTime();
          (this.pageTimeInfo.startTime = e), (this.stayTimeInfo.startTime = e);
          return { start_time: this.pageTimeInfo.startTime, duration: 0 };
        }),
        (t.pageStay = function () {
          var e = new Date().getTime();
          this.stayTimeInfo.endTime = e;
          var t = Et(this.stayTimeInfo.startTime, this.stayTimeInfo.endTime),
            n = { start_time: this.stayTimeInfo.startTime, duration: t };
          return (this.stayTimeInfo.startTime = e), n;
        }),
        (t.pageHidden = function () {
          this.tempTimeInfo.startTime = new Date().getTime();
        }),
        (t.pageVisible = function () {
          (this.tempTimeInfo.endTime = new Date().getTime()),
            (this.tempTimeInfo.duration += Et(
              this.tempTimeInfo.startTime,
              this.tempTimeInfo.endTime
            ));
        }),
        (t.pageLeave = function () {
          var e = new Date().getTime();
          this.pageTimeInfo.endTime = e;
          var t = Et(
            this.pageTimeInfo.startTime,
            this.pageTimeInfo.endTime - this.tempTimeInfo.duration
          );
          return (
            (this.tempTimeInfo.duration = 0),
            { start_time: this.pageTimeInfo.startTime, duration: t }
          );
        }),
        (t.pageClose = function () {
          var e = this;
          setTimeout(function () {
            e.$reporter.clearLinkQueue(), e.$reporter.clearEventQueue();
          });
        }),
        e
      );
    })();
    function Pt(e, t) {
      return (
        (Pt = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        Pt(e, t)
      );
    }
    var It = (function (e) {
      function t() {
        return e.call(this) || this;
      }
      var n, r;
      (r = e),
        ((n = t).prototype = Object.create(r.prototype)),
        (n.prototype.constructor = n),
        Pt(n, r);
      var o = t.prototype;
      return (
        (o.init = function (e) {
          (this.$reporter = e), this.initWebEvent();
        }),
        (o.initWebEvent = function () {
          var e = this;
          window.addEventListener('beforeunload', function () {
            return e.pageClose();
          });
        }),
        t
      );
    })(kt);
    const $t = new It();
    var Ot;
    const Dt = {
      all: (Ot = Ot || new Map()),
      on: function (e, t) {
        var n = Ot.get(e);
        n ? n.push(t) : Ot.set(e, [t]);
      },
      off: function (e, t) {
        var n = Ot.get(e);
        n && (t ? n.splice(n.indexOf(t) >>> 0, 1) : Ot.set(e, []));
      },
      emit: function (e, t) {
        var n = Ot.get(e);
        n &&
          n.slice().map(function (e) {
            e(t);
          }),
          (n = Ot.get('*')) &&
            n.slice().map(function (n) {
              n(e, t);
            });
      }
    };
    function Ct() {
      return (
        (Ct = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        Ct.apply(null, arguments)
      );
    }
    function Lt(e, t) {
      return (
        (Lt = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        Lt(e, t)
      );
    }
    function Rt() {
      try {
        var e = !Boolean.prototype.valueOf.call(
          Reflect.construct(Boolean, [], function () {})
        );
      } catch (e) {}
      return (Rt = function () {
        return !!e;
      })();
    }
    function At(e, t) {
      var n = window.history[e];
      return function () {
        Dt.emit(t, {});
        for (var e = arguments.length, r = new Array(e), o = 0; o < e; o++)
          r[o] = arguments[o];
        return n.apply(this, r);
      };
    }
    function jt(e) {
      return j(e) && e.toUpperCase(), e;
    }
    function Ut() {
      return new Proxy(window.OriginXMLHttpRequestKoocdp, {
        construct: function (e, n) {
          var r = {
              type: 'xhr',
              method: 'GET',
              url: '',
              status: 0,
              startTime: Date.now(),
              endTime: 0,
              duration: 0
            },
            o = (function (e, t, n) {
              if (Rt()) return Reflect.construct.apply(null, arguments);
              var r = [null];
              r.push.apply(r, t);
              var o = new (e.bind.apply(e, r))();
              return n && Lt(o, n.prototype), o;
            })(e, n),
            i = o.open;
          return (
            (o.open = function () {
              for (
                var e, n = arguments.length, a = new Array(n), s = 0;
                s < n;
                s++
              )
                a[s] = arguments[s];
              var u = a[0],
                c = a[1];
              return (
                (r.method = null !== (e = jt(u)) && void 0 !== e ? e : 'GET'),
                (r.url = c || ''),
                (r.startTime = Date.now()),
                Dt.emit(t.REQUEST_START, r),
                i.apply(o, a)
              );
            }),
            o.addEventListener('load', function () {
              var e = Ct({}, r);
              (e.status = o.status),
                (e.endTime = Date.now()),
                (e.duration = e.endTime - e.startTime),
                Dt.emit(t.REQUEST_LOAD, e);
            }),
            o.addEventListener('error', function () {
              var e = Ct({}, r);
              (e.status = o.status),
                (e.endTime = Date.now()),
                (e.duration = e.endTime - e.startTime),
                Dt.emit(t.REQUEST_ERROR, e);
            }),
            o
          );
        }
      });
    }
    var xt = (function () {
      function e() {
        this.name = 'plugin-web-listener';
      }
      var n = e.prototype;
      return (
        (n.init = function (e) {
          (this.$reporter = e),
            this.proxyHistory(),
            this.proxyXhr(),
            this.proxyFetch(),
            this.listenerOldResource(),
            this.listenerNewResource();
        }),
        (n.proxyHistory = function () {
          (window.history.pushState = At(V.PUSH, Q.PUSH)),
            (window.history.replaceState = At(V.REPLACE, Q.REPLACE));
        }),
        (n.proxyXhr = function () {
          window.OriginXMLHttpRequestKoocdp ||
            (window.OriginXMLHttpRequestKoocdp = window.XMLHttpRequest),
            window.ProxyXMLHttpRequestKoocdp ||
              ((window.ProxyXMLHttpRequestKoocdp = Ut()),
              (window.XMLHttpRequest = window.ProxyXMLHttpRequestKoocdp));
        }),
        (n.proxyFetch = function () {
          var e;
          window.proxyFetchKoocdp ||
            ((window.proxyFetchKoocdp =
              ((e = window.fetch),
              function () {
                for (
                  var n = arguments.length, r = new Array(n), o = 0;
                  o < n;
                  o++
                )
                  r[o] = arguments[o];
                return new Promise(function (n, o) {
                  var i = r[0],
                    a = r[1],
                    s = {
                      type: 'fetch',
                      method: jt((a || {}).method) || 'GET',
                      url: ('string' == typeof i ? i : i.toString()) || 'GET',
                      status: 0,
                      startTime: Date.now(),
                      endTime: 0,
                      duration: 0
                    };
                  Dt.emit(t.REQUEST_START, s),
                    e(i, a)
                      .then(function (e) {
                        var r = Ct({}, s);
                        (r.url = e.url),
                          (r.status = e.status),
                          (r.endTime = Date.now()),
                          (r.duration = r.endTime - r.startTime),
                          Dt.emit(t.REQUEST_LOAD, r),
                          n(e);
                      })
                      .catch(function (e) {
                        var n,
                          r = Ct({}, s);
                        (r.status =
                          null !== (n = e.status) && void 0 !== n ? n : 404),
                          (r.endTime = Date.now()),
                          (r.duration = r.endTime - r.startTime),
                          Dt.emit(t.REQUEST_ERROR, r),
                          o(e);
                      });
                });
              })),
            (window.fetch = window.proxyFetchKoocdp));
        }),
        (n.listenerOldResource = function () {
          var e = this,
            t = document.querySelectorAll('script'),
            n = document.querySelectorAll('link');
          t.forEach(function (t) {
            e.listenerResource(t);
          }),
            n.forEach(function (t) {
              e.listenerResource(t);
            });
        }),
        (n.listenerNewResource = function () {
          var e = this;
          new MutationObserver(function (t) {
            t.forEach(function (t) {
              'childList' === t.type &&
                t.addedNodes.forEach(function (t) {
                  t instanceof HTMLElement &&
                    ('SCRIPT' === t.tagName || 'LINK' === t.tagName) &&
                    e.listenerResource(t);
                });
            });
          }).observe(document, { childList: !0, subtree: !0 });
        }),
        (n.listenerResource = function (e) {
          var n,
            r = {
              type: 'source',
              method: 'GET',
              url:
                ((n = e),
                n instanceof HTMLLinkElement
                  ? n.href
                  : n instanceof HTMLScriptElement
                  ? n.src
                  : ''),
              status: 0,
              startTime: Date.now(),
              endTime: 0,
              duration: 0
            };
          Dt.emit(t.REQUEST_START, r),
            e.addEventListener('load', function () {
              var e = Ct({}, r);
              (e.status = 200),
                (e.endTime = Date.now()),
                (e.duration = e.endTime - e.startTime),
                Dt.emit(t.REQUEST_LOAD, e);
            }),
            e.addEventListener('error', function () {
              var e = Ct({}, r);
              (e.status = 404),
                (e.endTime = Date.now()),
                (e.duration = e.endTime - e.startTime),
                Dt.emit(t.REQUEST_ERROR, e);
            });
        }),
        e
      );
    })();
    const Mt = xt;
    var Ht = (function () {
      function e() {
        this.name = 'plugin-previous-page';
      }
      return (
        (e.prototype.update = function () {
          var e,
            t = !1,
            n =
              this.$reporter.config.cookieDomain ||
              (function (e) {
                var t,
                  n = e;
                ('' !== e && '/' !== e) ||
                  (n =
                    null ===
                      (t =
                        null === window || void 0 === window
                          ? void 0
                          : window.location) || void 0 === t
                      ? void 0
                      : t.href);
                var r = K(n);
                return null == r ? void 0 : r.hostname;
              })(location.href),
            r = this.$reporter.pageQueue,
            o = this.$reporter.$cookieStore.get(s, { domain: n }),
            i = this.$reporter.$localStore.get(s),
            u = this.$reporter.$localStore.get(h),
            c = this.$reporter.$localStore.get(p);
          o === i &&
            (this.$reporter.$localStore.set(s, o, { expires: a }),
            (t = !0),
            r.isEmpty() && r.enqueue({ url: u, title: c }));
          var l = this.$reporter.platform.collect.page.getUrl(),
            f = this.$reporter.platform.collect.page.getTitle(),
            d = r.enqueue({ url: l, title: f });
          return (
            u !== l &&
              (this.$reporter.$localStore.set(h, l, { expires: a }), (t = !0)),
            c !== f &&
              (this.$reporter.$localStore.set(p, f, { expires: a }), (t = !0)),
            t && this.$reporter.$localStore.write(),
            (this.$reporter.trackInfo.urlPrev =
              r.getSecond().url ||
              this.$reporter.platform.collect.page.getReferrer()),
            (this.$reporter.trackInfo.titlePrev =
              null !== (e = r.getSecond().title) && void 0 !== e ? e : ''),
            (this.$reporter.trackInfo.url =
              r.getRear().url || this.$reporter.platform.collect.page.getUrl()),
            (this.$reporter.trackInfo.title =
              r.getRear().title ||
              this.$reporter.platform.collect.page.getTitle()),
            d
          );
        }),
        e
      );
    })();
    function qt(e) {
      if (!e) return !0;
      var t = !0,
        n = !0,
        r = !0,
        o = window.location.href;
      return (
        R(e.whiteList) && (t = X(e.whiteList, o)),
        R(e.blackList) && (n = !X(e.blackList, o)),
        C(e.callback) && (r = e.callback()),
        t && n && r
      );
    }
    function Nt(e, t) {
      return (
        !!e.autoTrack[t] &&
        !!qt(e.autoTrackOption.all) &&
        !!qt(e.autoTrackOption[t])
      );
    }
    function Vt() {
      return (
        (Vt = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        Vt.apply(null, arguments)
      );
    }
    function Qt(e, t) {
      return (
        (Qt = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        Qt(e, t)
      );
    }
    var Ft = (function (e) {
      function t() {
        var t;
        return (
          ((t = e.call(this) || this).name = 'plugin-web-previous-page'),
          (t.stayInterval = null),
          (t.stayTime = 0),
          (t.pageState = new kt()),
          t
        );
      }
      var n, r;
      (r = e),
        ((n = t).prototype = Object.create(r.prototype)),
        (n.prototype.constructor = n),
        Qt(n, r);
      var o = t.prototype;
      return (
        (o.init = function (e) {
          (this.$reporter = e), this.initAutoTrackEvent();
        }),
        (o.initAutoTrackEvent = function () {
          var e = this;
          setTimeout(function () {
            setTimeout(function () {
              e.onPageShow(), e.initPageEvent();
            });
          });
        }),
        (o.initPageEvent = function () {
          window.addEventListener('scroll', this.onPageStay.bind(this)),
            window.addEventListener(
              'beforeunload',
              this.onPageUnLoad.bind(this)
            ),
            document.addEventListener(
              'visibilitychange',
              this.onPageVisibilityChange.bind(this)
            ),
            Dt.on(Q.PUSH, this.onPagePathChange.bind(this)),
            Dt.on(Q.REPLACE, this.onPagePathChange.bind(this)),
            window.addEventListener(
              'popstate',
              this.onPagePathChange.bind(this)
            ),
            window.addEventListener(
              'hashchange',
              this.onPageHashChange.bind(this)
            );
        }),
        (o.onPagePathChange = function () {
          fe.debug('AutoTrack.onPagePathChange.trigger'),
            this.$reporter.techStack.isSpa && this.onPageChange();
        }),
        (o.onPageHashChange = function () {
          fe.debug('AutoTrack.onPageHashChange.trigger'),
            this.$reporter.techStack.isSpa &&
              this.$reporter.techStack.history === N.HASH &&
              this.onPageChange();
        }),
        (o.onPageVisibilityChange = function () {
          var e = this.$reporter.config.visibleAsView;
          fe.debug('AutoTrack.onPageVisibilityChange.trigger', e),
            e
              ? 'hidden' === document.visibilityState
                ? this.onPageLeave()
                : this.onPageEnter()
              : 'hidden' === document.visibilityState
              ? this.pageState.pageHidden()
              : this.pageState.pageVisible();
        }),
        (o.onPageShow = function () {
          fe.debug('AutoTrack.onPageShow.trigger'),
            this.update(),
            this.onPageEnter();
        }),
        (o.onPageUnLoad = function () {
          fe.debug('AutoTrack.onPageUnLoad.trigger'), this.onPageLeave();
        }),
        (o.onPageEnter = function () {
          fe.debug('AutoTrack.onPageEnter.trigger'),
            (this.stayTime = Date.now());
          var e = this.pageState.pageEnter();
          if (!Nt(this.$reporter, _)) return !1;
          var t = Vt({}, e, {
            viewport_position:
              this.$reporter.platform.collect.getScreenInfo().$viewport_position
          });
          return this.$reporter.track(w, t), !0;
        }),
        (o.getLeavePageInfo = function () {
          var e,
            t,
            n,
            r,
            o,
            i,
            a,
            s,
            u = this.$reporter.pageQueue,
            c =
              null !==
                (t =
                  null === (e = u.getSecond()) || void 0 === e
                    ? void 0
                    : e.url) && void 0 !== t
                ? t
                : '',
            l =
              null !==
                (r =
                  null === (n = u.getSecond()) || void 0 === n
                    ? void 0
                    : n.title) && void 0 !== r
                ? r
                : '',
            h =
              null !==
                (i =
                  null === (o = u.getFront()) || void 0 === o
                    ? void 0
                    : o.url) && void 0 !== i
                ? i
                : '',
            p =
              null !==
                (s =
                  null === (a = u.getFront()) || void 0 === a
                    ? void 0
                    : a.title) && void 0 !== s
                ? s
                : '',
            f = K(c),
            d = K(h);
          return {
            page_title: l,
            page_url: c,
            page_host: f.host,
            page_path: f.pathname,
            page_hash_path: f.hashPath,
            page_hash_query: f.hashQuery,
            pre_page_title: p,
            pre_page_url: h,
            pre_page_host: d.host,
            pre_page_path: d.pathname,
            pre_page_hash_path: d.hashPath,
            pre_page_hash_query: d.hashQuery
          };
        }),
        (o.onPageLeave = function () {
          fe.debug('AutoTrack.onPageLeave.trigger');
          var e = this.pageState.pageLeave();
          if (!Nt(this.$reporter, P)) return !1;
          var t = Vt({}, e, this.getLeavePageInfo(), {
            viewport_position:
              this.$reporter.platform.collect.getScreenInfo().$viewport_position
          });
          return this.$reporter.track(T, t), !0;
        }),
        (o.onPageChange = function () {
          var e = this;
          fe.debug('AutoTrack.onPageChange.trigger'),
            setTimeout(function () {
              e.update() && (e.onPageLeave(), e.onPageEnter());
            });
        }),
        (o.onPageStay = function () {
          var e = Date.now();
          if (e - this.stayTime < 4e3) return !1;
          fe.debug('AutoTrack.onPageStay.trigger'), (this.stayTime = e);
          var t = this.pageState.pageStay();
          if (!Nt(this.$reporter, E)) return !1;
          var n = this.$reporter.platform.collect.getScreenInfo(),
            r = Vt({}, t, {
              viewport_width: n.$viewport_width,
              viewport_height: n.$viewport_height,
              viewport_position: n.$viewport_position,
              page_width: n.$page_width,
              page_height: n.$page_height
            });
          return this.$reporter.track(y, r), !0;
        }),
        t
      );
    })(Ht);
    const Wt = Ft;
    var Kt = (function () {
      function e() {
        this.name = 'plugin-web-session-id';
      }
      return (
        (e.prototype.init = function (e) {
          (this.$reporter = e), ye.generateSessionID(this.$reporter);
        }),
        e
      );
    })();
    const Bt = Kt;
    function Xt() {
      return (
        (Xt = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        Xt.apply(null, arguments)
      );
    }
    var Gt = (function () {
      function e() {
        this.name = 'plugin-common-props';
      }
      var t = e.prototype;
      return (
        (t.init = function (e) {
          this.$reporter = e;
        }),
        (t.onDataProduced = function (e) {
          var t = {},
            n = this.$reporter.commonProps;
          Object.keys(n).forEach(function (e) {
            C(n[e]) ? (t[e] = n[e]()) : (t[e] = n[e]);
          });
          var r = e.eventData;
          e.eventData = Xt({}, t, r);
        }),
        e
      );
    })();
    const zt = Gt;
    function Yt() {
      return (
        (Yt = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        Yt.apply(null, arguments)
      );
    }
    var Jt = (function () {
      function e() {
        this.name = 'plugin-user-props';
      }
      var t = e.prototype;
      return (
        (t.init = function (e) {
          this.$reporter = e;
        }),
        (t.onDataProduced = function (e) {
          var t = this.$reporter.profile,
            n = e.eventData;
          e.eventData = Yt({}, t, n);
        }),
        e
      );
    })();
    const Zt = Jt;
    function en() {
      return (
        (en = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        en.apply(null, arguments)
      );
    }
    function tn(e) {
      var t;
      return (
        (null === (t = (e.getEntriesByType('navigation') || [])[0]) ||
        void 0 === t
          ? void 0
          : t.duration) || 0
      );
    }
    function nn(e) {
      if (e.getEntries && 'function' == typeof e.getEntries) {
        var t = e.getEntries(),
          n = 0;
        return (
          t.forEach(function (e) {
            n += e.transferSize || 0;
          }),
          n
        );
      }
      return 0;
    }
    var rn = (function () {
      function e() {
        (this.name = 'plugin-web-auto-collect'),
          (this.collectTags = ['a', 'button']),
          (this.collectClasses = ['uga-track']),
          (this.collectAttrs = ['data-href']),
          (this.DO_NOT_TRACK = 'uga-do-not-track'),
          (this.collectElement = function () {
            return !0;
          }),
          (this.stayInterval = null),
          (this.stayTime = 0);
      }
      var t = e.prototype;
      return (
        (t.init = function (e) {
          (this.$reporter = e), this.initAutoTrackEvent();
        }),
        (t.initAutoTrackEvent = function () {
          var e = this;
          document.addEventListener('click', this.onPageClick.bind(this), {
            capture: !0
          }),
            setTimeout(function () {
              e.onPageLoad();
            });
        }),
        (t.addCollectTags = function (e) {
          if (!R(e))
            return (
              fe.error('addCollectTags params type should be Array<string>'), !1
            );
          var t = e.filter(function (e) {
            return j(e);
          });
          return (
            (this.collectTags = Array.from(
              new Set([].concat(this.collectTags, t))
            )),
            !0
          );
        }),
        (t.addCollectClasses = function (e) {
          var t = this;
          if (!R(e))
            return (
              fe.error('addCollectClasses params type should be Array<string>'),
              !1
            );
          var n = e.filter(function (e) {
            return j(e) && e !== t.DO_NOT_TRACK;
          });
          return (
            (this.collectClasses = Array.from(
              new Set([].concat(this.collectClasses, n))
            )),
            !0
          );
        }),
        (t.addCollectAttrs = function (e) {
          if (!R(e))
            return (
              fe.error('addCollectAttrs params type should be Array<string>'),
              !1
            );
          var t = e.filter(function (e) {
            return j(e);
          });
          return (
            (this.collectAttrs = Array.from(
              new Set([].concat(this.collectAttrs, t))
            )),
            !0
          );
        }),
        (t.onPageLoad = function () {
          if (
            (fe.debug('AutoTrack.onPageLoad.trigger'), !Nt(this.$reporter, S))
          )
            return !1;
          var e = en(
            {},
            {
              duration: Math.round(tn(performance)),
              page_resource_size: nn(performance)
            }
          );
          return this.$reporter.track(v, e), !0;
        }),
        (t.isCollectElement = function (e) {
          if (!e) return !1;
          if ('html' === e.localName || 'body' === e.localName) return !1;
          var t = this.collectTags.some(function (t) {
              return t === e.localName;
            }),
            n = this.collectClasses.some(function (t) {
              return e.classList.contains(t);
            }),
            r = this.collectAttrs.some(function (t) {
              return e.hasAttribute(t);
            }),
            o = e.classList.contains(this.DO_NOT_TRACK);
          return (t || n || r) && !o;
        }),
        (t.findCollectElement = function (e) {
          var t = this,
            n = -1,
            r = function (e) {
              return (
                (n += 1),
                t.isCollectElement(e)
                  ? e
                  : !!(e.parentElement && n < 10) && r(e.parentElement)
              );
            };
          return r(e);
        }),
        (t.onPageClick = function (e) {
          if (
            (fe.debug('AutoTrack.onPageClick.trigger'), !Nt(this.$reporter, k))
          )
            return !1;
          var t = e.target;
          if (!(t instanceof HTMLElement || t instanceof SVGAElement))
            return !1;
          if (t.nodeType !== Node.ELEMENT_NODE) return !1;
          var n = this.findCollectElement(t);
          if (!n) return !1;
          var r = this.$reporter.platform.collect.getElementInfo(n),
            o = this.$reporter.platform.collect.getEventInfo(e),
            i = this.$reporter.platform.collect.getScreenInfo(),
            a = en({}, r, o, {
              viewport_width: i.$viewport_width,
              viewport_height: i.$viewport_height,
              viewport_position: i.$viewport_position,
              page_width: i.$page_width,
              page_height: i.$page_height
            });
          return this.$reporter.track(b, a), !0;
        }),
        e
      );
    })();
    const on = rn;
    function an() {
      return (
        (an = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        an.apply(null, arguments)
      );
    }
    var sn = (function () {
      function e() {
        (this.name = 'plugin-web-link-reaching'), (this.appType = 'web');
      }
      var t = e.prototype;
      return (
        (t.init = function (e) {
          (this.$reporter = e),
            (this.collect = e.platform.collect),
            this.initEvent();
        }),
        (t.initEvent = function () {
          var e = this;
          setTimeout(function () {
            setTimeout(function () {
              e.onPageEnter();
            });
          });
        }),
        (t.onPageEnter = function () {
          var e = this.collect.page.getUrl();
          if (
            !(function (e) {
              var t = K(e),
                n = t.search,
                r = t.hashQuery;
              return (
                (null == n ? void 0 : n.includes('utm_')) ||
                (null == n ? void 0 : n.includes(O)) ||
                (null == r ? void 0 : r.includes('utm_')) ||
                (null == r ? void 0 : r.includes(O))
              );
            })(e)
          )
            return !1;
          if ((fe.debug('AutoTrack.onChannel.trigger'), !Nt(this.$reporter, I)))
            return !1;
          var t = Date.now(),
            n = K(e),
            r = He(e),
            o = n.host,
            i = this.$reporter.options.appId,
            a = this.$reporter.options.domainId,
            s = this.$reporter.trackInfo.aaid,
            u = this.$reporter.trackInfo.sid,
            c = this.$reporter.trackInfo.uid,
            l = {
              ugachannelcode: r.ugachannelcode,
              _domainid: a,
              _appid: i,
              _aaid: s,
              _sid: u,
              _uid: c,
              ot: t,
              eventTime: t,
              parametersMap: an(
                {
                  app_type: this.appType,
                  ot: t,
                  page_host: o,
                  aaid: s,
                  userid: c
                },
                r
              )
            };
          return this.$reporter.trackLinkReaching(l), !0;
        }),
        e
      );
    })();
    const un = sn;
    var cn = (function () {
      function e() {
        (this.name = 'plugin-preset-props'),
          (this.visitTimeInfo = { firstVisitTime: 0, firstVisitTimeDay: 0 });
      }
      var t = e.prototype;
      return (
        (t.init = function (e) {
          (this.$reporter = e),
            (this.collect = e.platform.collect),
            this.initData();
        }),
        (t.initData = function () {
          this.initFirstVisitTime();
        }),
        (t.onDataProduced = function (e) {
          this.updateEventData(e);
        }),
        (t.onDataConsume = function (e) {
          this.updateDataConsume(e);
        }),
        (t.onDataMerged = function (e) {
          this.updateReportData(e);
        }),
        (t.onLinkConsume = function (e) {
          this.updateLinkData(e);
        }),
        (t.initFirstVisitTime = function () {
          var e = this.$reporter.$localStore.get(f) || {},
            t = this.$reporter.trackInfo.uid,
            n = Date.now();
          this.$reporter.checkVisitInfo(e, t, n);
        }),
        (t.getVisitInfo = function (e) {
          return this.$reporter.getVisitInfo(e);
        }),
        (t.getHashCodeInfo = function () {
          return { hashcode: me() };
        }),
        e
      );
    })();
    function ln() {
      return (
        (ln = Object.assign
          ? Object.assign.bind()
          : function (e) {
              for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n)
                  ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
              }
              return e;
            }),
        ln.apply(null, arguments)
      );
    }
    function hn(e, t) {
      return (
        (hn = Object.setPrototypeOf
          ? Object.setPrototypeOf.bind()
          : function (e, t) {
              return (e.__proto__ = t), e;
            }),
        hn(e, t)
      );
    }
    var pn = [
        'google.com',
        'google.cn',
        'bing.com',
        'www.baidu.com',
        'm.baidu.com',
        'yahoo.com',
        'yandex.com',
        'naver.com',
        'duckduckgo.com',
        'sougou.com',
        'so.com',
        'youdao.com',
        'ask.com',
        'm.sm.cn'
      ],
      fn = [
        'facebook.com',
        'twitter.com',
        'instagram.com',
        'whatsapp.com',
        'tiktok.com',
        'reddit.com',
        'pinterest.com',
        'zhihu.com',
        'douban.com',
        'weibo.com',
        'tieba.baidu.com',
        'wechat.com',
        'maimai.cn',
        'linkedin.com',
        'renren.com',
        'toutiao.com',
        'csdn.net',
        'oschina.net',
        '51cto.com',
        'juejin.cn',
        'infoq.cn',
        'cnblogs.com',
        'weixin.qq.com',
        'douyin.com',
        'bilibili.com',
        'huya.com',
        'douyu.com',
        'kuaishou.com'
      ];
    const dn = (function (e) {
      function t() {
        var t;
        return ((t = e.call(this) || this).name = 'plugin-web-preset-props'), t;
      }
      var n, r;
      (r = e),
        ((n = t).prototype = Object.create(r.prototype)),
        (n.prototype.constructor = n),
        hn(n, r);
      var o = t.prototype;
      return (
        (o.getEventPropsForPreset = function (e) {
          var t = this.getHashCodeInfo(),
            n = this.getVisitInfo(e),
            r = this.getSessionInfo(),
            o = this.getPageInfo(),
            i = this.getUtmInfo(),
            a = this.getLibraryInfo();
          return ln(
            {},
            t,
            n,
            r,
            i,
            o,
            this.getBrowserInfo(),
            a,
            this.getScreenInfo(),
            this.getSourceInfo(),
            this.getTypeInfo(),
            this.getIdInfo()
          );
        }),
        (o.updateEventData = function (e) {
          var t = this.getEventPropsForPreset(e),
            n = e.eventData;
          e.eventData = ln({}, t, n);
        }),
        (o.updateDataConsume = function (e) {}),
        (o.updateLinkData = function (e) {
          var t = this.getHashCodeInfo(),
            n = this.getEventPropsForPreset(e),
            r = e.parametersMap;
          e.parametersMap = ln({}, t, n, r);
        }),
        (o.updateReportData = function (e) {
          if (!L(e.body)) return !1;
          var t = this.collect.screen.getScreenWidth(),
            n = this.collect.screen.getScreenHeight();
          return (
            (e.body.ut = this.collect.UA.getUserAgentType()),
            (e.body.ul = this.collect.UA.getUserAgentLang()),
            (e.body.vpr = t + ' X ' + n),
            (e.body.urlref = this.collect.page.getReferrer()),
            !0
          );
        }),
        (o.getLibraryInfo = function () {
          return this.collect.getLibraryInfo();
        }),
        (o.getBrowserInfo = function () {
          return this.collect.getBrowserInfo();
        }),
        (o.getScreenInfo = function () {
          var e = this.collect.getScreenInfo();
          return {
            $screen_width: e.$screen_width,
            $screen_height: e.$screen_height
          };
        }),
        (o.getPageInfo = function () {
          var e =
              this.$reporter.trackInfo.title ||
              this.$reporter.platform.collect.page.getTitle(),
            t = this.$reporter.trackInfo.titlePrev,
            n =
              this.$reporter.trackInfo.url ||
              this.$reporter.platform.collect.page.getUrl(),
            r = this.$reporter.trackInfo.urlPrev,
            o = K(n),
            i = K(r);
          return {
            page_title: e,
            page_url: n,
            page_host: o.host,
            page_path: o.pathname,
            page_hash_path: o.hashPath,
            page_hash_query: o.hashQuery,
            pre_page_title: t,
            pre_page_url: r,
            pre_page_host: i.host,
            pre_page_path: i.pathname,
            pre_page_hash_path: i.hashPath,
            pre_page_hash_query: i.hashQuery
          };
        }),
        (o.getSessionInfo = function () {
          return { session_id: this.$reporter.trackInfo.sid };
        }),
        (o.getUtmInfo = function () {
          var e = this.collect.getUtmInfo(),
            t = this.getUtmInfoCache();
          return (
            this.isValidUtmParams(e) && ((t = e), this.storeUtmInfo(t)),
            {
              utm_campaign: t.$utm_campaign,
              utm_content: t.$utm_content,
              utm_matching_type: t.$utm_matching_type,
              utm_medium: t.$utm_medium,
              utm_source: t.$utm_source,
              utm_term: t.$utm_term
            }
          );
        }),
        (o.isValidUtmParams = function (e) {
          return m.some(function (t) {
            return '' !== (e['$' + t] || '');
          });
        }),
        (o.storeUtmInfo = function (e) {
          var t = this;
          m.forEach(function (n) {
            var r = e['$' + n] || '';
            t.$reporter.$localStore.set(n, r, {});
          }),
            this.$reporter.$localStore.write();
        }),
        (o.getUtmInfoCache = function () {
          var e = this,
            t = {
              $utm_campaign: '',
              $utm_content: '',
              $utm_matching_type: '',
              $utm_medium: '',
              $utm_source: '',
              $utm_term: ''
            };
          return (
            m.forEach(function (n) {
              var r = e.$reporter.$localStore.get(n);
              r && (t['$' + n] = r);
            }),
            t
          );
        }),
        (o.getSourceInfo = function () {
          var e = this.collect.page.getUrl(),
            t = this.collect.page.getReferrer(),
            n = K(e),
            r = K(t),
            o = n.host,
            i = r.host,
            a = 'AD',
            s = 'SEARCH',
            u = 'SOCIAL',
            c = 'INNER',
            l = 'BLANK',
            h = 'OTHER',
            p = pn.concat(this.$reporter.sourceTypeOption.search),
            f = fn.concat(this.$reporter.sourceTypeOption.social),
            d = h;
          return (
            e.includes('utm_')
              ? (d = a)
              : (p.some(function (e) {
                  return t.includes(e);
                }) && (d = s),
                f.some(function (e) {
                  return t.includes(e);
                }) && (d = u)),
            '' === t && (d = l),
            '' !== o && '' !== i && o === i && (d = c),
            { referrer: t, referrer_host: i, source_type: d }
          );
        }),
        (o.getIdInfo = function () {
          return { uid: this.$reporter.trackInfo.uid };
        }),
        (o.getTypeInfo = function () {
          return { app_type: 'web' };
        }),
        t
      );
    })(cn);
    function gn() {
      var e,
        t,
        n = 'function' == typeof Symbol ? Symbol : {},
        r = n.iterator || '@@iterator',
        o = n.toStringTag || '@@toStringTag';
      function i(n, r, o, i) {
        var u = r && r.prototype instanceof s ? r : s,
          c = Object.create(u.prototype);
        return (
          mn(
            c,
            '_invoke',
            (function (n, r, o) {
              var i,
                s,
                u,
                c = 0,
                l = o || [],
                h = !1,
                p = {
                  p: 0,
                  n: 0,
                  v: e,
                  a: f,
                  f: f.bind(e, 4),
                  d: function (t, n) {
                    return (i = t), (s = 0), (u = e), (p.n = n), a;
                  }
                };
              function f(n, r) {
                for (s = n, u = r, t = 0; !h && c && !o && t < l.length; t++) {
                  var o,
                    i = l[t],
                    f = p.p,
                    d = i[2];
                  n > 3
                    ? (o = d === r) &&
                      ((u = i[(s = i[4]) ? 5 : ((s = 3), 3)]),
                      (i[4] = i[5] = e))
                    : i[0] <= f &&
                      ((o = n < 2 && f < i[1])
                        ? ((s = 0), (p.v = r), (p.n = i[1]))
                        : f < d &&
                          (o = n < 3 || i[0] > r || r > d) &&
                          ((i[4] = n), (i[5] = r), (p.n = d), (s = 0)));
                }
                if (o || n > 1) return a;
                throw ((h = !0), r);
              }
              return function (o, l, d) {
                if (c > 1) throw TypeError('Generator is already running');
                for (
                  h && 1 === l && f(l, d), s = l, u = d;
                  (t = s < 2 ? e : u) || !h;

                ) {
                  i ||
                    (s
                      ? s < 3
                        ? (s > 1 && (p.n = -1), f(s, u))
                        : (p.n = u)
                      : (p.v = u));
                  try {
                    if (((c = 2), i)) {
                      if ((s || (o = 'next'), (t = i[o]))) {
                        if (!(t = t.call(i, u)))
                          throw TypeError('iterator result is not an object');
                        if (!t.done) return t;
                        (u = t.value), s < 2 && (s = 0);
                      } else
                        1 === s && (t = i.return) && t.call(i),
                          s < 2 &&
                            ((u = TypeError(
                              "The iterator does not provide a '" +
                                o +
                                "' method"
                            )),
                            (s = 1));
                      i = e;
                    } else if ((t = (h = p.n < 0) ? u : n.call(r, p)) !== a)
                      break;
                  } catch (t) {
                    (i = e), (s = 1), (u = t);
                  } finally {
                    c = 1;
                  }
                }
                return { value: t, done: h };
              };
            })(n, o, i),
            !0
          ),
          c
        );
      }
      var a = {};
      function s() {}
      function u() {}
      function c() {}
      t = Object.getPrototypeOf;
      var l = [][r]
          ? t(t([][r]()))
          : (mn((t = {}), r, function () {
              return this;
            }),
            t),
        h = (c.prototype = s.prototype = Object.create(l));
      function p(e) {
        return (
          Object.setPrototypeOf
            ? Object.setPrototypeOf(e, c)
            : ((e.__proto__ = c), mn(e, o, 'GeneratorFunction')),
          (e.prototype = Object.create(h)),
          e
        );
      }
      return (
        (u.prototype = c),
        mn(h, 'constructor', c),
        mn(c, 'constructor', u),
        (u.displayName = 'GeneratorFunction'),
        mn(c, o, 'GeneratorFunction'),
        mn(h),
        mn(h, o, 'Generator'),
        mn(h, r, function () {
          return this;
        }),
        mn(h, 'toString', function () {
          return '[object Generator]';
        }),
        (gn = function () {
          return { w: i, m: p };
        })()
      );
    }
    function mn(e, t, n, r) {
      var o = Object.defineProperty;
      try {
        o({}, '', {});
      } catch (e) {
        o = 0;
      }
      (mn = function (e, t, n, r) {
        function i(t, n) {
          mn(e, t, function (e) {
            return this._invoke(t, n, e);
          });
        }
        t
          ? o
            ? o(e, t, {
                value: n,
                enumerable: !r,
                configurable: !r,
                writable: !r
              })
            : (e[t] = n)
          : (i('next', 0), i('throw', 1), i('return', 2));
      }),
        mn(e, t, n, r);
    }
    function vn(e, t, n, r, o, i, a) {
      try {
        var s = e[i](a),
          u = s.value;
      } catch (e) {
        return void n(e);
      }
      s.done ? t(u) : Promise.resolve(u).then(r, o);
    }
    function wn(e) {
      return function () {
        var t = this,
          n = arguments;
        return new Promise(function (r, o) {
          var i = e.apply(t, n);
          function a(e) {
            vn(i, r, o, a, s, 'next', e);
          }
          function s(e) {
            vn(i, r, o, a, s, 'throw', e);
          }
          a(void 0);
        });
      };
    }
    var yn = null;
    var bn = (function () {
      function e() {}
      return (
        (e.loadScript = function (e) {
          return new Promise(function (t, n) {
            if (e && 'string' == typeof e) {
              var r = document.createElement('script');
              (r.src = e),
                (r.async = !0),
                document.head.appendChild(r),
                (r.onload = t),
                (r.onerror = n);
            } else n(new Error('Invalid URL'));
          });
        }),
        (e.require = (function () {
          var e = wn(
            gn().m(function e(t, n) {
              return gn().w(
                function (e) {
                  for (;;)
                    switch ((e.p = e.n)) {
                      case 0:
                        return (
                          this.scriptCache[t] ||
                            (this.scriptCache[t] = this.loadScript(t)),
                          (e.p = 1),
                          (e.n = 2),
                          this.scriptCache[t]
                        );
                      case 2:
                        return e.a(2, window[n]);
                      case 3:
                        return (e.p = 3), e.v, e.a(2, null);
                    }
                },
                e,
                this,
                [[1, 3]]
              );
            })
          );
          return function (t, n) {
            return e.apply(this, arguments);
          };
        })()),
        e
      );
    })();
    bn.scriptCache = {};
    var Tn = (function () {
      function e() {
        (this.name = 'plugin-remote'), (this.isLoaded = !1);
      }
      var n = e.prototype;
      return (
        (n.init = function (e) {
          (this.$reporter = e), this.initEventListerner();
        }),
        (n.initEventListerner = function () {
          var e = this;
          window.addEventListener('message', this.onMessage.bind(this)),
            Dt.on(t.REQUEST_START, this.onRequestStart.bind(this)),
            Dt.on(t.REQUEST_LOAD, this.onRequestLoad.bind(this)),
            this.onRequestLoad({
              method: 'GET',
              url: this.$reporter.platform.collect.page.getUrl(),
              status: 0,
              startTime: Date.now(),
              duration: 0
            }),
            window.addEventListener('pageshow', this.onPageEnter.bind(this)),
            Dt.on(Q.PUSH, this.onPagePathChange.bind(this)),
            Dt.on(Q.REPLACE, this.onPagePathChange.bind(this)),
            window.addEventListener(
              'popstate',
              this.onPagePathChange.bind(this)
            ),
            window.addEventListener(
              'hashchange',
              this.onPageHashChange.bind(this)
            ),
            window.addEventListener('hashchange', function () {
              return e.onPageHashChange();
            });
        }),
        (n.onRequestStart = function (e) {
          this.$reporter.logger.debug('PluginRemote.onRequestStart', e),
            this.onRequest();
        }),
        (n.onRequestLoad = function (e) {
          this.$reporter.logger.debug('PluginRemote.onRequestLoad', e),
            this.onRequest();
        }),
        (n.onRequest = function () {
          var e = this;
          if (this.isLoaded) return !1;
          yn && clearTimeout(yn);
          var t = '4g' === it() ? 1e3 : 5e3;
          return (
            (yn = setTimeout(function () {
              var n;
              Promise.race([
                new Promise(function (e) {
                  'complete' === document.readyState
                    ? e(!0)
                    : window.addEventListener('load', function () {
                        e(!0);
                      });
                }),
                ((n = t),
                new Promise(function (e) {
                  return setTimeout(function () {
                    return e({});
                  }, n);
                }))
              ]).then(function () {
                (e.isLoaded = !0),
                  e.$reporter.logger.info('PluginRemote.loaded');
                var t = {
                  type: 'loaded',
                  version: o,
                  data: { url: window.location.href }
                };
                e.sendMessage(t);
              });
            }, t)),
            !0
          );
        }),
        (n.onPagePathChange = function () {
          this.onPageChange();
        }),
        (n.onPageHashChange = function () {
          this.$reporter.techStack.history === N.HASH && this.onPageChange();
        }),
        (n.onPageEnter = function () {
          this.$reporter.logger.debug('PluginRemote.onPageEnter');
          var e = {
            type: 'page',
            version: o,
            data: { url: window.location.href }
          };
          this.sendMessage(e);
        }),
        (n.onPageChange = function () {
          var e = this;
          clearTimeout(this.pageTimer),
            (this.pageTimer = setTimeout(function () {
              e.onPageEnter();
            }, 300));
        }),
        (n.onMessage = (function () {
          var e = wn(
            gn().m(function e(t) {
              var n, r, i, a, s;
              return gn().w(
                function (e) {
                  for (;;)
                    switch (e.n) {
                      case 0:
                        if (
                          ('ping' === (n = t.data).type &&
                            (this.remoteOrigin = n.data.origin),
                          'load-plugin' !== n.type)
                        ) {
                          e.n = 2;
                          break;
                        }
                        return (
                          (r = n.data.url),
                          (i = n.data.name),
                          this.$reporter.logger.debug(
                            'PluginRemote.loadPlugin',
                            'plugin ' + i + ' load failured'
                          ),
                          (e.n = 1),
                          bn.require(r, i)
                        );
                      case 1:
                        if ((a = e.v) && C(a))
                          try {
                            (s = new a()),
                              this.$reporter.isInstalledPlugin(s) ||
                                (this.$reporter.installPlugin(s),
                                this.$reporter.initPlugin(s)),
                              this.sendMessage({
                                type: 'ready',
                                version: o,
                                data: n.data
                              }),
                              this.$reporter.logger.debug(
                                'PluginRemote.loadPlugin',
                                'plugin ' + i + ' load success'
                              );
                          } catch (e) {
                            this.$reporter.logger.debug(
                              'PluginRemote.loadPlugin',
                              'plugin ' + i + ' install failure'
                            );
                          }
                        else
                          this.$reporter.logger.debug(
                            'PluginRemote.loadPlugin',
                            'plugin ' + i + ' load failure'
                          );
                      case 2:
                        return e.a(2);
                    }
                },
                e,
                this
              );
            })
          );
          return function (t) {
            return e.apply(this, arguments);
          };
        })()),
        (n.sendMessage = function (e) {
          if (window.top === window) return !1;
          var t = this.remoteOrigin;
          return (
            !!t &&
            (this.$reporter.logger.debug('PluginRemote.sendMessage', e),
            window.top.postMessage(e, t),
            !1)
          );
        }),
        e
      );
    })();
    const Sn = Tn;
    const _n = [
      new Mt(),
      new Wt(),
      new Bt(),
      new un(),
      new on(),
      new dn(),
      new zt(),
      new Zt(),
      new Sn()
    ];
    function En(e) {
      return j(e) || x(e)
        ? null === e || '' === e
          ? ((Ee.trackInfo.uid = ''), this)
          : ((Ee.trackInfo.uid = e), Ee.onSetUserInfo(), this)
        : (fe.error('setUid params type should be string or null.'), !1);
    }
    function kn(e) {
      if (!L(e)) return fe.error('params type should be object.'), !1;
      var t = e.webLoad,
        n = void 0 !== t && t,
        r = e.webShow,
        o = void 0 !== r && r,
        i = e.webStay,
        a = void 0 !== i && i,
        s = e.webLeave,
        u = void 0 !== s && s,
        c = e.webClick,
        l = void 0 !== c && c,
        h = e.webChannel,
        p = void 0 !== h && h;
      return (
        (Ee.autoTrack.webLoad = n),
        (Ee.autoTrack.webShow = o),
        (Ee.autoTrack.webStay = a),
        (Ee.autoTrack.webLeave = u),
        (Ee.autoTrack.webClick = l),
        (Ee.autoTrack.webChannel = p),
        this
      );
    }
    function Pn(e) {
      return L(e)
        ? ((Ee.autoTrackOption = e), this)
        : (fe.error('params type should be object.'), !1);
    }
    function In(e) {
      if (!L(e)) return fe.error('params type should be object.'), !1;
      var t = e.search,
        n = void 0 === t ? [] : t,
        r = e.social,
        o = void 0 === r ? [] : r;
      return R(n)
        ? R(o)
          ? ((Ee.sourceTypeOption.search = n),
            (Ee.sourceTypeOption.social = o),
            this)
          : (fe.error('params.social type should be object.'), !1)
        : (fe.error('params.search type should be object.'), !1);
    }
    function $n(e) {
      var t = Ee.pluginMap['plugin-web-auto-collect'];
      return t
        ? (t.addCollectTags(e), this)
        : (fe.error('plugin-web-auto-collect does not exist.'), this);
    }
    function On(e) {
      var t = Ee.pluginMap['plugin-web-auto-collect'];
      return t
        ? (t.addCollectClasses(e), this)
        : (fe.error('plugin-web-auto-collect does not exist.'), this);
    }
    function Dn(e) {
      var t = Ee.pluginMap['plugin-web-auto-collect'];
      return t
        ? (t.addCollectAttrs(e), this)
        : (fe.error('plugin-web-auto-collect does not exist.'), this);
    }
    function Cn(e) {
      if (!U(e.isSpa)) return fe.error('params isSpa should be boolean.'), this;
      if (((Ee.techStack.isSpa = e.isSpa), e.history)) {
        if (e.history !== N.PATH && e.history !== N.HASH)
          return (
            fe.error(
              'params history should be ' + N.PATH + ' or ' + N.HASH + '.'
            ),
            this
          );
        Ee.techStack.history = e.history;
      }
      return this;
    }
    function Ln(e, t) {
      return (
        void 0 === e && (e = !1),
        void 0 === t && (t = ''),
        U(e)
          ? j(t)
            ? location.hostname.endsWith(t)
              ? ((Ee.config.aaidLocation = e ? 'cookie' : 'localStorage'),
                t && (Ee.config.cookieDomain = t),
                this)
              : (fe.error(
                  'params cookieDomain should be include current domain.'
                ),
                this)
            : (fe.error('params cookieDomain should be string.'), this)
          : (fe.error('params isCookie should be boolean.'), this)
      );
    }
    function Rn(e) {
      return U(e)
        ? ((Ee.config.visibleAsView = e), this)
        : (fe.error('params should be boolean.'), this);
    }
    function An(e) {
      return (
        void 0 === e && (e = !1),
        U(e)
          ? ((Ee.config.cookieEnable = e),
            e ? (ye.generate(Ee), ye.flush(Ee)) : ye.clear(Ee),
            this)
          : (fe.error('setCookieEnable params should be boolean.'), this)
      );
    }
    function jn(e) {
      return (
        fe.warn(
          'method setReportServer will be deprecated. please use setOptions'
        ),
        j(e)
          ? '' === e
            ? (fe.error('setReportServer params must be not empty.'), !1)
            : ((Ee.options.serverUrl = e), this)
          : (fe.error(
              'setReportServer params type should be string. but params is ' + e
            ),
            !1)
      );
    }
    function Un(e) {
      return (
        fe.warn(
          'method setOnReportUrl will be deprecated. please use setOptions'
        ),
        !!jn.call(this, e) && this
      );
    }
    function xn(e) {
      return (
        fe.warn('method setDomainId will be deprecated. please use setOptions'),
        j(e)
          ? /^[a-zA-Z0-9_\-./]*$/.test(e)
            ? ((Ee.options.domainId = e), this)
            : (fe.error(
                'setDomainId params is invalid. regexp [a-zA-Z0-9_-./]'
              ),
              !1)
          : (fe.error('setDomainId params type should be string.'), !1)
      );
    }
    function Mn(e) {
      return (
        fe.warn('method setAppId will be deprecated. please use setOptions'),
        j(e)
          ? /^[a-zA-Z0-9_\-./]*$/.test(e)
            ? ((Ee.options.appId = e), this)
            : (fe.error('setAppId params is invalid. regexp [a-zA-Z0-9_-./]'),
              !1)
          : (fe.error('setAppId params type should be string.'), !1)
      );
    }
    function Hn(e) {
      return (
        fe.warn('method setIdsite will be deprecated. please use setOptions'),
        !!Mn.call(this, e) && this
      );
    }
    function qn(e) {
      return fe.warn('method setTitle is deprecated.'), this;
    }
    function Nn(e) {
      return (
        fe.warn(
          'method setPageData will be deprecated. please use setUserProfile'
        ),
        (Ee.profile = e),
        this
      );
    }
    function Vn(e) {
      return (
        fe.warn(
          'method setSessionTimeoutDuration will be deprecated. please use setSessionDuration'
        ),
        !!br.call(this, e) && this
      );
    }
    function Qn(e) {
      return (
        fe.warn('method setUserAccount will be deprecated. please use setUid'),
        this
      );
    }
    function Fn(e) {
      return (
        fe.warn('method setUserIdentity will be deprecated. please use setUid'),
        !!En.call(this, e) && this
      );
    }
    function Wn(e) {
      return fe.warn('method setBaseinfotypeSwitch is deprecated'), this;
    }
    function Kn(e) {
      return fe.warn('method setWindowCloseSwitch is deprecated'), this;
    }
    function Bn(e) {
      return fe.warn('method sendPageInfo is deprecated'), this;
    }
    function Xn(e) {
      return fe.warn('method sendPageClose is deprecated'), this;
    }
    function Gn(e, t, n) {
      return (
        fe.warn('method sendClickData will be deprecated. please use on Event'),
        !!dr.call(this, e, t, n) && this
      );
    }
    function zn(e) {
      return fe.warn('method setCXX is deprecated'), this;
    }
    function Yn(e) {
      return fe.warn('method setDefaultPageData is deprecated'), this;
    }
    function Jn(e) {
      return fe.warn('method setHttpHeader is deprecated'), this;
    }
    function Zn(e) {
      return fe.warn('method setIsUseUrl is deprecated'), this;
    }
    function er(e) {
      return fe.warn('method setIsUseCookie is deprecated'), this;
    }
    function tr(e) {
      return (
        fe.warn('method setDebugMode will be deprecated'),
        !!wr.call(this, e) && this
      );
    }
    function nr() {
      return fe.warn('method setCustomUrlParams is deprecated'), this;
    }
    function rr() {
      return fe.warn('method setAutoReportPageStart is deprecated'), this;
    }
    function or() {
      return fe.warn('method setAutoReportPageStart is deprecated'), this;
    }
    function ir() {
      return fe.warn('method sendPageStart is deprecated'), this;
    }
    function ar() {
      return fe.warn('method sendPageEnd is deprecated'), this;
    }
    function sr() {
      return fe.warn('method push is deprecated'), this;
    }
    function ur(e) {
      return (
        fe.warn(
          'method registerCommonProp will be deprecated please use setCommonProp'
        ),
        L(e)
          ? ((Ee.commonProps = Object.assign(Ee.commonProps, e)), this)
          : (fe.error('registerCommonProp params must be an object', e), !1)
      );
    }
    var cr = o;
    function lr(e) {
      if (!L(e)) return fe.error('initOptions params shoule be object.'), !1;
      var t = !0;
      if (
        (['serverUrl', 'appId'].forEach(function (n) {
          e[n] ||
            (fe.error('initOptions params ' + n + ' value should be not empty'),
            (t = !1));
        }),
        !t)
      )
        return !1;
      var n = e.serverUrl,
        r = void 0 === n ? '' : n,
        o = e.appId,
        i = void 0 === o ? '' : o;
      return /^[a-zA-Z0-9_\-./:]+$/.test(r)
        ? !!/^[a-zA-Z0-9_\-./]+$/.test(i) ||
            (fe.error(
              'initOptions params appId is value shoule be [a-zA-Z0-9_\\-./]',
              i
            ),
            !1)
        : (fe.error(
            'initOptions params serverUrl value shoule be [a-zA-Z0-9_\\-./]',
            r
          ),
          !1);
    }
    function hr(e) {
      return !!lr.call(this, e) && (Ee.setOptions(e), this);
    }
    function pr() {
      return Ee.init(), this;
    }
    function fr(e) {
      return !!hr.call(this, e) && (Ee.init(), this);
    }
    function dr(e, t, n) {
      return e
        ? n
          ? j(e)
            ? j(t)
              ? L(n)
                ? (Ee.track(e, n), this)
                : (fe.error('sendData params eventData shoule be object'), !1)
              : (fe.error('sendData params eventLabel shoule be string'), !1)
            : (fe.error('sendData params eventCode shoule be string'), !1)
          : (fe.error('sendData params eventData shoule be not empty'), !1)
        : (fe.error('sendData params eventCode shoule be not empty'), !1);
    }
    function gr(e, t) {
      return !!dr.call(this, e, '', t) && this;
    }
    function mr(e) {
      return U(e)
        ? ((Ee.config.useAuth = e), this)
        : (fe.error('useAuth type should be boolean.'), !1);
    }
    function vr(e) {
      return U(e)
        ? ((Ee.config.useEncrypt = e), this)
        : (fe.error('useEncrypt type should be boolean.'), !1);
    }
    function wr(e) {
      return U(e)
        ? ((Ee.config.useDebugMode = e), this)
        : (fe.error('setDebugMode params type should be boolean'), !1);
    }
    function yr(e) {
      return U(e)
        ? ((Ee.config.reportEnable = e), this)
        : (fe.error('setReportEnable params type must be boolean'), !1);
    }
    function br(e) {
      return A(e)
        ? ((Ee.config.sessionTime = e), this)
        : (fe.error('setSessionDuration params type should be number.'), !1);
    }
    function Tr(e) {
      return A(e)
        ? e < 10
          ? (fe.error('setClickDebounceTime params cannot be less than 10.'),
            !1)
          : e > 1e3
          ? (fe.error(
              'setClickDebounceTime params cannot be greater than 1000.'
            ),
            !1)
          : ((Ee.config.clickDebounceTime = e), this)
        : (fe.error('setClickDebounceTime params type should be number.'), !1);
    }
    function Sr(e) {
      return j(e) || x(e)
        ? ((null !== e && '' !== e) || (Ee.trackInfo.mobile = ''),
          e && (Ee.trackInfo.mobile = e),
          Ee.onSetUserInfo(),
          this)
        : (fe.error('setMobile params type should be string or null.'), !1);
    }
    function _r(e) {
      return L(e)
        ? ((Ee.profile = e), this)
        : (fe.error('setUserProfile params type should be object.'), !1);
    }
    function Er(e) {
      return L(e)
        ? ((Ee.commonProps = Object.assign(Ee.commonProps, e)), this)
        : (fe.error('setCommonProp params must be an object', e), !1);
    }
    function kr() {
      return Ee.trackInfo.aaid;
    }
    function Pr(e) {
      return (
        !!(function (e) {
          return j(e)
            ? !!['error', 'warn', 'info', 'debug', 'trace'].some(function (t) {
                return t === e.toLocaleLowerCase();
              }) ||
                (fe.error('level shoule be in error warn info debug trace'), !1)
            : (fe.error('level shoule be string.'), !1);
        })(e) && (fe.setLevel(e), this)
      );
    }
    function Ir(e) {
      return L(e)
        ? (Ee.installPlugin(e), this)
        : (fe.error('method installPlugin params shoule be object.'), !1);
    }
    function $r(e) {
      return j(e)
        ? '' === e
          ? (fe.error('method getPlugin params must be not empty.'), !1)
          : Ee.pluginMap[e] || null
        : (fe.error('method getPlugin params shoule be string.'), !1);
    }
    function Or(e) {
      return L(e)
        ? e.install && C(e.install)
          ? (e.install(Ee, fe, this), this)
          : this
        : (fe.error('method installAdpater params shoule be object.'), !1);
    }
    function Dr(e) {
      return A(e)
        ? (Ee.setReportDelay(e), !0)
        : (fe.error('method setReportDelay params shoule be number.'), !1);
    }
    var Cr = !1;
    function Lr(e, t) {
      return (
        void 0 === e && (e = 0),
        void 0 === t && (t = 30),
        Cr && fe.warn('method setSessionMode is been set up'),
        0 !== e && 1 !== e
          ? (fe.error(
              'method setSessionMode params duration must be in [0, 1].'
            ),
            !1)
          : A(t)
          ? t < 1
            ? (fe.error('method setSessionMode params duration is too small'),
              !1)
            : t > 1440
            ? (fe.error('method setSessionMode params duration is too large'),
              !1)
            : (t < 10 &&
                fe.warn('method setSessionMode params duration is too small'),
              (Cr = !0),
              (Ee.config.sessionMode = e),
              (Ee.config.sessionTime = 60 * t * 1e3),
              !0)
          : (fe.error(
              'method setSessionMode params duration shoule be number.'
            ),
            !1)
      );
    }
    window.ugasdk || Ee.installPlatform(_t),
      Ee.registerInitHook(function () {
        _n.forEach(function (e) {
          Ee.installPlugin(e);
        }),
          Ee.installPage($t);
      });
    var Rr = e;
    window.ugasdk && (Rr = window.ugasdk);
    const Ar = Rr;
  })(),
    (window.ugasdk = r.default);
})();
