schemas/libraries/joi/download_compiled/index/unminified.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
var import_joi_browser_min = __toESM(( __commonJSMin(((exports, module) => {
(function(e, t) {
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.joi = t() : e.joi = t();
})(self, () => (() => {
var e = {
2115(e, t, r) {
"use strict";
const { assert: s, clone: n, deepEqual: a, merge: o } = r(3115), i = r(2130), l = r(9415), c = r(3541), u = r(8013), f = r(2062), m = r(9017), h = r(6162), p = r(5844), d = r(8529), g = r(125), y = r(1190), b = r(6220), v = {
standardTypes: new Set([
"string",
"number",
"integer",
"boolean",
"object",
"array",
"null"
]),
jsonSchemaTarget: "draft-2020-12",
primitiveTypes: new Set([
"string",
"number",
"boolean"
]),
nullSchema: () => ({ type: "null" }),
Base: class {
constructor(e) {
this.type = e, this.$_root = null, this._definition = {}, this._reset();
}
_reset() {
this._ids = new p.Ids(), this._preferences = null, this._refs = new d.Manager(), this._cache = null, this._valids = null, this._invalids = null, this._flags = {}, this._rules = [], this._singleRules = new Map(), this.$_terms = {}, this.$_temp = {
ruleset: null,
whens: {}
};
}
describe() {
return s("function" == typeof m.describe, "Manifest functionality disabled"), m.describe(this);
}
$_jsonSchema(e, t = {}) {
var r;
if (void 0 !== t.target && t.target !== v.jsonSchemaTarget) throw new Error(`Unsupported JSON Schema target: ${t.target}`);
const s = !t.$defs, n = null !== (r = t.$defs) && void 0 !== r ? r : {};
let o = {};
const i = "any" === this.type, c = this._flags.only, u = this._valids && Array.from(this._valids._values).filter((e) => null !== e);
let f = !0;
if (u && u.length && c && !i) {
const e = new Set(u.map((e) => typeof e));
f = e.has(this.type) || "date" === this.type && e.has("object");
}
!i && f && v.standardTypes.has(this.type) && (o.type = this.type), this._flags.description && (o.description = this._flags.description), void 0 !== this._flags.default && "function" != typeof this._flags.default && (o.default = this._flags.default);
const m = {
...t,
$defs: n
};
this._definition.jsonSchema && f && (o = this._definition.jsonSchema(this, o, e, m));
for (const t of this._rules) {
const r = this._definition.rules[t.name];
r.jsonSchema && f && !t._resolve.length && (o = r.jsonSchema(t, o, c, e, m));
}
if (this.$_terms.shared) for (const t of this.$_terms.shared) n[t._flags.id] = t.$_jsonSchema(e, m);
if (s && Object.keys(n).length && (o.$defs = n), this._valids) {
const e = u.filter((e) => "symbol" != typeof e);
if (e.length) if (this._flags.only) {
o.enum = e;
const t = l.intersect(new Set(e.map((e) => typeof e)), v.primitiveTypes);
if (t.size) {
const e = [...t];
o.type = 1 === e.length ? e[0] : e;
}
} else {
const t = e.filter((e) => typeof e !== this.type || i);
!t.length || i && !c || (o.anyOf || (o = { anyOf: [o] }), o.anyOf.push({ enum: t }));
}
}
if (this._valids && this._valids.has(null) && (!i || c) && (1 === this._valids.length && (i || c) ? o.type = "null" : o.type ? o.type = [o.type, "null"] : o.anyOf ? o.anyOf.unshift(v.nullSchema()) : o = { anyOf: [v.nullSchema(), o] }), this.$_terms.whens) {
const t = this.clone();
t.$_terms.whens = null;
const r = [];
for (const s of this.$_terms.whens) {
const n = s.is ? [s] : s.switch;
for (let s = 0; s < n.length; ++s) {
const a = n[s];
a.then && r.push(t.concat(a.then).$_jsonSchema(e, m)), a.otherwise && r.push(t.concat(a.otherwise).$_jsonSchema(e, m)), a.then && (s !== n.length - 1 || a.otherwise) || r.push(t.$_jsonSchema(e, m));
}
}
const s = [];
for (const e of r) s.some((t) => a(t, e)) || s.push(e);
return { anyOf: s };
}
return o;
}
allow(...e) {
return l.verifyFlat(e, "allow"), this._values(e, "_valids");
}
alter(e) {
s(e && "object" == typeof e && !Array.isArray(e), "Invalid targets argument"), s(!this._inRuleset(), "Cannot set alterations inside a ruleset");
const t = this.clone();
t.$_terms.alterations = t.$_terms.alterations || [];
for (const r of Object.keys(e)) {
const n = e[r];
s("function" == typeof n, "Alteration adjuster for", r, "must be a function"), t.$_terms.alterations.push({
target: r,
adjuster: n
});
}
return t.$_temp.ruleset = !1, t;
}
artifact(e) {
return s(void 0 !== e, "Artifact cannot be undefined"), s(!this._cache, "Cannot set an artifact with a rule cache"), this.$_setFlag("artifact", e);
}
cast(e) {
return s(!1 === e || "string" == typeof e, "Invalid to value"), s(!1 === e || this._definition.cast[e], "Type", this.type, "does not support casting to", e), this.$_setFlag("cast", !1 === e ? void 0 : e);
}
default(e, t) {
return this._default("default", e, t);
}
description(e) {
return s(e && "string" == typeof e, "Description must be a non-empty string"), this.$_setFlag("description", e);
}
empty(e) {
const t = this.clone();
return void 0 !== e && (e = t.$_compile(e, { override: !1 })), t.$_setFlag("empty", e, { clone: !1 });
}
error(e) {
return s(e, "Missing error"), s(e instanceof Error || "function" == typeof e, "Must provide a valid Error object or a function"), this.$_setFlag("error", e);
}
example(e, t = {}) {
return s(void 0 !== e, "Missing example"), l.assertOptions(t, ["override"]), this._inner("examples", e, {
single: !0,
override: t.override
});
}
external(e, t) {
return "object" == typeof e && (s(!t, "Cannot combine options with description"), t = e.description, e = e.method), s("function" == typeof e, "Method must be a function"), s(void 0 === t || t && "string" == typeof t, "Description must be a non-empty string"), this._inner("externals", {
method: e,
description: t
}, { single: !0 });
}
failover(e, t) {
return this._default("failover", e, t);
}
forbidden() {
return this.presence("forbidden");
}
id(e) {
return e ? (s("string" == typeof e, "id must be a non-empty string"), s(/^[^\.]+$/.test(e), "id cannot contain period character"), this.$_setFlag("id", e)) : this.$_setFlag("id", void 0);
}
invalid(...e) {
return this._values(e, "_invalids");
}
label(e) {
return s(e && "string" == typeof e, "Label name must be a non-empty string"), this.$_setFlag("label", e);
}
meta(e) {
return s(void 0 !== e, "Meta cannot be undefined"), this._inner("metas", e, { single: !0 });
}
note(...e) {
s(e.length, "Missing notes");
for (const t of e) s(t && "string" == typeof t, "Notes must be non-empty strings");
return this._inner("notes", e);
}
only(e = !0) {
return s("boolean" == typeof e, "Invalid mode:", e), this.$_setFlag("only", e);
}
optional() {
return this.presence("optional");
}
prefs(e) {
s(e, "Missing preferences"), s(void 0 === e.context, "Cannot override context"), s(void 0 === e.externals, "Cannot override externals"), s(void 0 === e.warnings, "Cannot override warnings"), s(void 0 === e.debug, "Cannot override debug"), l.checkPreferences(e);
const t = this.clone();
return t._preferences = l.preferences(t._preferences, e), t;
}
presence(e) {
return s([
"optional",
"required",
"forbidden"
].includes(e), "Unknown presence mode", e), this.$_setFlag("presence", e);
}
raw(e = !0) {
return this.$_setFlag("result", e ? "raw" : void 0);
}
result(e) {
return s(["raw", "strip"].includes(e), "Unknown result mode", e), this.$_setFlag("result", e);
}
required() {
return this.presence("required");
}
strict(e) {
const t = this.clone(), r = void 0 !== e && !e;
return t._preferences = l.preferences(t._preferences, { convert: r }), t;
}
strip(e = !0) {
return this.$_setFlag("result", e ? "strip" : void 0);
}
tag(...e) {
s(e.length, "Missing tags");
for (const t of e) s(t && "string" == typeof t, "Tags must be non-empty strings");
return this._inner("tags", e);
}
unit(e) {
return s(e && "string" == typeof e, "Unit name must be a non-empty string"), this.$_setFlag("unit", e);
}
valid(...e) {
l.verifyFlat(e, "valid");
const t = this.allow(...e);
return t.$_setFlag("only", !!t._valids, { clone: !1 }), t;
}
when(e, t) {
const r = this.clone();
r.$_terms.whens || (r.$_terms.whens = []);
const n = c.when(r, e, t);
if (!["any", "link"].includes(r.type)) {
const e = n.is ? [n] : n.switch;
for (const t of e) s(!t.then || "any" === t.then.type || t.then.type === r.type, "Cannot combine", r.type, "with", t.then && t.then.type), s(!t.otherwise || "any" === t.otherwise.type || t.otherwise.type === r.type, "Cannot combine", r.type, "with", t.otherwise && t.otherwise.type);
}
return r.$_terms.whens.push(n), r.$_mutateRebuild();
}
cache(e) {
s(!this._inRuleset(), "Cannot set caching inside a ruleset"), s(!this._cache, "Cannot override schema cache"), s(void 0 === this._flags.artifact, "Cannot cache a rule with an artifact");
const t = this.clone();
return t._cache = e || i.provider.provision(), t.$_temp.ruleset = !1, t;
}
clone() {
const e = Object.create(Object.getPrototypeOf(this));
return this._assign(e);
}
concat(e) {
s(l.isSchema(e), "Invalid schema object"), s("any" === this.type || "any" === e.type || e.type === this.type, "Cannot merge type", this.type, "with another type:", e.type), s(!this._inRuleset(), "Cannot concatenate onto a schema with open ruleset"), s(!e._inRuleset(), "Cannot concatenate a schema with open ruleset");
let t = this.clone();
if ("any" === this.type && "any" !== e.type) {
const r = e.clone();
for (const e of Object.keys(t)) "type" !== e && (r[e] = t[e]);
t = r;
}
t._ids.concat(e._ids), t._refs.register(e, d.toSibling), t._preferences = t._preferences ? l.preferences(t._preferences, e._preferences) : e._preferences, t._valids = b.merge(t._valids, e._valids, e._invalids), t._invalids = b.merge(t._invalids, e._invalids, e._valids);
for (const r of e._singleRules.keys()) t._singleRules.has(r) && (t._rules = t._rules.filter((e) => e.keep || e.name !== r), t._singleRules.delete(r));
for (const r of e._rules) e._definition.rules[r.method].multi || t._singleRules.set(r.name, r), t._rules.push(r);
if (t._flags.empty && e._flags.empty) {
t._flags.empty = t._flags.empty.concat(e._flags.empty);
const r = Object.assign({}, e._flags);
delete r.empty, o(t._flags, r);
} else if (e._flags.empty) {
t._flags.empty = e._flags.empty;
const r = Object.assign({}, e._flags);
delete r.empty, o(t._flags, r);
} else o(t._flags, e._flags);
for (const r of Object.keys(e.$_terms)) {
const s = e.$_terms[r];
s ? t.$_terms[r] ? t.$_terms[r] = t.$_terms[r].concat(s) : t.$_terms[r] = s.slice() : t.$_terms[r] || (t.$_terms[r] = s);
}
return this.$_root._tracer && this.$_root._tracer._combine(t, [this, e]), t.$_mutateRebuild();
}
extend(e) {
return s(!e.base, "Cannot extend type with another base"), f.type(this, e);
}
extract(e) {
return e = Array.isArray(e) ? e : e.split("."), this._ids.reach(e);
}
fork(e, t) {
s(!this._inRuleset(), "Cannot fork inside a ruleset");
let r = this;
for (let s of [].concat(e)) s = Array.isArray(s) ? s : s.split("."), r = r._ids.fork(s, t, r);
return r.$_temp.ruleset = !1, r;
}
isAsync() {
var e;
if (Boolean(null === (e = this.$_terms.externals) || void 0 === e ? void 0 : e.length)) return !0;
if (this.$_terms.whens) for (const e of this.$_terms.whens) {
var t, r;
if (null !== (t = e.then) && void 0 !== t && t.isAsync()) return !0;
if (null !== (r = e.otherwise) && void 0 !== r && r.isAsync()) return !0;
if (e.switch) for (const t of e.switch) {
var s, n;
if (null !== (s = t.then) && void 0 !== s && s.isAsync()) return !0;
if (null !== (n = t.otherwise) && void 0 !== n && n.isAsync()) return !0;
}
}
return !1;
}
rule(e) {
const t = this._definition;
l.assertOptions(e, Object.keys(t.modifiers)), s(!1 !== this.$_temp.ruleset, "Cannot apply rules to empty ruleset or the last rule added does not support rule properties");
const r = null === this.$_temp.ruleset ? this._rules.length - 1 : this.$_temp.ruleset;
s(r >= 0 && r < this._rules.length, "Cannot apply rules to empty ruleset");
const a = this.clone();
for (let o = r; o < a._rules.length; ++o) {
const r = a._rules[o], i = n(r);
for (const n of Object.keys(e)) t.modifiers[n](i, e[n]), s(i.name === r.name, "Cannot change rule name");
a._rules[o] = i, a._singleRules.get(i.name) === r && a._singleRules.set(i.name, i);
}
return a.$_temp.ruleset = !1, a.$_mutateRebuild();
}
get ruleset() {
s(!this._inRuleset(), "Cannot start a new ruleset without closing the previous one");
const e = this.clone();
return e.$_temp.ruleset = e._rules.length, e;
}
get $() {
return this.ruleset;
}
tailor(e) {
e = [].concat(e), s(!this._inRuleset(), "Cannot tailor inside a ruleset");
let t = this;
if (this.$_terms.alterations) for (const { target: r, adjuster: n } of this.$_terms.alterations) e.includes(r) && (t = n(t), s(l.isSchema(t), "Alteration adjuster for", r, "failed to return a schema object"));
return t = t.$_modify({
each: (t) => t.tailor(e),
ref: !1
}), t.$_temp.ruleset = !1, t.$_mutateRebuild();
}
tracer() {
return g.location ? g.location(this) : this;
}
validate(e, t) {
return y.entry(e, this, t);
}
validateAsync(e, t) {
return y.entryAsync(e, this, t);
}
$_addRule(e) {
"string" == typeof e && (e = { name: e }), s(e && "object" == typeof e, "Invalid options"), s(e.name && "string" == typeof e.name, "Invalid rule name");
for (const t of Object.keys(e)) s("_" !== t[0], "Cannot set private rule properties");
const t = Object.assign({}, e);
t._resolve = [], t.method = t.method || t.name;
const r = this._definition.rules[t.method], n = t.args;
s(r, "Unknown rule", t.method);
const a = this.clone();
if (n) {
const e = Object.keys(n);
s(1 === e.length || e.length === this._definition.rules[t.name].args.length, "Invalid rule definition for", this.type, t.name);
for (const o of e) {
let e = n[o];
if (r.argsByName) {
const i = r.argsByName.get(o);
if (i.ref && l.isResolvable(e)) t._resolve.push(o), a.$_mutateRegister(e);
else if (i.normalize && (e = i.normalize(e), n[o] = e), i.assert) {
const t = l.validateArg(e, o, i);
s(!t, t, "or reference");
}
}
void 0 !== e ? n[o] = e : delete n[o];
}
}
return r.multi || (a._ruleRemove(t.name, { clone: !1 }), a._singleRules.set(t.name, t)), !1 === a.$_temp.ruleset && (a.$_temp.ruleset = null), r.priority ? a._rules.unshift(t) : a._rules.push(t), a;
}
$_compile(e, t) {
return c.schema(this.$_root, e, t);
}
$_createError(e, t, r, s, n, a = {}) {
const o = !1 !== a.flags ? this._flags : {}, i = a.messages ? h.merge(this._definition.messages, a.messages) : this._definition.messages;
return new u.Report(e, t, r, o, i, s, n);
}
$_getFlag(e) {
return this._flags[e];
}
$_getRule(e) {
return this._singleRules.get(e);
}
$_mapLabels(e) {
return e = Array.isArray(e) ? e : e.split("."), this._ids.labels(e);
}
$_match(e, t, r, s) {
(r = Object.assign({}, r)).abortEarly = !0, r._externals = !1, t.snapshot();
const n = !y.validate(e, this, t, r, s).errors;
return t.restore(), n;
}
$_modify(e) {
return l.assertOptions(e, [
"each",
"once",
"ref",
"schema"
]), p.schema(this, e) || this;
}
$_mutateRebuild() {
return s(!this._inRuleset(), "Cannot add this rule inside a ruleset"), this._refs.reset(), this._ids.reset(), this.$_modify({ each: (e, { source: t, name: r, path: s, key: n }) => {
const a = this._definition[t][r] && this._definition[t][r].register;
!1 !== a && this.$_mutateRegister(e, {
family: a,
key: n
});
} }), this._definition.rebuild && this._definition.rebuild(this), this.$_temp.ruleset = !1, this;
}
$_mutateRegister(e, { family: t, key: r } = {}) {
this._refs.register(e, t), this._ids.register(e, { key: r });
}
$_property(e) {
return this._definition.properties[e];
}
$_reach(e) {
return this._ids.reach(e);
}
$_rootReferences() {
return this._refs.roots();
}
$_setFlag(e, t, r = {}) {
s("_" === e[0] || !this._inRuleset(), "Cannot set flag inside a ruleset");
const n = this._definition.flags[e] || {};
if (a(t, n.default) && (t = void 0), a(t, this._flags[e])) return this;
const o = !1 !== r.clone ? this.clone() : this;
return void 0 !== t ? (o._flags[e] = t, o.$_mutateRegister(t)) : delete o._flags[e], "_" !== e[0] && (o.$_temp.ruleset = !1), o;
}
$_parent(e, ...t) {
return this[e][l.symbols.parent].call(this, ...t);
}
$_validate(e, t, r) {
return y.validate(e, this, t, r);
}
_assign(e) {
e.type = this.type, e.$_root = this.$_root, e.$_temp = Object.assign({}, this.$_temp), e.$_temp.whens = {}, e._ids = this._ids.clone(), e._preferences = this._preferences, e._valids = this._valids && this._valids.clone(), e._invalids = this._invalids && this._invalids.clone(), e._rules = this._rules.slice(), e._singleRules = new Map(this._singleRules), e._refs = this._refs.clone(), e._flags = Object.assign({}, this._flags), e._cache = null, e.$_terms = {};
for (const t of Object.keys(this.$_terms)) e.$_terms[t] = this.$_terms[t] ? this.$_terms[t].slice() : null;
if (e.$_super = {}, this.$_super) for (const t of Object.keys(this.$_super)) e.$_super[t] = this._super[t].bind(e);
return e;
}
_bare() {
const e = this.clone();
e._reset();
const t = e._definition.terms;
for (const r of Object.keys(t)) {
const s = t[r];
e.$_terms[r] = s.init;
}
return e.$_mutateRebuild();
}
_default(e, t, r = {}) {
return l.assertOptions(r, "literal"), s(void 0 !== t, "Missing", e, "value"), s("function" == typeof t || !r.literal, "Only function value supports literal option"), "function" == typeof t && r.literal && (t = {
[l.symbols.literal]: !0,
literal: t
}), this.$_setFlag(e, t);
}
_generate(e, t, r) {
if (!this.$_terms.whens) return { schema: this };
const s = [], n = [];
for (let a = 0; a < this.$_terms.whens.length; ++a) {
const o = this.$_terms.whens[a];
if (o.concat) {
s.push(o.concat), n.push(`${a}.concat`);
continue;
}
const i = o.ref ? o.ref.resolve(e, t, r) : e, l = o.is ? [o] : o.switch, c = n.length;
for (let c = 0; c < l.length; ++c) {
const { is: u, then: f, otherwise: m } = l[c], h = `${a}${o.switch ? "." + c : ""}`;
if (u.$_match(i, t.nest(u, `${h}.is`), r)) {
if (f) {
const a = t.localize([...t.path, `${h}.then`], t.ancestors, t.schemas), { schema: o, id: i } = f._generate(e, a, r);
s.push(o), n.push(`${h}.then${i ? `(${i})` : ""}`);
break;
}
} else if (m) {
const a = t.localize([...t.path, `${h}.otherwise`], t.ancestors, t.schemas), { schema: o, id: i } = m._generate(e, a, r);
s.push(o), n.push(`${h}.otherwise${i ? `(${i})` : ""}`);
break;
}
}
if (o.break && n.length > c) break;
}
const a = n.join(", ");
if (t.mainstay.tracer.debug(t, "rule", "when", a), !a) return { schema: this };
if (!t.mainstay.tracer.active && this.$_temp.whens[a]) return {
schema: this.$_temp.whens[a],
id: a
};
let o = this;
this._definition.generate && (o = this._definition.generate(this, e, t, r));
for (const e of s) o = o.concat(e);
return this.$_root._tracer && this.$_root._tracer._combine(o, [this, ...s]), this.$_temp.whens[a] = o, {
schema: o,
id: a
};
}
_inner(e, t, r = {}) {
s(!this._inRuleset(), `Cannot set ${e} inside a ruleset`);
const n = this.clone();
return n.$_terms[e] && !r.override || (n.$_terms[e] = []), r.single ? n.$_terms[e].push(t) : n.$_terms[e].push(...t), n.$_temp.ruleset = !1, n;
}
_inRuleset() {
return null !== this.$_temp.ruleset && !1 !== this.$_temp.ruleset;
}
_ruleRemove(e, t = {}) {
if (!this._singleRules.has(e)) return this;
const r = !1 !== t.clone ? this.clone() : this;
r._singleRules.delete(e);
const s = [];
for (let t = 0; t < r._rules.length; ++t) {
const n = r._rules[t];
n.name !== e || n.keep ? s.push(n) : r._inRuleset() && t < r.$_temp.ruleset && --r.$_temp.ruleset;
}
return r._rules = s, r;
}
_values(e, t) {
l.verifyFlat(e, t.slice(1, -1));
const r = this.clone(), n = e[0] === l.symbols.override;
if (n && (e = e.slice(1)), !r[t] && e.length ? r[t] = new b() : n && (r[t] = e.length ? new b() : null, r.$_mutateRebuild()), !r[t]) return r;
n && r[t].override();
for (const n of e) {
s(void 0 !== n, "Cannot call allow/valid/invalid with undefined"), s(n !== l.symbols.override, "Override must be the first value");
const e = "_invalids" === t ? "_valids" : "_invalids";
r[e] && (r[e].remove(n), r[e].length || (s("_valids" === t || !r._flags.only, "Setting invalid value", n, "leaves schema rejecting all values due to previous valid rule"), r[e] = null)), r[t].add(n, r._refs);
}
return r;
}
get "~standard"() {
const e = (e) => {
let t;
return t = u.ValidationError.isError(e) ? e.details.map(({ message: e, path: t }) => ({
message: e,
path: t
})) : [{ message: e.message }], { issues: t };
}, t = (e) => ({ value: e });
return {
version: 1,
vendor: "joi",
validate: (r, s) => {
const n = y.standard(r, this, s);
return n instanceof Promise ? n.then(t, e) : n.error ? e(n.error) : t(n.value);
},
jsonSchema: {
input: (e) => this.$_jsonSchema("input", e),
output: (e) => this.$_jsonSchema("output", e)
}
};
}
}
};
v.Base.prototype[l.symbols.any] = {
version: l.version,
compile: c.compile,
root: "$_root"
}, v.Base.prototype.isImmutable = !0, v.Base.prototype.deny = v.Base.prototype.invalid, v.Base.prototype.disallow = v.Base.prototype.invalid, v.Base.prototype.equal = v.Base.prototype.valid, v.Base.prototype.exist = v.Base.prototype.required, v.Base.prototype.not = v.Base.prototype.invalid, v.Base.prototype.options = v.Base.prototype.prefs, v.Base.prototype.preferences = v.Base.prototype.prefs, e.exports = new v.Base();
},
2130(e, t, r) {
"use strict";
const { assert: s, clone: n } = r(3115), a = r(9415), o = {
max: 1e3,
supported: new Set([
"undefined",
"boolean",
"number",
"string"
])
};
t.provider = { provision: (e) => new o.Cache(e) }, o.Cache = class {
constructor(e = {}) {
a.assertOptions(e, ["max"]), s(void 0 === e.max || e.max && e.max > 0 && isFinite(e.max), "Invalid max cache size"), this._max = e.max || o.max, this._map = new Map(), this._list = new o.List();
}
get length() {
return this._map.size;
}
set(e, t) {
if (null !== e && !o.supported.has(typeof e)) return;
let r = this._map.get(e);
if (r) return r.value = t, void this._list.first(r);
r = this._list.unshift({
key: e,
value: t
}), this._map.set(e, r), this._compact();
}
get(e) {
const t = this._map.get(e);
if (t) return this._list.first(t), n(t.value);
}
_compact() {
if (this._map.size > this._max) {
const e = this._list.pop();
this._map.delete(e.key);
}
}
}, o.List = class {
constructor() {
this.tail = null, this.head = null;
}
unshift(e) {
return e.next = null, e.prev = this.head, this.head && (this.head.next = e), this.head = e, this.tail || (this.tail = e), e;
}
first(e) {
e !== this.head && (this._remove(e), this.unshift(e));
}
pop() {
return this._remove(this.tail);
}
_remove(e) {
const { next: t, prev: r } = e;
return t.prev = r, r && (r.next = t), e === this.tail && (this.tail = t), e.prev = null, e.next = null, e;
}
};
},
9415(e, t, r) {
"use strict";
const { assert: s, AssertError: n } = r(3115), a = r(6913);
let o, i;
const l = { isoDate: /^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/ };
t.version = a.version, t.defaults = {
abortEarly: !0,
allowUnknown: !1,
artifacts: !1,
cache: !0,
context: null,
convert: !0,
dateFormat: "iso",
errors: {
escapeHtml: !1,
label: "path",
language: null,
render: !0,
stack: !1,
wrap: {
label: "\"",
array: "[]"
}
},
externals: !0,
messages: {},
nonEnumerables: !1,
noDefaults: !1,
presence: "optional",
skipFunctions: !1,
stripUnknown: !1,
warnings: !1
}, t.symbols = {
any: Symbol.for("@hapi/joi/schema"),
arraySingle: Symbol("arraySingle"),
deepDefault: Symbol("deepDefault"),
errors: Symbol("errors"),
literal: Symbol("literal"),
override: Symbol("override"),
parent: Symbol("parent"),
prefs: Symbol("prefs"),
ref: Symbol("ref"),
template: Symbol("template"),
values: Symbol("values")
}, t.assertOptions = function(e, t, r = "Options") {
s(e && "object" == typeof e && !Array.isArray(e), "Options must be of type object");
const n = Object.keys(e).filter((e) => !t.includes(e));
s(0 === n.length, `${r} contain unknown keys: ${n}`);
}, t.checkPreferences = function(e) {
i = i || r(1688);
const t = i.preferences.validate(e);
if (t.error) throw new n([t.error.details[0].message]);
}, t.compare = function(e, t, r) {
switch (r) {
case "=": return e === t;
case ">": return e > t;
case "<": return e < t;
case ">=": return e >= t;
case "<=": return e <= t;
}
}, t.default = function(e, t) {
return void 0 === e ? t : e;
}, t.intersect = function(e, t) {
if ("function" == typeof e.intersection) return e.intersection(t);
const r = new Set();
for (const s of e) t.has(s) && r.add(s);
return r;
}, t.isIsoDate = function(e) {
return l.isoDate.test(e);
}, t.isNumber = function(e) {
return "number" == typeof e && !isNaN(e);
}, t.isResolvable = function(e) {
return !!e && (e[t.symbols.ref] || e[t.symbols.template]);
}, t.isSchema = function(e, r = {}) {
const n = e && e[t.symbols.any];
return !!n && (s(r.legacy || n.version === t.version, "Cannot mix different versions of joi schemas"), !0);
}, t.isValues = function(e) {
return e[t.symbols.values];
}, t.limit = function(e) {
return Number.isSafeInteger(e) && e >= 0;
}, t.preferences = function(e, s) {
o = o || r(6162), e = e || {}, s = s || {};
const n = Object.assign({}, e, s);
return s.errors && e.errors && (n.errors = Object.assign({}, e.errors, s.errors), n.errors.wrap = Object.assign({}, e.errors.wrap, s.errors.wrap)), s.messages && (n.messages = o.compile(s.messages, e.messages)), delete n[t.symbols.prefs], n;
}, t.tryWithPath = function(e, t, r = {}) {
try {
return e();
} catch (e) {
throw void 0 !== e.path ? e.path = t + "." + e.path : e.path = t, r.append && (e.message = `${e.message} (${e.path})`), e;
}
}, t.validateArg = function(e, r, { assert: s, message: n }) {
if (t.isSchema(s)) {
const t = s.validate(e);
if (!t.error) return;
return t.error.message;
}
if (!s(e)) return r ? `${r} ${n}` : n;
}, t.verifyFlat = function(e, t) {
for (const r of e) s(!Array.isArray(r), "Method no longer accepts array arguments:", t);
};
},
3541(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(9415), a = r(8529), o = {};
t.schema = function(e, t, r = {}) {
n.assertOptions(r, ["appendPath", "override"]);
try {
return o.schema(e, t, r);
} catch (e) {
throw r.appendPath && void 0 !== e.path && (e.message = `${e.message} (${e.path})`), e;
}
}, o.schema = function(e, t, r) {
s(void 0 !== t, "Invalid undefined schema"), Array.isArray(t) && (s(t.length, "Invalid empty array schema"), 1 === t.length && (t = t[0]));
const a = (t, ...s) => !1 !== r.override ? t.valid(e.override, ...s) : t.valid(...s);
if (o.simple(t)) return a(e, t);
if ("function" == typeof t) return e.custom(t);
if (s("object" == typeof t, "Invalid schema content:", typeof t), n.isResolvable(t)) return a(e, t);
if (n.isSchema(t)) return t;
if (Array.isArray(t)) {
for (const r of t) if (!o.simple(r)) return e.alternatives().try(...t);
return a(e, ...t);
}
return t instanceof RegExp ? e.string().regex(t) : t instanceof Date ? a(e.date(), t) : (s(Object.getPrototypeOf(t) === Object.getPrototypeOf({}), "Schema can only contain plain objects"), e.object().keys(t));
}, t.ref = function(e, t) {
return a.isRef(e) ? e : a.create(e, t);
}, t.compile = function(e, r, a = {}) {
n.assertOptions(a, ["legacy"]);
const i = r && r[n.symbols.any];
if (i) return s(a.legacy || i.version === n.version, "Cannot mix different versions of joi schemas:", i.version, n.version), r;
if ("object" != typeof r || !a.legacy) return t.schema(e, r, { appendPath: !0 });
const l = o.walk(r);
return l ? l.compile(l.root, r) : t.schema(e, r, { appendPath: !0 });
}, o.walk = function(e) {
if ("object" != typeof e) return null;
if (Array.isArray(e)) {
for (const t of e) {
const e = o.walk(t);
if (e) return e;
}
return null;
}
const t = e[n.symbols.any];
if (t) return {
root: e[t.root],
compile: t.compile
};
s(Object.getPrototypeOf(e) === Object.getPrototypeOf({}), "Schema can only contain plain objects");
for (const t of Object.keys(e)) {
const r = o.walk(e[t]);
if (r) return r;
}
return null;
}, o.simple = function(e) {
return null === e || [
"boolean",
"string",
"number"
].includes(typeof e);
}, t.when = function(e, r, i) {
if (void 0 === i && (s(r && "object" == typeof r, "Missing options"), i = r, r = a.create(".")), Array.isArray(i) && (i = { switch: i }), n.assertOptions(i, [
"is",
"not",
"then",
"otherwise",
"switch",
"break"
]), n.isSchema(r)) return s(void 0 === i.is, "\"is\" can not be used with a schema condition"), s(void 0 === i.not, "\"not\" can not be used with a schema condition"), s(void 0 === i.switch, "\"switch\" can not be used with a schema condition"), o.condition(e, {
is: r,
then: i.then,
otherwise: i.otherwise,
break: i.break
});
if (s(a.isRef(r) || "string" == typeof r, "Invalid condition:", r), s(void 0 === i.not || void 0 === i.is, "Cannot combine \"is\" with \"not\""), void 0 === i.switch) {
let l = i;
void 0 !== i.not && (l = {
is: i.not,
then: i.otherwise,
otherwise: i.then,
break: i.break
});
let c = void 0 !== l.is ? e.$_compile(l.is) : e.$_root.invalid(null, !1, 0, "").required();
return s(void 0 !== l.then || void 0 !== l.otherwise, "options must have at least one of \"then\", \"otherwise\", or \"switch\""), s(void 0 === l.break || void 0 === l.then || void 0 === l.otherwise, "Cannot specify then, otherwise, and break all together"), void 0 === i.is || a.isRef(i.is) || n.isSchema(i.is) || (c = c.required()), o.condition(e, {
ref: t.ref(r),
is: c,
then: l.then,
otherwise: l.otherwise,
break: l.break
});
}
s(Array.isArray(i.switch), "\"switch\" must be an array"), s(void 0 === i.is, "Cannot combine \"switch\" with \"is\""), s(void 0 === i.not, "Cannot combine \"switch\" with \"not\""), s(void 0 === i.then, "Cannot combine \"switch\" with \"then\"");
const l = {
ref: t.ref(r),
switch: [],
break: i.break
};
for (let t = 0; t < i.switch.length; ++t) {
const r = i.switch[t], o = t === i.switch.length - 1;
n.assertOptions(r, o ? [
"is",
"then",
"otherwise"
] : ["is", "then"]), s(void 0 !== r.is, "Switch statement missing \"is\""), s(void 0 !== r.then, "Switch statement missing \"then\"");
const c = {
is: e.$_compile(r.is),
then: e.$_compile(r.then)
};
if (a.isRef(r.is) || n.isSchema(r.is) || (c.is = c.is.required()), o) {
s(void 0 === i.otherwise || void 0 === r.otherwise, "Cannot specify \"otherwise\" inside and outside a \"switch\"");
const t = void 0 !== i.otherwise ? i.otherwise : r.otherwise;
void 0 !== t && (s(void 0 === l.break, "Cannot specify both otherwise and break"), c.otherwise = e.$_compile(t));
}
l.switch.push(c);
}
return l;
}, o.condition = function(e, t) {
for (const r of ["then", "otherwise"]) void 0 === t[r] ? delete t[r] : t[r] = e.$_compile(t[r]);
return t;
};
},
8013(e, t, r) {
"use strict";
const s = r(9415), n = r(1532);
t.Report = class {
constructor(e, r, s, n, a, o, i) {
if (this.code = e, this.flags = n, this.messages = a, this.path = o.path, this.prefs = i, this.state = o, this.value = r, this.message = null, this.template = null, this.local = s || {}, this.local.label = t.label(this.flags, this.state, this.prefs, this.messages), void 0 === this.value || this.local.hasOwnProperty("value") || (this.local.value = this.value), this.path.length) {
const e = this.path[this.path.length - 1];
"object" != typeof e && (this.local.key = e);
}
}
_setTemplate(e) {
if (this.template = e, !this.flags.label && 0 === this.path.length) {
const e = this._template(this.template, "root");
e && (this.local.label = e);
}
}
toString() {
if (this.message) return this.message;
const e = this.code;
if (!this.prefs.errors.render) return this.code;
const t = this._template(this.template) || this._template(this.prefs.messages) || this._template(this.messages);
return void 0 === t ? `Error code "${e}" is not defined, your custom type is missing the correct messages definition` : (this.message = t.render(this.value, this.state, this.prefs, this.local, {
errors: this.prefs.errors,
messages: [this.prefs.messages, this.messages]
}), this.prefs.errors.label || (this.message = this.message.replace(/^"" /, "").trim()), this.message);
}
_template(e, r) {
return t.template(this.value, e, r || this.code, this.state, this.prefs);
}
}, t.path = function(e) {
let t = "";
for (const r of e) "object" != typeof r && ("string" == typeof r ? (t && (t += "."), t += r) : t += `[${r}]`);
return t;
}, t.template = function(e, t, r, a, o) {
if (!t) return;
if (n.isTemplate(t)) return "root" !== r ? t : null;
let i = o.errors.language;
if (s.isResolvable(i) && (i = i.resolve(e, a, o)), i && t[i]) {
if (void 0 !== t[i][r]) return t[i][r];
if (void 0 !== t[i]["*"]) return t[i]["*"];
}
return t[r] ? t[r] : t["*"];
}, t.label = function(e, r, s, n) {
if (!s.errors.label) return "";
if (e.label) return e.label;
let a = r.path;
"key" === s.errors.label && r.path.length > 1 && (a = r.path.slice(-1));
return t.path(a) || t.template(null, s.messages, "root", r, s) || n && t.template(null, n, "root", r, s) || "value";
}, t.process = function(e, r, s) {
if (!e) return null;
const { override: n, message: a, details: o } = t.details(e);
if (n) return n;
if (s.errors.stack) return new t.ValidationError(a, o, r);
const i = Error.stackTraceLimit;
Error.stackTraceLimit = 0;
const l = new t.ValidationError(a, o, r);
return Error.stackTraceLimit = i, l;
}, t.details = function(e, t = {}) {
let r = [];
const s = [];
for (const n of e) {
if (n instanceof Error) {
if (!1 !== t.override) return { override: n };
const e = n.toString();
r.push(e), s.push({
message: e,
type: "override",
context: { error: n }
});
continue;
}
const e = n.toString();
r.push(e), s.push({
message: e,
path: n.path.filter((e) => "object" != typeof e),
type: n.code,
context: n.local
});
}
return r.length > 1 && (r = [...new Set(r)]), {
message: r.join(". "),
details: s
};
}, t.ValidationError = class extends Error {
constructor(e, t, r) {
super(e), this._original = r, this.details = t;
}
static isError(e) {
return e instanceof t.ValidationError;
}
}, t.ValidationError.prototype.isJoi = !0, t.ValidationError.prototype.name = "ValidationError", t.ValidationError.prototype.annotate = r(554).error;
},
2062(e, t, r) {
"use strict";
const { assert: s, clone: n } = r(3115), a = r(9415), o = r(6162), i = {};
t.type = function(e, t) {
const r = Object.getPrototypeOf(e), l = n(r), c = e._assign(Object.create(l)), u = Object.assign({}, t);
delete u.base, l._definition = u;
const f = r._definition || {};
u.messages = o.merge(f.messages, u.messages), u.properties = Object.assign({}, f.properties, u.properties), c.type = u.type, u.flags = Object.assign({}, f.flags, u.flags);
const m = Object.assign({}, f.terms);
if (u.terms) for (const e of Object.keys(u.terms)) {
const t = u.terms[e];
s(void 0 === c.$_terms[e], "Invalid term override for", u.type, e), c.$_terms[e] = t.init, m[e] = t;
}
if (u.terms = m, u.args || (u.args = f.args), u.prepare) {
const { method: e, undefined: t } = "function" == typeof u.prepare ? { method: u.prepare } : u.prepare;
u.prepare = t ? e : (t, r) => {
if (void 0 !== t) return e(t, r);
};
}
u.prepare = i.prepare(u.prepare, f.prepare), u.coerce && ("function" == typeof u.coerce && (u.coerce = { method: u.coerce }), u.coerce.from && !Array.isArray(u.coerce.from) && (u.coerce = {
method: u.coerce.method,
from: [].concat(u.coerce.from)
})), u.coerce = i.coerce(u.coerce, f.coerce), u.validate = i.validate(u.validate, f.validate);
const h = Object.assign({}, f.rules);
if (u.rules) for (const e of Object.keys(u.rules)) {
const t = u.rules[e];
s("object" == typeof t, "Invalid rule definition for", u.type, e);
let r = t.method;
if (void 0 === r && (r = function() {
return this.$_addRule(e);
}), r && (s(!l[e], "Rule conflict in", u.type, e), l[e] = r), s(!h[e], "Rule conflict in", u.type, e), h[e] = t, t.alias) {
const e = [].concat(t.alias);
for (const r of e) l[r] = t.method;
}
t.args && (t.argsByName = new Map(), t.args = t.args.map((e) => ("string" == typeof e && (e = { name: e }), s(!t.argsByName.has(e.name), "Duplicated argument name", e.name), a.isSchema(e.assert) && (e.assert = e.assert.strict().label(e.name)), t.argsByName.set(e.name, e), e)));
}
u.rules = h, u.jsonSchema || (u.jsonSchema = f.jsonSchema);
const p = Object.assign({}, f.modifiers);
if (u.modifiers) for (const e of Object.keys(u.modifiers)) {
s(!l[e], "Rule conflict in", u.type, e);
const t = u.modifiers[e];
s("function" == typeof t, "Invalid modifier definition for", u.type, e);
const r = function(t) {
return this.rule({ [e]: t });
};
l[e] = r, p[e] = t;
}
if (u.modifiers = p, u.overrides) {
l._super = r, c.$_super = {};
for (const e of Object.keys(u.overrides)) s(r[e], "Cannot override missing", e), u.overrides[e][a.symbols.parent] = r[e], c.$_super[e] = r[e].bind(c);
Object.assign(l, u.overrides);
}
u.cast = Object.assign({}, f.cast, u.cast);
const d = Object.assign({}, f.manifest, u.manifest);
return d.build = i.build(u.manifest && u.manifest.build, f.manifest && f.manifest.build), u.manifest = d, u.rebuild = i.rebuild(u.rebuild, f.rebuild), c;
}, i.build = function(e, t) {
return e && t ? function(r, s) {
return t(e(r, s), s);
} : e || t;
}, i.coerce = function(e, t) {
return e && t ? {
from: e.from && t.from ? [... new Set([...e.from, ...t.from])] : null,
method(r, s) {
let n;
if ((!t.from || t.from.includes(typeof r)) && (n = t.method(r, s), n)) {
if (n.errors || void 0 === n.value) return n;
r = n.value;
}
if (!e.from || e.from.includes(typeof r)) {
const t = e.method(r, s);
if (t) return t;
}
return n;
}
} : e || t;
}, i.prepare = function(e, t) {
return e && t ? function(r, s) {
const n = e(r, s);
if (n) {
if (n.errors || void 0 === n.value) return n;
r = n.value;
}
return t(r, s) || n;
} : e || t;
}, i.rebuild = function(e, t) {
return e && t ? function(r) {
t(r), e(r);
} : e || t;
}, i.validate = function(e, t) {
return e && t ? function(r, s) {
const n = t(r, s);
if (n) {
if (n.errors && (!Array.isArray(n.errors) || n.errors.length)) return n;
r = n.value;
}
return e(r, s) || n;
} : e || t;
};
},
1100(e, t, r) {
"use strict";
const { assert: s, clone: n } = r(3115), a = r(2130), o = r(9415), i = r(3541), l = r(8013), c = r(2062), u = r(9017), f = r(8529), m = r(1532), h = r(125);
let p;
const d = {
types: {
alternatives: r(4972),
any: r(680),
array: r(2591),
boolean: r(6186),
date: r(2588),
function: r(4840),
link: r(9556),
number: r(4709),
object: r(7487),
string: r(9033),
symbol: r(5008)
},
aliases: {
alt: "alternatives",
bool: "boolean",
func: "function"
},
root: function() {
const e = { _types: new Set(Object.keys(d.types)) };
for (const t of e._types) e[t] = function(...e) {
return s(!e.length || [
"alternatives",
"link",
"object"
].includes(t), "The", t, "type does not allow arguments"), d.generate(this, d.types[t], e);
};
for (const t of [
"allow",
"custom",
"disallow",
"equal",
"exist",
"forbidden",
"invalid",
"not",
"only",
"optional",
"options",
"prefs",
"preferences",
"required",
"strip",
"valid",
"when"
]) e[t] = function(...e) {
return this.any()[t](...e);
};
Object.assign(e, d.methods);
for (const t of Object.keys(d.aliases)) e[t] = e[d.aliases[t]];
return e.x = e.expression, h.setup && h.setup(e), e;
}
};
d.methods = {
ValidationError: l.ValidationError,
version: o.version,
cache: a.provider,
assert(e, t, ...r) {
d.assert(e, t, !0, r);
},
attempt: (e, t, ...r) => d.assert(e, t, !1, r),
build(e) {
return s("function" == typeof u.build, "Manifest functionality disabled"), u.build(this, e);
},
checkPreferences(e) {
o.checkPreferences(e);
},
compile(e, t) {
return i.compile(this, e, t);
},
defaults(e) {
s("function" == typeof e, "modifier must be a function");
const t = Object.assign({}, this);
for (const r of t._types) {
const n = e(t[r]());
s(o.isSchema(n), "modifier must return a valid schema object"), t[r] = function(...e) {
return d.generate(this, n, e);
};
}
return t;
},
expression: (...e) => new m(...e),
extend(...e) {
o.verifyFlat(e, "extend"), p = p || r(1688), s(e.length, "You need to provide at least one extension"), this.assert(e, p.extensions);
const t = Object.assign({}, this);
t._types = new Set(t._types);
for (let r of e) {
"function" == typeof r && (r = r(t)), this.assert(r, p.extension);
const e = d.expandExtension(r, t);
for (const r of e) {
s(void 0 === t[r.type] || t._types.has(r.type), "Cannot override name", r.type);
const e = r.base || this.any(), n = c.type(e, r);
t._types.add(r.type), t[r.type] = function(...e) {
return d.generate(this, n, e);
};
}
}
return t;
},
isError: l.ValidationError.isError,
isExpression: m.isTemplate,
isRef: f.isRef,
isSchema: o.isSchema,
in: (...e) => f.in(...e),
override: o.symbols.override,
ref: (...e) => f.create(...e),
types() {
const e = {};
for (const t of this._types) e[t] = this[t]();
for (const t of Object.keys(d.aliases)) e[t] = this[t]();
return e;
}
}, d.assert = function(e, t, r, s) {
const a = s[0] instanceof Error || "string" == typeof s[0] ? s[0] : null, i = null !== a ? s[1] : s[0], c = t.validate(e, o.preferences({ errors: { stack: !0 } }, i || {}));
let u = c.error;
if (!u) return c.value;
if (a instanceof Error) throw a;
const f = r && "function" == typeof u.annotate ? u.annotate() : u.message;
throw u instanceof l.ValidationError == 0 && (u = n(u)), u.message = a ? `${a} ${f}` : f, u;
}, d.generate = function(e, t, r) {
return s(e, "Must be invoked on a Joi instance."), t.$_root = e, t._definition.args && r.length ? t._definition.args(t, ...r) : t;
}, d.expandExtension = function(e, t) {
if ("string" == typeof e.type) return [e];
const r = [];
for (const s of t._types) if (e.type.test(s)) {
const n = Object.assign({}, e);
n.type = s, n.base = t[s](), r.push(n);
}
return r;
}, e.exports = d.root();
},
6162(e, t, r) {
"use strict";
const { assert: s, clone: n } = r(3115), a = r(1532);
t.compile = function(e, t) {
if ("string" == typeof e) return s(!t, "Cannot set single message string"), new a(e);
if (a.isTemplate(e)) return s(!t, "Cannot set single message template"), e;
s("object" == typeof e && !Array.isArray(e), "Invalid message options"), t = t ? n(t) : {};
for (const r of Object.keys(e)) {
const n = e[r];
if ("root" === r || a.isTemplate(n)) {
s("__proto__" !== r, "Cannot use __proto__ as a message code"), t[r] = n;
continue;
}
if ("string" == typeof n) {
s("__proto__" !== r, "Cannot use __proto__ as a message code"), t[r] = new a(n);
continue;
}
s("object" == typeof n && !Array.isArray(n), "Invalid message for", r);
const o = r, i = Object.hasOwn(t, o) ? t[o] : {};
t[o] = i;
for (const e of Object.keys(n)) {
const t = n[e];
s("__proto__" !== e, "Cannot use __proto__ as a message code"), "root" === e || a.isTemplate(t) ? i[e] = t : (s("string" == typeof t, "Invalid message for", e, "in", o), i[e] = new a(t));
}
}
return t;
}, t.decompile = function(e) {
const t = {};
for (const r of Object.keys(e)) {
const s = e[r];
if ("root" === r) {
t.root = s;
continue;
}
if (a.isTemplate(s)) {
t[r] = s.describe({ compact: !0 });
continue;
}
const n = r;
t[n] = {};
for (const e of Object.keys(s)) {
const r = s[e];
"root" !== e ? t[n][e] = r.describe({ compact: !0 }) : t[n].root = r;
}
}
return t;
}, t.merge = function(e, r) {
if (!e) return t.compile(r);
if (!r) return e;
if ("string" == typeof r) return new a(r);
if (a.isTemplate(r)) return r;
const o = n(e);
for (const e of Object.keys(r)) {
const t = r[e];
if ("root" === e || a.isTemplate(t)) {
s("__proto__" !== e, "Cannot use __proto__ as a message code"), o[e] = t;
continue;
}
if ("string" == typeof t) {
s("__proto__" !== e, "Cannot use __proto__ as a message code"), o[e] = new a(t);
continue;
}
s("object" == typeof t && !Array.isArray(t), "Invalid message for", e);
const n = e, i = Object.hasOwn(o, n) ? o[n] : {};
o[n] = i;
for (const e of Object.keys(t)) {
const r = t[e];
s("__proto__" !== e, "Cannot use __proto__ as a message code"), "root" === e || a.isTemplate(r) ? i[e] = r : (s("string" == typeof r, "Invalid message for", e, "in", n), i[e] = new a(r));
}
}
return o;
};
},
5844(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(9415), a = r(8529), o = {};
t.Ids = o.Ids = class {
constructor() {
this._byId = new Map(), this._byKey = new Map(), this._schemaChain = !1;
}
clone() {
const e = new o.Ids();
return this._byId.size && (e._byId = new Map(this._byId)), this._byKey.size && (e._byKey = new Map(this._byKey)), e._schemaChain = this._schemaChain, e;
}
concat(e) {
e._schemaChain && (this._schemaChain = !0);
for (const [t, r] of e._byId.entries()) s(!this._byKey.has(t), "Schema id conflicts with existing key:", t), this._byId.set(t, r);
for (const [t, r] of e._byKey.entries()) s(!this._byId.has(t), "Schema key conflicts with existing id:", t), this._byKey.set(t, r);
}
fork(e, t, r) {
const a = this._collect(e);
a.push({ schema: r });
const i = a.shift();
let l = {
id: i.id,
schema: t(i.schema)
};
s(n.isSchema(l.schema), "adjuster function failed to return a joi schema type");
for (const e of a) l = {
id: e.id,
schema: o.fork(e.schema, l.id, l.schema)
};
return l.schema;
}
labels(e, t = []) {
const r = e[0], s = this._get(r);
if (!s) return [...t, ...e].join(".");
const n = e.slice(1);
return t = [...t, s.schema._flags.label || r], n.length ? s.schema._ids.labels(n, t) : t.join(".");
}
reach(e, t = []) {
const r = e[0], n = this._get(r);
s(n, "Schema does not contain path", [...t, ...e].join("."));
const a = e.slice(1);
return a.length ? n.schema._ids.reach(a, [...t, r]) : n.schema;
}
register(e, { key: t } = {}) {
if (!e || !n.isSchema(e)) return;
(e.$_property("schemaChain") || e._ids._schemaChain) && (this._schemaChain = !0);
const r = e._flags.id;
if (r) {
const t = this._byId.get(r);
s(!t || t.schema === e, "Cannot add different schemas with the same id:", r), s(!this._byKey.has(r), "Schema id conflicts with existing key:", r), this._byId.set(r, {
schema: e,
id: r
});
}
t && (s(!this._byKey.has(t), "Schema already contains key:", t), s(!this._byId.has(t), "Schema key conflicts with existing id:", t), this._byKey.set(t, {
schema: e,
id: t
}));
}
reset() {
this._byId = new Map(), this._byKey = new Map(), this._schemaChain = !1;
}
_collect(e, t = [], r = []) {
const n = e[0], a = this._get(n);
s(a, "Schema does not contain path", [...t, ...e].join(".")), r = [a, ...r];
const o = e.slice(1);
return o.length ? a.schema._ids._collect(o, [...t, n], r) : r;
}
_get(e) {
return this._byId.get(e) || this._byKey.get(e);
}
}, o.fork = function(e, r, s) {
const n = t.schema(e, {
each: (e, { key: t }) => {
if (r === (e._flags.id || t)) return s;
},
ref: !1
});
return n ? n.$_mutateRebuild() : e;
}, t.schema = function(e, t) {
let r;
for (const s of Object.keys(e._flags)) {
if ("_" === s[0]) continue;
const n = o.scan(e._flags[s], {
source: "flags",
name: s
}, t);
void 0 !== n && (r = r || e.clone(), r._flags[s] = n);
}
for (let s = 0; s < e._rules.length; ++s) {
const n = e._rules[s], a = o.scan(n.args, {
source: "rules",
name: n.name
}, t);
if (void 0 !== a) {
r = r || e.clone();
const t = Object.assign({}, n);
t.args = a, r._rules[s] = t, r._singleRules.get(n.name) === n && r._singleRules.set(n.name, t);
}
}
for (const s of Object.keys(e.$_terms)) {
if ("_" === s[0]) continue;
const n = o.scan(e.$_terms[s], {
source: "terms",
name: s
}, t);
void 0 !== n && (r = r || e.clone(), r.$_terms[s] = n);
}
return r;
}, o.scan = function(e, t, r, s, i) {
const l = s || [];
if (null === e || "object" != typeof e) return;
let c;
if (Array.isArray(e)) {
for (let s = 0; s < e.length; ++s) {
const n = "terms" === t.source && "keys" === t.name && e[s].key, a = o.scan(e[s], t, r, [s, ...l], n);
void 0 !== a && (c = c || e.slice(), c[s] = a);
}
return c;
}
if (!1 !== r.schema && n.isSchema(e) || !1 !== r.ref && a.isRef(e)) {
const s = r.each(e, {
...t,
path: l,
key: i
});
if (s === e) return;
return s;
}
for (const s of Object.keys(e)) {
if ("_" === s[0]) continue;
const n = o.scan(e[s], t, r, [s, ...l], i);
void 0 !== n && (c = c || Object.assign({}, e), c[s] = n);
}
return c;
};
},
8529(e, t, r) {
"use strict";
const { assert: s, reach: n } = r(3115), a = r(9415);
let o;
const i = {
symbol: Symbol("ref"),
defaults: {
adjust: null,
in: !1,
iterables: null,
map: null,
separator: ".",
type: "value"
}
};
t.create = function(e, t = {}) {
s("string" == typeof e, "Invalid reference key:", e), a.assertOptions(t, [
"adjust",
"ancestor",
"in",
"iterables",
"map",
"prefix",
"render",
"separator"
]), s(!t.prefix || "object" == typeof t.prefix, "options.prefix must be of type object");
const r = Object.assign({}, i.defaults, t);
delete r.prefix;
const n = r.separator, o = i.context(e, n, t.prefix);
if (r.type = o.type, e = o.key, "value" === r.type) if (o.root && (s(!n || e[0] !== n, "Cannot specify relative path with root prefix"), r.ancestor = "root", e || (e = null)), n && n === e) e = null, r.ancestor = 0;
else if (void 0 !== r.ancestor) s(!n || !e || e[0] !== n, "Cannot combine prefix with ancestor option");
else {
const [t, s] = i.ancestor(e, n);
s && "" === (e = e.slice(s)) && (e = null), r.ancestor = t;
}
return r.path = n ? null === e ? [] : e.split(n) : [e], new i.Ref(r);
}, t.in = function(e, r = {}) {
return t.create(e, {
...r,
in: !0
});
}, t.isRef = function(e) {
return !!e && !!e[a.symbols.ref];
}, i.Ref = class {
constructor(e) {
s("object" == typeof e, "Invalid reference construction"), a.assertOptions(e, [
"adjust",
"ancestor",
"in",
"iterables",
"map",
"path",
"render",
"separator",
"type",
"depth",
"key",
"root",
"display"
]), s([!1, void 0].includes(e.separator) || "string" == typeof e.separator && 1 === e.separator.length, "Invalid separator"), s(!e.adjust || "function" == typeof e.adjust, "options.adjust must be a function"), s(!e.map || Array.isArray(e.map), "options.map must be an array"), s(!e.map || !e.adjust, "Cannot set both map and adjust options"), Object.assign(this, i.defaults, e), s("value" === this.type || void 0 === this.ancestor, "Non-value references cannot reference ancestors"), Array.isArray(this.map) && (this.map = new Map(this.map)), this.depth = this.path.length, this.key = this.path.length ? this.path.join(this.separator) : null, this.root = this.path[0], this.updateDisplay();
}
resolve(e, t, r, n, a = {}) {
return s(!this.in || a.in, "Invalid in() reference usage"), "global" === this.type ? this._resolve(r.context, t, a) : "local" === this.type ? this._resolve(n, t, a) : this.ancestor ? "root" === this.ancestor ? this._resolve(t.ancestors[t.ancestors.length - 1], t, a) : (s(this.ancestor <= t.ancestors.length, "Invalid reference exceeds the schema root:", this.display), this._resolve(t.ancestors[this.ancestor - 1], t, a)) : this._resolve(e, t, a);
}
_resolve(e, t, r) {
let s;
if ("value" === this.type && t.mainstay.shadow && !1 !== r.shadow && (s = t.mainstay.shadow.get(this.absolute(t))), void 0 === s && (s = n(e, this.path, {
iterables: this.iterables,
functions: !0
})), this.adjust && (s = this.adjust(s)), this.map) {
const e = this.map.get(s);
void 0 !== e && (s = e);
}
return t.mainstay && t.mainstay.tracer.resolve(t, this, s), s;
}
toString() {
return this.display;
}
absolute(e) {
return [...e.path.slice(0, -this.ancestor), ...this.path];
}
clone() {
return new i.Ref(this);
}
describe() {
const e = { path: this.path };
"value" !== this.type && (e.type = this.type), "." !== this.separator && (e.separator = this.separator), "value" === this.type && 1 !== this.ancestor && (e.ancestor = this.ancestor), this.map && (e.map = [...this.map]);
for (const t of [
"adjust",
"iterables",
"render"
]) null !== this[t] && void 0 !== this[t] && (e[t] = this[t]);
return !1 !== this.in && (e.in = !0), { ref: e };
}
updateDisplay() {
const e = null !== this.key ? this.key : "";
if ("value" !== this.type) return void (this.display = `ref:${this.type}:${e}`);
if (!this.separator) return void (this.display = `ref:${e}`);
if (!this.ancestor) return void (this.display = `ref:${this.separator}${e}`);
if ("root" === this.ancestor) return void (this.display = `ref:root:${e}`);
if (1 === this.ancestor) return void (this.display = `ref:${e || ".."}`);
const t = new Array(this.ancestor + 1).fill(this.separator).join("");
this.display = `ref:${t}${e || ""}`;
}
}, i.Ref.prototype[a.symbols.ref] = !0, t.build = function(e) {
return "value" === (e = Object.assign({}, i.defaults, e)).type && void 0 === e.ancestor && (e.ancestor = 1), new i.Ref(e);
}, i.context = function(e, t, r = {}) {
if (e = e.trim(), r) {
const s = void 0 === r.global ? "$" : r.global;
if (s !== t && e.startsWith(s)) return {
key: e.slice(s.length),
type: "global"
};
const n = void 0 === r.local ? "#" : r.local;
if (n !== t && e.startsWith(n)) return {
key: e.slice(n.length),
type: "local"
};
const a = void 0 === r.root ? "/" : r.root;
if (a !== t && e.startsWith(a)) return {
key: e.slice(a.length),
type: "value",
root: !0
};
}
return {
key: e,
type: "value"
};
}, i.ancestor = function(e, t) {
if (!t) return [1, 0];
if (e[0] !== t) return [1, 0];
if (e[1] !== t) return [0, 1];
let r = 2;
for (; e[r] === t;) ++r;
return [r - 1, r];
}, t.toSibling = 0, t.toParent = 1, t.Manager = class {
constructor() {
this.refs = [];
}
register(e, s) {
if (e) if (s = void 0 === s ? t.toParent : s, Array.isArray(e)) for (const t of e) this.register(t, s);
else if (a.isSchema(e)) for (const t of e._refs.refs) t.ancestor - s >= 0 && this.refs.push({
ancestor: t.ancestor - s,
root: t.root
});
else t.isRef(e) && "value" === e.type && e.ancestor - s >= 0 && this.refs.push({
ancestor: e.ancestor - s,
root: e.root
}), o = o || r(1532), o.isTemplate(e) && this.register(e.refs(), s);
}
get length() {
return this.refs.length;
}
clone() {
const e = new t.Manager();
return e.refs = this.refs.slice(), e;
}
reset() {
this.refs = [];
}
roots() {
return this.refs.filter((e) => !e.ancestor).map((e) => e.root);
}
};
},
1688(e, t, r) {
"use strict";
const s = r(1100), n = {};
n.wrap = s.string().min(1).max(2).allow(!1), t.preferences = s.object({
allowUnknown: s.boolean(),
abortEarly: s.boolean(),
artifacts: s.boolean(),
cache: s.boolean(),
context: s.object(),
convert: s.boolean(),
dateFormat: s.valid("date", "iso", "string", "time", "utc"),
debug: s.boolean(),
errors: {
escapeHtml: s.boolean(),
label: s.valid("path", "key", !1),
language: [s.string(), s.object().ref()],
render: s.boolean(),
stack: s.boolean(),
wrap: {
label: n.wrap,
array: n.wrap,
string: n.wrap
}
},
externals: s.boolean(),
messages: s.object(),
noDefaults: s.boolean(),
nonEnumerables: s.boolean(),
presence: s.valid("required", "optional", "forbidden"),
skipFunctions: s.boolean(),
stripUnknown: s.object({
arrays: s.boolean(),
objects: s.boolean()
}).or("arrays", "objects").allow(!0, !1),
warnings: s.boolean()
}).strict(), n.nameRx = /^[a-zA-Z0-9]\w*$/, n.hook = s.function().maxArity(3), n.rule = s.object({
alias: s.array().items(s.string().pattern(n.nameRx)).single(),
args: s.array().items(s.string(), s.object({
name: s.string().pattern(n.nameRx).required(),
ref: s.boolean(),
assert: s.alternatives([s.function(), s.object().schema()]).conditional("ref", {
is: !0,
then: s.required()
}),
normalize: s.function(),
message: s.string().when("assert", {
is: s.function(),
then: s.required()
})
})),
convert: s.boolean(),
manifest: s.boolean(),
method: s.function().allow(!1),
multi: s.boolean(),
validate: s.function(),
jsonSchema: s.function()
}), t.extension = s.object({
type: s.alternatives([s.string(), s.object().regex()]).required(),
args: s.function(),
cast: s.object().pattern(n.nameRx, s.object({
from: s.function().maxArity(1).required(),
to: s.function().minArity(1).maxArity(2).required()
})),
base: s.object().schema().when("type", {
is: s.object().regex(),
then: s.forbidden()
}),
coerce: [n.hook, s.object({
method: n.hook.required(),
from: s.array().items(s.string()).single()
})],
flags: s.object().pattern(n.nameRx, s.object({
setter: s.string(),
default: s.any()
})),
manifest: { build: s.function().arity(2) },
messages: [s.object(), s.string()],
modifiers: s.object().pattern(n.nameRx, s.function().minArity(1).maxArity(2)),
overrides: s.object().pattern(n.nameRx, s.function()),
prepare: [n.hook, s.object({
method: n.hook.required(),
undefined: s.boolean()
})],
rebuild: s.function().arity(1),
rules: s.object().pattern(n.nameRx, n.rule),
jsonSchema: s.function(),
terms: s.object().pattern(n.nameRx, s.object({
init: s.array().allow(null).required(),
manifest: s.object().pattern(/.+/, [s.valid("schema", "single"), s.object({ mapped: s.object({
from: s.string().required(),
to: s.string().required()
}).required() })])
})),
validate: n.hook
}).strict(), t.extensions = s.array().items(s.object(), s.function().arity(1)).strict(), n.desc = {
buffer: s.object({ buffer: s.string() }),
func: s.object({
function: s.function().required(),
options: { literal: !0 }
}),
override: s.object({ override: !0 }),
ref: s.object({ ref: s.object({
type: s.valid("value", "global", "local"),
path: s.array().required(),
separator: s.string().length(1).allow(!1),
ancestor: s.number().min(0).integer().allow("root"),
map: s.array().items(s.array().length(2)).min(1),
adjust: s.function(),
iterables: s.boolean(),
in: s.boolean(),
render: s.boolean()
}).required() }),
regex: s.object({ regex: s.string().min(3) }),
special: s.object({ special: s.valid("deep").required() }),
template: s.object({
template: s.string().required(),
options: s.object()
}),
value: s.object({ value: s.alternatives([s.object(), s.array()]).required() })
}, n.desc.entity = s.alternatives([
s.array().items(s.link("...")),
s.boolean(),
s.function(),
s.number(),
s.string(),
n.desc.buffer,
n.desc.func,
n.desc.ref,
n.desc.regex,
n.desc.special,
n.desc.template,
n.desc.value,
s.link("/")
]), n.desc.values = s.array().items(null, s.boolean(), s.function(), s.number().allow(1 / 0, -1 / 0, NaN), s.string().allow(""), s.symbol(), n.desc.buffer, n.desc.func, n.desc.override, n.desc.ref, n.desc.regex, n.desc.template, n.desc.value), n.desc.messages = s.object().pattern(/.+/, [
s.string(),
n.desc.template,
s.object().pattern(/.+/, [s.string(), n.desc.template])
]), t.description = s.object({
type: s.string().required(),
flags: s.object({
cast: s.string(),
default: s.any(),
description: s.string(),
empty: s.link("/"),
failover: n.desc.entity,
id: s.string(),
label: s.string(),
only: !0,
presence: [
"optional",
"required",
"forbidden"
],
result: ["raw", "strip"],
strip: s.boolean(),
unit: s.string()
}).unknown(),
preferences: {
allowUnknown: s.boolean(),
abortEarly: s.boolean(),
artifacts: s.boolean(),
cache: s.boolean(),
convert: s.boolean(),
dateFormat: [
"date",
"iso",
"string",
"time",
"utc"
],
errors: {
escapeHtml: s.boolean(),
label: ["path", "key"],
language: [s.string(), n.desc.ref],
wrap: {
label: n.wrap,
array: n.wrap
}
},
externals: s.boolean(),
messages: n.desc.messages,
noDefaults: s.boolean(),
nonEnumerables: s.boolean(),
presence: [
"required",
"optional",
"forbidden"
],
skipFunctions: s.boolean(),
stripUnknown: s.object({
arrays: s.boolean(),
objects: s.boolean()
}).or("arrays", "objects").allow(!0, !1),
warnings: s.boolean()
},
allow: n.desc.values,
invalid: n.desc.values,
rules: s.array().min(1).items({
name: s.string().required(),
args: s.object().min(1),
keep: s.boolean(),
message: [s.string(), n.desc.messages],
warn: s.boolean()
}),
keys: s.object().pattern(/.*/, s.link("/")),
link: n.desc.ref
}).pattern(/^[a-z]\w*$/, s.any());
},
4957(e, t, r) {
"use strict";
const { clone: s, reach: n } = r(3115), a = r(9415), o = { value: Symbol("value") };
e.exports = o.State = class {
constructor(e, t, r) {
this.path = e, this.ancestors = t, this.mainstay = r.mainstay, this.schemas = r.schemas, this.debug = null;
}
localize(e, t = null, r = null) {
const s = new o.State(e, t, this);
return r && s.schemas && (s.schemas = [o.schemas(r), ...s.schemas]), s;
}
nest(e, t) {
const r = new o.State(this.path, this.ancestors, this);
return r.schemas = r.schemas && [o.schemas(e), ...r.schemas], r.debug = t, r;
}
shadow(e, t) {
this.mainstay.shadow = this.mainstay.shadow || new o.Shadow(), this.mainstay.shadow.set(this.path, e, t);
}
snapshot() {
this.mainstay.shadow && (this._snapshot = s(this.mainstay.shadow.node(this.path))), this.mainstay.snapshot();
}
restore() {
this.mainstay.shadow && (this.mainstay.shadow.override(this.path, this._snapshot), this._snapshot = void 0), this.mainstay.restore();
}
commit() {
this.mainstay.shadow && (this.mainstay.shadow.override(this.path, this._snapshot), this._snapshot = void 0), this.mainstay.commit();
}
}, o.schemas = function(e) {
return a.isSchema(e) ? { schema: e } : e;
}, o.Shadow = class {
constructor() {
this._values = null;
}
set(e, t, r) {
if (!e.length) return;
if ("strip" === r && "number" == typeof e[e.length - 1]) return;
this._values = this._values || new Map();
let s = this._values;
for (let t = 0; t < e.length; ++t) {
const r = e[t];
let n = s.get(r);
n || (n = new Map(), s.set(r, n)), s = n;
}
s[o.value] = t;
}
get(e) {
const t = this.node(e);
if (t) return t[o.value];
}
node(e) {
if (this._values) return n(this._values, e, { iterables: !0 });
}
override(e, t) {
if (!this._values) return;
const r = e.slice(0, -1), s = e[e.length - 1], a = n(this._values, r, { iterables: !0 });
t ? a.set(s, t) : a && a.delete(s);
}
};
},
1532(e, t, r) {
"use strict";
const { assert: s, clone: n, escapeHtml: a } = r(3115), o = r(679), i = r(9415), l = r(8013), c = r(8529), u = {
symbol: Symbol("template"),
opens: new Array(1e3).join("\0"),
closes: new Array(1e3).join(""),
dateFormat: {
date: Date.prototype.toDateString,
iso: Date.prototype.toISOString,
string: Date.prototype.toString,
time: Date.prototype.toTimeString,
utc: Date.prototype.toUTCString
}
};
e.exports = u.Template = class {
constructor(e, t) {
if (s("string" == typeof e, "Template source must be a string"), s(!e.includes("\0") && !e.includes(""), "Template source cannot contain reserved control characters"), this.source = e, this.rendered = e, this._template = null, t) {
const { functions: e, ...r } = t;
this._settings = Object.keys(r).length ? n(r) : void 0, this._functions = e, this._functions && (s(Object.keys(this._functions).every((e) => "string" == typeof e), "Functions keys must be strings"), s(Object.values(this._functions).every((e) => "function" == typeof e), "Functions values must be functions"));
} else this._settings = void 0, this._functions = void 0;
this._parse();
}
_parse() {
if (!this.source.includes("{")) return;
const e = u.encode(this.source), t = u.split(e);
let r = !1;
const s = [], n = t.shift();
n && s.push(u.decode(n));
for (const e of t) {
const t = "{" !== e[0], n = t ? "}" : "}}", a = e.indexOf(n);
if (-1 === a || "{" === e[1]) {
s.push(`{${u.decode(e)}`);
continue;
}
let o = e.slice(t ? 0 : 1, a);
const i = ":" === o[0];
i && (o = o.slice(1));
const l = this._ref(u.decode(o), {
raw: t,
wrapped: i
});
s.push(l), "string" != typeof l && (r = !0);
const c = e.slice(a + n.length);
c && s.push(u.decode(c));
}
r ? this._template = s : this.rendered = s.join("");
}
static date(e, t) {
return u.dateFormat[t.dateFormat].call(e);
}
describe(e = {}) {
if (!this._settings && e.compact) return this.source;
const t = { template: this.source };
return this._settings && (t.options = this._settings), this._functions && (t.functions = this._functions), t;
}
static build(e) {
return new u.Template(e.template, e.options || e.functions ? {
...e.options,
functions: e.functions
} : void 0);
}
isDynamic() {
return !!this._template;
}
static isTemplate(e) {
return !!e && !!e[i.symbols.template];
}
refs() {
if (!this._template) return;
const e = [];
for (const t of this._template) "string" != typeof t && e.push(...t.refs);
return e;
}
resolve(e, t, r, s) {
return this._template && 1 === this._template.length ? this._part(this._template[0], e, t, r, s, {}) : this.render(e, t, r, s);
}
_part(e, ...t) {
return e.ref ? e.ref.resolve(...t) : e.formula.evaluate(t);
}
render(e, t, r, s, n = {}) {
if (!this.isDynamic()) return this.rendered;
const o = [];
for (const i of this._template) if ("string" == typeof i) o.push(i);
else {
const l = this._part(i, e, t, r, s, n), c = u.stringify(l, e, t, r, s, n);
if (void 0 !== c) {
const e = i.raw || !1 === (n.errors && n.errors.escapeHtml) ? c : a(c);
o.push(u.wrap(e, i.wrapped && r.errors.wrap.label));
}
}
return o.join("");
}
_ref(e, { raw: t, wrapped: r }) {
const s = [], n = (e) => {
const t = c.create(e, this._settings);
return s.push(t), (e) => {
const r = t.resolve(...e);
return void 0 !== r ? r : null;
};
};
try {
const t = this._functions ? {
...u.functions,
...this._functions
} : u.functions;
var a = new o.Parser(e, {
reference: n,
functions: t,
constants: u.constants
});
} catch (t) {
throw t.message = `Invalid template variable "${e}" fails due to: ${t.message}`, t;
}
if (a.single) {
if ("reference" === a.single.type) {
const e = s[0];
return {
ref: e,
raw: t,
refs: s,
wrapped: r || "local" === e.type && "label" === e.key
};
}
return u.stringify(a.single.value);
}
return {
formula: a,
raw: t,
refs: s
};
}
toString() {
return this.source;
}
}, u.Template.prototype[i.symbols.template] = !0, u.Template.prototype.isImmutable = !0, u.encode = function(e) {
return e.replace(/\\(\{+)/g, (e, t) => u.opens.slice(0, t.length)).replace(/\\(\}+)/g, (e, t) => u.closes.slice(0, t.length));
}, u.decode = function(e) {
return e.replace(/\u0000/g, "{").replace(/\u0001/g, "}");
}, u.split = function(e) {
const t = [];
let r = "";
for (let s = 0; s < e.length; ++s) {
const n = e[s];
if ("{" === n) {
let n = "";
for (; s + 1 < e.length && "{" === e[s + 1];) n += "{", ++s;
t.push(r), r = n;
} else r += n;
}
return t.push(r), t;
}, u.wrap = function(e, t) {
return t ? 1 === t.length ? `${t}${e}${t}` : `${t[0]}${e}${t[1]}` : e;
}, u.stringify = function(e, t, r, s, n, a = {}) {
const o = typeof e, i = s && s.errors && s.errors.wrap || {};
let l = !1;
if (c.isRef(e) && e.render && (l = e.in, e = e.resolve(t, r, s, n, {
in: e.in,
...a
})), null === e) return "null";
if ("string" === o) return u.wrap(e, a.arrayItems && i.string);
if ("number" === o || "function" === o || "symbol" === o) return e.toString();
if ("object" !== o) return JSON.stringify(e);
if (e instanceof Date) return u.Template.date(e, s);
if (e instanceof Map) {
const t = [];
for (const [r, s] of e.entries()) t.push(`${r.toString()} -> ${s.toString()}`);
e = t;
}
if (!Array.isArray(e)) return e.toString();
const f = [];
for (const o of e) f.push(u.stringify(o, t, r, s, n, {
arrayItems: !0,
...a
}));
return u.wrap(f.join(", "), !l && i.array);
}, u.constants = {
true: !0,
false: !1,
null: null,
second: 1e3,
minute: 6e4,
hour: 36e5,
day: 864e5
}, u.functions = {
if: (e, t, r) => e ? t : r,
length: (e) => "string" == typeof e ? e.length : e && "object" == typeof e ? Array.isArray(e) ? e.length : Object.keys(e).length : null,
msg(e) {
const [t, r, s, n, a] = this, o = a.messages;
if (!o) return "";
const i = l.template(t, o[0], e, r, s) || l.template(t, o[1], e, r, s);
return i ? i.render(t, r, s, n, a) : "";
},
number: (e) => "number" == typeof e ? e : "string" == typeof e ? parseFloat(e) : "boolean" == typeof e ? e ? 1 : 0 : e instanceof Date ? e.getTime() : null
};
},
4972(e, t, r) {
"use strict";
const { assert: s, merge: n } = r(3115), a = r(680), o = r(9415), i = r(3541), l = r(8013), c = r(8529), u = {};
e.exports = a.extend({
type: "alternatives",
flags: { match: { default: "any" } },
terms: { matches: {
init: [],
register: c.toSibling
} },
args: (e, ...t) => 1 === t.length && Array.isArray(t[0]) ? e.try(...t[0]) : e.try(...t),
validate(e, t) {
const { schema: r, error: s, state: a, prefs: o } = t;
if (r._flags.match) {
const t = [], i = [];
for (let s = 0; s < r.$_terms.matches.length; ++s) {
const n = r.$_terms.matches[s], l = a.nest(n.schema, `match.${s}`);
l.snapshot();
const c = n.schema.$_validate(e, l, o);
c.errors ? (i.push(c.errors), l.restore()) : (t.push(c.value), l.commit());
}
if (0 === t.length) return { errors: s("alternatives.any", { details: i.map((e) => l.details(e, { override: !1 })) }) };
if ("one" === r._flags.match) return 1 === t.length ? { value: t[0] } : { errors: s("alternatives.one") };
if (t.length !== r.$_terms.matches.length) return { errors: s("alternatives.all", { details: i.map((e) => l.details(e, { override: !1 })) }) };
const c = (e) => e.$_terms.matches.some((e) => "object" === e.schema.type || "alternatives" === e.schema.type && c(e.schema));
return c(r) ? { value: t.reduce((e, t) => n(e, t, { mergeArrays: !1 })) } : { value: t[t.length - 1] };
}
const i = [];
for (let t = 0; t < r.$_terms.matches.length; ++t) {
const s = r.$_terms.matches[t];
if (s.schema) {
const r = a.nest(s.schema, `match.${t}`);
r.snapshot();
const n = s.schema.$_validate(e, r, o);
if (!n.errors) return r.commit(), n;
r.restore(), i.push({
schema: s.schema,
reports: n.errors
});
continue;
}
const n = s.ref ? s.ref.resolve(e, a, o) : e, l = s.is ? [s] : s.switch;
for (let r = 0; r < l.length; ++r) {
const { is: c, then: u, otherwise: f } = l[r], m = `match.${t}${s.switch ? "." + r : ""}`;
if (c.$_match(n, a.nest(c, `${m}.is`), o)) {
if (u) return u.$_validate(e, a.nest(u, `${m}.then`), o);
} else if (f) return f.$_validate(e, a.nest(f, `${m}.otherwise`), o);
}
}
return u.errors(i, t);
},
jsonSchema(e, t, r, s) {
const n = [];
for (const t of e.$_terms.matches) if (t.schema) n.push(t.schema.$_jsonSchema(r, s));
else {
const e = t.is ? [t] : t.switch;
for (const t of e) t.then && n.push(t.then.$_jsonSchema(r, s)), t.otherwise && n.push(t.otherwise.$_jsonSchema(r, s));
}
if (n.length) {
var a;
delete t.type;
const r = null !== (a = e._flags.match) && void 0 !== a ? a : "any";
"one" === r ? t.oneOf = n : "all" === r ? t.allOf = n : t.anyOf = n;
}
return t;
},
rules: {
conditional: { method(e, t) {
s(!this._flags._endedSwitch, "Unreachable condition"), s(!this._flags.match, "Cannot combine match mode", this._flags.match, "with conditional rule"), s(void 0 === t.break, "Cannot use break option with alternatives conditional");
const r = this.clone(), n = i.when(r, e, t), a = n.is ? [n] : n.switch;
for (const e of a) if (e.then && e.otherwise) {
r.$_setFlag("_endedSwitch", !0, { clone: !1 });
break;
}
return r.$_terms.matches.push(n), r.$_mutateRebuild();
} },
match: { method(e) {
if (s([
"any",
"one",
"all"
].includes(e), "Invalid alternatives match mode", e), "any" !== e) for (const t of this.$_terms.matches) s(t.schema, "Cannot combine match mode", e, "with conditional rules");
return this.$_setFlag("match", e);
} },
try: { method(...e) {
s(e.length, "Missing alternative schemas"), o.verifyFlat(e, "try"), s(!this._flags._endedSwitch, "Unreachable condition");
const t = this.clone();
for (const r of e) t.$_terms.matches.push({ schema: t.$_compile(r) });
return t.$_mutateRebuild();
} }
},
overrides: {
label(e) {
return this.$_parent("label", e).$_modify({
each: (t, r) => "is" !== r.path[0] && "string" != typeof t._flags.label ? t.label(e) : void 0,
ref: !1
});
},
isAsync() {
var e;
if (null !== (e = this.$_terms.externals) && void 0 !== e && e.length) return !0;
for (const e of this.$_terms.matches) {
var t, r, s;
if (null !== (t = e.schema) && void 0 !== t && t.isAsync()) return !0;
if (null !== (r = e.then) && void 0 !== r && r.isAsync()) return !0;
if (null !== (s = e.otherwise) && void 0 !== s && s.isAsync()) return !0;
}
return !1;
}
},
rebuild(e) {
e.$_modify({ each: (t) => {
o.isSchema(t) && "array" === t.type && e.$_setFlag("_arrayItems", !0, { clone: !1 });
} });
},
manifest: { build(e, t) {
if (t.matches) for (const r of t.matches) {
const { schema: t, ref: s, is: n, not: a, then: o, otherwise: i } = r;
e = t ? e.try(t) : s ? e.conditional(s, {
is: n,
then: o,
not: a,
otherwise: i,
switch: r.switch
}) : e.conditional(n, {
then: o,
otherwise: i
});
}
return e;
} },
messages: {
"alternatives.all": "{{#label}} does not match all of the required types",
"alternatives.any": "{{#label}} does not match any of the allowed types",
"alternatives.match": "{{#label}} does not match any of the allowed types",
"alternatives.one": "{{#label}} matches more than one allowed type",
"alternatives.types": "{{#label}} must be one of {{#types}}"
}
}), u.errors = function(e, { error: t, state: r }) {
if (!e.length) return { errors: t("alternatives.any") };
if (1 === e.length) return { errors: e[0].reports };
const s = new Set(), n = [];
for (const { reports: a, schema: o } of e) {
if (a.length > 1) return u.unmatched(e, t);
const i = a[0];
if (i instanceof l.Report == 0) return u.unmatched(e, t);
if (i.state.path.length !== r.path.length) {
n.push({
type: o.type,
report: i
});
continue;
}
if ("any.only" === i.code) {
for (const e of i.local.valids) s.add(e);
continue;
}
const [c, f] = i.code.split(".");
"base" !== f ? n.push({
type: o.type,
report: i
}) : "object.base" === i.code ? s.add(i.local.type) : s.add(c);
}
return n.length ? 1 === n.length ? { errors: n[0].report } : u.unmatched(e, t) : { errors: t("alternatives.types", { types: [...s] }) };
}, u.unmatched = function(e, t) {
const r = [];
for (const t of e) r.push(...t.reports);
return { errors: t("alternatives.match", l.details(r, { override: !1 })) };
};
},
680(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(2115), a = r(9415), o = r(6162);
e.exports = n.extend({
type: "any",
flags: { only: { default: !1 } },
terms: {
alterations: { init: null },
examples: { init: null },
externals: { init: null },
metas: { init: [] },
notes: { init: [] },
shared: { init: null },
tags: { init: [] },
whens: { init: null }
},
rules: {
custom: {
method(e, t) {
return s("function" == typeof e, "Method must be a function"), s(void 0 === t || t && "string" == typeof t, "Description must be a non-empty string"), this.$_addRule({
name: "custom",
args: {
method: e,
description: t
}
});
},
validate(e, t, { method: r }) {
try {
return r(e, t);
} catch (e) {
return t.error("any.custom", { error: e });
}
},
args: ["method", "description"],
multi: !0
},
messages: { method(e) {
return this.prefs({ messages: e });
} },
shared: { method(e) {
s(a.isSchema(e) && e._flags.id, "Schema must be a schema with an id");
const t = this.clone();
return t.$_terms.shared = t.$_terms.shared || [], t.$_terms.shared.push(e), t.$_mutateRegister(e), t;
} },
warning: {
method(e, t) {
return s(e && "string" == typeof e, "Invalid warning code"), this.$_addRule({
name: "warning",
args: {
code: e,
local: t
},
warn: !0
});
},
validate: (e, t, { code: r, local: s }) => t.error(r, s),
args: ["code", "local"],
multi: !0
}
},
modifiers: {
keep(e, t = !0) {
e.keep = t;
},
message(e, t) {
e.message = o.compile(t);
},
warn(e, t = !0) {
e.warn = t;
}
},
manifest: { build(e, t) {
for (const r of Object.keys(t)) {
const s = t[r];
if ([
"examples",
"externals",
"metas",
"notes",
"tags"
].includes(r)) for (const t of s) e = e[r.slice(0, -1)](t);
else {
if ("alterations" === r) {
const t = {};
for (const { target: e, adjuster: r } of s) t[e] = r;
e = e.alter(t);
continue;
}
if ("whens" !== r) {
if ("shared" === r) for (const t of s) e = e.shared(t);
} else for (const t of s) {
const { ref: r, is: s, not: n, then: a, otherwise: o, concat: i } = t;
e = i ? e.concat(i) : r ? e.when(r, {
is: s,
not: n,
then: a,
otherwise: o,
switch: t.switch,
break: t.break
}) : e.when(s, {
then: a,
otherwise: o,
break: t.break
});
}
}
}
return e;
} },
messages: {
"any.custom": "{{#label}} failed custom validation because {{#error.message}}",
"any.default": "{{#label}} threw an error when running default method",
"any.failover": "{{#label}} threw an error when running failover method",
"any.invalid": "{{#label}} contains an invalid value",
"any.only": "{{#label}} must be {if(#valids.length == 1, \"\", \"one of \")}{{#valids}}",
"any.ref": "{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}",
"any.required": "{{#label}} is required",
"any.unknown": "{{#label}} is not allowed"
}
});
},
2591(e, t, r) {
"use strict";
const { assert: s, deepEqual: n, reach: a } = r(3115), o = r(680), i = r(9415), l = r(3541), c = {};
e.exports = o.extend({
type: "array",
flags: {
single: { default: !1 },
sparse: { default: !1 }
},
terms: {
items: {
init: [],
manifest: "schema"
},
ordered: {
init: [],
manifest: "schema"
},
_exclusions: { init: [] },
_inclusions: { init: [] },
_requireds: { init: [] }
},
coerce: {
from: "object",
method(e, { schema: t, state: r, prefs: s }) {
if (!Array.isArray(e)) return;
const n = t.$_getRule("sort");
return n ? c.sort(t, e, n.args.options, r, s) : void 0;
}
},
validate(e, { schema: t, error: r }) {
if (!Array.isArray(e)) {
if (t._flags.single) {
const t = [e];
return t[i.symbols.arraySingle] = !0, { value: t };
}
return { errors: r("array.base") };
}
if (t.$_getRule("items") || t.$_terms.externals) return { value: e.slice() };
},
jsonSchema(e, t, r, s) {
const n = e.$_terms.ordered;
if (n.length && (t.prefixItems = n.map((e) => e.$_jsonSchema(r, s))), e.$_terms.items.length) {
let a;
a = 1 === e.$_terms.items.length ? e.$_terms.items[0].$_jsonSchema(r, s) : { anyOf: e.$_terms.items.map((e) => e.$_jsonSchema(r, s)) }, n.length ? (t.unevaluatedItems = a, c.setOrderedMinItems(t, n)) : t.items = a;
} else n.length && (t.unevaluatedItems = !1, c.setOrderedMinItems(t, n), t.maxItems = n.length);
const a = [];
for (const t of e._rules) "has" !== t.name || t.args.schema._refs.refs.length || a.push(t.args.schema.$_jsonSchema(r, s));
if (a.length && (1 === a.length ? t.contains = a[0] : t.allOf = a.map((e) => ({ contains: e }))), e._flags.single && e.$_terms.items.length) {
let n;
n = 1 === e.$_terms.items.length ? e.$_terms.items[0].$_jsonSchema(r, s) : { anyOf: e.$_terms.items.map((e) => e.$_jsonSchema(r, s)) }, t = { anyOf: [t, n] };
}
return t;
},
rules: {
has: {
method(e) {
e = this.$_compile(e, { appendPath: !0 });
const t = this.$_addRule({
name: "has",
args: { schema: e }
});
return t.$_mutateRegister(e), t;
},
validate(e, { state: t, prefs: r, error: s }, { schema: n }) {
const a = [e, ...t.ancestors];
for (let s = 0; s < e.length; ++s) {
const o = t.localize([...t.path, s], a, n);
if (n.$_match(e[s], o, r)) return e;
}
const o = n._flags.label;
return o ? s("array.hasKnown", { patternLabel: o }) : s("array.hasUnknown", null);
},
multi: !0
},
items: {
method(...e) {
i.verifyFlat(e, "items");
const t = this.$_addRule("items");
for (let r = 0; r < e.length; ++r) {
const s = i.tryWithPath(() => this.$_compile(e[r]), r, { append: !0 });
t.$_terms.items.push(s);
}
return t.$_mutateRebuild();
},
validate(e, { schema: t, error: r, state: s, prefs: n, errorsArray: a }) {
const o = t.$_terms._requireds.slice(), l = t.$_terms.ordered.slice(), u = [...t.$_terms._inclusions, ...o], f = !e[i.symbols.arraySingle];
delete e[i.symbols.arraySingle];
const m = a();
let h = e.length;
for (let a = 0; a < h; ++a) {
const i = e[a];
let p = !1, d = !1;
const g = f ? a : new Number(a), y = [...s.path, g];
if (!t._flags.sparse && void 0 === i) {
if (m.push(r("array.sparse", {
key: g,
path: y,
pos: a,
value: void 0
}, s.localize(y))), n.abortEarly) return m;
l.shift();
continue;
}
const b = [e, ...s.ancestors];
for (const e of t.$_terms._exclusions) if (e.$_match(i, s.localize(y, b, e), n, { presence: "ignore" })) {
if (m.push(r("array.excludes", {
pos: a,
value: i
}, s.localize(y))), n.abortEarly) return m;
p = !0, l.shift();
break;
}
if (p) continue;
if (t.$_terms.ordered.length) {
if (l.length) {
const o = l.shift(), u = o.$_validate(i, s.localize(y, b, o), n);
if (u.errors) {
if (m.push(...u.errors), n.abortEarly) return m;
} else if ("strip" === o._flags.result) c.fastSplice(e, a), --a, --h;
else {
if (!t._flags.sparse && void 0 === u.value) {
if (m.push(r("array.sparse", {
key: g,
path: y,
pos: a,
value: void 0
}, s.localize(y))), n.abortEarly) return m;
continue;
}
e[a] = u.value;
}
continue;
}
if (!t.$_terms.items.length) {
if (m.push(r("array.orderedLength", {
pos: a,
limit: t.$_terms.ordered.length
})), n.abortEarly) return m;
break;
}
}
const v = [];
let _ = o.length;
for (let l = 0; l < _; ++l) {
const u = s.localize(y, b, o[l]);
u.snapshot();
const f = o[l].$_validate(i, u, n);
if (v[l] = f, !f.errors) {
if (u.commit(), e[a] = f.value, d = !0, c.fastSplice(o, l), --l, --_, !t._flags.sparse && void 0 === f.value && (m.push(r("array.sparse", {
key: g,
path: y,
pos: a,
value: void 0
}, s.localize(y))), n.abortEarly)) return m;
break;
}
u.restore();
}
if (d) continue;
const A = n.stripUnknown && !!n.stripUnknown.arrays || !1;
_ = u.length;
for (const l of u) {
let u;
const f = o.indexOf(l);
if (-1 !== f) u = v[f];
else {
const o = s.localize(y, b, l);
if (o.snapshot(), u = l.$_validate(i, o, n), !u.errors) {
o.commit(), "strip" === l._flags.result ? (c.fastSplice(e, a), --a, --h) : t._flags.sparse || void 0 !== u.value ? e[a] = u.value : (m.push(r("array.sparse", {
key: g,
path: y,
pos: a,
value: void 0
}, s.localize(y))), p = !0), d = !0;
break;
}
o.restore();
}
if (1 === _) {
if (A) {
c.fastSplice(e, a), --a, --h, d = !0;
break;
}
if (m.push(...u.errors), n.abortEarly) return m;
p = !0;
break;
}
}
if (!p && (t.$_terms._inclusions.length || t.$_terms._requireds.length) && !d) {
if (A) {
c.fastSplice(e, a), --a, --h;
continue;
}
if (m.push(r("array.includes", {
pos: a,
value: i
}, s.localize(y))), n.abortEarly) return m;
}
}
return o.length && c.fillMissedErrors(t, m, o, e, s, n), l.length && (c.fillOrderedErrors(t, m, l, e, s, n), m.length || c.fillDefault(l, e, s, n)), m.length ? m : e;
},
priority: !0,
manifest: !1
},
length: {
method(e) {
return this.$_addRule({
name: "length",
args: { limit: e },
operator: "="
});
},
validate: (e, t, { limit: r }, { name: s, operator: n, args: a }) => i.compare(e.length, r, n) ? e : t.error("array." + s, {
limit: a.limit,
value: e
}),
jsonSchema: (e, t) => (t.minItems = e.args.limit, t.maxItems = e.args.limit, t),
args: [{
name: "limit",
ref: !0,
assert: i.limit,
message: "must be a positive integer"
}]
},
max: {
method(e) {
return this.$_addRule({
name: "max",
method: "length",
args: { limit: e },
operator: "<="
});
},
jsonSchema: (e, t) => (t.maxItems = e.args.limit, t)
},
min: {
method(e) {
return this.$_addRule({
name: "min",
method: "length",
args: { limit: e },
operator: ">="
});
},
jsonSchema: (e, t) => (t.minItems = e.args.limit, t)
},
ordered: { method(...e) {
i.verifyFlat(e, "ordered");
const t = this.$_addRule("items");
for (let r = 0; r < e.length; ++r) {
const s = i.tryWithPath(() => this.$_compile(e[r]), r, { append: !0 });
c.validateSingle(s, t), t.$_mutateRegister(s), t.$_terms.ordered.push(s);
}
return t.$_mutateRebuild();
} },
single: { method(e) {
const t = void 0 === e || !!e;
return s(!t || !this._flags._arrayItems, "Cannot specify single rule when array has array items"), this.$_setFlag("single", t);
} },
sort: {
method(e = {}) {
i.assertOptions(e, ["by", "order"]);
const t = { order: e.order || "ascending" };
return e.by && (t.by = l.ref(e.by, { ancestor: 0 }), s(!t.by.ancestor, "Cannot sort by ancestor")), this.$_addRule({
name: "sort",
args: { options: t }
});
},
validate(e, { error: t, state: r, prefs: s, schema: n }, { options: a }) {
const { value: o, errors: i } = c.sort(n, e, a, r, s);
if (i) return i;
for (let r = 0; r < e.length; ++r) if (e[r] !== o[r]) return t("array.sort", {
order: a.order,
by: a.by ? a.by.key : "value"
});
return e;
},
convert: !0
},
sparse: { method(e) {
const t = void 0 === e || !!e;
return this._flags.sparse === t ? this : (t ? this.clone() : this.$_addRule("items")).$_setFlag("sparse", t, { clone: !1 });
} },
unique: {
method(e, t = {}) {
s(!e || "function" == typeof e || "string" == typeof e, "comparator must be a function or a string"), i.assertOptions(t, ["ignoreUndefined", "separator"]);
const r = {
name: "unique",
args: {
options: t,
comparator: e
}
};
if (e) if ("string" == typeof e) {
const s = i.default(t.separator, ".");
r.path = s ? e.split(s) : [e];
} else r.comparator = e;
return this.$_addRule(r);
},
validate(e, { state: t, error: r, schema: o }, { comparator: i, options: l }, { comparator: c, path: u }) {
const f = {
string: Object.create(null),
number: Object.create(null),
undefined: Object.create(null),
boolean: Object.create(null),
bigint: Object.create(null),
object: new Map(),
function: new Map(),
custom: new Map()
}, m = c || n, h = l.ignoreUndefined;
for (let n = 0; n < e.length; ++n) {
const o = u ? a(e[n], u) : e[n], l = c ? f.custom : f[typeof o];
if (s(l, "Failed to find unique map container for type", typeof o), l instanceof Map) {
const s = l.entries();
let a;
for (; !(a = s.next()).done;) if (m(a.value[0], o)) {
const s = t.localize([...t.path, n], [e, ...t.ancestors]), o = {
pos: n,
value: e[n],
dupePos: a.value[1],
dupeValue: e[a.value[1]]
};
return u && (o.path = i), r("array.unique", o, s);
}
l.set(o, n);
} else {
if ((!h || void 0 !== o) && void 0 !== l[o]) {
const s = {
pos: n,
value: e[n],
dupePos: l[o],
dupeValue: e[l[o]]
};
return u && (s.path = i), r("array.unique", s, t.localize([...t.path, n], [e, ...t.ancestors]));
}
l[o] = n;
}
}
return e;
},
jsonSchema: (e, t) => (e.args.comparator || (t.uniqueItems = !0), t),
args: ["comparator", "options"],
multi: !0
}
},
overrides: { isAsync() {
var e;
if (null !== (e = this.$_terms.externals) && void 0 !== e && e.length) return !0;
for (const e of this.$_terms.items) if (e.isAsync()) return !0;
for (const e of this.$_terms.ordered) if (e.isAsync()) return !0;
return !1;
} },
cast: { set: {
from: Array.isArray,
to: (e, t) => new Set(e)
} },
rebuild(e) {
e.$_terms._inclusions = [], e.$_terms._exclusions = [], e.$_terms._requireds = [];
for (const t of e.$_terms.items) c.validateSingle(t, e), "required" === t._flags.presence ? e.$_terms._requireds.push(t) : "forbidden" === t._flags.presence ? e.$_terms._exclusions.push(t) : e.$_terms._inclusions.push(t);
for (const t of e.$_terms.ordered) c.validateSingle(t, e);
},
manifest: { build: (e, t) => (t.items && (e = e.items(...t.items)), t.ordered && (e = e.ordered(...t.ordered)), e) },
messages: {
"array.base": "{{#label}} must be an array",
"array.excludes": "{{#label}} contains an excluded value",
"array.hasKnown": "{{#label}} does not contain at least one required match for type {:#patternLabel}",
"array.hasUnknown": "{{#label}} does not contain at least one required match",
"array.includes": "{{#label}} does not match any of the allowed types",
"array.includesRequiredBoth": "{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)",
"array.includesRequiredKnowns": "{{#label}} does not contain {{#knownMisses}}",
"array.includesRequiredUnknowns": "{{#label}} does not contain {{#unknownMisses}} required value(s)",
"array.length": "{{#label}} must contain {{#limit}} items",
"array.max": "{{#label}} must contain less than or equal to {{#limit}} items",
"array.min": "{{#label}} must contain at least {{#limit}} items",
"array.orderedLength": "{{#label}} must contain at most {{#limit}} items",
"array.sort": "{{#label}} must be sorted in {#order} order by {{#by}}",
"array.sort.mismatching": "{{#label}} cannot be sorted due to mismatching types",
"array.sort.unsupported": "{{#label}} cannot be sorted due to unsupported type {#type}",
"array.sparse": "{{#label}} must not be a sparse array item",
"array.unique": "{{#label}} contains a duplicate value"
}
}), c.setOrderedMinItems = function(e, t) {
const r = c.orderedMinItems(t);
r && (e.minItems = r);
}, c.orderedMinItems = function(e) {
for (let t = e.length - 1; t >= 0; --t) if ("required" === e[t]._flags.presence) return t + 1;
return 0;
}, c.fillMissedErrors = function(e, t, r, s, n, a) {
const o = [];
let i = 0;
for (const e of r) {
const t = e._flags.label;
t ? o.push(t) : ++i;
}
o.length ? i ? t.push(e.$_createError("array.includesRequiredBoth", s, {
knownMisses: o,
unknownMisses: i
}, n, a)) : t.push(e.$_createError("array.includesRequiredKnowns", s, { knownMisses: o }, n, a)) : t.push(e.$_createError("array.includesRequiredUnknowns", s, { unknownMisses: i }, n, a));
}, c.fillOrderedErrors = function(e, t, r, s, n, a) {
const o = [];
for (const e of r) "required" === e._flags.presence && o.push(e);
o.length && c.fillMissedErrors(e, t, o, s, n, a);
}, c.fillDefault = function(e, t, r, s) {
const n = [];
let a = !0;
for (let o = e.length - 1; o >= 0; --o) {
const i = e[o], l = [t, ...r.ancestors], c = i.$_validate(void 0, r.localize(r.path, l, i), s).value;
if (a) {
if (void 0 === c) continue;
a = !1;
}
n.unshift(c);
}
n.length && t.push(...n);
}, c.fastSplice = function(e, t) {
let r = t;
for (; r < e.length;) e[r++] = e[r];
--e.length;
}, c.validateSingle = function(e, t) {
("array" === e.type || e._flags._arrayItems) && (s(!t._flags.single, "Cannot specify array item with single rule enabled"), t.$_setFlag("_arrayItems", !0, { clone: !1 }));
}, c.sort = function(e, t, r, s, n) {
const a = "ascending" === r.order ? 1 : -1, o = -1 * a, i = a, l = (l, u) => {
let f = c.compare(l, u, o, i);
if (null !== f) return f;
if (r.by && (l = r.by.resolve(l, s, n), u = r.by.resolve(u, s, n)), f = c.compare(l, u, o, i), null !== f) return f;
const m = typeof l;
if (m !== typeof u) throw e.$_createError("array.sort.mismatching", t, null, s, n);
if ("number" !== m && "string" !== m) throw e.$_createError("array.sort.unsupported", t, { type: m }, s, n);
return "number" === m ? (l - u) * a : l < u ? o : i;
};
try {
return { value: t.slice().sort(l) };
} catch (e) {
return { errors: e };
}
}, c.compare = function(e, t, r, s) {
return e === t ? 0 : void 0 === e ? 1 : void 0 === t ? -1 : null === e ? s : null === t ? r : null;
};
},
6186(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(680), a = r(9415), o = r(6220), i = { isBool: function(e) {
return "boolean" == typeof e;
} };
e.exports = n.extend({
type: "boolean",
flags: { sensitive: { default: !1 } },
terms: {
falsy: {
init: null,
manifest: "values"
},
truthy: {
init: null,
manifest: "values"
}
},
coerce(e, { schema: t }) {
if ("boolean" != typeof e) {
if ("string" == typeof e) {
const r = e.trim(), s = t._flags.sensitive ? r : r.toLowerCase();
e = "true" === s || "false" !== s && e;
}
return "boolean" != typeof e && (e = t.$_terms.truthy && t.$_terms.truthy.has(e, null, null, !t._flags.sensitive) || (!t.$_terms.falsy || !t.$_terms.falsy.has(e, null, null, !t._flags.sensitive)) && e), { value: e };
}
},
validate(e, { error: t }) {
if ("boolean" != typeof e) return {
value: e,
errors: t("boolean.base")
};
},
rules: {
truthy: { method(...e) {
a.verifyFlat(e, "truthy");
const t = this.clone();
t.$_terms.truthy = t.$_terms.truthy || new o();
for (let r = 0; r < e.length; ++r) {
const n = e[r];
s(void 0 !== n, "Cannot call truthy with undefined"), t.$_terms.truthy.add(n);
}
return t;
} },
falsy: { method(...e) {
a.verifyFlat(e, "falsy");
const t = this.clone();
t.$_terms.falsy = t.$_terms.falsy || new o();
for (let r = 0; r < e.length; ++r) {
const n = e[r];
s(void 0 !== n, "Cannot call falsy with undefined"), t.$_terms.falsy.add(n);
}
return t;
} },
sensitive: { method(e = !0) {
return this.$_setFlag("sensitive", e);
} }
},
cast: {
number: {
from: i.isBool,
to: (e, t) => e ? 1 : 0
},
string: {
from: i.isBool,
to: (e, t) => e ? "true" : "false"
}
},
manifest: { build: (e, t) => (t.truthy && (e = e.truthy(...t.truthy)), t.falsy && (e = e.falsy(...t.falsy)), e) },
messages: { "boolean.base": "{{#label}} must be a boolean" }
});
},
2588(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(680), a = r(9415), o = r(1532), i = {
formats: [
"iso",
"javascript",
"unix"
],
isDate: function(e) {
return e instanceof Date;
}
};
e.exports = n.extend({
type: "date",
coerce: {
from: ["number", "string"],
method: (e, { schema: t }) => ({ value: i.parse(e, t._flags.format) || e })
},
validate(e, { schema: t, error: r, prefs: s }) {
if (e instanceof Date && !isNaN(e.getTime())) return;
const n = t._flags.format;
return s.convert && n && "string" == typeof e ? {
value: e,
errors: r("date.format", { format: n })
} : {
value: e,
errors: r("date.base")
};
},
jsonSchema: (e, t, r, s) => (t.type = "string", t.format = "date-time", t),
rules: {
compare: {
method: !1,
validate(e, t, { date: r }, { name: s, operator: n, args: o }) {
const i = "now" === r ? Date.now() : r.getTime();
return a.compare(e.getTime(), i, n) ? e : t.error("date." + s, {
limit: o.date,
value: e
});
},
args: [{
name: "date",
ref: !0,
normalize: (e) => "now" === e ? e : i.parse(e),
assert: (e) => null !== e,
message: "must have a valid date format"
}]
},
format: { method(e) {
return s(i.formats.includes(e), "Unknown date format", e), this.$_setFlag("format", e);
} },
greater: {
method(e) {
return this.$_addRule({
name: "greater",
method: "compare",
args: { date: e },
operator: ">"
});
},
jsonSchema(e, t) {
const r = e.args.date;
return r instanceof Date && (t["x-constraint"] = {
...t["x-constraint"],
greater: r.toISOString()
}), t;
}
},
iso: { method() {
return this.format("iso");
} },
less: {
method(e) {
return this.$_addRule({
name: "less",
method: "compare",
args: { date: e },
operator: "<"
});
},
jsonSchema(e, t) {
const r = e.args.date;
return r instanceof Date && (t["x-constraint"] = {
...t["x-constraint"],
less: r.toISOString()
}), t;
}
},
max: {
method(e) {
return this.$_addRule({
name: "max",
method: "compare",
args: { date: e },
operator: "<="
});
},
jsonSchema(e, t) {
const r = e.args.date;
return r instanceof Date && (t["x-constraint"] = {
...t["x-constraint"],
max: r.toISOString()
}), t;
}
},
min: {
method(e) {
return this.$_addRule({
name: "min",
method: "compare",
args: { date: e },
operator: ">="
});
},
jsonSchema(e, t) {
const r = e.args.date;
return r instanceof Date && (t["x-constraint"] = {
...t["x-constraint"],
min: r.toISOString()
}), t;
}
},
timestamp: { method(e = "javascript") {
return s(["javascript", "unix"].includes(e), "\"type\" must be one of \"javascript, unix\""), this.format(e);
} }
},
cast: {
number: {
from: i.isDate,
to: (e, t) => e.getTime()
},
string: {
from: i.isDate,
to: (e, { prefs: t }) => o.date(e, t)
}
},
messages: {
"date.base": "{{#label}} must be a valid date",
"date.format": "{{#label}} must be in {msg(\"date.format.\" + #format) || #format} format",
"date.greater": "{{#label}} must be greater than {{:#limit}}",
"date.less": "{{#label}} must be less than {{:#limit}}",
"date.max": "{{#label}} must be less than or equal to {{:#limit}}",
"date.min": "{{#label}} must be greater than or equal to {{:#limit}}",
"date.format.iso": "ISO 8601 date",
"date.format.javascript": "timestamp or number of milliseconds",
"date.format.unix": "timestamp or number of seconds"
}
}), i.parse = function(e, t) {
if (e instanceof Date) return e;
if ("string" != typeof e && (isNaN(e) || !isFinite(e))) return null;
if (/^\s*$/.test(e)) return null;
if ("iso" === t) return a.isIsoDate(e) ? i.date(e.toString()) : null;
const r = e;
if ("string" == typeof e && /^[+-]?\d+(\.\d+)?$/.test(e) && (e = parseFloat(e)), t) {
if ("javascript" === t) return i.date(1 * e);
if ("unix" === t) return i.date(1e3 * e);
if ("string" == typeof r) return null;
}
return i.date(e);
}, i.date = function(e) {
const t = new Date(e);
return isNaN(t.getTime()) ? null : t;
};
},
4840(e, t, r) {
"use strict";
const { assert: s } = r(3115);
e.exports = r(2888).extend({
type: "function",
properties: { typeof: "function" },
rules: {
arity: {
method(e) {
return s(Number.isSafeInteger(e) && e >= 0, "n must be a positive integer"), this.$_addRule({
name: "arity",
args: { n: e }
});
},
validate: (e, t, { n: r }) => e.length === r ? e : t.error("function.arity", { n: r })
},
class: {
method() {
return this.$_addRule("class");
},
validate: (e, t) => /^\s*class\s/.test(e.toString()) ? e : t.error("function.class", { value: e })
},
minArity: {
method(e) {
return s(Number.isSafeInteger(e) && e > 0, "n must be a strict positive integer"), this.$_addRule({
name: "minArity",
args: { n: e }
});
},
validate: (e, t, { n: r }) => e.length >= r ? e : t.error("function.minArity", { n: r })
},
maxArity: {
method(e) {
return s(Number.isSafeInteger(e) && e >= 0, "n must be a positive integer"), this.$_addRule({
name: "maxArity",
args: { n: e }
});
},
validate: (e, t, { n: r }) => e.length <= r ? e : t.error("function.maxArity", { n: r })
}
},
messages: {
"function.arity": "{{#label}} must have an arity of {{#n}}",
"function.class": "{{#label}} must be a class",
"function.maxArity": "{{#label}} must have an arity lesser or equal to {{#n}}",
"function.minArity": "{{#label}} must have an arity greater or equal to {{#n}}"
}
});
},
2888(e, t, r) {
"use strict";
const { applyToDefaults: s, assert: n, clone: a } = r(3115), o = r(8248), i = r(680), l = r(9415), c = r(3541), u = r(8013), f = r(8529), m = r(1532), h = { renameDefaults: {
alias: !1,
multiple: !1,
override: !1
} };
e.exports = i.extend({
type: "_keys",
properties: { typeof: "object" },
flags: { unknown: { default: void 0 } },
terms: {
dependencies: { init: null },
keys: {
init: null,
manifest: { mapped: {
from: "schema",
to: "key"
} }
},
patterns: { init: null },
renames: { init: null }
},
args: (e, t) => e.keys(t),
jsonSchema(e, t, r, s) {
if (t.type = "object", e.$_terms.keys) {
t.properties = {};
const n = [];
for (const a of e.$_terms.keys) {
const e = a.schema.$_jsonSchema(r, s);
t.properties[a.key] = e, a.schema._flags.id && (s.$defs[a.schema._flags.id] = e), ("required" === a.schema._flags.presence || "output" === r && void 0 !== a.schema._flags.default) && n.push(a.key);
}
n.length && (t.required = n.sort());
}
if (e.$_terms.patterns) {
const n = {};
for (const a of e.$_terms.patterns) a.regex ? n[a.regex.source] = a.rule.$_jsonSchema(r, s) : "any" === a.schema.type ? t.additionalProperties = a.rule.$_jsonSchema(r, s) : n[".*"] = a.rule.$_jsonSchema(r, s);
Object.keys(n).length && (t.patternProperties = n);
}
return void 0 === t.additionalProperties && !1 == (!0 === e._flags.unknown || void 0 === e._flags.unknown && !e.$_terms.keys && !e.$_terms.patterns && !e._flags.only) && (t.additionalProperties = !1), t;
},
validate(e, { schema: t, error: r, state: s, prefs: n }) {
if (!e || typeof e !== t.$_property("typeof") || Array.isArray(e)) return {
value: e,
errors: r("object.base", { type: t.$_property("typeof") })
};
if (!(t.$_terms.renames || t.$_terms.dependencies || t.$_terms.keys || t.$_terms.patterns || t.$_terms.externals)) return;
e = h.clone(e, n);
const a = [];
if (t.$_terms.renames && !h.rename(t, e, s, n, a)) return {
value: e,
errors: a
};
if (!t.$_terms.keys && !t.$_terms.patterns && !t.$_terms.dependencies) return {
value: e,
errors: a
};
const o = new Set(Object.keys(e));
if (t.$_terms.keys) {
const r = [e, ...s.ancestors];
for (const i of t.$_terms.keys) {
const t = i.key, l = e[t];
o.delete(t);
const c = s.localize([...s.path, t], r, i), u = i.schema.$_validate(l, c, n);
if (u.errors) {
if (n.abortEarly) return {
value: e,
errors: u.errors
};
void 0 !== u.value && (e[t] = u.value), a.push(...u.errors);
} else "strip" === i.schema._flags.result || void 0 === u.value && void 0 !== l ? delete e[t] : void 0 !== u.value && (e[t] = u.value);
}
}
if (o.size || t._flags._hasPatternMatch) {
const r = h.unknown(t, e, o, a, s, n);
if (r) return r;
}
if (t.$_terms.dependencies) for (const r of t.$_terms.dependencies) {
if (null !== r.key && !1 === h.isPresent(r.options)(r.key.resolve(e, s, n, null, { shadow: !1 }))) continue;
const o = h.dependencies[r.rel](t, r, e, s, n);
if (o) {
const r = t.$_createError(o.code, e, o.context, s, n);
if (n.abortEarly) return {
value: e,
errors: r
};
a.push(r);
}
}
return {
value: e,
errors: a
};
},
rules: {
and: { method(...e) {
return l.verifyFlat(e, "and"), h.dependency(this, "and", null, e);
} },
append: { method(e) {
return null == e || 0 === Object.keys(e).length ? this : this.keys(e);
} },
assert: {
method(e, t, r) {
m.isTemplate(e) || (e = c.ref(e)), n(void 0 === r || "string" == typeof r, "Message must be a string"), t = this.$_compile(t, { appendPath: !0 });
const s = this.$_addRule({
name: "assert",
args: {
subject: e,
schema: t,
message: r
}
});
return s.$_mutateRegister(e), s.$_mutateRegister(t), s;
},
validate(e, { error: t, prefs: r, state: s }, { subject: n, schema: a, message: o }) {
const i = n.resolve(e, s, r), l = f.isRef(n) ? n.absolute(s) : [];
return a.$_match(i, s.localize(l, [e, ...s.ancestors], a), r) ? e : t("object.assert", {
subject: n,
message: o
});
},
args: [
"subject",
"schema",
"message"
],
multi: !0
},
instance: {
method(e, t) {
return n("function" == typeof e, "constructor must be a function"), t = t || e.name, this.$_addRule({
name: "instance",
args: {
constructor: e,
name: t
}
});
},
validate: (e, t, { constructor: r, name: s }) => e instanceof r ? e : t.error("object.instance", {
type: s,
value: e
}),
args: ["constructor", "name"]
},
keys: { method(e) {
n(void 0 === e || "object" == typeof e, "Object schema must be a valid object"), n(!l.isSchema(e), "Object schema cannot be a joi schema");
const t = this.clone();
if (e) if (Object.keys(e).length) {
t.$_terms.keys = t.$_terms.keys ? t.$_terms.keys.filter((t) => !e.hasOwnProperty(t.key)) : new h.Keys();
for (const r of Object.keys(e)) l.tryWithPath(() => t.$_terms.keys.push({
key: r,
schema: this.$_compile(e[r])
}), r);
} else t.$_terms.keys = new h.Keys();
else t.$_terms.keys = null;
return t.$_mutateRebuild();
} },
length: {
method(e) {
return this.$_addRule({
name: "length",
args: { limit: e },
operator: "="
});
},
validate: (e, t, { limit: r }, { name: s, operator: n, args: a }) => l.compare(Object.keys(e).length, r, n) ? e : t.error("object." + s, {
limit: a.limit,
value: e
}),
jsonSchema: (e, t) => (t.minProperties = e.args.limit, t.maxProperties = e.args.limit, t),
args: [{
name: "limit",
ref: !0,
assert: l.limit,
message: "must be a positive integer"
}]
},
max: {
method(e) {
return this.$_addRule({
name: "max",
method: "length",
args: { limit: e },
operator: "<="
});
},
jsonSchema: (e, t) => (t.maxProperties = e.args.limit, t)
},
min: {
method(e) {
return this.$_addRule({
name: "min",
method: "length",
args: { limit: e },
operator: ">="
});
},
jsonSchema: (e, t) => (t.minProperties = e.args.limit, t)
},
nand: { method(...e) {
return l.verifyFlat(e, "nand"), h.dependency(this, "nand", null, e);
} },
or: { method(...e) {
return l.verifyFlat(e, "or"), h.dependency(this, "or", null, e);
} },
oxor: { method(...e) {
return h.dependency(this, "oxor", null, e);
} },
pattern: { method(e, t, r = {}) {
const s = e instanceof RegExp;
s || (e = this.$_compile(e, { appendPath: !0 })), n(void 0 !== t, "Invalid rule"), l.assertOptions(r, ["fallthrough", "matches"]), s && n(!e.flags.includes("g") && !e.flags.includes("y"), "pattern should not use global or sticky mode"), t = this.$_compile(t, { appendPath: !0 });
const a = this.clone();
a.$_terms.patterns = a.$_terms.patterns || [];
const o = {
[s ? "regex" : "schema"]: e,
rule: t
};
return r.matches && (o.matches = this.$_compile(r.matches), "array" !== o.matches.type && (o.matches = o.matches.$_root.array().items(o.matches)), a.$_mutateRegister(o.matches), a.$_setFlag("_hasPatternMatch", !0, { clone: !1 })), r.fallthrough && (o.fallthrough = !0), a.$_terms.patterns.push(o), a.$_mutateRegister(t), a;
} },
ref: {
method() {
return this.$_addRule("ref");
},
validate: (e, t) => f.isRef(e) ? e : t.error("object.refType", { value: e })
},
regex: {
method() {
return this.$_addRule("regex");
},
validate: (e, t) => e instanceof RegExp ? e : t.error("object.regex", { value: e })
},
rename: { method(e, t, r = {}) {
n("string" == typeof e || e instanceof RegExp, "Rename missing the from argument"), n("string" == typeof t || t instanceof m, "Invalid rename to argument"), n(t !== e, "Cannot rename key to same name:", e), l.assertOptions(r, [
"alias",
"ignoreUndefined",
"override",
"multiple"
]);
const a = this.clone();
a.$_terms.renames = a.$_terms.renames || [];
for (const t of a.$_terms.renames) n(t.from !== e, "Cannot rename the same key multiple times");
return t instanceof m && a.$_mutateRegister(t), a.$_terms.renames.push({
from: e,
to: t,
options: s(h.renameDefaults, r)
}), a;
} },
schema: {
method(e = "any") {
return this.$_addRule({
name: "schema",
args: { type: e }
});
},
validate: (e, t, { type: r }) => !l.isSchema(e) || "any" !== r && e.type !== r ? t.error("object.schema", { type: r }) : e
},
unknown: { method(e) {
return this.$_setFlag("unknown", !1 !== e);
} },
with: { method(e, t, r = {}) {
return h.dependency(this, "with", e, t, r);
} },
without: { method(e, t, r = {}) {
return h.dependency(this, "without", e, t, r);
} },
xor: { method(...e) {
return l.verifyFlat(e, "xor"), h.dependency(this, "xor", null, e);
} }
},
overrides: {
default(e, t) {
return void 0 === e && (e = l.symbols.deepDefault), this.$_parent("default", e, t);
},
isAsync() {
var e, t, r;
if (null !== (e = this.$_terms.externals) && void 0 !== e && e.length) return !0;
if (null !== (t = this.$_terms.keys) && void 0 !== t && t.length) {
for (const e of this.$_terms.keys) if (e.schema.isAsync()) return !0;
}
if (null !== (r = this.$_terms.patterns) && void 0 !== r && r.length) {
for (const e of this.$_terms.patterns) if (e.rule.isAsync()) return !0;
}
return !1;
}
},
rebuild(e) {
e.$_terms.keys && (e.$_terms.keys = new h.Keys(...h.sortKeys(e.$_terms.keys)));
},
manifest: { build(e, t) {
if (t.keys && (e = e.keys(t.keys)), t.dependencies) for (const { rel: r, key: s = null, peers: n, options: a } of t.dependencies) e = h.dependency(e, r, s, n, a);
if (t.patterns) for (const { regex: r, schema: s, rule: n, fallthrough: a, matches: o } of t.patterns) e = e.pattern(r || s, n, {
fallthrough: a,
matches: o
});
if (t.renames) for (const { from: r, to: s, options: n } of t.renames) e = e.rename(r, s, n);
return e;
} },
messages: {
"object.and": "{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}",
"object.assert": "{{#label}} is invalid because {if(#subject.key, `\"` + #subject.key + `\" failed to ` + (#message || \"pass the assertion test\"), #message || \"the assertion failed\")}",
"object.base": "{{#label}} must be of type {{#type}}",
"object.instance": "{{#label}} must be an instance of {{:#type}}",
"object.length": "{{#label}} must have {{#limit}} key{if(#limit == 1, \"\", \"s\")}",
"object.max": "{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, \"\", \"s\")}",
"object.min": "{{#label}} must have at least {{#limit}} key{if(#limit == 1, \"\", \"s\")}",
"object.missing": "{{#label}} must contain at least one of {{#peersWithLabels}}",
"object.nand": "{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}",
"object.oxor": "{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}",
"object.pattern.match": "{{#label}} keys failed to match pattern requirements",
"object.refType": "{{#label}} must be a Joi reference",
"object.regex": "{{#label}} must be a RegExp object",
"object.rename.multiple": "{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}",
"object.rename.override": "{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists",
"object.rename.proto": "{{#label}} cannot rename {{:#from}} because target {{:#to}} is a reserved key",
"object.schema": "{{#label}} must be a Joi schema of {{#type}} type",
"object.unknown": "{{#label}} is not allowed",
"object.with": "{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}",
"object.without": "{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}",
"object.xor": "{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"
}
}), h.clone = function(e, t) {
if ("object" == typeof e) {
if (t.nonEnumerables) return a(e, { shallow: !0 });
const r = Object.getPrototypeOf(e), s = Object.create(r);
return Object.assign(s, e), Object.getPrototypeOf(s) !== r && Object.setPrototypeOf(s, r), s;
}
const r = function(...t) {
return e.apply(this, t);
};
return r.prototype = a(e.prototype), Object.defineProperty(r, "name", {
value: e.name,
writable: !1
}), Object.defineProperty(r, "length", {
value: e.length,
writable: !1
}), Object.assign(r, e), r;
}, h.dependency = function(e, t, r, s, a) {
n(null === r || "string" == typeof r, t, "key must be a strings"), a || (a = s.length > 1 && "object" == typeof s[s.length - 1] ? s.pop() : {}), l.assertOptions(a, ["separator", "isPresent"]), s = [].concat(s);
const o = l.default(a.separator, "."), i = [];
for (const e of s) n("string" == typeof e, t, "peers must be strings"), i.push(c.ref(e, {
separator: o,
ancestor: 0,
prefix: !1
}));
null !== r && (r = c.ref(r, {
separator: o,
ancestor: 0,
prefix: !1
}));
const u = e.clone();
return u.$_terms.dependencies = u.$_terms.dependencies || [], u.$_terms.dependencies.push(new h.Dependency(t, r, i, s, a)), u;
}, h.dependencies = {
and(e, t, r, s, n) {
const a = [], o = [], i = t.peers.length, l = h.isPresent(t.options);
for (const e of t.peers) !1 === l(e.resolve(r, s, n, null, { shadow: !1 })) ? a.push(e.key) : o.push(e.key);
if (a.length !== i && o.length !== i) return {
code: "object.and",
context: {
present: o,
presentWithLabels: h.keysToLabels(e, o),
missing: a,
missingWithLabels: h.keysToLabels(e, a)
}
};
},
nand(e, t, r, s, n) {
const a = [], o = h.isPresent(t.options);
for (const e of t.peers) o(e.resolve(r, s, n, null, { shadow: !1 })) && a.push(e.key);
if (a.length !== t.peers.length) return;
const i = t.paths[0], l = t.paths.slice(1);
return {
code: "object.nand",
context: {
main: i,
mainWithLabel: h.keysToLabels(e, i),
peers: l,
peersWithLabels: h.keysToLabels(e, l)
}
};
},
or(e, t, r, s, n) {
const a = h.isPresent(t.options);
for (const e of t.peers) if (a(e.resolve(r, s, n, null, { shadow: !1 }))) return;
return {
code: "object.missing",
context: {
peers: t.paths,
peersWithLabels: h.keysToLabels(e, t.paths)
}
};
},
oxor(e, t, r, s, n) {
const a = [], o = h.isPresent(t.options);
for (const e of t.peers) o(e.resolve(r, s, n, null, { shadow: !1 })) && a.push(e.key);
if (!a.length || 1 === a.length) return;
const i = {
peers: t.paths,
peersWithLabels: h.keysToLabels(e, t.paths)
};
return i.present = a, i.presentWithLabels = h.keysToLabels(e, a), {
code: "object.oxor",
context: i
};
},
with(e, t, r, s, n) {
const a = h.isPresent(t.options);
for (const o of t.peers) if (!1 === a(o.resolve(r, s, n, null, { shadow: !1 }))) return {
code: "object.with",
context: {
main: t.key.key,
mainWithLabel: h.keysToLabels(e, t.key.key),
peer: o.key,
peerWithLabel: h.keysToLabels(e, o.key)
}
};
},
without(e, t, r, s, n) {
const a = h.isPresent(t.options);
for (const o of t.peers) if (a(o.resolve(r, s, n, null, { shadow: !1 }))) return {
code: "object.without",
context: {
main: t.key.key,
mainWithLabel: h.keysToLabels(e, t.key.key),
peer: o.key,
peerWithLabel: h.keysToLabels(e, o.key)
}
};
},
xor(e, t, r, s, n) {
const a = [], o = h.isPresent(t.options);
for (const e of t.peers) o(e.resolve(r, s, n, null, { shadow: !1 })) && a.push(e.key);
if (1 === a.length) return;
const i = {
peers: t.paths,
peersWithLabels: h.keysToLabels(e, t.paths)
};
return 0 === a.length ? {
code: "object.missing",
context: i
} : (i.present = a, i.presentWithLabels = h.keysToLabels(e, a), {
code: "object.xor",
context: i
});
}
}, h.sortKeys = function(e, t = !0) {
const r = new o.Sorter();
for (const s of e) l.tryWithPath(() => r.add(s, {
after: s.schema.$_rootReferences(),
group: s.key,
manual: t
}), s.key);
try {
return r.sort();
} catch {
return h.sortKeys(e, !1);
}
}, h.keysToLabels = function(e, t) {
return Array.isArray(t) ? t.map((t) => e.$_mapLabels(t)) : e.$_mapLabels(t);
}, h.isPresent = function(e) {
return "function" == typeof e.isPresent ? e.isPresent : (e) => void 0 !== e;
}, h.rename = function(e, t, r, s, n) {
const a = {};
for (const o of e.$_terms.renames) {
const i = [], l = "string" != typeof o.from;
if (l) for (const e of Object.keys(t)) {
if (void 0 === t[e] && o.options.ignoreUndefined) continue;
if (e === o.to) continue;
const r = o.from.exec(e);
r && i.push({
from: e,
to: o.to,
match: r
});
}
else !Object.prototype.hasOwnProperty.call(t, o.from) || void 0 === t[o.from] && o.options.ignoreUndefined || i.push(o);
for (const c of i) {
const i = c.from;
let u = c.to;
if (u instanceof m && (u = u.render(t, r, s, c.match)), i !== u) {
if (!o.options.multiple && a[u] && (n.push(e.$_createError("object.rename.multiple", t, {
from: i,
to: u,
pattern: l
}, r, s)), s.abortEarly)) return !1;
if (Object.prototype.hasOwnProperty.call(t, u) && !o.options.override && !a[u] && (n.push(e.$_createError("object.rename.override", t, {
from: i,
to: u,
pattern: l
}, r, s)), s.abortEarly)) return !1;
if ("__proto__" !== u) void 0 === t[i] ? delete t[u] : t[u] = t[i], a[u] = !0, o.options.alias || delete t[i];
else if (n.push(e.$_createError("object.rename.proto", t, {
from: i,
to: u,
pattern: l
}, r, s)), s.abortEarly) return !1;
}
}
}
return !0;
}, h.unknown = function(e, t, r, s, n, a) {
if (e.$_terms.patterns) {
let o = !1;
const i = e.$_terms.patterns.map((e) => {
if (e.matches) return o = !0, [];
}), l = [t, ...n.ancestors];
for (const o of r) {
const c = t[o], u = [...n.path, o];
for (let f = 0; f < e.$_terms.patterns.length; ++f) {
const m = e.$_terms.patterns[f];
if (m.regex) {
const e = m.regex.test(o);
if (n.mainstay.tracer.debug(n, "rule", `pattern.${f}`, e ? "pass" : "error"), !e) continue;
} else if (!m.schema.$_match(o, n.nest(m.schema, `pattern.${f}`), a)) continue;
r.delete(o);
const h = n.localize(u, l, {
schema: m.rule,
key: o
}), p = m.rule.$_validate(c, h, a);
if (p.errors) {
if (a.abortEarly) return {
value: t,
errors: p.errors
};
s.push(...p.errors);
}
if (m.matches && i[f].push(o), t[o] = p.value, !m.fallthrough) break;
}
}
if (o) for (let r = 0; r < i.length; ++r) {
const o = i[r];
if (!o) continue;
const c = e.$_terms.patterns[r].matches, f = n.localize(n.path, l, c), m = c.$_validate(o, f, a);
if (m.errors) {
const r = u.details(m.errors, { override: !1 });
r.matches = o;
const i = e.$_createError("object.pattern.match", t, r, n, a);
if (a.abortEarly) return {
value: t,
errors: i
};
s.push(i);
}
}
}
if (r.size && (e.$_terms.keys || e.$_terms.patterns)) {
if (a.stripUnknown && void 0 === e._flags.unknown || a.skipFunctions) {
const e = !(!a.stripUnknown || !0 !== a.stripUnknown && !a.stripUnknown.objects);
for (const s of r) e ? (delete t[s], r.delete(s)) : "function" == typeof t[s] && r.delete(s);
}
if (!l.default(e._flags.unknown, a.allowUnknown)) for (const o of r) {
const r = n.localize([...n.path, o], []), i = e.$_createError("object.unknown", t[o], { child: o }, r, a, { flags: !1 });
if (a.abortEarly) return {
value: t,
errors: i
};
s.push(i);
}
}
}, h.Dependency = class {
constructor(e, t, r, s, n) {
this.rel = e, this.key = t, this.peers = r, this.paths = s, this.options = n;
}
describe() {
const e = {
rel: this.rel,
peers: this.paths
};
return null !== this.key && (e.key = this.key.key), "." !== this.peers[0].separator && (e.options = {
...e.options,
separator: this.peers[0].separator
}), this.options.isPresent && (e.options = {
...e.options,
isPresent: this.options.isPresent
}), e;
}
}, h.Keys = class extends Array {
concat(e) {
const t = this.slice(), r = new Map();
for (let e = 0; e < t.length; ++e) r.set(t[e].key, e);
for (const s of e) {
const e = s.key, n = r.get(e);
void 0 !== n ? t[n] = {
key: e,
schema: t[n].schema.concat(s.schema)
} : t.push(s);
}
return t;
}
};
},
9556(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(680), a = r(9415), o = r(3541), i = r(8013), l = {};
e.exports = n.extend({
type: "link",
properties: { schemaChain: !0 },
terms: { link: {
init: null,
manifest: "single",
register: !1
} },
args: (e, t) => e.ref(t),
jsonSchema(e, t, r, s) {
if (!e.$_terms.link) return t;
const { ref: n } = e.$_terms.link[0];
return "root" === n.ancestor || n.ancestor > 0 ? (t.$ref = `#/${n.path.map((e) => `properties/${e}`).join("/")}`, t) : (1 === n.path.length ? t.$ref = `#/$defs/${n.path[0]}` : t.$ref = `#/${n.path.slice(1).map((e) => `properties/${e}`).join("/")}`, t);
},
validate(e, { schema: t, state: r, prefs: n, error: a }) {
s(t.$_terms.link, "Uninitialized link schema");
const o = t._flags.maxRecursion;
if (void 0 !== o && r.schemas.filter((e) => e.schema === t).length > o) return {
value: e,
errors: a("link.maxRecursion", { limit: o })
};
const i = l.generate(t, e, r, n), c = t.$_terms.link[0].ref;
try {
return i.$_validate(e, r.nest(i, `link:${c.display}:${i.type}`), n);
} catch (t) {
if (!(t instanceof RangeError)) throw t;
return {
value: e,
errors: a("link.depth")
};
}
},
generate: (e, t, r, s) => l.generate(e, t, r, s),
rules: {
ref: { method(e) {
s(!this.$_terms.link, "Cannot reinitialize schema"), e = o.ref(e), s("value" === e.type || "local" === e.type, "Invalid reference type:", e.type), s("local" === e.type || "root" === e.ancestor || e.ancestor > 0, "Link cannot reference itself");
const t = this.clone();
return t.$_terms.link = [{ ref: e }], t;
} },
relative: { method(e = !0) {
return this.$_setFlag("relative", e);
} },
maxRecursion: { method(e) {
return s(Number.isSafeInteger(e) && e >= 1, "limit must be a positive integer"), this.$_setFlag("maxRecursion", e);
} }
},
messages: {
"link.depth": "{{#label}} exceeds maximum recursion depth supported by the runtime",
"link.maxRecursion": "{{#label}} exceeds maximum recursion depth of {{#limit}}"
},
overrides: { concat(e) {
s(this.$_terms.link, "Uninitialized link schema"), s(a.isSchema(e), "Invalid schema object"), s("link" !== e.type, "Cannot merge type link with another link");
const t = this.clone();
return t.$_terms.whens || (t.$_terms.whens = []), t.$_terms.whens.push({ concat: e }), t.$_mutateRebuild();
} },
manifest: { build: (e, t) => (s(t.link, "Invalid link description missing link"), e.ref(t.link)) }
}), l.generate = function(e, t, r, s) {
let n = r.mainstay.links.get(e);
if (n) return n._generate(t, r, s).schema;
const a = e.$_terms.link[0].ref, { perspective: o, path: i } = l.perspective(a, r);
l.assert(o, "which is outside of schema boundaries", a, e, r, s);
try {
n = i.length ? o.$_reach(i) : o;
} catch {
l.assert(!1, "to non-existing schema", a, e, r, s);
}
return l.assert("link" !== n.type, "which is another link", a, e, r, s), e._flags.relative || r.mainstay.links.set(e, n), n._generate(t, r, s).schema;
}, l.perspective = function(e, t) {
if ("local" === e.type) {
for (const { schema: r, key: s } of t.schemas) {
if ((r._flags.id || s) === e.path[0]) return {
perspective: r,
path: e.path.slice(1)
};
if (r.$_terms.shared) {
for (const t of r.$_terms.shared) if (t._flags.id === e.path[0]) return {
perspective: t,
path: e.path.slice(1)
};
}
}
return {
perspective: null,
path: null
};
}
return "root" === e.ancestor ? {
perspective: t.schemas[t.schemas.length - 1].schema,
path: e.path
} : {
perspective: t.schemas[e.ancestor] && t.schemas[e.ancestor].schema,
path: e.path
};
}, l.assert = function(e, t, r, n, a, o) {
e || s(!1, `"${i.label(n._flags, a, o)}" contains link reference "${r.display}" ${t}`);
};
},
4709(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(680), a = r(9415), o = {
numberRx: /^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,
precisionRx: /(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,
exponentialPartRegex: /[eE][+-]?\d+$/,
leadingSignAndZerosRegex: /^[+-]?(0*)?/,
dotRegex: /\./,
trailingZerosRegex: /0+$/,
decimalPlaces(e) {
const t = e.toString(), r = t.indexOf("."), s = t.indexOf("e");
return (r < 0 ? 0 : (s < 0 ? t.length : s) - r - 1) + (s < 0 ? 0 : Math.max(0, -parseInt(t.slice(s + 1))));
}
};
e.exports = n.extend({
type: "number",
flags: { unsafe: { default: !1 } },
coerce: {
from: "string",
method(e, { schema: t, error: r }) {
if (!e.match(o.numberRx)) return;
e = e.trim();
const s = { value: parseFloat(e) };
if (0 === s.value && (s.value = 0), !t._flags.unsafe) if (e.match(/e/i)) {
if (o.extractSignificantDigits(e) !== o.extractSignificantDigits(String(s.value))) return s.errors = r("number.unsafe"), s;
} else {
const t = s.value.toString();
if (t.match(/e/i)) return s;
if (t !== o.normalizeDecimal(e)) return s.errors = r("number.unsafe"), s;
}
return s;
}
},
validate(e, { schema: t, error: r, prefs: s }) {
if (e === 1 / 0 || e === -1 / 0) return {
value: e,
errors: r("number.infinity")
};
if (!a.isNumber(e)) return {
value: e,
errors: r("number.base")
};
const n = { value: e };
if (s.convert) {
const e = t.$_getRule("precision");
if (e) {
const t = Math.pow(10, e.args.limit);
n.value = Math.round(n.value * t) / t;
}
}
return 0 === n.value && (n.value = 0), !t._flags.unsafe && (e > Number.MAX_SAFE_INTEGER || e < Number.MIN_SAFE_INTEGER) && (n.errors = r("number.unsafe")), n;
},
rules: {
compare: {
method: !1,
validate: (e, t, { limit: r }, { name: s, operator: n, args: o }) => a.compare(e, r, n) ? e : t.error("number." + s, {
limit: o.limit,
value: e
}),
args: [{
name: "limit",
ref: !0,
assert: a.isNumber,
message: "must be a number"
}]
},
greater: {
method(e) {
return this.$_addRule({
name: "greater",
method: "compare",
args: { limit: e },
operator: ">"
});
},
jsonSchema: (e, t) => (t.exclusiveMinimum = e.args.limit, t)
},
integer: {
method() {
return this.$_addRule("integer");
},
validate: (e, t) => Math.trunc(e) - e === 0 ? e : t.error("number.integer"),
jsonSchema: (e, t) => (t.type = "integer", t)
},
less: {
method(e) {
return this.$_addRule({
name: "less",
method: "compare",
args: { limit: e },
operator: "<"
});
},
jsonSchema: (e, t) => (t.exclusiveMaximum = e.args.limit, t)
},
max: {
method(e) {
return this.$_addRule({
name: "max",
method: "compare",
args: { limit: e },
operator: "<="
});
},
jsonSchema: (e, t) => (t.maximum = e.args.limit, t)
},
min: {
method(e) {
return this.$_addRule({
name: "min",
method: "compare",
args: { limit: e },
operator: ">="
});
},
jsonSchema: (e, t) => (t.minimum = e.args.limit, t)
},
multiple: {
method(e) {
const t = "number" == typeof e ? o.decimalPlaces(e) : null, r = Math.pow(10, t);
return this.$_addRule({
name: "multiple",
args: {
base: e,
baseDecimalPlace: t,
pfactor: r
}
});
},
validate: (e, t, { base: r, baseDecimalPlace: s, pfactor: n }, a) => o.decimalPlaces(e) > s ? t.error("number.multiple", {
multiple: a.args.base,
value: e
}) : Math.round(n * e) % Math.round(n * r) === 0 ? e : t.error("number.multiple", {
multiple: a.args.base,
value: e
}),
jsonSchema: (e, t) => (t.multipleOf = e.args.base, t),
args: [
{
name: "base",
ref: !0,
assert: (e) => "number" == typeof e && isFinite(e) && e > 0,
message: "must be a positive number"
},
"baseDecimalPlace",
"pfactor"
],
multi: !0
},
negative: { method() {
return this.sign("negative");
} },
port: {
method() {
return this.$_addRule("port");
},
validate: (e, t) => Number.isSafeInteger(e) && e >= 0 && e <= 65535 ? e : t.error("number.port"),
jsonSchema: (e, t) => (t.type = "integer", t.minimum = 0, t.maximum = 65535, t)
},
positive: { method() {
return this.sign("positive");
} },
precision: {
method(e) {
return s(Number.isSafeInteger(e), "limit must be an integer"), this.$_addRule({
name: "precision",
args: { limit: e }
});
},
validate(e, t, { limit: r }) {
const s = e.toString().match(o.precisionRx);
return Math.max((s[1] ? s[1].length : 0) - (s[2] ? parseInt(s[2], 10) : 0), 0) <= r ? e : t.error("number.precision", {
limit: r,
value: e
});
},
convert: !0
},
sign: {
method(e) {
return s(["negative", "positive"].includes(e), "Invalid sign", e), this.$_addRule({
name: "sign",
args: { sign: e }
});
},
validate: (e, t, { sign: r }) => "negative" === r && e < 0 || "positive" === r && e > 0 ? e : t.error(`number.${r}`),
jsonSchema: (e, t) => ("positive" === e.args.sign ? t.exclusiveMinimum = 0 : t.exclusiveMaximum = 0, t)
},
unsafe: { method(e = !0) {
return s("boolean" == typeof e, "enabled must be a boolean"), this.$_setFlag("unsafe", e);
} }
},
cast: { string: {
from: (e) => "number" == typeof e,
to: (e, t) => e.toString()
} },
messages: {
"number.base": "{{#label}} must be a number",
"number.greater": "{{#label}} must be greater than {{#limit}}",
"number.infinity": "{{#label}} cannot be infinity",
"number.integer": "{{#label}} must be an integer",
"number.less": "{{#label}} must be less than {{#limit}}",
"number.max": "{{#label}} must be less than or equal to {{#limit}}",
"number.min": "{{#label}} must be greater than or equal to {{#limit}}",
"number.multiple": "{{#label}} must be a multiple of {{#multiple}}",
"number.negative": "{{#label}} must be a negative number",
"number.port": "{{#label}} must be a valid port",
"number.positive": "{{#label}} must be a positive number",
"number.precision": "{{#label}} must have no more than {{#limit}} decimal places",
"number.unsafe": "{{#label}} must be a safe number"
}
}), o.extractSignificantDigits = function(e) {
return e.replace(o.exponentialPartRegex, "").replace(o.dotRegex, "").replace(o.trailingZerosRegex, "").replace(o.leadingSignAndZerosRegex, "");
}, o.normalizeDecimal = function(e) {
return (e = e.replace(/^\+/, "").replace(/\.0*$/, "").replace(/^(-?)\.([^\.]*)$/, "$10.$2").replace(/^(-?)0+([0-9])/, "$1$2")).includes(".") && e.endsWith("0") && (e = e.replace(/0+$/, "")), "-0" === e ? "0" : e;
};
},
7487(e, t, r) {
"use strict";
e.exports = r(2888).extend({
type: "object",
cast: { map: {
from: (e) => e && "object" == typeof e,
to: (e, t) => new Map(Object.entries(e))
} }
});
},
9033(e, t, r) {
"use strict";
const { assert: s, escapeRegex: n } = r(3115), { isDomainValid: a, isEmailValid: o, ipRegex: i, uriRegex: l } = r(9089), c = r(7368), u = r(680), f = r(9415), m = {
tlds: c.tlds instanceof Set && { tlds: {
allow: c.tlds,
deny: null
} },
base64Regex: {
true: {
true: /^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,
false: /^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/
},
false: {
true: /^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,
false: /^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/
}
},
dataUriRegex: /^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,
hexRegex: {
withPrefix: /^0x[0-9a-f]+$/i,
withOptionalPrefix: /^(?:0x)?[0-9a-f]+$/i,
withoutPrefix: /^[0-9a-f]+$/i
},
ipRegex: i({ cidr: "forbidden" }).regex,
isoDurationRegex: /^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,
guidBrackets: {
"{": "}",
"[": "]",
"(": ")",
"": ""
},
guidVersions: {
uuidv1: "1",
uuidv2: "2",
uuidv3: "3",
uuidv4: "4",
uuidv5: "5",
uuidv6: "6",
uuidv7: "7",
uuidv8: "8"
},
guidSeparators: new Set([
void 0,
!0,
!1,
"-",
":"
]),
normalizationForms: [
"NFC",
"NFD",
"NFKC",
"NFKD"
]
};
e.exports = u.extend({
type: "string",
flags: {
insensitive: { default: !1 },
truncate: { default: !1 }
},
terms: { replacements: { init: null } },
coerce: {
from: "string",
method(e, { schema: t, state: r, prefs: s }) {
const n = t.$_getRule("normalize");
n && (e = e.normalize(n.args.form));
const a = t.$_getRule("case");
a && (e = "upper" === a.args.direction ? e.toLocaleUpperCase() : e.toLocaleLowerCase());
const o = t.$_getRule("trim");
if (o && o.args.enabled && (e = e.trim()), t.$_terms.replacements) for (const r of t.$_terms.replacements) e = e.replace(r.pattern, r.replacement);
const i = t.$_getRule("hex");
if (i && i.args.options.byteAligned && e.length % 2 != 0 && (e = `0${e}`), t.$_getRule("isoDate")) {
const t = m.isoDate(e);
t && (e = t);
}
if (t._flags.truncate) {
const n = t.$_getRule("max");
if (n) {
let a = n.args.limit;
if (f.isResolvable(a) && (a = a.resolve(e, r, s), !f.limit(a))) return {
value: e,
errors: t.$_createError("any.ref", a, {
ref: n.args.limit,
arg: "limit",
reason: "must be a positive integer"
}, r, s)
};
e = e.slice(0, a);
}
}
return { value: e };
}
},
validate(e, { schema: t, error: r }) {
if ("string" != typeof e) return {
value: e,
errors: r("string.base")
};
if ("" === e) {
const s = t.$_getRule("min");
if (s && 0 === s.args.limit) return;
return {
value: e,
errors: r("string.empty")
};
}
},
jsonSchema(e, t, r, s) {
var n;
if (!(null !== (n = e._valids) && void 0 !== n && n.has("") || e._flags.only)) {
const r = e.$_getRule("min"), s = e.$_getRule("length");
(!r || r.args.limit > 0) && (!s || s.args.limit > 0) && (t.minLength = 1);
}
return t;
},
rules: {
alphanum: {
method() {
return this.$_addRule("alphanum");
},
validate: (e, t) => /^[a-zA-Z0-9]+$/.test(e) ? e : t.error("string.alphanum")
},
base64: {
method(e = {}) {
return f.assertOptions(e, ["paddingRequired", "urlSafe"]), e = {
urlSafe: !1,
paddingRequired: !0,
...e
}, s("boolean" == typeof e.paddingRequired, "paddingRequired must be boolean"), s("boolean" == typeof e.urlSafe, "urlSafe must be boolean"), this.$_addRule({
name: "base64",
args: { options: e }
});
},
validate: (e, t, { options: r }) => m.base64Regex[r.paddingRequired][r.urlSafe].test(e) ? e : t.error("string.base64"),
jsonSchema: (e, t) => (t.format = "base64", t)
},
case: {
method(e) {
return s(["lower", "upper"].includes(e), "Invalid case:", e), this.$_addRule({
name: "case",
args: { direction: e }
});
},
validate: (e, t, { direction: r }) => "lower" === r && e === e.toLocaleLowerCase() || "upper" === r && e === e.toLocaleUpperCase() ? e : t.error(`string.${r}case`),
convert: !0
},
creditCard: {
method() {
return this.$_addRule("creditCard");
},
validate(e, t) {
let r = e.length, s = 0, n = 1;
for (; r--;) {
const t = e.charAt(r) * n;
s += t - 9 * (t > 9), n ^= 3;
}
return s > 0 && s % 10 == 0 ? e : t.error("string.creditCard");
}
},
dataUri: {
method(e = {}) {
return f.assertOptions(e, ["paddingRequired"]), e = {
paddingRequired: !0,
...e
}, s("boolean" == typeof e.paddingRequired, "paddingRequired must be boolean"), this.$_addRule({
name: "dataUri",
args: { options: e }
});
},
validate(e, t, { options: r }) {
const s = e.match(m.dataUriRegex);
if (s) {
if (!s[2]) return e;
if ("base64" !== s[2]) return e;
if (m.base64Regex[r.paddingRequired].false.test(s[3])) return e;
}
return t.error("string.dataUri");
},
jsonSchema: (e, t) => (t.format = "data-uri", t)
},
domain: {
method(e) {
e && f.assertOptions(e, [
"allowFullyQualified",
"allowUnicode",
"allowUnderscore",
"maxDomainSegments",
"minDomainSegments",
"tlds"
]);
const t = m.addressOptions(e);
return this.$_addRule({
name: "domain",
args: { options: e },
address: t
});
},
validate: (e, t, r, { address: s }) => a(e, s) ? e : t.error("string.domain")
},
email: {
method(e = {}) {
f.assertOptions(e, [
"allowFullyQualified",
"allowUnicode",
"allowUnderscore",
"ignoreLength",
"maxDomainSegments",
"minDomainSegments",
"multiple",
"separator",
"tlds"
]), s(void 0 === e.multiple || "boolean" == typeof e.multiple, "multiple option must be an boolean");
const t = m.addressOptions(e), r = new RegExp(`\\s*[${e.separator ? n(e.separator) : ","}]\\s*`);
return this.$_addRule({
name: "email",
args: { options: e },
regex: r,
address: t
});
},
validate(e, t, { options: r }, { regex: s, address: n }) {
const a = r.multiple ? e.split(s) : [e], i = [];
for (const e of a) o(e, n) || i.push(e);
return i.length ? t.error("string.email", {
value: e,
invalids: i
}) : e;
},
jsonSchema: (e, t) => (t.format = "email", t)
},
guid: {
alias: "uuid",
method(e = {}) {
f.assertOptions(e, [
"version",
"separator",
"wrapper"
]), s(void 0 === e.wrapper || "boolean" == typeof e.wrapper || "string" == typeof e.wrapper && "string" == typeof m.guidBrackets[e.wrapper], `"wrapper" must be true, false, or one of "${Object.keys(m.guidBrackets).filter(Boolean).join("\", \"")}"`);
let t = "";
if (e.version) {
const r = [].concat(e.version);
s(r.length >= 1, "version must have at least 1 valid version specified");
const n = new Set();
for (let e = 0; e < r.length; ++e) {
const a = r[e];
s("string" == typeof a, "version at position " + e + " must be a string");
const o = m.guidVersions[a.toLowerCase()];
s(o, "version at position " + e + " must be one of " + Object.keys(m.guidVersions).join(", ")), s(!n.has(o), "version at position " + e + " must not be a duplicate"), t += o, n.add(o);
}
}
s(m.guidSeparators.has(e.separator), "separator must be one of true, false, \"-\", or \":\"");
const r = void 0 === e.separator ? "[:-]?" : !0 === e.separator ? "[:-]" : !1 === e.separator ? "[]?" : `\\${e.separator}`;
let a, o;
void 0 === e.wrapper ? (a = "[\\[{\\(]?", o = "[\\]}\\)]?") : !0 === e.wrapper ? (a = "[\\[{\\(]", o = "[\\]}\\)]") : !1 === e.wrapper ? (a = "", o = "") : (a = n(e.wrapper), o = n(m.guidBrackets[e.wrapper]));
const i = new RegExp(`^(${a})[0-9A-F]{8}(${r})[0-9A-F]{4}\\2?[${t || "0-9A-F"}][0-9A-F]{3}\\2?[${t ? "89AB" : "0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}(${o})$`, "i");
return this.$_addRule({
name: "guid",
args: { options: e },
regex: i
});
},
validate(e, t, r, { regex: s }) {
const n = s.exec(e);
if (!n) return t.error("string.guid");
const a = n[1], o = n[n.length - 1];
return (a || o) && m.guidBrackets[a] !== o ? t.error("string.guid") : e;
},
jsonSchema: (e, t) => (t.format = "uuid", t)
},
hex: {
method(e = {}) {
return f.assertOptions(e, ["byteAligned", "prefix"]), e = {
byteAligned: !1,
prefix: !1,
...e
}, s("boolean" == typeof e.byteAligned, "byteAligned must be boolean"), s("boolean" == typeof e.prefix || "optional" === e.prefix, "prefix must be boolean or \"optional\""), this.$_addRule({
name: "hex",
args: { options: e }
});
},
validate: (e, t, { options: r }) => ("optional" === r.prefix ? m.hexRegex.withOptionalPrefix : !0 === r.prefix ? m.hexRegex.withPrefix : m.hexRegex.withoutPrefix).test(e) ? r.byteAligned && e.length % 2 != 0 ? t.error("string.hexAlign") : e : t.error("string.hex"),
jsonSchema: (e, t) => (t.format = "hex", t)
},
hostname: {
method() {
return this.$_addRule("hostname");
},
validate: (e, t) => a(e, { minDomainSegments: 1 }) || m.ipRegex.test(e) ? e : t.error("string.hostname"),
jsonSchema: (e, t) => (t.format = "hostname", t)
},
insensitive: { method() {
return this.$_setFlag("insensitive", !0);
} },
ip: {
method(e = {}) {
f.assertOptions(e, ["cidr", "version"]);
const { cidr: t, versions: r, regex: s } = i(e), n = e.version ? r : void 0;
return this.$_addRule({
name: "ip",
args: { options: {
cidr: t,
version: n
} },
regex: s
});
},
validate: (e, t, { options: r }, { regex: s }) => s.test(e) ? e : r.version ? t.error("string.ipVersion", {
value: e,
cidr: r.cidr,
version: r.version
}) : t.error("string.ip", {
value: e,
cidr: r.cidr
}),
jsonSchema(e, t) {
const r = e.args.options.version;
return r && 1 === r.length ? t.format = r[0] : t.format = "ip", t;
}
},
isoDate: {
method() {
return this.$_addRule("isoDate");
},
validate: (e, { error: t }) => m.isoDate(e) ? e : t("string.isoDate"),
jsonSchema: (e, t) => (t.format = "date-time", t)
},
isoDuration: {
method() {
return this.$_addRule("isoDuration");
},
validate: (e, t) => m.isoDurationRegex.test(e) ? e : t.error("string.isoDuration"),
jsonSchema: (e, t) => (t.format = "duration", t)
},
length: {
method(e, t) {
return m.length(this, "length", e, "=", t);
},
validate(e, t, { limit: r, encoding: s }, { name: n, operator: a, args: o }) {
const i = !s && e.length;
return f.compare(i, r, a) ? e : t.error("string." + n, {
limit: o.limit,
value: e,
encoding: s
});
},
jsonSchema: (e, t) => (t.minLength = e.args.limit, t.maxLength = e.args.limit, t),
args: [{
name: "limit",
ref: !0,
assert: f.limit,
message: "must be a positive integer"
}, "encoding"]
},
lowercase: { method() {
return this.case("lower");
} },
max: {
method(e, t) {
return m.length(this, "max", e, "<=", t);
},
jsonSchema: (e, t) => (t.maxLength = e.args.limit, t),
args: ["limit", "encoding"]
},
min: {
method(e, t) {
return m.length(this, "min", e, ">=", t);
},
jsonSchema: (e, t) => (e.args.limit > 0 && (t.minLength = e.args.limit), t),
args: ["limit", "encoding"]
},
normalize: {
method(e = "NFC") {
return s(m.normalizationForms.includes(e), "normalization form must be one of " + m.normalizationForms.join(", ")), this.$_addRule({
name: "normalize",
args: { form: e }
});
},
validate: (e, { error: t }, { form: r }) => e === e.normalize(r) ? e : t("string.normalize", {
value: e,
form: r
}),
convert: !0
},
pattern: {
alias: "regex",
method(e, t = {}) {
s(e instanceof RegExp, "regex must be a RegExp"), s(!e.flags.includes("g") && !e.flags.includes("y"), "regex should not use global or sticky mode"), "string" == typeof t && (t = { name: t }), f.assertOptions(t, ["invert", "name"]);
const r = [
"string.pattern",
t.invert ? ".invert" : "",
t.name ? ".name" : ".base"
].join("");
return this.$_addRule({
name: "pattern",
args: {
regex: e,
options: t
},
errorCode: r
});
},
validate: (e, t, { regex: r, options: s }, { errorCode: n }) => r.test(e) ^ s.invert ? e : t.error(n, {
name: s.name,
regex: r,
value: e
}),
jsonSchema(e, t) {
const r = e.args.regex.source;
return t.allOf ? t.allOf.push({ pattern: r }) : void 0 !== t.pattern ? (t.allOf = [{ pattern: t.pattern }, { pattern: r }], delete t.pattern) : t.pattern = r, t;
},
args: ["regex", "options"],
multi: !0
},
replace: { method(e, t) {
"string" == typeof e && (e = new RegExp(n(e), "g")), s(e instanceof RegExp, "pattern must be a RegExp"), s("string" == typeof t, "replacement must be a String");
const r = this.clone();
return r.$_terms.replacements || (r.$_terms.replacements = []), r.$_terms.replacements.push({
pattern: e,
replacement: t
}), r;
} },
token: {
method() {
return this.$_addRule("token");
},
validate: (e, t) => /^\w+$/.test(e) ? e : t.error("string.token"),
jsonSchema: (e, t) => (t.format = "token", t)
},
trim: {
method(e = !0) {
return s("boolean" == typeof e, "enabled must be a boolean"), this.$_addRule({
name: "trim",
args: { enabled: e }
});
},
validate: (e, t, { enabled: r }) => r && e !== e.trim() ? t.error("string.trim") : e,
convert: !0
},
truncate: { method(e = !0) {
return s("boolean" == typeof e, "enabled must be a boolean"), this.$_setFlag("truncate", e);
} },
uppercase: { method() {
return this.case("upper");
} },
uri: {
method(e = {}) {
f.assertOptions(e, [
"allowRelative",
"allowQuerySquareBrackets",
"domain",
"relativeOnly",
"scheme",
"encodeUri"
]), e.domain && f.assertOptions(e.domain, [
"allowFullyQualified",
"allowUnicode",
"maxDomainSegments",
"minDomainSegments",
"tlds"
]);
const { regex: t, scheme: r } = l(e), s = e.domain ? m.addressOptions(e.domain) : null;
return this.$_addRule({
name: "uri",
args: { options: e },
regex: t,
domain: s,
scheme: r
});
},
validate(e, t, { options: r }, { regex: s, domain: n, scheme: o }) {
if (["http:/", "https:/"].includes(e)) return t.error("string.uri");
let i = s.exec(e);
if (!i && t.prefs.convert && r.encodeUri) {
const t = encodeURI(e);
i = s.exec(t), i && (e = t);
}
if (i) {
const s = i[1] || i[2];
return !n || r.allowRelative && !s || a(s, n) ? e : t.error("string.domain", { value: s });
}
return r.relativeOnly ? t.error("string.uriRelativeOnly") : r.scheme ? t.error("string.uriCustomScheme", {
scheme: o,
value: e
}) : t.error("string.uri");
},
jsonSchema: (e, t) => (t.format = "uri", t)
}
},
manifest: { build(e, t) {
if (t.replacements) for (const { pattern: r, replacement: s } of t.replacements) e = e.replace(r, s);
return e;
} },
messages: {
"string.alphanum": "{{#label}} must only contain alpha-numeric characters",
"string.base": "{{#label}} must be a string",
"string.base64": "{{#label}} must be a valid base64 string",
"string.creditCard": "{{#label}} must be a credit card",
"string.dataUri": "{{#label}} must be a valid dataUri string",
"string.domain": "{{#label}} must contain a valid domain name",
"string.email": "{{#label}} must be a valid email",
"string.empty": "{{#label}} is not allowed to be empty",
"string.guid": "{{#label}} must be a valid GUID",
"string.hex": "{{#label}} must only contain hexadecimal characters",
"string.hexAlign": "{{#label}} hex decoded representation must be byte aligned",
"string.hostname": "{{#label}} must be a valid hostname",
"string.ip": "{{#label}} must be a valid ip address with a {{#cidr}} CIDR",
"string.ipVersion": "{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR",
"string.isoDate": "{{#label}} must be in iso format",
"string.isoDuration": "{{#label}} must be a valid ISO 8601 duration",
"string.length": "{{#label}} length must be {{#limit}} characters long",
"string.lowercase": "{{#label}} must only contain lowercase characters",
"string.max": "{{#label}} length must be less than or equal to {{#limit}} characters long",
"string.min": "{{#label}} length must be at least {{#limit}} characters long",
"string.normalize": "{{#label}} must be unicode normalized in the {{#form}} form",
"string.token": "{{#label}} must only contain alpha-numeric and underscore characters",
"string.pattern.base": "{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}",
"string.pattern.name": "{{#label}} with value {:[.]} fails to match the {{#name}} pattern",
"string.pattern.invert.base": "{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}",
"string.pattern.invert.name": "{{#label}} with value {:[.]} matches the inverted {{#name}} pattern",
"string.trim": "{{#label}} must not have leading or trailing whitespace",
"string.uri": "{{#label}} must be a valid uri",
"string.uriCustomScheme": "{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern",
"string.uriRelativeOnly": "{{#label}} must be a valid relative uri",
"string.uppercase": "{{#label}} must only contain uppercase characters"
}
}), m.addressOptions = function(e) {
if (!e) return m.tlds || e;
if (s(void 0 === e.minDomainSegments || Number.isSafeInteger(e.minDomainSegments) && e.minDomainSegments > 0, "minDomainSegments must be a positive integer"), s(void 0 === e.maxDomainSegments || Number.isSafeInteger(e.maxDomainSegments) && e.maxDomainSegments > 0, "maxDomainSegments must be a positive integer"), !1 === e.tlds) return e;
if (!0 === e.tlds || void 0 === e.tlds) return s(m.tlds, "Built-in TLD list disabled"), Object.assign({}, e, m.tlds);
s("object" == typeof e.tlds, "tlds must be true, false, or an object");
const t = e.tlds.deny;
if (t) return Array.isArray(t) && (e = Object.assign({}, e, { tlds: { deny: new Set(t) } })), s(e.tlds.deny instanceof Set, "tlds.deny must be an array, Set, or boolean"), s(!e.tlds.allow, "Cannot specify both tlds.allow and tlds.deny lists"), m.validateTlds(e.tlds.deny, "tlds.deny"), e;
const r = e.tlds.allow;
return r ? !0 === r ? (s(m.tlds, "Built-in TLD list disabled"), Object.assign({}, e, m.tlds)) : (Array.isArray(r) && (e = Object.assign({}, e, { tlds: { allow: new Set(r) } })), s(e.tlds.allow instanceof Set, "tlds.allow must be an array, Set, or boolean"), m.validateTlds(e.tlds.allow, "tlds.allow"), e) : {
...e,
tlds: !1
};
}, m.validateTlds = function(e, t) {
for (const r of e) s(a(r, {
minDomainSegments: 1,
maxDomainSegments: 1
}), `${t} must contain valid top level domain names`);
}, m.isoDate = function(e) {
if (!f.isIsoDate(e)) return null;
/T.*[+-]\d\d$/.test(e) && (e += ":00");
const t = new Date(e);
return isNaN(t.getTime()) ? null : t.toISOString();
}, m.length = function(e, t, r, n, a) {
return s(!a || !1, "Invalid encoding:", a), e.$_addRule({
name: t,
method: "length",
args: {
limit: r,
encoding: a
},
operator: n
});
};
},
5008(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = r(680), a = {};
a.Map = class extends Map {
slice() {
return new a.Map(this);
}
}, e.exports = n.extend({
type: "symbol",
terms: { map: { init: new a.Map() } },
coerce: { method(e, { schema: t, error: r }) {
const s = t.$_terms.map.get(e);
return s && (e = s), t._flags.only && "symbol" != typeof e ? {
value: e,
errors: r("symbol.map", { map: t.$_terms.map })
} : { value: e };
} },
validate(e, { error: t }) {
if ("symbol" != typeof e) return {
value: e,
errors: t("symbol.base")
};
},
rules: { map: { method(e) {
e && !e[Symbol.iterator] && "object" == typeof e && (e = Object.entries(e)), s(e && e[Symbol.iterator], "Iterable must be an iterable or object");
const t = this.clone(), r = [];
for (const n of e) {
s(n && n[Symbol.iterator], "Entry must be an iterable");
const [e, a] = n;
s("object" != typeof e && "function" != typeof e && "symbol" != typeof e, "Key must not be of type object, function, or Symbol"), s("symbol" == typeof a, "Value must be a Symbol"), t.$_terms.map.set(e, a), r.push(a);
}
return t.valid(...r);
} } },
manifest: { build: (e, t) => (t.map && (e = e.map(t.map)), e) },
jsonSchema(e, t, r, s) {
const n = e.$_terms.map;
return n.size ? { anyOf: Array.from(n.keys()).map((e) => ({ const: e })) } : {};
},
messages: {
"symbol.base": "{{#label}} must be a symbol",
"symbol.map": "{{#label}} must be one of {{#map}}"
}
});
},
1190(e, t, r) {
"use strict";
const { assert: s, clone: n, ignore: a, reach: o } = r(3115), i = r(9415), l = r(8013), c = r(4957), u = { result: Symbol("result") };
t.entry = function(e, t, r) {
let n = i.defaults;
r && (s(void 0 === r.warnings, "Cannot override warnings preference in synchronous validation"), s(void 0 === r.artifacts, "Cannot override artifacts preference in synchronous validation"), n = i.preferences(i.defaults, r));
const a = u.entry(e, t, n);
s(!a.mainstay.externals.length, "Schema with external rules must use validateAsync()");
const o = { value: a.value };
return a.error && (o.error = a.error), a.mainstay.warnings.length && (o.warning = l.details(a.mainstay.warnings)), a.mainstay.debug && (o.debug = a.mainstay.debug), a.mainstay.artifacts && (o.artifacts = a.mainstay.artifacts), o;
}, t.entryAsync = async function(e, t, r) {
let s = i.defaults;
r && (s = i.preferences(i.defaults, r));
const n = u.entry(e, t, s), a = n.mainstay;
if (n.error) throw a.debug && (n.error.debug = a.debug), n.error;
if (a.externals.length) {
let t = n.value;
const c = [];
for (const n of a.externals) {
const f = n.state.path, m = "link" === n.schema.type ? a.links.get(n.schema) : null;
let h, p, d = t;
const g = f.length ? [t] : [], y = f.length ? o(e, f) : e;
if (f.length) {
h = f[f.length - 1];
let e = t;
for (const t of f.slice(0, -1)) e = e[t], g.unshift(e);
p = g[0], d = p[h];
}
try {
const e = (e, t) => (m || n.schema).$_createError(e, d, t, n.state, s), o = await n.method(d, {
schema: n.schema,
linked: m,
state: n.state,
prefs: r,
original: y,
error: e,
errorsArray: u.errorsArray,
warn: (e, t) => a.warnings.push((m || n.schema).$_createError(e, d, t, n.state, s)),
message: (e, t) => (m || n.schema).$_createError("external", d, t, n.state, s, { messages: e })
});
if (void 0 === o || o === d) continue;
if (o instanceof l.Report) {
if (a.tracer.log(n.schema, n.state, "rule", "external", "error"), c.push(o), s.abortEarly) break;
continue;
}
if (Array.isArray(o) && o[i.symbols.errors]) {
if (a.tracer.log(n.schema, n.state, "rule", "external", "error"), c.push(...o), s.abortEarly) break;
continue;
}
p ? (a.tracer.value(n.state, "rule", d, o, "external"), p[h] = o) : (a.tracer.value(n.state, "rule", t, o, "external"), t = o);
} catch (e) {
throw s.errors.label && (e.message += ` (${n.label})`), e;
}
}
if (n.value = t, c.length) throw n.error = l.process(c, e, s), a.debug && (n.error.debug = a.debug), n.error;
}
if (!s.warnings && !s.debug && !s.artifacts) return n.value;
const c = { value: n.value };
return a.warnings.length && (c.warning = l.details(a.warnings)), a.debug && (c.debug = a.debug), a.artifacts && (c.artifacts = a.artifacts), c;
}, t.standard = function(e, r, s) {
const n = null == s ? void 0 : s.libraryOptions;
return r.isAsync() ? t.entryAsync(e, r, n) : t.entry(e, r, n);
}, u.Mainstay = class {
constructor(e, t, r) {
this.externals = [], this.warnings = [], this.tracer = e, this.debug = t, this.links = r, this.shadow = null, this.artifacts = null, this._snapshots = [];
}
snapshot() {
this._snapshots.push({
externals: this.externals.length,
warnings: this.warnings.length
});
}
restore() {
const e = this._snapshots.pop();
this.externals.length = e.externals, this.warnings.length = e.warnings;
}
commit() {
this._snapshots.pop();
}
}, u.entry = function(e, r, s) {
const { tracer: n, cleanup: a } = u.tracer(r, s), o = s.debug ? [] : null, i = r._ids._schemaChain ? new Map() : null, f = new u.Mainstay(n, o, i), m = r._ids._schemaChain ? [{ schema: r }] : null, h = new c([], [], {
mainstay: f,
schemas: m
}), p = t.validate(e, r, h, s);
a && r.$_root.untrace();
const d = l.process(p.errors, e, s);
return {
value: p.value,
error: d,
mainstay: f
};
}, u.tracer = function(e, t) {
return e.$_root._tracer ? { tracer: e.$_root._tracer._register(e) } : t.debug ? (s(e.$_root.trace, "Debug mode not supported"), {
tracer: e.$_root.trace()._register(e),
cleanup: !0
}) : { tracer: u.ignore };
}, t.validate = function(e, t, r, s, n = {}) {
if (t.$_terms.whens && (t = t._generate(e, r, s).schema), t._preferences && (s = u.prefs(t, s)), t._cache && s.cache) {
const s = t._cache.get(e);
if (r.mainstay.tracer.debug(r, "validate", "cached", !!s), s) return s;
}
void 0 !== t._flags.failover && r.snapshot();
const a = (n, a, o) => t.$_createError(n, e, a, o || r, s), o = {
original: e,
prefs: s,
schema: t,
state: r,
error: a,
errorsArray: u.errorsArray,
warn: (e, t, s) => r.mainstay.warnings.push(a(e, t, s)),
message: (n, a) => t.$_createError("custom", e, a, r, s, { messages: n })
};
r.mainstay.tracer.entry(t, r);
const l = t._definition;
if (l.prepare && s.convert) {
const t = l.prepare(e, o);
if (t) {
if (r.mainstay.tracer.value(r, "prepare", e, t.value), t.errors) return u.finalize(t.value, [].concat(t.errors), o);
e = t.value;
}
}
if (l.coerce && void 0 !== e && s.convert && (!l.coerce.from || l.coerce.from.includes(typeof e))) {
const t = l.coerce.method(e, o);
if (t) {
if (r.mainstay.tracer.value(r, "coerced", e, t.value), t.errors) return u.finalize(t.value, [].concat(t.errors), o);
e = t.value;
}
}
const c = t._flags.empty;
c && c.$_match(u.trim(e, t), r.nest(c), i.defaults) && (r.mainstay.tracer.value(r, "empty", e, void 0), e = void 0);
const f = n.presence || t._flags.presence || (t._flags._endedSwitch ? null : s.presence);
if (void 0 === e) {
if ("forbidden" === f) return u.finalize(e, null, o);
if ("required" === f) return u.finalize(e, [t.$_createError("any.required", e, null, r, s)], o);
if ("optional" === f) {
if (t._flags.default !== i.symbols.deepDefault) return u.finalize(e, null, o);
r.mainstay.tracer.value(r, "default", e, {}), e = {};
}
} else if ("forbidden" === f) return u.finalize(e, [t.$_createError("any.unknown", e, null, r, s)], o);
const m = [];
if (t._valids) {
const n = t._valids.get(e, r, s, t._flags.insensitive);
if (n) return s.convert && (r.mainstay.tracer.value(r, "valids", e, n.value), e = n.value), r.mainstay.tracer.filter(t, r, "valid", n), u.finalize(e, null, o);
if (t._flags.only) {
const n = t.$_createError("any.only", e, { valids: t._valids.values({ display: !0 }) }, r, s);
if (s.abortEarly) return u.finalize(e, [n], o);
m.push(n);
}
}
if (t._invalids) {
const n = t._invalids.get(e, r, s, t._flags.insensitive);
if (n) {
r.mainstay.tracer.filter(t, r, "invalid", n);
const a = t.$_createError("any.invalid", e, { invalids: t._invalids.values({ display: !0 }) }, r, s);
if (s.abortEarly) return u.finalize(e, [a], o);
m.push(a);
}
}
if (l.validate) {
const t = l.validate(e, o);
if (t && (r.mainstay.tracer.value(r, "base", e, t.value), e = t.value, t.errors)) {
if (!Array.isArray(t.errors)) return m.push(t.errors), u.finalize(e, m, o);
if (t.errors.length) return m.push(...t.errors), u.finalize(e, m, o);
}
}
return t._rules.length ? u.rules(e, m, o) : u.finalize(e, m, o);
}, u.rules = function(e, t, r) {
const { schema: s, state: n, prefs: a } = r;
for (const o of s._rules) {
const l = s._definition.rules[o.method];
if (l.convert && a.convert) {
n.mainstay.tracer.log(s, n, "rule", o.name, "full");
continue;
}
let c, f = o.args;
if (o._resolve.length) {
f = Object.assign({}, f);
for (const t of o._resolve) {
const r = l.argsByName.get(t), o = f[t].resolve(e, n, a), u = r.normalize ? r.normalize(o) : o, m = i.validateArg(u, null, r);
if (m) {
c = s.$_createError("any.ref", o, {
arg: t,
ref: f[t],
reason: m
}, n, a);
break;
}
f[t] = u;
}
}
c = c || l.validate(e, r, f, o);
const m = u.rule(c, o);
if (m.errors) {
if (n.mainstay.tracer.log(s, n, "rule", o.name, "error"), o.warn) {
n.mainstay.warnings.push(...m.errors);
continue;
}
if (a.abortEarly) return u.finalize(e, m.errors, r);
t.push(...m.errors);
} else n.mainstay.tracer.log(s, n, "rule", o.name, "pass"), n.mainstay.tracer.value(n, "rule", e, m.value, o.name), e = m.value;
}
return u.finalize(e, t, r);
}, u.rule = function(e, t) {
return e instanceof l.Report ? (u.error(e, t), {
errors: [e],
value: null
}) : Array.isArray(e) && e[i.symbols.errors] ? (e.forEach((e) => u.error(e, t)), {
errors: e,
value: null
}) : {
errors: null,
value: e
};
}, u.error = function(e, t) {
return t.message && e._setTemplate(t.message), e;
}, u.finalize = function(e, t, r) {
t = t || [];
const { schema: n, state: a, prefs: o } = r;
if (void 0 !== n._flags.failover) {
let s = !1;
if (t.length) {
const n = u.default("failover", void 0, t, r);
void 0 !== n && (a.mainstay.tracer.value(a, "failover", e, n), e = n, t = [], s = !0);
}
s ? a.restore() : a.commit();
}
if (t.length && n._flags.error) if ("function" == typeof n._flags.error) {
t = n._flags.error(t), Array.isArray(t) || (t = [t]);
for (const e of t) s(e instanceof Error || e instanceof l.Report, "error() must return an Error object");
} else t = [n._flags.error];
if (void 0 === e) {
const s = u.default("default", e, t, r);
a.mainstay.tracer.value(a, "default", e, s), e = s;
}
if (n._flags.cast && void 0 !== e) {
const t = n._definition.cast[n._flags.cast];
if (t.from(e)) {
const s = t.to(e, r);
a.mainstay.tracer.value(a, "cast", e, s, n._flags.cast), e = s;
}
}
if (n.$_terms.externals && o.externals && !1 !== o._externals) for (const { method: e } of n.$_terms.externals) a.mainstay.externals.push({
method: e,
schema: n,
state: a,
label: l.label(n._flags, a, o)
});
const i = {
value: e,
errors: t.length ? t : null
};
return n._flags.result && (i.value = "strip" === n._flags.result ? void 0 : r.original, a.mainstay.tracer.value(a, n._flags.result, e, i.value), a.shadow(e, n._flags.result)), n._cache && !1 !== o.cache && !n._refs.length && n._cache.set(r.original, i), void 0 === e || i.errors || void 0 === n._flags.artifact || (a.mainstay.artifacts = a.mainstay.artifacts || new Map(), a.mainstay.artifacts.has(n._flags.artifact) || a.mainstay.artifacts.set(n._flags.artifact, []), a.mainstay.artifacts.get(n._flags.artifact).push(a.path)), i;
}, u.prefs = function(e, t) {
const r = t === i.defaults;
return r && e._preferences[i.symbols.prefs] ? e._preferences[i.symbols.prefs] : (t = i.preferences(t, e._preferences), r && (e._preferences[i.symbols.prefs] = t), t);
}, u.default = function(e, t, r, s) {
const { schema: a, state: o, prefs: l } = s, c = a._flags[e];
if (l.noDefaults || void 0 === c) return t;
if (o.mainstay.tracer.log(a, o, "rule", e, "full"), !c) return c;
if ("function" == typeof c) {
const t = c.length ? [n(o.ancestors[0]), s] : [];
try {
return c(...t);
} catch (t) {
r.push(a.$_createError(`any.${e}`, null, { error: t }, o, l));
return;
}
}
return "object" != typeof c ? c : c[i.symbols.literal] ? c.literal : i.isResolvable(c) ? c.resolve(t, o, l) : n(c);
}, u.trim = function(e, t) {
if ("string" != typeof e) return e;
const r = t.$_getRule("trim");
return r && r.args.enabled ? e.trim() : e;
}, u.ignore = {
active: !1,
debug: a,
entry: a,
filter: a,
log: a,
resolve: a,
value: a
}, u.errorsArray = function() {
const e = [];
return e[i.symbols.errors] = !0, e;
};
},
6220(e, t, r) {
"use strict";
const { assert: s, deepEqual: n } = r(3115), a = r(9415), o = {};
e.exports = o.Values = class {
constructor(e, t) {
this._values = new Set(e), this._refs = new Set(t), this._lowercase = o.lowercases(e), this._override = !1;
}
get length() {
return this._values.size + this._refs.size;
}
add(e, t) {
a.isResolvable(e) ? this._refs.has(e) || (this._refs.add(e), t && t.register(e)) : this.has(e, null, null, !1) || (this._values.add(e), "string" == typeof e && this._lowercase.set(e.toLowerCase(), e));
}
static merge(e, t, r) {
if (e = e || new o.Values(), t) {
if (t._override) return t.clone();
for (const r of [...t._values, ...t._refs]) e.add(r);
}
if (r) for (const t of [...r._values, ...r._refs]) e.remove(t);
return e.length ? e : null;
}
remove(e) {
a.isResolvable(e) ? this._refs.delete(e) : (this._values.delete(e), "string" == typeof e && this._lowercase.delete(e.toLowerCase()));
}
has(e, t, r, s) {
return !!this.get(e, t, r, s);
}
get(e, t, r, s) {
if (!this.length) return !1;
if (this._values.has(e)) return { value: e };
if ("string" == typeof e && e && s) {
const t = this._lowercase.get(e.toLowerCase());
if (t) return { value: t };
}
if (!this._refs.size && "object" != typeof e) return !1;
if ("object" == typeof e) {
for (const t of this._values) if (n(t, e)) return { value: t };
}
if (t) for (const a of this._refs) {
const o = a.resolve(e, t, r, null, { in: !0 });
if (void 0 === o) continue;
const i = a.in && "object" == typeof o ? Array.isArray(o) ? o : Object.keys(o) : [o];
for (const t of i) if (typeof t == typeof e) {
if (s && e && "string" == typeof e) {
if (t.toLowerCase() === e.toLowerCase()) return {
value: t,
ref: a
};
} else if (n(t, e)) return {
value: t,
ref: a
};
}
}
return !1;
}
override() {
this._override = !0;
}
values(e) {
if (e && e.display) {
const e = [];
for (const t of [...this._values, ...this._refs]) void 0 !== t && e.push(t);
return e;
}
return Array.from([...this._values, ...this._refs]);
}
clone() {
const e = new o.Values(this._values, this._refs);
return e._override = this._override, e;
}
concat(e) {
s(!e._override, "Cannot concat override set of values");
const t = new o.Values([...this._values, ...e._values], [...this._refs, ...e._refs]);
return t._override = this._override, t;
}
describe() {
const e = [];
this._override && e.push({ override: !0 });
for (const t of this._values.values()) e.push(t && "object" == typeof t ? { value: t } : t);
for (const t of this._refs.values()) e.push(t.describe());
return e;
}
}, o.Values.prototype[a.symbols.values] = !0, o.Values.prototype.slice = o.Values.prototype.clone, o.lowercases = function(e) {
const t = new Map();
if (e) for (const r of e) "string" == typeof r && t.set(r.toLowerCase(), r);
return t;
};
},
9089(e, t, r) {
"use strict";
r.d(t, {
ipRegex: () => C,
isDomainValid: () => h,
isEmailValid: () => y,
uriRegex: () => T
});
var s = r(8663);
const n = {
EMPTY_STRING: "Address must be a non-empty string",
FORBIDDEN_UNICODE: "Address contains forbidden Unicode characters",
MULTIPLE_AT_CHAR: "Address cannot contain more than one @ character",
MISSING_AT_CHAR: "Address must contain one @ character",
EMPTY_LOCAL: "Address local part cannot be empty",
ADDRESS_TOO_LONG: "Address too long",
LOCAL_TOO_LONG: "Address local part too long",
EMPTY_LOCAL_SEGMENT: "Address local part contains empty dot-separated segment",
INVALID_LOCAL_CHARS: "Address local part contains invalid character",
DOMAIN_NON_EMPTY_STRING: "Domain must be a non-empty string",
DOMAIN_TOO_LONG: "Domain too long",
DOMAIN_INVALID_UNICODE_CHARS: "Domain contains forbidden Unicode characters",
DOMAIN_INVALID_CHARS: "Domain contains invalid character",
DOMAIN_INVALID_TLDS_CHARS: "Domain contains invalid tld character",
DOMAIN_SEGMENTS_COUNT: "Domain lacks the minimum required number of segments",
DOMAIN_SEGMENTS_COUNT_MAX: "Domain contains too many segments",
DOMAIN_FORBIDDEN_TLDS: "Domain uses forbidden TLD",
DOMAIN_EMPTY_SEGMENT: "Domain contains empty dot-separated segment",
DOMAIN_LONG_SEGMENT: "Domain contains dot-separated segment that is too long"
};
function a(e) {
return {
code: e,
error: n[e]
};
}
const o = /[^\x00-\x7f]/, i = /[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/, l = /^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/, c = /^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/, u = /^[a-zA-Z0-9_](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/, f = s.URL || URL;
function m(e, t = {}) {
if (!e) return a("DOMAIN_NON_EMPTY_STRING");
if ("string" != typeof e) throw new Error("Invalid input: domain must be a string");
if (e.length > 256) return a("DOMAIN_TOO_LONG");
if (o.test(e)) {
if (!1 === t.allowUnicode) return a("DOMAIN_INVALID_UNICODE_CHARS");
e = e.normalize("NFC");
}
if (i.test(e)) return a("DOMAIN_INVALID_CHARS");
e = function(e) {
e.includes("%") && (e = e.replace(/%/g, "%25"));
try {
return new f(`http://${e}`).host;
} catch (t) {
return e;
}
}(e), t.allowFullyQualified && "." === e[e.length - 1] && (e = e.slice(0, -1));
const r = t.minDomainSegments || 2, s = e.split(".");
if (s.length < r) return a("DOMAIN_SEGMENTS_COUNT");
if (t.maxDomainSegments && s.length > t.maxDomainSegments) return a("DOMAIN_SEGMENTS_COUNT_MAX");
const n = t.tlds;
if (n) {
const e = s[s.length - 1].toLowerCase();
if (function(e) {
return !!e.allow;
}(n)) {
if (!n.allow.has(e)) return a("DOMAIN_FORBIDDEN_TLDS");
} else if (n.deny.has(e)) return a("DOMAIN_FORBIDDEN_TLDS");
}
for (let e = 0; e < s.length; ++e) {
const r = s[e];
if (!r.length) return a("DOMAIN_EMPTY_SEGMENT");
if (r.length > 63) return a("DOMAIN_LONG_SEGMENT");
if (e < s.length - 1) {
if (t.allowUnderscore) {
if (!u.test(r)) return a("DOMAIN_INVALID_CHARS");
} else if (!c.test(r)) return a("DOMAIN_INVALID_CHARS");
} else if (!l.test(r)) return a("DOMAIN_INVALID_TLDS_CHARS");
}
return null;
}
function h(e, t) {
return !m(e, t);
}
var p = r(6984);
const d = /[^\x00-\x7f]/, g = new (p.TextEncoder || TextEncoder)();
function y(e, t) {
return !function(e, t = {}) {
if ("string" != typeof e) throw new Error("Invalid input: email must be a string");
if (!e) return a("EMPTY_STRING");
const r = !d.test(e);
if (!r) {
if (!1 === t.allowUnicode) return a("FORBIDDEN_UNICODE");
e = e.normalize("NFC");
}
const s = e.split("@");
if (2 !== s.length) return s.length > 2 ? a("MULTIPLE_AT_CHAR") : a("MISSING_AT_CHAR");
const [n, o] = s;
if (!n) return a("EMPTY_LOCAL");
if (!t.ignoreLength) {
if (e.length > 254) return a("ADDRESS_TOO_LONG");
if (g.encode(n).length > 64) return a("LOCAL_TOO_LONG");
}
return function(e, t) {
const r = e.split(".");
for (const e of r) {
if (!e.length) return a("EMPTY_LOCAL_SEGMENT");
if (t) {
if (!v.test(e)) return a("INVALID_LOCAL_CHARS");
} else for (const t of e) {
if (v.test(t)) continue;
const e = b(t);
if (!_.test(e)) return a("INVALID_LOCAL_CHARS");
}
}
return null;
}(n, r) || m(o, t);
}(e, t);
}
function b(e) {
return Array.from(g.encode(e), (e) => String.fromCharCode(e)).join("");
}
const v = /^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/, _ = new RegExp([
"(?:[\\xc2-\\xdf][\\x80-\\xbf])",
"(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})",
"(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"
].join("|"));
var A = r(8253), S = r.n(A), E = r(8669), O = r.n(E);
const R = function() {
const e = {}, t = "\\dA-Fa-f", r = "[" + t + "]", s = "\\w-\\.~", n = "!\\$&'\\(\\)\\*\\+,;=", a = "%" + t, o = s + a + n + ":@", l = "(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
e.ipv4address = "(?:" + l + "\\.){3}" + l;
const c = r + "{1,4}", u = "(?:" + c + ":" + c + "|" + e.ipv4address + ")", f = "(?:" + c + ":){6}" + u, m = "::(?:" + c + ":){5}" + u, h = "(?:" + c + ")?::(?:" + c + ":){4}" + u, p = "(?:(?:" + c + ":){0,1}" + c + ")?::(?:" + c + ":){3}" + u, d = "(?:(?:" + c + ":){0,2}" + c + ")?::(?:" + c + ":){2}" + u, g = "(?:(?:" + c + ":){0,3}" + c + ")?::" + c + ":" + u, y = "(?:(?:" + c + ":){0,4}" + c + ")?::" + u;
e.ipv4Cidr = "(?:\\d|[1-2]\\d|3[0-2])", e.ipv6Cidr = "(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])", e.ipv6address = "(?:" + f + "|" + m + "|" + h + "|" + p + "|" + d + "|" + g + "|" + y + "|(?:(?:[\\dA-Fa-f]{1,4}:){0,5}[\\dA-Fa-f]{1,4})?::[\\dA-Fa-f]{1,4}|(?:(?:[\\dA-Fa-f]{1,4}:){0,6}[\\dA-Fa-f]{1,4})?::)", e.ipvFuture = "v" + r + "+\\.[" + s + n + ":]+", e.scheme = "[a-zA-Z][a-zA-Z\\d+-\\.]*", e.schemeRegex = new RegExp(e.scheme);
const _ = "[" + s + a + n + ":]*", S = "(?:\\[(?:" + e.ipv6address + "|" + e.ipvFuture + ")\\]|" + e.ipv4address + "|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=]{1,255})", E = "(?:" + _ + "@)?" + S + "(?::\\d*)?", O = "(?:" + _ + "@)?(" + S + ")(?::\\d*)?";
return e.hierPart = "(?:(?:\\/\\/" + E + "(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)|\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)?|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*))", e.hierPartCapture = "(?:(?:\\/\\/" + O + "(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)|\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)?|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)", e.relativeRef = "(?:(?:\\/\\/" + E + "(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)|\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)?|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*|)", e.relativeRefCapture = "(?:(?:\\/\\/" + O + "(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)|\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)?|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*|)", e.query = "[" + o + "\\/\\?]*(?=#|$)", e.queryWithSquareBrackets = "[" + o + "\\[\\]\\/\\?]*(?=#|$)", e.fragment = "[" + o + "\\/\\?]*", e;
}(), N = {
v4Cidr: R.ipv4Cidr,
v6Cidr: R.ipv6Cidr,
ipv4: R.ipv4address,
ipv6: R.ipv6address,
ipvfuture: R.ipvFuture
};
function I(e) {
const t = R, r = "(?:\\?" + (e.allowQuerySquareBrackets ? t.queryWithSquareBrackets : t.query) + ")?(?:#" + t.fragment + ")?", s = e.domain ? t.relativeRefCapture : t.relativeRef;
if (e.relativeOnly) return w(s + r);
let n = "";
if (e.scheme) {
S()(e.scheme instanceof RegExp || "string" == typeof e.scheme || Array.isArray(e.scheme), "scheme must be a RegExp, String, or Array");
const r = [].concat(e.scheme);
S()(r.length >= 1, "scheme must have at least 1 scheme specified");
const s = [];
for (let e = 0; e < r.length; ++e) {
const n = r[e];
S()(n instanceof RegExp || "string" == typeof n, "scheme at position " + e + " must be a RegExp or String"), n instanceof RegExp ? s.push(n.source.toString()) : (S()(t.schemeRegex.test(n), "scheme at position " + e + " must be a valid scheme"), s.push(O()(n)));
}
n = s.join("|");
}
const a = "(?:" + (n ? "(?:" + n + ")" : t.scheme) + ":" + (e.domain ? t.hierPartCapture : t.hierPart) + ")";
return w((e.allowRelative ? "(?:" + a + "|" + s + ")" : a) + r, n);
}
function w(e, t = null) {
return {
raw: e = `(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${e}`,
regex: new RegExp(`^${e}$`),
scheme: t
};
}
const $ = I({});
function T(e = {}) {
return e.scheme || e.allowRelative || e.relativeOnly || e.allowQuerySquareBrackets || e.domain ? I(e) : $;
}
function C(e = {}) {
const t = e.cidr || "optional";
S()([
"required",
"optional",
"forbidden"
].includes(t), "options.cidr must be one of required, optional, forbidden"), S()(void 0 === e.version || "string" == typeof e.version || Array.isArray(e.version), "options.version must be a string or an array of string");
let r = e.version || [
"ipv4",
"ipv6",
"ipvfuture"
];
Array.isArray(r) || (r = [r]), S()(r.length >= 1, "options.version must have at least 1 version specified");
for (const e of r) S()("string" == typeof e && e === e.toLowerCase(), "Invalid options.version value"), S()([
"ipv4",
"ipv6",
"ipvfuture"
].includes(e), "options.version contains unknown version " + e + " - must be one of ipv4, ipv6, ipvfuture");
r = Array.from(new Set(r));
const s = `(?:${r.map((e) => {
if ("forbidden" === t) return N[e];
const r = `\\/${"ipv4" === e ? N.v4Cidr : N.v6Cidr}`;
return "required" === t ? `${N[e]}${r}` : `${N[e]}(?:${r})?`;
}).join("|")})`, n = new RegExp(`^${s}$`);
return {
cidr: t,
versions: r,
regex: n,
raw: s
};
}
},
679(e, t) {
"use strict";
const r = {
operators: [
"!",
"^",
"*",
"/",
"%",
"+",
"-",
"<",
"<=",
">",
">=",
"==",
"!=",
"&&",
"||",
"??"
],
operatorCharacters: [
"!",
"^",
"*",
"/",
"%",
"+",
"-",
"<",
"=",
">",
"&",
"|",
"?"
],
operatorsOrder: [
["^"],
[
"*",
"/",
"%"
],
["+", "-"],
[
"<",
"<=",
">",
">="
],
["==", "!="],
["&&"],
["||", "??"]
],
operatorsPrefix: ["!", "n"],
literals: {
"\"": "\"",
"`": "`",
"'": "'",
"[": "]"
},
numberRx: /^(?:[0-9]*(\.[0-9]*)?){1}$/,
tokenRx: /^[\w\$\#\.\@\:\{\}]+$/,
symbol: Symbol("formula"),
settings: Symbol("settings")
};
t.Parser = class {
constructor(e, t = {}) {
if (!t[r.settings] && t.constants) for (const e in t.constants) {
const r = t.constants[e];
if (null !== r && ![
"boolean",
"number",
"string"
].includes(typeof r)) throw new Error(`Formula constant ${e} contains invalid ${typeof r} value type`);
}
this.settings = t[r.settings] ? t : Object.assign({
[r.settings]: !0,
constants: {},
functions: {}
}, t), this.single = null, this._parts = null, this._parse(e);
}
_parse(e) {
let s = [], n = "", a = 0, o = !1;
const i = (e) => {
if (a) throw new Error("Formula missing closing parenthesis");
const i = s.length ? s[s.length - 1] : null;
if (o || n || e) {
if (i && "reference" === i.type && ")" === e) return i.type = "function", i.value = this._subFormula(n, i.value), void (n = "");
if (")" === e) {
const e = new t.Parser(n, this.settings);
s.push({
type: "segment",
value: e
});
} else if (o) {
if ("]" === o) return s.push({
type: "reference",
value: n
}), void (n = "");
s.push({
type: "literal",
value: n
});
} else if (r.operatorCharacters.includes(n)) i && "operator" === i.type && r.operators.includes(i.value + n) ? i.value += n : s.push({
type: "operator",
value: n
});
else if (n.match(r.numberRx)) s.push({
type: "constant",
value: parseFloat(n)
});
else if (void 0 !== this.settings.constants[n]) s.push({
type: "constant",
value: this.settings.constants[n]
});
else {
if (!n.match(r.tokenRx)) throw new Error(`Formula contains invalid token: ${n}`);
s.push({
type: "reference",
value: n
});
}
n = "";
}
};
for (const t of e) o ? t === o ? (i(), o = !1) : n += t : a ? "(" === t ? (n += t, ++a) : ")" === t ? (--a, a ? n += t : i(t)) : n += t : t in r.literals ? o = r.literals[t] : "(" === t ? (i(), ++a) : r.operatorCharacters.includes(t) ? (i(), n = t, i()) : " " !== t ? n += t : i();
i(), s = s.map((e, t) => "operator" !== e.type || "-" !== e.value || t && "operator" !== s[t - 1].type ? e : {
type: "operator",
value: "n"
});
let l = !1;
for (const e of s) {
if ("operator" === e.type) {
if (r.operatorsPrefix.includes(e.value)) continue;
if (!l) throw new Error("Formula contains an operator in invalid position");
if (!r.operators.includes(e.value)) throw new Error(`Formula contains an unknown operator ${e.value}`);
} else if (l) throw new Error("Formula missing expected operator");
l = !l;
}
if (!l) throw new Error("Formula contains invalid trailing operator");
1 === s.length && [
"reference",
"literal",
"constant"
].includes(s[0].type) && (this.single = {
type: "reference" === s[0].type ? "reference" : "value",
value: s[0].value
}), this._parts = s.map((e) => {
if ("operator" === e.type) return r.operatorsPrefix.includes(e.value) ? e : e.value;
if ("reference" !== e.type) return e.value;
if (this.settings.tokenRx && !this.settings.tokenRx.test(e.value)) throw new Error(`Formula contains invalid reference ${e.value}`);
return this.settings.reference ? this.settings.reference(e.value) : r.reference(e.value);
});
}
_subFormula(e, s) {
const n = this.settings.functions[s];
if ("function" != typeof n) throw new Error(`Formula contains unknown function ${s}`);
let a = [];
if (e) {
let t = "", n = 0, o = !1;
const i = () => {
if (!t) throw new Error(`Formula contains function ${s} with invalid arguments ${e}`);
a.push(t), t = "";
};
for (let s = 0; s < e.length; ++s) {
const a = e[s];
o ? (t += a, a === o && (o = !1)) : a in r.literals && !n ? (t += a, o = r.literals[a]) : "," !== a || n ? (t += a, "(" === a ? ++n : ")" === a && --n) : i();
}
i();
}
return a = a.map((e) => new t.Parser(e, this.settings)), function(e) {
const t = [];
for (const r of a) t.push(r.evaluate(e));
return n.call(e, ...t);
};
}
evaluate(e) {
const t = this._parts.slice();
for (let s = t.length - 2; s >= 0; --s) {
const n = t[s];
if (n && "operator" === n.type) {
const a = t[s + 1];
t.splice(s + 1, 1);
const o = r.evaluate(a, e);
t[s] = r.single(n.value, o);
}
}
return r.operatorsOrder.forEach((s) => {
for (let n = 1; n < t.length - 1;) if (s.includes(t[n])) {
const s = t[n], a = r.evaluate(t[n - 1], e), o = r.evaluate(t[n + 1], e);
t.splice(n, 2);
const i = r.calculate(s, a, o);
t[n - 1] = 0 === i ? 0 : i;
} else n += 2;
}), r.evaluate(t[0], e);
}
}, t.Parser.prototype[r.symbol] = !0, r.reference = function(e) {
return function(t) {
return t && void 0 !== t[e] ? t[e] : null;
};
}, r.evaluate = function(e, t) {
return null === e ? null : "function" == typeof e ? e(t) : e[r.symbol] ? e.evaluate(t) : e;
}, r.single = function(e, t) {
if ("!" === e) return !t;
const r = -t;
return 0 === r ? 0 : r;
}, r.calculate = function(e, t, s) {
if ("??" === e) return r.exists(t) ? t : s;
if ("string" == typeof t || "string" == typeof s) {
if ("+" === e) return (t = r.exists(t) ? t : "") + (r.exists(s) ? s : "");
} else switch (e) {
case "^": return Math.pow(t, s);
case "*": return t * s;
case "/": return t / s;
case "%": return t % s;
case "+": return t + s;
case "-": return t - s;
}
switch (e) {
case "<": return t < s;
case "<=": return t <= s;
case ">": return t > s;
case ">=": return t >= s;
case "==": return t === s;
case "!=": return t !== s;
case "&&": return t && s;
case "||": return t || s;
}
return null;
}, r.exists = function(e) {
return null != e;
};
},
6084(e, t, r) {
"use strict";
const s = r(8253), n = r(4126), a = r(9315), o = r(1528), i = {};
e.exports = function(e, t, r = {}) {
if (s(e && "object" == typeof e, "Invalid defaults value: must be an object"), s(!t || !0 === t || "object" == typeof t, "Invalid source value: must be true, falsy or an object"), s("object" == typeof r, "Invalid options: must be an object"), !t) return null;
if (r.shallow) return i.applyToDefaultsWithShallow(e, t, r);
const o = n(e);
if (!0 === t) return o;
const l = void 0 !== r.nullOverride && r.nullOverride;
return a(o, t, {
nullOverride: l,
mergeArrays: !1
});
}, i.applyToDefaultsWithShallow = function(e, t, r) {
const l = r.shallow;
s(Array.isArray(l), "Invalid keys");
const c = new Map(), u = !0 === t ? null : new Set();
for (let r of l) {
r = Array.isArray(r) ? r : r.split(".");
const s = o(e, r);
s && "object" == typeof s ? c.set(s, u && o(t, r) || s) : u && u.add(r);
}
const f = n(e, {}, c);
if (!u) return f;
for (const e of u) i.reachCopy(f, t, e);
const m = void 0 !== r.nullOverride && r.nullOverride;
return a(f, t, {
nullOverride: m,
mergeArrays: !1
});
}, i.reachCopy = function(e, t, r) {
for (const e of r) {
if (!(e in t)) return;
const r = t[e];
if ("object" != typeof r || null === r) return;
t = r;
}
const s = t;
let n = e;
for (let e = 0; e < r.length - 1; ++e) {
const t = r[e];
"object" != typeof n[t] && (n[t] = {}), n = n[t];
}
n[r[r.length - 1]] = s;
};
},
8253(e, t, r) {
"use strict";
const s = r(1803), n = r(8314), a = e.exports = function(e, ...t) {
if (e) return;
if (1 === t.length && t[0] instanceof Error) throw t[0];
const r = t.filter((e) => "" !== e).map((e) => "string" == typeof e ? e : e instanceof Error ? e.message : n(e));
throw new s(r.join(" "), a);
};
},
1803(e) {
"use strict";
e.exports = class extends Error {
constructor(e, t) {
var r, s, n;
super(e || "Unknown error"), r = this, n = "AssertError", (s = function(e) {
var t = function(e) {
if ("object" != typeof e || !e) return e;
var t;
if ("undefined" != typeof Symbol && void 0 !== (t = e[Symbol.toPrimitive])) {
var r = t.call(e, "string");
if ("object" != typeof r) return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return String(e);
}(e);
return "symbol" == typeof t ? t : t + "";
}(s = "name")) in r ? Object.defineProperty(r, s, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : r[s] = n, "function" == typeof Error.captureStackTrace && Error.captureStackTrace(this, t);
}
};
},
4126(e, t, r) {
"use strict";
const s = r(1528), n = r(3738), a = r(86), o = {
needsProtoHack: new Set([
n.set,
n.map,
n.weakSet,
n.weakMap
]),
structuredCloneExists: "function" == typeof structuredClone
};
e.exports = o.clone = function(e, t = {}, r = null) {
if ("object" != typeof e || null === e) return e;
let s = o.clone, i = r;
if (t.shallow) {
if (!0 !== t.shallow) return o.cloneWithShallow(e, t);
s = (e) => e;
} else if (i) {
const t = i.get(e);
if (t) return t;
} else i = new Map();
const l = n.getInternalProto(e);
switch (l) {
case n.buffer: return false.from(e);
case n.date: return new Date(e.getTime());
case n.regex:
case n.url: return new l.constructor(e);
}
const c = o.base(e, l, t);
if (c === e) return e;
if (i && i.set(e, c), l === n.set) for (const r of e) c.add(s(r, t, i));
else if (l === n.map) for (const [r, n] of e) c.set(r, s(n, t, i));
const u = a.keys(e, t);
for (const r of u) {
if ("__proto__" === r) continue;
if (l === n.array && "length" === r) {
c.length = e.length;
continue;
}
if (o.structuredCloneExists && l === n.error && "stack" === r) continue;
const a = Object.getOwnPropertyDescriptor(e, r);
a ? a.get || a.set ? Object.defineProperty(c, r, a) : a.enumerable ? c[r] = s(e[r], t, i) : Object.defineProperty(c, r, {
enumerable: !1,
writable: !0,
configurable: !0,
value: s(e[r], t, i)
}) : Object.defineProperty(c, r, {
enumerable: !0,
writable: !0,
configurable: !0,
value: s(e[r], t, i)
});
}
return c;
}, o.cloneWithShallow = function(e, t) {
const r = t.shallow;
(t = Object.assign({}, t)).shallow = !1;
const n = new Map();
for (const t of r) {
const r = s(e, t);
"object" != typeof r && "function" != typeof r || n.set(r, r);
}
return o.clone(e, t, n);
}, o.base = function(e, t, r) {
if (!1 === r.prototype) return o.needsProtoHack.has(t) ? new t.constructor() : t === n.array ? [] : {};
const s = Object.getPrototypeOf(e);
if (s && s.isImmutable) return e;
if (t === n.array) {
const e = [];
return s !== t && Object.setPrototypeOf(e, s), e;
}
if (t === n.error && o.structuredCloneExists && (s === t || Error.isPrototypeOf(s.constructor))) {
const t = structuredClone(e);
return Object.getPrototypeOf(t) !== s && Object.setPrototypeOf(t, s), t;
}
if (o.needsProtoHack.has(t)) {
const e = new s.constructor();
return s !== t && Object.setPrototypeOf(e, s), e;
}
return Object.create(s);
};
},
7125(e, t, r) {
"use strict";
const s = r(3738), n = { mismatched: null };
e.exports = function(e, t, r) {
return r = Object.assign({ prototype: !0 }, r), !!n.isDeepEqual(e, t, r, []);
}, n.isDeepEqual = function(e, t, r, a) {
if (e === t) return 0 !== e || 1 / e == 1 / t;
const o = typeof e;
if (o !== typeof t) return !1;
if (null === e || null === t) return !1;
if ("function" === o) {
if (!r.deepFunction || e.toString() !== t.toString()) return !1;
} else if ("object" !== o) return e != e && t != t;
const i = n.getSharedType(e, t, !!r.prototype);
switch (i) {
case s.buffer: return !1;
case s.promise: return e === t;
case s.regex:
case s.url: return e.toString() === t.toString();
case n.mismatched: return !1;
}
for (let r = a.length - 1; r >= 0; --r) if (a[r].isSame(e, t)) return !0;
a.push(new n.SeenEntry(e, t));
try {
return !!n.isDeepEqualObj(i, e, t, r, a);
} finally {
a.pop();
}
}, n.getSharedType = function(e, t, r) {
if (r) return Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) ? n.mismatched : s.getInternalProto(e);
const a = s.getInternalProto(e);
return a !== s.getInternalProto(t) ? n.mismatched : a;
}, n.valueOf = function(e) {
const t = e.valueOf;
if (void 0 === t) return e;
try {
return t.call(e);
} catch (e) {
return e;
}
}, n.hasOwnEnumerableProperty = function(e, t) {
return Object.prototype.propertyIsEnumerable.call(e, t);
}, n.isSetSimpleEqual = function(e, t) {
for (const r of Set.prototype.values.call(e)) if (!Set.prototype.has.call(t, r)) return !1;
return !0;
}, n.isDeepEqualObj = function(e, t, r, a, o) {
const { isDeepEqual: i, valueOf: l, hasOwnEnumerableProperty: c } = n, { keys: u, getOwnPropertySymbols: f } = Object;
if (e === s.array) {
if (!a.part) {
if (t.length !== r.length) return !1;
for (let e = 0; e < t.length; ++e) if (!i(t[e], r[e], a, o)) return !1;
return !0;
}
for (const e of t) for (const t of r) if (i(e, t, a, o)) return !0;
} else if (e === s.set) {
if (t.size !== r.size) return !1;
if (!n.isSetSimpleEqual(t, r)) {
const e = new Set(Set.prototype.values.call(r));
for (const r of Set.prototype.values.call(t)) {
if (e.delete(r)) continue;
let t = !1;
for (const s of e) if (i(r, s, a, o)) {
e.delete(s), t = !0;
break;
}
if (!t) return !1;
}
}
} else if (e === s.map) {
if (t.size !== r.size) return !1;
for (const [e, s] of Map.prototype.entries.call(t)) {
if (void 0 === s && !Map.prototype.has.call(r, e)) return !1;
if (!i(s, Map.prototype.get.call(r, e), a, o)) return !1;
}
} else if (e === s.error && (t.name !== r.name || t.message !== r.message)) return !1;
const m = l(t), h = l(r);
if ((t !== m || r !== h) && !i(m, h, a, o)) return !1;
const p = u(t);
if (!a.part && p.length !== u(r).length && !a.skip) return !1;
let d = 0;
for (const e of p) if (a.skip && a.skip.includes(e)) void 0 === r[e] && ++d;
else {
if (!c(r, e)) return !1;
if (!i(t[e], r[e], a, o)) return !1;
}
if (!a.part && p.length - d !== u(r).length) return !1;
if (!1 !== a.symbols) {
const e = f(t), s = new Set(f(r));
for (const n of e) {
var g;
if (null === (g = a.skip) || void 0 === g || !g.includes(n)) {
if (c(t, n)) {
if (!c(r, n)) return !1;
if (!i(t[n], r[n], a, o)) return !1;
} else if (c(r, n)) return !1;
}
s.delete(n);
}
for (const e of s) if (c(r, e)) return !1;
}
return !0;
}, n.SeenEntry = class {
constructor(e, t) {
this.obj = e, this.ref = t;
}
isSame(e, t) {
return this.obj === e && this.ref === t;
}
};
},
8121(e) {
"use strict";
const t = {};
e.exports = function(e) {
if (!e) return "";
let r = "";
for (let s = 0; s < e.length; ++s) {
const n = e.charCodeAt(s);
t.isSafe(n) ? r += e[s] : r += t.escapeHtmlChar(n);
}
return r;
}, t.escapeHtmlChar = function(e) {
return t.namedHtml.get(e) || (e >= 256 ? "&#" + e + ";" : `&#x${e.toString(16).padStart(2, "0")};`);
}, t.isSafe = function(e) {
return t.safeCharCodes.has(e);
}, t.namedHtml = new Map([
[38, "&"],
[60, "<"],
[62, ">"],
[34, """],
[160, " "],
[162, "¢"],
[163, "£"],
[164, "¤"],
[169, "©"],
[174, "®"]
]), t.safeCharCodes = function() {
const e = new Set();
for (let t = 32; t < 123; ++t) (t >= 97 || t >= 65 && t <= 90 || t >= 48 && t <= 57 || 32 === t || 46 === t || 44 === t || 45 === t || 58 === t || 95 === t) && e.add(t);
return e;
}();
},
8669(e) {
"use strict";
e.exports = function(e) {
return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, "\\$&");
};
},
9725(e) {
"use strict";
e.exports = function() {};
},
3115(e, t, r) {
"use strict";
t.applyToDefaults = r(6084), t.assert = r(8253), t.AssertError = r(1803), t.clone = r(4126), t.deepEqual = r(7125), t.escapeHtml = r(8121), t.escapeRegex = r(8669), t.ignore = r(9725), t.merge = r(9315), t.reach = r(1528);
},
9315(e, t, r) {
"use strict";
const s = r(8253), n = r(4126), a = r(86), o = {};
e.exports = o.merge = function(e, t, r) {
if (s(e && "object" == typeof e, "Invalid target value: must be an object"), s(null == t || "object" == typeof t, "Invalid source value: must be null, undefined, or an object"), !t) return e;
if (r = Object.assign({
nullOverride: !0,
mergeArrays: !0
}, r), Array.isArray(t)) {
s(Array.isArray(e), "Cannot merge array onto an object"), r.mergeArrays || (e.length = 0);
for (let s = 0; s < t.length; ++s) e.push(n(t[s], { symbols: r.symbols }));
return e;
}
const i = a.keys(t, r);
for (let s = 0; s < i.length; ++s) {
const a = i[s];
if ("__proto__" === a || !Object.prototype.propertyIsEnumerable.call(t, a)) continue;
const l = t[a];
if (l && "object" == typeof l) {
if (e[a] === l) continue;
!e[a] || "object" != typeof e[a] || Array.isArray(e[a]) !== Array.isArray(l) || l instanceof Date || l instanceof RegExp ? e[a] = n(l, { symbols: r.symbols }) : o.merge(e[a], l, r);
} else (null != l || r.nullOverride) && (e[a] = l);
}
return e;
};
},
1528(e, t, r) {
"use strict";
const s = r(8253), n = {};
e.exports = function(e, t, r) {
if (!1 === t || null == t) return e;
"string" == typeof (r = r || {}) && (r = { separator: r });
const a = Array.isArray(t);
s(!a || !r.separator, "Separator option is not valid for array-based chain");
const o = a ? t : t.split(r.separator || ".");
let i = e;
for (let e = 0; e < o.length; ++e) {
let a = o[e];
const l = r.iterables && n.iterables(i);
if (Array.isArray(i) || "set" === l) {
const e = Number(a);
Number.isInteger(e) && (a = e < 0 ? i.length + e : e);
}
if (!i || "function" == typeof i && !1 === r.functions || !l && void 0 === i[a]) {
s(!r.strict || e + 1 === o.length, "Missing segment", a, "in reach path ", t), s("object" == typeof i || !0 === r.functions || "function" != typeof i, "Invalid segment", a, "in reach path ", t), i = r.default;
break;
}
i = l ? "set" === l ? [...i][a] : i.get(a) : i[a];
}
return i;
}, n.iterables = function(e) {
return e instanceof Set ? "set" : e instanceof Map ? "map" : void 0;
};
},
8314(e) {
"use strict";
e.exports = function(...e) {
try {
return JSON.stringify(...e);
} catch (e) {
return "[Cannot display object: " + e.message + "]";
}
};
},
3738(e, t) {
"use strict";
const r = {};
t = e.exports = {
array: Array.prototype,
buffer: !1,
date: Date.prototype,
error: Error.prototype,
generic: Object.prototype,
map: Map.prototype,
promise: Promise.prototype,
regex: RegExp.prototype,
set: Set.prototype,
url: URL.prototype,
weakMap: WeakMap.prototype,
weakSet: WeakSet.prototype
}, r.typeMap = new Map([
["[object Error]", t.error],
["[object Map]", t.map],
["[object Promise]", t.promise],
["[object Set]", t.set],
["[object URL]", t.url],
["[object WeakMap]", t.weakMap],
["[object WeakSet]", t.weakSet]
]), t.getInternalProto = function(e) {
if (Array.isArray(e)) return t.array;
if (e instanceof Date) return t.date;
if (e instanceof RegExp) return t.regex;
if (e instanceof Error) return t.error;
const s = Object.prototype.toString.call(e);
return r.typeMap.get(s) || t.generic;
};
},
86(e, t) {
"use strict";
t.keys = function(e, t = {}) {
return !1 !== t.symbols ? Reflect.ownKeys(e) : Object.getOwnPropertyNames(e);
};
},
8248(e, t, r) {
"use strict";
const { assert: s } = r(3115), n = {};
t.Sorter = class {
constructor() {
this._items = [], this.nodes = [];
}
add(e, t) {
var r, n, a, o;
const i = [].concat(null !== (r = (t = null != t ? t : {}).before) && void 0 !== r ? r : []), l = [].concat(null !== (n = t.after) && void 0 !== n ? n : []), c = null !== (a = t.group) && void 0 !== a ? a : "?", u = null !== (o = t.sort) && void 0 !== o ? o : 0;
s(!i.includes(c), `Item cannot come before itself: ${c}`), s(!i.includes("?"), "Item cannot come before unassociated items"), s(!l.includes(c), `Item cannot come after itself: ${c}`), s(!l.includes("?"), "Item cannot come after unassociated items"), Array.isArray(e) || (e = [e]);
for (const t of e) {
const e = {
seq: this._items.length,
sort: u,
before: i,
after: l,
group: c,
node: t
};
this._items.push(e);
}
if (!t.manual) {
const e = this._sort();
s(e, "item", "?" !== c ? `added into group ${c}` : "", "created a dependencies error");
}
return this.nodes;
}
merge(e) {
Array.isArray(e) || (e = [e]);
for (const t of e) if (t) for (const e of t._items) this._items.push(Object.assign({}, e));
this._items.sort(n.mergeSort);
for (let e = 0; e < this._items.length; ++e) this._items[e].seq = e;
const t = this._sort();
return s(t, "merge created a dependencies error"), this.nodes;
}
sort() {
const e = this._sort();
return s(e, "sort created a dependencies error"), this.nodes;
}
_sort() {
const e = {}, t = Object.create(null), r = Object.create(null);
for (const a of this._items) {
var s;
const o = a.seq, i = a.group;
r[i] = null !== (s = r[i]) && void 0 !== s ? s : [], r[i].push(o), e[o] = a.before;
for (const e of a.after) {
var n;
t[e] = null !== (n = t[e]) && void 0 !== n ? n : [], t[e].push(o);
}
}
for (const t in e) {
const s = [];
for (const n in e[t]) {
var a;
const o = e[t][n];
r[o] = null !== (a = r[o]) && void 0 !== a ? a : [], s.push(...r[o]);
}
e[t] = s;
}
for (const s in t) if (r[s]) for (const n of r[s]) e[n].push(...t[s]);
const o = {};
for (const t in e) {
const r = e[t];
for (const e of r) {
var i;
o[e] = null !== (i = o[e]) && void 0 !== i ? i : [], o[e].push(t);
}
}
const l = {}, c = [];
for (let e = 0; e < this._items.length; ++e) {
let t = e;
if (o[e]) {
t = null;
for (let e = 0; e < this._items.length; ++e) {
if (!0 === l[e]) continue;
o[e] || (o[e] = []);
const r = o[e].length;
let s = 0;
for (let t = 0; t < r; ++t) l[o[e][t]] && ++s;
if (s === r) {
t = e;
break;
}
}
}
null !== t && (l[t] = !0, c.push(t));
}
if (c.length !== this._items.length) return !1;
const u = {};
for (const e of this._items) u[e.seq] = e;
this._items = [], this.nodes = [];
for (const e of c) {
const t = u[e];
this.nodes.push(t.node), this._items.push(t);
}
return !0;
}
}, n.mergeSort = (e, t) => e.sort === t.sort ? 0 : e.sort < t.sort ? -1 : 1;
},
554() {},
9017() {},
125() {},
8663() {},
6984() {},
7368(e, t, r) {
"use strict";
t.tlds = void 0;
const s = r(1044);
t.tlds = new Set(s.TLDS.map((e) => e.toLowerCase()));
},
1044(e, t) {
"use strict";
t.TLDS = void 0, t.TLDS = [
"AAA",
"AARP",
"ABB",
"ABBOTT",
"ABBVIE",
"ABC",
"ABLE",
"ABOGADO",
"ABUDHABI",
"AC",
"ACADEMY",
"ACCENTURE",
"ACCOUNTANT",
"ACCOUNTANTS",
"ACO",
"ACTOR",
"AD",
"ADS",
"ADULT",
"AE",
"AEG",
"AERO",
"AETNA",
"AF",
"AFL",
"AFRICA",
"AG",
"AGAKHAN",
"AGENCY",
"AI",
"AIG",
"AIRBUS",
"AIRFORCE",
"AIRTEL",
"AKDN",
"AL",
"ALIBABA",
"ALIPAY",
"ALLFINANZ",
"ALLSTATE",
"ALLY",
"ALSACE",
"ALSTOM",
"AM",
"AMAZON",
"AMERICANEXPRESS",
"AMERICANFAMILY",
"AMEX",
"AMFAM",
"AMICA",
"AMSTERDAM",
"ANALYTICS",
"ANDROID",
"ANQUAN",
"ANZ",
"AO",
"AOL",
"APARTMENTS",
"APP",
"APPLE",
"AQ",
"AQUARELLE",
"AR",
"ARAB",
"ARAMCO",
"ARCHI",
"ARMY",
"ARPA",
"ART",
"ARTE",
"AS",
"ASDA",
"ASIA",
"ASSOCIATES",
"AT",
"ATHLETA",
"ATTORNEY",
"AU",
"AUCTION",
"AUDI",
"AUDIBLE",
"AUDIO",
"AUSPOST",
"AUTHOR",
"AUTO",
"AUTOS",
"AW",
"AWS",
"AX",
"AXA",
"AZ",
"AZURE",
"BA",
"BABY",
"BAIDU",
"BANAMEX",
"BAND",
"BANK",
"BAR",
"BARCELONA",
"BARCLAYCARD",
"BARCLAYS",
"BAREFOOT",
"BARGAINS",
"BASEBALL",
"BASKETBALL",
"BAUHAUS",
"BAYERN",
"BB",
"BBC",
"BBT",
"BBVA",
"BCG",
"BCN",
"BD",
"BE",
"BEATS",
"BEAUTY",
"BEER",
"BERLIN",
"BEST",
"BESTBUY",
"BET",
"BF",
"BG",
"BH",
"BHARTI",
"BI",
"BIBLE",
"BID",
"BIKE",
"BING",
"BINGO",
"BIO",
"BIZ",
"BJ",
"BLACK",
"BLACKFRIDAY",
"BLOCKBUSTER",
"BLOG",
"BLOOMBERG",
"BLUE",
"BM",
"BMS",
"BMW",
"BN",
"BNPPARIBAS",
"BO",
"BOATS",
"BOEHRINGER",
"BOFA",
"BOM",
"BOND",
"BOO",
"BOOK",
"BOOKING",
"BOSCH",
"BOSTIK",
"BOSTON",
"BOT",
"BOUTIQUE",
"BOX",
"BR",
"BRADESCO",
"BRIDGESTONE",
"BROADWAY",
"BROKER",
"BROTHER",
"BRUSSELS",
"BS",
"BT",
"BUILD",
"BUILDERS",
"BUSINESS",
"BUY",
"BUZZ",
"BV",
"BW",
"BY",
"BZ",
"BZH",
"CA",
"CAB",
"CAFE",
"CAL",
"CALL",
"CALVINKLEIN",
"CAM",
"CAMERA",
"CAMP",
"CANON",
"CAPETOWN",
"CAPITAL",
"CAPITALONE",
"CAR",
"CARAVAN",
"CARDS",
"CARE",
"CAREER",
"CAREERS",
"CARS",
"CASA",
"CASE",
"CASH",
"CASINO",
"CAT",
"CATERING",
"CATHOLIC",
"CBA",
"CBN",
"CBRE",
"CC",
"CD",
"CENTER",
"CEO",
"CERN",
"CF",
"CFA",
"CFD",
"CG",
"CH",
"CHANEL",
"CHANNEL",
"CHARITY",
"CHASE",
"CHAT",
"CHEAP",
"CHINTAI",
"CHRISTMAS",
"CHROME",
"CHURCH",
"CI",
"CIPRIANI",
"CIRCLE",
"CISCO",
"CITADEL",
"CITI",
"CITIC",
"CITY",
"CK",
"CL",
"CLAIMS",
"CLEANING",
"CLICK",
"CLINIC",
"CLINIQUE",
"CLOTHING",
"CLOUD",
"CLUB",
"CLUBMED",
"CM",
"CN",
"CO",
"COACH",
"CODES",
"COFFEE",
"COLLEGE",
"COLOGNE",
"COM",
"COMMBANK",
"COMMUNITY",
"COMPANY",
"COMPARE",
"COMPUTER",
"COMSEC",
"CONDOS",
"CONSTRUCTION",
"CONSULTING",
"CONTACT",
"CONTRACTORS",
"COOKING",
"COOL",
"COOP",
"CORSICA",
"COUNTRY",
"COUPON",
"COUPONS",
"COURSES",
"CPA",
"CR",
"CREDIT",
"CREDITCARD",
"CREDITUNION",
"CRICKET",
"CROWN",
"CRS",
"CRUISE",
"CRUISES",
"CU",
"CUISINELLA",
"CV",
"CW",
"CX",
"CY",
"CYMRU",
"CYOU",
"CZ",
"DAD",
"DANCE",
"DATA",
"DATE",
"DATING",
"DATSUN",
"DAY",
"DCLK",
"DDS",
"DE",
"DEAL",
"DEALER",
"DEALS",
"DEGREE",
"DELIVERY",
"DELL",
"DELOITTE",
"DELTA",
"DEMOCRAT",
"DENTAL",
"DENTIST",
"DESI",
"DESIGN",
"DEV",
"DHL",
"DIAMONDS",
"DIET",
"DIGITAL",
"DIRECT",
"DIRECTORY",
"DISCOUNT",
"DISCOVER",
"DISH",
"DIY",
"DJ",
"DK",
"DM",
"DNP",
"DO",
"DOCS",
"DOCTOR",
"DOG",
"DOMAINS",
"DOT",
"DOWNLOAD",
"DRIVE",
"DTV",
"DUBAI",
"DUPONT",
"DURBAN",
"DVAG",
"DVR",
"DZ",
"EARTH",
"EAT",
"EC",
"ECO",
"EDEKA",
"EDU",
"EDUCATION",
"EE",
"EG",
"EMAIL",
"EMERCK",
"ENERGY",
"ENGINEER",
"ENGINEERING",
"ENTERPRISES",
"EPSON",
"EQUIPMENT",
"ER",
"ERICSSON",
"ERNI",
"ES",
"ESQ",
"ESTATE",
"ET",
"EU",
"EUROVISION",
"EUS",
"EVENTS",
"EXCHANGE",
"EXPERT",
"EXPOSED",
"EXPRESS",
"EXTRASPACE",
"FAGE",
"FAIL",
"FAIRWINDS",
"FAITH",
"FAMILY",
"FAN",
"FANS",
"FARM",
"FARMERS",
"FASHION",
"FAST",
"FEDEX",
"FEEDBACK",
"FERRARI",
"FERRERO",
"FI",
"FIDELITY",
"FIDO",
"FILM",
"FINAL",
"FINANCE",
"FINANCIAL",
"FIRE",
"FIRESTONE",
"FIRMDALE",
"FISH",
"FISHING",
"FIT",
"FITNESS",
"FJ",
"FK",
"FLICKR",
"FLIGHTS",
"FLIR",
"FLORIST",
"FLOWERS",
"FLY",
"FM",
"FO",
"FOO",
"FOOD",
"FOOTBALL",
"FORD",
"FOREX",
"FORSALE",
"FORUM",
"FOUNDATION",
"FOX",
"FR",
"FREE",
"FRESENIUS",
"FRL",
"FROGANS",
"FRONTIER",
"FTR",
"FUJITSU",
"FUN",
"FUND",
"FURNITURE",
"FUTBOL",
"FYI",
"GA",
"GAL",
"GALLERY",
"GALLO",
"GALLUP",
"GAME",
"GAMES",
"GAP",
"GARDEN",
"GAY",
"GB",
"GBIZ",
"GD",
"GDN",
"GE",
"GEA",
"GENT",
"GENTING",
"GEORGE",
"GF",
"GG",
"GGEE",
"GH",
"GI",
"GIFT",
"GIFTS",
"GIVES",
"GIVING",
"GL",
"GLASS",
"GLE",
"GLOBAL",
"GLOBO",
"GM",
"GMAIL",
"GMBH",
"GMO",
"GMX",
"GN",
"GODADDY",
"GOLD",
"GOLDPOINT",
"GOLF",
"GOODYEAR",
"GOOG",
"GOOGLE",
"GOP",
"GOT",
"GOV",
"GP",
"GQ",
"GR",
"GRAINGER",
"GRAPHICS",
"GRATIS",
"GREEN",
"GRIPE",
"GROCERY",
"GROUP",
"GS",
"GT",
"GU",
"GUCCI",
"GUGE",
"GUIDE",
"GUITARS",
"GURU",
"GW",
"GY",
"HAIR",
"HAMBURG",
"HANGOUT",
"HAUS",
"HBO",
"HDFC",
"HDFCBANK",
"HEALTH",
"HEALTHCARE",
"HELP",
"HELSINKI",
"HERE",
"HERMES",
"HIPHOP",
"HISAMITSU",
"HITACHI",
"HIV",
"HK",
"HKT",
"HM",
"HN",
"HOCKEY",
"HOLDINGS",
"HOLIDAY",
"HOMEDEPOT",
"HOMEGOODS",
"HOMES",
"HOMESENSE",
"HONDA",
"HORSE",
"HOSPITAL",
"HOST",
"HOSTING",
"HOT",
"HOTELS",
"HOTMAIL",
"HOUSE",
"HOW",
"HR",
"HSBC",
"HT",
"HU",
"HUGHES",
"HYATT",
"HYUNDAI",
"IBM",
"ICBC",
"ICE",
"ICU",
"ID",
"IE",
"IEEE",
"IFM",
"IKANO",
"IL",
"IM",
"IMAMAT",
"IMDB",
"IMMO",
"IMMOBILIEN",
"IN",
"INC",
"INDUSTRIES",
"INFINITI",
"INFO",
"ING",
"INK",
"INSTITUTE",
"INSURANCE",
"INSURE",
"INT",
"INTERNATIONAL",
"INTUIT",
"INVESTMENTS",
"IO",
"IPIRANGA",
"IQ",
"IR",
"IRISH",
"IS",
"ISMAILI",
"IST",
"ISTANBUL",
"IT",
"ITAU",
"ITV",
"JAGUAR",
"JAVA",
"JCB",
"JE",
"JEEP",
"JETZT",
"JEWELRY",
"JIO",
"JLL",
"JM",
"JMP",
"JNJ",
"JO",
"JOBS",
"JOBURG",
"JOT",
"JOY",
"JP",
"JPMORGAN",
"JPRS",
"JUEGOS",
"JUNIPER",
"KAUFEN",
"KDDI",
"KE",
"KERRYHOTELS",
"KERRYPROPERTIES",
"KFH",
"KG",
"KH",
"KI",
"KIA",
"KIDS",
"KIM",
"KINDLE",
"KITCHEN",
"KIWI",
"KM",
"KN",
"KOELN",
"KOMATSU",
"KOSHER",
"KP",
"KPMG",
"KPN",
"KR",
"KRD",
"KRED",
"KUOKGROUP",
"KW",
"KY",
"KYOTO",
"KZ",
"LA",
"LACAIXA",
"LAMBORGHINI",
"LAMER",
"LAND",
"LANDROVER",
"LANXESS",
"LASALLE",
"LAT",
"LATINO",
"LATROBE",
"LAW",
"LAWYER",
"LB",
"LC",
"LDS",
"LEASE",
"LECLERC",
"LEFRAK",
"LEGAL",
"LEGO",
"LEXUS",
"LGBT",
"LI",
"LIDL",
"LIFE",
"LIFEINSURANCE",
"LIFESTYLE",
"LIGHTING",
"LIKE",
"LILLY",
"LIMITED",
"LIMO",
"LINCOLN",
"LINK",
"LIVE",
"LIVING",
"LK",
"LLC",
"LLP",
"LOAN",
"LOANS",
"LOCKER",
"LOCUS",
"LOL",
"LONDON",
"LOTTE",
"LOTTO",
"LOVE",
"LPL",
"LPLFINANCIAL",
"LR",
"LS",
"LT",
"LTD",
"LTDA",
"LU",
"LUNDBECK",
"LUXE",
"LUXURY",
"LV",
"LY",
"MA",
"MADRID",
"MAIF",
"MAISON",
"MAKEUP",
"MAN",
"MANAGEMENT",
"MANGO",
"MAP",
"MARKET",
"MARKETING",
"MARKETS",
"MARRIOTT",
"MARSHALLS",
"MATTEL",
"MBA",
"MC",
"MCKINSEY",
"MD",
"ME",
"MED",
"MEDIA",
"MEET",
"MELBOURNE",
"MEME",
"MEMORIAL",
"MEN",
"MENU",
"MERCK",
"MERCKMSD",
"MG",
"MH",
"MIAMI",
"MICROSOFT",
"MIL",
"MINI",
"MINT",
"MIT",
"MITSUBISHI",
"MK",
"ML",
"MLB",
"MLS",
"MM",
"MMA",
"MN",
"MO",
"MOBI",
"MOBILE",
"MODA",
"MOE",
"MOI",
"MOM",
"MONASH",
"MONEY",
"MONSTER",
"MORMON",
"MORTGAGE",
"MOSCOW",
"MOTO",
"MOTORCYCLES",
"MOV",
"MOVIE",
"MP",
"MQ",
"MR",
"MS",
"MSD",
"MT",
"MTN",
"MTR",
"MU",
"MUSEUM",
"MUSIC",
"MV",
"MW",
"MX",
"MY",
"MZ",
"NA",
"NAB",
"NAGOYA",
"NAME",
"NAVY",
"NBA",
"NC",
"NE",
"NEC",
"NET",
"NETBANK",
"NETFLIX",
"NETWORK",
"NEUSTAR",
"NEW",
"NEWS",
"NEXT",
"NEXTDIRECT",
"NEXUS",
"NF",
"NFL",
"NG",
"NGO",
"NHK",
"NI",
"NICO",
"NIKE",
"NIKON",
"NINJA",
"NISSAN",
"NISSAY",
"NL",
"NO",
"NOKIA",
"NORTON",
"NOW",
"NOWRUZ",
"NOWTV",
"NP",
"NR",
"NRA",
"NRW",
"NTT",
"NU",
"NYC",
"NZ",
"OBI",
"OBSERVER",
"OFFICE",
"OKINAWA",
"OLAYAN",
"OLAYANGROUP",
"OLLO",
"OM",
"OMEGA",
"ONE",
"ONG",
"ONL",
"ONLINE",
"OOO",
"OPEN",
"ORACLE",
"ORANGE",
"ORG",
"ORGANIC",
"ORIGINS",
"OSAKA",
"OTSUKA",
"OTT",
"OVH",
"PA",
"PAGE",
"PANASONIC",
"PARIS",
"PARS",
"PARTNERS",
"PARTS",
"PARTY",
"PAY",
"PCCW",
"PE",
"PET",
"PF",
"PFIZER",
"PG",
"PH",
"PHARMACY",
"PHD",
"PHILIPS",
"PHONE",
"PHOTO",
"PHOTOGRAPHY",
"PHOTOS",
"PHYSIO",
"PICS",
"PICTET",
"PICTURES",
"PID",
"PIN",
"PING",
"PINK",
"PIONEER",
"PIZZA",
"PK",
"PL",
"PLACE",
"PLAY",
"PLAYSTATION",
"PLUMBING",
"PLUS",
"PM",
"PN",
"PNC",
"POHL",
"POKER",
"POLITIE",
"PORN",
"POST",
"PR",
"PRAXI",
"PRESS",
"PRIME",
"PRO",
"PROD",
"PRODUCTIONS",
"PROF",
"PROGRESSIVE",
"PROMO",
"PROPERTIES",
"PROPERTY",
"PROTECTION",
"PRU",
"PRUDENTIAL",
"PS",
"PT",
"PUB",
"PW",
"PWC",
"PY",
"QA",
"QPON",
"QUEBEC",
"QUEST",
"RACING",
"RADIO",
"RE",
"READ",
"REALESTATE",
"REALTOR",
"REALTY",
"RECIPES",
"RED",
"REDUMBRELLA",
"REHAB",
"REISE",
"REISEN",
"REIT",
"RELIANCE",
"REN",
"RENT",
"RENTALS",
"REPAIR",
"REPORT",
"REPUBLICAN",
"REST",
"RESTAURANT",
"REVIEW",
"REVIEWS",
"REXROTH",
"RICH",
"RICHARDLI",
"RICOH",
"RIL",
"RIO",
"RIP",
"RO",
"ROCKS",
"RODEO",
"ROGERS",
"ROOM",
"RS",
"RSVP",
"RU",
"RUGBY",
"RUHR",
"RUN",
"RW",
"RWE",
"RYUKYU",
"SA",
"SAARLAND",
"SAFE",
"SAFETY",
"SAKURA",
"SALE",
"SALON",
"SAMSCLUB",
"SAMSUNG",
"SANDVIK",
"SANDVIKCOROMANT",
"SANOFI",
"SAP",
"SARL",
"SAS",
"SAVE",
"SAXO",
"SB",
"SBI",
"SBS",
"SC",
"SCB",
"SCHAEFFLER",
"SCHMIDT",
"SCHOLARSHIPS",
"SCHOOL",
"SCHULE",
"SCHWARZ",
"SCIENCE",
"SCOT",
"SD",
"SE",
"SEARCH",
"SEAT",
"SECURE",
"SECURITY",
"SEEK",
"SELECT",
"SENER",
"SERVICES",
"SEVEN",
"SEW",
"SEX",
"SEXY",
"SFR",
"SG",
"SH",
"SHANGRILA",
"SHARP",
"SHELL",
"SHIA",
"SHIKSHA",
"SHOES",
"SHOP",
"SHOPPING",
"SHOUJI",
"SHOW",
"SI",
"SILK",
"SINA",
"SINGLES",
"SITE",
"SJ",
"SK",
"SKI",
"SKIN",
"SKY",
"SKYPE",
"SL",
"SLING",
"SM",
"SMART",
"SMILE",
"SN",
"SNCF",
"SO",
"SOCCER",
"SOCIAL",
"SOFTBANK",
"SOFTWARE",
"SOHU",
"SOLAR",
"SOLUTIONS",
"SONG",
"SONY",
"SOY",
"SPA",
"SPACE",
"SPORT",
"SPOT",
"SR",
"SRL",
"SS",
"ST",
"STADA",
"STAPLES",
"STAR",
"STATEBANK",
"STATEFARM",
"STC",
"STCGROUP",
"STOCKHOLM",
"STORAGE",
"STORE",
"STREAM",
"STUDIO",
"STUDY",
"STYLE",
"SU",
"SUCKS",
"SUPPLIES",
"SUPPLY",
"SUPPORT",
"SURF",
"SURGERY",
"SUZUKI",
"SV",
"SWATCH",
"SWISS",
"SX",
"SY",
"SYDNEY",
"SYSTEMS",
"SZ",
"TAB",
"TAIPEI",
"TALK",
"TAOBAO",
"TARGET",
"TATAMOTORS",
"TATAR",
"TATTOO",
"TAX",
"TAXI",
"TC",
"TCI",
"TD",
"TDK",
"TEAM",
"TECH",
"TECHNOLOGY",
"TEL",
"TEMASEK",
"TENNIS",
"TEVA",
"TF",
"TG",
"TH",
"THD",
"THEATER",
"THEATRE",
"TIAA",
"TICKETS",
"TIENDA",
"TIPS",
"TIRES",
"TIROL",
"TJ",
"TJMAXX",
"TJX",
"TK",
"TKMAXX",
"TL",
"TM",
"TMALL",
"TN",
"TO",
"TODAY",
"TOKYO",
"TOOLS",
"TOP",
"TORAY",
"TOSHIBA",
"TOTAL",
"TOURS",
"TOWN",
"TOYOTA",
"TOYS",
"TR",
"TRADE",
"TRADING",
"TRAINING",
"TRAVEL",
"TRAVELERS",
"TRAVELERSINSURANCE",
"TRUST",
"TRV",
"TT",
"TUBE",
"TUI",
"TUNES",
"TUSHU",
"TV",
"TVS",
"TW",
"TZ",
"UA",
"UBANK",
"UBS",
"UG",
"UK",
"UNICOM",
"UNIVERSITY",
"UNO",
"UOL",
"UPS",
"US",
"UY",
"UZ",
"VA",
"VACATIONS",
"VANA",
"VANGUARD",
"VC",
"VE",
"VEGAS",
"VENTURES",
"VERISIGN",
"VERSICHERUNG",
"VET",
"VG",
"VI",
"VIAJES",
"VIDEO",
"VIG",
"VIKING",
"VILLAS",
"VIN",
"VIP",
"VIRGIN",
"VISA",
"VISION",
"VIVA",
"VIVO",
"VLAANDEREN",
"VN",
"VODKA",
"VOLVO",
"VOTE",
"VOTING",
"VOTO",
"VOYAGE",
"VU",
"WALES",
"WALMART",
"WALTER",
"WANG",
"WANGGOU",
"WATCH",
"WATCHES",
"WEATHER",
"WEATHERCHANNEL",
"WEBCAM",
"WEBER",
"WEBSITE",
"WED",
"WEDDING",
"WEIBO",
"WEIR",
"WF",
"WHOSWHO",
"WIEN",
"WIKI",
"WILLIAMHILL",
"WIN",
"WINDOWS",
"WINE",
"WINNERS",
"WME",
"WOODSIDE",
"WORK",
"WORKS",
"WORLD",
"WOW",
"WS",
"WTC",
"WTF",
"XBOX",
"XEROX",
"XIHUAN",
"XIN",
"XN--11B4C3D",
"XN--1CK2E1B",
"XN--1QQW23A",
"XN--2SCRJ9C",
"XN--30RR7Y",
"XN--3BST00M",
"XN--3DS443G",
"XN--3E0B707E",
"XN--3HCRJ9C",
"XN--3PXU8K",
"XN--42C2D9A",
"XN--45BR5CYL",
"XN--45BRJ9C",
"XN--45Q11C",
"XN--4DBRK0CE",
"XN--4GBRIM",
"XN--54B7FTA0CC",
"XN--55QW42G",
"XN--55QX5D",
"XN--5SU34J936BGSG",
"XN--5TZM5G",
"XN--6FRZ82G",
"XN--6QQ986B3XL",
"XN--80ADXHKS",
"XN--80AO21A",
"XN--80AQECDR1A",
"XN--80ASEHDB",
"XN--80ASWG",
"XN--8Y0A063A",
"XN--90A3AC",
"XN--90AE",
"XN--90AIS",
"XN--9DBQ2A",
"XN--9ET52U",
"XN--9KRT00A",
"XN--B4W605FERD",
"XN--BCK1B9A5DRE4C",
"XN--C1AVG",
"XN--C2BR7G",
"XN--CCK2B3B",
"XN--CCKWCXETD",
"XN--CG4BKI",
"XN--CLCHC0EA0B2G2A9GCD",
"XN--CZR694B",
"XN--CZRS0T",
"XN--CZRU2D",
"XN--D1ACJ3B",
"XN--D1ALF",
"XN--E1A4C",
"XN--ECKVDTC9D",
"XN--EFVY88H",
"XN--FCT429K",
"XN--FHBEI",
"XN--FIQ228C5HS",
"XN--FIQ64B",
"XN--FIQS8S",
"XN--FIQZ9S",
"XN--FJQ720A",
"XN--FLW351E",
"XN--FPCRJ9C3D",
"XN--FZC2C9E2C",
"XN--FZYS8D69UVGM",
"XN--G2XX48C",
"XN--GCKR3F0F",
"XN--GECRJ9C",
"XN--GK3AT1E",
"XN--H2BREG3EVE",
"XN--H2BRJ9C",
"XN--H2BRJ9C8C",
"XN--HXT814E",
"XN--I1B6B1A6A2E",
"XN--IMR513N",
"XN--IO0A7I",
"XN--J1AEF",
"XN--J1AMH",
"XN--J6W193G",
"XN--JLQ480N2RG",
"XN--JVR189M",
"XN--KCRX77D1X4A",
"XN--KPRW13D",
"XN--KPRY57D",
"XN--KPUT3I",
"XN--L1ACC",
"XN--LGBBAT1AD8J",
"XN--MGB9AWBF",
"XN--MGBA3A3EJT",
"XN--MGBA3A4F16A",
"XN--MGBA7C0BBN0A",
"XN--MGBAAM7A8H",
"XN--MGBAB2BD",
"XN--MGBAH1A3HJKRD",
"XN--MGBAI9AZGQP6J",
"XN--MGBAYH7GPA",
"XN--MGBBH1A",
"XN--MGBBH1A71E",
"XN--MGBC0A9AZCG",
"XN--MGBCA7DZDO",
"XN--MGBCPQ6GPA1A",
"XN--MGBERP4A5D4AR",
"XN--MGBGU82A",
"XN--MGBI4ECEXP",
"XN--MGBPL2FH",
"XN--MGBT3DHD",
"XN--MGBTX2B",
"XN--MGBX4CD0AB",
"XN--MIX891F",
"XN--MK1BU44C",
"XN--MXTQ1M",
"XN--NGBC5AZD",
"XN--NGBE9E0A",
"XN--NGBRX",
"XN--NODE",
"XN--NQV7F",
"XN--NQV7FS00EMA",
"XN--NYQY26A",
"XN--O3CW4H",
"XN--OGBPF8FL",
"XN--OTU796D",
"XN--P1ACF",
"XN--P1AI",
"XN--PGBS0DH",
"XN--PSSY2U",
"XN--Q7CE6A",
"XN--Q9JYB4C",
"XN--QCKA1PMC",
"XN--QXA6A",
"XN--QXAM",
"XN--RHQV96G",
"XN--ROVU88B",
"XN--RVC1E0AM3E",
"XN--S9BRJ9C",
"XN--SES554G",
"XN--T60B56A",
"XN--TCKWE",
"XN--TIQ49XQYJ",
"XN--UNUP4Y",
"XN--VERMGENSBERATER-CTB",
"XN--VERMGENSBERATUNG-PWB",
"XN--VHQUV",
"XN--VUQ861B",
"XN--W4R85EL8FHU5DNRA",
"XN--W4RS40L",
"XN--WGBH1C",
"XN--WGBL6A",
"XN--XHQ521B",
"XN--XKC2AL3HYE2A",
"XN--XKC2DL3A5EE0H",
"XN--Y9A3AQ",
"XN--YFRO4I67O",
"XN--YGBI2AMMX",
"XN--ZFR164B",
"XXX",
"XYZ",
"YACHTS",
"YAHOO",
"YAMAXUN",
"YANDEX",
"YE",
"YODOBASHI",
"YOGA",
"YOKOHAMA",
"YOU",
"YOUTUBE",
"YT",
"YUN",
"ZA",
"ZAPPOS",
"ZARA",
"ZERO",
"ZIP",
"ZM",
"ZONE",
"ZUERICH",
"ZW"
];
},
6913(e) {
"use strict";
e.exports = { version: "18.3.0" };
}
};
const t = {};
function r(s) {
const n = t[s];
if (void 0 !== n) return n.exports;
const a = t[s] = { exports: {} };
return e[s](a, a.exports, r), a.exports;
}
return r.n = (e) => {
const t = e && e.__esModule ? () => e.default : () => e;
return r.d(t, { a: t }), t;
}, r.d = (e, t) => {
for (var s in t) r.o(t, s) && !r.o(e, s) && Object.defineProperty(e, s, {
enumerable: !0,
get: t[s]
});
}, r.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), r(1100);
})());
})))(), 1);
const imageSchema = import_joi_browser_min.default.object({
id: import_joi_browser_min.default.number().required(),
created: import_joi_browser_min.default.date().required(),
title: import_joi_browser_min.default.string().min(1).max(100).required(),
type: import_joi_browser_min.default.string().valid("jpg", "png").required(),
size: import_joi_browser_min.default.number().required(),
url: import_joi_browser_min.default.string().uri().required()
});
const ratingSchema = import_joi_browser_min.default.object({
id: import_joi_browser_min.default.number().required(),
stars: import_joi_browser_min.default.number().min(1).max(5).required(),
title: import_joi_browser_min.default.string().min(1).max(100).required(),
text: import_joi_browser_min.default.string().min(1).max(1e3).required(),
images: import_joi_browser_min.default.array().items(imageSchema).required()
});
import_joi_browser_min.default.object({
id: import_joi_browser_min.default.number().required(),
created: import_joi_browser_min.default.date().required(),
title: import_joi_browser_min.default.string().min(1).max(100).required(),
brand: import_joi_browser_min.default.string().min(1).max(30).required(),
description: import_joi_browser_min.default.string().min(1).max(500).required(),
price: import_joi_browser_min.default.number().min(1).max(1e4).required(),
discount: import_joi_browser_min.default.number().min(1).max(100).allow(null).required(),
quantity: import_joi_browser_min.default.number().min(0).max(10).required(),
tags: import_joi_browser_min.default.array().items(import_joi_browser_min.default.string().min(1).max(30)).required(),
images: import_joi_browser_min.default.array().items(imageSchema).required(),
ratings: import_joi_browser_min.default.array().items(ratingSchema).required()
}).validate({});