@expofp/floorplan
Version:
Interactive floor plan library for expos and events
1,616 lines (1,610 loc) • 280 kB
JavaScript
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
e.SENTRY_RELEASE = { id: "3.20.0" };
var t = new e.Error().stack;
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "efb8cd3d-d71b-41bd-bc15-44d64adc9276", e._sentryDebugIdIdentifier = "sentry-dbid-efb8cd3d-d71b-41bd-bc15-44d64adc9276");
} catch {}
})();
import { r as e, t } from "./rolldown-runtime-7-Wh3Cc7.js";
import { s as n } from "./efp-debug-init-CHsd9_cw.js";
import { t as r } from "./es5-cNhUtAJ8.js";
//#region ../config/src/lib/config-store.ts
var i;
function a(e) {
i = e;
}
function o() {
if (!i) throw Error("Config not loaded yet");
return i;
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
var s;
function c(e, t, n) {
var r;
function i(n, r) {
if (n._zod || Object.defineProperty(n, "_zod", {
value: {
def: r,
constr: s,
traits: /* @__PURE__ */ new Set()
},
enumerable: !1
}), n._zod.traits.has(e)) return;
n._zod.traits.add(e), t(n, r);
let i = s.prototype, a = Object.keys(i);
for (let e = 0; e < a.length; e++) {
let t = a[e];
t in n || (n[t] = i[t].bind(n));
}
}
let a = (r = n == null ? void 0 : n.Parent) == null ? Object : r;
class o extends a {}
Object.defineProperty(o, "name", { value: e });
function s(e) {
var t;
let r = n != null && n.Parent ? new o() : this;
i(r, e), (t = r._zod).deferred != null || (t.deferred = []);
for (let e of r._zod.deferred) e();
return r;
}
return Object.defineProperty(s, "init", { value: i }), Object.defineProperty(s, Symbol.hasInstance, { value: (t) => {
var r;
return n != null && n.Parent && t instanceof n.Parent ? !0 : t == null || (r = t._zod) == null || (r = r.traits) == null ? void 0 : r.has(e);
} }), Object.defineProperty(s, "name", { value: e }), s;
}
var l = class extends Error {
constructor() {
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
}
}, u = class extends Error {
constructor(e) {
super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
}
};
(s = globalThis).__zod_globalConfig != null || (s.__zod_globalConfig = {});
var d = globalThis.__zod_globalConfig;
function f(e) {
return e && Object.assign(d, e), d;
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
function p(e) {
let t = Object.values(e).filter((e) => typeof e == "number");
return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
}
function m(e, t) {
return typeof t == "bigint" ? t.toString() : t;
}
function h(e) {
return { get value() {
{
let t = e();
return Object.defineProperty(this, "value", { value: t }), t;
}
throw Error("cached value already set");
} };
}
function g(e) {
return e == null;
}
function _(e) {
let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
return e.slice(t, n);
}
function v(e, t) {
let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1);
return Math.abs(n - r) < i ? 0 : n - r;
}
var y = /* @__PURE__*/ Symbol("evaluating");
function b(e, t, n) {
let r;
Object.defineProperty(e, t, {
get() {
if (r !== y) return r === void 0 && (r = y, r = n()), r;
},
set(n) {
Object.defineProperty(e, t, { value: n });
},
configurable: !0
});
}
function x(e, t, n) {
Object.defineProperty(e, t, {
value: n,
writable: !0,
enumerable: !0,
configurable: !0
});
}
function S(...e) {
let t = {};
for (let n of e) {
let e = Object.getOwnPropertyDescriptors(n);
Object.assign(t, e);
}
return Object.defineProperties({}, t);
}
function C(e) {
return JSON.stringify(e);
}
function ee(e) {
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
}
var te = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
function ne(e) {
return typeof e == "object" && !!e && !Array.isArray(e);
}
var re = /* @__PURE__*/ h(() => {
var e;
if (d.jitless || typeof navigator < "u" && !((e = navigator) == null || (e = e.userAgent) == null) && e.includes("Cloudflare")) return !1;
try {
return Function(""), !0;
} catch {
return !1;
}
});
function ie(e) {
if (ne(e) === !1) return !1;
let t = e.constructor;
if (t === void 0 || typeof t != "function") return !0;
let n = t.prototype;
return !(ne(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
}
function ae(e) {
return ie(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
}
var oe = /* @__PURE__*/ new Set([
"string",
"number",
"symbol"
]);
function w(e) {
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function se(e, t, n) {
let r = new e._zod.constr(t == null ? e._zod.def : t);
return (!t || n != null && n.parent) && (r._zod.parent = e), r;
}
function T(e) {
let t = e;
if (!t) return {};
if (typeof t == "string") return { error: () => t };
if ((t == null ? void 0 : t.message) !== void 0) {
if ((t == null ? void 0 : t.error) !== void 0) throw Error("Cannot specify both `message` and `error` params");
t.error = t.message;
}
return delete t.message, typeof t.error == "string" ? {
...t,
error: () => t.error
} : t;
}
function ce(e) {
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
}
var le = {
safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
int32: [-2147483648, 2147483647],
uint32: [0, 4294967295],
float32: [-34028234663852886e22, 34028234663852886e22],
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
};
function ue(e, t) {
let n = e._zod.def, r = n.checks;
if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
return se(e, S(e._zod.def, {
get shape() {
let e = {};
for (let r in t) {
if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
t[r] && (e[r] = n.shape[r]);
}
return x(this, "shape", e), e;
},
checks: []
}));
}
function de(e, t) {
let n = e._zod.def, r = n.checks;
if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
return se(e, S(e._zod.def, {
get shape() {
let r = { ...e._zod.def.shape };
for (let e in t) {
if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
t[e] && delete r[e];
}
return x(this, "shape", r), r;
},
checks: []
}));
}
function fe(e, t) {
if (!ie(t)) throw Error("Invalid input to extend: expected a plain object");
let n = e._zod.def.checks;
if (n && n.length > 0) {
let n = e._zod.def.shape;
for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
}
return se(e, S(e._zod.def, { get shape() {
let n = {
...e._zod.def.shape,
...t
};
return x(this, "shape", n), n;
} }));
}
function pe(e, t) {
if (!ie(t)) throw Error("Invalid input to safeExtend: expected a plain object");
return se(e, S(e._zod.def, { get shape() {
let n = {
...e._zod.def.shape,
...t
};
return x(this, "shape", n), n;
} }));
}
function me(e, t) {
var n, r;
if ((n = e._zod.def.checks) != null && n.length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
return se(e, S(e._zod.def, {
get shape() {
let n = {
...e._zod.def.shape,
...t._zod.def.shape
};
return x(this, "shape", n), n;
},
get catchall() {
return t._zod.def.catchall;
},
checks: (r = t._zod.def.checks) == null ? [] : r
}));
}
function he(e, t, n) {
let r = t._zod.def.checks;
if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
return se(t, S(t._zod.def, {
get shape() {
let r = t._zod.def.shape, i = { ...r };
if (n) for (let t in n) {
if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
n[t] && (i[t] = e ? new e({
type: "optional",
innerType: r[t]
}) : r[t]);
}
else for (let t in r) i[t] = e ? new e({
type: "optional",
innerType: r[t]
}) : r[t];
return x(this, "shape", i), i;
},
checks: []
}));
}
function ge(e, t, n) {
return se(t, S(t._zod.def, { get shape() {
let r = t._zod.def.shape, i = { ...r };
if (n) for (let t in n) {
if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
n[t] && (i[t] = new e({
type: "nonoptional",
innerType: r[t]
}));
}
else for (let t in r) i[t] = new e({
type: "nonoptional",
innerType: r[t]
});
return x(this, "shape", i), i;
} }));
}
function _e(e, t = 0) {
if (e.aborted === !0) return !0;
for (let r = t; r < e.issues.length; r++) {
var n;
if (((n = e.issues[r]) == null ? void 0 : n.continue) !== !0) return !0;
}
return !1;
}
function ve(e, t = 0) {
if (e.aborted === !0) return !0;
for (let r = t; r < e.issues.length; r++) {
var n;
if (((n = e.issues[r]) == null ? void 0 : n.continue) === !1) return !0;
}
return !1;
}
function ye(e, t) {
return t.map((t) => {
var n;
return (n = t).path != null || (n.path = []), t.path.unshift(e), t;
});
}
function be(e) {
return typeof e == "string" ? e : e == null ? void 0 : e.message;
}
function xe(e, t, n) {
var r, i, a, o, s, c, l, u, d;
let f = e.message ? e.message : (r = (i = (a = (o = be((s = e.inst) == null || (s = s._zod.def) == null || (c = s.error) == null ? void 0 : c.call(s, e))) == null ? be(t == null || (l = t.error) == null ? void 0 : l.call(t, e)) : o) == null ? be((u = n.customError) == null ? void 0 : u.call(n, e)) : a) == null ? be((d = n.localeError) == null ? void 0 : d.call(n, e)) : i) == null ? "Invalid input" : r, { inst: p, continue: m, input: h, ...g } = e;
return g.path != null || (g.path = []), g.message = f, t != null && t.reportInput && (g.input = h), g;
}
function Se(e) {
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
}
function Ce(...e) {
let [t, n, r] = e;
return typeof t == "string" ? {
message: t,
code: "custom",
input: n,
inst: r
} : { ...t };
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
var we = (e, t) => {
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
value: e._zod,
enumerable: !1
}), Object.defineProperty(e, "issues", {
value: t,
enumerable: !1
}), e.message = JSON.stringify(t, m, 2), Object.defineProperty(e, "toString", {
value: () => e.message,
enumerable: !1
});
}, Te = c("$ZodError", we), Ee = c("$ZodError", we, { Parent: Error });
function De(e, t = (e) => e.message) {
let n = {}, r = [];
for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
return {
formErrors: r,
fieldErrors: n
};
}
function Oe(e, t = (e) => e.message) {
let n = { _errors: [] }, r = (e, i = []) => {
for (let a of e.issues) if (a.code === "invalid_union" && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path]));
else if (a.code === "invalid_key") r({ issues: a.issues }, [...i, ...a.path]);
else if (a.code === "invalid_element") r({ issues: a.issues }, [...i, ...a.path]);
else {
let e = [...i, ...a.path];
if (e.length === 0) n._errors.push(t(a));
else {
let r = n, i = 0;
for (; i < e.length;) {
let n = e[i];
i === e.length - 1 ? (r[n] = r[n] || { _errors: [] }, r[n]._errors.push(t(a))) : r[n] = r[n] || { _errors: [] }, r = r[n], i++;
}
}
}
};
return r(e), n;
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
var ke = (e) => (t, n, r, i) => {
let a = r ? {
...r,
async: !1
} : { async: !1 }, o = t._zod.run({
value: n,
issues: []
}, a);
if (o instanceof Promise) throw new l();
if (o.issues.length) {
var s;
let t = new ((s = i == null ? void 0 : i.Err) == null ? e : s)(o.issues.map((e) => xe(e, a, f())));
throw te(t, i == null ? void 0 : i.callee), t;
}
return o.value;
}, Ae = /* @__PURE__*/ ke(Ee), je = (e) => async (t, n, r, i) => {
let a = r ? {
...r,
async: !0
} : { async: !0 }, o = t._zod.run({
value: n,
issues: []
}, a);
if (o instanceof Promise && (o = await o), o.issues.length) {
var s;
let t = new ((s = i == null ? void 0 : i.Err) == null ? e : s)(o.issues.map((e) => xe(e, a, f())));
throw te(t, i == null ? void 0 : i.callee), t;
}
return o.value;
}, Me = /* @__PURE__*/ je(Ee), Ne = (e) => (t, n, r) => {
let i = r ? {
...r,
async: !1
} : { async: !1 }, a = t._zod.run({
value: n,
issues: []
}, i);
if (a instanceof Promise) throw new l();
return a.issues.length ? {
success: !1,
error: new (e == null ? Te : e)(a.issues.map((e) => xe(e, i, f())))
} : {
success: !0,
data: a.value
};
}, Pe = /* @__PURE__*/ Ne(Ee), Fe = (e) => async (t, n, r) => {
let i = r ? {
...r,
async: !0
} : { async: !0 }, a = t._zod.run({
value: n,
issues: []
}, i);
return a instanceof Promise && (a = await a), a.issues.length ? {
success: !1,
error: new e(a.issues.map((e) => xe(e, i, f())))
} : {
success: !0,
data: a.value
};
}, Ie = /* @__PURE__*/ Fe(Ee), Le = (e) => (t, n, r) => {
let i = r ? {
...r,
direction: "backward"
} : { direction: "backward" };
return ke(e)(t, n, i);
}, Re = (e) => (t, n, r) => ke(e)(t, n, r), ze = (e) => async (t, n, r) => {
let i = r ? {
...r,
direction: "backward"
} : { direction: "backward" };
return je(e)(t, n, i);
}, Be = (e) => async (t, n, r) => je(e)(t, n, r), Ve = (e) => (t, n, r) => {
let i = r ? {
...r,
direction: "backward"
} : { direction: "backward" };
return Ne(e)(t, n, i);
}, He = (e) => (t, n, r) => Ne(e)(t, n, r), Ue = (e) => async (t, n, r) => {
let i = r ? {
...r,
direction: "backward"
} : { direction: "backward" };
return Fe(e)(t, n, i);
}, We = (e) => async (t, n, r) => Fe(e)(t, n, r), Ge = /^[cC][0-9a-z]{6,}$/, Ke = /^[0-9a-z]+$/, qe = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Je = /^[0-9a-vA-V]{20}$/, Ye = /^[A-Za-z0-9]{27}$/, Xe = /^[a-zA-Z0-9_-]{21}$/, Ze = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Qe = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, $e = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, et = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, tt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
function nt() {
return new RegExp(tt, "u");
}
var rt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, it = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, at = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, ot = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, st = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, ct = /^[A-Za-z0-9_-]*$/, lt = /^https?$/, ut = /^\+[1-9]\d{6,14}$/, dt = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", ft = /*@__PURE__*/ RegExp(`^${dt}$`);
function pt(e) {
let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
}
function mt(e) {
return RegExp(`^${pt(e)}$`);
}
function ht(e) {
let t = pt({ precision: e.precision }), n = ["Z"];
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
let r = `${t}(?:${n.join("|")})`;
return RegExp(`^${dt}T(?:${r})$`);
}
var gt = (e) => {
var t, n;
let r = e ? `[\\s\\S]{${(t = e == null ? void 0 : e.minimum) == null ? 0 : t},${(n = e == null ? void 0 : e.maximum) == null ? "" : n}}` : "[\\s\\S]*";
return RegExp(`^${r}$`);
}, _t = /^-?\d+$/, vt = /^-?\d+(?:\.\d+)?$/, yt = /^(?:true|false)$/i, bt = /^null$/i, xt = /^[^A-Z]*$/, St = /^[^a-z]*$/, E = /*@__PURE__*/ c("$ZodCheck", (e, t) => {
var n;
e._zod != null || (e._zod = {}), e._zod.def = t, (n = e._zod).onattach != null || (n.onattach = []);
}), Ct = {
number: "number",
bigint: "bigint",
object: "date"
}, wt = /*@__PURE__*/ c("$ZodCheckLessThan", (e, t) => {
E.init(e, t);
let n = Ct[typeof t.value];
e._zod.onattach.push((e) => {
var n;
let r = e._zod.bag, i = (n = t.inclusive ? r.maximum : r.exclusiveMaximum) == null ? Infinity : n;
t.value < i && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value);
}), e._zod.check = (r) => {
(t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
origin: n,
code: "too_big",
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
input: r.value,
inclusive: t.inclusive,
inst: e,
continue: !t.abort
});
};
}), Tt = /*@__PURE__*/ c("$ZodCheckGreaterThan", (e, t) => {
E.init(e, t);
let n = Ct[typeof t.value];
e._zod.onattach.push((e) => {
var n;
let r = e._zod.bag, i = (n = t.inclusive ? r.minimum : r.exclusiveMinimum) == null ? -Infinity : n;
t.value > i && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value);
}), e._zod.check = (r) => {
(t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
origin: n,
code: "too_small",
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
input: r.value,
inclusive: t.inclusive,
inst: e,
continue: !t.abort
});
};
}), Et = /*@__PURE__*/ c("$ZodCheckMultipleOf", (e, t) => {
E.init(e, t), e._zod.onattach.push((e) => {
var n;
(n = e._zod.bag).multipleOf != null || (n.multipleOf = t.value);
}), e._zod.check = (n) => {
if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : v(n.value, t.value) === 0) || n.issues.push({
origin: typeof n.value,
code: "not_multiple_of",
divisor: t.value,
input: n.value,
inst: e,
continue: !t.abort
});
};
}), Dt = /*@__PURE__*/ c("$ZodCheckNumberFormat", (e, t) => {
var n;
E.init(e, t), t.format = t.format || "float64";
let r = (n = t.format) == null ? void 0 : n.includes("int"), i = r ? "int" : "number", [a, o] = le[t.format];
e._zod.onattach.push((e) => {
let n = e._zod.bag;
n.format = t.format, n.minimum = a, n.maximum = o, r && (n.pattern = _t);
}), e._zod.check = (n) => {
let s = n.value;
if (r) {
if (!Number.isInteger(s)) {
n.issues.push({
expected: i,
format: t.format,
code: "invalid_type",
continue: !1,
input: s,
inst: e
});
return;
}
if (!Number.isSafeInteger(s)) {
s > 0 ? n.issues.push({
input: s,
code: "too_big",
maximum: 2 ** 53 - 1,
note: "Integers must be within the safe integer range.",
inst: e,
origin: i,
inclusive: !0,
continue: !t.abort
}) : n.issues.push({
input: s,
code: "too_small",
minimum: -(2 ** 53 - 1),
note: "Integers must be within the safe integer range.",
inst: e,
origin: i,
inclusive: !0,
continue: !t.abort
});
return;
}
}
s < a && n.issues.push({
origin: "number",
input: s,
code: "too_small",
minimum: a,
inclusive: !0,
inst: e,
continue: !t.abort
}), s > o && n.issues.push({
origin: "number",
input: s,
code: "too_big",
maximum: o,
inclusive: !0,
inst: e,
continue: !t.abort
});
};
}), Ot = /*@__PURE__*/ c("$ZodCheckMaxLength", (e, t) => {
var n;
E.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
let t = e.value;
return !g(t) && t.length !== void 0;
}), e._zod.onattach.push((e) => {
var n;
let r = (n = e._zod.bag.maximum) == null ? Infinity : n;
t.maximum < r && (e._zod.bag.maximum = t.maximum);
}), e._zod.check = (n) => {
let r = n.value;
if (r.length <= t.maximum) return;
let i = Se(r);
n.issues.push({
origin: i,
code: "too_big",
maximum: t.maximum,
inclusive: !0,
input: r,
inst: e,
continue: !t.abort
});
};
}), kt = /*@__PURE__*/ c("$ZodCheckMinLength", (e, t) => {
var n;
E.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
let t = e.value;
return !g(t) && t.length !== void 0;
}), e._zod.onattach.push((e) => {
var n;
let r = (n = e._zod.bag.minimum) == null ? -Infinity : n;
t.minimum > r && (e._zod.bag.minimum = t.minimum);
}), e._zod.check = (n) => {
let r = n.value;
if (r.length >= t.minimum) return;
let i = Se(r);
n.issues.push({
origin: i,
code: "too_small",
minimum: t.minimum,
inclusive: !0,
input: r,
inst: e,
continue: !t.abort
});
};
}), At = /*@__PURE__*/ c("$ZodCheckLengthEquals", (e, t) => {
var n;
E.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
let t = e.value;
return !g(t) && t.length !== void 0;
}), e._zod.onattach.push((e) => {
let n = e._zod.bag;
n.minimum = t.length, n.maximum = t.length, n.length = t.length;
}), e._zod.check = (n) => {
let r = n.value, i = r.length;
if (i === t.length) return;
let a = Se(r), o = i > t.length;
n.issues.push({
origin: a,
...o ? {
code: "too_big",
maximum: t.length
} : {
code: "too_small",
minimum: t.length
},
inclusive: !0,
exact: !0,
input: n.value,
inst: e,
continue: !t.abort
});
};
}), jt = /*@__PURE__*/ c("$ZodCheckStringFormat", (e, t) => {
var n, r;
E.init(e, t), e._zod.onattach.push((e) => {
let n = e._zod.bag;
n.format = t.format, t.pattern && (n.patterns != null || (n.patterns = /* @__PURE__ */ new Set()), n.patterns.add(t.pattern));
}), t.pattern ? (n = e._zod).check != null || (n.check = (n) => {
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
origin: "string",
code: "invalid_format",
format: t.format,
input: n.value,
...t.pattern ? { pattern: t.pattern.toString() } : {},
inst: e,
continue: !t.abort
});
}) : (r = e._zod).check != null || (r.check = () => {});
}), Mt = /*@__PURE__*/ c("$ZodCheckRegex", (e, t) => {
jt.init(e, t), e._zod.check = (n) => {
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
origin: "string",
code: "invalid_format",
format: "regex",
input: n.value,
pattern: t.pattern.toString(),
inst: e,
continue: !t.abort
});
};
}), Nt = /*@__PURE__*/ c("$ZodCheckLowerCase", (e, t) => {
t.pattern != null || (t.pattern = xt), jt.init(e, t);
}), Pt = /*@__PURE__*/ c("$ZodCheckUpperCase", (e, t) => {
t.pattern != null || (t.pattern = St), jt.init(e, t);
}), Ft = /*@__PURE__*/ c("$ZodCheckIncludes", (e, t) => {
E.init(e, t);
let n = w(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
t.pattern = r, e._zod.onattach.push((e) => {
let t = e._zod.bag;
t.patterns != null || (t.patterns = /* @__PURE__ */ new Set()), t.patterns.add(r);
}), e._zod.check = (n) => {
n.value.includes(t.includes, t.position) || n.issues.push({
origin: "string",
code: "invalid_format",
format: "includes",
includes: t.includes,
input: n.value,
inst: e,
continue: !t.abort
});
};
}), It = /*@__PURE__*/ c("$ZodCheckStartsWith", (e, t) => {
E.init(e, t);
let n = RegExp(`^${w(t.prefix)}.*`);
t.pattern != null || (t.pattern = n), e._zod.onattach.push((e) => {
let t = e._zod.bag;
t.patterns != null || (t.patterns = /* @__PURE__ */ new Set()), t.patterns.add(n);
}), e._zod.check = (n) => {
n.value.startsWith(t.prefix) || n.issues.push({
origin: "string",
code: "invalid_format",
format: "starts_with",
prefix: t.prefix,
input: n.value,
inst: e,
continue: !t.abort
});
};
}), Lt = /*@__PURE__*/ c("$ZodCheckEndsWith", (e, t) => {
E.init(e, t);
let n = RegExp(`.*${w(t.suffix)}$`);
t.pattern != null || (t.pattern = n), e._zod.onattach.push((e) => {
let t = e._zod.bag;
t.patterns != null || (t.patterns = /* @__PURE__ */ new Set()), t.patterns.add(n);
}), e._zod.check = (n) => {
n.value.endsWith(t.suffix) || n.issues.push({
origin: "string",
code: "invalid_format",
format: "ends_with",
suffix: t.suffix,
input: n.value,
inst: e,
continue: !t.abort
});
};
}), Rt = /*@__PURE__*/ c("$ZodCheckOverwrite", (e, t) => {
E.init(e, t), e._zod.check = (e) => {
e.value = t.tx(e.value);
};
}), zt = class {
constructor(e = []) {
this.content = [], this.indent = 0, this && (this.args = e);
}
indented(e) {
this.indent += 1, e(this), --this.indent;
}
write(e) {
if (typeof e == "function") {
e(this, { execution: "sync" }), e(this, { execution: "async" });
return;
}
let t = e.split("\n").filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => " ".repeat(this.indent * 2) + e);
for (let e of r) this.content.push(e);
}
compile() {
var e, t, n;
let r = Function, i = (e = this) == null ? void 0 : e.args, a = [...((t = (n = this) == null ? void 0 : n.content) == null ? [""] : t).map((e) => ` ${e}`)];
return new r(...i, a.join("\n"));
}
}, Bt = {
major: 4,
minor: 4,
patch: 3
}, D = /*@__PURE__*/ c("$ZodType", (e, t) => {
var n, r;
e != null || (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Bt;
let i = [...(n = e._zod.def.checks) == null ? [] : n];
e._zod.traits.has("$ZodCheck") && i.unshift(e);
for (let t of i) for (let n of t._zod.onattach) n(e);
if (i.length === 0) {
var a;
(r = e._zod).deferred != null || (r.deferred = []), (a = e._zod.deferred) == null || a.push(() => {
e._zod.run = e._zod.parse;
});
} else {
let t = (e, t, n) => {
let r = _e(e), i;
for (let o of t) {
if (o._zod.def.when) {
if (ve(e) || !o._zod.def.when(e)) continue;
} else if (r) continue;
let t = e.issues.length, s = o._zod.check(e);
if (s instanceof Promise && (n == null ? void 0 : n.async) === !1) throw new l();
if (i || s instanceof Promise) {
var a;
i = ((a = i) == null ? Promise.resolve() : a).then(async () => {
await s, e.issues.length !== t && (r || (r = _e(e, t)));
});
} else {
if (e.issues.length === t) continue;
r || (r = _e(e, t));
}
}
return i ? i.then(() => e) : e;
}, n = (n, r, a) => {
if (_e(n)) return n.aborted = !0, n;
let o = t(r, i, a);
if (o instanceof Promise) {
if (a.async === !1) throw new l();
return o.then((t) => e._zod.parse(t, a));
}
return e._zod.parse(o, a);
};
e._zod.run = (r, a) => {
if (a.skipChecks) return e._zod.parse(r, a);
if (a.direction === "backward") {
let t = e._zod.parse({
value: r.value,
issues: []
}, {
...a,
skipChecks: !0
});
return t instanceof Promise ? t.then((e) => n(e, r, a)) : n(t, r, a);
}
let o = e._zod.parse(r, a);
if (o instanceof Promise) {
if (a.async === !1) throw new l();
return o.then((e) => t(e, i, a));
}
return t(o, i, a);
};
}
b(e, "~standard", () => ({
validate: (t) => {
try {
var n;
let r = Pe(e, t);
return r.success ? { value: r.data } : { issues: (n = r.error) == null ? void 0 : n.issues };
} catch {
return Ie(e, t).then((e) => {
var t;
return e.success ? { value: e.data } : { issues: (t = e.error) == null ? void 0 : t.issues };
});
}
},
vendor: "zod",
version: 1
}));
}), Vt = /*@__PURE__*/ c("$ZodString", (e, t) => {
var n, r, i;
D.init(e, t), e._zod.pattern = (n = [...(r = e == null || (i = e._zod.bag) == null ? void 0 : i.patterns) == null ? [] : r].pop()) == null ? gt(e._zod.bag) : n, e._zod.parse = (n, r) => {
if (t.coerce) try {
n.value = String(n.value);
} catch {}
return typeof n.value == "string" || n.issues.push({
expected: "string",
code: "invalid_type",
input: n.value,
inst: e
}), n;
};
}), O = /*@__PURE__*/ c("$ZodStringFormat", (e, t) => {
jt.init(e, t), Vt.init(e, t);
}), Ht = /*@__PURE__*/ c("$ZodGUID", (e, t) => {
t.pattern != null || (t.pattern = Qe), O.init(e, t);
}), Ut = /*@__PURE__*/ c("$ZodUUID", (e, t) => {
if (t.version) {
let e = {
v1: 1,
v2: 2,
v3: 3,
v4: 4,
v5: 5,
v6: 6,
v7: 7,
v8: 8
}[t.version];
if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
t.pattern != null || (t.pattern = $e(e));
} else t.pattern != null || (t.pattern = $e());
O.init(e, t);
}), Wt = /*@__PURE__*/ c("$ZodEmail", (e, t) => {
t.pattern != null || (t.pattern = et), O.init(e, t);
}), Gt = /*@__PURE__*/ c("$ZodURL", (e, t) => {
O.init(e, t), e._zod.check = (n) => {
try {
var r;
let i = n.value.trim();
if (!t.normalize && ((r = t.protocol) == null ? void 0 : r.source) === lt.source && !/^https?:\/\//i.test(i)) {
n.issues.push({
code: "invalid_format",
format: "url",
note: "Invalid URL format",
input: n.value,
inst: e,
continue: !t.abort
});
return;
}
let a = new URL(i);
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(a.hostname) || n.issues.push({
code: "invalid_format",
format: "url",
note: "Invalid hostname",
pattern: t.hostname.source,
input: n.value,
inst: e,
continue: !t.abort
})), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(a.protocol.endsWith(":") ? a.protocol.slice(0, -1) : a.protocol) || n.issues.push({
code: "invalid_format",
format: "url",
note: "Invalid protocol",
pattern: t.protocol.source,
input: n.value,
inst: e,
continue: !t.abort
})), t.normalize ? n.value = a.href : n.value = i;
return;
} catch {
n.issues.push({
code: "invalid_format",
format: "url",
input: n.value,
inst: e,
continue: !t.abort
});
}
};
}), Kt = /*@__PURE__*/ c("$ZodEmoji", (e, t) => {
t.pattern != null || (t.pattern = nt()), O.init(e, t);
}), qt = /*@__PURE__*/ c("$ZodNanoID", (e, t) => {
t.pattern != null || (t.pattern = Xe), O.init(e, t);
}), Jt = /*@__PURE__*/ c("$ZodCUID", (e, t) => {
t.pattern != null || (t.pattern = Ge), O.init(e, t);
}), Yt = /*@__PURE__*/ c("$ZodCUID2", (e, t) => {
t.pattern != null || (t.pattern = Ke), O.init(e, t);
}), Xt = /*@__PURE__*/ c("$ZodULID", (e, t) => {
t.pattern != null || (t.pattern = qe), O.init(e, t);
}), Zt = /*@__PURE__*/ c("$ZodXID", (e, t) => {
t.pattern != null || (t.pattern = Je), O.init(e, t);
}), Qt = /*@__PURE__*/ c("$ZodKSUID", (e, t) => {
t.pattern != null || (t.pattern = Ye), O.init(e, t);
}), $t = /*@__PURE__*/ c("$ZodISODateTime", (e, t) => {
t.pattern != null || (t.pattern = ht(t)), O.init(e, t);
}), en = /*@__PURE__*/ c("$ZodISODate", (e, t) => {
t.pattern != null || (t.pattern = ft), O.init(e, t);
}), tn = /*@__PURE__*/ c("$ZodISOTime", (e, t) => {
t.pattern != null || (t.pattern = mt(t)), O.init(e, t);
}), nn = /*@__PURE__*/ c("$ZodISODuration", (e, t) => {
t.pattern != null || (t.pattern = Ze), O.init(e, t);
}), rn = /*@__PURE__*/ c("$ZodIPv4", (e, t) => {
t.pattern != null || (t.pattern = rt), O.init(e, t), e._zod.bag.format = "ipv4";
}), an = /*@__PURE__*/ c("$ZodIPv6", (e, t) => {
t.pattern != null || (t.pattern = it), O.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
try {
new URL(`http://[${n.value}]`);
} catch {
n.issues.push({
code: "invalid_format",
format: "ipv6",
input: n.value,
inst: e,
continue: !t.abort
});
}
};
}), on = /*@__PURE__*/ c("$ZodCIDRv4", (e, t) => {
t.pattern != null || (t.pattern = at), O.init(e, t);
}), sn = /*@__PURE__*/ c("$ZodCIDRv6", (e, t) => {
t.pattern != null || (t.pattern = ot), O.init(e, t), e._zod.check = (n) => {
let r = n.value.split("/");
try {
if (r.length !== 2) throw Error();
let [e, t] = r;
if (!t) throw Error();
let n = Number(t);
if (`${n}` !== t || n < 0 || n > 128) throw Error();
new URL(`http://[${e}]`);
} catch {
n.issues.push({
code: "invalid_format",
format: "cidrv6",
input: n.value,
inst: e,
continue: !t.abort
});
}
};
});
function cn(e) {
if (e === "") return !0;
if (/\s/.test(e) || e.length % 4 != 0) return !1;
try {
return atob(e), !0;
} catch {
return !1;
}
}
var ln = /*@__PURE__*/ c("$ZodBase64", (e, t) => {
t.pattern != null || (t.pattern = st), O.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
cn(n.value) || n.issues.push({
code: "invalid_format",
format: "base64",
input: n.value,
inst: e,
continue: !t.abort
});
};
});
function un(e) {
if (!ct.test(e)) return !1;
let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
return cn(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
}
var dn = /*@__PURE__*/ c("$ZodBase64URL", (e, t) => {
t.pattern != null || (t.pattern = ct), O.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
un(n.value) || n.issues.push({
code: "invalid_format",
format: "base64url",
input: n.value,
inst: e,
continue: !t.abort
});
};
}), fn = /*@__PURE__*/ c("$ZodE164", (e, t) => {
t.pattern != null || (t.pattern = ut), O.init(e, t);
});
function pn(e, t = null) {
try {
let n = e.split(".");
if (n.length !== 3) return !1;
let [r] = n;
if (!r) return !1;
let i = JSON.parse(atob(r));
return !("typ" in i && (i == null ? void 0 : i.typ) !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
} catch {
return !1;
}
}
var mn = /*@__PURE__*/ c("$ZodJWT", (e, t) => {
O.init(e, t), e._zod.check = (n) => {
pn(n.value, t.alg) || n.issues.push({
code: "invalid_format",
format: "jwt",
input: n.value,
inst: e,
continue: !t.abort
});
};
}), hn = /*@__PURE__*/ c("$ZodNumber", (e, t) => {
var n;
D.init(e, t), e._zod.pattern = (n = e._zod.bag.pattern) == null ? vt : n, e._zod.parse = (n, r) => {
if (t.coerce) try {
n.value = Number(n.value);
} catch {}
let i = n.value;
if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i)) return n;
let a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
return n.issues.push({
expected: "number",
code: "invalid_type",
input: i,
inst: e,
...a ? { received: a } : {}
}), n;
};
}), gn = /*@__PURE__*/ c("$ZodNumberFormat", (e, t) => {
Dt.init(e, t), hn.init(e, t);
}), _n = /*@__PURE__*/ c("$ZodBoolean", (e, t) => {
D.init(e, t), e._zod.pattern = yt, e._zod.parse = (n, r) => {
if (t.coerce) try {
n.value = !!n.value;
} catch {}
let i = n.value;
return typeof i == "boolean" || n.issues.push({
expected: "boolean",
code: "invalid_type",
input: i,
inst: e
}), n;
};
}), vn = /*@__PURE__*/ c("$ZodNull", (e, t) => {
D.init(e, t), e._zod.pattern = bt, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => {
let r = t.value;
return r === null || t.issues.push({
expected: "null",
code: "invalid_type",
input: r,
inst: e
}), t;
};
}), yn = /*@__PURE__*/ c("$ZodAny", (e, t) => {
D.init(e, t), e._zod.parse = (e) => e;
}), bn = /*@__PURE__*/ c("$ZodUnknown", (e, t) => {
D.init(e, t), e._zod.parse = (e) => e;
}), xn = /*@__PURE__*/ c("$ZodNever", (e, t) => {
D.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
expected: "never",
code: "invalid_type",
input: t.value,
inst: e
}), t);
});
function Sn(e, t, n) {
e.issues.length && t.issues.push(...ye(n, e.issues)), t.value[n] = e.value;
}
var Cn = /*@__PURE__*/ c("$ZodArray", (e, t) => {
D.init(e, t), e._zod.parse = (n, r) => {
let i = n.value;
if (!Array.isArray(i)) return n.issues.push({
expected: "array",
code: "invalid_type",
input: i,
inst: e
}), n;
n.value = Array(i.length);
let a = [];
for (let e = 0; e < i.length; e++) {
let o = i[e], s = t.element._zod.run({
value: o,
issues: []
}, r);
s instanceof Promise ? a.push(s.then((t) => Sn(t, n, e))) : Sn(s, n, e);
}
return a.length ? Promise.all(a).then(() => n) : n;
};
});
function wn(e, t, n, r, i, a) {
let o = n in r;
if (e.issues.length) {
if (i && a && !o) return;
t.issues.push(...ye(n, e.issues));
}
if (!o && !i) {
e.issues.length || t.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: void 0,
path: [n]
});
return;
}
e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value;
}
function Tn(e) {
let t = Object.keys(e.shape);
for (let r of t) {
var n;
if (!(!((n = e.shape) == null || (n = n[r]) == null || (n = n._zod) == null || (n = n.traits) == null) && n.has("$ZodType"))) throw Error(`Invalid element at key "${r}": expected a Zod schema`);
}
let r = ce(e.shape);
return {
...e,
keys: t,
keySet: new Set(t),
numKeys: t.length,
optionalKeys: new Set(r)
};
}
function En(e, t, n, r, i, a) {
let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin === "optional", d = c.optout === "optional";
for (let i in t) {
if (i === "__proto__" || s.has(i)) continue;
if (l === "never") {
o.push(i);
continue;
}
let a = c.run({
value: t[i],
issues: []
}, r);
a instanceof Promise ? e.push(a.then((e) => wn(e, n, i, t, u, d))) : wn(a, n, i, t, u, d);
}
return o.length && n.issues.push({
code: "unrecognized_keys",
keys: o,
input: t,
inst: a
}), e.length ? Promise.all(e).then(() => n) : n;
}
var Dn = /*@__PURE__*/ c("$ZodObject", (e, t) => {
D.init(e, t);
let n = Object.getOwnPropertyDescriptor(t, "shape");
if (!(n != null && n.get)) {
let e = t.shape;
Object.defineProperty(t, "shape", { get: () => {
let n = { ...e };
return Object.defineProperty(t, "shape", { value: n }), n;
} });
}
let r = h(() => Tn(t));
b(e._zod, "propValues", () => {
let e = t.shape, n = {};
for (let t in e) {
let r = e[t]._zod;
if (r.values) {
n[t] != null || (n[t] = /* @__PURE__ */ new Set());
for (let e of r.values) n[t].add(e);
}
}
return n;
});
let i = ne, a = t.catchall, o;
e._zod.parse = (t, n) => {
o != null || (o = r.value);
let s = t.value;
if (!i(s)) return t.issues.push({
expected: "object",
code: "invalid_type",
input: s,
inst: e
}), t;
t.value = {};
let c = [], l = o.shape;
for (let e of o.keys) {
let r = l[e], i = r._zod.optin === "optional", a = r._zod.optout === "optional", o = r._zod.run({
value: s[e],
issues: []
}, n);
o instanceof Promise ? c.push(o.then((n) => wn(n, t, e, s, i, a))) : wn(o, t, e, s, i, a);
}
return a ? En(c, s, t, n, r.value, e) : c.length ? Promise.all(c).then(() => t) : t;
};
}), On = /*@__PURE__*/ c("$ZodObjectJIT", (e, t) => {
Dn.init(e, t);
let n = e._zod.parse, r = h(() => Tn(t)), i = (e) => {
let t = new zt([
"shape",
"payload",
"ctx"
]), n = r.value, i = (e) => {
let t = C(e);
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
};
t.write("const input = payload.value;");
let a = Object.create(null), o = 0;
for (let e of n.keys) a[e] = `key_${o++}`;
t.write("const newResult = {};");
for (let r of n.keys) {
var s, c;
let n = a[r], o = C(r), l = e[r], u = (l == null || (s = l._zod) == null ? void 0 : s.optin) === "optional", d = (l == null || (c = l._zod) == null ? void 0 : c.optout) === "optional";
t.write(`const ${n} = ${i(r)};`), u && d ? t.write(`
if (${n}.issues.length) {
if (${o} in input) {
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
...iss,
path: iss.path ? [${o}, ...iss.path] : [${o}]
})));
}
}
if (${n}.value === undefined) {
if (${o} in input) {
newResult[${o}] = undefined;
}
} else {
newResult[${o}] = ${n}.value;
}
`) : u ? t.write(`
if (${n}.issues.length) {
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
...iss,
path: iss.path ? [${o}, ...iss.path] : [${o}]
})));
}
if (${n}.value === undefined) {
if (${o} in input) {
newResult[${o}] = undefined;
}
} else {
newResult[${o}] = ${n}.value;
}
`) : t.write(`
const ${n}_present = ${o} in input;
if (${n}.issues.length) {
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
...iss,
path: iss.path ? [${o}, ...iss.path] : [${o}]
})));
}
if (!${n}_present && !${n}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${o}]
});
}
if (${n}_present) {
if (${n}.value === undefined) {
newResult[${o}] = undefined;
} else {
newResult[${o}] = ${n}.value;
}
}
`);
}
t.write("payload.value = newResult;"), t.write("return payload;");
let l = t.compile();
return (t, n) => l(e, t, n);
}, a, o = ne, s = !d.jitless, c = s && re.value, l = t.catchall, u;
e._zod.parse = (d, f) => {
u != null || (u = r.value);
let p = d.value;
return o(p) ? s && c && (f == null ? void 0 : f.async) === !1 && f.jitless !== !0 ? (a || (a = i(t.shape)), d = a(d, f), l ? En([], p, d, f, u, e) : d) : n(d, f) : (d.issues.push({
expected: "object",
code: "invalid_type",
input: p,
inst: e
}), d);
};
});
function kn(e, t, n, r) {
for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
let i = e.filter((e) => !_e(e));
return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
code: "invalid_union",
input: t.value,
inst: n,
errors: e.map((e) => e.issues.map((e) => xe(e, r, f())))
}), t);
}
var An = /*@__PURE__*/ c("$ZodUnion", (e, t) => {
D.init(e, t), b(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), b(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), b(e._zod, "values", () => {
if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
}), b(e._zod, "pattern", () => {
if (t.options.every((e) => e._zod.pattern)) {
let e = t.options.map((e) => e._zod.pattern);
return RegExp(`^(${e.map((e) => _(e.source)).join("|")})$`);
}
});
let n = t.options.length === 1 ? t.options[0]._zod.run : null;
e._zod.parse = (r, i) => {
if (n) return n(r, i);
let a = !1, o = [];
for (let e of t.options) {
let t = e._zod.run({
value: r.value,
issues: []
}, i);
if (t instanceof Promise) o.push(t), a = !0;
else {
if (t.issues.length === 0) return t;
o.push(t);
}
}
return a ? Promise.all(o).then((t) => kn(t, r, e, i)) : kn(o, r, e, i);
};
}), jn = /*@__PURE__*/ c("$ZodDiscriminatedUnion", (e, t) => {
t.inclusive = !1, An.init(e, t);
let n = e._zod.parse;
b(e._zod, "propValues", () => {
let e = {};
for (let n of t.options) {
let r = n._zod.propValues;
if (!r || Object.keys(r).length === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);
for (let [t, n] of Object.entries(r)) {
e[t] || (e[t] = /* @__PURE__ */ new Set());
for (let r of n) e[t].add(r);
}
}
return e;
});
let r = h(() => {
let e = t.options, n = /* @__PURE__ */ new Map();
for (let i of e) {
var r;
let e = (r = i._zod.propValues) == null ? void 0 : r[t.discriminator];
if (!e || e.size === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);
for (let t of e) {
if (n.has(t)) throw Error(`Duplicate discriminator value "${String(t)}"`);
n.set(t, i);
}
}
return n;
});
e._zod.parse = (i, a) => {
let o = i.value;
if (!ne(o)) return i.issues.push({
code: "invalid_type",
expected: "object",
input: o,
inst: e
}), i;
let s = r.value.get(o == null ? void 0 : o[t.discriminator]);
return s ? s._zod.run(i, a) : t.unionFallback || a.direction === "backward" ? n(i, a) : (i.issues.push({
code: "invalid_union",
errors: [],
note: "No matching discriminator",
discriminator: t.discriminator,
options: Array.from(r.value.keys()),
input: o,
path: [t.discriminator],
inst: e
}), i);
};
}), Mn = /*@__PURE__*/ c("$ZodIntersection", (e, t) => {
D.init(e, t), e._zod.parse = (e, n) => {
let r = e.value, i = t.left._zod.run({
value: r,
issues: []
}, n), a = t.right._zod.run({
value: r,
issues: []
}, n);
return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => Pn(e, t, n)) : Pn(e, i, a);
};
});
function Nn(e, t) {
if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
valid: !0,
data: e
};
if (ie(e) && ie(t)) {
let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
...e,
...t
};
for (let n of r) {
let r = Nn(e[n], t[n]);
if (!r.valid) return {
valid: !1,
mergeErrorPath: [n, ...r.mergeErrorPath]
};
i[n] = r.data;
}
return {
valid: !0,
data: i
};
}
if (Array.isArray(e) && Array.isArray(t)) {
if (e.length !== t.length) return {
valid: !1,
mergeErrorPath: []
};
let n = [];
for (let r = 0; r < e.length; r++) {
let i = e[r], a = t[r], o = Nn(i, a);
if (!o.valid) return {
valid: !1,
mergeErrorPath: [r, ...o.mergeErrorPath]
};
n.push(o.data);
}
return {
valid: !0,
data: n
};
}
return {
valid: !1,
mergeErrorPath: []
};
}
function Pn(e, t, n) {
let r = /* @__PURE__ */ new Map(), i;
for (let n of t.issues) if (n.code === "unrecognized_keys") {
i != null || (i = n);
for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0;
} else e.issues.push(n);
for (let t of n.issues) if (t.code === "unrecognized_keys") for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0;
else e.issues.push(t);
let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e);
if (a.length && i && e.issues.push({
...i,
keys: a
}), _e(e)) return e;
let o = Nn(t.value, n.value);
if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
return e.value = o.data, e;
}
var Fn = /*@__PURE__*/ c("$ZodTuple", (e, t) => {
D.init(e, t);
let n = t.items;
e._zod.parse = (r, i) => {
let a = r.value;
if (!Array.isArray(a)) return r.issues.push({
input: a,
inst: e,
expected: "tuple",
code: "invalid_type"
}), r;
r.value = [];
let o = [], s = In(n, "optin"), c = In(n, "optout");
if (!t.rest) {
if (a.length < s) return r.issues.push({
code: "too_small",
minimum: s,
inclusive: !0,
input: a,
inst: e,
origin: "array"
}), r;
a.length > n.length && r.issues.push({
code: "too_big",
maximum: n.length,
inclusive: !0,
input: a,
inst: e,
origin: "array"
});
}
let l = Array(n.length);
for (let e = 0; e < n.length; e++) {
let t = n[e]._zod.run({
value: a[e],
issues: []
}, i);
t instanceof Promise ? o.push(t.then((t) => {
l[e] = t;
})) : l[e] = t;
}
if (t.rest) {
let e = n.length - 1, s = a.slice(n.length);
for (let n of s) {
e++;
let a = t.rest._zod.run({
value: n,
issues: []
}, i);
a instanceof Promise ? o.push(a.then((t) => Ln(t, r, e))) : Ln(a, r, e);
}
}
return o.length ? Promise.all(o).then(() => Rn(l, r, n, a, c)) : Rn(l, r, n, a, c);
};
});
function In(e, t) {
for (let n = e.length - 1; n >= 0; n--) if (e[n]._zod[t] !== "optional") return n + 1;
return 0;
}
function Ln(e, t, n) {
e.issues.length && t.issues.push(...ye(n, e.issues)), t.value[n] = e.value;
}
function Rn(e, t, n, r, i) {
for (let a = 0; a < n.length; a++) {
let n = e[a], o = a < r.length;
if (n.issues.length) {
if (!o && a >= i) {
t.value.length = a;
break;
}
t.issues.push(...ye(a, n.issues));
}
t.value[a] = n.value;
}
for (let e = t.value.length - 1; e >= r.length && n[e]._zod.optout === "optional" && t.value[e] === void 0; e--) t.value.length = e;
return t;
}
var zn = /*@__PURE__*/ c("$ZodRecord", (e, t) => {
D.init(e, t), e._zod.parse = (n, r) => {
let i = n.value;
if (!ie(i)) return n.issues.push({
expected: "record",
code: "invalid_type",
input: i,
inst: e
}), n;
let a = [], o = t.keyType._zod.values;
if (o) {
n.value = {};
let c = /* @__PURE__ */ new Set();
for (let s of o) if (typeof s == "string" || typeof s == "number" || typeof s == "symbol") {
c.add(typeof s == "number" ? s.toString() : s);
let o = t.keyType._zod.run({
value: s,
issues: []
}, r);
if (o instanceof Promise) throw Error("Async schemas not supported in object keys currently");
if (o.issues.length) {
n.issues.push({
code: "invalid_key",
origin: "record",
issues: o.issues.map((e) => xe(e, r, f())),
input: s,
path: [s],
inst: e
});
continue;
}
let l = o.value, u = t.valueType._zod.run({
value: i[s],
issues: []
},