reactjs-tiptap-editor
Version:
A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React
1,917 lines (1,915 loc) • 697 kB
JavaScript
import { E as Ts } from "./index-CXIIg9Sq.js";
import { jsxs as ws, jsx as ba } from "react/jsx-runtime";
import { useState as Es, useRef as As } from "react";
import { ab as Cs, ac as un, a2 as Fs, ad as Ss, A as Bs, ae as ks } from "./RichTextEditor-iSPxjLdO.js";
import { u as Ws } from "./index-D-DR0FPY.js";
var ze = {}, Ei = "1.13.7", ya = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || Function("return this")() || {}, Ht = Array.prototype, Ai = Object.prototype, Da = typeof Symbol < "u" ? Symbol.prototype : null, Rs = Ht.push, rt = Ht.slice, Kn = Ai.toString, Ns = Ai.hasOwnProperty, Mc = typeof ArrayBuffer < "u", Os = typeof DataView < "u", Is = Array.isArray, va = Object.keys, xa = Object.create, _a = Mc && ArrayBuffer.isView, Ls = isNaN, Ms = isFinite, qc = !{ toString: null }.propertyIsEnumerable("toString"), Ua = [
"valueOf",
"isPrototypeOf",
"toString",
"propertyIsEnumerable",
"hasOwnProperty",
"toLocaleString"
], qs = Math.pow(2, 53) - 1;
function Oe(e, n) {
return n = n == null ? e.length - 1 : +n, function() {
for (var t = Math.max(arguments.length - n, 0), i = Array(t), c = 0; c < t; c++)
i[c] = arguments[c + n];
switch (n) {
case 0:
return e.call(this, i);
case 1:
return e.call(this, arguments[0], i);
case 2:
return e.call(this, arguments[0], arguments[1], i);
}
var r = Array(n + 1);
for (c = 0; c < n; c++)
r[c] = arguments[c];
return r[n] = i, e.apply(this, r);
};
}
function ln(e) {
var n = typeof e;
return n === "function" || n === "object" && !!e;
}
function Pc(e) {
return e === null;
}
function Ci(e) {
return e === void 0;
}
function Fi(e) {
return e === !0 || e === !1 || Kn.call(e) === "[object Boolean]";
}
function zc(e) {
return !!(e && e.nodeType === 1);
}
function Ne(e) {
var n = "[object " + e + "]";
return function(t) {
return Kn.call(t) === n;
};
}
const Gt = Ne("String"), Si = Ne("Number"), jc = Ne("Date"), Xc = Ne("RegExp"), Vc = Ne("Error"), Bi = Ne("Symbol"), ki = Ne("ArrayBuffer");
var Hc = Ne("Function"), Ps = ya.document && ya.document.childNodes;
typeof /./ != "function" && typeof Int8Array != "object" && typeof Ps != "function" && (Hc = function(e) {
return typeof e == "function" || !1;
});
const Re = Hc, Gc = Ne("Object");
var Zc = Os && (!/\[native code\]/.test(String(DataView)) || Gc(new DataView(new ArrayBuffer(8)))), Wi = typeof Map < "u" && Gc(/* @__PURE__ */ new Map()), zs = Ne("DataView");
function js(e) {
return e != null && Re(e.getInt8) && ki(e.buffer);
}
const Qn = Zc ? js : zs, fn = Is || Ne("Array");
function hn(e, n) {
return e != null && Ns.call(e, n);
}
var Ui = Ne("Arguments");
(function() {
Ui(arguments) || (Ui = function(e) {
return hn(e, "callee");
});
})();
const Zt = Ui;
function $c(e) {
return !Bi(e) && Ms(e) && !isNaN(parseFloat(e));
}
function Ri(e) {
return Si(e) && Ls(e);
}
function Ni(e) {
return function() {
return e;
};
}
function Yc(e) {
return function(n) {
var t = e(n);
return typeof t == "number" && t >= 0 && t <= qs;
};
}
function Kc(e) {
return function(n) {
return n == null ? void 0 : n[e];
};
}
const Pt = Kc("byteLength"), Xs = Yc(Pt);
var Vs = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
function Hs(e) {
return _a ? _a(e) && !Qn(e) : Xs(e) && Vs.test(Kn.call(e));
}
const Oi = Mc ? Hs : Ni(!1), Le = Kc("length");
function Gs(e) {
for (var n = {}, t = e.length, i = 0; i < t; ++i) n[e[i]] = !0;
return {
contains: function(c) {
return n[c] === !0;
},
push: function(c) {
return n[c] = !0, e.push(c);
}
};
}
function Qc(e, n) {
n = Gs(n);
var t = Ua.length, i = e.constructor, c = Re(i) && i.prototype || Ai, r = "constructor";
for (hn(e, r) && !n.contains(r) && n.push(r); t--; )
r = Ua[t], r in e && e[r] !== c[r] && !n.contains(r) && n.push(r);
}
function Be(e) {
if (!ln(e)) return [];
if (va) return va(e);
var n = [];
for (var t in e) hn(e, t) && n.push(t);
return qc && Qc(e, n), n;
}
function Jc(e) {
if (e == null) return !0;
var n = Le(e);
return typeof n == "number" && (fn(e) || Gt(e) || Zt(e)) ? n === 0 : Le(Be(e)) === 0;
}
function Ii(e, n) {
var t = Be(n), i = t.length;
if (e == null) return !i;
for (var c = Object(e), r = 0; r < i; r++) {
var a = t[r];
if (n[a] !== c[a] || !(a in c)) return !1;
}
return !0;
}
function we(e) {
if (e instanceof we) return e;
if (!(this instanceof we)) return new we(e);
this._wrapped = e;
}
we.VERSION = Ei;
we.prototype.value = function() {
return this._wrapped;
};
we.prototype.valueOf = we.prototype.toJSON = we.prototype.value;
we.prototype.toString = function() {
return String(this._wrapped);
};
function Ta(e) {
return new Uint8Array(
e.buffer || e,
e.byteOffset || 0,
Pt(e)
);
}
var wa = "[object DataView]";
function Ti(e, n, t, i) {
if (e === n) return e !== 0 || 1 / e === 1 / n;
if (e == null || n == null) return !1;
if (e !== e) return n !== n;
var c = typeof e;
return c !== "function" && c !== "object" && typeof n != "object" ? !1 : eu(e, n, t, i);
}
function eu(e, n, t, i) {
e instanceof we && (e = e._wrapped), n instanceof we && (n = n._wrapped);
var c = Kn.call(e);
if (c !== Kn.call(n)) return !1;
if (Zc && c == "[object Object]" && Qn(e)) {
if (!Qn(n)) return !1;
c = wa;
}
switch (c) {
// These types are compared by value.
case "[object RegExp]":
// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
case "[object String]":
return "" + e == "" + n;
case "[object Number]":
return +e != +e ? +n != +n : +e == 0 ? 1 / +e === 1 / n : +e == +n;
case "[object Date]":
case "[object Boolean]":
return +e == +n;
case "[object Symbol]":
return Da.valueOf.call(e) === Da.valueOf.call(n);
case "[object ArrayBuffer]":
case wa:
return eu(Ta(e), Ta(n), t, i);
}
var r = c === "[object Array]";
if (!r && Oi(e)) {
var a = Pt(e);
if (a !== Pt(n)) return !1;
if (e.buffer === n.buffer && e.byteOffset === n.byteOffset) return !0;
r = !0;
}
if (!r) {
if (typeof e != "object" || typeof n != "object") return !1;
var o = e.constructor, u = n.constructor;
if (o !== u && !(Re(o) && o instanceof o && Re(u) && u instanceof u) && "constructor" in e && "constructor" in n)
return !1;
}
t = t || [], i = i || [];
for (var l = t.length; l--; )
if (t[l] === e) return i[l] === n;
if (t.push(e), i.push(n), r) {
if (l = e.length, l !== n.length) return !1;
for (; l--; )
if (!Ti(e[l], n[l], t, i)) return !1;
} else {
var b = Be(e), m;
if (l = b.length, Be(n).length !== l) return !1;
for (; l--; )
if (m = b[l], !(hn(n, m) && Ti(e[m], n[m], t, i))) return !1;
}
return t.pop(), i.pop(), !0;
}
function nu(e, n) {
return Ti(e, n);
}
function Ln(e) {
if (!ln(e)) return [];
var n = [];
for (var t in e) n.push(t);
return qc && Qc(e, n), n;
}
function Li(e) {
var n = Le(e);
return function(t) {
if (t == null) return !1;
var i = Ln(t);
if (Le(i)) return !1;
for (var c = 0; c < n; c++)
if (!Re(t[e[c]])) return !1;
return e !== iu || !Re(t[Mi]);
};
}
var Mi = "forEach", tu = "has", qi = ["clear", "delete"], ru = ["get", tu, "set"], Zs = qi.concat(Mi, ru), iu = qi.concat(ru), $s = ["add"].concat(qi, Mi, tu);
const au = Wi ? Li(Zs) : Ne("Map"), ou = Wi ? Li(iu) : Ne("WeakMap"), cu = Wi ? Li($s) : Ne("Set"), uu = Ne("WeakSet");
function En(e) {
for (var n = Be(e), t = n.length, i = Array(t), c = 0; c < t; c++)
i[c] = e[n[c]];
return i;
}
function su(e) {
for (var n = Be(e), t = n.length, i = Array(t), c = 0; c < t; c++)
i[c] = [n[c], e[n[c]]];
return i;
}
function Pi(e) {
for (var n = {}, t = Be(e), i = 0, c = t.length; i < c; i++)
n[e[t[i]]] = t[i];
return n;
}
function Jn(e) {
var n = [];
for (var t in e)
Re(e[t]) && n.push(t);
return n.sort();
}
function zi(e, n) {
return function(t) {
var i = arguments.length;
if (n && (t = Object(t)), i < 2 || t == null) return t;
for (var c = 1; c < i; c++)
for (var r = arguments[c], a = e(r), o = a.length, u = 0; u < o; u++) {
var l = a[u];
(!n || t[l] === void 0) && (t[l] = r[l]);
}
return t;
};
}
const ji = zi(Ln), On = zi(Be), Xi = zi(Ln, !0);
function Ys() {
return function() {
};
}
function du(e) {
if (!ln(e)) return {};
if (xa) return xa(e);
var n = Ys();
n.prototype = e;
var t = new n();
return n.prototype = null, t;
}
function lu(e, n) {
var t = du(e);
return n && On(t, n), t;
}
function fu(e) {
return ln(e) ? fn(e) ? e.slice() : ji({}, e) : e;
}
function hu(e, n) {
return n(e), e;
}
function Vi(e) {
return fn(e) ? e : [e];
}
we.toPath = Vi;
function it(e) {
return we.toPath(e);
}
function Hi(e, n) {
for (var t = n.length, i = 0; i < t; i++) {
if (e == null) return;
e = e[n[i]];
}
return t ? e : void 0;
}
function Gi(e, n, t) {
var i = Hi(e, it(n));
return Ci(i) ? t : i;
}
function pu(e, n) {
n = it(n);
for (var t = n.length, i = 0; i < t; i++) {
var c = n[i];
if (!hn(e, c)) return !1;
e = e[c];
}
return !!t;
}
function $t(e) {
return e;
}
function wn(e) {
return e = On({}, e), function(n) {
return Ii(n, e);
};
}
function Yt(e) {
return e = it(e), function(n) {
return Hi(n, e);
};
}
function at(e, n, t) {
if (n === void 0) return e;
switch (t ?? 3) {
case 1:
return function(i) {
return e.call(n, i);
};
// The 2-argument case is omitted because we’re not using it.
case 3:
return function(i, c, r) {
return e.call(n, i, c, r);
};
case 4:
return function(i, c, r, a) {
return e.call(n, i, c, r, a);
};
}
return function() {
return e.apply(n, arguments);
};
}
function gu(e, n, t) {
return e == null ? $t : Re(e) ? at(e, n, t) : ln(e) && !fn(e) ? wn(e) : Yt(e);
}
function Kt(e, n) {
return gu(e, n, 1 / 0);
}
we.iteratee = Kt;
function Me(e, n, t) {
return we.iteratee !== Kt ? we.iteratee(e, n) : gu(e, n, t);
}
function mu(e, n, t) {
n = Me(n, t);
for (var i = Be(e), c = i.length, r = {}, a = 0; a < c; a++) {
var o = i[a];
r[o] = n(e[o], o, e);
}
return r;
}
function Zi() {
}
function bu(e) {
return e == null ? Zi : function(n) {
return Gi(e, n);
};
}
function yu(e, n, t) {
var i = Array(Math.max(0, e));
n = at(n, t, 1);
for (var c = 0; c < e; c++) i[c] = n(c);
return i;
}
function zt(e, n) {
return n == null && (n = e, e = 0), e + Math.floor(Math.random() * (n - e + 1));
}
const In = Date.now || function() {
return (/* @__PURE__ */ new Date()).getTime();
};
function Du(e) {
var n = function(r) {
return e[r];
}, t = "(?:" + Be(e).join("|") + ")", i = RegExp(t), c = RegExp(t, "g");
return function(r) {
return r = r == null ? "" : "" + r, i.test(r) ? r.replace(c, n) : r;
};
}
const vu = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"`": "`"
}, xu = Du(vu), Ks = Pi(vu), _u = Du(Ks), Uu = we.templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
escape: /<%-([\s\S]+?)%>/g
};
var br = /(.)^/, Qs = {
"'": "'",
"\\": "\\",
"\r": "r",
"\n": "n",
"\u2028": "u2028",
"\u2029": "u2029"
}, Js = /\\|'|\r|\n|\u2028|\u2029/g;
function ed(e) {
return "\\" + Qs[e];
}
var nd = /^\s*(\w|\$)+\s*$/;
function Tu(e, n, t) {
!n && t && (n = t), n = Xi({}, n, we.templateSettings);
var i = RegExp([
(n.escape || br).source,
(n.interpolate || br).source,
(n.evaluate || br).source
].join("|") + "|$", "g"), c = 0, r = "__p+='";
e.replace(i, function(l, b, m, g, f) {
return r += e.slice(c, f).replace(Js, ed), c = f + l.length, b ? r += `'+
((__t=(` + b + `))==null?'':_.escape(__t))+
'` : m ? r += `'+
((__t=(` + m + `))==null?'':__t)+
'` : g && (r += `';
` + g + `
__p+='`), l;
}), r += `';
`;
var a = n.variable;
if (a) {
if (!nd.test(a)) throw new Error(
"variable is not a bare identifier: " + a
);
} else
r = `with(obj||{}){
` + r + `}
`, a = "obj";
r = `var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
` + r + `return __p;
`;
var o;
try {
o = new Function(a, "_", r);
} catch (l) {
throw l.source = r, l;
}
var u = function(l) {
return o.call(this, l, we);
};
return u.source = "function(" + a + `){
` + r + "}", u;
}
function wu(e, n, t) {
n = it(n);
var i = n.length;
if (!i)
return Re(t) ? t.call(e) : t;
for (var c = 0; c < i; c++) {
var r = e == null ? void 0 : e[n[c]];
r === void 0 && (r = t, c = i), e = Re(r) ? r.call(e) : r;
}
return e;
}
var td = 0;
function Eu(e) {
var n = ++td + "";
return e ? e + n : n;
}
function Au(e) {
var n = we(e);
return n._chain = !0, n;
}
function Cu(e, n, t, i, c) {
if (!(i instanceof n)) return e.apply(t, c);
var r = du(e.prototype), a = e.apply(r, c);
return ln(a) ? a : r;
}
var An = Oe(function(e, n) {
var t = An.placeholder, i = function() {
for (var c = 0, r = n.length, a = Array(r), o = 0; o < r; o++)
a[o] = n[o] === t ? arguments[c++] : n[o];
for (; c < arguments.length; ) a.push(arguments[c++]);
return Cu(e, i, this, this, a);
};
return i;
});
An.placeholder = we;
const $i = Oe(function(e, n, t) {
if (!Re(e)) throw new TypeError("Bind must be called on a function");
var i = Oe(function(c) {
return Cu(e, i, n, this, t.concat(c));
});
return i;
}), Pe = Yc(Le);
function Cn(e, n, t, i) {
if (i = i || [], !n && n !== 0)
n = 1 / 0;
else if (n <= 0)
return i.concat(e);
for (var c = i.length, r = 0, a = Le(e); r < a; r++) {
var o = e[r];
if (Pe(o) && (fn(o) || Zt(o)))
if (n > 1)
Cn(o, n - 1, t, i), c = i.length;
else
for (var u = 0, l = o.length; u < l; ) i[c++] = o[u++];
else t || (i[c++] = o);
}
return i;
}
const Fu = Oe(function(e, n) {
n = Cn(n, !1, !1);
var t = n.length;
if (t < 1) throw new Error("bindAll must be passed function names");
for (; t--; ) {
var i = n[t];
e[i] = $i(e[i], e);
}
return e;
});
function Su(e, n) {
var t = function(i) {
var c = t.cache, r = "" + (n ? n.apply(this, arguments) : i);
return hn(c, r) || (c[r] = e.apply(this, arguments)), c[r];
};
return t.cache = {}, t;
}
const Yi = Oe(function(e, n, t) {
return setTimeout(function() {
return e.apply(null, t);
}, n);
}), Bu = An(Yi, we, 1);
function ku(e, n, t) {
var i, c, r, a, o = 0;
t || (t = {});
var u = function() {
o = t.leading === !1 ? 0 : In(), i = null, a = e.apply(c, r), i || (c = r = null);
}, l = function() {
var b = In();
!o && t.leading === !1 && (o = b);
var m = n - (b - o);
return c = this, r = arguments, m <= 0 || m > n ? (i && (clearTimeout(i), i = null), o = b, a = e.apply(c, r), i || (c = r = null)) : !i && t.trailing !== !1 && (i = setTimeout(u, m)), a;
};
return l.cancel = function() {
clearTimeout(i), o = 0, i = c = r = null;
}, l;
}
function Wu(e, n, t) {
var i, c, r, a, o, u = function() {
var b = In() - c;
n > b ? i = setTimeout(u, n - b) : (i = null, t || (a = e.apply(o, r)), i || (r = o = null));
}, l = Oe(function(b) {
return o = this, r = b, c = In(), i || (i = setTimeout(u, n), t && (a = e.apply(o, r))), a;
});
return l.cancel = function() {
clearTimeout(i), i = r = o = null;
}, l;
}
function Ru(e, n) {
return An(n, e);
}
function Qt(e) {
return function() {
return !e.apply(this, arguments);
};
}
function Nu() {
var e = arguments, n = e.length - 1;
return function() {
for (var t = n, i = e[n].apply(this, arguments); t--; ) i = e[t].call(this, i);
return i;
};
}
function Ou(e, n) {
return function() {
if (--e < 1)
return n.apply(this, arguments);
};
}
function Ki(e, n) {
var t;
return function() {
return --e > 0 && (t = n.apply(this, arguments)), e <= 1 && (n = null), t;
};
}
const Iu = An(Ki, 2);
function Qi(e, n, t) {
n = Me(n, t);
for (var i = Be(e), c, r = 0, a = i.length; r < a; r++)
if (c = i[r], n(e[c], c, e)) return c;
}
function Lu(e) {
return function(n, t, i) {
t = Me(t, i);
for (var c = Le(n), r = e > 0 ? 0 : c - 1; r >= 0 && r < c; r += e)
if (t(n[r], r, n)) return r;
return -1;
};
}
const Jt = Lu(1), Ji = Lu(-1);
function ea(e, n, t, i) {
t = Me(t, i, 1);
for (var c = t(n), r = 0, a = Le(e); r < a; ) {
var o = Math.floor((r + a) / 2);
t(e[o]) < c ? r = o + 1 : a = o;
}
return r;
}
function Mu(e, n, t) {
return function(i, c, r) {
var a = 0, o = Le(i);
if (typeof r == "number")
e > 0 ? a = r >= 0 ? r : Math.max(r + o, a) : o = r >= 0 ? Math.min(r + 1, o) : r + o + 1;
else if (t && r && o)
return r = t(i, c), i[r] === c ? r : -1;
if (c !== c)
return r = n(rt.call(i, a, o), Ri), r >= 0 ? r + a : -1;
for (r = e > 0 ? a : o - 1; r >= 0 && r < o; r += e)
if (i[r] === c) return r;
return -1;
};
}
const na = Mu(1, Jt, ea), qu = Mu(-1, Ji);
function et(e, n, t) {
var i = Pe(e) ? Jt : Qi, c = i(e, n, t);
if (c !== void 0 && c !== -1) return e[c];
}
function Pu(e, n) {
return et(e, wn(n));
}
function Ze(e, n, t) {
n = at(n, t);
var i, c;
if (Pe(e))
for (i = 0, c = e.length; i < c; i++)
n(e[i], i, e);
else {
var r = Be(e);
for (i = 0, c = r.length; i < c; i++)
n(e[r[i]], r[i], e);
}
return e;
}
function nn(e, n, t) {
n = Me(n, t);
for (var i = !Pe(e) && Be(e), c = (i || e).length, r = Array(c), a = 0; a < c; a++) {
var o = i ? i[a] : a;
r[a] = n(e[o], o, e);
}
return r;
}
function zu(e) {
var n = function(t, i, c, r) {
var a = !Pe(t) && Be(t), o = (a || t).length, u = e > 0 ? 0 : o - 1;
for (r || (c = t[a ? a[u] : u], u += e); u >= 0 && u < o; u += e) {
var l = a ? a[u] : u;
c = i(c, t[l], l, t);
}
return c;
};
return function(t, i, c, r) {
var a = arguments.length >= 3;
return n(t, at(i, r, 4), c, a);
};
}
const Rn = zu(1), jt = zu(-1);
function sn(e, n, t) {
var i = [];
return n = Me(n, t), Ze(e, function(c, r, a) {
n(c, r, a) && i.push(c);
}), i;
}
function ju(e, n, t) {
return sn(e, Qt(Me(n)), t);
}
function Xt(e, n, t) {
n = Me(n, t);
for (var i = !Pe(e) && Be(e), c = (i || e).length, r = 0; r < c; r++) {
var a = i ? i[r] : r;
if (!n(e[a], a, e)) return !1;
}
return !0;
}
function Vt(e, n, t) {
n = Me(n, t);
for (var i = !Pe(e) && Be(e), c = (i || e).length, r = 0; r < c; r++) {
var a = i ? i[r] : r;
if (n(e[a], a, e)) return !0;
}
return !1;
}
function Xe(e, n, t, i) {
return Pe(e) || (e = En(e)), (typeof t != "number" || i) && (t = 0), na(e, n, t) >= 0;
}
const Xu = Oe(function(e, n, t) {
var i, c;
return Re(n) ? c = n : (n = it(n), i = n.slice(0, -1), n = n[n.length - 1]), nn(e, function(r) {
var a = c;
if (!a) {
if (i && i.length && (r = Hi(r, i)), r == null) return;
a = r[n];
}
return a == null ? a : a.apply(r, t);
});
});
function er(e, n) {
return nn(e, Yt(n));
}
function Vu(e, n) {
return sn(e, wn(n));
}
function ta(e, n, t) {
var i = -1 / 0, c = -1 / 0, r, a;
if (n == null || typeof n == "number" && typeof e[0] != "object" && e != null) {
e = Pe(e) ? e : En(e);
for (var o = 0, u = e.length; o < u; o++)
r = e[o], r != null && r > i && (i = r);
} else
n = Me(n, t), Ze(e, function(l, b, m) {
a = n(l, b, m), (a > c || a === -1 / 0 && i === -1 / 0) && (i = l, c = a);
});
return i;
}
function Hu(e, n, t) {
var i = 1 / 0, c = 1 / 0, r, a;
if (n == null || typeof n == "number" && typeof e[0] != "object" && e != null) {
e = Pe(e) ? e : En(e);
for (var o = 0, u = e.length; o < u; o++)
r = e[o], r != null && r < i && (i = r);
} else
n = Me(n, t), Ze(e, function(l, b, m) {
a = n(l, b, m), (a < c || a === 1 / 0 && i === 1 / 0) && (i = l, c = a);
});
return i;
}
var rd = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
function ra(e) {
return e ? fn(e) ? rt.call(e) : Gt(e) ? e.match(rd) : Pe(e) ? nn(e, $t) : En(e) : [];
}
function ia(e, n, t) {
if (n == null || t)
return Pe(e) || (e = En(e)), e[zt(e.length - 1)];
var i = ra(e), c = Le(i);
n = Math.max(Math.min(n, c), 0);
for (var r = c - 1, a = 0; a < n; a++) {
var o = zt(a, r), u = i[a];
i[a] = i[o], i[o] = u;
}
return i.slice(0, n);
}
function Gu(e) {
return ia(e, 1 / 0);
}
function Zu(e, n, t) {
var i = 0;
return n = Me(n, t), er(nn(e, function(c, r, a) {
return {
value: c,
index: i++,
criteria: n(c, r, a)
};
}).sort(function(c, r) {
var a = c.criteria, o = r.criteria;
if (a !== o) {
if (a > o || a === void 0) return 1;
if (a < o || o === void 0) return -1;
}
return c.index - r.index;
}), "value");
}
function nr(e, n) {
return function(t, i, c) {
var r = n ? [[], []] : {};
return i = Me(i, c), Ze(t, function(a, o) {
var u = i(a, o, t);
e(r, a, u);
}), r;
};
}
const $u = nr(function(e, n, t) {
hn(e, t) ? e[t].push(n) : e[t] = [n];
}), Yu = nr(function(e, n, t) {
e[t] = n;
}), Ku = nr(function(e, n, t) {
hn(e, t) ? e[t]++ : e[t] = 1;
}), Qu = nr(function(e, n, t) {
e[t ? 0 : 1].push(n);
}, !0);
function Ju(e) {
return e == null ? 0 : Pe(e) ? e.length : Be(e).length;
}
function id(e, n, t) {
return n in t;
}
const aa = Oe(function(e, n) {
var t = {}, i = n[0];
if (e == null) return t;
Re(i) ? (n.length > 1 && (i = at(i, n[1])), n = Ln(e)) : (i = id, n = Cn(n, !1, !1), e = Object(e));
for (var c = 0, r = n.length; c < r; c++) {
var a = n[c], o = e[a];
i(o, a, e) && (t[a] = o);
}
return t;
}), es = Oe(function(e, n) {
var t = n[0], i;
return Re(t) ? (t = Qt(t), n.length > 1 && (i = n[1])) : (n = nn(Cn(n, !1, !1), String), t = function(c, r) {
return !Xe(n, r);
}), aa(e, t, i);
});
function oa(e, n, t) {
return rt.call(e, 0, Math.max(0, e.length - (n == null || t ? 1 : n)));
}
function Nn(e, n, t) {
return e == null || e.length < 1 ? n == null || t ? void 0 : [] : n == null || t ? e[0] : oa(e, e.length - n);
}
function Tn(e, n, t) {
return rt.call(e, n == null || t ? 1 : n);
}
function ns(e, n, t) {
return e == null || e.length < 1 ? n == null || t ? void 0 : [] : n == null || t ? e[e.length - 1] : Tn(e, Math.max(0, e.length - n));
}
function ts(e) {
return sn(e, Boolean);
}
function rs(e, n) {
return Cn(e, n, !1);
}
const ca = Oe(function(e, n) {
return n = Cn(n, !0, !0), sn(e, function(t) {
return !Xe(n, t);
});
}), is = Oe(function(e, n) {
return ca(e, n);
});
function nt(e, n, t, i) {
Fi(n) || (i = t, t = n, n = !1), t != null && (t = Me(t, i));
for (var c = [], r = [], a = 0, o = Le(e); a < o; a++) {
var u = e[a], l = t ? t(u, a, e) : u;
n && !t ? ((!a || r !== l) && c.push(u), r = l) : t ? Xe(r, l) || (r.push(l), c.push(u)) : Xe(c, u) || c.push(u);
}
return c;
}
const as = Oe(function(e) {
return nt(Cn(e, !0, !0));
});
function os(e) {
for (var n = [], t = arguments.length, i = 0, c = Le(e); i < c; i++) {
var r = e[i];
if (!Xe(n, r)) {
var a;
for (a = 1; a < t && Xe(arguments[a], r); a++)
;
a === t && n.push(r);
}
}
return n;
}
function tt(e) {
for (var n = e && ta(e, Le).length || 0, t = Array(n), i = 0; i < n; i++)
t[i] = er(e, i);
return t;
}
const cs = Oe(tt);
function us(e, n) {
for (var t = {}, i = 0, c = Le(e); i < c; i++)
n ? t[e[i]] = n[i] : t[e[i][0]] = e[i][1];
return t;
}
function ss(e, n, t) {
n == null && (n = e || 0, e = 0), t || (t = n < e ? -1 : 1);
for (var i = Math.max(Math.ceil((n - e) / t), 0), c = Array(i), r = 0; r < i; r++, e += t)
c[r] = e;
return c;
}
function ds(e, n) {
if (n == null || n < 1) return [];
for (var t = [], i = 0, c = e.length; i < c; )
t.push(rt.call(e, i, i += n));
return t;
}
function ua(e, n) {
return e._chain ? we(n).chain() : n;
}
function sa(e) {
return Ze(Jn(e), function(n) {
var t = we[n] = e[n];
we.prototype[n] = function() {
var i = [this._wrapped];
return Rs.apply(i, arguments), ua(this, t.apply(we, i));
};
}), we;
}
Ze(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(e) {
var n = Ht[e];
we.prototype[e] = function() {
var t = this._wrapped;
return t != null && (n.apply(t, arguments), (e === "shift" || e === "splice") && t.length === 0 && delete t[0]), ua(this, t);
};
});
Ze(["concat", "join", "slice"], function(e) {
var n = Ht[e];
we.prototype[e] = function() {
var t = this._wrapped;
return t != null && (t = n.apply(t, arguments)), ua(this, t);
};
});
const ad = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
VERSION: Ei,
after: Ou,
all: Xt,
allKeys: Ln,
any: Vt,
assign: On,
before: Ki,
bind: $i,
bindAll: Fu,
chain: Au,
chunk: ds,
clone: fu,
collect: nn,
compact: ts,
compose: Nu,
constant: Ni,
contains: Xe,
countBy: Ku,
create: lu,
debounce: Wu,
default: we,
defaults: Xi,
defer: Bu,
delay: Yi,
detect: et,
difference: ca,
drop: Tn,
each: Ze,
escape: xu,
every: Xt,
extend: ji,
extendOwn: On,
filter: sn,
find: et,
findIndex: Jt,
findKey: Qi,
findLastIndex: Ji,
findWhere: Pu,
first: Nn,
flatten: rs,
foldl: Rn,
foldr: jt,
forEach: Ze,
functions: Jn,
get: Gi,
groupBy: $u,
has: pu,
head: Nn,
identity: $t,
include: Xe,
includes: Xe,
indexBy: Yu,
indexOf: na,
initial: oa,
inject: Rn,
intersection: os,
invert: Pi,
invoke: Xu,
isArguments: Zt,
isArray: fn,
isArrayBuffer: ki,
isBoolean: Fi,
isDataView: Qn,
isDate: jc,
isElement: zc,
isEmpty: Jc,
isEqual: nu,
isError: Vc,
isFinite: $c,
isFunction: Re,
isMap: au,
isMatch: Ii,
isNaN: Ri,
isNull: Pc,
isNumber: Si,
isObject: ln,
isRegExp: Xc,
isSet: cu,
isString: Gt,
isSymbol: Bi,
isTypedArray: Oi,
isUndefined: Ci,
isWeakMap: ou,
isWeakSet: uu,
iteratee: Kt,
keys: Be,
last: ns,
lastIndexOf: qu,
map: nn,
mapObject: mu,
matcher: wn,
matches: wn,
max: ta,
memoize: Su,
methods: Jn,
min: Hu,
mixin: sa,
negate: Qt,
noop: Zi,
now: In,
object: us,
omit: es,
once: Iu,
pairs: su,
partial: An,
partition: Qu,
pick: aa,
pluck: er,
property: Yt,
propertyOf: bu,
random: zt,
range: ss,
reduce: Rn,
reduceRight: jt,
reject: ju,
rest: Tn,
restArguments: Oe,
result: wu,
sample: ia,
select: sn,
shuffle: Gu,
size: Ju,
some: Vt,
sortBy: Zu,
sortedIndex: ea,
tail: Tn,
take: Nn,
tap: hu,
template: Tu,
templateSettings: Uu,
throttle: ku,
times: yu,
toArray: ra,
toPath: Vi,
transpose: tt,
unescape: _u,
union: as,
uniq: nt,
unique: nt,
uniqueId: Eu,
unzip: tt,
values: En,
where: Vu,
without: is,
wrap: Ru,
zip: cs
}, Symbol.toStringTag, { value: "Module" }));
var wi = sa(ad);
wi._ = wi;
const od = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
VERSION: Ei,
after: Ou,
all: Xt,
allKeys: Ln,
any: Vt,
assign: On,
before: Ki,
bind: $i,
bindAll: Fu,
chain: Au,
chunk: ds,
clone: fu,
collect: nn,
compact: ts,
compose: Nu,
constant: Ni,
contains: Xe,
countBy: Ku,
create: lu,
debounce: Wu,
default: wi,
defaults: Xi,
defer: Bu,
delay: Yi,
detect: et,
difference: ca,
drop: Tn,
each: Ze,
escape: xu,
every: Xt,
extend: ji,
extendOwn: On,
filter: sn,
find: et,
findIndex: Jt,
findKey: Qi,
findLastIndex: Ji,
findWhere: Pu,
first: Nn,
flatten: rs,
foldl: Rn,
foldr: jt,
forEach: Ze,
functions: Jn,
get: Gi,
groupBy: $u,
has: pu,
head: Nn,
identity: $t,
include: Xe,
includes: Xe,
indexBy: Yu,
indexOf: na,
initial: oa,
inject: Rn,
intersection: os,
invert: Pi,
invoke: Xu,
isArguments: Zt,
isArray: fn,
isArrayBuffer: ki,
isBoolean: Fi,
isDataView: Qn,
isDate: jc,
isElement: zc,
isEmpty: Jc,
isEqual: nu,
isError: Vc,
isFinite: $c,
isFunction: Re,
isMap: au,
isMatch: Ii,
isNaN: Ri,
isNull: Pc,
isNumber: Si,
isObject: ln,
isRegExp: Xc,
isSet: cu,
isString: Gt,
isSymbol: Bi,
isTypedArray: Oi,
isUndefined: Ci,
isWeakMap: ou,
isWeakSet: uu,
iteratee: Kt,
keys: Be,
last: ns,
lastIndexOf: qu,
map: nn,
mapObject: mu,
matcher: wn,
matches: wn,
max: ta,
memoize: Su,
methods: Jn,
min: Hu,
mixin: sa,
negate: Qt,
noop: Zi,
now: In,
object: us,
omit: es,
once: Iu,
pairs: su,
partial: An,
partition: Qu,
pick: aa,
pluck: er,
property: Yt,
propertyOf: bu,
random: zt,
range: ss,
reduce: Rn,
reduceRight: jt,
reject: ju,
rest: Tn,
restArguments: Oe,
result: wu,
sample: ia,
select: sn,
shuffle: Gu,
size: Ju,
some: Vt,
sortBy: Zu,
sortedIndex: ea,
tail: Tn,
take: Nn,
tap: hu,
template: Tu,
templateSettings: Uu,
throttle: ku,
times: yu,
toArray: ra,
toPath: Vi,
transpose: tt,
unescape: _u,
union: as,
uniq: nt,
unique: nt,
uniqueId: Eu,
unzip: tt,
values: En,
where: Vu,
without: is,
wrap: Ru,
zip: cs
}, Symbol.toStringTag, { value: "Module" })), Se = /* @__PURE__ */ Cs(od);
var ct = {}, je = {}, yr = { exports: {} }, ut = { exports: {} }, Ea;
function Mn() {
if (Ea) return ut.exports;
Ea = 1;
var e = /* @__PURE__ */ function() {
return this === void 0;
}();
if (e)
ut.exports = {
freeze: Object.freeze,
defineProperty: Object.defineProperty,
getDescriptor: Object.getOwnPropertyDescriptor,
keys: Object.keys,
names: Object.getOwnPropertyNames,
getPrototypeOf: Object.getPrototypeOf,
isArray: Array.isArray,
isES5: e,
propertyIsWritable: function(b, m) {
var g = Object.getOwnPropertyDescriptor(b, m);
return !!(!g || g.writable || g.set);
}
};
else {
var n = {}.hasOwnProperty, t = {}.toString, i = {}.constructor.prototype, c = function(b) {
var m = [];
for (var g in b)
n.call(b, g) && m.push(g);
return m;
}, r = function(b, m) {
return { value: b[m] };
}, a = function(b, m, g) {
return b[m] = g.value, b;
}, o = function(b) {
return b;
}, u = function(b) {
try {
return Object(b).constructor.prototype;
} catch {
return i;
}
}, l = function(b) {
try {
return t.call(b) === "[object Array]";
} catch {
return !1;
}
};
ut.exports = {
isArray: l,
keys: c,
names: c,
defineProperty: a,
getDescriptor: r,
freeze: o,
getPrototypeOf: u,
isES5: e,
propertyIsWritable: function() {
return !0;
}
};
}
return ut.exports;
}
var Pn, Aa;
function Ae() {
if (Aa) return Pn;
Aa = 1;
var e = Mn(), n = typeof navigator > "u", t = { e: {} }, i, c = typeof self < "u" ? self : typeof window < "u" ? window : typeof un < "u" ? un : Pn !== void 0 ? Pn : null;
function r() {
try {
var k = i;
return i = null, k.apply(this, arguments);
} catch (re) {
return t.e = re, t;
}
}
function a(k) {
return i = k, r;
}
var o = function(k, re) {
var ae = {}.hasOwnProperty;
function J() {
this.constructor = k, this.constructor$ = re;
for (var ue in re.prototype)
ae.call(re.prototype, ue) && ue.charAt(ue.length - 1) !== "$" && (this[ue + "$"] = re.prototype[ue]);
}
return J.prototype = re.prototype, k.prototype = new J(), k.prototype;
};
function u(k) {
return k == null || k === !0 || k === !1 || typeof k == "string" || typeof k == "number";
}
function l(k) {
return typeof k == "function" || typeof k == "object" && k !== null;
}
function b(k) {
return u(k) ? new Error(w(k)) : k;
}
function m(k, re) {
var ae = k.length, J = new Array(ae + 1), ue;
for (ue = 0; ue < ae; ++ue)
J[ue] = k[ue];
return J[ue] = re, J;
}
function g(k, re, ae) {
if (e.isES5) {
var J = Object.getOwnPropertyDescriptor(k, re);
if (J != null)
return J.get == null && J.set == null ? J.value : ae;
} else
return {}.hasOwnProperty.call(k, re) ? k[re] : void 0;
}
function f(k, re, ae) {
if (u(k)) return k;
var J = {
value: ae,
configurable: !0,
enumerable: !1,
writable: !0
};
return e.defineProperty(k, re, J), k;
}
function y(k) {
throw k;
}
var h = function() {
var k = [
Array.prototype,
Object.prototype,
Function.prototype
], re = function(ue) {
for (var pe = 0; pe < k.length; ++pe)
if (k[pe] === ue)
return !0;
return !1;
};
if (e.isES5) {
var ae = Object.getOwnPropertyNames;
return function(ue) {
for (var pe = [], le = /* @__PURE__ */ Object.create(null); ue != null && !re(ue); ) {
var fe;
try {
fe = ae(ue);
} catch {
return pe;
}
for (var me = 0; me < fe.length; ++me) {
var ye = fe[me];
if (!le[ye]) {
le[ye] = !0;
var Ue = Object.getOwnPropertyDescriptor(ue, ye);
Ue != null && Ue.get == null && Ue.set == null && pe.push(ye);
}
}
ue = e.getPrototypeOf(ue);
}
return pe;
};
} else {
var J = {}.hasOwnProperty;
return function(ue) {
if (re(ue)) return [];
var pe = [];
e: for (var le in ue)
if (J.call(ue, le))
pe.push(le);
else {
for (var fe = 0; fe < k.length; ++fe)
if (J.call(k[fe], le))
continue e;
pe.push(le);
}
return pe;
};
}
}(), s = /this\s*\.\s*\S+\s*=/;
function p(k) {
try {
if (typeof k == "function") {
var re = e.names(k.prototype), ae = e.isES5 && re.length > 1, J = re.length > 0 && !(re.length === 1 && re[0] === "constructor"), ue = s.test(k + "") && e.names(k).length > 0;
if (ae || J || ue)
return !0;
}
return !1;
} catch {
return !1;
}
}
function d(k) {
return k;
}
var D = /^[a-z$_][a-z$_0-9]*$/i;
function U(k) {
return D.test(k);
}
function _(k, re, ae) {
for (var J = new Array(k), ue = 0; ue < k; ++ue)
J[ue] = re + ue + ae;
return J;
}
function w(k) {
try {
return k + "";
} catch {
return "[no string representation]";
}
}
function E(k) {
return k !== null && typeof k == "object" && typeof k.message == "string" && typeof k.name == "string";
}
function S(k) {
try {
f(k, "isOperational", !0);
} catch {
}
}
function A(k) {
return k == null ? !1 : k instanceof Error.__BluebirdErrorTypes__.OperationalError || k.isOperational === !0;
}
function I(k) {
return E(k) && e.propertyIsWritable(k, "stack");
}
var $ = function() {
return "stack" in new Error() ? function(k) {
return I(k) ? k : new Error(w(k));
} : function(k) {
if (I(k)) return k;
try {
throw new Error(w(k));
} catch (re) {
return re;
}
};
}();
function T(k) {
return {}.toString.call(k);
}
function R(k, re, ae) {
for (var J = e.names(k), ue = 0; ue < J.length; ++ue) {
var pe = J[ue];
if (ae(pe))
try {
e.defineProperty(re, pe, e.getDescriptor(k, pe));
} catch {
}
}
}
var x = function(k) {
return e.isArray(k) ? k : null;
};
if (typeof Symbol < "u" && Symbol.iterator) {
var X = typeof Array.from == "function" ? function(k) {
return Array.from(k);
} : function(k) {
for (var re = [], ae = k[Symbol.iterator](), J; !(J = ae.next()).done; )
re.push(J.value);
return re;
};
x = function(k) {
return e.isArray(k) ? k : k != null && typeof k[Symbol.iterator] == "function" ? X(k) : null;
};
}
var W = typeof process < "u" && T(process).toLowerCase() === "[object process]", O = typeof process < "u" && typeof process.env < "u";
function Z(k) {
return O ? process.env[k] : void 0;
}
function q() {
if (typeof Promise == "function")
try {
var k = new Promise(function() {
});
if ({}.toString.call(k) === "[object Promise]")
return Promise;
} catch {
}
}
function Q(k, re) {
return k.bind(re);
}
var L = {
isClass: p,
isIdentifier: U,
inheritedDataKeys: h,
getDataPropertyOrDefault: g,
thrower: y,
isArray: e.isArray,
asArray: x,
notEnumerableProp: f,
isPrimitive: u,
isObject: l,
isError: E,
canEvaluate: n,
errorObj: t,
tryCatch: a,
inherits: o,
withAppended: m,
maybeWrapAsError: b,
toFastProperties: d,
filledRange: _,
toString: w,
canAttachTrace: I,
ensureErrorObject: $,
originatesFromRejection: A,
markAsOriginatingFromRejection: S,
classString: T,
copyDescriptors: R,
hasDevTools: typeof chrome < "u" && chrome && typeof chrome.loadTimes == "function",
isNode: W,
hasEnvVariables: O,
env: Z,
global: c,
getNativePromise: q,
domainBind: Q
};
L.isRecentNode = L.isNode && function() {
var k = process.versions.node.split(".").map(Number);
return k[0] === 0 && k[1] > 10 || k[0] > 0;
}(), L.isNode && L.toFastProperties(process);
try {
throw new Error();
} catch (k) {
L.lastLineError = k;
}
return Pn = L, Pn;
}
var st = { exports: {} }, Dr, Ca;
function cd() {
if (Ca) return Dr;
Ca = 1;
var e = Ae(), n, t = function() {
throw new Error(`No async scheduler available
See http://goo.gl/MqrFmX
`);
}, i = e.getNativePromise();
if (e.isNode && typeof MutationObserver > "u") {
var c = un.setImmediate, r = process.nextTick;
n = e.isRecentNode ? function(o) {
c.call(un, o);
} : function(o) {
r.call(process, o);
};
} else if (typeof i == "function" && typeof i.resolve == "function") {
var a = i.resolve();
n = function(o) {
a.then(o);
};
} else typeof MutationObserver < "u" && !(typeof window < "u" && window.navigator && (window.navigator.standalone || window.cordova)) ? n = function() {
var o = document.createElement("div"), u = { attributes: !0 }, l = !1, b = document.createElement("div"), m = new MutationObserver(function() {
o.classList.toggle("foo"), l = !1;
});
m.observe(b, u);
var g = function() {
l || (l = !0, b.classList.toggle("foo"));
};
return function(y) {
var h = new MutationObserver(function() {
h.disconnect(), y();
});
h.observe(o, u), g();
};
}() : typeof setImmediate < "u" ? n = function(o) {
setImmediate(o);
} : typeof setTimeout < "u" ? n = function(o) {
setTimeout(o, 0);
} : n = t;
return Dr = n, Dr;
}
var vr, Fa;
function ud() {
if (Fa) return vr;
Fa = 1;
function e(t, i, c, r, a) {
for (var o = 0; o < a; ++o)
c[o + r] = t[o + i], t[o + i] = void 0;
}
function n(t) {
this._capacity = t, this._length = 0, this._front = 0;
}
return n.prototype._willBeOverCapacity = function(t) {
return this._capacity < t;
}, n.prototype._pushOne = function(t) {
var i = this.length();
this._checkCapacity(i + 1);
var c = this._front + i & this._capacity - 1;
this[c] = t, this._length = i + 1;
}, n.prototype.push = function(t, i, c) {
var r = this.length() + 3;
if (this._willBeOverCapacity(r)) {
this._pushOne(t), this._pushOne(i), this._pushOne(c);
return;
}
var a = this._front + r - 3;
this._checkCapacity(r);
var o = this._capacity - 1;
this[a + 0 & o] = t, this[a + 1 & o] = i, this[a + 2 & o] = c, this._length = r;
}, n.prototype.shift = function() {
var t = this._front, i = this[t];
return this[t] = void 0, this._front = t + 1 & this._capacity - 1, this._length--, i;
}, n.prototype.length = function() {
return this._length;
}, n.prototype._checkCapacity = function(t) {
this._capacity < t && this._resizeTo(this._capacity << 1);
}, n.prototype._resizeTo = function(t) {
var i = this._capacity;
this._capacity = t;
var c = this._front, r = this._length, a = c + r & i - 1;
e(this, 0, this, i, a);
}, vr = n, vr;
}
var Sa;
function sd() {
if (Sa) return st.exports;
Sa = 1;
var e;
try {
throw new Error();
} catch (u) {
e = u;
}
var n = cd(), t = ud(), i = Ae();
function c() {
this._customScheduler = !1, this._isTickUsed = !1, this._lateQueue = new t(16), this._normalQueue = new t(16), this._haveDrainedQueues = !1, this._trampolineEnabled = !0;
var u = this;
this.drainQueues = function() {
u._drainQueues();
}, this._schedule = n;
}
c.prototype.setScheduler = function(u) {
var l = this._schedule;
return this._schedule = u, this._customScheduler = !0, l;
}, c.prototype.hasCustomScheduler = function() {
return this._customScheduler;
}, c.prototype.enableTrampoline = function() {
this._trampolineEnabled = !0;
}, c.prototype.disableTrampolineIfNecessary = function() {
i.hasDevTools && (this._trampolineEnabled = !1);
}, c.prototype.haveItemsQueued = function() {
return this._isTickUsed || this._haveDrainedQueues;
}, c.prototype.fatalError = function(u, l) {
l ? (process.stderr.write("Fatal " + (u instanceof Error ? u.stack : u) + `
`), process.exit(2)) : this.throwLater(u);
}, c.prototype.throwLater = function(u, l) {
if (arguments.length === 1 && (l = u, u = function() {
throw l;
}), typeof setTimeout < "u")
setTimeout(function() {
u(l);
}, 0);
else try {
this._schedule(function() {
u(l);
});
} catch {
throw new Error(`No async scheduler available
See http://goo.gl/MqrFmX
`);
}
};
function r(u, l, b) {
this._lateQueue.push(u, l, b), this._queueTick();
}
function a(u, l, b) {
this._normalQueue.push(u, l, b), this._queueTick();
}
function o(u) {
this._normalQueue._pushOne(u), this._queueTick();
}
return i.hasDevTools ? (c.prototype.invokeLater = function(u, l, b) {
this._trampolineEnabled ? r.call(this, u, l, b) : this._schedule(function() {
setTimeout(function() {
u.call(l, b);
}, 100);
});
}, c.prototype.invoke = function(u, l, b) {
this._trampolineEnabled ? a.call(this, u, l, b) : this._schedule(function() {
u.call(l, b);
});
}, c.prototype.settlePromises = function(u) {
this._trampolineEnabled ? o.call(this, u) : this._schedule(function() {
u._settlePromises();
});
}) : (c.prototype.invokeLater = r, c.prototype.invoke = a, c.prototype.settlePromises = o), c.prototype._drainQueue = function(u) {
for (; u.length() > 0; ) {
var l = u.shift();
if (typeof l != "function") {
l._settlePromises();
continue;
}
var b = u.shift(), m = u.shift();
l.call(b, m);
}
}, c.prototype._drainQueues = function() {
this._drainQueue(this._normalQueue), this._reset(), this._haveDrainedQueues = !0, this._drainQueue(this._lateQueue);
}, c.prototype._queueTick = function() {
this._isTickUsed || (this._isTickUsed = !0, this._schedule(this.drainQueues));
}, c.prototype._reset = function() {
this._isTickUsed = !1;
}, st.exports = c, st.exports.firstLineError = e, st.exports;
}
var xr, Ba;
function dn() {
if (Ba) return xr;
Ba = 1;
var e = Mn(), n = e.freeze, t = Ae(), i = t.inherits, c = t.notEnumerableProp;
function r(p, d) {
function D(U) {
if (!(this instanceof D)) return new D(U);
c(
this,
"message",
typeof U == "string" ? U : d
), c(this, "name", p), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : Error.call(this);
}
return i(D, Error), D;
}
var a, o, u = r("Warning", "warning"), l = r("CancellationError", "cancellation error"), b = r("TimeoutError", "timeout error"), m = r("AggregateError", "aggregate error");
try {
a = TypeError, o = RangeError;
} catch {
a = r("TypeError", "type error"), o = r("RangeError", "range error");
}
for (var g = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "), f = 0; f < g.length; ++f)
typeof Array.prototype[g[f]] == "function" && (m.prototype[g[f]] = Array.prototype[g[f]]);
e.defineProperty(m.prototype, "length", {
value: 0,
configurable: !1,
writable: !0,
enumerable: !0
}), m.prototype.isOperational = !0;
var y = 0;
m.prototype.toString = function() {
var p = Array(y * 4 + 1).join(" "), d = `
` + p + `AggregateError of:
`;
y++, p = Array(y * 4 + 1).join(" ");
for (var D = 0; D < this.length; ++D) {
for (var U = this[D] === this ? "[Circular AggregateError]" : this[D] + "", _ = U.split(`
`), w = 0; w < _.length; ++w)
_[w] = p + _[w];
U = _.join(`
`), d += U + `
`;
}
return y--, d;
};
function h(p) {
if (!(this instanceof h))
return new h(p);
c(this, "name", "OperationalError"), c(this, "message", p), this.cause = p, this.isOperational = !0, p instanceof Error ? (c(this, "message", p.message), c(this, "stack", p.stack)) : Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
}
i(h, Error);
var s = Error.__BluebirdErrorTypes__;
return s || (s = n({
CancellationError: l,
TimeoutError: b,
OperationalError: h,
RejectionError: h,
AggregateError: m
}), e.defineProperty(Error, "__BluebirdErrorTypes__", {
value: s,
writable: !1,
enumerable: !1,
configurable: !1
})), xr = {
Error,
TypeError: a,
RangeError: o,
CancellationError: s.CancellationError,
OperationalError: s.OperationalError,
TimeoutError: s.TimeoutError,
AggregateError: s.AggregateError,
Warning: u
}, xr;
}
var _r, ka;
function dd() {
return ka || (ka = 1, _r = function(e, n) {
var t = Ae(), i = t.errorObj, c = t.isObject;
function r(m, g) {
if (c(m)) {
if (m instanceof e) return m;
var f = o(m);
if (f === i) {
g && g._pushContext();
var y = e.reject(f.e);
return g && g._popContext(), y;
} else if (typeof f == "function") {
if (l(m)) {
var y = new e(n);
return m._then(
y._fulfill,
y._reject,
void 0,
y,
null
), y;
}
return b(m, f, g);
}
}
return m;
}
function a(m) {
return m.then;
}
function o(m) {
try {
return a(m);
} catch (g) {
return i.e = g, i;
}
}
var u = {}.hasOwnProperty;
function l(m) {
try {
return u.call(m, "_promise0");
} catch {
return !1;
}
}
function b(m, g, f) {
var y = new e(n), h = y;
f && f._pushContext(), y._captureStackTrace(), f && f._popContext();
var s = !0, p = t.tryCatch(g).call(m, d, D);
s = !1, y && p === i && (y._rejectCallback(p.e, !0, !0), y = null);
function d(U) {
y && (y._resolveCallback(U), y = null);
}
function D(U) {
y && (y._rejectCallback(U, s, !0), y = null);
}
return h;
}
return r;
}), _r;
}
var Ur, Wa;
function ld() {
return Wa || (Wa = 1, Ur = function(e, n, t, i, c) {
var r = Ae();
r.isArray;
function a(u) {
switch (u) {
case -2:
return [];
case -3:
return {};
}
}
function o(u) {
var l = this._promise = new e(n);
u instanceof e && l._propagateFrom(u, 3), l._setOnCancel(this), this._values = u, this._length = 0, this._totalResolved = 0, this._init(void 0, -2);
}
return r.inherits(o, c), o.prototype.length = function() {
return this._length;
}, o.prototype.promise = function() {
return this._promise;
}, o.prototype._init = function u(l, b) {
var m = t(this._values, this._promise);
if (m instanceof e) {
m = m._target();
var g = m._bitField;
if (this._values = m, (g & 50397184) === 0)
return this._promise._setAsyncGuaranteed(), m._then(
u,
this._reject,
void 0,
this,
b
);
if ((g & 33554432) !== 0)
m = m._value();
else return (g & 16777216) !== 0 ? this._reject(m._reason()) : this._cancel();
}
if (m = r.asArray(m), m === null) {
var f = i(
"expecting an array or an iterable object but got " + r.classString(m)
).reason();
this._promise._rejectCallback(f, !1);
return;
}
if (m.length === 0) {
b === -5 ? this._resolveEmptyArray() : this._resolve(a(b));
return;
}
this._iterate(m);
}, o.prototype._iterate = function(u) {
var l = this.getActualLength(u.length);
this._length = l, this._values = this.shouldCopyValues() ? new Array(l) : this._values;
for (var b = this._promise, m = !1, g = null, f = 0; f < l; ++f) {
var y = t(u[f], b);
y instanceof e ? (y = y._target(), g = y._bitField) : g = null, m ? g !== null && y.suppressUnhandledRejections() : g !== null ? (g & 50397184) === 0 ? (y._proxy(this, f), this._values[f] = y) : (g & 33554