@ericbutera/kaleido 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useMutation as
|
|
2
|
-
import { QueryClientProvider as
|
|
3
|
-
import B, { useState as ae, useRef as
|
|
1
|
+
import { useMutation as Br, useInfiniteQuery as Qr, useSuspenseQuery as Wr, useQuery as Hr, QueryClient as Yr, MutationCache as Gr } from "@tanstack/react-query";
|
|
2
|
+
import { QueryClientProvider as Ba } from "@tanstack/react-query";
|
|
3
|
+
import B, { useState as ae, useRef as Kr, useEffect as Se, useMemo as Xt, createContext as Jr, useContext as er } from "react";
|
|
4
|
+
import { Outlet as tr, useSearchParams as vt, useLocation as Be, Navigate as lt, Link as he, useNavigate as Ie } from "react-router-dom";
|
|
4
5
|
import se from "react-hot-toast";
|
|
5
|
-
import { FontAwesomeIcon as
|
|
6
|
-
import { useSearchParams as bt, useLocation as Be, Navigate as ct, Outlet as Kr, Link as he, useNavigate as Me } from "react-router-dom";
|
|
6
|
+
import { FontAwesomeIcon as Me } from "@fortawesome/react-fontawesome";
|
|
7
7
|
import { useForm as Le } from "react-hook-form";
|
|
8
|
-
import { faEnvelope as
|
|
9
|
-
var
|
|
8
|
+
import { faEnvelope as Xr, faRightToBracket as es, faStore as ts, faSort as rs, faSortUp as ss, faSortDown as ns } from "@fortawesome/free-solid-svg-icons";
|
|
9
|
+
var Qe = { exports: {} }, Fe = {};
|
|
10
10
|
var Nt;
|
|
11
|
-
function
|
|
11
|
+
function as() {
|
|
12
12
|
if (Nt) return Fe;
|
|
13
13
|
Nt = 1;
|
|
14
14
|
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
@@ -29,10 +29,10 @@ function ns() {
|
|
|
29
29
|
}
|
|
30
30
|
return Fe.Fragment = e, Fe.jsx = r, Fe.jsxs = r, Fe;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
function
|
|
35
|
-
return
|
|
32
|
+
var $e = {};
|
|
33
|
+
var kt;
|
|
34
|
+
function is() {
|
|
35
|
+
return kt || (kt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
36
36
|
function t(p) {
|
|
37
37
|
if (p == null) return null;
|
|
38
38
|
if (typeof p == "function")
|
|
@@ -41,7 +41,7 @@ function as() {
|
|
|
41
41
|
switch (p) {
|
|
42
42
|
case v:
|
|
43
43
|
return "Fragment";
|
|
44
|
-
case
|
|
44
|
+
case N:
|
|
45
45
|
return "Profiler";
|
|
46
46
|
case T:
|
|
47
47
|
return "StrictMode";
|
|
@@ -62,15 +62,15 @@ function as() {
|
|
|
62
62
|
return p.displayName || "Context";
|
|
63
63
|
case w:
|
|
64
64
|
return (p._context.displayName || "Context") + ".Consumer";
|
|
65
|
-
case
|
|
66
|
-
var
|
|
67
|
-
return p = p.displayName, p || (p =
|
|
65
|
+
case U:
|
|
66
|
+
var k = p.render;
|
|
67
|
+
return p = p.displayName, p || (p = k.displayName || k.name || "", p = p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef"), p;
|
|
68
68
|
case W:
|
|
69
|
-
return
|
|
69
|
+
return k = p.displayName || null, k !== null ? k : t(p.type) || "Memo";
|
|
70
70
|
case Y:
|
|
71
|
-
|
|
71
|
+
k = p._payload, p = p._init;
|
|
72
72
|
try {
|
|
73
|
-
return t(p(
|
|
73
|
+
return t(p(k));
|
|
74
74
|
} catch {
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -82,15 +82,15 @@ function as() {
|
|
|
82
82
|
function r(p) {
|
|
83
83
|
try {
|
|
84
84
|
e(p);
|
|
85
|
-
var
|
|
85
|
+
var k = !1;
|
|
86
86
|
} catch {
|
|
87
|
-
|
|
87
|
+
k = !0;
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
var P =
|
|
89
|
+
if (k) {
|
|
90
|
+
k = console;
|
|
91
|
+
var P = k.error, R = typeof Symbol == "function" && Symbol.toStringTag && p[Symbol.toStringTag] || p.constructor.name || "Object";
|
|
92
92
|
return P.call(
|
|
93
|
-
|
|
93
|
+
k,
|
|
94
94
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
95
95
|
R
|
|
96
96
|
), e(p);
|
|
@@ -101,8 +101,8 @@ function as() {
|
|
|
101
101
|
if (typeof p == "object" && p !== null && p.$$typeof === Y)
|
|
102
102
|
return "<...>";
|
|
103
103
|
try {
|
|
104
|
-
var
|
|
105
|
-
return
|
|
104
|
+
var k = t(p);
|
|
105
|
+
return k ? "<" + k + ">" : "<...>";
|
|
106
106
|
} catch {
|
|
107
107
|
return "<...>";
|
|
108
108
|
}
|
|
@@ -116,16 +116,16 @@ function as() {
|
|
|
116
116
|
}
|
|
117
117
|
function l(p) {
|
|
118
118
|
if (H.call(p, "key")) {
|
|
119
|
-
var
|
|
120
|
-
if (
|
|
119
|
+
var k = Object.getOwnPropertyDescriptor(p, "key").get;
|
|
120
|
+
if (k && k.isReactWarning) return !1;
|
|
121
121
|
}
|
|
122
122
|
return p.key !== void 0;
|
|
123
123
|
}
|
|
124
|
-
function c(p,
|
|
124
|
+
function c(p, k) {
|
|
125
125
|
function P() {
|
|
126
126
|
ve || (ve = !0, console.error(
|
|
127
127
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
128
|
-
|
|
128
|
+
k
|
|
129
129
|
));
|
|
130
130
|
}
|
|
131
131
|
P.isReactWarning = !0, Object.defineProperty(p, "key", {
|
|
@@ -139,12 +139,12 @@ function as() {
|
|
|
139
139
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
140
140
|
)), p = this.props.ref, p !== void 0 ? p : null;
|
|
141
141
|
}
|
|
142
|
-
function u(p,
|
|
142
|
+
function u(p, k, P, R, re, de) {
|
|
143
143
|
var Z = P.ref;
|
|
144
144
|
return p = {
|
|
145
145
|
$$typeof: g,
|
|
146
146
|
type: p,
|
|
147
|
-
key:
|
|
147
|
+
key: k,
|
|
148
148
|
props: P,
|
|
149
149
|
_owner: R
|
|
150
150
|
}, (Z !== void 0 ? Z : null) !== null ? Object.defineProperty(p, "ref", {
|
|
@@ -172,8 +172,8 @@ function as() {
|
|
|
172
172
|
value: de
|
|
173
173
|
}), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
|
|
174
174
|
}
|
|
175
|
-
function d(p,
|
|
176
|
-
var Z =
|
|
175
|
+
function d(p, k, P, R, re, de) {
|
|
176
|
+
var Z = k.children;
|
|
177
177
|
if (Z !== void 0)
|
|
178
178
|
if (R)
|
|
179
179
|
if (G(Z)) {
|
|
@@ -185,10 +185,10 @@ function as() {
|
|
|
185
185
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
186
186
|
);
|
|
187
187
|
else f(Z);
|
|
188
|
-
if (H.call(
|
|
188
|
+
if (H.call(k, "key")) {
|
|
189
189
|
Z = t(p);
|
|
190
|
-
var je = Object.keys(
|
|
191
|
-
return
|
|
190
|
+
var je = Object.keys(k).filter(function(Vr) {
|
|
191
|
+
return Vr !== "key";
|
|
192
192
|
});
|
|
193
193
|
R = 0 < je.length ? "{key: someKey, " + je.join(": ..., ") + ": ...}" : "{key: someKey}", z[Z + R] || (je = 0 < je.length ? "{" + je.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
194
194
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -203,11 +203,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
203
203
|
Z
|
|
204
204
|
), z[Z + R] = !0);
|
|
205
205
|
}
|
|
206
|
-
if (Z = null, P !== void 0 && (r(P), Z = "" + P), l(
|
|
206
|
+
if (Z = null, P !== void 0 && (r(P), Z = "" + P), l(k) && (r(k.key), Z = "" + k.key), "key" in k) {
|
|
207
207
|
P = {};
|
|
208
|
-
for (var
|
|
209
|
-
|
|
210
|
-
} else P =
|
|
208
|
+
for (var at in k)
|
|
209
|
+
at !== "key" && (P[at] = k[at]);
|
|
210
|
+
} else P = k;
|
|
211
211
|
return Z && c(
|
|
212
212
|
P,
|
|
213
213
|
typeof p == "function" ? p.displayName || p.name || "Unknown" : p
|
|
@@ -226,7 +226,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
226
226
|
function h(p) {
|
|
227
227
|
return typeof p == "object" && p !== null && p.$$typeof === g;
|
|
228
228
|
}
|
|
229
|
-
var m = B, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), v = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"),
|
|
229
|
+
var m = B, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), v = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"), N = /* @__PURE__ */ Symbol.for("react.profiler"), w = /* @__PURE__ */ Symbol.for("react.consumer"), S = /* @__PURE__ */ Symbol.for("react.context"), U = /* @__PURE__ */ Symbol.for("react.forward_ref"), A = /* @__PURE__ */ Symbol.for("react.suspense"), V = /* @__PURE__ */ Symbol.for("react.suspense_list"), W = /* @__PURE__ */ Symbol.for("react.memo"), Y = /* @__PURE__ */ Symbol.for("react.lazy"), X = /* @__PURE__ */ Symbol.for("react.activity"), M = /* @__PURE__ */ Symbol.for("react.client.reference"), L = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, G = Array.isArray, D = console.createTask ? console.createTask : function() {
|
|
230
230
|
return null;
|
|
231
231
|
};
|
|
232
232
|
m = {
|
|
@@ -238,55 +238,94 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
m,
|
|
239
239
|
a
|
|
240
240
|
)(), J = D(s(a)), z = {};
|
|
241
|
-
|
|
241
|
+
$e.Fragment = v, $e.jsx = function(p, k, P) {
|
|
242
242
|
var R = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
243
243
|
return d(
|
|
244
244
|
p,
|
|
245
|
-
|
|
245
|
+
k,
|
|
246
246
|
P,
|
|
247
247
|
!1,
|
|
248
248
|
R ? Error("react-stack-top-frame") : ie,
|
|
249
249
|
R ? D(s(p)) : J
|
|
250
250
|
);
|
|
251
|
-
},
|
|
251
|
+
}, $e.jsxs = function(p, k, P) {
|
|
252
252
|
var R = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
253
253
|
return d(
|
|
254
254
|
p,
|
|
255
|
-
|
|
255
|
+
k,
|
|
256
256
|
P,
|
|
257
257
|
!0,
|
|
258
258
|
R ? Error("react-stack-top-frame") : ie,
|
|
259
259
|
R ? D(s(p)) : J
|
|
260
260
|
);
|
|
261
261
|
};
|
|
262
|
-
})()),
|
|
262
|
+
})()), $e;
|
|
263
263
|
}
|
|
264
|
-
var
|
|
265
|
-
function
|
|
266
|
-
return
|
|
264
|
+
var Ct;
|
|
265
|
+
function os() {
|
|
266
|
+
return Ct || (Ct = 1, process.env.NODE_ENV === "production" ? Qe.exports = as() : Qe.exports = is()), Qe.exports;
|
|
267
267
|
}
|
|
268
|
-
var i =
|
|
269
|
-
let
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
function ls() {
|
|
274
|
-
return /* @__PURE__ */ i.jsx("header", { className: "bg-base-300 p-4", children: /* @__PURE__ */ i.jsx("div", { className: "container mx-auto font-semibold", children: "Kaleido" }) });
|
|
268
|
+
var i = os();
|
|
269
|
+
let He = {};
|
|
270
|
+
function ls(t) {
|
|
271
|
+
He = { ...He, ...t };
|
|
275
272
|
}
|
|
276
273
|
function cs() {
|
|
277
|
-
return /* @__PURE__ */ i.jsx("
|
|
274
|
+
return /* @__PURE__ */ i.jsx("header", { className: "bg-base-300 p-4", children: /* @__PURE__ */ i.jsx("div", { className: "container mx-auto font-semibold", children: "Kaleido" }) });
|
|
278
275
|
}
|
|
279
276
|
function us() {
|
|
280
|
-
return
|
|
277
|
+
return /* @__PURE__ */ i.jsx("div", { className: "text-sm text-muted", children: "No admin navigation provided." });
|
|
281
278
|
}
|
|
282
279
|
function ds() {
|
|
283
|
-
return
|
|
280
|
+
return He.SiteNavigation ?? cs;
|
|
281
|
+
}
|
|
282
|
+
function fs() {
|
|
283
|
+
return He.AdminNav ?? us;
|
|
284
|
+
}
|
|
285
|
+
function rr({
|
|
286
|
+
icon: t,
|
|
287
|
+
title: e,
|
|
288
|
+
value: r,
|
|
289
|
+
desc: s,
|
|
290
|
+
to: n
|
|
291
|
+
}) {
|
|
292
|
+
const a = /* @__PURE__ */ i.jsxs("div", { className: "stat bg-base-100 shadow", children: [
|
|
293
|
+
/* @__PURE__ */ i.jsxs("div", { className: "stat-title", children: [
|
|
294
|
+
t && /* @__PURE__ */ i.jsx("span", { className: "mr-1", children: t }),
|
|
295
|
+
e
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ i.jsx("div", { className: "stat-value", children: r ?? "—" }),
|
|
298
|
+
s && /* @__PURE__ */ i.jsx("div", { className: "stat-desc", children: s })
|
|
299
|
+
] });
|
|
300
|
+
return n ? /* @__PURE__ */ i.jsx("a", { href: n, className: "block", children: a }) : a;
|
|
284
301
|
}
|
|
285
|
-
|
|
302
|
+
const hs = {
|
|
303
|
+
auth: "Auth",
|
|
304
|
+
background_tasks: "Background Tasks"
|
|
305
|
+
};
|
|
306
|
+
function ms({
|
|
307
|
+
data: t
|
|
308
|
+
}) {
|
|
309
|
+
if (!t) return null;
|
|
310
|
+
const e = Object.entries(t).filter(([, r]) => r?.length);
|
|
311
|
+
return e.length ? /* @__PURE__ */ i.jsx(i.Fragment, { children: e.map(([r, s]) => /* @__PURE__ */ i.jsxs("section", { className: "mb-6", children: [
|
|
312
|
+
/* @__PURE__ */ i.jsx("h3", { className: "text-lg font-semibold mb-3", children: hs[r] ?? r }),
|
|
313
|
+
/* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: s.map((n) => /* @__PURE__ */ i.jsx(
|
|
314
|
+
rr,
|
|
315
|
+
{
|
|
316
|
+
title: n.label,
|
|
317
|
+
value: n.error ? `Error: ${n.error}` : n.value.toLocaleString(),
|
|
318
|
+
desc: n.desc
|
|
319
|
+
},
|
|
320
|
+
n.key
|
|
321
|
+
)) })
|
|
322
|
+
] }, r)) }) : null;
|
|
323
|
+
}
|
|
324
|
+
function sr({
|
|
286
325
|
title: t,
|
|
287
326
|
children: e
|
|
288
327
|
}) {
|
|
289
|
-
const r =
|
|
328
|
+
const r = ds(), s = fs();
|
|
290
329
|
return /* @__PURE__ */ i.jsxs("div", { className: "min-h-screen bg-base-200", children: [
|
|
291
330
|
/* @__PURE__ */ i.jsx(r, {}),
|
|
292
331
|
/* @__PURE__ */ i.jsxs("div", { className: "container mx-auto p-6", children: [
|
|
@@ -298,44 +337,47 @@ function Qe({
|
|
|
298
337
|
] })
|
|
299
338
|
] });
|
|
300
339
|
}
|
|
301
|
-
function
|
|
302
|
-
return /* @__PURE__ */ i.jsx(
|
|
340
|
+
function ps({ title: t }) {
|
|
341
|
+
return /* @__PURE__ */ i.jsx(sr, { title: t, children: /* @__PURE__ */ i.jsx(tr, {}) });
|
|
342
|
+
}
|
|
343
|
+
function gs() {
|
|
344
|
+
return /* @__PURE__ */ i.jsx("div", { children: "Admin panel" });
|
|
303
345
|
}
|
|
304
|
-
const
|
|
346
|
+
const nr = "registration", ar = "oauth", ys = "api_clients";
|
|
305
347
|
let Ze = null;
|
|
306
|
-
function
|
|
348
|
+
function ir(t) {
|
|
307
349
|
Ze = t;
|
|
308
350
|
}
|
|
309
|
-
function
|
|
351
|
+
function bt(t) {
|
|
310
352
|
if (!Ze)
|
|
311
353
|
throw new Error(
|
|
312
354
|
"Feature flags not configured. Call configureFeatureFlags() in your app setup."
|
|
313
355
|
);
|
|
314
356
|
return Ze.useFeatureFlags(t);
|
|
315
357
|
}
|
|
316
|
-
function
|
|
317
|
-
const { data: e = [] } =
|
|
358
|
+
function ct(t) {
|
|
359
|
+
const { data: e = [] } = bt();
|
|
318
360
|
return e.find((r) => r.feature_key === t)?.enabled ?? !1;
|
|
319
361
|
}
|
|
320
|
-
function
|
|
362
|
+
function or() {
|
|
321
363
|
if (!Ze)
|
|
322
364
|
throw new Error(
|
|
323
365
|
"Feature flags not configured. Call configureFeatureFlags() in your app setup."
|
|
324
366
|
);
|
|
325
367
|
return Ze.useUpdateFeatureFlag();
|
|
326
368
|
}
|
|
327
|
-
const
|
|
369
|
+
const Ea = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
328
370
|
__proto__: null,
|
|
329
|
-
FLAG_API_CLIENTS:
|
|
330
|
-
FLAG_OAUTH:
|
|
331
|
-
FLAG_REGISTRATION:
|
|
332
|
-
configureFeatureFlags:
|
|
333
|
-
useFeatureFlag:
|
|
334
|
-
useFeatureFlags:
|
|
335
|
-
useUpdateFeatureFlag:
|
|
371
|
+
FLAG_API_CLIENTS: ys,
|
|
372
|
+
FLAG_OAUTH: ar,
|
|
373
|
+
FLAG_REGISTRATION: nr,
|
|
374
|
+
configureFeatureFlags: ir,
|
|
375
|
+
useFeatureFlag: ct,
|
|
376
|
+
useFeatureFlags: bt,
|
|
377
|
+
useUpdateFeatureFlag: or
|
|
336
378
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
337
|
-
function
|
|
338
|
-
const { data: t = [], isLoading: e, refetch: r } =
|
|
379
|
+
function vs() {
|
|
380
|
+
const { data: t = [], isLoading: e, refetch: r } = bt(), s = or(), [n, a] = ae({}), l = async (c) => {
|
|
339
381
|
const o = t.find((d) => d.feature_key === c);
|
|
340
382
|
if (!o) return;
|
|
341
383
|
const u = !o.enabled;
|
|
@@ -351,7 +393,7 @@ function ms() {
|
|
|
351
393
|
});
|
|
352
394
|
}
|
|
353
395
|
};
|
|
354
|
-
return e ? /* @__PURE__ */ i.jsx("div", { className: "p-6", children: "Loading..." }) : /* @__PURE__ */ i.jsxs(
|
|
396
|
+
return e ? /* @__PURE__ */ i.jsx("div", { className: "p-6", children: "Loading..." }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
355
397
|
/* @__PURE__ */ i.jsx("div", { className: "flex items-center justify-between mb-6", children: /* @__PURE__ */ i.jsxs("div", { children: [
|
|
356
398
|
/* @__PURE__ */ i.jsx("h1", { className: "text-2xl font-bold", children: "Feature Flags" }),
|
|
357
399
|
/* @__PURE__ */ i.jsx("p", { className: "text-sm text-base-content/60 mt-1", children: "Configure which features are enabled in the application" })
|
|
@@ -392,7 +434,7 @@ function ms() {
|
|
|
392
434
|
}) }) })
|
|
393
435
|
] });
|
|
394
436
|
}
|
|
395
|
-
function
|
|
437
|
+
function bs({
|
|
396
438
|
icon: t,
|
|
397
439
|
title: e,
|
|
398
440
|
message: r,
|
|
@@ -401,7 +443,7 @@ function ps({
|
|
|
401
443
|
return /* @__PURE__ */ i.jsx("div", { className: "min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/10 to-secondary/10", children: /* @__PURE__ */ i.jsx("div", { className: "card bg-base-100 shadow-soft hover:shadow-medium transition-shadow border border-base-300 w-full max-w-md mx-4", children: /* @__PURE__ */ i.jsxs("div", { className: "card-body p-8", children: [
|
|
402
444
|
/* @__PURE__ */ i.jsxs("h2", { className: "card-title text-2xl mb-4", children: [
|
|
403
445
|
t && /* @__PURE__ */ i.jsx(
|
|
404
|
-
|
|
446
|
+
Me,
|
|
405
447
|
{
|
|
406
448
|
icon: t,
|
|
407
449
|
className: "text-neutral-content-300 mb-4"
|
|
@@ -413,7 +455,7 @@ function ps({
|
|
|
413
455
|
s && /* @__PURE__ */ i.jsx("div", { children: s })
|
|
414
456
|
] }) }) });
|
|
415
457
|
}
|
|
416
|
-
function
|
|
458
|
+
function xs({
|
|
417
459
|
isOpen: t,
|
|
418
460
|
title: e,
|
|
419
461
|
handleSubmit: r,
|
|
@@ -490,70 +532,70 @@ function gs({
|
|
|
490
532
|
}
|
|
491
533
|
) });
|
|
492
534
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
495
|
-
var e =
|
|
535
|
+
var _s = typeof global == "object" && global && global.Object === Object && global, ws = typeof self == "object" && self && self.Object === Object && self, lr = _s || ws || Function("return this")(), Ye = lr.Symbol, cr = Object.prototype, js = cr.hasOwnProperty, Ns = cr.toString, Ue = Ye ? Ye.toStringTag : void 0;
|
|
536
|
+
function ks(t) {
|
|
537
|
+
var e = js.call(t, Ue), r = t[Ue];
|
|
496
538
|
try {
|
|
497
|
-
t[
|
|
539
|
+
t[Ue] = void 0;
|
|
498
540
|
var s = !0;
|
|
499
541
|
} catch {
|
|
500
542
|
}
|
|
501
|
-
var n =
|
|
502
|
-
return s && (e ? t[
|
|
543
|
+
var n = Ns.call(t);
|
|
544
|
+
return s && (e ? t[Ue] = r : delete t[Ue]), n;
|
|
503
545
|
}
|
|
504
|
-
var
|
|
505
|
-
function
|
|
506
|
-
return
|
|
546
|
+
var Cs = Object.prototype, Es = Cs.toString;
|
|
547
|
+
function Ss(t) {
|
|
548
|
+
return Es.call(t);
|
|
507
549
|
}
|
|
508
|
-
var
|
|
509
|
-
function
|
|
510
|
-
return t == null ? t === void 0 ?
|
|
550
|
+
var As = "[object Null]", Rs = "[object Undefined]", Et = Ye ? Ye.toStringTag : void 0;
|
|
551
|
+
function Ps(t) {
|
|
552
|
+
return t == null ? t === void 0 ? Rs : As : Et && Et in Object(t) ? ks(t) : Ss(t);
|
|
511
553
|
}
|
|
512
|
-
function
|
|
554
|
+
function Ts(t) {
|
|
513
555
|
return t != null && typeof t == "object";
|
|
514
556
|
}
|
|
515
|
-
var
|
|
516
|
-
function
|
|
517
|
-
return typeof t == "symbol" ||
|
|
557
|
+
var Os = "[object Symbol]";
|
|
558
|
+
function Is(t) {
|
|
559
|
+
return typeof t == "symbol" || Ts(t) && Ps(t) == Os;
|
|
518
560
|
}
|
|
519
|
-
var
|
|
520
|
-
function
|
|
521
|
-
for (var e = t.length; e-- &&
|
|
561
|
+
var Ms = /\s/;
|
|
562
|
+
function Ls(t) {
|
|
563
|
+
for (var e = t.length; e-- && Ms.test(t.charAt(e)); )
|
|
522
564
|
;
|
|
523
565
|
return e;
|
|
524
566
|
}
|
|
525
|
-
var
|
|
526
|
-
function
|
|
527
|
-
return t && t.slice(0,
|
|
567
|
+
var Fs = /^\s+/;
|
|
568
|
+
function $s(t) {
|
|
569
|
+
return t && t.slice(0, Ls(t) + 1).replace(Fs, "");
|
|
528
570
|
}
|
|
529
|
-
function
|
|
571
|
+
function ut(t) {
|
|
530
572
|
var e = typeof t;
|
|
531
573
|
return t != null && (e == "object" || e == "function");
|
|
532
574
|
}
|
|
533
|
-
var
|
|
534
|
-
function
|
|
575
|
+
var St = NaN, Us = /^[-+]0x[0-9a-f]+$/i, Ds = /^0b[01]+$/i, zs = /^0o[0-7]+$/i, Zs = parseInt;
|
|
576
|
+
function At(t) {
|
|
535
577
|
if (typeof t == "number")
|
|
536
578
|
return t;
|
|
537
|
-
if (
|
|
538
|
-
return
|
|
539
|
-
if (
|
|
579
|
+
if (Is(t))
|
|
580
|
+
return St;
|
|
581
|
+
if (ut(t)) {
|
|
540
582
|
var e = typeof t.valueOf == "function" ? t.valueOf() : t;
|
|
541
|
-
t =
|
|
583
|
+
t = ut(e) ? e + "" : e;
|
|
542
584
|
}
|
|
543
585
|
if (typeof t != "string")
|
|
544
586
|
return t === 0 ? t : +t;
|
|
545
|
-
t =
|
|
546
|
-
var r =
|
|
547
|
-
return r ||
|
|
548
|
-
}
|
|
549
|
-
var
|
|
550
|
-
return
|
|
551
|
-
},
|
|
552
|
-
function
|
|
587
|
+
t = $s(t);
|
|
588
|
+
var r = Ds.test(t);
|
|
589
|
+
return r || zs.test(t) ? Zs(t.slice(2), r ? 2 : 8) : Us.test(t) ? St : +t;
|
|
590
|
+
}
|
|
591
|
+
var it = function() {
|
|
592
|
+
return lr.Date.now();
|
|
593
|
+
}, qs = "Expected a function", Vs = Math.max, Bs = Math.min;
|
|
594
|
+
function Qs(t, e, r) {
|
|
553
595
|
var s, n, a, l, c, o, u = 0, d = !1, f = !1, h = !0;
|
|
554
596
|
if (typeof t != "function")
|
|
555
|
-
throw new TypeError(
|
|
556
|
-
e =
|
|
597
|
+
throw new TypeError(qs);
|
|
598
|
+
e = At(e) || 0, ut(r) && (d = !!r.leading, f = "maxWait" in r, a = f ? Vs(At(r.maxWait) || 0, e) : a, h = "trailing" in r ? !!r.trailing : h);
|
|
557
599
|
function m(A) {
|
|
558
600
|
var V = s, W = n;
|
|
559
601
|
return s = n = void 0, u = A, l = t.apply(W, V), l;
|
|
@@ -563,29 +605,29 @@ function Zs(t, e, r) {
|
|
|
563
605
|
}
|
|
564
606
|
function x(A) {
|
|
565
607
|
var V = A - o, W = A - u, Y = e - V;
|
|
566
|
-
return f ?
|
|
608
|
+
return f ? Bs(Y, a - W) : Y;
|
|
567
609
|
}
|
|
568
610
|
function v(A) {
|
|
569
611
|
var V = A - o, W = A - u;
|
|
570
612
|
return o === void 0 || V >= e || V < 0 || f && W >= a;
|
|
571
613
|
}
|
|
572
614
|
function T() {
|
|
573
|
-
var A =
|
|
615
|
+
var A = it();
|
|
574
616
|
if (v(A))
|
|
575
|
-
return
|
|
617
|
+
return N(A);
|
|
576
618
|
c = setTimeout(T, x(A));
|
|
577
619
|
}
|
|
578
|
-
function
|
|
620
|
+
function N(A) {
|
|
579
621
|
return c = void 0, h && s ? m(A) : (s = n = void 0, l);
|
|
580
622
|
}
|
|
581
623
|
function w() {
|
|
582
624
|
c !== void 0 && clearTimeout(c), u = 0, s = o = n = c = void 0;
|
|
583
625
|
}
|
|
584
626
|
function S() {
|
|
585
|
-
return c === void 0 ? l :
|
|
627
|
+
return c === void 0 ? l : N(it());
|
|
586
628
|
}
|
|
587
|
-
function
|
|
588
|
-
var A =
|
|
629
|
+
function U() {
|
|
630
|
+
var A = it(), V = v(A);
|
|
589
631
|
if (s = arguments, n = this, o = A, V) {
|
|
590
632
|
if (c === void 0)
|
|
591
633
|
return g(o);
|
|
@@ -594,9 +636,9 @@ function Zs(t, e, r) {
|
|
|
594
636
|
}
|
|
595
637
|
return c === void 0 && (c = setTimeout(T, e)), l;
|
|
596
638
|
}
|
|
597
|
-
return
|
|
639
|
+
return U.cancel = w, U.flush = S, U;
|
|
598
640
|
}
|
|
599
|
-
function
|
|
641
|
+
function Sa(t, e) {
|
|
600
642
|
const r = e?.defaultPage ?? 1, s = e?.defaultPerPage ?? 25, n = {};
|
|
601
643
|
t.page !== void 0 && t.page !== null && t.page !== r && (n.page = Number(t.page)), t.per_page !== void 0 && t.per_page !== null && t.per_page !== s && (n.per_page = Number(t.per_page));
|
|
602
644
|
const a = {};
|
|
@@ -604,19 +646,19 @@ function ka(t, e) {
|
|
|
604
646
|
const l = t.q ?? t.q, c = {};
|
|
605
647
|
return Object.keys(n).length && (c.pagination = n), l != null && String(l) !== "" && (c.q = l), Object.keys(a).length && (c.sort = a), c;
|
|
606
648
|
}
|
|
607
|
-
function
|
|
649
|
+
function Rt(t, e) {
|
|
608
650
|
const r = {};
|
|
609
651
|
for (const [s, n] of t.entries())
|
|
610
652
|
r[s] = n;
|
|
611
653
|
return r;
|
|
612
654
|
}
|
|
613
|
-
function
|
|
655
|
+
function We(t) {
|
|
614
656
|
const e = new URLSearchParams();
|
|
615
657
|
return Object.entries(t || {}).forEach(([r, s]) => {
|
|
616
658
|
s != null && e.set(r, String(s));
|
|
617
659
|
}), e;
|
|
618
660
|
}
|
|
619
|
-
function
|
|
661
|
+
function ur({
|
|
620
662
|
page: t,
|
|
621
663
|
perPage: e,
|
|
622
664
|
total: r,
|
|
@@ -665,7 +707,7 @@ function lr({
|
|
|
665
707
|
)
|
|
666
708
|
] }) });
|
|
667
709
|
}
|
|
668
|
-
function
|
|
710
|
+
function xt({
|
|
669
711
|
title: t,
|
|
670
712
|
actions: e,
|
|
671
713
|
paramsSchema: r,
|
|
@@ -676,41 +718,41 @@ function _t({
|
|
|
676
718
|
onRowClick: c,
|
|
677
719
|
paginationType: o = "pages"
|
|
678
720
|
}) {
|
|
679
|
-
const [u, d] =
|
|
721
|
+
const [u, d] = vt(), f = Rt(u), { data: h, isLoading: m, raw: g } = s(f), x = g?.metadata?.total ?? 0, v = f.page ?? 1, T = f.per_page ?? 20, [N, w] = ae(f), S = Kr(f);
|
|
680
722
|
Se(() => {
|
|
681
723
|
JSON.stringify(f) !== JSON.stringify(S.current) && (w(f), S.current = f);
|
|
682
724
|
}, [f]);
|
|
683
|
-
const
|
|
684
|
-
() =>
|
|
685
|
-
d(
|
|
725
|
+
const U = Xt(
|
|
726
|
+
() => Qs((L) => {
|
|
727
|
+
d(We(L));
|
|
686
728
|
}, 300),
|
|
687
729
|
[d]
|
|
688
730
|
);
|
|
689
|
-
Se(() => () =>
|
|
731
|
+
Se(() => () => U.cancel(), [U]);
|
|
690
732
|
const A = (L, H) => {
|
|
691
733
|
const G = {
|
|
692
|
-
...
|
|
734
|
+
...N,
|
|
693
735
|
[L]: H === "" ? void 0 : H,
|
|
694
736
|
// Reset to page 1 when filters change
|
|
695
737
|
page: 1
|
|
696
738
|
};
|
|
697
|
-
w(G),
|
|
739
|
+
w(G), U(G);
|
|
698
740
|
}, V = (L) => {
|
|
699
741
|
const H = {
|
|
700
|
-
...
|
|
742
|
+
...N,
|
|
701
743
|
...L,
|
|
702
744
|
// Reset to page 1 when filters change
|
|
703
745
|
page: 1
|
|
704
746
|
};
|
|
705
|
-
w(H),
|
|
747
|
+
w(H), U(H);
|
|
706
748
|
}, W = () => {
|
|
707
|
-
|
|
749
|
+
U.cancel(), d(We(N));
|
|
708
750
|
}, Y = () => {
|
|
709
|
-
const L =
|
|
710
|
-
w(L),
|
|
751
|
+
const L = Rt(new URLSearchParams());
|
|
752
|
+
w(L), U.cancel(), d(We(L));
|
|
711
753
|
}, X = (L) => {
|
|
712
754
|
const H = { ...f, page: L };
|
|
713
|
-
d(
|
|
755
|
+
d(We(H));
|
|
714
756
|
}, M = t || e || n;
|
|
715
757
|
return /* @__PURE__ */ i.jsx("div", { className: "card bg-base-100 shadow-xl", children: /* @__PURE__ */ i.jsxs("div", { className: "card-body", children: [
|
|
716
758
|
M && /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col gap-4 mb-4", children: [
|
|
@@ -719,7 +761,7 @@ function _t({
|
|
|
719
761
|
e && /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-3", children: e })
|
|
720
762
|
] }),
|
|
721
763
|
n && /* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2 bg-base-200/50 p-2 rounded-lg w-full", children: [
|
|
722
|
-
/* @__PURE__ */ i.jsx("div", { className: "flex flex-wrap gap-2 justify-end flex-1", children: n(
|
|
764
|
+
/* @__PURE__ */ i.jsx("div", { className: "flex flex-wrap gap-2 justify-end flex-1", children: n(N, A) }),
|
|
723
765
|
/* @__PURE__ */ i.jsxs("div", { className: "join", children: [
|
|
724
766
|
/* @__PURE__ */ i.jsx(
|
|
725
767
|
"button",
|
|
@@ -763,7 +805,7 @@ function _t({
|
|
|
763
805
|
}) })
|
|
764
806
|
] }) }),
|
|
765
807
|
o !== "none" && /* @__PURE__ */ i.jsx("div", { className: "mt-4", children: /* @__PURE__ */ i.jsx(
|
|
766
|
-
|
|
808
|
+
ur,
|
|
767
809
|
{
|
|
768
810
|
page: v,
|
|
769
811
|
perPage: T,
|
|
@@ -773,26 +815,26 @@ function _t({
|
|
|
773
815
|
) })
|
|
774
816
|
] }) });
|
|
775
817
|
}
|
|
776
|
-
function
|
|
818
|
+
function Ws({
|
|
777
819
|
errors: t,
|
|
778
820
|
className: e = ""
|
|
779
821
|
}) {
|
|
780
822
|
return !Array.isArray(t) || t.length === 0 ? null : /* @__PURE__ */ i.jsx("div", { className: `alert alert-error mb-4 ${e}`.trim(), children: /* @__PURE__ */ i.jsx("ul", { className: "list-disc list-inside", children: t.map((r, s) => /* @__PURE__ */ i.jsx("li", { children: r }, s)) }) });
|
|
781
823
|
}
|
|
782
|
-
var
|
|
824
|
+
var Hs = Object.defineProperty, Ge = Object.getOwnPropertySymbols, dr = Object.prototype.hasOwnProperty, fr = Object.prototype.propertyIsEnumerable, Pt = (t, e, r) => e in t ? Hs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, dt = (t, e) => {
|
|
783
825
|
for (var r in e || (e = {}))
|
|
784
|
-
|
|
785
|
-
if (
|
|
786
|
-
for (var r of
|
|
787
|
-
|
|
826
|
+
dr.call(e, r) && Pt(t, r, e[r]);
|
|
827
|
+
if (Ge)
|
|
828
|
+
for (var r of Ge(e))
|
|
829
|
+
fr.call(e, r) && Pt(t, r, e[r]);
|
|
788
830
|
return t;
|
|
789
|
-
},
|
|
831
|
+
}, ft = (t, e) => {
|
|
790
832
|
var r = {};
|
|
791
833
|
for (var s in t)
|
|
792
|
-
|
|
793
|
-
if (t != null &&
|
|
794
|
-
for (var s of
|
|
795
|
-
e.indexOf(s) < 0 &&
|
|
834
|
+
dr.call(t, s) && e.indexOf(s) < 0 && (r[s] = t[s]);
|
|
835
|
+
if (t != null && Ge)
|
|
836
|
+
for (var s of Ge(t))
|
|
837
|
+
e.indexOf(s) < 0 && fr.call(t, s) && (r[s] = t[s]);
|
|
796
838
|
return r;
|
|
797
839
|
};
|
|
798
840
|
var be;
|
|
@@ -880,10 +922,10 @@ var be;
|
|
|
880
922
|
n(v.length <= T), r(0, Math.min(4, T - v.length), v), r(0, (8 - v.length % 8) % 8, v), n(v.length % 8 == 0);
|
|
881
923
|
for (let w = 236; v.length < T; w ^= 253)
|
|
882
924
|
r(w, 8, v);
|
|
883
|
-
let
|
|
884
|
-
for (;
|
|
885
|
-
|
|
886
|
-
return v.forEach((w, S) =>
|
|
925
|
+
let N = [];
|
|
926
|
+
for (; N.length * 8 < v.length; )
|
|
927
|
+
N.push(0);
|
|
928
|
+
return v.forEach((w, S) => N[S >>> 3] |= w << 7 - (S & 7)), new I(g, u, N, h);
|
|
887
929
|
}
|
|
888
930
|
/*-- Accessor methods --*/
|
|
889
931
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
@@ -975,17 +1017,17 @@ var be;
|
|
|
975
1017
|
let v = [];
|
|
976
1018
|
const T = I.reedSolomonComputeDivisor(h);
|
|
977
1019
|
for (let w = 0, S = 0; w < f; w++) {
|
|
978
|
-
let
|
|
979
|
-
S +=
|
|
980
|
-
const A = I.reedSolomonComputeRemainder(
|
|
981
|
-
w < g &&
|
|
1020
|
+
let U = o.slice(S, S + x - h + (w < g ? 0 : 1));
|
|
1021
|
+
S += U.length;
|
|
1022
|
+
const A = I.reedSolomonComputeRemainder(U, T);
|
|
1023
|
+
w < g && U.push(0), v.push(U.concat(A));
|
|
982
1024
|
}
|
|
983
|
-
let
|
|
1025
|
+
let N = [];
|
|
984
1026
|
for (let w = 0; w < v[0].length; w++)
|
|
985
|
-
v.forEach((S,
|
|
986
|
-
(w != x - h ||
|
|
1027
|
+
v.forEach((S, U) => {
|
|
1028
|
+
(w != x - h || U >= g) && N.push(S[w]);
|
|
987
1029
|
});
|
|
988
|
-
return n(
|
|
1030
|
+
return n(N.length == m), N;
|
|
989
1031
|
}
|
|
990
1032
|
// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
|
|
991
1033
|
// data area of this QR Code. Function modules need to be marked off before this is called.
|
|
@@ -1331,13 +1373,13 @@ var be;
|
|
|
1331
1373
|
})(t.QrSegment || (t.QrSegment = {}));
|
|
1332
1374
|
})(be || (be = {}));
|
|
1333
1375
|
var Ee = be;
|
|
1334
|
-
var
|
|
1376
|
+
var Ys = {
|
|
1335
1377
|
L: Ee.QrCode.Ecc.LOW,
|
|
1336
1378
|
M: Ee.QrCode.Ecc.MEDIUM,
|
|
1337
1379
|
Q: Ee.QrCode.Ecc.QUARTILE,
|
|
1338
1380
|
H: Ee.QrCode.Ecc.HIGH
|
|
1339
|
-
},
|
|
1340
|
-
function
|
|
1381
|
+
}, hr = 128, mr = "L", pr = "#FFFFFF", gr = "#000000", yr = !1, vr = 1, Gs = 4, Ks = 0, Js = 0.1;
|
|
1382
|
+
function br(t, e = 0) {
|
|
1341
1383
|
const r = [];
|
|
1342
1384
|
return t.forEach(function(s, n) {
|
|
1343
1385
|
let a = null;
|
|
@@ -1360,13 +1402,13 @@ function yr(t, e = 0) {
|
|
|
1360
1402
|
});
|
|
1361
1403
|
}), r.join("");
|
|
1362
1404
|
}
|
|
1363
|
-
function
|
|
1405
|
+
function xr(t, e) {
|
|
1364
1406
|
return t.slice().map((r, s) => s < e.y || s >= e.y + e.h ? r : r.map((n, a) => a < e.x || a >= e.x + e.w ? n : !1));
|
|
1365
1407
|
}
|
|
1366
|
-
function
|
|
1408
|
+
function Xs(t, e, r, s) {
|
|
1367
1409
|
if (s == null)
|
|
1368
1410
|
return null;
|
|
1369
|
-
const n = t.length + r * 2, a = Math.floor(e *
|
|
1411
|
+
const n = t.length + r * 2, a = Math.floor(e * Js), l = n / e, c = (s.width || a) * l, o = (s.height || a) * l, u = s.x == null ? t.length / 2 - c / 2 : s.x * l, d = s.y == null ? t.length / 2 - o / 2 : s.y * l, f = s.opacity == null ? 1 : s.opacity;
|
|
1370
1412
|
let h = null;
|
|
1371
1413
|
if (s.excavate) {
|
|
1372
1414
|
let g = Math.floor(u), x = Math.floor(d), v = Math.ceil(c + u - g), T = Math.ceil(o + d - x);
|
|
@@ -1375,10 +1417,10 @@ function Ys(t, e, r, s) {
|
|
|
1375
1417
|
const m = s.crossOrigin;
|
|
1376
1418
|
return { x: u, y: d, h: o, w: c, excavation: h, opacity: f, crossOrigin: m };
|
|
1377
1419
|
}
|
|
1378
|
-
function
|
|
1379
|
-
return e != null ? Math.max(Math.floor(e), 0) : t ?
|
|
1420
|
+
function en(t, e) {
|
|
1421
|
+
return e != null ? Math.max(Math.floor(e), 0) : t ? Gs : Ks;
|
|
1380
1422
|
}
|
|
1381
|
-
function
|
|
1423
|
+
function _r({
|
|
1382
1424
|
value: t,
|
|
1383
1425
|
level: e,
|
|
1384
1426
|
minVersion: r,
|
|
@@ -1392,7 +1434,7 @@ function br({
|
|
|
1392
1434
|
const g = (Array.isArray(t) ? t : [t]).reduce((x, v) => (x.push(...Ee.QrSegment.makeSegments(v)), x), []);
|
|
1393
1435
|
return Ee.QrCode.encodeSegments(
|
|
1394
1436
|
g,
|
|
1395
|
-
|
|
1437
|
+
Ys[e],
|
|
1396
1438
|
r,
|
|
1397
1439
|
void 0,
|
|
1398
1440
|
void 0,
|
|
@@ -1401,7 +1443,7 @@ function br({
|
|
|
1401
1443
|
}, [t, e, r, c]);
|
|
1402
1444
|
const { cells: u, margin: d, numCells: f, calculatedImageSettings: h } = B.useMemo(() => {
|
|
1403
1445
|
let m = o.getModules();
|
|
1404
|
-
const g =
|
|
1446
|
+
const g = en(s, n), x = m.length + g * 2, v = Xs(
|
|
1405
1447
|
m,
|
|
1406
1448
|
l,
|
|
1407
1449
|
g,
|
|
@@ -1422,27 +1464,27 @@ function br({
|
|
|
1422
1464
|
calculatedImageSettings: h
|
|
1423
1465
|
};
|
|
1424
1466
|
}
|
|
1425
|
-
var
|
|
1467
|
+
var tn = (function() {
|
|
1426
1468
|
try {
|
|
1427
1469
|
new Path2D().addPath(new Path2D());
|
|
1428
1470
|
} catch {
|
|
1429
1471
|
return !1;
|
|
1430
1472
|
}
|
|
1431
1473
|
return !0;
|
|
1432
|
-
})(),
|
|
1474
|
+
})(), rn = B.forwardRef(
|
|
1433
1475
|
function(e, r) {
|
|
1434
1476
|
const s = e, {
|
|
1435
1477
|
value: n,
|
|
1436
|
-
size: a =
|
|
1437
|
-
level: l =
|
|
1438
|
-
bgColor: c =
|
|
1439
|
-
fgColor: o =
|
|
1440
|
-
includeMargin: u =
|
|
1441
|
-
minVersion: d =
|
|
1478
|
+
size: a = hr,
|
|
1479
|
+
level: l = mr,
|
|
1480
|
+
bgColor: c = pr,
|
|
1481
|
+
fgColor: o = gr,
|
|
1482
|
+
includeMargin: u = yr,
|
|
1483
|
+
minVersion: d = vr,
|
|
1442
1484
|
boostLevel: f,
|
|
1443
1485
|
marginSize: h,
|
|
1444
1486
|
imageSettings: m
|
|
1445
|
-
} = s, x =
|
|
1487
|
+
} = s, x = ft(s, [
|
|
1446
1488
|
"value",
|
|
1447
1489
|
"size",
|
|
1448
1490
|
"level",
|
|
@@ -1453,12 +1495,12 @@ var Ks = (function() {
|
|
|
1453
1495
|
"boostLevel",
|
|
1454
1496
|
"marginSize",
|
|
1455
1497
|
"imageSettings"
|
|
1456
|
-
]), { style: v } = x, T =
|
|
1498
|
+
]), { style: v } = x, T = ft(x, ["style"]), N = m?.src, w = B.useRef(null), S = B.useRef(null), U = B.useCallback(
|
|
1457
1499
|
(G) => {
|
|
1458
1500
|
w.current = G, typeof r == "function" ? r(G) : r && (r.current = G);
|
|
1459
1501
|
},
|
|
1460
1502
|
[r]
|
|
1461
|
-
), [A, V] = B.useState(!1), { margin: W, cells: Y, numCells: X, calculatedImageSettings: M } =
|
|
1503
|
+
), [A, V] = B.useState(!1), { margin: W, cells: Y, numCells: X, calculatedImageSettings: M } = _r({
|
|
1462
1504
|
value: n,
|
|
1463
1505
|
level: l,
|
|
1464
1506
|
minVersion: d,
|
|
@@ -1475,16 +1517,16 @@ var Ks = (function() {
|
|
|
1475
1517
|
return;
|
|
1476
1518
|
let ve = Y;
|
|
1477
1519
|
const ee = S.current, ie = M != null && ee !== null && ee.complete && ee.naturalHeight !== 0 && ee.naturalWidth !== 0;
|
|
1478
|
-
ie && M.excavation != null && (ve =
|
|
1520
|
+
ie && M.excavation != null && (ve = xr(
|
|
1479
1521
|
Y,
|
|
1480
1522
|
M.excavation
|
|
1481
1523
|
));
|
|
1482
1524
|
const J = window.devicePixelRatio || 1;
|
|
1483
1525
|
G.height = G.width = a * J;
|
|
1484
1526
|
const z = a / X * J;
|
|
1485
|
-
D.scale(z, z), D.fillStyle = c, D.fillRect(0, 0, X, X), D.fillStyle = o,
|
|
1527
|
+
D.scale(z, z), D.fillStyle = c, D.fillRect(0, 0, X, X), D.fillStyle = o, tn ? D.fill(new Path2D(br(ve, W))) : Y.forEach(function(p, k) {
|
|
1486
1528
|
p.forEach(function(P, R) {
|
|
1487
|
-
P && D.fillRect(R + W,
|
|
1529
|
+
P && D.fillRect(R + W, k + W, 1, 1);
|
|
1488
1530
|
});
|
|
1489
1531
|
}), M && (D.globalAlpha = M.opacity), ie && D.drawImage(
|
|
1490
1532
|
ee,
|
|
@@ -1496,14 +1538,14 @@ var Ks = (function() {
|
|
|
1496
1538
|
}
|
|
1497
1539
|
}), B.useEffect(() => {
|
|
1498
1540
|
V(!1);
|
|
1499
|
-
}, [
|
|
1500
|
-
const L =
|
|
1541
|
+
}, [N]);
|
|
1542
|
+
const L = dt({ height: a, width: a }, v);
|
|
1501
1543
|
let H = null;
|
|
1502
|
-
return
|
|
1544
|
+
return N != null && (H = /* @__PURE__ */ B.createElement(
|
|
1503
1545
|
"img",
|
|
1504
1546
|
{
|
|
1505
|
-
src:
|
|
1506
|
-
key:
|
|
1547
|
+
src: N,
|
|
1548
|
+
key: N,
|
|
1507
1549
|
style: { display: "none" },
|
|
1508
1550
|
onLoad: () => {
|
|
1509
1551
|
V(!0);
|
|
@@ -1513,32 +1555,32 @@ var Ks = (function() {
|
|
|
1513
1555
|
}
|
|
1514
1556
|
)), /* @__PURE__ */ B.createElement(B.Fragment, null, /* @__PURE__ */ B.createElement(
|
|
1515
1557
|
"canvas",
|
|
1516
|
-
|
|
1558
|
+
dt({
|
|
1517
1559
|
style: L,
|
|
1518
1560
|
height: a,
|
|
1519
1561
|
width: a,
|
|
1520
|
-
ref:
|
|
1562
|
+
ref: U,
|
|
1521
1563
|
role: "img"
|
|
1522
1564
|
}, T)
|
|
1523
1565
|
), H);
|
|
1524
1566
|
}
|
|
1525
1567
|
);
|
|
1526
|
-
|
|
1527
|
-
var
|
|
1568
|
+
rn.displayName = "QRCodeCanvas";
|
|
1569
|
+
var wr = B.forwardRef(
|
|
1528
1570
|
function(e, r) {
|
|
1529
1571
|
const s = e, {
|
|
1530
1572
|
value: n,
|
|
1531
|
-
size: a =
|
|
1532
|
-
level: l =
|
|
1533
|
-
bgColor: c =
|
|
1534
|
-
fgColor: o =
|
|
1535
|
-
includeMargin: u =
|
|
1536
|
-
minVersion: d =
|
|
1573
|
+
size: a = hr,
|
|
1574
|
+
level: l = mr,
|
|
1575
|
+
bgColor: c = pr,
|
|
1576
|
+
fgColor: o = gr,
|
|
1577
|
+
includeMargin: u = yr,
|
|
1578
|
+
minVersion: d = vr,
|
|
1537
1579
|
boostLevel: f,
|
|
1538
1580
|
title: h,
|
|
1539
1581
|
marginSize: m,
|
|
1540
1582
|
imageSettings: g
|
|
1541
|
-
} = s, x =
|
|
1583
|
+
} = s, x = ft(s, [
|
|
1542
1584
|
"value",
|
|
1543
1585
|
"size",
|
|
1544
1586
|
"level",
|
|
@@ -1550,7 +1592,7 @@ var xr = B.forwardRef(
|
|
|
1550
1592
|
"title",
|
|
1551
1593
|
"marginSize",
|
|
1552
1594
|
"imageSettings"
|
|
1553
|
-
]), { margin: v, cells: T, numCells:
|
|
1595
|
+
]), { margin: v, cells: T, numCells: N, calculatedImageSettings: w } = _r({
|
|
1554
1596
|
value: n,
|
|
1555
1597
|
level: l,
|
|
1556
1598
|
minVersion: d,
|
|
@@ -1560,11 +1602,11 @@ var xr = B.forwardRef(
|
|
|
1560
1602
|
imageSettings: g,
|
|
1561
1603
|
size: a
|
|
1562
1604
|
});
|
|
1563
|
-
let S = T,
|
|
1564
|
-
g != null && w != null && (w.excavation != null && (S =
|
|
1605
|
+
let S = T, U = null;
|
|
1606
|
+
g != null && w != null && (w.excavation != null && (S = xr(
|
|
1565
1607
|
T,
|
|
1566
1608
|
w.excavation
|
|
1567
|
-
)),
|
|
1609
|
+
)), U = /* @__PURE__ */ B.createElement(
|
|
1568
1610
|
"image",
|
|
1569
1611
|
{
|
|
1570
1612
|
href: g.src,
|
|
@@ -1577,13 +1619,13 @@ var xr = B.forwardRef(
|
|
|
1577
1619
|
crossOrigin: w.crossOrigin
|
|
1578
1620
|
}
|
|
1579
1621
|
));
|
|
1580
|
-
const A =
|
|
1622
|
+
const A = br(S, v);
|
|
1581
1623
|
return /* @__PURE__ */ B.createElement(
|
|
1582
1624
|
"svg",
|
|
1583
|
-
|
|
1625
|
+
dt({
|
|
1584
1626
|
height: a,
|
|
1585
1627
|
width: a,
|
|
1586
|
-
viewBox: `0 0 ${
|
|
1628
|
+
viewBox: `0 0 ${N} ${N}`,
|
|
1587
1629
|
ref: r,
|
|
1588
1630
|
role: "img"
|
|
1589
1631
|
}, x),
|
|
@@ -1592,17 +1634,17 @@ var xr = B.forwardRef(
|
|
|
1592
1634
|
"path",
|
|
1593
1635
|
{
|
|
1594
1636
|
fill: c,
|
|
1595
|
-
d: `M0,0 h${
|
|
1637
|
+
d: `M0,0 h${N}v${N}H0z`,
|
|
1596
1638
|
shapeRendering: "crispEdges"
|
|
1597
1639
|
}
|
|
1598
1640
|
),
|
|
1599
1641
|
/* @__PURE__ */ B.createElement("path", { fill: o, d: A, shapeRendering: "crispEdges" }),
|
|
1600
|
-
|
|
1642
|
+
U
|
|
1601
1643
|
);
|
|
1602
1644
|
}
|
|
1603
1645
|
);
|
|
1604
|
-
|
|
1605
|
-
const
|
|
1646
|
+
wr.displayName = "QRCodeSVG";
|
|
1647
|
+
const sn = (t, e = "qr-code", r = 4) => {
|
|
1606
1648
|
const s = document.getElementById(t);
|
|
1607
1649
|
if (!s) return;
|
|
1608
1650
|
let n = new XMLSerializer().serializeToString(s);
|
|
@@ -1624,7 +1666,7 @@ const Xs = (t, e = "qr-code", r = 4) => {
|
|
|
1624
1666
|
m.download = `${e}.png`, m.href = h, m.click();
|
|
1625
1667
|
}, f.src = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(n)));
|
|
1626
1668
|
};
|
|
1627
|
-
function
|
|
1669
|
+
function nn({
|
|
1628
1670
|
id: t = "qr-code",
|
|
1629
1671
|
value: e,
|
|
1630
1672
|
size: r = 200,
|
|
@@ -1634,11 +1676,11 @@ function en({
|
|
|
1634
1676
|
}) {
|
|
1635
1677
|
const l = n || e.replace(/[^a-z0-9_-]/gi, "-").slice(0, 40) || "qr-code";
|
|
1636
1678
|
return /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col items-start ", children: [
|
|
1637
|
-
/* @__PURE__ */ i.jsx("div", { className: "bg-base-100 p-4 rounded-lg", children: /* @__PURE__ */ i.jsx(
|
|
1638
|
-
a && /* @__PURE__ */ i.jsx("div", { className: "join justify-center self-center", children: /* @__PURE__ */ i.jsx(
|
|
1679
|
+
/* @__PURE__ */ i.jsx("div", { className: "bg-base-100 p-4 rounded-lg", children: /* @__PURE__ */ i.jsx(wr, { id: t, value: e, size: r, level: s }) }),
|
|
1680
|
+
a && /* @__PURE__ */ i.jsx("div", { className: "join justify-center self-center", children: /* @__PURE__ */ i.jsx(an, { id: t, fileBase: l }) })
|
|
1639
1681
|
] });
|
|
1640
1682
|
}
|
|
1641
|
-
function
|
|
1683
|
+
function an({ id: t, fileBase: e }) {
|
|
1642
1684
|
const [r, s] = ae(8), n = (a) => a === 8 ? "large" : a === 4 ? "medium" : "small";
|
|
1643
1685
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
1644
1686
|
/* @__PURE__ */ i.jsxs(
|
|
@@ -1659,21 +1701,21 @@ function tn({ id: t, fileBase: e }) {
|
|
|
1659
1701
|
"button",
|
|
1660
1702
|
{
|
|
1661
1703
|
className: "btn btn-secondary join-item",
|
|
1662
|
-
onClick: () =>
|
|
1704
|
+
onClick: () => sn(t, `${e}-${n(r)}`, r),
|
|
1663
1705
|
title: `Download ${r}x`,
|
|
1664
1706
|
children: "Download"
|
|
1665
1707
|
}
|
|
1666
1708
|
)
|
|
1667
1709
|
] });
|
|
1668
1710
|
}
|
|
1669
|
-
const
|
|
1711
|
+
const Pa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1670
1712
|
__proto__: null,
|
|
1671
|
-
AlertCard:
|
|
1672
|
-
GenericFormModal:
|
|
1673
|
-
GenericList:
|
|
1674
|
-
ModalErrors:
|
|
1675
|
-
Pagination:
|
|
1676
|
-
QRCodeGenerator:
|
|
1713
|
+
AlertCard: bs,
|
|
1714
|
+
GenericFormModal: xs,
|
|
1715
|
+
GenericList: xt,
|
|
1716
|
+
ModalErrors: Ws,
|
|
1717
|
+
Pagination: ur,
|
|
1718
|
+
QRCodeGenerator: nn
|
|
1677
1719
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1678
1720
|
function De(t) {
|
|
1679
1721
|
if (!t) return "";
|
|
@@ -1684,20 +1726,20 @@ function De(t) {
|
|
|
1684
1726
|
}
|
|
1685
1727
|
}
|
|
1686
1728
|
let qe = null;
|
|
1687
|
-
function
|
|
1729
|
+
function jr(t) {
|
|
1688
1730
|
qe = t;
|
|
1689
1731
|
}
|
|
1690
|
-
function
|
|
1732
|
+
function Nr(t) {
|
|
1691
1733
|
if (!qe)
|
|
1692
1734
|
throw new Error(
|
|
1693
1735
|
"Tasks not configured. Call tasks.configureTasks() before using task hooks."
|
|
1694
1736
|
);
|
|
1695
1737
|
return qe.useTasks(t);
|
|
1696
1738
|
}
|
|
1697
|
-
function
|
|
1739
|
+
function kr(t) {
|
|
1698
1740
|
return qe?.useTask ? qe.useTask(t) : { data: null, isLoading: !1 };
|
|
1699
1741
|
}
|
|
1700
|
-
var
|
|
1742
|
+
var $;
|
|
1701
1743
|
(function(t) {
|
|
1702
1744
|
t.assertEqual = (n) => {
|
|
1703
1745
|
};
|
|
@@ -1733,16 +1775,16 @@ var U;
|
|
|
1733
1775
|
return n.map((l) => typeof l == "string" ? `'${l}'` : l).join(a);
|
|
1734
1776
|
}
|
|
1735
1777
|
t.joinValues = s, t.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
|
|
1736
|
-
})(
|
|
1737
|
-
var
|
|
1778
|
+
})($ || ($ = {}));
|
|
1779
|
+
var Tt;
|
|
1738
1780
|
(function(t) {
|
|
1739
1781
|
t.mergeShapes = (e, r) => ({
|
|
1740
1782
|
...e,
|
|
1741
1783
|
...r
|
|
1742
1784
|
// second overwrites first
|
|
1743
1785
|
});
|
|
1744
|
-
})(
|
|
1745
|
-
const _ =
|
|
1786
|
+
})(Tt || (Tt = {}));
|
|
1787
|
+
const _ = $.arrayToEnum([
|
|
1746
1788
|
"string",
|
|
1747
1789
|
"nan",
|
|
1748
1790
|
"number",
|
|
@@ -1784,7 +1826,7 @@ const _ = U.arrayToEnum([
|
|
|
1784
1826
|
default:
|
|
1785
1827
|
return _.unknown;
|
|
1786
1828
|
}
|
|
1787
|
-
}, y =
|
|
1829
|
+
}, y = $.arrayToEnum([
|
|
1788
1830
|
"invalid_type",
|
|
1789
1831
|
"invalid_literal",
|
|
1790
1832
|
"custom",
|
|
@@ -1846,7 +1888,7 @@ class ue extends Error {
|
|
|
1846
1888
|
return this.message;
|
|
1847
1889
|
}
|
|
1848
1890
|
get message() {
|
|
1849
|
-
return JSON.stringify(this.issues,
|
|
1891
|
+
return JSON.stringify(this.issues, $.jsonStringifyReplacer, 2);
|
|
1850
1892
|
}
|
|
1851
1893
|
get isEmpty() {
|
|
1852
1894
|
return this.issues.length === 0;
|
|
@@ -1866,26 +1908,26 @@ class ue extends Error {
|
|
|
1866
1908
|
}
|
|
1867
1909
|
}
|
|
1868
1910
|
ue.create = (t) => new ue(t);
|
|
1869
|
-
const
|
|
1911
|
+
const ht = (t, e) => {
|
|
1870
1912
|
let r;
|
|
1871
1913
|
switch (t.code) {
|
|
1872
1914
|
case y.invalid_type:
|
|
1873
1915
|
t.received === _.undefined ? r = "Required" : r = `Expected ${t.expected}, received ${t.received}`;
|
|
1874
1916
|
break;
|
|
1875
1917
|
case y.invalid_literal:
|
|
1876
|
-
r = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
1918
|
+
r = `Invalid literal value, expected ${JSON.stringify(t.expected, $.jsonStringifyReplacer)}`;
|
|
1877
1919
|
break;
|
|
1878
1920
|
case y.unrecognized_keys:
|
|
1879
|
-
r = `Unrecognized key(s) in object: ${
|
|
1921
|
+
r = `Unrecognized key(s) in object: ${$.joinValues(t.keys, ", ")}`;
|
|
1880
1922
|
break;
|
|
1881
1923
|
case y.invalid_union:
|
|
1882
1924
|
r = "Invalid input";
|
|
1883
1925
|
break;
|
|
1884
1926
|
case y.invalid_union_discriminator:
|
|
1885
|
-
r = `Invalid discriminator value. Expected ${
|
|
1927
|
+
r = `Invalid discriminator value. Expected ${$.joinValues(t.options)}`;
|
|
1886
1928
|
break;
|
|
1887
1929
|
case y.invalid_enum_value:
|
|
1888
|
-
r = `Invalid enum value. Expected ${
|
|
1930
|
+
r = `Invalid enum value. Expected ${$.joinValues(t.options)}, received '${t.received}'`;
|
|
1889
1931
|
break;
|
|
1890
1932
|
case y.invalid_arguments:
|
|
1891
1933
|
r = "Invalid function arguments";
|
|
@@ -1897,7 +1939,7 @@ const mt = (t, e) => {
|
|
|
1897
1939
|
r = "Invalid date";
|
|
1898
1940
|
break;
|
|
1899
1941
|
case y.invalid_string:
|
|
1900
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
1942
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` : $.assertNever(t.validation) : t.validation !== "regex" ? r = `Invalid ${t.validation}` : r = "Invalid";
|
|
1901
1943
|
break;
|
|
1902
1944
|
case y.too_small:
|
|
1903
1945
|
t.type === "array" ? r = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "bigint" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? r = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : r = "Invalid input";
|
|
@@ -1918,15 +1960,15 @@ const mt = (t, e) => {
|
|
|
1918
1960
|
r = "Number must be finite";
|
|
1919
1961
|
break;
|
|
1920
1962
|
default:
|
|
1921
|
-
r = e.defaultError,
|
|
1963
|
+
r = e.defaultError, $.assertNever(t);
|
|
1922
1964
|
}
|
|
1923
1965
|
return { message: r };
|
|
1924
1966
|
};
|
|
1925
|
-
let
|
|
1926
|
-
function
|
|
1927
|
-
return
|
|
1967
|
+
let on = ht;
|
|
1968
|
+
function ln() {
|
|
1969
|
+
return on;
|
|
1928
1970
|
}
|
|
1929
|
-
const
|
|
1971
|
+
const cn = (t) => {
|
|
1930
1972
|
const { data: e, path: r, errorMaps: s, issueData: n } = t, a = [...r, ...n.path || []], l = {
|
|
1931
1973
|
...n,
|
|
1932
1974
|
path: a
|
|
@@ -1948,7 +1990,7 @@ const nn = (t) => {
|
|
|
1948
1990
|
};
|
|
1949
1991
|
};
|
|
1950
1992
|
function b(t, e) {
|
|
1951
|
-
const r =
|
|
1993
|
+
const r = ln(), s = cn({
|
|
1952
1994
|
issueData: e,
|
|
1953
1995
|
data: t.data,
|
|
1954
1996
|
path: t.path,
|
|
@@ -1959,7 +2001,7 @@ function b(t, e) {
|
|
|
1959
2001
|
// then schema-bound map if available
|
|
1960
2002
|
r,
|
|
1961
2003
|
// then global override map
|
|
1962
|
-
r ===
|
|
2004
|
+
r === ht ? void 0 : ht
|
|
1963
2005
|
// then global default map
|
|
1964
2006
|
].filter((n) => !!n)
|
|
1965
2007
|
});
|
|
@@ -2008,7 +2050,7 @@ class te {
|
|
|
2008
2050
|
}
|
|
2009
2051
|
const C = Object.freeze({
|
|
2010
2052
|
status: "aborted"
|
|
2011
|
-
}), ze = (t) => ({ status: "dirty", value: t }), ne = (t) => ({ status: "valid", value: t }),
|
|
2053
|
+
}), ze = (t) => ({ status: "dirty", value: t }), ne = (t) => ({ status: "valid", value: t }), Ot = (t) => t.status === "aborted", It = (t) => t.status === "dirty", Ae = (t) => t.status === "valid", Ke = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
2012
2054
|
var j;
|
|
2013
2055
|
(function(t) {
|
|
2014
2056
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
@@ -2021,7 +2063,7 @@ class pe {
|
|
|
2021
2063
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
2022
2064
|
}
|
|
2023
2065
|
}
|
|
2024
|
-
const
|
|
2066
|
+
const Mt = (t, e) => {
|
|
2025
2067
|
if (Ae(e))
|
|
2026
2068
|
return { success: !0, data: e.value };
|
|
2027
2069
|
if (!t.common.issues.length)
|
|
@@ -2079,7 +2121,7 @@ class F {
|
|
|
2079
2121
|
}
|
|
2080
2122
|
_parseSync(e) {
|
|
2081
2123
|
const r = this._parse(e);
|
|
2082
|
-
if (
|
|
2124
|
+
if (Ke(r))
|
|
2083
2125
|
throw new Error("Synchronous parse encountered promise.");
|
|
2084
2126
|
return r;
|
|
2085
2127
|
}
|
|
@@ -2106,7 +2148,7 @@ class F {
|
|
|
2106
2148
|
data: e,
|
|
2107
2149
|
parsedType: fe(e)
|
|
2108
2150
|
}, n = this._parseSync({ data: e, path: s.path, parent: s });
|
|
2109
|
-
return
|
|
2151
|
+
return Mt(s, n);
|
|
2110
2152
|
}
|
|
2111
2153
|
"~validate"(e) {
|
|
2112
2154
|
const r = {
|
|
@@ -2158,8 +2200,8 @@ class F {
|
|
|
2158
2200
|
parent: null,
|
|
2159
2201
|
data: e,
|
|
2160
2202
|
parsedType: fe(e)
|
|
2161
|
-
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
2162
|
-
return
|
|
2203
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (Ke(n) ? n : Promise.resolve(n));
|
|
2204
|
+
return Mt(s, a);
|
|
2163
2205
|
}
|
|
2164
2206
|
refine(e, r) {
|
|
2165
2207
|
const s = (n) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(n) : r;
|
|
@@ -2204,13 +2246,13 @@ class F {
|
|
|
2204
2246
|
return oe.create(this);
|
|
2205
2247
|
}
|
|
2206
2248
|
promise() {
|
|
2207
|
-
return
|
|
2249
|
+
return tt.create(this, this._def);
|
|
2208
2250
|
}
|
|
2209
2251
|
or(e) {
|
|
2210
|
-
return
|
|
2252
|
+
return Xe.create([this, e], this._def);
|
|
2211
2253
|
}
|
|
2212
2254
|
and(e) {
|
|
2213
|
-
return
|
|
2255
|
+
return et.create(this, e, this._def);
|
|
2214
2256
|
}
|
|
2215
2257
|
transform(e) {
|
|
2216
2258
|
return new Te({
|
|
@@ -2222,7 +2264,7 @@ class F {
|
|
|
2222
2264
|
}
|
|
2223
2265
|
default(e) {
|
|
2224
2266
|
const r = typeof e == "function" ? e : () => e;
|
|
2225
|
-
return new
|
|
2267
|
+
return new pt({
|
|
2226
2268
|
...O(this._def),
|
|
2227
2269
|
innerType: this,
|
|
2228
2270
|
defaultValue: r,
|
|
@@ -2230,7 +2272,7 @@ class F {
|
|
|
2230
2272
|
});
|
|
2231
2273
|
}
|
|
2232
2274
|
brand() {
|
|
2233
|
-
return new
|
|
2275
|
+
return new Tn({
|
|
2234
2276
|
typeName: E.ZodBranded,
|
|
2235
2277
|
type: this,
|
|
2236
2278
|
...O(this._def)
|
|
@@ -2238,7 +2280,7 @@ class F {
|
|
|
2238
2280
|
}
|
|
2239
2281
|
catch(e) {
|
|
2240
2282
|
const r = typeof e == "function" ? e : () => e;
|
|
2241
|
-
return new
|
|
2283
|
+
return new gt({
|
|
2242
2284
|
...O(this._def),
|
|
2243
2285
|
innerType: this,
|
|
2244
2286
|
catchValue: r,
|
|
@@ -2253,10 +2295,10 @@ class F {
|
|
|
2253
2295
|
});
|
|
2254
2296
|
}
|
|
2255
2297
|
pipe(e) {
|
|
2256
|
-
return
|
|
2298
|
+
return _t.create(this, e);
|
|
2257
2299
|
}
|
|
2258
2300
|
readonly() {
|
|
2259
|
-
return
|
|
2301
|
+
return yt.create(this);
|
|
2260
2302
|
}
|
|
2261
2303
|
isOptional() {
|
|
2262
2304
|
return this.safeParse(void 0).success;
|
|
@@ -2265,28 +2307,28 @@ class F {
|
|
|
2265
2307
|
return this.safeParse(null).success;
|
|
2266
2308
|
}
|
|
2267
2309
|
}
|
|
2268
|
-
const
|
|
2269
|
-
let
|
|
2270
|
-
const
|
|
2271
|
-
function
|
|
2310
|
+
const un = /^c[^\s-]{8,}$/i, dn = /^[0-9a-z]+$/, fn = /^[0-9A-HJKMNP-TV-Z]{26}$/i, hn = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, mn = /^[a-z0-9_-]{21}$/i, pn = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, gn = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, yn = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, vn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2311
|
+
let ot;
|
|
2312
|
+
const bn = /^(?:(?: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])$/, xn = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, _n = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, wn = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, jn = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Nn = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Cr = "((\\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])))", kn = new RegExp(`^${Cr}$`);
|
|
2313
|
+
function Er(t) {
|
|
2272
2314
|
let e = "[0-5]\\d";
|
|
2273
2315
|
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2274
2316
|
const r = t.precision ? "+" : "?";
|
|
2275
2317
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`;
|
|
2276
2318
|
}
|
|
2277
|
-
function
|
|
2278
|
-
return new RegExp(`^${
|
|
2319
|
+
function Cn(t) {
|
|
2320
|
+
return new RegExp(`^${Er(t)}$`);
|
|
2279
2321
|
}
|
|
2280
|
-
function
|
|
2281
|
-
let e = `${
|
|
2322
|
+
function En(t) {
|
|
2323
|
+
let e = `${Cr}T${Er(t)}`;
|
|
2282
2324
|
const r = [];
|
|
2283
2325
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
2284
2326
|
}
|
|
2285
|
-
function
|
|
2286
|
-
return !!((e === "v4" || !e) &&
|
|
2327
|
+
function Sn(t, e) {
|
|
2328
|
+
return !!((e === "v4" || !e) && bn.test(t) || (e === "v6" || !e) && _n.test(t));
|
|
2287
2329
|
}
|
|
2288
|
-
function
|
|
2289
|
-
if (!
|
|
2330
|
+
function An(t, e) {
|
|
2331
|
+
if (!pn.test(t))
|
|
2290
2332
|
return !1;
|
|
2291
2333
|
try {
|
|
2292
2334
|
const [r] = t.split(".");
|
|
@@ -2298,8 +2340,8 @@ function Nn(t, e) {
|
|
|
2298
2340
|
return !1;
|
|
2299
2341
|
}
|
|
2300
2342
|
}
|
|
2301
|
-
function
|
|
2302
|
-
return !!((e === "v4" || !e) &&
|
|
2343
|
+
function Rn(t, e) {
|
|
2344
|
+
return !!((e === "v4" || !e) && xn.test(t) || (e === "v6" || !e) && wn.test(t));
|
|
2303
2345
|
}
|
|
2304
2346
|
class ce extends F {
|
|
2305
2347
|
_parse(e) {
|
|
@@ -2350,43 +2392,43 @@ class ce extends F {
|
|
|
2350
2392
|
message: a.message
|
|
2351
2393
|
}), s.dirty());
|
|
2352
2394
|
} else if (a.kind === "email")
|
|
2353
|
-
|
|
2395
|
+
yn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2354
2396
|
validation: "email",
|
|
2355
2397
|
code: y.invalid_string,
|
|
2356
2398
|
message: a.message
|
|
2357
2399
|
}), s.dirty());
|
|
2358
2400
|
else if (a.kind === "emoji")
|
|
2359
|
-
|
|
2401
|
+
ot || (ot = new RegExp(vn, "u")), ot.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2360
2402
|
validation: "emoji",
|
|
2361
2403
|
code: y.invalid_string,
|
|
2362
2404
|
message: a.message
|
|
2363
2405
|
}), s.dirty());
|
|
2364
2406
|
else if (a.kind === "uuid")
|
|
2365
|
-
|
|
2407
|
+
hn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2366
2408
|
validation: "uuid",
|
|
2367
2409
|
code: y.invalid_string,
|
|
2368
2410
|
message: a.message
|
|
2369
2411
|
}), s.dirty());
|
|
2370
2412
|
else if (a.kind === "nanoid")
|
|
2371
|
-
|
|
2413
|
+
mn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2372
2414
|
validation: "nanoid",
|
|
2373
2415
|
code: y.invalid_string,
|
|
2374
2416
|
message: a.message
|
|
2375
2417
|
}), s.dirty());
|
|
2376
2418
|
else if (a.kind === "cuid")
|
|
2377
|
-
|
|
2419
|
+
un.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2378
2420
|
validation: "cuid",
|
|
2379
2421
|
code: y.invalid_string,
|
|
2380
2422
|
message: a.message
|
|
2381
2423
|
}), s.dirty());
|
|
2382
2424
|
else if (a.kind === "cuid2")
|
|
2383
|
-
|
|
2425
|
+
dn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2384
2426
|
validation: "cuid2",
|
|
2385
2427
|
code: y.invalid_string,
|
|
2386
2428
|
message: a.message
|
|
2387
2429
|
}), s.dirty());
|
|
2388
2430
|
else if (a.kind === "ulid")
|
|
2389
|
-
|
|
2431
|
+
fn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2390
2432
|
validation: "ulid",
|
|
2391
2433
|
code: y.invalid_string,
|
|
2392
2434
|
message: a.message
|
|
@@ -2417,43 +2459,43 @@ class ce extends F {
|
|
|
2417
2459
|
code: y.invalid_string,
|
|
2418
2460
|
validation: { endsWith: a.value },
|
|
2419
2461
|
message: a.message
|
|
2420
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
2462
|
+
}), s.dirty()) : a.kind === "datetime" ? En(a).test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2421
2463
|
code: y.invalid_string,
|
|
2422
2464
|
validation: "datetime",
|
|
2423
2465
|
message: a.message
|
|
2424
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
2466
|
+
}), s.dirty()) : a.kind === "date" ? kn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2425
2467
|
code: y.invalid_string,
|
|
2426
2468
|
validation: "date",
|
|
2427
2469
|
message: a.message
|
|
2428
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
2470
|
+
}), s.dirty()) : a.kind === "time" ? Cn(a).test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2429
2471
|
code: y.invalid_string,
|
|
2430
2472
|
validation: "time",
|
|
2431
2473
|
message: a.message
|
|
2432
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
2474
|
+
}), s.dirty()) : a.kind === "duration" ? gn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2433
2475
|
validation: "duration",
|
|
2434
2476
|
code: y.invalid_string,
|
|
2435
2477
|
message: a.message
|
|
2436
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
2478
|
+
}), s.dirty()) : a.kind === "ip" ? Sn(e.data, a.version) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2437
2479
|
validation: "ip",
|
|
2438
2480
|
code: y.invalid_string,
|
|
2439
2481
|
message: a.message
|
|
2440
|
-
}), s.dirty()) : a.kind === "jwt" ?
|
|
2482
|
+
}), s.dirty()) : a.kind === "jwt" ? An(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2441
2483
|
validation: "jwt",
|
|
2442
2484
|
code: y.invalid_string,
|
|
2443
2485
|
message: a.message
|
|
2444
|
-
}), s.dirty()) : a.kind === "cidr" ?
|
|
2486
|
+
}), s.dirty()) : a.kind === "cidr" ? Rn(e.data, a.version) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2445
2487
|
validation: "cidr",
|
|
2446
2488
|
code: y.invalid_string,
|
|
2447
2489
|
message: a.message
|
|
2448
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
2490
|
+
}), s.dirty()) : a.kind === "base64" ? jn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2449
2491
|
validation: "base64",
|
|
2450
2492
|
code: y.invalid_string,
|
|
2451
2493
|
message: a.message
|
|
2452
|
-
}), s.dirty()) : a.kind === "base64url" ?
|
|
2494
|
+
}), s.dirty()) : a.kind === "base64url" ? Nn.test(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
2453
2495
|
validation: "base64url",
|
|
2454
2496
|
code: y.invalid_string,
|
|
2455
2497
|
message: a.message
|
|
2456
|
-
}), s.dirty()) :
|
|
2498
|
+
}), s.dirty()) : $.assertNever(a);
|
|
2457
2499
|
return { status: s.value, value: e.data };
|
|
2458
2500
|
}
|
|
2459
2501
|
_regex(e, r, s) {
|
|
@@ -2684,7 +2726,7 @@ ce.create = (t) => new ce({
|
|
|
2684
2726
|
coerce: t?.coerce ?? !1,
|
|
2685
2727
|
...O(t)
|
|
2686
2728
|
});
|
|
2687
|
-
function
|
|
2729
|
+
function Pn(t, e) {
|
|
2688
2730
|
const r = (t.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = r > s ? r : s, a = Number.parseInt(t.toFixed(n).replace(".", "")), l = Number.parseInt(e.toFixed(n).replace(".", ""));
|
|
2689
2731
|
return a % l / 10 ** n;
|
|
2690
2732
|
}
|
|
@@ -2704,7 +2746,7 @@ class xe extends F {
|
|
|
2704
2746
|
let s;
|
|
2705
2747
|
const n = new te();
|
|
2706
2748
|
for (const a of this._def.checks)
|
|
2707
|
-
a.kind === "int" ?
|
|
2749
|
+
a.kind === "int" ? $.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
2708
2750
|
code: y.invalid_type,
|
|
2709
2751
|
expected: "integer",
|
|
2710
2752
|
received: "float",
|
|
@@ -2723,14 +2765,14 @@ class xe extends F {
|
|
|
2723
2765
|
inclusive: a.inclusive,
|
|
2724
2766
|
exact: !1,
|
|
2725
2767
|
message: a.message
|
|
2726
|
-
}), n.dirty()) : a.kind === "multipleOf" ?
|
|
2768
|
+
}), n.dirty()) : a.kind === "multipleOf" ? Pn(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
2727
2769
|
code: y.not_multiple_of,
|
|
2728
2770
|
multipleOf: a.value,
|
|
2729
2771
|
message: a.message
|
|
2730
2772
|
}), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
2731
2773
|
code: y.not_finite,
|
|
2732
2774
|
message: a.message
|
|
2733
|
-
}), n.dirty()) :
|
|
2775
|
+
}), n.dirty()) : $.assertNever(a);
|
|
2734
2776
|
return { status: n.value, value: e.data };
|
|
2735
2777
|
}
|
|
2736
2778
|
gte(e, r) {
|
|
@@ -2842,7 +2884,7 @@ class xe extends F {
|
|
|
2842
2884
|
return e;
|
|
2843
2885
|
}
|
|
2844
2886
|
get isInt() {
|
|
2845
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
2887
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && $.isInteger(e.value));
|
|
2846
2888
|
}
|
|
2847
2889
|
get isFinite() {
|
|
2848
2890
|
let e = null, r = null;
|
|
@@ -2892,7 +2934,7 @@ class _e extends F {
|
|
|
2892
2934
|
code: y.not_multiple_of,
|
|
2893
2935
|
multipleOf: a.value,
|
|
2894
2936
|
message: a.message
|
|
2895
|
-
}), n.dirty()) :
|
|
2937
|
+
}), n.dirty()) : $.assertNever(a);
|
|
2896
2938
|
return { status: n.value, value: e.data };
|
|
2897
2939
|
}
|
|
2898
2940
|
_getInvalidInput(e) {
|
|
@@ -2993,7 +3035,7 @@ _e.create = (t) => new _e({
|
|
|
2993
3035
|
coerce: t?.coerce ?? !1,
|
|
2994
3036
|
...O(t)
|
|
2995
3037
|
});
|
|
2996
|
-
class
|
|
3038
|
+
class Je extends F {
|
|
2997
3039
|
_parse(e) {
|
|
2998
3040
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
2999
3041
|
const s = this._getOrReturnCtx(e);
|
|
@@ -3006,7 +3048,7 @@ class Xe extends F {
|
|
|
3006
3048
|
return ne(e.data);
|
|
3007
3049
|
}
|
|
3008
3050
|
}
|
|
3009
|
-
|
|
3051
|
+
Je.create = (t) => new Je({
|
|
3010
3052
|
typeName: E.ZodBoolean,
|
|
3011
3053
|
coerce: t?.coerce || !1,
|
|
3012
3054
|
...O(t)
|
|
@@ -3044,7 +3086,7 @@ class Re extends F {
|
|
|
3044
3086
|
exact: !1,
|
|
3045
3087
|
maximum: a.value,
|
|
3046
3088
|
type: "date"
|
|
3047
|
-
}), s.dirty()) :
|
|
3089
|
+
}), s.dirty()) : $.assertNever(a);
|
|
3048
3090
|
return {
|
|
3049
3091
|
status: s.value,
|
|
3050
3092
|
value: new Date(e.data.getTime())
|
|
@@ -3089,7 +3131,7 @@ Re.create = (t) => new Re({
|
|
|
3089
3131
|
typeName: E.ZodDate,
|
|
3090
3132
|
...O(t)
|
|
3091
3133
|
});
|
|
3092
|
-
class
|
|
3134
|
+
class Lt extends F {
|
|
3093
3135
|
_parse(e) {
|
|
3094
3136
|
if (this._getType(e) !== _.symbol) {
|
|
3095
3137
|
const s = this._getOrReturnCtx(e);
|
|
@@ -3102,11 +3144,11 @@ class Ft extends F {
|
|
|
3102
3144
|
return ne(e.data);
|
|
3103
3145
|
}
|
|
3104
3146
|
}
|
|
3105
|
-
|
|
3147
|
+
Lt.create = (t) => new Lt({
|
|
3106
3148
|
typeName: E.ZodSymbol,
|
|
3107
3149
|
...O(t)
|
|
3108
3150
|
});
|
|
3109
|
-
class
|
|
3151
|
+
class Ft extends F {
|
|
3110
3152
|
_parse(e) {
|
|
3111
3153
|
if (this._getType(e) !== _.undefined) {
|
|
3112
3154
|
const s = this._getOrReturnCtx(e);
|
|
@@ -3119,7 +3161,7 @@ class Ut extends F {
|
|
|
3119
3161
|
return ne(e.data);
|
|
3120
3162
|
}
|
|
3121
3163
|
}
|
|
3122
|
-
|
|
3164
|
+
Ft.create = (t) => new Ft({
|
|
3123
3165
|
typeName: E.ZodUndefined,
|
|
3124
3166
|
...O(t)
|
|
3125
3167
|
});
|
|
@@ -3140,7 +3182,7 @@ $t.create = (t) => new $t({
|
|
|
3140
3182
|
typeName: E.ZodNull,
|
|
3141
3183
|
...O(t)
|
|
3142
3184
|
});
|
|
3143
|
-
class
|
|
3185
|
+
class Ut extends F {
|
|
3144
3186
|
constructor() {
|
|
3145
3187
|
super(...arguments), this._any = !0;
|
|
3146
3188
|
}
|
|
@@ -3148,11 +3190,11 @@ class Dt extends F {
|
|
|
3148
3190
|
return ne(e.data);
|
|
3149
3191
|
}
|
|
3150
3192
|
}
|
|
3151
|
-
|
|
3193
|
+
Ut.create = (t) => new Ut({
|
|
3152
3194
|
typeName: E.ZodAny,
|
|
3153
3195
|
...O(t)
|
|
3154
3196
|
});
|
|
3155
|
-
class
|
|
3197
|
+
class Dt extends F {
|
|
3156
3198
|
constructor() {
|
|
3157
3199
|
super(...arguments), this._unknown = !0;
|
|
3158
3200
|
}
|
|
@@ -3160,7 +3202,7 @@ class zt extends F {
|
|
|
3160
3202
|
return ne(e.data);
|
|
3161
3203
|
}
|
|
3162
3204
|
}
|
|
3163
|
-
|
|
3205
|
+
Dt.create = (t) => new Dt({
|
|
3164
3206
|
typeName: E.ZodUnknown,
|
|
3165
3207
|
...O(t)
|
|
3166
3208
|
});
|
|
@@ -3178,7 +3220,7 @@ ge.create = (t) => new ge({
|
|
|
3178
3220
|
typeName: E.ZodNever,
|
|
3179
3221
|
...O(t)
|
|
3180
3222
|
});
|
|
3181
|
-
class
|
|
3223
|
+
class zt extends F {
|
|
3182
3224
|
_parse(e) {
|
|
3183
3225
|
if (this._getType(e) !== _.undefined) {
|
|
3184
3226
|
const s = this._getOrReturnCtx(e);
|
|
@@ -3191,7 +3233,7 @@ class Zt extends F {
|
|
|
3191
3233
|
return ne(e.data);
|
|
3192
3234
|
}
|
|
3193
3235
|
}
|
|
3194
|
-
|
|
3236
|
+
zt.create = (t) => new zt({
|
|
3195
3237
|
typeName: E.ZodVoid,
|
|
3196
3238
|
...O(t)
|
|
3197
3239
|
});
|
|
@@ -3268,12 +3310,12 @@ oe.create = (t, e) => new oe({
|
|
|
3268
3310
|
typeName: E.ZodArray,
|
|
3269
3311
|
...O(e)
|
|
3270
3312
|
});
|
|
3271
|
-
function
|
|
3313
|
+
function ke(t) {
|
|
3272
3314
|
if (t instanceof Q) {
|
|
3273
3315
|
const e = {};
|
|
3274
3316
|
for (const r in t.shape) {
|
|
3275
3317
|
const s = t.shape[r];
|
|
3276
|
-
e[r] = me.create(
|
|
3318
|
+
e[r] = me.create(ke(s));
|
|
3277
3319
|
}
|
|
3278
3320
|
return new Q({
|
|
3279
3321
|
...t._def,
|
|
@@ -3281,8 +3323,8 @@ function Ne(t) {
|
|
|
3281
3323
|
});
|
|
3282
3324
|
} else return t instanceof oe ? new oe({
|
|
3283
3325
|
...t._def,
|
|
3284
|
-
type:
|
|
3285
|
-
}) : t instanceof me ? me.create(
|
|
3326
|
+
type: ke(t.element)
|
|
3327
|
+
}) : t instanceof me ? me.create(ke(t.unwrap())) : t instanceof Oe ? Oe.create(ke(t.unwrap())) : t instanceof we ? we.create(t.items.map((e) => ke(e))) : t;
|
|
3286
3328
|
}
|
|
3287
3329
|
class Q extends F {
|
|
3288
3330
|
constructor() {
|
|
@@ -3291,7 +3333,7 @@ class Q extends F {
|
|
|
3291
3333
|
_getCached() {
|
|
3292
3334
|
if (this._cached !== null)
|
|
3293
3335
|
return this._cached;
|
|
3294
|
-
const e = this._def.shape(), r =
|
|
3336
|
+
const e = this._def.shape(), r = $.objectKeys(e);
|
|
3295
3337
|
return this._cached = { shape: e, keys: r }, this._cached;
|
|
3296
3338
|
}
|
|
3297
3339
|
_parse(e) {
|
|
@@ -3497,7 +3539,7 @@ class Q extends F {
|
|
|
3497
3539
|
}
|
|
3498
3540
|
pick(e) {
|
|
3499
3541
|
const r = {};
|
|
3500
|
-
for (const s of
|
|
3542
|
+
for (const s of $.objectKeys(e))
|
|
3501
3543
|
e[s] && this.shape[s] && (r[s] = this.shape[s]);
|
|
3502
3544
|
return new Q({
|
|
3503
3545
|
...this._def,
|
|
@@ -3506,7 +3548,7 @@ class Q extends F {
|
|
|
3506
3548
|
}
|
|
3507
3549
|
omit(e) {
|
|
3508
3550
|
const r = {};
|
|
3509
|
-
for (const s of
|
|
3551
|
+
for (const s of $.objectKeys(this.shape))
|
|
3510
3552
|
e[s] || (r[s] = this.shape[s]);
|
|
3511
3553
|
return new Q({
|
|
3512
3554
|
...this._def,
|
|
@@ -3517,11 +3559,11 @@ class Q extends F {
|
|
|
3517
3559
|
* @deprecated
|
|
3518
3560
|
*/
|
|
3519
3561
|
deepPartial() {
|
|
3520
|
-
return
|
|
3562
|
+
return ke(this);
|
|
3521
3563
|
}
|
|
3522
3564
|
partial(e) {
|
|
3523
3565
|
const r = {};
|
|
3524
|
-
for (const s of
|
|
3566
|
+
for (const s of $.objectKeys(this.shape)) {
|
|
3525
3567
|
const n = this.shape[s];
|
|
3526
3568
|
e && !e[s] ? r[s] = n : r[s] = n.optional();
|
|
3527
3569
|
}
|
|
@@ -3532,7 +3574,7 @@ class Q extends F {
|
|
|
3532
3574
|
}
|
|
3533
3575
|
required(e) {
|
|
3534
3576
|
const r = {};
|
|
3535
|
-
for (const s of
|
|
3577
|
+
for (const s of $.objectKeys(this.shape))
|
|
3536
3578
|
if (e && !e[s])
|
|
3537
3579
|
r[s] = this.shape[s];
|
|
3538
3580
|
else {
|
|
@@ -3547,7 +3589,7 @@ class Q extends F {
|
|
|
3547
3589
|
});
|
|
3548
3590
|
}
|
|
3549
3591
|
keyof() {
|
|
3550
|
-
return
|
|
3592
|
+
return Sr($.objectKeys(this.shape));
|
|
3551
3593
|
}
|
|
3552
3594
|
}
|
|
3553
3595
|
Q.create = (t, e) => new Q({
|
|
@@ -3571,7 +3613,7 @@ Q.lazycreate = (t, e) => new Q({
|
|
|
3571
3613
|
typeName: E.ZodObject,
|
|
3572
3614
|
...O(e)
|
|
3573
3615
|
});
|
|
3574
|
-
class
|
|
3616
|
+
class Xe extends F {
|
|
3575
3617
|
_parse(e) {
|
|
3576
3618
|
const { ctx: r } = this._processInputParams(e), s = this._def.options;
|
|
3577
3619
|
function n(a) {
|
|
@@ -3639,19 +3681,19 @@ class et extends F {
|
|
|
3639
3681
|
return this._def.options;
|
|
3640
3682
|
}
|
|
3641
3683
|
}
|
|
3642
|
-
|
|
3684
|
+
Xe.create = (t, e) => new Xe({
|
|
3643
3685
|
options: t,
|
|
3644
3686
|
typeName: E.ZodUnion,
|
|
3645
3687
|
...O(e)
|
|
3646
3688
|
});
|
|
3647
|
-
function
|
|
3689
|
+
function mt(t, e) {
|
|
3648
3690
|
const r = fe(t), s = fe(e);
|
|
3649
3691
|
if (t === e)
|
|
3650
3692
|
return { valid: !0, data: t };
|
|
3651
3693
|
if (r === _.object && s === _.object) {
|
|
3652
|
-
const n =
|
|
3694
|
+
const n = $.objectKeys(e), a = $.objectKeys(t).filter((c) => n.indexOf(c) !== -1), l = { ...t, ...e };
|
|
3653
3695
|
for (const c of a) {
|
|
3654
|
-
const o =
|
|
3696
|
+
const o = mt(t[c], e[c]);
|
|
3655
3697
|
if (!o.valid)
|
|
3656
3698
|
return { valid: !1 };
|
|
3657
3699
|
l[c] = o.data;
|
|
@@ -3662,7 +3704,7 @@ function pt(t, e) {
|
|
|
3662
3704
|
return { valid: !1 };
|
|
3663
3705
|
const n = [];
|
|
3664
3706
|
for (let a = 0; a < t.length; a++) {
|
|
3665
|
-
const l = t[a], c = e[a], o =
|
|
3707
|
+
const l = t[a], c = e[a], o = mt(l, c);
|
|
3666
3708
|
if (!o.valid)
|
|
3667
3709
|
return { valid: !1 };
|
|
3668
3710
|
n.push(o.data);
|
|
@@ -3670,13 +3712,13 @@ function pt(t, e) {
|
|
|
3670
3712
|
return { valid: !0, data: n };
|
|
3671
3713
|
} else return r === _.date && s === _.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
3672
3714
|
}
|
|
3673
|
-
class
|
|
3715
|
+
class et extends F {
|
|
3674
3716
|
_parse(e) {
|
|
3675
3717
|
const { status: r, ctx: s } = this._processInputParams(e), n = (a, l) => {
|
|
3676
|
-
if (
|
|
3718
|
+
if (Ot(a) || Ot(l))
|
|
3677
3719
|
return C;
|
|
3678
|
-
const c =
|
|
3679
|
-
return c.valid ? ((
|
|
3720
|
+
const c = mt(a.value, l.value);
|
|
3721
|
+
return c.valid ? ((It(a) || It(l)) && r.dirty(), { status: r.value, value: c.data }) : (b(s, {
|
|
3680
3722
|
code: y.invalid_intersection_types
|
|
3681
3723
|
}), C);
|
|
3682
3724
|
};
|
|
@@ -3702,7 +3744,7 @@ class tt extends F {
|
|
|
3702
3744
|
}));
|
|
3703
3745
|
}
|
|
3704
3746
|
}
|
|
3705
|
-
|
|
3747
|
+
et.create = (t, e, r) => new et({
|
|
3706
3748
|
left: t,
|
|
3707
3749
|
right: e,
|
|
3708
3750
|
typeName: E.ZodIntersection,
|
|
@@ -3758,7 +3800,7 @@ we.create = (t, e) => {
|
|
|
3758
3800
|
...O(e)
|
|
3759
3801
|
});
|
|
3760
3802
|
};
|
|
3761
|
-
class
|
|
3803
|
+
class Zt extends F {
|
|
3762
3804
|
get keySchema() {
|
|
3763
3805
|
return this._def.keyType;
|
|
3764
3806
|
}
|
|
@@ -3800,7 +3842,7 @@ class qt extends F {
|
|
|
3800
3842
|
}
|
|
3801
3843
|
}
|
|
3802
3844
|
}
|
|
3803
|
-
|
|
3845
|
+
Zt.create = (t, e, r) => new Zt({
|
|
3804
3846
|
valueType: e,
|
|
3805
3847
|
keyType: t,
|
|
3806
3848
|
typeName: E.ZodMap,
|
|
@@ -3870,7 +3912,7 @@ Ve.create = (t, e) => new Ve({
|
|
|
3870
3912
|
typeName: E.ZodSet,
|
|
3871
3913
|
...O(e)
|
|
3872
3914
|
});
|
|
3873
|
-
class
|
|
3915
|
+
class qt extends F {
|
|
3874
3916
|
get schema() {
|
|
3875
3917
|
return this._def.getter();
|
|
3876
3918
|
}
|
|
@@ -3879,12 +3921,12 @@ class Vt extends F {
|
|
|
3879
3921
|
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
3880
3922
|
}
|
|
3881
3923
|
}
|
|
3882
|
-
|
|
3924
|
+
qt.create = (t, e) => new qt({
|
|
3883
3925
|
getter: t,
|
|
3884
3926
|
typeName: E.ZodLazy,
|
|
3885
3927
|
...O(e)
|
|
3886
3928
|
});
|
|
3887
|
-
class
|
|
3929
|
+
class Vt extends F {
|
|
3888
3930
|
_parse(e) {
|
|
3889
3931
|
if (e.data !== this._def.value) {
|
|
3890
3932
|
const r = this._getOrReturnCtx(e);
|
|
@@ -3900,12 +3942,12 @@ class Bt extends F {
|
|
|
3900
3942
|
return this._def.value;
|
|
3901
3943
|
}
|
|
3902
3944
|
}
|
|
3903
|
-
|
|
3945
|
+
Vt.create = (t, e) => new Vt({
|
|
3904
3946
|
value: t,
|
|
3905
3947
|
typeName: E.ZodLiteral,
|
|
3906
3948
|
...O(e)
|
|
3907
3949
|
});
|
|
3908
|
-
function
|
|
3950
|
+
function Sr(t, e) {
|
|
3909
3951
|
return new Pe({
|
|
3910
3952
|
values: t,
|
|
3911
3953
|
typeName: E.ZodEnum,
|
|
@@ -3917,7 +3959,7 @@ class Pe extends F {
|
|
|
3917
3959
|
if (typeof e.data != "string") {
|
|
3918
3960
|
const r = this._getOrReturnCtx(e), s = this._def.values;
|
|
3919
3961
|
return b(r, {
|
|
3920
|
-
expected:
|
|
3962
|
+
expected: $.joinValues(s),
|
|
3921
3963
|
received: r.parsedType,
|
|
3922
3964
|
code: y.invalid_type
|
|
3923
3965
|
}), C;
|
|
@@ -3966,20 +4008,20 @@ class Pe extends F {
|
|
|
3966
4008
|
});
|
|
3967
4009
|
}
|
|
3968
4010
|
}
|
|
3969
|
-
Pe.create =
|
|
3970
|
-
class
|
|
4011
|
+
Pe.create = Sr;
|
|
4012
|
+
class Bt extends F {
|
|
3971
4013
|
_parse(e) {
|
|
3972
|
-
const r =
|
|
4014
|
+
const r = $.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
3973
4015
|
if (s.parsedType !== _.string && s.parsedType !== _.number) {
|
|
3974
|
-
const n =
|
|
4016
|
+
const n = $.objectValues(r);
|
|
3975
4017
|
return b(s, {
|
|
3976
|
-
expected:
|
|
4018
|
+
expected: $.joinValues(n),
|
|
3977
4019
|
received: s.parsedType,
|
|
3978
4020
|
code: y.invalid_type
|
|
3979
4021
|
}), C;
|
|
3980
4022
|
}
|
|
3981
|
-
if (this._cache || (this._cache = new Set(
|
|
3982
|
-
const n =
|
|
4023
|
+
if (this._cache || (this._cache = new Set($.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
4024
|
+
const n = $.objectValues(r);
|
|
3983
4025
|
return b(s, {
|
|
3984
4026
|
received: s.data,
|
|
3985
4027
|
code: y.invalid_enum_value,
|
|
@@ -3992,12 +4034,12 @@ class Qt extends F {
|
|
|
3992
4034
|
return this._def.values;
|
|
3993
4035
|
}
|
|
3994
4036
|
}
|
|
3995
|
-
|
|
4037
|
+
Bt.create = (t, e) => new Bt({
|
|
3996
4038
|
values: t,
|
|
3997
4039
|
typeName: E.ZodNativeEnum,
|
|
3998
4040
|
...O(e)
|
|
3999
4041
|
});
|
|
4000
|
-
class
|
|
4042
|
+
class tt extends F {
|
|
4001
4043
|
unwrap() {
|
|
4002
4044
|
return this._def.type;
|
|
4003
4045
|
}
|
|
@@ -4016,7 +4058,7 @@ class rt extends F {
|
|
|
4016
4058
|
})));
|
|
4017
4059
|
}
|
|
4018
4060
|
}
|
|
4019
|
-
|
|
4061
|
+
tt.create = (t, e) => new tt({
|
|
4020
4062
|
type: t,
|
|
4021
4063
|
typeName: E.ZodPromise,
|
|
4022
4064
|
...O(e)
|
|
@@ -4098,7 +4140,7 @@ class Te extends F {
|
|
|
4098
4140
|
status: r.value,
|
|
4099
4141
|
value: c
|
|
4100
4142
|
})) : C);
|
|
4101
|
-
|
|
4143
|
+
$.assertNever(n);
|
|
4102
4144
|
}
|
|
4103
4145
|
}
|
|
4104
4146
|
Te.create = (t, e, r) => new Te({
|
|
@@ -4139,7 +4181,7 @@ Oe.create = (t, e) => new Oe({
|
|
|
4139
4181
|
typeName: E.ZodNullable,
|
|
4140
4182
|
...O(e)
|
|
4141
4183
|
});
|
|
4142
|
-
class
|
|
4184
|
+
class pt extends F {
|
|
4143
4185
|
_parse(e) {
|
|
4144
4186
|
const { ctx: r } = this._processInputParams(e);
|
|
4145
4187
|
let s = r.data;
|
|
@@ -4153,13 +4195,13 @@ class gt extends F {
|
|
|
4153
4195
|
return this._def.innerType;
|
|
4154
4196
|
}
|
|
4155
4197
|
}
|
|
4156
|
-
|
|
4198
|
+
pt.create = (t, e) => new pt({
|
|
4157
4199
|
innerType: t,
|
|
4158
4200
|
typeName: E.ZodDefault,
|
|
4159
4201
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
4160
4202
|
...O(e)
|
|
4161
4203
|
});
|
|
4162
|
-
class
|
|
4204
|
+
class gt extends F {
|
|
4163
4205
|
_parse(e) {
|
|
4164
4206
|
const { ctx: r } = this._processInputParams(e), s = {
|
|
4165
4207
|
...r,
|
|
@@ -4174,7 +4216,7 @@ class yt extends F {
|
|
|
4174
4216
|
...s
|
|
4175
4217
|
}
|
|
4176
4218
|
});
|
|
4177
|
-
return
|
|
4219
|
+
return Ke(n) ? n.then((a) => ({
|
|
4178
4220
|
status: "valid",
|
|
4179
4221
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
4180
4222
|
get error() {
|
|
@@ -4196,13 +4238,13 @@ class yt extends F {
|
|
|
4196
4238
|
return this._def.innerType;
|
|
4197
4239
|
}
|
|
4198
4240
|
}
|
|
4199
|
-
|
|
4241
|
+
gt.create = (t, e) => new gt({
|
|
4200
4242
|
innerType: t,
|
|
4201
4243
|
typeName: E.ZodCatch,
|
|
4202
4244
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4203
4245
|
...O(e)
|
|
4204
4246
|
});
|
|
4205
|
-
class
|
|
4247
|
+
class Qt extends F {
|
|
4206
4248
|
_parse(e) {
|
|
4207
4249
|
if (this._getType(e) !== _.nan) {
|
|
4208
4250
|
const s = this._getOrReturnCtx(e);
|
|
@@ -4215,11 +4257,11 @@ class Wt extends F {
|
|
|
4215
4257
|
return { status: "valid", value: e.data };
|
|
4216
4258
|
}
|
|
4217
4259
|
}
|
|
4218
|
-
|
|
4260
|
+
Qt.create = (t) => new Qt({
|
|
4219
4261
|
typeName: E.ZodNaN,
|
|
4220
4262
|
...O(t)
|
|
4221
4263
|
});
|
|
4222
|
-
class
|
|
4264
|
+
class Tn extends F {
|
|
4223
4265
|
_parse(e) {
|
|
4224
4266
|
const { ctx: r } = this._processInputParams(e), s = r.data;
|
|
4225
4267
|
return this._def.type._parse({
|
|
@@ -4232,7 +4274,7 @@ class Sn extends F {
|
|
|
4232
4274
|
return this._def.type;
|
|
4233
4275
|
}
|
|
4234
4276
|
}
|
|
4235
|
-
class
|
|
4277
|
+
class _t extends F {
|
|
4236
4278
|
_parse(e) {
|
|
4237
4279
|
const { status: r, ctx: s } = this._processInputParams(e);
|
|
4238
4280
|
if (s.common.async)
|
|
@@ -4265,23 +4307,23 @@ class wt extends F {
|
|
|
4265
4307
|
}
|
|
4266
4308
|
}
|
|
4267
4309
|
static create(e, r) {
|
|
4268
|
-
return new
|
|
4310
|
+
return new _t({
|
|
4269
4311
|
in: e,
|
|
4270
4312
|
out: r,
|
|
4271
4313
|
typeName: E.ZodPipeline
|
|
4272
4314
|
});
|
|
4273
4315
|
}
|
|
4274
4316
|
}
|
|
4275
|
-
class
|
|
4317
|
+
class yt extends F {
|
|
4276
4318
|
_parse(e) {
|
|
4277
4319
|
const r = this._def.innerType._parse(e), s = (n) => (Ae(n) && (n.value = Object.freeze(n.value)), n);
|
|
4278
|
-
return
|
|
4320
|
+
return Ke(r) ? r.then((n) => s(n)) : s(r);
|
|
4279
4321
|
}
|
|
4280
4322
|
unwrap() {
|
|
4281
4323
|
return this._def.innerType;
|
|
4282
4324
|
}
|
|
4283
4325
|
}
|
|
4284
|
-
|
|
4326
|
+
yt.create = (t, e) => new yt({
|
|
4285
4327
|
innerType: t,
|
|
4286
4328
|
typeName: E.ZodReadonly,
|
|
4287
4329
|
...O(e)
|
|
@@ -4293,39 +4335,39 @@ var E;
|
|
|
4293
4335
|
const Ce = ce.create;
|
|
4294
4336
|
xe.create;
|
|
4295
4337
|
_e.create;
|
|
4296
|
-
|
|
4338
|
+
Je.create;
|
|
4297
4339
|
Re.create;
|
|
4298
4340
|
ge.create;
|
|
4299
4341
|
oe.create;
|
|
4300
|
-
const
|
|
4342
|
+
const Ar = Q.create;
|
|
4343
|
+
Xe.create;
|
|
4301
4344
|
et.create;
|
|
4302
|
-
tt.create;
|
|
4303
4345
|
we.create;
|
|
4304
|
-
const
|
|
4305
|
-
|
|
4346
|
+
const On = Pe.create;
|
|
4347
|
+
tt.create;
|
|
4306
4348
|
me.create;
|
|
4307
4349
|
Oe.create;
|
|
4308
|
-
const
|
|
4350
|
+
const rt = {
|
|
4309
4351
|
string: ((t) => ce.create({ ...t, coerce: !0 })),
|
|
4310
4352
|
number: ((t) => xe.create({ ...t, coerce: !0 })),
|
|
4311
|
-
boolean: ((t) =>
|
|
4353
|
+
boolean: ((t) => Je.create({
|
|
4312
4354
|
...t,
|
|
4313
4355
|
coerce: !0
|
|
4314
4356
|
})),
|
|
4315
4357
|
bigint: ((t) => _e.create({ ...t, coerce: !0 })),
|
|
4316
4358
|
date: ((t) => Re.create({ ...t, coerce: !0 }))
|
|
4317
|
-
},
|
|
4359
|
+
}, In = Ar({
|
|
4318
4360
|
q: Ce().optional(),
|
|
4319
4361
|
task_type: Ce().optional(),
|
|
4320
4362
|
status: Ce().optional(),
|
|
4321
4363
|
from_date: Ce().optional(),
|
|
4322
4364
|
to_date: Ce().optional(),
|
|
4323
|
-
page:
|
|
4324
|
-
per_page:
|
|
4365
|
+
page: rt.number().int().positive().default(1),
|
|
4366
|
+
per_page: rt.number().int().positive().default(20)
|
|
4325
4367
|
});
|
|
4326
|
-
function
|
|
4368
|
+
function Mn({ setSelectedTask: t }) {
|
|
4327
4369
|
const e = (s) => {
|
|
4328
|
-
const { data: n, raw: a, isLoading: l } =
|
|
4370
|
+
const { data: n, raw: a, isLoading: l } = Nr(s);
|
|
4329
4371
|
return {
|
|
4330
4372
|
data: n ?? [],
|
|
4331
4373
|
isLoading: l,
|
|
@@ -4357,10 +4399,10 @@ function Pn({ setSelectedTask: t }) {
|
|
|
4357
4399
|
}
|
|
4358
4400
|
];
|
|
4359
4401
|
return /* @__PURE__ */ i.jsx(
|
|
4360
|
-
|
|
4402
|
+
xt,
|
|
4361
4403
|
{
|
|
4362
4404
|
title: "Background Tasks",
|
|
4363
|
-
paramsSchema:
|
|
4405
|
+
paramsSchema: In,
|
|
4364
4406
|
useQuery: e,
|
|
4365
4407
|
columns: r,
|
|
4366
4408
|
onRowClick: t,
|
|
@@ -4437,8 +4479,8 @@ function Pn({ setSelectedTask: t }) {
|
|
|
4437
4479
|
}
|
|
4438
4480
|
);
|
|
4439
4481
|
}
|
|
4440
|
-
function
|
|
4441
|
-
const r = t?.id == null ? null : String(t.id), n =
|
|
4482
|
+
function Ln({ selectedTask: t, setSelectedTask: e }) {
|
|
4483
|
+
const r = t?.id == null ? null : String(t.id), n = kr(r).data ?? null;
|
|
4442
4484
|
if (!t) return null;
|
|
4443
4485
|
const a = n?.payload ?? t.payload ?? null;
|
|
4444
4486
|
return /* @__PURE__ */ i.jsx(
|
|
@@ -4515,77 +4557,77 @@ function Tn({ selectedTask: t, setSelectedTask: e }) {
|
|
|
4515
4557
|
}
|
|
4516
4558
|
);
|
|
4517
4559
|
}
|
|
4518
|
-
function
|
|
4560
|
+
function Fn() {
|
|
4519
4561
|
const [t, e] = ae(null);
|
|
4520
|
-
return /* @__PURE__ */ i.jsxs(
|
|
4521
|
-
/* @__PURE__ */ i.jsx(
|
|
4522
|
-
/* @__PURE__ */ i.jsx(
|
|
4562
|
+
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4563
|
+
/* @__PURE__ */ i.jsx(Mn, { setSelectedTask: e }),
|
|
4564
|
+
/* @__PURE__ */ i.jsx(Ln, { selectedTask: t, setSelectedTask: e })
|
|
4523
4565
|
] });
|
|
4524
4566
|
}
|
|
4525
4567
|
let K = null;
|
|
4526
|
-
function
|
|
4568
|
+
function Rr(t) {
|
|
4527
4569
|
K = t;
|
|
4528
4570
|
}
|
|
4529
|
-
function
|
|
4571
|
+
function Pr(t) {
|
|
4530
4572
|
if (!K)
|
|
4531
4573
|
throw new Error(
|
|
4532
4574
|
"Users not configured. Call users.configureUsers() before using user hooks."
|
|
4533
4575
|
);
|
|
4534
4576
|
return K.useUsers(t);
|
|
4535
4577
|
}
|
|
4536
|
-
function
|
|
4578
|
+
function Tr(t) {
|
|
4537
4579
|
return K?.useUser ? K.useUser(t) : { data: null, isLoading: !1 };
|
|
4538
4580
|
}
|
|
4539
|
-
function
|
|
4581
|
+
function Or() {
|
|
4540
4582
|
if (!K)
|
|
4541
4583
|
throw new Error(
|
|
4542
4584
|
"Users not configured. Call users.configureUsers() before using user hooks."
|
|
4543
4585
|
);
|
|
4544
4586
|
return K.useCreateUser();
|
|
4545
4587
|
}
|
|
4546
|
-
function
|
|
4588
|
+
function Ir() {
|
|
4547
4589
|
if (!K)
|
|
4548
4590
|
throw new Error(
|
|
4549
4591
|
"Users not configured. Call users.configureUsers() before using user hooks."
|
|
4550
4592
|
);
|
|
4551
4593
|
return K.useUpdateUser();
|
|
4552
4594
|
}
|
|
4553
|
-
function
|
|
4595
|
+
function Mr() {
|
|
4554
4596
|
if (!K)
|
|
4555
4597
|
throw new Error(
|
|
4556
4598
|
"Users not configured. Call users.configureUsers() before using user hooks."
|
|
4557
4599
|
);
|
|
4558
4600
|
return K.useResendForgotPassword();
|
|
4559
4601
|
}
|
|
4560
|
-
function
|
|
4602
|
+
function Lr() {
|
|
4561
4603
|
if (!K)
|
|
4562
4604
|
throw new Error(
|
|
4563
4605
|
"Users not configured. Call users.configureUsers() before using user hooks."
|
|
4564
4606
|
);
|
|
4565
4607
|
return K.useResendConfirmationEmail();
|
|
4566
4608
|
}
|
|
4567
|
-
function
|
|
4609
|
+
function Fr() {
|
|
4568
4610
|
if (!K)
|
|
4569
4611
|
throw new Error(
|
|
4570
4612
|
"Users not configured. Call users.configureUsers() before using user hooks."
|
|
4571
4613
|
);
|
|
4572
4614
|
return K.useDisableUserAccount();
|
|
4573
4615
|
}
|
|
4574
|
-
const
|
|
4616
|
+
const $n = Ar({
|
|
4575
4617
|
q: Ce().optional(),
|
|
4576
|
-
disabled:
|
|
4577
|
-
page:
|
|
4578
|
-
per_page:
|
|
4618
|
+
disabled: On(["true", "false"]).optional(),
|
|
4619
|
+
page: rt.number().int().positive().default(1),
|
|
4620
|
+
per_page: rt.number().int().positive().default(20)
|
|
4579
4621
|
});
|
|
4580
|
-
function
|
|
4622
|
+
function Wt(t) {
|
|
4581
4623
|
return !!(t.disabled ?? t.is_disabled ?? t.active === !1);
|
|
4582
4624
|
}
|
|
4583
|
-
function
|
|
4625
|
+
function Ht(t) {
|
|
4584
4626
|
return !!(t.verified ?? t.email_verified_at);
|
|
4585
4627
|
}
|
|
4586
|
-
function
|
|
4628
|
+
function Un({ onCreateUser: t, onSelectUser: e }) {
|
|
4587
4629
|
const r = (n) => {
|
|
4588
|
-
const { data: a, raw: l, isLoading: c } =
|
|
4630
|
+
const { data: a, raw: l, isLoading: c } = Pr(n);
|
|
4589
4631
|
return {
|
|
4590
4632
|
data: a ?? [],
|
|
4591
4633
|
isLoading: c,
|
|
@@ -4611,8 +4653,8 @@ function Mn({ onCreateUser: t, onSelectUser: e }) {
|
|
|
4611
4653
|
render: (n) => /* @__PURE__ */ i.jsx(
|
|
4612
4654
|
"span",
|
|
4613
4655
|
{
|
|
4614
|
-
className: `badge ${
|
|
4615
|
-
children:
|
|
4656
|
+
className: `badge ${Ht(n) ? "badge-success" : "badge-warning"}`,
|
|
4657
|
+
children: Ht(n) ? "Verified" : "Unverified"
|
|
4616
4658
|
}
|
|
4617
4659
|
)
|
|
4618
4660
|
},
|
|
@@ -4622,18 +4664,18 @@ function Mn({ onCreateUser: t, onSelectUser: e }) {
|
|
|
4622
4664
|
render: (n) => /* @__PURE__ */ i.jsx(
|
|
4623
4665
|
"span",
|
|
4624
4666
|
{
|
|
4625
|
-
className: `badge ${
|
|
4626
|
-
children:
|
|
4667
|
+
className: `badge ${Wt(n) ? "badge-error" : "badge-success"}`,
|
|
4668
|
+
children: Wt(n) ? "Disabled" : "Active"
|
|
4627
4669
|
}
|
|
4628
4670
|
)
|
|
4629
4671
|
}
|
|
4630
4672
|
];
|
|
4631
4673
|
return /* @__PURE__ */ i.jsx(
|
|
4632
|
-
|
|
4674
|
+
xt,
|
|
4633
4675
|
{
|
|
4634
4676
|
title: "Users",
|
|
4635
4677
|
actions: /* @__PURE__ */ i.jsx("button", { className: "btn btn-sm btn-primary", onClick: t, children: "Create User" }),
|
|
4636
|
-
paramsSchema:
|
|
4678
|
+
paramsSchema: $n,
|
|
4637
4679
|
useQuery: r,
|
|
4638
4680
|
columns: s,
|
|
4639
4681
|
onRowClick: e,
|
|
@@ -4666,7 +4708,7 @@ function Mn({ onCreateUser: t, onSelectUser: e }) {
|
|
|
4666
4708
|
}
|
|
4667
4709
|
);
|
|
4668
4710
|
}
|
|
4669
|
-
function
|
|
4711
|
+
function st(t, e, r = "An error occurred", s = !0) {
|
|
4670
4712
|
const n = t;
|
|
4671
4713
|
if (n?.errors && Object.entries(n.errors).forEach(([a, l]) => {
|
|
4672
4714
|
e(a, {
|
|
@@ -4678,32 +4720,32 @@ function nt(t, e, r = "An error occurred", s = !0) {
|
|
|
4678
4720
|
se.error(a);
|
|
4679
4721
|
}
|
|
4680
4722
|
}
|
|
4681
|
-
const
|
|
4723
|
+
const Yt = {
|
|
4682
4724
|
email: "",
|
|
4683
4725
|
name: "",
|
|
4684
4726
|
password: "",
|
|
4685
4727
|
is_admin: !1
|
|
4686
4728
|
};
|
|
4687
|
-
function
|
|
4729
|
+
function Dn(t) {
|
|
4688
4730
|
return !t || t.id == null ? null : String(t.id);
|
|
4689
4731
|
}
|
|
4690
|
-
function
|
|
4732
|
+
function zn(t) {
|
|
4691
4733
|
return t ? !!(t.disabled ?? t.is_disabled ?? t.active === !1) : !1;
|
|
4692
4734
|
}
|
|
4693
|
-
function
|
|
4694
|
-
const s =
|
|
4735
|
+
function Zn({ mode: t, selectedUser: e, onClose: r }) {
|
|
4736
|
+
const s = Dn(e), a = Tr(t === "edit" ? s : null).data ?? e, l = Or(), c = Ir(), o = Mr(), u = Lr(), d = Fr(), [f, h] = ae(!1), {
|
|
4695
4737
|
register: m,
|
|
4696
4738
|
handleSubmit: g,
|
|
4697
4739
|
reset: x,
|
|
4698
4740
|
setError: v,
|
|
4699
|
-
formState: { errors: T, isSubmitting:
|
|
4741
|
+
formState: { errors: T, isSubmitting: N }
|
|
4700
4742
|
} = Le({
|
|
4701
|
-
defaultValues:
|
|
4743
|
+
defaultValues: Yt
|
|
4702
4744
|
}), w = t !== null, S = t === "create";
|
|
4703
4745
|
Se(() => {
|
|
4704
4746
|
if (w) {
|
|
4705
4747
|
if (S) {
|
|
4706
|
-
x(
|
|
4748
|
+
x(Yt), h(!1);
|
|
4707
4749
|
return;
|
|
4708
4750
|
}
|
|
4709
4751
|
x({
|
|
@@ -4711,10 +4753,10 @@ function Un({ mode: t, selectedUser: e, onClose: r }) {
|
|
|
4711
4753
|
name: String(a?.name ?? ""),
|
|
4712
4754
|
password: "",
|
|
4713
4755
|
is_admin: !!a?.is_admin
|
|
4714
|
-
}), h(
|
|
4756
|
+
}), h(zn(a));
|
|
4715
4757
|
}
|
|
4716
4758
|
}, [a, S, w, x]);
|
|
4717
|
-
const A =
|
|
4759
|
+
const A = Xt(
|
|
4718
4760
|
() => l.isPending || c.isPending || o.isPending || u.isPending || d.isPending,
|
|
4719
4761
|
[
|
|
4720
4762
|
l.isPending,
|
|
@@ -4723,7 +4765,7 @@ function Un({ mode: t, selectedUser: e, onClose: r }) {
|
|
|
4723
4765
|
o.isPending,
|
|
4724
4766
|
c.isPending
|
|
4725
4767
|
]
|
|
4726
|
-
) ||
|
|
4768
|
+
) || N;
|
|
4727
4769
|
if (!w || !S && !s) return null;
|
|
4728
4770
|
const V = async (M) => {
|
|
4729
4771
|
try {
|
|
@@ -4741,7 +4783,7 @@ function Un({ mode: t, selectedUser: e, onClose: r }) {
|
|
|
4741
4783
|
}
|
|
4742
4784
|
}), se.success("User updated")), r();
|
|
4743
4785
|
} catch (L) {
|
|
4744
|
-
console.error("Failed to save user", L),
|
|
4786
|
+
console.error("Failed to save user", L), st(L, v, "Failed to save user");
|
|
4745
4787
|
}
|
|
4746
4788
|
}, W = async () => {
|
|
4747
4789
|
if (s)
|
|
@@ -4879,7 +4921,7 @@ function Un({ mode: t, selectedUser: e, onClose: r }) {
|
|
|
4879
4921
|
] })
|
|
4880
4922
|
] }) });
|
|
4881
4923
|
}
|
|
4882
|
-
function
|
|
4924
|
+
function qn() {
|
|
4883
4925
|
const [t, e] = ae(null), [r, s] = ae(null), n = () => {
|
|
4884
4926
|
e(null), s("create");
|
|
4885
4927
|
}, a = (c) => {
|
|
@@ -4887,13 +4929,13 @@ function $n() {
|
|
|
4887
4929
|
}, l = () => {
|
|
4888
4930
|
e(null), s(null);
|
|
4889
4931
|
};
|
|
4890
|
-
return /* @__PURE__ */ i.jsxs(
|
|
4891
|
-
/* @__PURE__ */ i.jsx(
|
|
4892
|
-
/* @__PURE__ */ i.jsx(
|
|
4932
|
+
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4933
|
+
/* @__PURE__ */ i.jsx(Un, { onCreateUser: n, onSelectUser: a }),
|
|
4934
|
+
/* @__PURE__ */ i.jsx(Zn, { mode: r, selectedUser: t, onClose: l })
|
|
4893
4935
|
] });
|
|
4894
4936
|
}
|
|
4895
|
-
const
|
|
4896
|
-
function
|
|
4937
|
+
const wt = Jr(null);
|
|
4938
|
+
function Vn({
|
|
4897
4939
|
client: t,
|
|
4898
4940
|
config: e = {},
|
|
4899
4941
|
children: r
|
|
@@ -4903,39 +4945,42 @@ function Dn({
|
|
|
4903
4945
|
registrationEnabled: !0,
|
|
4904
4946
|
OAuthButton: void 0
|
|
4905
4947
|
}, ...e };
|
|
4906
|
-
return /* @__PURE__ */ i.jsx(
|
|
4948
|
+
return /* @__PURE__ */ i.jsx(wt.Provider, { value: { client: t, config: n }, children: r });
|
|
4907
4949
|
}
|
|
4908
4950
|
function le() {
|
|
4909
|
-
const t =
|
|
4951
|
+
const t = er(wt);
|
|
4910
4952
|
if (!t)
|
|
4911
4953
|
throw new Error(
|
|
4912
4954
|
"useAuthApi must be used within AuthProvider. Wrap your app with <AuthProvider client={yourApiClient}>"
|
|
4913
4955
|
);
|
|
4914
4956
|
return t.client;
|
|
4915
4957
|
}
|
|
4916
|
-
function
|
|
4917
|
-
const t =
|
|
4958
|
+
function $r() {
|
|
4959
|
+
const t = er(wt);
|
|
4918
4960
|
if (!t)
|
|
4919
4961
|
throw new Error(
|
|
4920
4962
|
"useAuthConfig must be used within AuthProvider. Wrap your app with <AuthProvider client={yourApiClient}>"
|
|
4921
4963
|
);
|
|
4922
4964
|
return t.config;
|
|
4923
4965
|
}
|
|
4924
|
-
function
|
|
4966
|
+
function Bn() {
|
|
4925
4967
|
const t = le(), { user: e, isLoading: r } = t.useCurrentUser(), s = Be();
|
|
4926
|
-
return r ? /* @__PURE__ */ i.jsx("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ i.jsx("span", { className: "loading loading-spinner loading-lg" }) }) : e ? e.is_admin ? /* @__PURE__ */ i.jsx(
|
|
4968
|
+
return r ? /* @__PURE__ */ i.jsx("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ i.jsx("span", { className: "loading loading-spinner loading-lg" }) }) : e ? e.is_admin ? /* @__PURE__ */ i.jsx(tr, {}) : /* @__PURE__ */ i.jsx(lt, { to: "/", replace: !0 }) : /* @__PURE__ */ i.jsx(lt, { to: "/login", state: { from: s } });
|
|
4927
4969
|
}
|
|
4928
|
-
const
|
|
4970
|
+
const Ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4929
4971
|
__proto__: null,
|
|
4930
|
-
Dashboard:
|
|
4931
|
-
FeatureFlags:
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4972
|
+
Dashboard: gs,
|
|
4973
|
+
FeatureFlags: vs,
|
|
4974
|
+
KaleidoMetricsSection: ms,
|
|
4975
|
+
Layout: sr,
|
|
4976
|
+
LayoutRoute: ps,
|
|
4977
|
+
Route: Bn,
|
|
4978
|
+
StatItem: rr,
|
|
4979
|
+
Tasks: Fn,
|
|
4980
|
+
Users: qn,
|
|
4981
|
+
configureAdminLayout: ls
|
|
4937
4982
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4938
|
-
function
|
|
4983
|
+
function jt() {
|
|
4939
4984
|
const t = le(), e = t.useLoginUser(), r = t.useRegisterUser(), s = t.useLogout(), n = t.useCurrentUser();
|
|
4940
4985
|
return {
|
|
4941
4986
|
user: n.user ?? null,
|
|
@@ -4952,24 +4997,24 @@ function kt() {
|
|
|
4952
4997
|
}
|
|
4953
4998
|
};
|
|
4954
4999
|
}
|
|
4955
|
-
function
|
|
5000
|
+
function Ur(t, e, r = "/") {
|
|
4956
5001
|
const s = new URLSearchParams(e.search), n = s.get("origin") || s.get("redirect");
|
|
4957
5002
|
t(n || r, { replace: !0 });
|
|
4958
5003
|
}
|
|
4959
5004
|
function ye({ children: t }) {
|
|
4960
5005
|
return /* @__PURE__ */ i.jsx("div", { className: "min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/10 to-secondary/10", children: /* @__PURE__ */ i.jsx("div", { className: "card bg-base-100 shadow-soft hover:shadow-medium transition-shadow border border-base-300 w-full max-w-md mx-4", children: /* @__PURE__ */ i.jsx("div", { className: "card-body p-8", children: t }) }) });
|
|
4961
5006
|
}
|
|
4962
|
-
function
|
|
5007
|
+
function Qn({
|
|
4963
5008
|
children: t
|
|
4964
5009
|
}) {
|
|
4965
|
-
const { user: e, isLoading: r } =
|
|
4966
|
-
return r ? /* @__PURE__ */ i.jsx("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ i.jsx("span", { className: "loading loading-spinner loading-lg" }) }) : e ? /* @__PURE__ */ i.jsx(i.Fragment, { children: t }) : /* @__PURE__ */ i.jsx(
|
|
5010
|
+
const { user: e, isLoading: r } = jt(), s = Be();
|
|
5011
|
+
return r ? /* @__PURE__ */ i.jsx("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ i.jsx("span", { className: "loading loading-spinner loading-lg" }) }) : e ? /* @__PURE__ */ i.jsx(i.Fragment, { children: t }) : /* @__PURE__ */ i.jsx(lt, { to: "/login", state: { from: s } });
|
|
4967
5012
|
}
|
|
4968
|
-
function
|
|
5013
|
+
function Wn() {
|
|
4969
5014
|
const e = Be().state.email;
|
|
4970
5015
|
return /* @__PURE__ */ i.jsxs(ye, { children: [
|
|
4971
5016
|
/* @__PURE__ */ i.jsxs("h2", { className: "card-title text-2xl mb-4", children: [
|
|
4972
|
-
/* @__PURE__ */ i.jsx(
|
|
5017
|
+
/* @__PURE__ */ i.jsx(Me, { icon: Xr }),
|
|
4973
5018
|
"Check Your Email"
|
|
4974
5019
|
] }),
|
|
4975
5020
|
/* @__PURE__ */ i.jsxs("div", { className: "mt-4 text-sm text-center", children: [
|
|
@@ -4996,7 +5041,7 @@ function qn() {
|
|
|
4996
5041
|
] })
|
|
4997
5042
|
] });
|
|
4998
5043
|
}
|
|
4999
|
-
function
|
|
5044
|
+
function Hn() {
|
|
5000
5045
|
const { register: t, handleSubmit: e } = Le({
|
|
5001
5046
|
defaultValues: { email: "" }
|
|
5002
5047
|
}), { useForgotPassword: r } = le(), s = r(), n = async (a) => {
|
|
@@ -5020,7 +5065,7 @@ function Vn() {
|
|
|
5020
5065
|
] })
|
|
5021
5066
|
] });
|
|
5022
5067
|
}
|
|
5023
|
-
function
|
|
5068
|
+
function Yn() {
|
|
5024
5069
|
const {
|
|
5025
5070
|
register: t,
|
|
5026
5071
|
handleSubmit: e,
|
|
@@ -5028,9 +5073,9 @@ function Bn() {
|
|
|
5028
5073
|
formState: { errors: s, isSubmitting: n }
|
|
5029
5074
|
} = Le({
|
|
5030
5075
|
defaultValues: { email: "", password: "" }
|
|
5031
|
-
}), a =
|
|
5076
|
+
}), a = Ie(), l = Be(), { useLoginUser: c, useCurrentUser: o } = le(), { oauthEnabled: u, registrationEnabled: d, OAuthButton: f } = $r(), h = c(), { user: m } = o();
|
|
5032
5077
|
Se(() => {
|
|
5033
|
-
m &&
|
|
5078
|
+
m && Ur(a, l);
|
|
5034
5079
|
}, [m, a, l]);
|
|
5035
5080
|
const g = async (x) => {
|
|
5036
5081
|
try {
|
|
@@ -5043,20 +5088,20 @@ function Bn() {
|
|
|
5043
5088
|
message: "Invalid email or password"
|
|
5044
5089
|
});
|
|
5045
5090
|
else if (T == 422) {
|
|
5046
|
-
const
|
|
5091
|
+
const N = v?.response?.data, w = N && (N.error || N.message) || "Too many login attempts. Please try again later.";
|
|
5047
5092
|
r("root", { type: "server", message: w });
|
|
5048
5093
|
} else {
|
|
5049
|
-
const
|
|
5050
|
-
|
|
5094
|
+
const N = v?.response?.data ?? v;
|
|
5095
|
+
st(N, r, "Failed to sign in");
|
|
5051
5096
|
}
|
|
5052
5097
|
}
|
|
5053
5098
|
};
|
|
5054
5099
|
return /* @__PURE__ */ i.jsxs(ye, { children: [
|
|
5055
5100
|
/* @__PURE__ */ i.jsxs("div", { className: "text-center mb-6", children: [
|
|
5056
5101
|
/* @__PURE__ */ i.jsx("div", { className: "inline-flex items-center justify-center w-16 h-16 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ i.jsx(
|
|
5057
|
-
|
|
5102
|
+
Me,
|
|
5058
5103
|
{
|
|
5059
|
-
icon:
|
|
5104
|
+
icon: es,
|
|
5060
5105
|
className: "text-3xl text-primary"
|
|
5061
5106
|
}
|
|
5062
5107
|
) }),
|
|
@@ -5118,16 +5163,16 @@ function Bn() {
|
|
|
5118
5163
|
] })
|
|
5119
5164
|
] });
|
|
5120
5165
|
}
|
|
5121
|
-
function
|
|
5122
|
-
const t =
|
|
5166
|
+
function Gn() {
|
|
5167
|
+
const t = Ie(), { useTokenRefresh: e } = le(), r = e?.();
|
|
5123
5168
|
return Se(() => {
|
|
5124
5169
|
r?.mutateAsync?.().finally(() => t("/"));
|
|
5125
5170
|
}, [t, r]), /* @__PURE__ */ i.jsx("div", { children: "Processing OAuth callback..." });
|
|
5126
5171
|
}
|
|
5127
|
-
function
|
|
5172
|
+
function Kn() {
|
|
5128
5173
|
const e = Be().state?.email, { register: r, handleSubmit: s } = Le({
|
|
5129
5174
|
defaultValues: { email: e ?? "" }
|
|
5130
|
-
}), { useResendConfirmationEmail: n } = le(), a = n(), l =
|
|
5175
|
+
}), { useResendConfirmationEmail: n } = le(), a = n(), l = Ie(), c = async (o) => {
|
|
5131
5176
|
try {
|
|
5132
5177
|
await a.mutateAsync(o), l("/confirm-email", { state: { email: o.email } });
|
|
5133
5178
|
} catch {
|
|
@@ -5149,8 +5194,8 @@ function Wn() {
|
|
|
5149
5194
|
] })
|
|
5150
5195
|
] });
|
|
5151
5196
|
}
|
|
5152
|
-
function
|
|
5153
|
-
const { register: t, handleSubmit: e } = Le({ defaultValues: { token: "", password: "" } }), { useResetPassword: r } = le(), s = r(), n =
|
|
5197
|
+
function Jn() {
|
|
5198
|
+
const { register: t, handleSubmit: e } = Le({ defaultValues: { token: "", password: "" } }), { useResetPassword: r } = le(), s = r(), n = Ie(), [a] = vt(), l = a.get("token") || void 0, c = async (o) => {
|
|
5154
5199
|
try {
|
|
5155
5200
|
await s.mutateAsync(o), n("/");
|
|
5156
5201
|
} catch {
|
|
@@ -5179,12 +5224,12 @@ function Hn() {
|
|
|
5179
5224
|
] })
|
|
5180
5225
|
] });
|
|
5181
5226
|
}
|
|
5182
|
-
var
|
|
5227
|
+
var Xn = {
|
|
5183
5228
|
prefix: "fab",
|
|
5184
5229
|
iconName: "google",
|
|
5185
5230
|
icon: [512, 512, [], "f1a0", "M500 261.8C500 403.3 403.1 504 260 504 122.8 504 12 393.2 12 256S122.8 8 260 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9c-88.3-85.2-252.5-21.2-252.5 118.2 0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9l-140.8 0 0-85.3 236.1 0c2.3 12.7 3.9 24.9 3.9 41.4z"]
|
|
5186
5231
|
};
|
|
5187
|
-
function
|
|
5232
|
+
function ea({
|
|
5188
5233
|
redirectUrl: t = "",
|
|
5189
5234
|
text: e = "Continue with Google",
|
|
5190
5235
|
className: r = "",
|
|
@@ -5201,13 +5246,13 @@ function Gn({
|
|
|
5201
5246
|
type: "button",
|
|
5202
5247
|
disabled: s,
|
|
5203
5248
|
children: [
|
|
5204
|
-
/* @__PURE__ */ i.jsx(
|
|
5249
|
+
/* @__PURE__ */ i.jsx(Me, { icon: Xn, className: "text-lg" }),
|
|
5205
5250
|
e
|
|
5206
5251
|
]
|
|
5207
5252
|
}
|
|
5208
5253
|
);
|
|
5209
5254
|
}
|
|
5210
|
-
function
|
|
5255
|
+
function ta({ redirectUrl: t = "" }) {
|
|
5211
5256
|
const {
|
|
5212
5257
|
register: e,
|
|
5213
5258
|
handleSubmit: r,
|
|
@@ -5216,7 +5261,7 @@ function Kn({ redirectUrl: t = "" }) {
|
|
|
5216
5261
|
formState: { errors: a, isSubmitting: l }
|
|
5217
5262
|
} = Le({
|
|
5218
5263
|
defaultValues: { name: "", email: "", password: "", confirmPassword: "" }
|
|
5219
|
-
}), c =
|
|
5264
|
+
}), c = Ie(), o = ct(nr), u = ct(ar), { useRegisterUser: d } = le(), f = d(), [h, m] = ae(null), g = async (x) => {
|
|
5220
5265
|
if (m(null), !o) {
|
|
5221
5266
|
m("Registrations are temporarily disabled");
|
|
5222
5267
|
return;
|
|
@@ -5231,12 +5276,12 @@ function Kn({ redirectUrl: t = "" }) {
|
|
|
5231
5276
|
try {
|
|
5232
5277
|
await f.mutateAsync(x, s), c("/confirm-email", { state: { email: x.email } });
|
|
5233
5278
|
} catch (v) {
|
|
5234
|
-
|
|
5279
|
+
st(v, s, "Failed to register account", !1);
|
|
5235
5280
|
}
|
|
5236
5281
|
};
|
|
5237
5282
|
return /* @__PURE__ */ i.jsxs(ye, { children: [
|
|
5238
5283
|
/* @__PURE__ */ i.jsxs("h2", { className: "card-title text-2xl mb-4", children: [
|
|
5239
|
-
/* @__PURE__ */ i.jsx(
|
|
5284
|
+
/* @__PURE__ */ i.jsx(Me, { icon: ts, className: "text-primary mr-2" }),
|
|
5240
5285
|
"Sign Up"
|
|
5241
5286
|
] }),
|
|
5242
5287
|
h && /* @__PURE__ */ i.jsx("div", { role: "alert", className: "alert alert-warning alert-soft mb-4", children: /* @__PURE__ */ i.jsx("span", { children: h }) }),
|
|
@@ -5324,7 +5369,7 @@ function Kn({ redirectUrl: t = "" }) {
|
|
|
5324
5369
|
u && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
5325
5370
|
/* @__PURE__ */ i.jsx("div", { className: "divider", children: "OR" }),
|
|
5326
5371
|
/* @__PURE__ */ i.jsx(
|
|
5327
|
-
|
|
5372
|
+
ea,
|
|
5328
5373
|
{
|
|
5329
5374
|
redirectUrl: t,
|
|
5330
5375
|
text: "Sign up with Google"
|
|
@@ -5340,8 +5385,8 @@ function Kn({ redirectUrl: t = "" }) {
|
|
|
5340
5385
|
] })
|
|
5341
5386
|
] });
|
|
5342
5387
|
}
|
|
5343
|
-
function
|
|
5344
|
-
const t =
|
|
5388
|
+
function ra() {
|
|
5389
|
+
const t = Ie(), [e] = vt(), [r, s] = ae(!1), [n, a] = ae(null), [l, c] = ae(!1), { useVerifyEmail: o } = le(), u = o(), d = e.get("token"), f = async () => {
|
|
5345
5390
|
if (!d) {
|
|
5346
5391
|
a("No token provided.");
|
|
5347
5392
|
return;
|
|
@@ -5385,26 +5430,26 @@ function Jn() {
|
|
|
5385
5430
|
] })
|
|
5386
5431
|
] });
|
|
5387
5432
|
}
|
|
5388
|
-
const
|
|
5433
|
+
const Oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5389
5434
|
__proto__: null,
|
|
5390
5435
|
AuthLayout: ye,
|
|
5391
|
-
AuthProvider:
|
|
5392
|
-
ConfirmEmail:
|
|
5393
|
-
ForgotPassword:
|
|
5394
|
-
Login:
|
|
5395
|
-
OAuthCallback:
|
|
5396
|
-
ProtectedRoute:
|
|
5397
|
-
ResendConfirmation:
|
|
5398
|
-
Reset:
|
|
5399
|
-
SignUp:
|
|
5400
|
-
Verify:
|
|
5401
|
-
handleFormError:
|
|
5402
|
-
redirectToOrigin:
|
|
5403
|
-
useAuth:
|
|
5436
|
+
AuthProvider: Vn,
|
|
5437
|
+
ConfirmEmail: Wn,
|
|
5438
|
+
ForgotPassword: Hn,
|
|
5439
|
+
Login: Yn,
|
|
5440
|
+
OAuthCallback: Gn,
|
|
5441
|
+
ProtectedRoute: Qn,
|
|
5442
|
+
ResendConfirmation: Kn,
|
|
5443
|
+
Reset: Jn,
|
|
5444
|
+
SignUp: ta,
|
|
5445
|
+
Verify: ra,
|
|
5446
|
+
handleFormError: st,
|
|
5447
|
+
redirectToOrigin: Ur,
|
|
5448
|
+
useAuth: jt,
|
|
5404
5449
|
useAuthApi: le,
|
|
5405
|
-
useAuthConfig:
|
|
5450
|
+
useAuthConfig: $r
|
|
5406
5451
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5407
|
-
function
|
|
5452
|
+
function Ia({
|
|
5408
5453
|
label: t,
|
|
5409
5454
|
field: e,
|
|
5410
5455
|
params: r,
|
|
@@ -5412,7 +5457,7 @@ function Ra({
|
|
|
5412
5457
|
setFilters: n,
|
|
5413
5458
|
className: a = ""
|
|
5414
5459
|
}) {
|
|
5415
|
-
const l = r.sort_by, c = r.sort_order, o = l === e, u = o ? c === "asc" ?
|
|
5460
|
+
const l = r.sort_by, c = r.sort_order, o = l === e, u = o ? c === "asc" ? ss : ns : rs, d = () => {
|
|
5416
5461
|
let f = "asc";
|
|
5417
5462
|
o && c === "asc" && (f = "desc"), n ? n({
|
|
5418
5463
|
sort_by: e,
|
|
@@ -5427,7 +5472,7 @@ function Ra({
|
|
|
5427
5472
|
children: [
|
|
5428
5473
|
t,
|
|
5429
5474
|
/* @__PURE__ */ i.jsx(
|
|
5430
|
-
|
|
5475
|
+
Me,
|
|
5431
5476
|
{
|
|
5432
5477
|
icon: u,
|
|
5433
5478
|
className: o ? "text-primary" : "text-base-content/30"
|
|
@@ -5437,35 +5482,35 @@ function Ra({
|
|
|
5437
5482
|
}
|
|
5438
5483
|
);
|
|
5439
5484
|
}
|
|
5440
|
-
const
|
|
5485
|
+
const sa = {
|
|
5441
5486
|
tasks: (t) => {
|
|
5442
5487
|
if (!t.tasks)
|
|
5443
5488
|
throw new Error(
|
|
5444
5489
|
"Feature 'tasks' is enabled but adapters.tasks is missing."
|
|
5445
5490
|
);
|
|
5446
|
-
|
|
5491
|
+
jr(t.tasks);
|
|
5447
5492
|
},
|
|
5448
5493
|
"feature-flags": (t) => {
|
|
5449
5494
|
if (!t.featureFlags)
|
|
5450
5495
|
throw new Error(
|
|
5451
5496
|
"Feature 'feature-flags' is enabled but adapters.featureFlags is missing."
|
|
5452
5497
|
);
|
|
5453
|
-
|
|
5498
|
+
ir(t.featureFlags);
|
|
5454
5499
|
},
|
|
5455
5500
|
"admin-users": (t) => {
|
|
5456
5501
|
if (!t.users)
|
|
5457
5502
|
throw new Error(
|
|
5458
5503
|
"Feature 'admin-users' is enabled but adapters.users is missing."
|
|
5459
5504
|
);
|
|
5460
|
-
|
|
5505
|
+
Rr(t.users);
|
|
5461
5506
|
}
|
|
5462
5507
|
};
|
|
5463
|
-
function
|
|
5508
|
+
function na(t) {
|
|
5464
5509
|
const e = Array.from(new Set(t.features));
|
|
5465
5510
|
for (const r of e)
|
|
5466
|
-
|
|
5511
|
+
sa[r](t.adapters);
|
|
5467
5512
|
}
|
|
5468
|
-
function
|
|
5513
|
+
function aa(t) {
|
|
5469
5514
|
const e = {
|
|
5470
5515
|
listPath: t.featureFlags?.listPath ?? "/feature-flags",
|
|
5471
5516
|
adminListPath: t.featureFlags?.adminListPath ?? "/admin/feature-flags",
|
|
@@ -5510,7 +5555,7 @@ function ta(t) {
|
|
|
5510
5555
|
}
|
|
5511
5556
|
};
|
|
5512
5557
|
}
|
|
5513
|
-
function
|
|
5558
|
+
function ia(t) {
|
|
5514
5559
|
const e = {
|
|
5515
5560
|
listPath: t.tasks?.listPath ?? "/admin/tasks",
|
|
5516
5561
|
detailPath: t.tasks?.detailPath ?? "/admin/tasks/{id}"
|
|
@@ -5556,7 +5601,7 @@ function ra(t) {
|
|
|
5556
5601
|
}
|
|
5557
5602
|
};
|
|
5558
5603
|
}
|
|
5559
|
-
function
|
|
5604
|
+
function oa(t) {
|
|
5560
5605
|
const e = {
|
|
5561
5606
|
listPath: t.users?.listPath ?? "/admin/users",
|
|
5562
5607
|
detailPath: t.users?.detailPath ?? "/admin/users/{id}",
|
|
@@ -5677,14 +5722,14 @@ function sa(t) {
|
|
|
5677
5722
|
}
|
|
5678
5723
|
};
|
|
5679
5724
|
}
|
|
5680
|
-
function
|
|
5725
|
+
function Dr(t) {
|
|
5681
5726
|
const e = {
|
|
5682
|
-
featureFlags:
|
|
5683
|
-
tasks:
|
|
5727
|
+
featureFlags: aa(t),
|
|
5728
|
+
tasks: ia(t)
|
|
5684
5729
|
};
|
|
5685
|
-
return t.users && (e.users =
|
|
5730
|
+
return t.users && (e.users = oa(t)), e;
|
|
5686
5731
|
}
|
|
5687
|
-
function
|
|
5732
|
+
function Ne(t, e, r) {
|
|
5688
5733
|
if (!e) return;
|
|
5689
5734
|
const s = t?.response?.data;
|
|
5690
5735
|
if (s?.errors && typeof s.errors == "object") {
|
|
@@ -5699,7 +5744,7 @@ function ke(t, e, r) {
|
|
|
5699
5744
|
message: s?.message || r
|
|
5700
5745
|
});
|
|
5701
5746
|
}
|
|
5702
|
-
function
|
|
5747
|
+
function zr(t) {
|
|
5703
5748
|
const e = {
|
|
5704
5749
|
currentPath: t.paths?.currentPath ?? "/auth/current",
|
|
5705
5750
|
loginPath: t.paths?.loginPath ?? "/auth/login",
|
|
@@ -5730,7 +5775,7 @@ function $r(t) {
|
|
|
5730
5775
|
n.refetchQueries({ queryKey: s })
|
|
5731
5776
|
]);
|
|
5732
5777
|
} catch (o) {
|
|
5733
|
-
throw
|
|
5778
|
+
throw Ne(o, c, "Login failed"), o;
|
|
5734
5779
|
}
|
|
5735
5780
|
},
|
|
5736
5781
|
isPending: a.isPending
|
|
@@ -5746,7 +5791,7 @@ function $r(t) {
|
|
|
5746
5791
|
try {
|
|
5747
5792
|
await n.mutateAsync({ body: a });
|
|
5748
5793
|
} catch (c) {
|
|
5749
|
-
throw
|
|
5794
|
+
throw Ne(c, l, "Registration failed"), c;
|
|
5750
5795
|
}
|
|
5751
5796
|
},
|
|
5752
5797
|
isPending: n.isPending
|
|
@@ -5762,7 +5807,7 @@ function $r(t) {
|
|
|
5762
5807
|
try {
|
|
5763
5808
|
await n.mutateAsync({ body: { email: a } });
|
|
5764
5809
|
} catch (c) {
|
|
5765
|
-
throw
|
|
5810
|
+
throw Ne(c, l, "Failed to send reset email"), c;
|
|
5766
5811
|
}
|
|
5767
5812
|
},
|
|
5768
5813
|
isPending: n.isPending
|
|
@@ -5778,7 +5823,7 @@ function $r(t) {
|
|
|
5778
5823
|
try {
|
|
5779
5824
|
await n.mutateAsync({ body: a });
|
|
5780
5825
|
} catch (c) {
|
|
5781
|
-
throw
|
|
5826
|
+
throw Ne(c, l, "Reset failed"), c;
|
|
5782
5827
|
}
|
|
5783
5828
|
},
|
|
5784
5829
|
isPending: n.isPending
|
|
@@ -5794,7 +5839,7 @@ function $r(t) {
|
|
|
5794
5839
|
try {
|
|
5795
5840
|
await n.mutateAsync({ params: { path: { token: a } } });
|
|
5796
5841
|
} catch (c) {
|
|
5797
|
-
throw
|
|
5842
|
+
throw Ne(c, l, "Verification failed"), c;
|
|
5798
5843
|
}
|
|
5799
5844
|
},
|
|
5800
5845
|
isPending: n.isPending
|
|
@@ -5810,7 +5855,7 @@ function $r(t) {
|
|
|
5810
5855
|
try {
|
|
5811
5856
|
await n.mutateAsync({ body: a });
|
|
5812
5857
|
} catch (c) {
|
|
5813
|
-
throw
|
|
5858
|
+
throw Ne(c, l, "Resend failed"), c;
|
|
5814
5859
|
}
|
|
5815
5860
|
},
|
|
5816
5861
|
isPending: n.isPending
|
|
@@ -5856,12 +5901,12 @@ function $r(t) {
|
|
|
5856
5901
|
}
|
|
5857
5902
|
};
|
|
5858
5903
|
}
|
|
5859
|
-
const
|
|
5904
|
+
const Ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5860
5905
|
__proto__: null,
|
|
5861
|
-
createKaleidoOpenApiAdapters:
|
|
5862
|
-
createKaleidoOpenApiAuthClient:
|
|
5906
|
+
createKaleidoOpenApiAdapters: Dr,
|
|
5907
|
+
createKaleidoOpenApiAuthClient: zr
|
|
5863
5908
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5864
|
-
function
|
|
5909
|
+
function la(t) {
|
|
5865
5910
|
return t ? {
|
|
5866
5911
|
id: t.id ?? t.pid,
|
|
5867
5912
|
email: t.email,
|
|
@@ -5870,24 +5915,24 @@ function na(t) {
|
|
|
5870
5915
|
is_admin: t.is_admin
|
|
5871
5916
|
} : null;
|
|
5872
5917
|
}
|
|
5873
|
-
class
|
|
5918
|
+
class ca {
|
|
5874
5919
|
authClient = null;
|
|
5875
5920
|
configure(e) {
|
|
5876
5921
|
const r = [];
|
|
5877
5922
|
e.tasks && r.push("tasks"), e.featureFlags && r.push("feature-flags"), e.adminUsers && r.push("admin-users");
|
|
5878
|
-
const s =
|
|
5923
|
+
const s = Dr({
|
|
5879
5924
|
api: e.api,
|
|
5880
5925
|
useQueryClient: e.useQueryClient,
|
|
5881
5926
|
toast: e.toast,
|
|
5882
5927
|
users: e.adminUsers ? {} : void 0
|
|
5883
5928
|
});
|
|
5884
|
-
r.length > 0 &&
|
|
5929
|
+
r.length > 0 && na({
|
|
5885
5930
|
features: r,
|
|
5886
5931
|
adapters: s
|
|
5887
|
-
}), this.authClient = e.auth ?
|
|
5932
|
+
}), this.authClient = e.auth ? zr({
|
|
5888
5933
|
api: e.api,
|
|
5889
5934
|
useQueryClient: e.useQueryClient,
|
|
5890
|
-
mapCurrentUser: e.mapCurrentUser ??
|
|
5935
|
+
mapCurrentUser: e.mapCurrentUser ?? la
|
|
5891
5936
|
}) : null;
|
|
5892
5937
|
}
|
|
5893
5938
|
createAuthApiClient() {
|
|
@@ -5898,14 +5943,14 @@ class aa {
|
|
|
5898
5943
|
return this.authClient;
|
|
5899
5944
|
}
|
|
5900
5945
|
useAuth() {
|
|
5901
|
-
return
|
|
5946
|
+
return jt();
|
|
5902
5947
|
}
|
|
5903
5948
|
}
|
|
5904
|
-
const
|
|
5905
|
-
function
|
|
5949
|
+
const La = new ca(), ua = /\{[^{}]+\}/g, da = () => typeof process == "object" && Number.parseInt(process?.versions?.node?.substring(0, 2)) >= 18 && process.versions.undici;
|
|
5950
|
+
function fa() {
|
|
5906
5951
|
return Math.random().toString(36).slice(2, 11);
|
|
5907
5952
|
}
|
|
5908
|
-
function
|
|
5953
|
+
function ha(t) {
|
|
5909
5954
|
let {
|
|
5910
5955
|
baseUrl: e = "",
|
|
5911
5956
|
Request: r = globalThis.Request,
|
|
@@ -5917,7 +5962,7 @@ function ca(t) {
|
|
|
5917
5962
|
requestInitExt: o = void 0,
|
|
5918
5963
|
...u
|
|
5919
5964
|
} = { ...t };
|
|
5920
|
-
o =
|
|
5965
|
+
o = da() ? o : void 0, e = Jt(e);
|
|
5921
5966
|
const d = [];
|
|
5922
5967
|
async function f(h, m) {
|
|
5923
5968
|
const {
|
|
@@ -5925,31 +5970,31 @@ function ca(t) {
|
|
|
5925
5970
|
fetch: x = s,
|
|
5926
5971
|
Request: v = r,
|
|
5927
5972
|
headers: T,
|
|
5928
|
-
params:
|
|
5973
|
+
params: N = {},
|
|
5929
5974
|
parseAs: w = "json",
|
|
5930
5975
|
querySerializer: S,
|
|
5931
|
-
bodySerializer:
|
|
5976
|
+
bodySerializer: U = a ?? pa,
|
|
5932
5977
|
pathSerializer: A,
|
|
5933
5978
|
body: V,
|
|
5934
5979
|
middleware: W = [],
|
|
5935
5980
|
...Y
|
|
5936
5981
|
} = m || {};
|
|
5937
5982
|
let X = e;
|
|
5938
|
-
g && (X =
|
|
5939
|
-
let M = typeof n == "function" ? n :
|
|
5940
|
-
S && (M = typeof S == "function" ? S :
|
|
5983
|
+
g && (X = Jt(g) ?? e);
|
|
5984
|
+
let M = typeof n == "function" ? n : Gt(n);
|
|
5985
|
+
S && (M = typeof S == "function" ? S : Gt({
|
|
5941
5986
|
...typeof n == "object" ? n : {},
|
|
5942
5987
|
...S
|
|
5943
5988
|
}));
|
|
5944
|
-
const L = A || l ||
|
|
5989
|
+
const L = A || l || ma, H = V === void 0 ? void 0 : U(
|
|
5945
5990
|
V,
|
|
5946
5991
|
// Note: we declare mergeHeaders() both here and below because it’s a bit of a chicken-or-egg situation:
|
|
5947
5992
|
// bodySerializer() needs all headers so we aren’t dropping ones set by the user, however,
|
|
5948
5993
|
// the result of this ALSO sets the lowest-priority content-type header. So we re-merge below,
|
|
5949
5994
|
// setting the content-type at the very beginning to be overwritten.
|
|
5950
5995
|
// Lastly, based on the way headers work, it’s not a simple “present-or-not” check becauase null intentionally un-sets headers.
|
|
5951
|
-
|
|
5952
|
-
), G =
|
|
5996
|
+
Kt(c, T, N.header)
|
|
5997
|
+
), G = Kt(
|
|
5953
5998
|
// with no body, we should not to set Content-Type
|
|
5954
5999
|
H === void 0 || // if serialized body is FormData; browser will correctly set Content-Type & boundary expression
|
|
5955
6000
|
H instanceof FormData ? {} : {
|
|
@@ -5957,7 +6002,7 @@ function ca(t) {
|
|
|
5957
6002
|
},
|
|
5958
6003
|
c,
|
|
5959
6004
|
T,
|
|
5960
|
-
|
|
6005
|
+
N.header
|
|
5961
6006
|
), D = [...d, ...W], ve = {
|
|
5962
6007
|
redirect: "follow",
|
|
5963
6008
|
...u,
|
|
@@ -5966,18 +6011,18 @@ function ca(t) {
|
|
|
5966
6011
|
headers: G
|
|
5967
6012
|
};
|
|
5968
6013
|
let ee, ie, J = new v(
|
|
5969
|
-
|
|
6014
|
+
ga(h, { baseUrl: X, params: N, querySerializer: M, pathSerializer: L }),
|
|
5970
6015
|
ve
|
|
5971
6016
|
), z;
|
|
5972
6017
|
for (const P in Y)
|
|
5973
6018
|
P in J || (J[P] = Y[P]);
|
|
5974
6019
|
if (D.length) {
|
|
5975
|
-
ee =
|
|
6020
|
+
ee = fa(), ie = Object.freeze({
|
|
5976
6021
|
baseUrl: X,
|
|
5977
6022
|
fetch: x,
|
|
5978
6023
|
parseAs: w,
|
|
5979
6024
|
querySerializer: M,
|
|
5980
|
-
bodySerializer:
|
|
6025
|
+
bodySerializer: U,
|
|
5981
6026
|
pathSerializer: L
|
|
5982
6027
|
});
|
|
5983
6028
|
for (const P of D)
|
|
@@ -5985,7 +6030,7 @@ function ca(t) {
|
|
|
5985
6030
|
const R = await P.onRequest({
|
|
5986
6031
|
request: J,
|
|
5987
6032
|
schemaPath: h,
|
|
5988
|
-
params:
|
|
6033
|
+
params: N,
|
|
5989
6034
|
options: ie,
|
|
5990
6035
|
id: ee
|
|
5991
6036
|
});
|
|
@@ -6012,7 +6057,7 @@ function ca(t) {
|
|
|
6012
6057
|
request: J,
|
|
6013
6058
|
error: R,
|
|
6014
6059
|
schemaPath: h,
|
|
6015
|
-
params:
|
|
6060
|
+
params: N,
|
|
6016
6061
|
options: ie,
|
|
6017
6062
|
id: ee
|
|
6018
6063
|
});
|
|
@@ -6040,7 +6085,7 @@ function ca(t) {
|
|
|
6040
6085
|
request: J,
|
|
6041
6086
|
response: z,
|
|
6042
6087
|
schemaPath: h,
|
|
6043
|
-
params:
|
|
6088
|
+
params: N,
|
|
6044
6089
|
options: ie,
|
|
6045
6090
|
id: ee
|
|
6046
6091
|
});
|
|
@@ -6065,12 +6110,12 @@ function ca(t) {
|
|
|
6065
6110
|
}
|
|
6066
6111
|
return await z[w]();
|
|
6067
6112
|
})(), response: z };
|
|
6068
|
-
let
|
|
6113
|
+
let k = await z.text();
|
|
6069
6114
|
try {
|
|
6070
|
-
|
|
6115
|
+
k = JSON.parse(k);
|
|
6071
6116
|
} catch {
|
|
6072
6117
|
}
|
|
6073
|
-
return { error:
|
|
6118
|
+
return { error: k, response: z };
|
|
6074
6119
|
}
|
|
6075
6120
|
return {
|
|
6076
6121
|
request(h, m, g) {
|
|
@@ -6126,7 +6171,7 @@ function ca(t) {
|
|
|
6126
6171
|
}
|
|
6127
6172
|
};
|
|
6128
6173
|
}
|
|
6129
|
-
function
|
|
6174
|
+
function nt(t, e, r) {
|
|
6130
6175
|
if (e == null)
|
|
6131
6176
|
return "";
|
|
6132
6177
|
if (typeof e == "object")
|
|
@@ -6135,7 +6180,7 @@ function at(t, e, r) {
|
|
|
6135
6180
|
);
|
|
6136
6181
|
return `${t}=${r?.allowReserved === !0 ? e : encodeURIComponent(e)}`;
|
|
6137
6182
|
}
|
|
6138
|
-
function
|
|
6183
|
+
function Zr(t, e, r) {
|
|
6139
6184
|
if (!e || typeof e != "object")
|
|
6140
6185
|
return "";
|
|
6141
6186
|
const s = [], n = {
|
|
@@ -6160,12 +6205,12 @@ function Dr(t, e, r) {
|
|
|
6160
6205
|
}
|
|
6161
6206
|
for (const l in e) {
|
|
6162
6207
|
const c = r.style === "deepObject" ? `${t}[${l}]` : l;
|
|
6163
|
-
s.push(
|
|
6208
|
+
s.push(nt(c, e[l], r));
|
|
6164
6209
|
}
|
|
6165
6210
|
const a = s.join(n);
|
|
6166
6211
|
return r.style === "label" || r.style === "matrix" ? `${n}${a}` : a;
|
|
6167
6212
|
}
|
|
6168
|
-
function
|
|
6213
|
+
function qr(t, e, r) {
|
|
6169
6214
|
if (!Array.isArray(e))
|
|
6170
6215
|
return "";
|
|
6171
6216
|
if (r.explode === !1) {
|
|
@@ -6185,10 +6230,10 @@ function zr(t, e, r) {
|
|
|
6185
6230
|
}
|
|
6186
6231
|
const s = { simple: ",", label: ".", matrix: ";" }[r.style] || "&", n = [];
|
|
6187
6232
|
for (const a of e)
|
|
6188
|
-
r.style === "simple" || r.style === "label" ? n.push(r.allowReserved === !0 ? a : encodeURIComponent(a)) : n.push(
|
|
6233
|
+
r.style === "simple" || r.style === "label" ? n.push(r.allowReserved === !0 ? a : encodeURIComponent(a)) : n.push(nt(t, a, r));
|
|
6189
6234
|
return r.style === "label" || r.style === "matrix" ? `${s}${n.join(s)}` : n.join(s);
|
|
6190
6235
|
}
|
|
6191
|
-
function
|
|
6236
|
+
function Gt(t) {
|
|
6192
6237
|
return function(r) {
|
|
6193
6238
|
const s = [];
|
|
6194
6239
|
if (r && typeof r == "object")
|
|
@@ -6199,7 +6244,7 @@ function Kt(t) {
|
|
|
6199
6244
|
if (a.length === 0)
|
|
6200
6245
|
continue;
|
|
6201
6246
|
s.push(
|
|
6202
|
-
|
|
6247
|
+
qr(n, a, {
|
|
6203
6248
|
style: "form",
|
|
6204
6249
|
explode: !0,
|
|
6205
6250
|
...t?.array,
|
|
@@ -6210,7 +6255,7 @@ function Kt(t) {
|
|
|
6210
6255
|
}
|
|
6211
6256
|
if (typeof a == "object") {
|
|
6212
6257
|
s.push(
|
|
6213
|
-
|
|
6258
|
+
Zr(n, a, {
|
|
6214
6259
|
style: "deepObject",
|
|
6215
6260
|
explode: !0,
|
|
6216
6261
|
...t?.object,
|
|
@@ -6219,45 +6264,45 @@ function Kt(t) {
|
|
|
6219
6264
|
);
|
|
6220
6265
|
continue;
|
|
6221
6266
|
}
|
|
6222
|
-
s.push(
|
|
6267
|
+
s.push(nt(n, a, t));
|
|
6223
6268
|
}
|
|
6224
6269
|
}
|
|
6225
6270
|
return s.join("&");
|
|
6226
6271
|
};
|
|
6227
6272
|
}
|
|
6228
|
-
function
|
|
6273
|
+
function ma(t, e) {
|
|
6229
6274
|
let r = t;
|
|
6230
|
-
for (const s of t.match(
|
|
6275
|
+
for (const s of t.match(ua) ?? []) {
|
|
6231
6276
|
let n = s.substring(1, s.length - 1), a = !1, l = "simple";
|
|
6232
6277
|
if (n.endsWith("*") && (a = !0, n = n.substring(0, n.length - 1)), n.startsWith(".") ? (l = "label", n = n.substring(1)) : n.startsWith(";") && (l = "matrix", n = n.substring(1)), !e || e[n] === void 0 || e[n] === null)
|
|
6233
6278
|
continue;
|
|
6234
6279
|
const c = e[n];
|
|
6235
6280
|
if (Array.isArray(c)) {
|
|
6236
|
-
r = r.replace(s,
|
|
6281
|
+
r = r.replace(s, qr(n, c, { style: l, explode: a }));
|
|
6237
6282
|
continue;
|
|
6238
6283
|
}
|
|
6239
6284
|
if (typeof c == "object") {
|
|
6240
|
-
r = r.replace(s,
|
|
6285
|
+
r = r.replace(s, Zr(n, c, { style: l, explode: a }));
|
|
6241
6286
|
continue;
|
|
6242
6287
|
}
|
|
6243
6288
|
if (l === "matrix") {
|
|
6244
|
-
r = r.replace(s, `;${
|
|
6289
|
+
r = r.replace(s, `;${nt(n, c)}`);
|
|
6245
6290
|
continue;
|
|
6246
6291
|
}
|
|
6247
6292
|
r = r.replace(s, l === "label" ? `.${encodeURIComponent(c)}` : encodeURIComponent(c));
|
|
6248
6293
|
}
|
|
6249
6294
|
return r;
|
|
6250
6295
|
}
|
|
6251
|
-
function
|
|
6296
|
+
function pa(t, e) {
|
|
6252
6297
|
return t instanceof FormData ? t : e && (e.get instanceof Function ? e.get("Content-Type") ?? e.get("content-type") : e["Content-Type"] ?? e["content-type"]) === "application/x-www-form-urlencoded" ? new URLSearchParams(t).toString() : JSON.stringify(t);
|
|
6253
6298
|
}
|
|
6254
|
-
function
|
|
6299
|
+
function ga(t, e) {
|
|
6255
6300
|
let r = `${e.baseUrl}${t}`;
|
|
6256
6301
|
e.params?.path && (r = e.pathSerializer(r, e.params.path));
|
|
6257
6302
|
let s = e.querySerializer(e.params.query ?? {});
|
|
6258
6303
|
return s.startsWith("?") && (s = s.substring(1)), s && (r += `?${s}`), r;
|
|
6259
6304
|
}
|
|
6260
|
-
function
|
|
6305
|
+
function Kt(...t) {
|
|
6261
6306
|
const e = new Headers();
|
|
6262
6307
|
for (const r of t) {
|
|
6263
6308
|
if (!r || typeof r != "object")
|
|
@@ -6273,10 +6318,10 @@ function Jt(...t) {
|
|
|
6273
6318
|
}
|
|
6274
6319
|
return e;
|
|
6275
6320
|
}
|
|
6276
|
-
function
|
|
6321
|
+
function Jt(t) {
|
|
6277
6322
|
return t.endsWith("/") ? t.substring(0, t.length - 1) : t;
|
|
6278
6323
|
}
|
|
6279
|
-
function
|
|
6324
|
+
function ya(t) {
|
|
6280
6325
|
const e = async ({
|
|
6281
6326
|
queryKey: [s, n, a],
|
|
6282
6327
|
signal: l
|
|
@@ -6292,15 +6337,15 @@ function ha(t) {
|
|
|
6292
6337
|
});
|
|
6293
6338
|
return {
|
|
6294
6339
|
queryOptions: r,
|
|
6295
|
-
useQuery: (s, n, ...[a, l, c]) =>
|
|
6296
|
-
useSuspenseQuery: (s, n, ...[a, l, c]) =>
|
|
6340
|
+
useQuery: (s, n, ...[a, l, c]) => Hr(r(s, n, a, l), c),
|
|
6341
|
+
useSuspenseQuery: (s, n, ...[a, l, c]) => Wr(r(s, n, a, l), c),
|
|
6297
6342
|
useInfiniteQuery: (s, n, a, l, c) => {
|
|
6298
6343
|
const { pageParamName: o = "cursor", ...u } = l, { queryKey: d } = r(s, n, a);
|
|
6299
|
-
return
|
|
6344
|
+
return Qr(
|
|
6300
6345
|
{
|
|
6301
6346
|
queryKey: d,
|
|
6302
6347
|
queryFn: async ({ queryKey: [f, h, m], pageParam: g = 0, signal: x }) => {
|
|
6303
|
-
const v = f.toUpperCase(), T = t[v],
|
|
6348
|
+
const v = f.toUpperCase(), T = t[v], N = {
|
|
6304
6349
|
...m,
|
|
6305
6350
|
signal: x,
|
|
6306
6351
|
params: {
|
|
@@ -6310,7 +6355,7 @@ function ha(t) {
|
|
|
6310
6355
|
[o]: g
|
|
6311
6356
|
}
|
|
6312
6357
|
}
|
|
6313
|
-
}, { data: w, error: S } = await T(h,
|
|
6358
|
+
}, { data: w, error: S } = await T(h, N);
|
|
6314
6359
|
if (S)
|
|
6315
6360
|
throw S;
|
|
6316
6361
|
return w;
|
|
@@ -6320,7 +6365,7 @@ function ha(t) {
|
|
|
6320
6365
|
c
|
|
6321
6366
|
);
|
|
6322
6367
|
},
|
|
6323
|
-
useMutation: (s, n, a, l) =>
|
|
6368
|
+
useMutation: (s, n, a, l) => Br(
|
|
6324
6369
|
{
|
|
6325
6370
|
mutationKey: [s, n],
|
|
6326
6371
|
mutationFn: async (c) => {
|
|
@@ -6335,7 +6380,7 @@ function ha(t) {
|
|
|
6335
6380
|
)
|
|
6336
6381
|
};
|
|
6337
6382
|
}
|
|
6338
|
-
function
|
|
6383
|
+
function va(t) {
|
|
6339
6384
|
if (t?.status === "error") return t;
|
|
6340
6385
|
const e = t?.response?.data;
|
|
6341
6386
|
return {
|
|
@@ -6344,8 +6389,8 @@ function ma(t) {
|
|
|
6344
6389
|
errors: e?.errors || void 0
|
|
6345
6390
|
};
|
|
6346
6391
|
}
|
|
6347
|
-
function
|
|
6348
|
-
return new
|
|
6392
|
+
function Fa() {
|
|
6393
|
+
return new Yr({
|
|
6349
6394
|
defaultOptions: {
|
|
6350
6395
|
queries: {
|
|
6351
6396
|
refetchOnWindowFocus: !1,
|
|
@@ -6353,15 +6398,15 @@ function Oa() {
|
|
|
6353
6398
|
staleTime: 300 * 1e3
|
|
6354
6399
|
}
|
|
6355
6400
|
},
|
|
6356
|
-
mutationCache: new
|
|
6401
|
+
mutationCache: new Gr({
|
|
6357
6402
|
onError: (t) => {
|
|
6358
|
-
const e =
|
|
6403
|
+
const e = va(t);
|
|
6359
6404
|
!e.errors && e.message && se.error(e.message), console.error(`[Mutation Error] ${e.message}`, e.errors);
|
|
6360
6405
|
}
|
|
6361
6406
|
})
|
|
6362
6407
|
});
|
|
6363
6408
|
}
|
|
6364
|
-
const
|
|
6409
|
+
const ba = async (t, e) => {
|
|
6365
6410
|
const r = await fetch(t, { ...e || {}, credentials: "include" });
|
|
6366
6411
|
let s;
|
|
6367
6412
|
if ((r.headers.get?.("content-type") || "").includes("application/json"))
|
|
@@ -6380,16 +6425,16 @@ const pa = async (t, e) => {
|
|
|
6380
6425
|
}
|
|
6381
6426
|
return r;
|
|
6382
6427
|
};
|
|
6383
|
-
function
|
|
6384
|
-
return
|
|
6428
|
+
function $a(t) {
|
|
6429
|
+
return ha({
|
|
6385
6430
|
baseUrl: t.baseUrl,
|
|
6386
|
-
fetch: t.fetch ??
|
|
6431
|
+
fetch: t.fetch ?? ba
|
|
6387
6432
|
});
|
|
6388
6433
|
}
|
|
6389
|
-
function
|
|
6390
|
-
return
|
|
6434
|
+
function Ua(t) {
|
|
6435
|
+
return ya(t);
|
|
6391
6436
|
}
|
|
6392
|
-
function
|
|
6437
|
+
function Da(t, e) {
|
|
6393
6438
|
const r = {};
|
|
6394
6439
|
e.defaults && Object.assign(r, e.defaults);
|
|
6395
6440
|
for (const [s, n] of Object.entries(t || {}))
|
|
@@ -6407,46 +6452,46 @@ function La(t, e) {
|
|
|
6407
6452
|
}
|
|
6408
6453
|
return r;
|
|
6409
6454
|
}
|
|
6410
|
-
const
|
|
6455
|
+
const za = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6411
6456
|
__proto__: null,
|
|
6412
|
-
configureTasks:
|
|
6413
|
-
useTask:
|
|
6414
|
-
useTasks:
|
|
6415
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
6457
|
+
configureTasks: jr,
|
|
6458
|
+
useTask: kr,
|
|
6459
|
+
useTasks: Nr
|
|
6460
|
+
}, Symbol.toStringTag, { value: "Module" })), Za = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6416
6461
|
__proto__: null,
|
|
6417
|
-
configureUsers:
|
|
6418
|
-
useCreateUser:
|
|
6419
|
-
useDisableUserAccount:
|
|
6420
|
-
useResendConfirmationEmail:
|
|
6421
|
-
useResendForgotPassword:
|
|
6422
|
-
useUpdateUser:
|
|
6423
|
-
useUser:
|
|
6424
|
-
useUsers:
|
|
6462
|
+
configureUsers: Rr,
|
|
6463
|
+
useCreateUser: Or,
|
|
6464
|
+
useDisableUserAccount: Fr,
|
|
6465
|
+
useResendConfirmationEmail: Lr,
|
|
6466
|
+
useResendForgotPassword: Mr,
|
|
6467
|
+
useUpdateUser: Ir,
|
|
6468
|
+
useUser: Tr,
|
|
6469
|
+
useUsers: Pr
|
|
6425
6470
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6426
6471
|
export {
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6472
|
+
xt as GenericList,
|
|
6473
|
+
ur as Pagination,
|
|
6474
|
+
Ba as QueryClientProvider,
|
|
6475
|
+
Ia as SortHeader,
|
|
6476
|
+
Ta as admin,
|
|
6477
|
+
Oa as auth,
|
|
6478
|
+
Sa as buildApiQuery,
|
|
6479
|
+
Pa as components,
|
|
6480
|
+
na as configureKaleido,
|
|
6481
|
+
Ua as createClient,
|
|
6482
|
+
$a as createFetchClient,
|
|
6483
|
+
Dr as createKaleidoOpenApiAdapters,
|
|
6484
|
+
zr as createKaleidoOpenApiAuthClient,
|
|
6485
|
+
La as default,
|
|
6486
|
+
Ea as featureFlags,
|
|
6487
|
+
ba as fetchWithCredentials,
|
|
6488
|
+
va as handleApiError,
|
|
6489
|
+
La as kaleido,
|
|
6490
|
+
Fa as newQueryClient,
|
|
6491
|
+
Ma as openapi,
|
|
6492
|
+
Rt as parseParams,
|
|
6493
|
+
za as tasks,
|
|
6494
|
+
We as toSearchParams,
|
|
6495
|
+
Za as users,
|
|
6496
|
+
Da as validateParams
|
|
6452
6497
|
};
|