@meta-track/vue3
Version:
前端埋点JS - vue3版本
1,481 lines (1,475 loc) • 462 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _arrayLikeToArray$1(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _arrayWithHoles$1(r) {
if (Array.isArray(r)) return r;
}
function _arrayWithoutHoles$1(r) {
if (Array.isArray(r)) return _arrayLikeToArray$1(r);
}
function _classCallCheck$1(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties$1(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$1(o.key), o);
}
}
function _createClass$1(e, r, t) {
return r && _defineProperties$1(e.prototype, r), t && _defineProperties$1(e, t), Object.defineProperty(e, "prototype", {
writable: !1
}), e;
}
function _createForOfIteratorHelper$1(r, e) {
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (!t) {
if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
t && (r = t);
var n = 0,
F = function () {};
return {
s: F,
n: function () {
return n >= r.length ? {
done: !0
} : {
done: !1,
value: r[n++]
};
},
e: function (r) {
throw r;
},
f: F
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var o,
a = !0,
u = !1;
return {
s: function () {
t = t.call(r);
},
n: function () {
var r = t.next();
return a = r.done, r;
},
e: function (r) {
u = !0, o = r;
},
f: function () {
try {
a || null == t.return || t.return();
} finally {
if (u) throw o;
}
}
};
}
function _iterableToArray$1(r) {
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
function _iterableToArrayLimit$1(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableSpread$1() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _regeneratorRuntime$1() {
_regeneratorRuntime$1 = function () {
return r;
};
var t,
r = {},
e = Object.prototype,
n = e.hasOwnProperty,
o = "function" == typeof Symbol ? Symbol : {},
i = o.iterator || "@@iterator",
a = o.asyncIterator || "@@asyncIterator",
u = o.toStringTag || "@@toStringTag";
function c(t, r, e, n) {
Object.defineProperty(t, r, {
value: e,
enumerable: !n,
configurable: !n,
writable: !n
});
}
try {
c({}, "");
} catch (t) {
c = function (t, r, e) {
return t[r] = e;
};
}
function h(r, e, n, o) {
var i = e && e.prototype instanceof Generator ? e : Generator,
a = Object.create(i.prototype);
return c(a, "_invoke", function (r, e, n) {
var o = 1;
return function (i, a) {
if (3 === o) throw Error("Generator is already running");
if (4 === o) {
if ("throw" === i) throw a;
return {
value: t,
done: !0
};
}
for (n.method = i, n.arg = a;;) {
var u = n.delegate;
if (u) {
var c = d(u, n);
if (c) {
if (c === f) continue;
return c;
}
}
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
if (1 === o) throw o = 4, n.arg;
n.dispatchException(n.arg);
} else "return" === n.method && n.abrupt("return", n.arg);
o = 3;
var h = s(r, e, n);
if ("normal" === h.type) {
if (o = n.done ? 4 : 2, h.arg === f) continue;
return {
value: h.arg,
done: n.done
};
}
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
}
};
}(r, n, new Context(o || [])), !0), a;
}
function s(t, r, e) {
try {
return {
type: "normal",
arg: t.call(r, e)
};
} catch (t) {
return {
type: "throw",
arg: t
};
}
}
r.wrap = h;
var f = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var l = {};
c(l, i, function () {
return this;
});
var p = Object.getPrototypeOf,
y = p && p(p(x([])));
y && y !== e && n.call(y, i) && (l = y);
var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
function g(t) {
["next", "throw", "return"].forEach(function (r) {
c(t, r, function (t) {
return this._invoke(r, t);
});
});
}
function AsyncIterator(t, r) {
function e(o, i, a, u) {
var c = s(t[o], t, i);
if ("throw" !== c.type) {
var h = c.arg,
f = h.value;
return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
e("next", t, a, u);
}, function (t) {
e("throw", t, a, u);
}) : r.resolve(f).then(function (t) {
h.value = t, a(h);
}, function (t) {
return e("throw", t, a, u);
});
}
u(c.arg);
}
var o;
c(this, "_invoke", function (t, n) {
function i() {
return new r(function (r, o) {
e(t, n, r, o);
});
}
return o = o ? o.then(i, i) : i();
}, !0);
}
function d(r, e) {
var n = e.method,
o = r.i[n];
if (o === t) return e.delegate = null, "throw" === n && r.i.return && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
var i = s(o, r.i, e.arg);
if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
var a = i.arg;
return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
}
function w(t) {
this.tryEntries.push(t);
}
function m(r) {
var e = r[4] || {};
e.type = "normal", e.arg = t, r[4] = e;
}
function Context(t) {
this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0);
}
function x(r) {
if (null != r) {
var e = r[i];
if (e) return e.call(r);
if ("function" == typeof r.next) return r;
if (!isNaN(r.length)) {
var o = -1,
a = function e() {
for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e;
return e.value = t, e.done = !0, e;
};
return a.next = a;
}
}
throw new TypeError(typeof r + " is not iterable");
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) {
var r = "function" == typeof t && t.constructor;
return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
}, r.mark = function (t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
}, r.awrap = function (t) {
return {
__await: t
};
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
return this;
}), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
void 0 === i && (i = Promise);
var a = new AsyncIterator(h(t, e, n, o), i);
return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
return t.done ? t.value : a.next();
});
}, g(v), c(v, u, "Generator"), c(v, i, function () {
return this;
}), c(v, "toString", function () {
return "[object Generator]";
}), r.keys = function (t) {
var r = Object(t),
e = [];
for (var n in r) e.unshift(n);
return function t() {
for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t;
return t.done = !0, t;
};
}, r.values = x, Context.prototype = {
constructor: Context,
reset: function (r) {
if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
},
stop: function () {
this.done = !0;
var t = this.tryEntries[0][4];
if ("throw" === t.type) throw t.arg;
return this.rval;
},
dispatchException: function (r) {
if (this.done) throw r;
var e = this;
function n(t) {
a.type = "throw", a.arg = r, e.next = t;
}
for (var o = e.tryEntries.length - 1; o >= 0; --o) {
var i = this.tryEntries[o],
a = i[4],
u = this.prev,
c = i[1],
h = i[2];
if (-1 === i[0]) return n("end"), !1;
if (!c && !h) throw Error("try statement without catch or finally");
if (null != i[0] && i[0] <= u) {
if (u < c) return this.method = "next", this.arg = t, n(c), !0;
if (u < h) return n(h), !1;
}
}
},
abrupt: function (t, r) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var n = this.tryEntries[e];
if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
var o = n;
break;
}
}
o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
var i = o ? o[4] : {};
return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
},
complete: function (t, r) {
if ("throw" === t.type) throw t.arg;
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
},
finish: function (t) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var e = this.tryEntries[r];
if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
}
},
catch: function (t) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var e = this.tryEntries[r];
if (e[0] === t) {
var n = e[4];
if ("throw" === n.type) {
var o = n.arg;
m(e);
}
return o;
}
}
throw Error("illegal catch attempt");
},
delegateYield: function (r, e, n) {
return this.delegate = {
i: x(r),
r: e,
n: n
}, "next" === this.method && (this.arg = t), f;
}
}, r;
}
function _slicedToArray$1(r, e) {
return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest$1();
}
function _toConsumableArray$1(r) {
return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$1();
}
function _toPrimitive$1(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey$1(t) {
var i = _toPrimitive$1(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function _typeof$1(o) {
"@babel/helpers - typeof";
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$1(o);
}
function _unsupportedIterableToArray$1(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
}
}
function _arrayLikeToArray(r2, a2) {
(null == a2 || a2 > r2.length) && (a2 = r2.length);
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
return n2;
}
function _arrayWithHoles(r2) {
if (Array.isArray(r2)) return r2;
}
function _arrayWithoutHoles(r2) {
if (Array.isArray(r2)) return _arrayLikeToArray(r2);
}
function asyncGeneratorStep(n2, t2, e2, r2, o2, a2, c2) {
try {
var i = n2[a2](c2),
u2 = i.value;
} catch (n3) {
return void e2(n3);
}
i.done ? t2(u2) : Promise.resolve(u2).then(r2, o2);
}
function _asyncToGenerator(n2) {
return function () {
var t2 = this,
e2 = arguments;
return new Promise(function (r2, o2) {
var a2 = n2.apply(t2, e2);
function _next(n3) {
asyncGeneratorStep(a2, r2, o2, _next, _throw, "next", n3);
}
function _throw(n3) {
asyncGeneratorStep(a2, r2, o2, _next, _throw, "throw", n3);
}
_next(void 0);
});
};
}
function _classCallCheck(a2, n2) {
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e2, r2) {
for (var t2 = 0; t2 < r2.length; t2++) {
var o2 = r2[t2];
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey(o2.key), o2);
}
}
function _createClass(e2, r2, t2) {
return r2 && _defineProperties(e2.prototype, r2), t2 && _defineProperties(e2, t2), Object.defineProperty(e2, "prototype", {
writable: false
}), e2;
}
function _createForOfIteratorHelper(r2, e2) {
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
if (!t2) {
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray(r2)) || e2 && r2 && "number" == typeof r2.length) {
t2 && (r2 = t2);
var n2 = 0,
F2 = function F2() {};
return {
s: F2,
n: function n() {
return n2 >= r2.length ? {
done: true
} : {
done: false,
value: r2[n2++]
};
},
e: function e(r3) {
throw r3;
},
f: F2
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var o2,
a2 = true,
u2 = false;
return {
s: function s() {
t2 = t2.call(r2);
},
n: function n() {
var r3 = t2.next();
return a2 = r3.done, r3;
},
e: function e(r3) {
u2 = true, o2 = r3;
},
f: function f() {
try {
a2 || null == t2.return || t2.return();
} finally {
if (u2) throw o2;
}
}
};
}
function _defineProperty(e2, r2, t2) {
return (r2 = _toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
value: t2,
enumerable: true,
configurable: true,
writable: true
}) : e2[r2] = t2, e2;
}
function _iterableToArray(r2) {
if ("undefined" != typeof Symbol && null != r2[Symbol.iterator] || null != r2["@@iterator"]) return Array.from(r2);
}
function _iterableToArrayLimit(r2, l2) {
var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
if (null != t2) {
var e2,
n2,
i,
u2,
a2 = [],
f2 = true,
o2 = false;
try {
if (i = (t2 = t2.call(r2)).next, 0 === l2) {
if (Object(t2) !== t2) return;
f2 = false;
} else for (; !(f2 = (e2 = i.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true);
} catch (r3) {
o2 = true, n2 = r3;
} finally {
try {
if (!f2 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) return;
} finally {
if (o2) throw n2;
}
}
return a2;
}
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function ownKeys(e2, r2) {
var t2 = Object.keys(e2);
if (Object.getOwnPropertySymbols) {
var o2 = Object.getOwnPropertySymbols(e2);
r2 && (o2 = o2.filter(function (r3) {
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
})), t2.push.apply(t2, o2);
}
return t2;
}
function _objectSpread2(e2) {
for (var r2 = 1; r2 < arguments.length; r2++) {
var t2 = null != arguments[r2] ? arguments[r2] : {};
r2 % 2 ? ownKeys(Object(t2), true).forEach(function (r3) {
_defineProperty(e2, r3, t2[r3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function (r3) {
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
});
}
return e2;
}
function _regeneratorRuntime() {
_regeneratorRuntime = function _regeneratorRuntime() {
return r2;
};
var t2,
r2 = {},
e2 = Object.prototype,
n2 = e2.hasOwnProperty,
o2 = "function" == typeof Symbol ? Symbol : {},
i = o2.iterator || "@@iterator",
a2 = o2.asyncIterator || "@@asyncIterator",
u2 = o2.toStringTag || "@@toStringTag";
function c2(t3, r3, e3, n3) {
Object.defineProperty(t3, r3, {
value: e3,
enumerable: !n3,
configurable: !n3,
writable: !n3
});
}
try {
c2({}, "");
} catch (t3) {
c2 = function c2(t4, r3, e3) {
return t4[r3] = e3;
};
}
function h2(r3, e3, n3, o3) {
var i2 = e3 && e3.prototype instanceof Generator ? e3 : Generator,
a3 = Object.create(i2.prototype);
return c2(a3, "_invoke", function (r4, e4, n4) {
var o4 = 1;
return function (i3, a4) {
if (3 === o4) throw Error("Generator is already running");
if (4 === o4) {
if ("throw" === i3) throw a4;
return {
value: t2,
done: true
};
}
for (n4.method = i3, n4.arg = a4;;) {
var u3 = n4.delegate;
if (u3) {
var c3 = d2(u3, n4);
if (c3) {
if (c3 === f2) continue;
return c3;
}
}
if ("next" === n4.method) n4.sent = n4._sent = n4.arg;else if ("throw" === n4.method) {
if (1 === o4) throw o4 = 4, n4.arg;
n4.dispatchException(n4.arg);
} else "return" === n4.method && n4.abrupt("return", n4.arg);
o4 = 3;
var h3 = s2(r4, e4, n4);
if ("normal" === h3.type) {
if (o4 = n4.done ? 4 : 2, h3.arg === f2) continue;
return {
value: h3.arg,
done: n4.done
};
}
"throw" === h3.type && (o4 = 4, n4.method = "throw", n4.arg = h3.arg);
}
};
}(r3, n3, new Context(o3 || [])), true), a3;
}
function s2(t3, r3, e3) {
try {
return {
type: "normal",
arg: t3.call(r3, e3)
};
} catch (t4) {
return {
type: "throw",
arg: t4
};
}
}
r2.wrap = h2;
var f2 = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var l2 = {};
c2(l2, i, function () {
return this;
});
var p2 = Object.getPrototypeOf,
y2 = p2 && p2(p2(x2([])));
y2 && y2 !== e2 && n2.call(y2, i) && (l2 = y2);
var v2 = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l2);
function g2(t3) {
["next", "throw", "return"].forEach(function (r3) {
c2(t3, r3, function (t4) {
return this._invoke(r3, t4);
});
});
}
function AsyncIterator(t3, r3) {
function e3(o4, i2, a3, u3) {
var c3 = s2(t3[o4], t3, i2);
if ("throw" !== c3.type) {
var h3 = c3.arg,
f3 = h3.value;
return f3 && "object" == _typeof$1(f3) && n2.call(f3, "__await") ? r3.resolve(f3.__await).then(function (t4) {
e3("next", t4, a3, u3);
}, function (t4) {
e3("throw", t4, a3, u3);
}) : r3.resolve(f3).then(function (t4) {
h3.value = t4, a3(h3);
}, function (t4) {
return e3("throw", t4, a3, u3);
});
}
u3(c3.arg);
}
var o3;
c2(this, "_invoke", function (t4, n3) {
function i2() {
return new r3(function (r4, o4) {
e3(t4, n3, r4, o4);
});
}
return o3 = o3 ? o3.then(i2, i2) : i2();
}, true);
}
function d2(r3, e3) {
var n3 = e3.method,
o3 = r3.i[n3];
if (o3 === t2) return e3.delegate = null, "throw" === n3 && r3.i.return && (e3.method = "return", e3.arg = t2, d2(r3, e3), "throw" === e3.method) || "return" !== n3 && (e3.method = "throw", e3.arg = new TypeError("The iterator does not provide a '" + n3 + "' method")), f2;
var i2 = s2(o3, r3.i, e3.arg);
if ("throw" === i2.type) return e3.method = "throw", e3.arg = i2.arg, e3.delegate = null, f2;
var a3 = i2.arg;
return a3 ? a3.done ? (e3[r3.r] = a3.value, e3.next = r3.n, "return" !== e3.method && (e3.method = "next", e3.arg = t2), e3.delegate = null, f2) : a3 : (e3.method = "throw", e3.arg = new TypeError("iterator result is not an object"), e3.delegate = null, f2);
}
function w2(t3) {
this.tryEntries.push(t3);
}
function m2(r3) {
var e3 = r3[4] || {};
e3.type = "normal", e3.arg = t2, r3[4] = e3;
}
function Context(t3) {
this.tryEntries = [[-1]], t3.forEach(w2, this), this.reset(true);
}
function x2(r3) {
if (null != r3) {
var e3 = r3[i];
if (e3) return e3.call(r3);
if ("function" == typeof r3.next) return r3;
if (!isNaN(r3.length)) {
var o3 = -1,
a3 = function e4() {
for (; ++o3 < r3.length;) if (n2.call(r3, o3)) return e4.value = r3[o3], e4.done = false, e4;
return e4.value = t2, e4.done = true, e4;
};
return a3.next = a3;
}
}
throw new TypeError(_typeof$1(r3) + " is not iterable");
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, c2(v2, "constructor", GeneratorFunctionPrototype), c2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c2(GeneratorFunctionPrototype, u2, GeneratorFunction.displayName = "GeneratorFunction"), r2.isGeneratorFunction = function (t3) {
var r3 = "function" == typeof t3 && t3.constructor;
return !!r3 && (r3 === GeneratorFunction || "GeneratorFunction" === (r3.displayName || r3.name));
}, r2.mark = function (t3) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t3, GeneratorFunctionPrototype) : (t3.__proto__ = GeneratorFunctionPrototype, c2(t3, u2, "GeneratorFunction")), t3.prototype = Object.create(v2), t3;
}, r2.awrap = function (t3) {
return {
__await: t3
};
}, g2(AsyncIterator.prototype), c2(AsyncIterator.prototype, a2, function () {
return this;
}), r2.AsyncIterator = AsyncIterator, r2.async = function (t3, e3, n3, o3, i2) {
void 0 === i2 && (i2 = Promise);
var a3 = new AsyncIterator(h2(t3, e3, n3, o3), i2);
return r2.isGeneratorFunction(e3) ? a3 : a3.next().then(function (t4) {
return t4.done ? t4.value : a3.next();
});
}, g2(v2), c2(v2, u2, "Generator"), c2(v2, i, function () {
return this;
}), c2(v2, "toString", function () {
return "[object Generator]";
}), r2.keys = function (t3) {
var r3 = Object(t3),
e3 = [];
for (var n3 in r3) e3.unshift(n3);
return function t4() {
for (; e3.length;) if ((n3 = e3.pop()) in r3) return t4.value = n3, t4.done = false, t4;
return t4.done = true, t4;
};
}, r2.values = x2, Context.prototype = {
constructor: Context,
reset: function reset(r3) {
if (this.prev = this.next = 0, this.sent = this._sent = t2, this.done = false, this.delegate = null, this.method = "next", this.arg = t2, this.tryEntries.forEach(m2), !r3) for (var e3 in this) "t" === e3.charAt(0) && n2.call(this, e3) && !isNaN(+e3.slice(1)) && (this[e3] = t2);
},
stop: function stop() {
this.done = true;
var t3 = this.tryEntries[0][4];
if ("throw" === t3.type) throw t3.arg;
return this.rval;
},
dispatchException: function dispatchException(r3) {
if (this.done) throw r3;
var e3 = this;
function n3(t3) {
a3.type = "throw", a3.arg = r3, e3.next = t3;
}
for (var o3 = e3.tryEntries.length - 1; o3 >= 0; --o3) {
var i2 = this.tryEntries[o3],
a3 = i2[4],
u3 = this.prev,
c3 = i2[1],
h3 = i2[2];
if (-1 === i2[0]) return n3("end"), false;
if (!c3 && !h3) throw Error("try statement without catch or finally");
if (null != i2[0] && i2[0] <= u3) {
if (u3 < c3) return this.method = "next", this.arg = t2, n3(c3), true;
if (u3 < h3) return n3(h3), false;
}
}
},
abrupt: function abrupt(t3, r3) {
for (var e3 = this.tryEntries.length - 1; e3 >= 0; --e3) {
var n3 = this.tryEntries[e3];
if (n3[0] > -1 && n3[0] <= this.prev && this.prev < n3[2]) {
var o3 = n3;
break;
}
}
o3 && ("break" === t3 || "continue" === t3) && o3[0] <= r3 && r3 <= o3[2] && (o3 = null);
var i2 = o3 ? o3[4] : {};
return i2.type = t3, i2.arg = r3, o3 ? (this.method = "next", this.next = o3[2], f2) : this.complete(i2);
},
complete: function complete(t3, r3) {
if ("throw" === t3.type) throw t3.arg;
return "break" === t3.type || "continue" === t3.type ? this.next = t3.arg : "return" === t3.type ? (this.rval = this.arg = t3.arg, this.method = "return", this.next = "end") : "normal" === t3.type && r3 && (this.next = r3), f2;
},
finish: function finish(t3) {
for (var r3 = this.tryEntries.length - 1; r3 >= 0; --r3) {
var e3 = this.tryEntries[r3];
if (e3[2] === t3) return this.complete(e3[4], e3[3]), m2(e3), f2;
}
},
catch: function _catch(t3) {
for (var r3 = this.tryEntries.length - 1; r3 >= 0; --r3) {
var e3 = this.tryEntries[r3];
if (e3[0] === t3) {
var n3 = e3[4];
if ("throw" === n3.type) {
var o3 = n3.arg;
m2(e3);
}
return o3;
}
}
throw Error("illegal catch attempt");
},
delegateYield: function delegateYield(r3, e3, n3) {
return this.delegate = {
i: x2(r3),
r: e3,
n: n3
}, "next" === this.method && (this.arg = t2), f2;
}
}, r2;
}
function _slicedToArray(r2, e2) {
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray(r2, e2) || _nonIterableRest();
}
function _toConsumableArray(r2) {
return _arrayWithoutHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray(r2) || _nonIterableSpread();
}
function _toPrimitive(t2, r2) {
if ("object" != _typeof$1(t2) || !t2) return t2;
var e2 = t2[Symbol.toPrimitive];
if (void 0 !== e2) {
var i = e2.call(t2, r2 || "default");
if ("object" != _typeof$1(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r2 ? String : Number)(t2);
}
function _toPropertyKey(t2) {
var i = _toPrimitive(t2, "string");
return "symbol" == _typeof$1(i) ? i : i + "";
}
function _typeof(o2) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o3) {
return typeof o3;
} : function (o3) {
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
}, _typeof(o2);
}
function _unsupportedIterableToArray(r2, a2) {
if (r2) {
if ("string" == typeof r2) return _arrayLikeToArray(r2, a2);
var t2 = {}.toString.call(r2).slice(8, -1);
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r2, a2) : void 0;
}
}
function isType(type) {
return function (value) {
return Object.prototype.toString.call(value) === "[object ".concat(type, "]");
};
}
var isRegExp$1 = isType("RegExp");
var isNumber = isType("Number");
var isString = isType("String");
var isBoolean = isType("Boolean");
var isFunction = isType("Function");
var isArray = isType("Array");
var isWindow = isType("Window");
var isFlase = function isFlase2(val) {
return isBoolean(val) && String(val) === "false";
};
function isEmpty(wat) {
return isString(wat) && wat.trim() === "" || wat === void 0 || wat === null;
}
var _window, _window$process, _window$process$versi;
var isBrowserEnv = isWindow(typeof window !== "undefined" ? window : 0);
var isElectronEnv = !!((_window = window) !== null && _window !== void 0 && (_window$process = _window.process) !== null && _window$process !== void 0 && (_window$process$versi = _window$process.versions) !== null && _window$process$versi !== void 0 && _window$process$versi.electron);
var isTestEnv = typeof navigator !== "undefined" && navigator.userAgent.includes("jsdom") ||
// @ts-expect-error: jsdom
typeof window !== "undefined" && window.jsdom;
function getGlobal() {
if (isBrowserEnv || isElectronEnv || isTestEnv) return window;
return {};
}
function getGlobalSupport() {
_global.__metaTrack__ = _global.__metaTrack__ || {};
return _global.__metaTrack__;
}
function isInit() {
return !!_global.__metaTrackInit__;
}
var _global = getGlobal();
var _support = getGlobalSupport();
var Dep = /* @__PURE__ */function () {
function Dep2() {
_classCallCheck(this, Dep2);
_defineProperty(this, "subs", /* @__PURE__ */new Set());
}
return _createClass(Dep2, [{
key: "addSub",
value:
// 全局唯一收集容器
function addSub() {
if (Dep2.target) this.subs.add(Dep2.target);
}
}, {
key: "notify",
value: function notify() {
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
params[_key] = arguments[_key];
}
this.subs.forEach(function (watcher) {
watcher.proxy.dirty = true;
watcher.update.apply(watcher, params);
});
}
}]);
}();
_defineProperty(Dep, "target", void 0);
var OBSERVERSIGNBOARD = "__metatrackobserver__";
function isRegExp(value) {
return Object.prototype.toString.call(value) === "[object RegExp]";
}
var Observer = /* @__PURE__ */function () {
function Observer2(target) {
_classCallCheck(this, Observer2);
_defineProperty(this, "target", void 0);
this.target = target;
}
return _createClass(Observer2, [{
key: "defineReactive",
value: function defineReactive() {
var dep = new Dep();
var handlers = getHandlers(function () {
dep.addSub();
}, function (oldValue) {
dep.notify(oldValue);
});
return new Proxy(this.target, handlers);
}
}]);
}();
function getHandlers(getCallBack, setCallBack) {
var proxyCache = /* @__PURE__ */new WeakMap();
var handlers = {
get: function get(target, key, receiver) {
var value = Reflect.get(target, key, receiver);
getCallBack && getCallBack();
if (_typeof(value) === "object" && value !== null && !isRegExp(value)) {
var proxy = proxyCache.get(value);
if (!proxy) {
proxy = new Proxy(value, handlers);
proxyCache.set(value, proxy);
}
return proxy;
}
return value;
},
set: function set(target, key, value, receiver) {
var oldValue = Reflect.get(target, key, receiver);
if (oldValue === value) return oldValue;
var beforeTarget = JSON.parse(JSON.stringify(target));
var result = Reflect.set(target, key, value, receiver);
setCallBack && setCallBack(beforeTarget);
return result;
}
};
return handlers;
}
var refMap = /* @__PURE__ */new WeakMap();
function ref$1(target) {
var newObj = {
value: target
};
newObj[OBSERVERSIGNBOARD] = true;
var ob = new Observer(newObj);
var proxy = ob.defineReactive();
refMap.set(ob, proxy);
return proxy;
}
function isRef(ref2) {
return !!ref2[OBSERVERSIGNBOARD];
}
var targetStack = [];
function pushTarget(_target) {
if (Dep.target) targetStack.push(Dep.target);
Dep.target = _target;
}
function popTarget() {
Dep.target = targetStack.pop();
}
var Watcher = /* @__PURE__ */function () {
function Watcher2(vm, options2, getter) {
_classCallCheck(this, Watcher2);
_defineProperty(this, "vm", void 0);
_defineProperty(this, "computed", void 0);
_defineProperty(this, "watch", void 0);
_defineProperty(this, "proxy", void 0);
_defineProperty(this, "dep", void 0);
_defineProperty(this, "getter", void 0);
_defineProperty(this, "callback", void 0);
var computed2 = options2.computed,
watch2 = options2.watch,
callback = options2.callback;
this.getter = getter;
this.computed = computed2 || false;
this.watch = watch2 || false;
this.callback = callback;
this.proxy = {
value: "",
// 存储这个属性的值,在不需要更新的时候会直接取这个值
dirty: true
// 表示这个属性是否脏了(脏了代表需要重新运算更新这个值)
};
this.vm = vm;
if (computed2) {
this.dep = new Dep();
} else if (watch2) {
this.watchGet();
} else {
this.get();
}
}
return _createClass(Watcher2, [{
key: "update",
value: function update(oldValue) {
if (this.computed) {
this.dep.notify();
} else if (this.watch) {
if (oldValue !== this.proxy.value) {
this.callback && this.callback(this.proxy.value, oldValue);
}
} else {
this.get();
}
}
}, {
key: "get",
value: function get() {
pushTarget(this);
var value = this.computed ? computedMap.get(this.vm).call(this.vm) : "";
if (value !== this.proxy.value) {
this.proxy.dirty = false;
this.proxy.value = value;
}
popTarget();
return value;
}
/**
* 监听属性专用 - 拿到最新值并添加依赖
*/
}, {
key: "watchGet",
value: function watchGet() {
pushTarget(this);
this.proxy.dirty = false;
if (this.getter) {
this.proxy.value = this.getter();
}
popTarget();
}
/**
* 计算属性专用 - 添加依赖
* 其他值用到了这个计算属性就会被记录添加到依赖中
*/
}, {
key: "depend",
value: function depend() {
this.dep.addSub();
}
}]);
}();
var Computed = /* @__PURE__ */function () {
function Computed2(target) {
_classCallCheck(this, Computed2);
_defineProperty(this, "target", void 0);
this.target = target;
}
return _createClass(Computed2, [{
key: "defineReactive",
value: function defineReactive() {
var computedWatcher = new Watcher(this, {
computed: true
});
var handlers = {
get: function get() {
if (computedWatcher.proxy.dirty) {
computedWatcher.depend();
return computedWatcher.get();
} else {
computedWatcher.depend();
return computedWatcher.proxy.value;
}
}
};
return new Proxy(this.target, handlers);
}
}]);
}();
var computedMap = /* @__PURE__ */new WeakMap();
function computed$1(fun) {
var target = {
value: 0
};
target[OBSERVERSIGNBOARD] = true;
var ob = new Computed(target);
var proxy = ob.defineReactive();
computedMap.set(ob, fun);
return proxy;
}
function watchInit(callback, getter) {
new Watcher("", {
watch: true,
callback: callback
}, getter);
}
function watch$1(target, fun) {
if (!isRef(target)) return;
watchInit(function (newValue, oldValue) {
fun(newValue, oldValue);
}, function () {
return target.value;
});
}
function hasProxy() {
return !!window.Proxy;
}
function ref(target) {
return hasProxy() ? ref$1(target) : {
value: target
};
}
function computed(fun) {
return hasProxy() ? computed$1(fun) : {
value: fun()
};
}
function watch(target, fun) {
return hasProxy() ? watch$1(target, fun) : function () {
return {};
};
}
var Options = /* @__PURE__ */function () {
function Options2(initOptions2) {
_classCallCheck(this, Options2);
_defineProperty(this, "dsn", "");
_defineProperty(this, "appName", "");
_defineProperty(this, "appCode", "");
_defineProperty(this, "appVersion", "");
_defineProperty(this, "userUuid", "");
_defineProperty(this, "sdkUserUuid", "");
_defineProperty(this, "debug", false);
_defineProperty(this, "pv", {
core: false
// 页面跳转-是否自动发送页面跳转相关数据
});
_defineProperty(this, "performance", {
core: false,
// 性能数据-是否采集静态资源、接口的相关数据
firstResource: false,
// 性能数据-是否采集首次进入页面的数据(ps: tcp连接耗时,HTML加载完成时间,首次可交互时间)
server: false
// 接口请求-是否采集接口请求(成功的才会采集)
});
_defineProperty(this, "error", {
core: false,
// 是否采集异常数据(ps: 资源引入错误,promise错误,控制台输出错误)
server: false
// 接口请求-是否采集报错接口数据
});
_defineProperty(this, "event", {
core: false
// 页面点击-是否采集点击事件
});
_defineProperty(this, "recordScreen", true);
_defineProperty(this, "ext", {});
_defineProperty(this, "tracesSampleRate", 1);
_defineProperty(this, "cacheMaxLength", 5);
_defineProperty(this, "cacheWatingTime", 5e3);
_defineProperty(this, "ignoreErrors", []);
_defineProperty(this, "ignoreRequest", []);
_defineProperty(this, "scopeError", false);
_defineProperty(this, "localization", false);
_defineProperty(this, "sendTypeByXmlBody", false);
_defineProperty(this, "beforePushEventList", []);
_defineProperty(this, "beforeSendData", []);
_defineProperty(this, "afterSendData", []);
_defineProperty(this, "localizationOverFlow", function () {});
var _options = this.transitionOptions(initOptions2);
_options.ignoreRequest.push(new RegExp(_options.dsn));
deepAssign(this, _options);
}
return _createClass(Options2, [{
key: "transitionOptions",
value: function transitionOptions(options2) {
var _options = deepAssign({}, this, options2);
var beforePushEventList2 = options2.beforePushEventList,
beforeSendData2 = options2.beforeSendData,
afterSendData2 = options2.afterSendData;
var pv = _options.pv,
performance2 = _options.performance,
error = _options.error,
event = _options.event;
if (typeof pv === "boolean") {
_options.pv = {
core: pv
};
}
if (typeof performance2 === "boolean") {
_options.performance = {
core: performance2,
firstResource: performance2,
server: performance2
};
}
if (typeof error === "boolean") {
_options.error = {
core: error,
server: error
};
}
if (typeof event === "boolean") {
_options.event = {
core: event
};
}
if (beforePushEventList2) {
_options.beforePushEventList = [beforePushEventList2];
}
if (beforeSendData2) {
_options.beforeSendData = [beforeSendData2];
}
if (afterSendData2) {
_options.afterSendData = [afterSendData2];
}
return _options;
}
}]);
}();
function _validateInitOption(options2) {
var dsn = options2.dsn,
appName = options2.appName,
appCode = options2.appCode,
appVersion = options2.appVersion,
userUuid = options2.userUuid,
debug2 = options2.debug,
recordScreen2 = options2.recordScreen,
pv = options2.pv,
performance2 = options2.performance,
error = options2.error,
event = options2.event,
ext = options2.ext,
tracesSampleRate = options2.tracesSampleRate,
cacheMaxLength = options2.cacheMaxLength,
cacheWatingTime = options2.cacheWatingTime,
ignoreErrors = options2.ignoreErrors,
ignoreRequest = options2.ignoreRequest,
scopeError = options2.scopeError,
localization = options2.localization,
sendTypeByXmlBody = options2.sendTypeByXmlBody,
beforePushEventList2 = options2.beforePushEventList,
beforeSendData2 = options2.beforeSendData;
var validateFunList = [];
if (pv && _typeof(pv) === "object") {
validateFunList.push(validateOption(pv.core, "pv.core", "boolean"));
} else {
validateFunList.push(validateOption(pv, "pv", "boolean"));
}
if (performance2 && _typeof(performance2) === "object") {
validateFunList.push(validateOption(performance2.core, "performance.core", "boolean"), validateOption(performance2.firstResource, "performance.firstResource", "boolean"), validateOption(performance2.server, "performance.server", "boolean"));
} else {
validateFunList.push(validateOption(performance2, "performance", "boolean"));
}
if (error && _typeof(error) === "object") {
validateFunList.push(validateOption(error.core, "error.core", "boolean"), validateOption(error.server, "error.server", "boolean"));
} else {
validateFunList.push(validateOption(error, "error", "boolean"));
}
if (event && _typeof(event) === "object") {
validateFunList.push(validateOption(event.core, "event.core", "boolean"));
} else {
validateFunList.push(validateOption(event, "event", "boolean"));
}
var validateList = [validateOption(dsn, "dsn", "string"), validateOption(appName, "appName", "string"), validateOption(appCode, "appCode", "string"), validateOption(appVersion, "appVersion", "string"), validateOption(userUuid, "userUuid", "string"), validateOption(debug2, "debug", "boolean"), validateOption(recordScreen2, "recordScreen", "boolean"), validateOption(ext, "ext", "object"), validateOption(tracesSampleRate, "tracesSampleRate", "number"), validateOption(cacheMaxLength, "cacheMaxLength", "number"), validateOption(cacheWatingTime, "cacheWatingTime", "number"), validateOption(ignoreErrors, "ignoreErrors", "array"), validateOptionArray(ignoreErrors, "ignoreErrors", ["string", "regexp"]), validateOption(ignoreRequest, "ignoreRequest", "array"), validateOptionArray(ignoreRequest, "ignoreRequest", ["string", "regexp"]), validateOption(scopeError, "scopeError", "boolean"), validateOption(localization, "localization", "boolean"), validateOption(sendTypeByXmlBody, "sendTypeByXmlBody", "boolean"),
// validateOption(whiteScreen, 'whiteScreen', 'boolean'),
validateOption(beforePushEventList2, "beforePushEventList", "function"), validateOption(beforeSendData2, "beforeSendData", "function")];
return validateList.every(function (res) {
return !!res;
});
}
function _validateMustFill(options2) {
var validateList = [validateOptionMustFill(options2.appName, "appName"), validateOptionMustFill(options2.dsn, "dsn")];
return validateList.every(function (res) {
return !!res;
});
}
function validateOptionMustFill(target, targetName) {
if (isEmpty(target)) {
logError("\u3010".concat(targetName, "\u3011\u53C2\u6570\u5FC5\u586B"));
return false;
}
return true;
}
function validateOption(target, targetName, expectType) {
if (!target || typeofAny(target) === expectType) return true;
logError("TypeError:\u3010".concat(targetName, "\u3011\u671F\u671B\u4F20\u5165").concat(expectType, "\u7C7B\u578B\uFF0C\u76EE\u524D\u662F").concat(typeofAny(target), "\u7C7B\u578B"));
return false;
}
function validateOptionArray(target, targetName, expectTypes) {
if (!target) return true;
var pass = true;
target.forEach(function (item) {
if (!expectTypes.includes(typeofAny(item))) {
logError("TypeError:\u3010".concat(targetName, "\u3011\u6570\u7EC4\u5185\u7684\u503C\u671F\u671B\u4F20\u5165").concat(expectTypes.join("|"), "\u7C7B\u578B\uFF0C\u76EE\u524D\u503C").concat(item, "\u662F").concat(typeofAny(item), "\u7C7B\u578B"));
pass = false;
}
});
return pass;
}
exports.options = void 0;
function initOptions(initOptions2) {
if (!_validateMustFill(initOptions2) || !_validateInitOption(initOptions2)) return false;
exports.options = ref(new Options(initOptions2));
_support.options = exports.options;
return true;
}
function debug() {
var _console;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (exports.options.value.debug) (_console = console).log.apply(_console, ["@meta-track: "].concat(args));
}
function logError() {
var _console2;
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
(_console2 = console).error.apply(_console2, ["@meta-track: "].concat(args));
}
function on$1(target, eventName, handler) {
var opitons = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
target.addEventListener(eventName, handler, opitons);
}
function replaceAop(source, name, replacement) {
var isForced = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
if (source === void 0) return;
if (name in source || isForced) {
var original = source[name];
var wrapped = replacement(original);
if (isFunction(wrapped)) {
source[name] = wrapped;
}
}
}
function normalizeObj(source) {
Object.keys(source).forEach(function (p2) {
var v2 = source[p2];
if (isNumber(v2)) {
source[p2] = v2 === 0 ? void 0 : parseFloat(v2.toFixed(2));
}
});
return source;
}
function getLocationHref() {
if (typeof document === "undefined" || document.location == null) return "";
return document.location.href;
}
function getTimestamp() {
return Date.now();
}
function throttle$1(func, wait) {
var runFirst = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
var timer = null;
var lastArgs;
return function () {
var _this = this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
lastArgs = args;
if (timer === null) {
if (runFirst) {
func.apply(this, lastArgs);
}
timer = setTimeout(function () {
timer = null;
func.apply(_this, lastArgs);
}, wait);
}
};
}
function debounce(func, wait) {
var runFirst = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
var timer = null;
return function () {
var _this2 = this;
for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
arg[_key2] = arguments[_key2];
}
if (runFirst) {
func.call.apply(func, [this].concat(arg));
runFirst = false;
}
if (timer) clearTimeout(timer);
timer = setTimeout(function () {
func.call.apply(func, [_this2].concat(arg));
}, wait);
};
}
function groupArray(arr) {
var groups = /* @__PURE__ */new Map();
for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
keys[_key3 - 1] = arguments[_key3];
}
var _iterator = _createForOfIteratorHelper(arr),
_step;
try {
var _loop = function _loop2() {
var obj = _step.value;
var key = keys.filter(function (k2) {
return obj[k2];
}).map(function (k2) {
return obj[k2];
}).join(":");
if (!groups.has(key)) {
groups.set(key, []);
}
groups.get(key).push(obj);
};
for (_iterator.s(); !(_step = _iterator.n()).done;) {
_loop();
}
} catch (err2) {
_iterator.e(err2);
} finally {
_iterator.f();
}
return Array.from(groups.values());
}
function deepAssign(target) {
for (var _len4 = arguments.length, sources = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
sources[_key4 - 1] = arguments[_key4];
}
sources.forEach(function (source) {
for (var key in source) {
if (source[key] !== null && isRegExp$1(source[key])) {
target[key] = source[key];
} else if (source[key] !== null && _typeof(source[key]) === "object") {