strapi-plugin-comments
Version:
1,643 lines • 381 kB
JavaScript
import { z as v } from "zod";
import { isProfane as Ov, replaceProfanities as Cv } from "no-profanity";
import "fs";
import "path";
const mm = {
uid: /^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,
relatedUid: /^(?<uid>[a-z0-9-]+\:{2}[a-z0-9-]+\.[a-z0-9-]+)\:{1}(?<id>[a-z0-9-]+)$/i,
email: /\S+@\S+\.\S+/,
sorting: /^(?<path>[a-z0-9-_\:\.]+)\:+(asc|desc)$/i
}, oa = {
ENABLED_COLLECTIONS: "enabledCollections",
APPROVAL_FLOW: "approvalFlow",
ENTRY_LABEL: "entryLabel",
MODERATOR_ROLES: "moderatorRoles",
BAD_WORDS: "badWords",
AUTHOR_BLOCKED_PROPS: "blockedAuthorProps"
};
var Ui = /* @__PURE__ */ ((i) => (i.PENDING = "PENDING", i.APPROVED = "APPROVED", i.REJECTED = "REJECTED", i))(Ui || {}), Zt = /* @__PURE__ */ ((i) => (i.BAD_LANGUAGE = "BAD_LANGUAGE", i.DISCRIMINATION = "DISCRIMINATION", i.OTHER = "OTHER", i))(Zt || {});
const Iv = "plugin::comments", xv = {
collectionName: "plugin_comments_comments",
info: {
tableName: "plugin-comments-comments",
singularName: "comment",
pluralName: "comments",
displayName: "Comment",
description: "Comment content type",
kind: "collectionType"
},
options: {
draftAndPublish: !1
},
pluginOptions: {
"content-manager": {
visible: !1
},
"content-type-builder": {
visible: !1
}
},
attributes: {
content: {
type: "text",
configurable: !1,
required: !0
},
blocked: {
type: "boolean",
default: !1,
configurable: !1
},
blockedThread: {
type: "boolean",
default: !1,
configurable: !1
},
blockReason: {
type: "string",
configurable: !1
},
authorUser: {
type: "relation",
relation: "oneToOne",
target: "plugin::users-permissions.user",
configurable: !1
},
authorId: {
type: "string",
configurable: !1
},
authorName: {
type: "string",
configurable: !1
},
authorEmail: {
type: "email",
configurable: !1
},
authorAvatar: {
type: "string",
configurable: !1
},
isAdminComment: {
type: "boolean",
configurable: !1
},
removed: {
type: "boolean",
configurable: !1
},
approvalStatus: {
type: "enumeration",
enum: Object.values(Ui),
configurable: !1
},
related: {
type: "string",
configurable: !1
},
reports: {
type: "relation",
relation: "oneToMany",
target: "plugin::comments.comment-report",
mappedBy: "related",
configurable: !1
},
threadOf: {
type: "relation",
relation: "oneToOne",
target: "plugin::comments.comment",
configurable: !1
}
}
}, Rv = {
schema: xv
}, Nv = {
collectionName: "plugin_comments_reports",
info: {
tableName: "plugin-comments-reports",
singularName: "comment-report",
pluralName: "comment-reports",
displayName: "Reports",
description: "Reports content type",
kind: "collectionType"
},
options: {
draftAndPublish: !1
},
pluginOptions: {
"content-manager": {
visible: !1
},
"content-type-builder": {
visible: !1
}
},
attributes: {
content: {
type: "text",
configurable: !1
},
reason: {
type: "enumeration",
enum: Object.values(Zt),
default: Zt.OTHER,
configurable: !1,
required: !0
},
resolved: {
type: "boolean",
default: !1,
configurable: !1
},
related: {
type: "relation",
relation: "manyToOne",
target: "plugin::comments.comment",
inversedBy: "reports",
configurable: !1
}
}
}, Lv = {
schema: Nv
}, Pv = {
comment: Rv,
"comment-report": Lv
}, Dv = {
name: "comments",
plugin: "comments",
type: "json"
}, Fv = ({ strapi: i }) => {
if (!Uv({ strapi: i })) {
i.log.warn(
"[Comments Plugin] Custom fields disabled. Upgrade Strapi to use custom fields."
);
return;
}
i.customFields.register(Dv);
}, Uv = ({ strapi: i }) => !!i.customFields, ft = (i, u) => i.plugin("comments").service(u), Mv = (i) => {
Fv(i);
const u = ft(i.strapi, "common");
i.strapi.documents.use(async (o, h) => {
if (o.action === "delete" && o.uid.startsWith("api::")) {
const { params: { locale: m, documentId: A }, uid: E } = o, C = [E, A].join(":");
await u.perRemove(C, m);
}
return h();
});
}, lr = (i, u) => i.plugin("comments").contentType(u)?.uid, il = (i) => {
const u = "plugin::users-permissions.user", o = ["media", "relation"], { attributes: h } = i.contentType(u) ?? { attributes: {} };
return (Object.keys(h)?.filter(
(A) => o.includes(h[A]?.type)
)).includes("avatar") ? {
populate: { avatar: !0 }
} : !0;
};
function vm(i) {
return typeof i == "string" ? i.split(":") : "createdAt:desc".split(":");
}
const Wv = (i) => {
const { gql: { auth: u = !1 } = {} } = i;
return {
"Query.findAllFlat": { auth: u },
"Query.findAllInHierarchy": { auth: u },
"Mutation.getCreateComment": { auth: u },
"Mutation.getUpdateComment": { auth: u },
"Mutation.getRemoveComment": { auth: u },
"Mutation.getCreateAbuseReport": { auth: u }
};
}, Bv = (i, u) => {
const { nonNull: o } = u;
return {
type: o("Report"),
args: {
input: o("CreateReport")
},
async resolve(h, m, A) {
const { input: E } = m, { state: { user: C = void 0 } = {} } = A, { commentId: x, relation: N, ...O } = E;
try {
return await ft(i, "client").reportAbuse(
{ ...O, commentId: x, relation: N },
C
);
} catch (U) {
throw U;
}
}
};
}, $v = (i, u) => {
const { nonNull: o } = u;
return {
type: o("CommentSingle"),
args: {
input: o("CreateComment")
},
async resolve(h, m, A) {
const { input: E } = m, { state: { user: C = void 0 } = {} } = A, { relation: x, ...N } = E;
try {
return await ft(i, "client").create(
{ ...N, relation: x },
C
);
} catch (O) {
throw O;
}
}
};
}, jv = (i, u) => {
const { nonNull: o } = u;
return {
type: o("CommentSingle"),
args: {
input: o("RemoveComment")
},
async resolve(h, m, A) {
const { input: E } = m, { state: { user: C = void 0 } = {} } = A, { id: x, relation: N, author: O } = E;
try {
return await ft(i, "client").markAsRemoved(
{ commentId: x, relation: N, authorId: O?.id },
C
);
} catch (U) {
throw U;
}
}
};
}, kv = (i, u) => {
const { nonNull: o } = u;
return {
type: o("CommentSingle"),
args: {
input: o("UpdateComment")
},
async resolve(h, m, A) {
const { input: E } = m, { state: { user: C = void 0 } = {} } = A, { id: x, relation: N, ...O } = E;
try {
return await ft(i, "client").update(
{ ...O, relation: N, commentId: x },
C
);
} catch (U) {
throw U;
}
}
};
}, Vv = (i, u) => {
const o = {
getCreateComment: $v,
getUpdateComment: kv,
getRemoveComment: jv,
getCreateAbuseReport: Bv
};
return u.extendType({
type: "Mutation",
definition(h) {
for (const [m, A] of Object.entries(o)) {
const E = A(i, u);
h.field(m, E);
}
}
});
};
var xr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, xf = { exports: {} };
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
xf.exports;
(function(i, u) {
(function() {
var o, h = "4.17.21", m = 200, A = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", E = "Expected a function", C = "Invalid `variable` option passed into `_.template`", x = "__lodash_hash_undefined__", N = 500, O = "__lodash_placeholder__", U = 1, M = 2, Q = 4, j = 1, J = 2, te = 1, X = 2, me = 4, ve = 8, Pe = 16, Ge = 32, Ye = 64, We = 128, hn = 256, kn = 512, Qe = 30, Sn = "...", En = 800, Kr = 16, fr = 1, Ze = 2, Bi = 3, Mt = 1 / 0, Kt = 9007199254740991, xo = 17976931348623157e292, ei = NaN, Wt = 4294967295, Ro = Wt - 1, ze = Wt >>> 1, Nr = [
["ary", We],
["bind", te],
["bindKey", X],
["curry", ve],
["curryRight", Pe],
["flip", kn],
["partial", Ge],
["partialRight", Ye],
["rearg", hn]
], z = "[object Arguments]", B = "[object Array]", V = "[object AsyncFunction]", q = "[object Boolean]", re = "[object Date]", ot = "[object DOMException]", wt = "[object Error]", ut = "[object Function]", Ke = "[object GeneratorFunction]", De = "[object Map]", hr = "[object Number]", jf = "[object Null]", Vn = "[object Object]", cl = "[object Promise]", _ = "[object Proxy]", $i = "[object RegExp]", Bt = "[object Set]", ji = "[object String]", At = "[object Symbol]", kf = "[object Undefined]", Lr = "[object WeakMap]", Vf = "[object WeakSet]", pr = "[object ArrayBuffer]", $t = "[object DataView]", No = "[object Float32Array]", dr = "[object Float64Array]", gr = "[object Int8Array]", ti = "[object Int16Array]", jt = "[object Int32Array]", mr = "[object Uint8Array]", Lo = "[object Uint8ClampedArray]", pn = "[object Uint16Array]", Pr = "[object Uint32Array]", Gn = /\b__p \+= '';/g, ki = /\b(__p \+=) '' \+/g, zn = /(__e\(.*?\)|\b__t\)) \+\n'';/g, ni = /&(?:amp|lt|gt|quot|#39);/g, Po = /[&<>"']/g, Gf = RegExp(ni.source), zf = RegExp(Po.source), qf = /<%-([\s\S]+?)%>/g, Hf = /<%([\s\S]+?)%>/g, ca = /<%=([\s\S]+?)%>/g, Yf = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Qf = /^\w*$/, Dr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Tn = /[\\^$.*+?()[\]{}|]/g, Jf = RegExp(Tn.source), ri = /^\s+/, On = /\s/, Xf = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Zf = /\{\n\/\* \[wrapped with (.+)\] \*/, Kf = /,? & /, ii = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Do = /[()=,{}\[\]\/\s]/, eh = /\\(\\)?/g, Vi = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, oi = /\w*$/, th = /^[-+]0x[0-9a-f]+$/i, Fo = /^0b[01]+$/i, Uo = /^\[object .+?Constructor\]$/, fl = /^0o[0-7]+$/i, dn = /^(?:0|[1-9]\d*)$/, Gi = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Mo = /($^)/, qn = /['\n\r\u2028\u2029\\]/g, zi = "\\ud800-\\udfff", nh = "\\u0300-\\u036f", qi = "\\ufe20-\\ufe2f", gn = "\\u20d0-\\u20ff", ui = nh + qi + gn, Hi = "\\u2700-\\u27bf", hl = "a-z\\xdf-\\xf6\\xf8-\\xff", Yi = "\\xac\\xb1\\xd7\\xf7", rh = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", Qi = "\\u2000-\\u206f", ai = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", Wo = "A-Z\\xc0-\\xd6\\xd8-\\xde", Bo = "\\ufe0e\\ufe0f", $o = Yi + rh + Qi + ai, Ji = "['’]", fa = "[" + zi + "]", jo = "[" + $o + "]", si = "[" + ui + "]", ko = "\\d+", ha = "[" + Hi + "]", pl = "[" + hl + "]", dl = "[^" + zi + $o + ko + Hi + hl + Wo + "]", pa = "\\ud83c[\\udffb-\\udfff]", gl = "(?:" + si + "|" + pa + ")", da = "[^" + zi + "]", ga = "(?:\\ud83c[\\udde6-\\uddff]){2}", ma = "[\\ud800-\\udbff][\\udc00-\\udfff]", li = "[" + Wo + "]", ml = "\\u200d", va = "(?:" + pl + "|" + dl + ")", ih = "(?:" + li + "|" + dl + ")", vl = "(?:" + Ji + "(?:d|ll|m|re|s|t|ve))?", yl = "(?:" + Ji + "(?:D|LL|M|RE|S|T|VE))?", Vo = gl + "?", _l = "[" + Bo + "]?", ya = "(?:" + ml + "(?:" + [da, ga, ma].join("|") + ")" + _l + Vo + ")*", oh = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", uh = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", bl = _l + Vo + ya, ah = "(?:" + [ha, ga, ma].join("|") + ")" + bl, sh = "(?:" + [da + si + "?", si, ga, ma, fa].join("|") + ")", lh = RegExp(Ji, "g"), ch = RegExp(si, "g"), _a = RegExp(pa + "(?=" + pa + ")|" + sh + bl, "g"), wl = RegExp([
li + "?" + pl + "+" + vl + "(?=" + [jo, li, "$"].join("|") + ")",
ih + "+" + yl + "(?=" + [jo, li + va, "$"].join("|") + ")",
li + "?" + va + "+" + vl,
li + "+" + yl,
uh,
oh,
ko,
ah
].join("|"), "g"), fh = RegExp("[" + ml + zi + ui + Bo + "]"), hh = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, ph = [
"Array",
"Buffer",
"DataView",
"Date",
"Error",
"Float32Array",
"Float64Array",
"Function",
"Int8Array",
"Int16Array",
"Int32Array",
"Map",
"Math",
"Object",
"Promise",
"RegExp",
"Set",
"String",
"Symbol",
"TypeError",
"Uint8Array",
"Uint8ClampedArray",
"Uint16Array",
"Uint32Array",
"WeakMap",
"_",
"clearTimeout",
"isFinite",
"parseInt",
"setTimeout"
], dh = -1, xe = {};
xe[No] = xe[dr] = xe[gr] = xe[ti] = xe[jt] = xe[mr] = xe[Lo] = xe[pn] = xe[Pr] = !0, xe[z] = xe[B] = xe[pr] = xe[q] = xe[$t] = xe[re] = xe[wt] = xe[ut] = xe[De] = xe[hr] = xe[Vn] = xe[$i] = xe[Bt] = xe[ji] = xe[Lr] = !1;
var Oe = {};
Oe[z] = Oe[B] = Oe[pr] = Oe[$t] = Oe[q] = Oe[re] = Oe[No] = Oe[dr] = Oe[gr] = Oe[ti] = Oe[jt] = Oe[De] = Oe[hr] = Oe[Vn] = Oe[$i] = Oe[Bt] = Oe[ji] = Oe[At] = Oe[mr] = Oe[Lo] = Oe[pn] = Oe[Pr] = !0, Oe[wt] = Oe[ut] = Oe[Lr] = !1;
var Go = {
// Latin-1 Supplement block.
À: "A",
Á: "A",
Â: "A",
Ã: "A",
Ä: "A",
Å: "A",
à: "a",
á: "a",
â: "a",
ã: "a",
ä: "a",
å: "a",
Ç: "C",
ç: "c",
Ð: "D",
ð: "d",
È: "E",
É: "E",
Ê: "E",
Ë: "E",
è: "e",
é: "e",
ê: "e",
ë: "e",
Ì: "I",
Í: "I",
Î: "I",
Ï: "I",
ì: "i",
í: "i",
î: "i",
ï: "i",
Ñ: "N",
ñ: "n",
Ò: "O",
Ó: "O",
Ô: "O",
Õ: "O",
Ö: "O",
Ø: "O",
ò: "o",
ó: "o",
ô: "o",
õ: "o",
ö: "o",
ø: "o",
Ù: "U",
Ú: "U",
Û: "U",
Ü: "U",
ù: "u",
ú: "u",
û: "u",
ü: "u",
Ý: "Y",
ý: "y",
ÿ: "y",
Æ: "Ae",
æ: "ae",
Þ: "Th",
þ: "th",
ß: "ss",
// Latin Extended-A block.
Ā: "A",
Ă: "A",
Ą: "A",
ā: "a",
ă: "a",
ą: "a",
Ć: "C",
Ĉ: "C",
Ċ: "C",
Č: "C",
ć: "c",
ĉ: "c",
ċ: "c",
č: "c",
Ď: "D",
Đ: "D",
ď: "d",
đ: "d",
Ē: "E",
Ĕ: "E",
Ė: "E",
Ę: "E",
Ě: "E",
ē: "e",
ĕ: "e",
ė: "e",
ę: "e",
ě: "e",
Ĝ: "G",
Ğ: "G",
Ġ: "G",
Ģ: "G",
ĝ: "g",
ğ: "g",
ġ: "g",
ģ: "g",
Ĥ: "H",
Ħ: "H",
ĥ: "h",
ħ: "h",
Ĩ: "I",
Ī: "I",
Ĭ: "I",
Į: "I",
İ: "I",
ĩ: "i",
ī: "i",
ĭ: "i",
į: "i",
ı: "i",
Ĵ: "J",
ĵ: "j",
Ķ: "K",
ķ: "k",
ĸ: "k",
Ĺ: "L",
Ļ: "L",
Ľ: "L",
Ŀ: "L",
Ł: "L",
ĺ: "l",
ļ: "l",
ľ: "l",
ŀ: "l",
ł: "l",
Ń: "N",
Ņ: "N",
Ň: "N",
Ŋ: "N",
ń: "n",
ņ: "n",
ň: "n",
ŋ: "n",
Ō: "O",
Ŏ: "O",
Ő: "O",
ō: "o",
ŏ: "o",
ő: "o",
Ŕ: "R",
Ŗ: "R",
Ř: "R",
ŕ: "r",
ŗ: "r",
ř: "r",
Ś: "S",
Ŝ: "S",
Ş: "S",
Š: "S",
ś: "s",
ŝ: "s",
ş: "s",
š: "s",
Ţ: "T",
Ť: "T",
Ŧ: "T",
ţ: "t",
ť: "t",
ŧ: "t",
Ũ: "U",
Ū: "U",
Ŭ: "U",
Ů: "U",
Ű: "U",
Ų: "U",
ũ: "u",
ū: "u",
ŭ: "u",
ů: "u",
ű: "u",
ų: "u",
Ŵ: "W",
ŵ: "w",
Ŷ: "Y",
ŷ: "y",
Ÿ: "Y",
Ź: "Z",
Ż: "Z",
Ž: "Z",
ź: "z",
ż: "z",
ž: "z",
IJ: "IJ",
ij: "ij",
Œ: "Oe",
œ: "oe",
ʼn: "'n",
ſ: "s"
}, gh = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
}, zo = {
"&": "&",
"<": "<",
">": ">",
""": '"',
"'": "'"
}, mh = {
"\\": "\\",
"'": "'",
"\n": "n",
"\r": "r",
"\u2028": "u2028",
"\u2029": "u2029"
}, vh = parseFloat, yh = parseInt, ba = typeof xr == "object" && xr && xr.Object === Object && xr, Al = typeof self == "object" && self && self.Object === Object && self, et = ba || Al || Function("return this")(), wa = u && !u.nodeType && u, Fr = wa && !0 && i && !i.nodeType && i, Sl = Fr && Fr.exports === wa, Aa = Sl && ba.process, kt = function() {
try {
var p = Fr && Fr.require && Fr.require("util").types;
return p || Aa && Aa.binding && Aa.binding("util");
} catch {
}
}(), Sa = kt && kt.isArrayBuffer, Ea = kt && kt.isDate, qo = kt && kt.isMap, El = kt && kt.isRegExp, Ta = kt && kt.isSet, Xi = kt && kt.isTypedArray;
function Lt(p, y, l) {
switch (l.length) {
case 0:
return p.call(y);
case 1:
return p.call(y, l[0]);
case 2:
return p.call(y, l[0], l[1]);
case 3:
return p.call(y, l[0], l[1], l[2]);
}
return p.apply(y, l);
}
function _h(p, y, l, I) {
for (var D = -1, F = p == null ? 0 : p.length; ++D < F; ) {
var fe = p[D];
y(I, fe, l(fe), p);
}
return I;
}
function Vt(p, y) {
for (var l = -1, I = p == null ? 0 : p.length; ++l < I && y(p[l], l, p) !== !1; )
;
return p;
}
function Tl(p, y) {
for (var l = p == null ? 0 : p.length; l-- && y(p[l], l, p) !== !1; )
;
return p;
}
function Ho(p, y) {
for (var l = -1, I = p == null ? 0 : p.length; ++l < I; )
if (!y(p[l], l, p))
return !1;
return !0;
}
function vr(p, y) {
for (var l = -1, I = p == null ? 0 : p.length, D = 0, F = []; ++l < I; ) {
var fe = p[l];
y(fe, l, p) && (F[D++] = fe);
}
return F;
}
function Zi(p, y) {
var l = p == null ? 0 : p.length;
return !!l && ci(p, y, 0) > -1;
}
function Ki(p, y, l) {
for (var I = -1, D = p == null ? 0 : p.length; ++I < D; )
if (l(y, p[I]))
return !0;
return !1;
}
function Ce(p, y) {
for (var l = -1, I = p == null ? 0 : p.length, D = Array(I); ++l < I; )
D[l] = y(p[l], l, p);
return D;
}
function Gt(p, y) {
for (var l = -1, I = y.length, D = p.length; ++l < I; )
p[D + l] = y[l];
return p;
}
function Yo(p, y, l, I) {
var D = -1, F = p == null ? 0 : p.length;
for (I && F && (l = p[++D]); ++D < F; )
l = y(l, p[D], D, p);
return l;
}
function Ol(p, y, l, I) {
var D = p == null ? 0 : p.length;
for (I && D && (l = p[--D]); D--; )
l = y(l, p[D], D, p);
return l;
}
function Oa(p, y) {
for (var l = -1, I = p == null ? 0 : p.length; ++l < I; )
if (y(p[l], l, p))
return !0;
return !1;
}
var Cl = xa("length");
function Il(p) {
return p.split("");
}
function xl(p) {
return p.match(ii) || [];
}
function Ca(p, y, l) {
var I;
return l(p, function(D, F, fe) {
if (y(D, F, fe))
return I = F, !1;
}), I;
}
function Qo(p, y, l, I) {
for (var D = p.length, F = l + (I ? 1 : -1); I ? F-- : ++F < D; )
if (y(p[F], F, p))
return F;
return -1;
}
function ci(p, y, l) {
return y === y ? Ml(p, y, l) : Qo(p, Ia, l);
}
function bh(p, y, l, I) {
for (var D = l - 1, F = p.length; ++D < F; )
if (I(p[D], y))
return D;
return -1;
}
function Ia(p) {
return p !== p;
}
function Rl(p, y) {
var l = p == null ? 0 : p.length;
return l ? La(p, y) / l : ei;
}
function xa(p) {
return function(y) {
return y == null ? o : y[p];
};
}
function Ra(p) {
return function(y) {
return p == null ? o : p[y];
};
}
function Nl(p, y, l, I, D) {
return D(p, function(F, fe, ye) {
l = I ? (I = !1, F) : y(l, F, fe, ye);
}), l;
}
function Na(p, y) {
var l = p.length;
for (p.sort(y); l--; )
p[l] = p[l].value;
return p;
}
function La(p, y) {
for (var l, I = -1, D = p.length; ++I < D; ) {
var F = y(p[I]);
F !== o && (l = l === o ? F : l + F);
}
return l;
}
function Pa(p, y) {
for (var l = -1, I = Array(p); ++l < p; )
I[l] = y(l);
return I;
}
function wh(p, y) {
return Ce(y, function(l) {
return [l, p[l]];
});
}
function Ll(p) {
return p && p.slice(0, Ua(p) + 1).replace(ri, "");
}
function zt(p) {
return function(y) {
return p(y);
};
}
function Ee(p, y) {
return Ce(y, function(l) {
return p[l];
});
}
function de(p, y) {
return p.has(y);
}
function Pl(p, y) {
for (var l = -1, I = p.length; ++l < I && ci(y, p[l], 0) > -1; )
;
return l;
}
function Dl(p, y) {
for (var l = p.length; l-- && ci(y, p[l], 0) > -1; )
;
return l;
}
function Ah(p, y) {
for (var l = p.length, I = 0; l--; )
p[l] === y && ++I;
return I;
}
var Sh = Ra(Go), Eh = Ra(gh);
function Th(p) {
return "\\" + mh[p];
}
function Fl(p, y) {
return p == null ? o : p[y];
}
function fi(p) {
return fh.test(p);
}
function at(p) {
return hh.test(p);
}
function Da(p) {
for (var y, l = []; !(y = p.next()).done; )
l.push(y.value);
return l;
}
function Hn(p) {
var y = -1, l = Array(p.size);
return p.forEach(function(I, D) {
l[++y] = [D, I];
}), l;
}
function Fa(p, y) {
return function(l) {
return p(y(l));
};
}
function Cn(p, y) {
for (var l = -1, I = p.length, D = 0, F = []; ++l < I; ) {
var fe = p[l];
(fe === y || fe === O) && (p[l] = O, F[D++] = l);
}
return F;
}
function St(p) {
var y = -1, l = Array(p.size);
return p.forEach(function(I) {
l[++y] = I;
}), l;
}
function Ul(p) {
var y = -1, l = Array(p.size);
return p.forEach(function(I) {
l[++y] = [I, I];
}), l;
}
function Ml(p, y, l) {
for (var I = l - 1, D = p.length; ++I < D; )
if (p[I] === y)
return I;
return -1;
}
function Wl(p, y, l) {
for (var I = l + 1; I--; )
if (p[I] === y)
return I;
return I;
}
function Ur(p) {
return fi(p) ? Ch(p) : Cl(p);
}
function en(p) {
return fi(p) ? Ih(p) : Il(p);
}
function Ua(p) {
for (var y = p.length; y-- && On.test(p.charAt(y)); )
;
return y;
}
var Oh = Ra(zo);
function Ch(p) {
for (var y = _a.lastIndex = 0; _a.test(p); )
++y;
return y;
}
function Ih(p) {
return p.match(_a) || [];
}
function xh(p) {
return p.match(wl) || [];
}
var Rh = function p(y) {
y = y == null ? et : mn.defaults(et.Object(), y, mn.pick(et, ph));
var l = y.Array, I = y.Date, D = y.Error, F = y.Function, fe = y.Math, ye = y.Object, Ma = y.RegExp, Mr = y.String, tn = y.TypeError, Jo = l.prototype, Nh = F.prototype, hi = ye.prototype, Xo = y["__core-js_shared__"], nn = Nh.toString, _e = hi.hasOwnProperty, Lh = 0, Bl = function() {
var e = /[^.]+$/.exec(Xo && Xo.keys && Xo.keys.IE_PROTO || "");
return e ? "Symbol(src)_1." + e : "";
}(), Zo = hi.toString, Ph = nn.call(ye), Yn = et._, Dh = Ma(
"^" + nn.call(_e).replace(Tn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
), Ko = Sl ? y.Buffer : o, yr = y.Symbol, eu = y.Uint8Array, $l = Ko ? Ko.allocUnsafe : o, In = Fa(ye.getPrototypeOf, ye), jl = ye.create, kl = hi.propertyIsEnumerable, Pt = Jo.splice, Vl = yr ? yr.isConcatSpreadable : o, eo = yr ? yr.iterator : o, Wr = yr ? yr.toStringTag : o, tu = function() {
try {
var e = Hr(ye, "defineProperty");
return e({}, "", {}), e;
} catch {
}
}(), Fh = y.clearTimeout !== et.clearTimeout && y.clearTimeout, Gl = I && I.now !== et.Date.now && I.now, zl = y.setTimeout !== et.setTimeout && y.setTimeout, nu = fe.ceil, ru = fe.floor, to = ye.getOwnPropertySymbols, no = Ko ? Ko.isBuffer : o, ro = y.isFinite, Uh = Jo.join, ql = Fa(ye.keys, ye), Je = fe.max, Fe = fe.min, Wa = I.now, Br = y.parseInt, qt = fe.random, Mh = Jo.reverse, iu = Hr(y, "DataView"), pi = Hr(y, "Map"), $r = Hr(y, "Promise"), di = Hr(y, "Set"), _r = Hr(y, "WeakMap"), io = Hr(ye, "create"), oo = _r && new _r(), Be = {}, xn = Yr(iu), Ba = Yr(pi), ou = Yr($r), jr = Yr(di), Hl = Yr(_r), tt = yr ? yr.prototype : o, kr = tt ? tt.valueOf : o, Yl = tt ? tt.toString : o;
function d(e) {
if (Ne(e) && !ee(e) && !(e instanceof ae)) {
if (e instanceof rn)
return e;
if (_e.call(e, "__wrapped__"))
return bo(e);
}
return new rn(e);
}
var gi = /* @__PURE__ */ function() {
function e() {
}
return function(t) {
if (!Me(t))
return {};
if (jl)
return jl(t);
e.prototype = t;
var n = new e();
return e.prototype = o, n;
};
}();
function mi() {
}
function rn(e, t) {
this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = o;
}
d.templateSettings = {
/**
* Used to detect `data` property values to be HTML-escaped.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
escape: qf,
/**
* Used to detect code to be evaluated.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
evaluate: Hf,
/**
* Used to detect `data` property values to inject.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
interpolate: ca,
/**
* Used to reference the data object in the template text.
*
* @memberOf _.templateSettings
* @type {string}
*/
variable: "",
/**
* Used to import variables into the compiled template.
*
* @memberOf _.templateSettings
* @type {Object}
*/
imports: {
/**
* A reference to the `lodash` function.
*
* @memberOf _.templateSettings.imports
* @type {Function}
*/
_: d
}
}, d.prototype = mi.prototype, d.prototype.constructor = d, rn.prototype = gi(mi.prototype), rn.prototype.constructor = rn;
function ae(e) {
this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = Wt, this.__views__ = [];
}
function Ql() {
var e = new ae(this.__wrapped__);
return e.__actions__ = Tt(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this.__filtered__, e.__iteratees__ = Tt(this.__iteratees__), e.__takeCount__ = this.__takeCount__, e.__views__ = Tt(this.__views__), e;
}
function Wh() {
if (this.__filtered__) {
var e = new ae(this);
e.__dir__ = -1, e.__filtered__ = !0;
} else
e = this.clone(), e.__dir__ *= -1;
return e;
}
function Bh() {
var e = this.__wrapped__.value(), t = this.__dir__, n = ee(e), r = t < 0, a = n ? e.length : 0, s = Oc(0, a, this.__views__), c = s.start, f = s.end, g = f - c, w = r ? f : c - 1, b = this.__iteratees__, S = b.length, T = 0, R = Fe(g, this.__takeCount__);
if (!n || !r && a == g && R == g)
return Su(e, this.__actions__);
var L = [];
e:
for (; g-- && T < R; ) {
w += t;
for (var W = -1, P = e[w]; ++W < S; ) {
var $ = b[W], k = $.iteratee, Ae = $.type, Se = k(P);
if (Ae == Ze)
P = Se;
else if (!Se) {
if (Ae == fr)
continue e;
break e;
}
}
L[T++] = P;
}
return L;
}
ae.prototype = gi(mi.prototype), ae.prototype.constructor = ae;
function vn(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var r = e[t];
this.set(r[0], r[1]);
}
}
function $h() {
this.__data__ = io ? io(null) : {}, this.size = 0;
}
function jh(e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0, t;
}
function $a(e) {
var t = this.__data__;
if (io) {
var n = t[e];
return n === x ? o : n;
}
return _e.call(t, e) ? t[e] : o;
}
function Jl(e) {
var t = this.__data__;
return io ? t[e] !== o : _e.call(t, e);
}
function kh(e, t) {
var n = this.__data__;
return this.size += this.has(e) ? 0 : 1, n[e] = io && t === o ? x : t, this;
}
vn.prototype.clear = $h, vn.prototype.delete = jh, vn.prototype.get = $a, vn.prototype.has = Jl, vn.prototype.set = kh;
function Qn(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var r = e[t];
this.set(r[0], r[1]);
}
}
function Vh() {
this.__data__ = [], this.size = 0;
}
function Xl(e) {
var t = this.__data__, n = au(t, e);
if (n < 0)
return !1;
var r = t.length - 1;
return n == r ? t.pop() : Pt.call(t, n, 1), --this.size, !0;
}
function ja(e) {
var t = this.__data__, n = au(t, e);
return n < 0 ? o : t[n][1];
}
function Gh(e) {
return au(this.__data__, e) > -1;
}
function ka(e, t) {
var n = this.__data__, r = au(n, e);
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
}
Qn.prototype.clear = Vh, Qn.prototype.delete = Xl, Qn.prototype.get = ja, Qn.prototype.has = Gh, Qn.prototype.set = ka;
function Rn(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var r = e[t];
this.set(r[0], r[1]);
}
}
function Zl() {
this.size = 0, this.__data__ = {
hash: new vn(),
map: new (pi || Qn)(),
string: new vn()
};
}
function Kl(e) {
var t = Nu(this, e).delete(e);
return this.size -= t ? 1 : 0, t;
}
function uu(e) {
return Nu(this, e).get(e);
}
function zh(e) {
return Nu(this, e).has(e);
}
function ec(e, t) {
var n = Nu(this, e), r = n.size;
return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
}
Rn.prototype.clear = Zl, Rn.prototype.delete = Kl, Rn.prototype.get = uu, Rn.prototype.has = zh, Rn.prototype.set = ec;
function br(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.__data__ = new Rn(); ++t < n; )
this.add(e[t]);
}
function qh(e) {
return this.__data__.set(e, x), this;
}
function tc(e) {
return this.__data__.has(e);
}
br.prototype.add = br.prototype.push = qh, br.prototype.has = tc;
function yn(e) {
var t = this.__data__ = new Qn(e);
this.size = t.size;
}
function Va() {
this.__data__ = new Qn(), this.size = 0;
}
function nc(e) {
var t = this.__data__, n = t.delete(e);
return this.size = t.size, n;
}
function Ga(e) {
return this.__data__.get(e);
}
function Hh(e) {
return this.__data__.has(e);
}
function za(e, t) {
var n = this.__data__;
if (n instanceof Qn) {
var r = n.__data__;
if (!pi || r.length < m - 1)
return r.push([e, t]), this.size = ++n.size, this;
n = this.__data__ = new Rn(r);
}
return n.set(e, t), this.size = n.size, this;
}
yn.prototype.clear = Va, yn.prototype.delete = nc, yn.prototype.get = Ga, yn.prototype.has = Hh, yn.prototype.set = za;
function se(e, t) {
var n = ee(e), r = !n && Or(e), a = !n && !r && wn(e), s = !n && !r && !a && ur(e), c = n || r || a || s, f = c ? Pa(e.length, Mr) : [], g = f.length;
for (var w in e)
(t || _e.call(e, w)) && !(c && // Safari 9 has enumerable `arguments.length` in strict mode.
(w == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
a && (w == "offset" || w == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
s && (w == "buffer" || w == "byteLength" || w == "byteOffset") || // Skip index properties.
er(w, g))) && f.push(w);
return f;
}
function rc(e) {
var t = e.length;
return t ? e[ho(0, t - 1)] : o;
}
function Yh(e, t) {
return _o(Tt(e), Dt(t, 0, e.length));
}
function uo(e) {
return _o(Tt(e));
}
function qa(e, t, n) {
(n !== o && !be(e[t], n) || n === o && !(t in e)) && Nn(e, t, n);
}
function ht(e, t, n) {
var r = e[t];
(!(_e.call(e, t) && be(r, n)) || n === o && !(t in e)) && Nn(e, t, n);
}
function au(e, t) {
for (var n = e.length; n--; )
if (be(e[n][0], t))
return n;
return -1;
}
function su(e, t, n, r) {
return Jn(e, function(a, s, c) {
t(r, a, n(a), c);
}), r;
}
function lu(e, t) {
return e && Mn(t, rt(t), e);
}
function ic(e, t) {
return e && Mn(t, Rt(t), e);
}
function Nn(e, t, n) {
t == "__proto__" && tu ? tu(e, t, {
configurable: !0,
enumerable: !0,
value: n,
writable: !0
}) : e[t] = n;
}
function Et(e, t) {
for (var n = -1, r = t.length, a = l(r), s = e == null; ++n < r; )
a[n] = s ? o : Wn(e, t[n]);
return a;
}
function Dt(e, t, n) {
return e === e && (n !== o && (e = e <= n ? e : n), t !== o && (e = e >= t ? e : t)), e;
}
function Ft(e, t, n, r, a, s) {
var c, f = t & U, g = t & M, w = t & Q;
if (n && (c = a ? n(e, r, a, s) : n(e)), c !== o)
return c;
if (!Me(e))
return e;
var b = ee(e);
if (b) {
if (c = mp(e), !f)
return Tt(e, c);
} else {
var S = mt(e), T = S == ut || S == Ke;
if (wn(e))
return as(e, f);
if (S == Vn || S == z || T && !a) {
if (c = g || T ? {} : Cc(e), !f)
return g ? ap(e, ic(c, e)) : up(e, lu(c, e));
} else {
if (!Oe[S])
return a ? e : {};
c = vp(e, S, f);
}
}
s || (s = new yn());
var R = s.get(e);
if (R)
return R;
s.set(e, c), tf(e) ? e.forEach(function(P) {
c.add(Ft(P, t, n, P, e, s));
}) : rr(e) && e.forEach(function(P, $) {
c.set($, Ft(P, t, n, $, e, s));
});
var L = w ? g ? ds : ps : g ? Rt : rt, W = b ? o : L(e);
return Vt(W || e, function(P, $) {
W && ($ = P, P = e[$]), ht(c, $, Ft(P, t, n, $, e, s));
}), c;
}
function oc(e) {
var t = rt(e);
return function(n) {
return ao(n, e, t);
};
}
function ao(e, t, n) {
var r = n.length;
if (e == null)
return !r;
for (e = ye(e); r--; ) {
var a = n[r], s = t[a], c = e[a];
if (c === o && !(a in e) || !s(c))
return !1;
}
return !0;
}
function Ha(e, t, n) {
if (typeof e != "function")
throw new tn(E);
return yo(function() {
e.apply(o, n);
}, t);
}
function Vr(e, t, n, r) {
var a = -1, s = Zi, c = !0, f = e.length, g = [], w = t.length;
if (!f)
return g;
n && (t = Ce(t, zt(n))), r ? (s = Ki, c = !1) : t.length >= m && (s = de, c = !1, t = new br(t));
e:
for (; ++a < f; ) {
var b = e[a], S = n == null ? b : n(b);
if (b = r || b !== 0 ? b : 0, c && S === S) {
for (var T = w; T--; )
if (t[T] === S)
continue e;
g.push(b);
} else s(t, S, r) || g.push(b);
}
return g;
}
var Jn = gc(Ln), cu = gc(fu, !0);
function Ya(e, t) {
var n = !0;
return Jn(e, function(r, a, s) {
return n = !!t(r, a, s), n;
}), n;
}
function _n(e, t, n) {
for (var r = -1, a = e.length; ++r < a; ) {
var s = e[r], c = t(s);
if (c != null && (f === o ? c === c && !Qt(c) : n(c, f)))
var f = c, g = s;
}
return g;
}
function wr(e, t, n, r) {
var a = e.length;
for (n = H(n), n < 0 && (n = -n > a ? 0 : a + n), r = r === o || r > a ? a : H(r), r < 0 && (r += a), r = n > r ? 0 : of(r); n < r; )
e[n++] = t;
return e;
}
function Qa(e, t) {
var n = [];
return Jn(e, function(r, a, s) {
t(r, a, s) && n.push(r);
}), n;
}
function Xe(e, t, n, r, a) {
var s = -1, c = e.length;
for (n || (n = _p), a || (a = []); ++s < c; ) {
var f = e[s];
t > 0 && n(f) ? t > 1 ? Xe(f, t - 1, n, r, a) : Gt(a, f) : r || (a[a.length] = f);
}
return a;
}
var Ja = mc(), uc = mc(!0);
function Ln(e, t) {
return e && Ja(e, t, rt);
}
function fu(e, t) {
return e && uc(e, t, rt);
}
function so(e, t) {
return vr(t, function(n) {
return ln(e[n]);
});
}
function Gr(e, t) {
t = Sr(t, e);
for (var n = 0, r = t.length; e != null && n < r; )
e = e[bn(t[n++])];
return n && n == r ? e : o;
}
function Xa(e, t, n) {
var r = t(e);
return ee(e) ? r : Gt(r, n(e));
}
function pt(e) {
return e == null ? e === o ? kf : jf : Wr && Wr in ye(e) ? vs(e) : Tp(e);
}
function dt(e, t) {
return e > t;
}
function Pn(e, t) {
return e != null && _e.call(e, t);
}
function Qh(e, t) {
return e != null && t in ye(e);
}
function Jh(e, t, n) {
return e >= Fe(t, n) && e < Je(t, n);
}
function vi(e, t, n) {
for (var r = n ? Ki : Zi, a = e[0].length, s = e.length, c = s, f = l(s), g = 1 / 0, w = []; c--; ) {
var b = e[c];
c && t && (b = Ce(b, zt(t))), g = Fe(b.length, g), f[c] = !n && (t || a >= 120 && b.length >= 120) ? new br(c && b) : o;
}
b = e[0];
var S = -1, T = f[0];
e:
for (; ++S < a && w.length < g; ) {
var R = b[S], L = t ? t(R) : R;
if (R = n || R !== 0 ? R : 0, !(T ? de(T, L) : r(w, L, n))) {
for (c = s; --c; ) {
var W = f[c];
if (!(W ? de(W, L) : r(e[c], L, n)))
continue e;
}
T && T.push(L), w.push(R);
}
}
return w;
}
function yi(e, t, n, r) {
return Ln(e, function(a, s, c) {
t(r, n(a), s, c);
}), r;
}
function _i(e, t, n) {
t = Sr(t, e), e = Rc(e, t);
var r = e == null ? e : e[bn(xt(t))];
return r == null ? o : Lt(r, e, n);
}
function Za(e) {
return Ne(e) && pt(e) == z;
}
function Xh(e) {
return Ne(e) && pt(e) == pr;
}
function ac(e) {
return Ne(e) && pt(e) == re;
}
function Dn(e, t, n, r, a) {
return e === t ? !0 : e == null || t == null || !Ne(e) && !Ne(t) ? e !== e && t !== t : lo(e, t, n, r, Dn, a);
}
function lo(e, t, n, r, a, s) {
var c = ee(e), f = ee(t), g = c ? B : mt(e), w = f ? B : mt(t);
g = g == z ? Vn : g, w = w == z ? Vn : w;
var b = g == Vn, S = w == Vn, T = g == w;
if (T && wn(e)) {
if (!wn(t))
return !1;
c = !0, b = !1;
}
if (T && !b)
return s || (s = new yn()), c || ur(e) ? Ec(e, t, n, r, a, s) : pp(e, t, g, n, r, a, s);
if (!(n & j)) {
var R = b && _e.call(e, "__wrapped__"), L = S && _e.call(t, "__wrapped__");
if (R || L) {
var W = R ? e.value() : e, P = L ? t.value() : t;
return s || (s = new yn()), a(W, P, n, r, s);
}
}
return T ? (s || (s = new yn()), dp(e, t, n, r, a, s)) : !1;
}
function Zh(e) {
return Ne(e) && mt(e) == De;
}
function hu(e, t, n, r) {
var a = n.length, s = a, c = !r;
if (e == null)
return !s;
for (e = ye(e); a--; ) {
var f = n[a];
if (c && f[2] ? f[1] !== e[f[0]] : !(f[0] in e))
return !1;
}
for (; ++a < s; ) {
f = n[a];
var g = f[0], w = e[g], b = f[1];
if (c && f[2]) {
if (w === o && !(g in e))
return !1;
} else {
var S = new yn();
if (r)
var T = r(w, b, g, e, t, S);
if (!(T === o ? Dn(b, w, j | J, r, S) : T))
return !1;
}
}
return !0;
}
function Ka(e) {
if (!Me(e) || wp(e))
return !1;
var t = ln(e) ? Dh : Uo;
return t.test(Yr(e));
}
function pu(e) {
return Ne(e) && pt(e) == $i;
}
function sc(e) {
return Ne(e) && mt(e) == Bt;
}
function du(e) {
return Ne(e) && qu(e.length) && !!xe[pt(e)];
}
function gu(e) {
return typeof e == "function" ? e : e == null ? lt : typeof e == "object" ? ee(e) ? vu(e[0], e[1]) : es(e) : Xs(e);
}
function bi(e) {
if (!Oi(e))
return ql(e);
var t = [];
for (var n in ye(e))
_e.call(e, n) && n != "constructor" && t.push(n);
return t;
}
function Kh(e) {
if (!Me(e))
return Ep(e);
var t = Oi(e), n = [];
for (var r in e)
r == "constructor" && (t || !_e.call(e, r)) || n.push(r);
return n;
}
function mu(e, t) {
return e < t;
}
function co(e, t) {
var n = -1, r = yt(e) ? l(e.length) : [];
return Jn(e, function(a, s, c) {
r[++n] = t(a, s, c);
}), r;
}
function es(e) {
var t = ms(e);
return t.length == 1 && t[0][2] ? Ic(t[0][0], t[0][1]) : function(n) {
return n === e || hu(n, e, t);
};
}
function vu(e, t) {
return ys(e) && bs(t) ? Ic(bn(e), t) : function(n) {
var r = Wn(n, e);
return r === o && r === t ? Io(n, e) : Dn(t, r, j | J);
};
}
function fo(e, t, n, r, a) {
e !== t && Ja(t, function(s, c) {
if (a || (a = new yn()), Me(s))
Xn(e, t, c, n, fo, r, a);
else {
var f = r ? r(ws(e, c), s, c + "", e, t, a) : o;
f === o && (f = s), qa(e, c, f);
}
}, Rt);
}
function Xn(e, t, n, r, a, s, c) {
var f = ws(e, n), g = ws(t, n), w = c.get(g);
if (w) {
qa(e, n, w);
return;
}
var b = s ? s(f, g, n + "", e, t, c) : o, S = b === o;
if (S) {
var T = ee(g), R = !T && wn(g), L = !T && !R && ur(g);
b = g, T || R || L ? ee(f) ? b = f : Ve(f) ? b = Tt(f) : R ? (S = !1, b = as(g, !0)) : L ? (S = !1, b = ls(g, !0)) : b = [] : ir(g) || Or(g) ? (b = f, Or(f) ? b = Ws(f) : (!Me(f) || ln(f)) && (b = Cc(g))) : S = !1;
}
S && (c.set(g, b), a(b, g, r, s, c), c.delete(g)), qa(e, n, b);
}
function ts(e, t) {
var n = e.length;
if (n)
return t += t < 0 ? n : 0, er(t, n) ? e[t] : o;
}
function ns(e, t, n) {
t.length ? t = Ce(t, function(s) {
return ee(s) ? function(c) {
return Gr(c, s.length === 1 ? s[0] : s);
} : s;
}) : t = [lt];
var r = -1;
t = Ce(t, zt(K()));
var a = co(e, function(s, c, f) {
var g = Ce(t, function(w) {
return w(s);
});
return { criteria: g, index: ++r, value: s };
});
return Na(a, function(s, c) {
return Un(s, c, n);
});
}
function ep(e, t) {
return rs(e, t, function(n, r) {
return Io(e, r);
});
}
function rs(e, t, n) {
for (var r = -1, a = t.length, s = {}; ++r < a; ) {
var c = t[r], f = Gr(e, c);
n(f, c) && zr(s, Sr(c, e), f);
}
return s;
}
function tp(e) {
return function(t) {
return Gr(t, e);
};
}
function is(e, t, n, r) {
var a = r ? bh : ci, s = -1, c = t.length, f = e;
for (e === t && (t = Tt(t)), n && (f = Ce(e, zt(n))); ++s < c; )
for (var g = 0, w = t[s], b = n ? n(w) : w; (g = a(f, b, g, r)) > -1; )
f !== e && Pt.call(f, g, 1), Pt.call(e, g, 1);
return e;
}
function Fn(e, t) {
for (var n = e ? t.length : 0, r = n - 1; n--; ) {
var a = t[n];
if (n == r || a !== s) {
var s = a;
er(a) ? Pt.call(e, a, 1) : st(e, a);
}
}
return e;
}
function ho(e, t) {
return e + ru(qt() * (t - e + 1));
}
function os(e, t, n, r) {
for (var a = -1, s = Je(nu((t - e) / (n || 1)), 0), c = l(s); s--; )
c[r ? s : ++a] = e, e += n;
return c;
}
function wi(e, t) {
var n = "";
if (!e || t < 1 || t > Kt)
return n;
do
t % 2 && (n += e), t = ru(t / 2), t && (e += e);
while (t);
return n;
}
function ne(e, t) {
return As(xc(e, t, lt), e + "");
}
function Z(e) {
return rc(Li(e));
}
function yu(e, t) {
var n = Li(e);
return _o(n, Dt(t, 0, n.length));
}
function zr(e, t, n, r) {
if (!Me(e))
return e;
t = Sr(t, e);
for (var a = -1, s = t.length, c = s - 1, f = e; f != null && ++a < s; ) {
var g = bn(t[a]), w = n;
if (g === "__proto__" || g === "constructor" || g === "prototype")
return e;
if (a != c) {
var b = f[g];
w = r ? r(b, g, f) : o, w === o && (w = Me(b) ? b : er(t[a + 1]) ? [] : {});
}
ht(f, g, w), f = f[g];
}
return e;
}
var Ar = oo ? function(e, t) {
return oo.set(e, t), e;
} : lt, np = tu ? function(e, t) {
return tu(e, "toString", {
configurable: !0,
enumerable: !1,
value: Hs(t),
writable: !0
});
} : lt;
function rp(e) {
return _o(Li(e));
}
function on(e, t, n) {
var r = -1, a = e.length;
t < 0 && (t = -t > a ? 0 : a + t), n = n > a ? a : n, n < 0 && (n += a), a = t > n ? 0 : n - t >>> 0, t >>>= 0;
for (var s = l(a); ++r < a; )
s[r] = e[r + t];
return s;
}
function lc(e, t) {
var n;
return Jn(e, function(r, a, s) {
return n = t(r, a, s), !n;
}), !!n;
}
function _u(e, t, n) {
var r = 0, a = e == null ? r : e.length;
if (typeof t == "number" && t === t && a <= ze) {
for (; r < a; ) {
var s = r + a >>> 1, c = e[s];
c !== null && !Qt(c) && (n ? c <= t : c < t) ? r = s + 1 : a = s;
}
return a;
}
return bu(e, t, lt, n);
}
function bu(e, t, n, r) {
var a = 0, s = e == null ? 0 : e.length;
if (s === 0)
return 0;
t = n(t);
for (var c = t !== t, f = t === null, g = Qt(t), w = t === o; a < s; ) {
var b = ru((a + s) / 2), S = n(e[b]), T = S !== o, R = S === null, L = S === S, W = Qt(S);
if (c)
var P = r || L;
else w ? P = L && (r || T) : f ? P = L && T && (r || !R) : g ? P = L && T && !R && (r || !W) : R || W ? P = !1 : P = r ? S <= t : S < t;
P ? a = b + 1 : s = b;
}
return Fe(s, Ro);
}
function cc(e, t) {
for (var n = -1, r = e.length, a = 0, s = []; ++n < r; ) {
var c = e[n], f = t ? t(c) : c;
if (!n || !be(f, g)) {
va