@feedmepos/mf-brand-app-builder 0.5.6 → 0.5.7-beta.1

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.
@@ -0,0 +1,4690 @@
1
+ import { defineAsyncComponent as L, defineComponent as dr, getCurrentInstance as ct, markRaw as nt, watch as Re, watchEffect as ne, reactive as Ie, onMounted as yr, onUnmounted as vn, ref as z, isRef as pt, h as mt, inject as qe, computed as me, provide as gn, toRef as hn, onBeforeUnmount as bn, nextTick as $n, triggerRef as Te, isReactive as Dt, createTextVNode as _n, resolveComponent as wn } from "vue";
2
+ const vo = [
3
+ // {
4
+ // path: '/',
5
+ // name: 'home',
6
+ // component: HomeView,
7
+ // },
8
+ {
9
+ path: "/builder",
10
+ name: "builder",
11
+ component: L(() => import("./BuilderView-CSboYMIG.js"))
12
+ },
13
+ {
14
+ path: "/settings",
15
+ name: "settings",
16
+ component: L(() => import("./SettingsView-DFAxZPug.js")),
17
+ redirect: { name: "settings-assets" },
18
+ children: [
19
+ {
20
+ path: "assets",
21
+ name: "settings-assets",
22
+ component: L(() => import("./AssetsSettings-Ck7VZOA3.js"))
23
+ },
24
+ {
25
+ path: "management",
26
+ name: "settings-management",
27
+ component: L(() => import("./ManagementSettings-D1CddZ9I.js"))
28
+ }
29
+ ]
30
+ },
31
+ // temp until home view is done
32
+ {
33
+ path: "/",
34
+ redirect: { name: "builder" }
35
+ },
36
+ {
37
+ path: "",
38
+ redirect: { name: "builder" }
39
+ },
40
+ {
41
+ path: "/:pathMatch(.*)",
42
+ redirect: { name: "builder" }
43
+ }
44
+ ];
45
+ var vr = [
46
+ "__key",
47
+ "__init",
48
+ "__shim",
49
+ "__original",
50
+ "__index",
51
+ "__prevKey"
52
+ ];
53
+ function Ee() {
54
+ return Math.random().toString(36).substring(2, 15);
55
+ }
56
+ function kn(e, t) {
57
+ return [...e instanceof Set ? e : new Set(e)];
58
+ }
59
+ function P(e, t) {
60
+ return Object.prototype.hasOwnProperty.call(e, t);
61
+ }
62
+ function T(e, t, r = !0, n = ["__key"]) {
63
+ if (e === t)
64
+ return !0;
65
+ if (typeof t == "object" && typeof e == "object") {
66
+ if (e instanceof Map || e instanceof Set)
67
+ return !1;
68
+ if (e instanceof Date && t instanceof Date)
69
+ return e.getTime() === t.getTime();
70
+ if (e instanceof RegExp && t instanceof RegExp)
71
+ return Sn(e, t);
72
+ if (e === null || t === null || Object.keys(e).length !== Object.keys(t).length)
73
+ return !1;
74
+ for (const s of n)
75
+ if ((s in e || s in t) && e[s] !== t[s])
76
+ return !1;
77
+ for (const s in e)
78
+ if (!(s in t) || e[s] !== t[s] && !r || r && !T(e[s], t[s], r, n))
79
+ return !1;
80
+ return !0;
81
+ }
82
+ return !1;
83
+ }
84
+ function Sn(e, t) {
85
+ return e.source === t.source && e.flags.split("").sort().join("") === t.flags.split("").sort().join("");
86
+ }
87
+ function Z(e) {
88
+ const t = typeof e;
89
+ if (t === "number")
90
+ return !1;
91
+ if (e === void 0)
92
+ return !0;
93
+ if (t === "string")
94
+ return e === "";
95
+ if (t === "object") {
96
+ if (e === null)
97
+ return !0;
98
+ for (const r in e)
99
+ return !1;
100
+ return !(e instanceof RegExp || e instanceof Date);
101
+ }
102
+ return !1;
103
+ }
104
+ function An(e) {
105
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
106
+ }
107
+ function Cn(e) {
108
+ const t = `^${An(e)}$`, r = {
109
+ MM: "(0[1-9]|1[012])",
110
+ M: "([1-9]|1[012])",
111
+ DD: "([012][0-9]|3[01])",
112
+ D: "([012]?[0-9]|3[01])",
113
+ YYYY: "\\d{4}",
114
+ YY: "\\d{2}"
115
+ }, n = Object.keys(r);
116
+ return new RegExp(
117
+ n.reduce((s, i) => s.replace(i, r[i]), t)
118
+ );
119
+ }
120
+ function Ue(e) {
121
+ return Object.prototype.toString.call(e) === "[object Object]";
122
+ }
123
+ function je(e) {
124
+ return Ue(e) || Array.isArray(e);
125
+ }
126
+ function Se(e) {
127
+ if (Ue(e) === !1 || e.__FKNode__ || e.__POJO__ === !1)
128
+ return !1;
129
+ const t = e.constructor;
130
+ if (t === void 0)
131
+ return !0;
132
+ const r = t.prototype;
133
+ return !(Ue(r) === !1 || r.hasOwnProperty("isPrototypeOf") === !1);
134
+ }
135
+ var le = /* @__NO_SIDE_EFFECTS__ */ (e, t, r = !1, n = !1) => {
136
+ if (t === null)
137
+ return null;
138
+ const s = {};
139
+ if (typeof t == "string")
140
+ return t;
141
+ for (const i in e)
142
+ if (P(t, i) && (t[i] !== void 0 || !n)) {
143
+ if (r && Array.isArray(e[i]) && Array.isArray(t[i])) {
144
+ s[i] = e[i].concat(t[i]);
145
+ continue;
146
+ }
147
+ if (t[i] === void 0)
148
+ continue;
149
+ Se(e[i]) && Se(t[i]) ? s[i] = /* @__PURE__ */ le(
150
+ e[i],
151
+ t[i],
152
+ r,
153
+ n
154
+ ) : s[i] = t[i];
155
+ } else
156
+ s[i] = e[i];
157
+ for (const i in t)
158
+ !P(s, i) && t[i] !== void 0 && (s[i] = t[i]);
159
+ return s;
160
+ };
161
+ function Pn(e) {
162
+ if (e[0] !== '"' && e[0] !== "'" || e[0] !== e[e.length - 1])
163
+ return !1;
164
+ const t = e[0];
165
+ for (let r = 1; r < e.length; r++)
166
+ if (e[r] === t && (r === 1 || e[r - 1] !== "\\") && r !== e.length - 1)
167
+ return !1;
168
+ return !0;
169
+ }
170
+ function En(e) {
171
+ if (!e.length)
172
+ return "";
173
+ let t = "", r = "";
174
+ for (let n = 0; n < e.length; n++) {
175
+ const s = e.charAt(n);
176
+ (s !== "\\" || r === "\\") && (t += s), r = s;
177
+ }
178
+ return t;
179
+ }
180
+ function ge(...e) {
181
+ return e.reduce((t, r) => {
182
+ const { value: n, name: s, modelValue: i, config: a, plugins: l, ...o } = r;
183
+ return Object.assign(t, o);
184
+ }, {});
185
+ }
186
+ function On(e) {
187
+ const t = [];
188
+ let r = "", n = 0, s = "", i = "";
189
+ for (let a = 0; a < e.length; a++) {
190
+ const l = e.charAt(a);
191
+ l === s && i !== "\\" ? s = "" : (l === "'" || l === '"') && !s && i !== "\\" ? s = l : l === "(" && !s ? n++ : l === ")" && !s && n--, l === "," && !s && n === 0 ? (t.push(r), r = "") : (l !== " " || s) && (r += l), i = l;
192
+ }
193
+ return r && t.push(r), t;
194
+ }
195
+ function Lt(e, t) {
196
+ const r = {}, n = t.filter((i) => i instanceof RegExp), s = new Set(t);
197
+ for (const i in e)
198
+ !s.has(i) && !n.some((a) => a.test(i)) && (r[i] = e[i]);
199
+ return r;
200
+ }
201
+ function qt(e, t) {
202
+ const r = {}, n = t.filter((s) => s instanceof RegExp);
203
+ return t.forEach((s) => {
204
+ s instanceof RegExp || (r[s] = e[s]);
205
+ }), Object.keys(e).forEach((s) => {
206
+ n.some((i) => i.test(s)) && (r[s] = e[s]);
207
+ }), r;
208
+ }
209
+ function $e(e) {
210
+ return e.replace(
211
+ /-([a-z0-9])/gi,
212
+ (t, r) => r.toUpperCase()
213
+ );
214
+ }
215
+ function gr(e) {
216
+ return e.replace(
217
+ /([a-z0-9])([A-Z])/g,
218
+ (t, r, n) => r + "-" + n.toLowerCase()
219
+ ).replace(" ", "-").toLowerCase();
220
+ }
221
+ function dt(e, t = vr) {
222
+ if (e !== null && typeof e == "object") {
223
+ let r;
224
+ if (Array.isArray(e) ? r = [...e] : Se(e) && (r = { ...e }), r)
225
+ return Mn(e, r, t), r;
226
+ }
227
+ return e;
228
+ }
229
+ function Ae(e, t = vr) {
230
+ if (e === null || e instanceof RegExp || e instanceof Date || e instanceof Map || e instanceof Set || typeof File == "function" && e instanceof File)
231
+ return e;
232
+ let r;
233
+ Array.isArray(e) ? r = e.map((n) => typeof n == "object" ? Ae(n, t) : n) : r = Object.keys(e).reduce((n, s) => (n[s] = typeof e[s] == "object" ? Ae(e[s], t) : e[s], n), {});
234
+ for (const n of t)
235
+ n in e && Object.defineProperty(r, n, {
236
+ enumerable: !1,
237
+ value: e[n]
238
+ });
239
+ return r;
240
+ }
241
+ function U(e) {
242
+ return typeof e == "object" ? Ae(e) : e;
243
+ }
244
+ function In(e, t) {
245
+ if (!e || typeof e != "object")
246
+ return null;
247
+ const r = t.split(".");
248
+ let n = e;
249
+ for (const s in r) {
250
+ const i = r[s];
251
+ if (P(n, i) && (n = n[i]), +s === r.length - 1)
252
+ return n;
253
+ if (!n || typeof n != "object")
254
+ return null;
255
+ }
256
+ return null;
257
+ }
258
+ function G(e) {
259
+ return e !== void 0 && e !== "false" && e !== !1 ? !0 : void 0;
260
+ }
261
+ function Ce(e) {
262
+ return Object.isFrozen(e) ? e : Object.defineProperty(e, "__init", {
263
+ enumerable: !1,
264
+ value: !0
265
+ });
266
+ }
267
+ function At(e) {
268
+ return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]/g, " ").trim().replace(/\s+/g, "-");
269
+ }
270
+ function Mn(e, t, r) {
271
+ for (const n of r)
272
+ n in e && Object.defineProperty(t, n, {
273
+ enumerable: !1,
274
+ value: e[n]
275
+ });
276
+ return t;
277
+ }
278
+ function xn(e) {
279
+ let t = !1;
280
+ return (...r) => {
281
+ if (!t)
282
+ return t = !0, queueMicrotask(() => t = !1), e(...r);
283
+ };
284
+ }
285
+ function Rn(e) {
286
+ if (!(e === "false" || e === !1))
287
+ return !0;
288
+ }
289
+ function Ct() {
290
+ const e = [];
291
+ let t = 0;
292
+ const r = (s) => e.push(s), n = (s) => {
293
+ const i = e[t];
294
+ return typeof i == "function" ? i(s, (a) => (t++, n(a))) : (t = 0, s);
295
+ };
296
+ return r.dispatch = n, r.unshift = (s) => e.unshift(s), r.remove = (s) => {
297
+ const i = e.indexOf(s);
298
+ i > -1 && e.splice(i, 1);
299
+ }, r;
300
+ }
301
+ function hr() {
302
+ const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
303
+ let r;
304
+ const n = (s, i) => {
305
+ if (r) {
306
+ r.set(i.name, [s, i]);
307
+ return;
308
+ }
309
+ e.has(i.name) && e.get(i.name).forEach((a) => {
310
+ (i.origin === s || a.modifiers.includes("deep")) && a.listener(i);
311
+ }), i.bubble && s.bubble(i);
312
+ };
313
+ return n.flush = () => {
314
+ e.clear(), t.clear(), r == null || r.clear();
315
+ }, n.on = (s, i, a = "push") => {
316
+ const [l, ...o] = s.split("."), y = i.receipt || Ee(), v = {
317
+ modifiers: o,
318
+ event: l,
319
+ listener: i,
320
+ receipt: y
321
+ };
322
+ return e.has(l) ? e.get(l)[a](v) : e.set(l, [v]), t.has(y) ? t.get(y)[a](l) : t.set(y, [l]), y;
323
+ }, n.off = (s) => {
324
+ var i;
325
+ t.has(s) && ((i = t.get(s)) == null || i.forEach((a) => {
326
+ const l = e.get(a);
327
+ Array.isArray(l) && e.set(
328
+ a,
329
+ l.filter((o) => o.receipt !== s)
330
+ );
331
+ }), t.delete(s));
332
+ }, n.pause = (s) => {
333
+ r || (r = /* @__PURE__ */ new Map()), s && s.walk((i) => i._e.pause());
334
+ }, n.play = (s) => {
335
+ if (!r)
336
+ return;
337
+ const i = r;
338
+ r = void 0, i.forEach(([a, l]) => n(a, l)), s && s.walk((a) => a._e.play());
339
+ }, n;
340
+ }
341
+ function jn(e, t, r, n, s = !0, i) {
342
+ return t._e(e, {
343
+ payload: n,
344
+ name: r,
345
+ bubble: s,
346
+ origin: e,
347
+ meta: i
348
+ }), e;
349
+ }
350
+ function Fn(e, t, r) {
351
+ return Ne(e.parent) && e.parent._e(e.parent, r), e;
352
+ }
353
+ function Vn(e, t, r, n, s) {
354
+ return t._e.on(r, n, s);
355
+ }
356
+ function Nn(e, t, r) {
357
+ return t._e.off(r), e;
358
+ }
359
+ var Pt = Ct();
360
+ Pt((e, t) => (e.message || (e.message = `E${e.code}`), t(e)));
361
+ var Et = Ct();
362
+ Et((e, t) => {
363
+ e.message || (e.message = `W${e.code}`);
364
+ const r = t(e);
365
+ return console && typeof console.warn == "function" && console.warn(r.message), r;
366
+ });
367
+ function ye(e, t = {}) {
368
+ Et.dispatch({ code: e, data: t });
369
+ }
370
+ function W(e, t = {}) {
371
+ throw Error(Pt.dispatch({ code: e, data: t }).message);
372
+ }
373
+ function H(e, t) {
374
+ return {
375
+ blocking: !1,
376
+ key: Ee(),
377
+ meta: {},
378
+ type: "state",
379
+ visible: !0,
380
+ ...e
381
+ };
382
+ }
383
+ var Tt = {
384
+ apply: zn,
385
+ set: Ln,
386
+ remove: br,
387
+ filter: Tn,
388
+ reduce: Kn,
389
+ release: Bn,
390
+ touch: qn
391
+ };
392
+ function Dn(e = !1) {
393
+ const t = {};
394
+ let r, n = e, s = [];
395
+ const i = /* @__PURE__ */ new Map();
396
+ let a;
397
+ const l = new Proxy(t, {
398
+ get(...o) {
399
+ const [y, v] = o;
400
+ return v === "buffer" ? n : v === "_b" ? s : v === "_m" ? i : v === "_r" ? a : P(Tt, v) ? Tt[v].bind(
401
+ null,
402
+ t,
403
+ l,
404
+ r
405
+ ) : Reflect.get(...o);
406
+ },
407
+ set(o, y, v) {
408
+ return y === "_n" ? (r = v, a === "__n" && $r(r, l), !0) : y === "_b" ? (s = v, !0) : y === "buffer" ? (n = v, !0) : y === "_r" ? (a = v, !0) : (W(101, r), !1);
409
+ }
410
+ });
411
+ return l;
412
+ }
413
+ function Ln(e, t, r, n) {
414
+ if (t.buffer)
415
+ return t._b.push([[n]]), t;
416
+ if (e[n.key] !== n) {
417
+ if (typeof n.value == "string" && n.meta.localize !== !1) {
418
+ const i = n.value;
419
+ n.value = r.t(n), n.value !== i && (n.meta.locale = r.props.locale);
420
+ }
421
+ const s = `message-${P(e, n.key) ? "updated" : "added"}`;
422
+ e[n.key] = Object.freeze(
423
+ r.hook.message.dispatch(n)
424
+ ), r.emit(s, n);
425
+ }
426
+ return t;
427
+ }
428
+ function qn(e, t) {
429
+ for (const r in e) {
430
+ const n = { ...e[r] };
431
+ t.set(n);
432
+ }
433
+ }
434
+ function br(e, t, r, n) {
435
+ if (P(e, n)) {
436
+ const s = e[n];
437
+ delete e[n], r.emit("message-removed", s);
438
+ }
439
+ return t.buffer === !0 && (t._b = t._b.filter((s) => (s[0] = s[0].filter((i) => i.key !== n), s[1] || s[0].length))), t;
440
+ }
441
+ function Tn(e, t, r, n, s) {
442
+ for (const i in e) {
443
+ const a = e[i];
444
+ (!s || a.type === s) && !n(a) && br(e, t, r, i);
445
+ }
446
+ }
447
+ function Kn(e, t, r, n, s) {
448
+ for (const i in e) {
449
+ const a = e[i];
450
+ s = n(s, a);
451
+ }
452
+ return s;
453
+ }
454
+ function zn(e, t, r, n, s) {
455
+ if (Array.isArray(n)) {
456
+ if (t.buffer) {
457
+ t._b.push([n, s]);
458
+ return;
459
+ }
460
+ const i = new Set(
461
+ n.map((a) => (t.set(a), a.key))
462
+ );
463
+ typeof s == "string" ? t.filter(
464
+ (a) => a.type !== s || i.has(a.key)
465
+ ) : typeof s == "function" && t.filter((a) => !s(a) || i.has(a.key));
466
+ } else
467
+ for (const i in n) {
468
+ const a = r.at(i);
469
+ a ? a.store.apply(n[i], s) : Hn(r, t, i, n[i], s);
470
+ }
471
+ }
472
+ function Wn(e, ...t) {
473
+ const r = `${e.name}-set`, n = (s) => /* @__PURE__ */ H({
474
+ key: At(s),
475
+ type: "error",
476
+ value: s,
477
+ meta: { source: r, autoClear: !0 }
478
+ });
479
+ return t.filter((s) => !!s).map((s) => {
480
+ if (typeof s == "string" && (s = [s]), Array.isArray(s))
481
+ return s.map((i) => n(i));
482
+ {
483
+ const i = {};
484
+ for (const a in s)
485
+ Array.isArray(s[a]) ? i[a] = s[a].map(
486
+ (l) => n(l)
487
+ ) : i[a] = [n(s[a])];
488
+ return i;
489
+ }
490
+ });
491
+ }
492
+ function Hn(e, t, r, n, s) {
493
+ var a;
494
+ const i = t._m;
495
+ i.has(r) || i.set(r, []), t._r || (t._r = $r(e, t)), (a = i.get(r)) == null || a.push([n, s]);
496
+ }
497
+ function $r(e, t) {
498
+ return e.on(
499
+ "child.deep",
500
+ ({ payload: r }) => {
501
+ t._m.forEach((n, s) => {
502
+ e.at(s) === r && (n.forEach(([i, a]) => {
503
+ r.store.apply(i, a);
504
+ }), t._m.delete(s));
505
+ }), t._m.size === 0 && t._r && (e.off(t._r), t._r = void 0);
506
+ }
507
+ );
508
+ }
509
+ function Bn(e, t) {
510
+ t.buffer = !1, t._b.forEach(([r, n]) => t.apply(r, n)), t._b = [];
511
+ }
512
+ function Un() {
513
+ const e = {};
514
+ let t;
515
+ return {
516
+ count: (...r) => Zn(t, e, ...r),
517
+ init(r) {
518
+ t = r, r.on("message-added.deep", Kt(e, 1)), r.on("message-removed.deep", Kt(e, -1));
519
+ },
520
+ merge: (r) => zt(t, e, r),
521
+ settled(r) {
522
+ return P(e, r) ? e[r].promise : Promise.resolve();
523
+ },
524
+ unmerge: (r) => zt(t, e, r, !0),
525
+ value(r) {
526
+ return P(e, r) ? e[r].count : 0;
527
+ }
528
+ };
529
+ }
530
+ function Zn(e, t, r, n, s = 0) {
531
+ if (n = Yn(n || r), !P(t, r)) {
532
+ const i = {
533
+ condition: n,
534
+ count: 0,
535
+ name: r,
536
+ node: e,
537
+ promise: Promise.resolve(),
538
+ resolve: () => {
539
+ }
540
+ // eslint-disable-line @typescript-eslint/no-empty-function
541
+ };
542
+ t[r] = i, s = e.store.reduce(
543
+ (a, l) => a + i.condition(l) * 1,
544
+ s
545
+ ), e.each((a) => {
546
+ a.ledger.count(i.name, i.condition), s += a.ledger.value(i.name);
547
+ });
548
+ }
549
+ return _r(t[r], s).promise;
550
+ }
551
+ function Yn(e) {
552
+ return typeof e == "function" ? e : (t) => t.type === e;
553
+ }
554
+ function _r(e, t) {
555
+ const r = e.count, n = e.count + t;
556
+ return e.count = n, r === 0 && n !== 0 ? (e.node.emit(`unsettled:${e.name}`, e.count, !1), e.promise = new Promise((s) => e.resolve = s)) : r !== 0 && n === 0 && (e.node.emit(`settled:${e.name}`, e.count, !1), e.resolve()), e.node.emit(`count:${e.name}`, e.count, !1), e;
557
+ }
558
+ function Kt(e, t) {
559
+ return (r) => {
560
+ for (const n in e) {
561
+ const s = e[n];
562
+ s.condition(r.payload) && _r(s, t);
563
+ }
564
+ };
565
+ }
566
+ function zt(e, t, r, n = !1) {
567
+ const s = e;
568
+ for (const i in t) {
569
+ const a = t[i].condition;
570
+ n || r.ledger.count(i, a);
571
+ const l = r.ledger.value(i) * (n ? -1 : 1);
572
+ if (e) {
573
+ do
574
+ e.ledger.count(i, a, l), e = e.parent;
575
+ while (e);
576
+ e = s;
577
+ }
578
+ }
579
+ }
580
+ var Ot = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map(), It = hr();
581
+ function Gn(e) {
582
+ e.props.id && (Ot.set(e.props.id, e), ze.set(e, e.props.id), It(e, {
583
+ payload: e,
584
+ name: e.props.id,
585
+ bubble: !1,
586
+ origin: e
587
+ }));
588
+ }
589
+ function Jn(e) {
590
+ if (ze.has(e)) {
591
+ const t = ze.get(e);
592
+ ze.delete(e), Ot.delete(t), It(e, {
593
+ payload: null,
594
+ name: t,
595
+ bubble: !1,
596
+ origin: e
597
+ });
598
+ }
599
+ }
600
+ function Ve(e) {
601
+ return Ot.get(e);
602
+ }
603
+ function Qn(e, t) {
604
+ return It.on(e, t);
605
+ }
606
+ function yt(e, t, r) {
607
+ let n = !0;
608
+ return t in e.config._t ? n = !1 : e.emit(`config:${t}`, r, !1), t in e.props || (e.emit("prop", { prop: t, value: r }), e.emit(`prop:${t}`, r)), n;
609
+ }
610
+ function Xn(e = {}) {
611
+ const t = /* @__PURE__ */ new Set(), r = {
612
+ ...e,
613
+ _add: (s) => t.add(s),
614
+ _rm: (s) => t.delete(s)
615
+ };
616
+ return new Proxy(r, {
617
+ set(s, i, a, l) {
618
+ return typeof i == "string" && t.forEach((o) => yt(o, i, a)), Reflect.set(s, i, a, l);
619
+ }
620
+ });
621
+ }
622
+ function wr(e, t) {
623
+ const r = (t || document).getElementById(e);
624
+ if (r instanceof HTMLFormElement) {
625
+ const n = new Event("submit", { cancelable: !0, bubbles: !0 });
626
+ r.dispatchEvent(n);
627
+ return;
628
+ }
629
+ ye(151, e);
630
+ }
631
+ function es(e) {
632
+ const t = (r) => {
633
+ for (const n in r.store) {
634
+ const s = r.store[n];
635
+ s.type === "error" || s.type === "ui" && n === "incomplete" ? r.store.remove(n) : s.type === "state" && r.store.set({ ...s, value: !1 });
636
+ }
637
+ };
638
+ t(e), e.walk(t);
639
+ }
640
+ function kr(e, t) {
641
+ const r = typeof e == "string" ? Ve(e) : e;
642
+ if (r) {
643
+ const n = (a) => {
644
+ const l = U(a.props.initial);
645
+ return l !== void 0 ? l : a.type === "group" ? {} : a.type === "list" ? [] : void 0;
646
+ };
647
+ r._e.pause(r);
648
+ const s = U(t);
649
+ return t && !Z(t) && (r.props.initial = je(s) ? Ce(s) : s, r.props._init = r.props.initial), r.input(n(r), !1), r.walk((a) => {
650
+ a.type === "list" && a.sync || a.input(n(a), !1);
651
+ }), r.input(
652
+ Z(s) && s ? s : n(r),
653
+ !1
654
+ ), r.type !== "input" && t && !Z(t) && je(t) && r.walk((a) => {
655
+ a.props.initial = je(a.value) ? Ce(a.value) : a.value, a.props._init = a.props.initial;
656
+ }), r._e.play(r), es(r), r.emit("reset", r), r;
657
+ }
658
+ ye(152, e);
659
+ }
660
+ var ts = {
661
+ delimiter: ".",
662
+ delay: 0,
663
+ locale: "en",
664
+ rootClasses: (e) => ({ [`formkit-${gr(e)}`]: !0 })
665
+ }, Sr = Symbol("index"), vt = Symbol("removed"), gt = Symbol("moved"), Ar = Symbol("inserted");
666
+ function rs(e) {
667
+ return e.type === "list" && Array.isArray(e._value);
668
+ }
669
+ function Ne(e) {
670
+ return e && typeof e == "object" && e.__FKNode__ === !0;
671
+ }
672
+ var We = (e, t, r) => {
673
+ W(102, [e, r]);
674
+ }, ns = {
675
+ _c: x(Ss, We, !1),
676
+ add: x(vs),
677
+ addProps: x(ys),
678
+ address: x(Cs, We, !1),
679
+ at: x(Ps),
680
+ bubble: x(Fn),
681
+ clearErrors: x(Vs),
682
+ calm: x(ps),
683
+ config: x(!1),
684
+ define: x(ds),
685
+ disturb: x(cs),
686
+ destroy: x(ms),
687
+ extend: x(Ds),
688
+ hydrate: x(us),
689
+ index: x(ks, ws, !1),
690
+ input: x(Er),
691
+ each: x(bs),
692
+ emit: x(jn),
693
+ find: x(Os),
694
+ on: x(Vn),
695
+ off: x(Nn),
696
+ parent: x(!1, gs),
697
+ plugins: x(!1),
698
+ remove: x(hs),
699
+ root: x(Ms, We, !1),
700
+ reset: x(js),
701
+ resetConfig: x(_s),
702
+ setErrors: x(Fs),
703
+ submit: x(Rs),
704
+ t: x(xs),
705
+ use: x(Mt),
706
+ name: x(As, !1, !1),
707
+ walk: x($s)
708
+ };
709
+ function ss() {
710
+ return new Map(Object.entries(ns));
711
+ }
712
+ function x(e, t, r = !0) {
713
+ return {
714
+ get: e ? (n, s) => r ? (...i) => e(n, s, ...i) : e(n, s) : !1,
715
+ set: t !== void 0 ? t : We.bind(null)
716
+ };
717
+ }
718
+ function is() {
719
+ const e = /* @__PURE__ */ new Map();
720
+ return new Proxy(e, {
721
+ get(t, r) {
722
+ return e.has(r) || e.set(r, Ct()), e.get(r);
723
+ }
724
+ });
725
+ }
726
+ var Cr = 0, as = 0;
727
+ function ls(e) {
728
+ var t, r;
729
+ return ((t = e.parent) == null ? void 0 : t.type) === "list" ? Sr : e.name || `${((r = e.props) == null ? void 0 : r.type) || "input"}_${++Cr}`;
730
+ }
731
+ function Pr(e) {
732
+ return e.type === "group" ? Ce(
733
+ e.value && typeof e.value == "object" && !Array.isArray(e.value) ? e.value : {}
734
+ ) : e.type === "list" ? Ce(Array.isArray(e.value) ? e.value : []) : e.value;
735
+ }
736
+ function Er(e, t, r, n = !0) {
737
+ return t._value = os(e, e.hook.input.dispatch(r)), e.emit("input", t._value), e.isCreated && e.type === "input" && T(t._value, t.value) && !e.props.mergeStrategy ? (e.emit("commitRaw", t.value), t.settled) : (t.isSettled && e.disturb(), n ? (t._tmo && clearTimeout(t._tmo), t._tmo = setTimeout(
738
+ Ze,
739
+ e.props.delay,
740
+ e,
741
+ t
742
+ )) : Ze(e, t), t.settled);
743
+ }
744
+ function os(e, t) {
745
+ switch (e.type) {
746
+ case "input":
747
+ break;
748
+ case "group":
749
+ (!t || typeof t != "object") && W(107, [e, t]);
750
+ break;
751
+ case "list":
752
+ Array.isArray(t) || W(108, [e, t]);
753
+ break;
754
+ }
755
+ return t;
756
+ }
757
+ function Ze(e, t, r = !0, n = !0) {
758
+ t._value = t.value = e.hook.commit.dispatch(t._value), e.type !== "input" && n && e.hydrate(), e.emit("commitRaw", t.value), e.emit("commit", t.value), r && e.calm();
759
+ }
760
+ function Or(e, { name: t, value: r, from: n }) {
761
+ if (!Object.isFrozen(e._value)) {
762
+ if (rs(e)) {
763
+ const s = r === vt ? [] : r === gt && typeof n == "number" ? e._value.splice(n, 1) : [r];
764
+ e._value.splice(
765
+ t,
766
+ r === gt || n === Ar ? 0 : 1,
767
+ ...s
768
+ );
769
+ return;
770
+ }
771
+ r !== vt ? e._value[t] = r : delete e._value[t];
772
+ }
773
+ }
774
+ function us(e, t) {
775
+ const r = t._value;
776
+ return e.type === "list" && e.sync && fs(e, t), t.children.forEach((n) => {
777
+ if (typeof r == "object")
778
+ if (n.name in r) {
779
+ const s = n.type !== "input" || r[n.name] && typeof r[n.name] == "object" ? Ce(r[n.name]) : r[n.name];
780
+ if (!n.isSettled || (!je(s) || n.props.mergeStrategy) && T(s, n._value))
781
+ return;
782
+ n.input(s, !1);
783
+ } else
784
+ (e.type !== "list" || typeof n.name == "number") && Or(t, { name: n.name, value: n.value }), r.__init || (n.type === "group" ? n.input({}, !1) : n.type === "list" ? n.input([], !1) : n.input(void 0, !1));
785
+ }), e;
786
+ }
787
+ function fs(e, t) {
788
+ const r = e._value;
789
+ if (!Array.isArray(r))
790
+ return;
791
+ const n = [], s = new Set(t.children), i = /* @__PURE__ */ new Map();
792
+ r.forEach((l, o) => {
793
+ if (t.children[o] && t.children[o]._value === l)
794
+ n.push(t.children[o]), s.delete(t.children[o]);
795
+ else {
796
+ n.push(null);
797
+ const y = i.get(l) || [];
798
+ y.push(o), i.set(l, y);
799
+ }
800
+ }), s.size && i.size && s.forEach((l) => {
801
+ if (i.has(l._value)) {
802
+ const o = i.get(l._value), y = o.shift();
803
+ n[y] = l, s.delete(l), o.length || i.delete(l._value);
804
+ }
805
+ });
806
+ const a = [];
807
+ for (i.forEach((l) => {
808
+ a.push(...l);
809
+ }); s.size && a.length; ) {
810
+ const l = s.values().next().value, o = a.shift();
811
+ if (o === void 0)
812
+ break;
813
+ n[o] = l, s.delete(l);
814
+ }
815
+ a.forEach((l, o) => {
816
+ n[l] = Ks({ value: o });
817
+ }), s.size && s.forEach((l) => {
818
+ if (!("__FKP" in l)) {
819
+ const o = l._c.parent;
820
+ if (!o || zs(o))
821
+ return;
822
+ o.ledger.unmerge(l), l._c.parent = null, l.destroy();
823
+ }
824
+ }), t.children = n;
825
+ }
826
+ function cs(e, t) {
827
+ var r;
828
+ return t._d <= 0 && (t.isSettled = !1, e.emit("settled", !1, !1), t.settled = new Promise((n) => {
829
+ t._resolve = n;
830
+ }), e.parent && ((r = e.parent) == null || r.disturb())), t._d++, e;
831
+ }
832
+ function ps(e, t, r) {
833
+ var n;
834
+ if (r !== void 0 && e.type !== "input") {
835
+ Or(t, r);
836
+ const s = !!(e.config.mergeStrategy && e.config.mergeStrategy[r.name]);
837
+ return Ze(e, t, !0, s);
838
+ }
839
+ t._d > 0 && t._d--, t._d === 0 && (t.isSettled = !0, e.emit("settled", !0, !1), e.parent && ((n = e.parent) == null || n.calm({ name: e.name, value: t.value })), t._resolve && t._resolve(t.value));
840
+ }
841
+ function ms(e, t) {
842
+ e.emit("destroying", e), e.store.filter(() => !1), e.parent && e.parent.remove(e), Jn(e), e.emit("destroyed", e), t._e.flush(), t._value = t.value = void 0;
843
+ for (const r in t.context)
844
+ delete t.context[r];
845
+ t.plugins.clear(), t.context = null;
846
+ }
847
+ function ds(e, t, r) {
848
+ t.type = r.type;
849
+ const n = Ae(r);
850
+ e.props.__propDefs = Ir(
851
+ e.props.__propDefs ?? [],
852
+ (n == null ? void 0 : n.props) || []
853
+ ), n.props = e.props.__propDefs, t.props.definition = n, t.value = t._value = Pr({
854
+ type: e.type,
855
+ value: t.value
856
+ }), r.forceTypeProp && (e.props.type && (e.props.originalType = e.props.type), t.props.type = r.forceTypeProp), r.family && (t.props.family = r.family), r.features && r.features.forEach((s) => s(e)), r.props && e.addProps(r.props), e.emit("defined", r);
857
+ }
858
+ function ys(e, t, r) {
859
+ const n = Array.isArray(r) ? r : Object.keys(r), s = Array.isArray(r) ? {} : n.reduce((a, l) => ("default" in r[l] && (a[l] = r[l].default), a), {});
860
+ if (e.props.attrs) {
861
+ const a = { ...e.props.attrs };
862
+ e.props._emit = !1;
863
+ for (const o in a) {
864
+ const y = $e(o);
865
+ n.includes(y) && (e.props[y] = a[o], delete a[o]);
866
+ }
867
+ Array.isArray(r) || n.forEach((o) => {
868
+ "default" in r[o] && e.props[o] === void 0 && (e.props[o] = s[o]);
869
+ });
870
+ const l = U(t._value);
871
+ e.props.initial = e.type !== "input" ? Ce(l) : l, e.props._emit = !0, e.props.attrs = a;
872
+ }
873
+ const i = Ir(e.props.__propDefs ?? [], r);
874
+ return e.props.definition && (e.props.definition.props = i), e.props.__propDefs = i, e.emit("added-props", r), e;
875
+ }
876
+ function ht(e) {
877
+ return Array.isArray(e) ? e.reduce((t, r) => (t[r] = {}, t), {}) : e;
878
+ }
879
+ function Ir(e, t) {
880
+ return Array.isArray(e) && Array.isArray(t) ? e.concat(t) : le(ht(e), ht(t));
881
+ }
882
+ function vs(e, t, r, n) {
883
+ if (e.type === "input" && W(100, e), r.parent && r.parent !== e && r.parent.remove(r), !t.children.includes(r)) {
884
+ if (n !== void 0 && e.type === "list") {
885
+ const s = t.children[n];
886
+ s && "__FKP" in s ? (r._c.uid = s.uid, t.children.splice(n, 1, r)) : t.children.splice(n, 0, r), Array.isArray(e.value) && e.value.length < t.children.length && e.disturb().calm({
887
+ name: n,
888
+ value: r.value,
889
+ from: Ar
890
+ });
891
+ } else
892
+ t.children.push(r);
893
+ r.isSettled || e.disturb();
894
+ }
895
+ if (r.parent !== e) {
896
+ if (r.parent = e, r.parent !== e)
897
+ return e.remove(r), r.parent.add(r), e;
898
+ } else
899
+ r.use(e.plugins);
900
+ return Ze(e, t, !1), e.ledger.merge(r), e.emit("child", r), e;
901
+ }
902
+ function gs(e, t, r, n) {
903
+ return Ne(n) ? (e.parent && e.parent !== n && e.parent.remove(e), t.parent = n, e.resetConfig(), n.children.includes(e) ? e.use(n.plugins) : n.add(e), !0) : n === null ? (t.parent = null, !0) : !1;
904
+ }
905
+ function hs(e, t, r) {
906
+ const n = t.children.indexOf(r);
907
+ if (n !== -1) {
908
+ r.isSettled && e.disturb(), t.children.splice(n, 1);
909
+ let s = G(r.props.preserve), i = r.parent;
910
+ for (; s === void 0 && i; )
911
+ s = G(i.props.preserve), i = i.parent;
912
+ s ? e.calm() : e.calm({
913
+ name: e.type === "list" ? n : r.name,
914
+ value: vt
915
+ }), r.parent = null, r.config._rmn = r;
916
+ }
917
+ return e.ledger.unmerge(r), e.emit("childRemoved", r), e;
918
+ }
919
+ function bs(e, t, r) {
920
+ t.children.forEach((n) => !("__FKP" in n) && r(n));
921
+ }
922
+ function $s(e, t, r, n = !1, s = !1) {
923
+ t.children.some((i) => {
924
+ if ("__FKP" in i)
925
+ return !1;
926
+ const a = r(i);
927
+ return n && a === !1 ? !0 : s && a === !1 ? !1 : i.walk(r, n, s);
928
+ });
929
+ }
930
+ function _s(e, t) {
931
+ const r = e.parent || void 0;
932
+ t.config = Mr(e.config._t, r), e.walk((n) => n.resetConfig());
933
+ }
934
+ function Mt(e, t, r, n = !0, s = !0) {
935
+ return Array.isArray(r) || r instanceof Set ? (r.forEach((i) => Mt(e, t, i)), e) : (t.plugins.has(r) || (s && typeof r.library == "function" && r.library(e), n && r(e) !== !1 && (t.plugins.add(r), e.children.forEach((i) => i.use(r)))), e);
936
+ }
937
+ function ws(e, t, r, n) {
938
+ if (Ne(e.parent)) {
939
+ const s = e.parent.children, i = n >= s.length ? s.length - 1 : n < 0 ? 0 : n, a = s.indexOf(e);
940
+ return a === -1 ? !1 : (s.splice(a, 1), s.splice(i, 0, e), e.parent.children = s, e.parent.type === "list" && e.parent.disturb().calm({ name: i, value: gt, from: a }), !0);
941
+ }
942
+ return !1;
943
+ }
944
+ function ks(e) {
945
+ if (e.parent) {
946
+ const t = [...e.parent.children].indexOf(e);
947
+ return t === -1 ? e.parent.children.length : t;
948
+ }
949
+ return -1;
950
+ }
951
+ function Ss(e, t) {
952
+ return t;
953
+ }
954
+ function As(e, t) {
955
+ var r;
956
+ return ((r = e.parent) == null ? void 0 : r.type) === "list" ? e.index : t.name !== Sr ? t.name : e.index;
957
+ }
958
+ function Cs(e, t) {
959
+ return t.parent ? t.parent.address.concat([e.name]) : [e.name];
960
+ }
961
+ function Ps(e, t, r) {
962
+ const n = typeof r == "string" ? r.split(e.config.delimiter) : r;
963
+ if (!n.length)
964
+ return;
965
+ const s = n[0];
966
+ let i = e.parent;
967
+ for (i || (String(n[0]) === String(e.name) && n.shift(), i = e), s === "$parent" && n.shift(); i && n.length; ) {
968
+ const a = n.shift();
969
+ switch (a) {
970
+ case "$root":
971
+ i = e.root;
972
+ break;
973
+ case "$parent":
974
+ i = i.parent;
975
+ break;
976
+ case "$self":
977
+ i = e;
978
+ break;
979
+ default:
980
+ i = i.children.find(
981
+ (l) => !("__FKP" in l) && String(l.name) === String(a)
982
+ ) || Es(i, a);
983
+ }
984
+ }
985
+ return i || void 0;
986
+ }
987
+ function Es(e, t) {
988
+ const r = String(t).match(/^(find)\((.*)\)$/);
989
+ if (r) {
990
+ const [, n, s] = r, i = s.split(",").map((a) => a.trim());
991
+ switch (n) {
992
+ case "find":
993
+ return e.find(i[0], i[1]);
994
+ default:
995
+ return;
996
+ }
997
+ }
998
+ }
999
+ function Os(e, t, r, n) {
1000
+ return Is(e, r, n);
1001
+ }
1002
+ function Is(e, t, r = "name") {
1003
+ const n = typeof r == "string" ? (i) => i[r] == t : r, s = [e];
1004
+ for (; s.length; ) {
1005
+ const i = s.shift();
1006
+ if (!("__FKP" in i)) {
1007
+ if (n(i, t))
1008
+ return i;
1009
+ s.push(...i.children);
1010
+ }
1011
+ }
1012
+ }
1013
+ function Ms(e) {
1014
+ let t = e;
1015
+ for (; t.parent; )
1016
+ t = t.parent;
1017
+ return t;
1018
+ }
1019
+ function Mr(e = {}, t) {
1020
+ let r;
1021
+ return new Proxy(e, {
1022
+ get(...n) {
1023
+ const s = n[1];
1024
+ if (s === "_t")
1025
+ return e;
1026
+ const i = Reflect.get(...n);
1027
+ if (i !== void 0)
1028
+ return i;
1029
+ if (t) {
1030
+ const a = t.config[s];
1031
+ if (a !== void 0)
1032
+ return a;
1033
+ }
1034
+ if (e.rootConfig && typeof s == "string") {
1035
+ const a = e.rootConfig[s];
1036
+ if (a !== void 0)
1037
+ return a;
1038
+ }
1039
+ return s === "delay" && (r == null ? void 0 : r.type) === "input" ? 20 : ts[s];
1040
+ },
1041
+ set(...n) {
1042
+ const s = n[1], i = n[2];
1043
+ if (s === "_n")
1044
+ return r = i, e.rootConfig && e.rootConfig._add(r), !0;
1045
+ if (s === "_rmn")
1046
+ return e.rootConfig && e.rootConfig._rm(r), r = void 0, !0;
1047
+ if (!T(e[s], i, !1)) {
1048
+ const a = Reflect.set(...n);
1049
+ return r && (r.emit(`config:${s}`, i, !1), yt(r, s, i), r.walk((l) => yt(l, s, i), !1, !0)), a;
1050
+ }
1051
+ return !0;
1052
+ }
1053
+ });
1054
+ }
1055
+ function xs(e, t, r, n = "ui") {
1056
+ const s = typeof r == "string" ? { key: r, value: r, type: n } : r, i = e.hook.text.dispatch(s);
1057
+ return e.emit("text", i, !1), i.value;
1058
+ }
1059
+ function Rs(e) {
1060
+ const t = e.name;
1061
+ do {
1062
+ if (e.props.isForm === !0)
1063
+ break;
1064
+ e.parent || W(106, t), e = e.parent;
1065
+ } while (e);
1066
+ e.props.id && wr(e.props.id, e.props.__root);
1067
+ }
1068
+ function js(e, t, r) {
1069
+ return kr(e, r);
1070
+ }
1071
+ function Fs(e, t, r, n) {
1072
+ const s = `${e.name}-set`, i = e.hook.setErrors.dispatch({ localErrors: r, childErrors: n });
1073
+ return Wn(e, i.localErrors, i.childErrors).forEach(
1074
+ (a) => {
1075
+ e.store.apply(a, (l) => l.meta.source === s);
1076
+ }
1077
+ ), e;
1078
+ }
1079
+ function Vs(e, t, r = !0, n) {
1080
+ return e.store.filter((s) => !(n === void 0 || s.meta.source === n), "error"), r && (n = n || `${e.name}-set`, e.walk((s) => {
1081
+ s.store.filter((i) => !(i.type === "error" && i.meta && i.meta.source === n));
1082
+ })), e;
1083
+ }
1084
+ function Ns(e) {
1085
+ const t = {
1086
+ initial: typeof e == "object" ? U(e) : e
1087
+ };
1088
+ let r, n = !0, s = {};
1089
+ return new Proxy(t, {
1090
+ get(...i) {
1091
+ var v, h, O, g;
1092
+ const [a, l] = i;
1093
+ let o;
1094
+ P(t, l) ? (o = Reflect.get(...i), (v = s[l]) != null && v.boolean && (o = Rn(o))) : r && typeof l == "string" && r.config[l] !== void 0 ? (o = r.config[l], l === "mergeStrategy" && (r == null ? void 0 : r.type) === "input" && Ue(o) && r.name in o && (o = o[r.name])) : o = (h = s[l]) == null ? void 0 : h.default;
1095
+ const y = (O = s[l]) == null ? void 0 : O.getter;
1096
+ return (g = s[l]) != null && g.boolean && (o = !!o), y ? y(o, r) : o;
1097
+ },
1098
+ set(i, a, l, o) {
1099
+ var O;
1100
+ if (a === "_n")
1101
+ return r = l, !0;
1102
+ if (a === "_emit")
1103
+ return n = l, !0;
1104
+ let { prop: y, value: v } = r.hook.prop.dispatch({
1105
+ prop: a,
1106
+ value: l
1107
+ });
1108
+ const h = (O = s[y]) == null ? void 0 : O.setter;
1109
+ if (v = h ? h(v, r) : v, !T(t[y], v, !1) || typeof v == "object") {
1110
+ const g = Reflect.set(i, y, v, o);
1111
+ return y === "__propDefs" && (s = ht(v)), n && (r.emit("prop", { prop: y, value: v }), typeof y == "string" && r.emit(`prop:${y}`, v)), g;
1112
+ }
1113
+ return !0;
1114
+ }
1115
+ });
1116
+ }
1117
+ function Ds(e, t, r, n) {
1118
+ return t.traps.set(r, n), e;
1119
+ }
1120
+ function Ls(e, t) {
1121
+ if (e.props.definition)
1122
+ return e.define(e.props.definition);
1123
+ for (const r of t) {
1124
+ if (e.props.definition)
1125
+ return;
1126
+ typeof r.library == "function" && r.library(e);
1127
+ }
1128
+ }
1129
+ function qs(e) {
1130
+ const t = Pr(e), r = Mr(e.config || {}, e.parent);
1131
+ return {
1132
+ _d: 0,
1133
+ _e: hr(),
1134
+ uid: Symbol(),
1135
+ _resolve: !1,
1136
+ _tmo: !1,
1137
+ _value: t,
1138
+ children: kn(e.children || []),
1139
+ config: r,
1140
+ hook: is(),
1141
+ isCreated: !1,
1142
+ isSettled: !0,
1143
+ ledger: Un(),
1144
+ name: ls(e),
1145
+ parent: e.parent || null,
1146
+ plugins: /* @__PURE__ */ new Set(),
1147
+ props: Ns(t),
1148
+ settled: Promise.resolve(t),
1149
+ store: Dn(!0),
1150
+ sync: e.sync || !1,
1151
+ traps: ss(),
1152
+ type: e.type || "input",
1153
+ value: t
1154
+ };
1155
+ }
1156
+ function Ts(e, t) {
1157
+ var n, s;
1158
+ const r = (n = t.props) == null ? void 0 : n.id;
1159
+ if (r || (s = t.props) == null || delete s.id, e.ledger.init(e.store._n = e.props._n = e.config._n = e), e.props._emit = !1, Object.assign(
1160
+ e.props,
1161
+ r ? {} : { id: `input_${as++}` },
1162
+ t.props ?? {}
1163
+ ), e.props._emit = !0, Ls(
1164
+ e,
1165
+ /* @__PURE__ */ new Set([
1166
+ ...t.plugins || [],
1167
+ ...e.parent ? e.parent.plugins : []
1168
+ ])
1169
+ ), t.plugins)
1170
+ for (const i of t.plugins)
1171
+ Mt(e, e._c, i, !0, !1);
1172
+ return e.each((i) => e.add(i)), e.parent && e.parent.add(e, t.index), e.type === "input" && e.children.length && W(100, e), Er(e, e._c, e._value, !1), e.store.release(), r && Gn(e), e.emit("created", e), e.isCreated = !0, e;
1173
+ }
1174
+ function Ks(e) {
1175
+ return {
1176
+ __FKP: !0,
1177
+ uid: Symbol(),
1178
+ name: (e == null ? void 0 : e.name) ?? `p_${Cr++}`,
1179
+ value: (e == null ? void 0 : e.value) ?? null,
1180
+ _value: (e == null ? void 0 : e.value) ?? null,
1181
+ type: (e == null ? void 0 : e.type) ?? "input",
1182
+ props: {},
1183
+ use: () => {
1184
+ },
1185
+ input(t) {
1186
+ return this._value = t, this.value = t, Promise.resolve();
1187
+ },
1188
+ isSettled: !0
1189
+ };
1190
+ }
1191
+ function zs(e) {
1192
+ return "__FKP" in e;
1193
+ }
1194
+ function Ws(e) {
1195
+ const t = e || {}, r = qs(t), n = new Proxy(r, {
1196
+ get(...s) {
1197
+ const [, i] = s;
1198
+ if (i === "__FKNode__")
1199
+ return !0;
1200
+ const a = r.traps.get(i);
1201
+ return a && a.get ? a.get(n, r) : Reflect.get(...s);
1202
+ },
1203
+ set(...s) {
1204
+ const [, i, a] = s, l = r.traps.get(i);
1205
+ return l && l.set ? l.set(n, r, i, a) : Reflect.set(...s);
1206
+ }
1207
+ });
1208
+ return Ts(n, t);
1209
+ }
1210
+ function bt(e) {
1211
+ return typeof e != "string" && P(e, "$el");
1212
+ }
1213
+ function $t(e) {
1214
+ return typeof e != "string" && P(e, "$cmp");
1215
+ }
1216
+ function he(e) {
1217
+ return !e || typeof e == "string" ? !1 : P(e, "if") && P(e, "then");
1218
+ }
1219
+ function Hs(e) {
1220
+ return typeof e != "string" && "$formkit" in e;
1221
+ }
1222
+ function Bs(e) {
1223
+ if (typeof e == "string")
1224
+ return {
1225
+ $el: "text",
1226
+ children: e
1227
+ };
1228
+ if (Hs(e)) {
1229
+ const {
1230
+ $formkit: t,
1231
+ for: r,
1232
+ if: n,
1233
+ children: s,
1234
+ bind: i,
1235
+ ...a
1236
+ } = e;
1237
+ return Object.assign(
1238
+ {
1239
+ $cmp: "FormKit",
1240
+ props: { ...a, type: t }
1241
+ },
1242
+ n ? { if: n } : {},
1243
+ r ? { for: r } : {},
1244
+ s ? { children: s } : {},
1245
+ i ? { bind: i } : {}
1246
+ );
1247
+ }
1248
+ return e;
1249
+ }
1250
+ function Y(e) {
1251
+ let t;
1252
+ const r = /* @__PURE__ */ new Set(), n = function(m, d) {
1253
+ return typeof m == "function" ? m(d) : m;
1254
+ }, s = [
1255
+ {
1256
+ "&&": (c, m, d) => n(c, d) && n(m, d),
1257
+ "||": (c, m, d) => n(c, d) || n(m, d)
1258
+ },
1259
+ {
1260
+ "===": (c, m, d) => n(c, d) === n(m, d),
1261
+ "!==": (c, m, d) => n(c, d) !== n(m, d),
1262
+ "==": (c, m, d) => n(c, d) == n(m, d),
1263
+ "!=": (c, m, d) => n(c, d) != n(m, d),
1264
+ ">=": (c, m, d) => n(c, d) >= n(m, d),
1265
+ "<=": (c, m, d) => n(c, d) <= n(m, d),
1266
+ ">": (c, m, d) => n(c, d) > n(m, d),
1267
+ "<": (c, m, d) => n(c, d) < n(m, d)
1268
+ },
1269
+ {
1270
+ "+": (c, m, d) => n(c, d) + n(m, d),
1271
+ "-": (c, m, d) => n(c, d) - n(m, d)
1272
+ },
1273
+ {
1274
+ "*": (c, m, d) => n(c, d) * n(m, d),
1275
+ "/": (c, m, d) => n(c, d) / n(m, d),
1276
+ "%": (c, m, d) => n(c, d) % n(m, d)
1277
+ }
1278
+ ], i = s.reduce((c, m) => c.concat(Object.keys(m)), []), a = new Set(i.map((c) => c.charAt(0)));
1279
+ function l(c, m, d, _) {
1280
+ const S = c.filter(($) => $.startsWith(m));
1281
+ return S.length ? S.find(($) => _.length >= d + $.length && _.substring(d, d + $.length) === $ ? $ : !1) : !1;
1282
+ }
1283
+ function o(c, m, d = 1) {
1284
+ let _ = d ? m.substring(c + 1).trim() : m.substring(0, c).trim();
1285
+ if (!_.length)
1286
+ return -1;
1287
+ if (!d) {
1288
+ const $ = _.split("").reverse(), w = $.findIndex((u) => a.has(u));
1289
+ _ = $.slice(w).join("");
1290
+ }
1291
+ const S = _[0];
1292
+ return s.findIndex(($) => {
1293
+ const w = Object.keys($);
1294
+ return !!l(w, S, 0, _);
1295
+ });
1296
+ }
1297
+ function y(c, m) {
1298
+ let d = "";
1299
+ const _ = m.length;
1300
+ let S = 0;
1301
+ for (let $ = c; $ < _; $++) {
1302
+ const w = m.charAt($);
1303
+ if (w === "(")
1304
+ S++;
1305
+ else if (w === ")")
1306
+ S--;
1307
+ else if (S === 0 && w === " ")
1308
+ continue;
1309
+ if (S === 0 && l(i, w, $, m))
1310
+ return [d, $ - 1];
1311
+ d += w;
1312
+ }
1313
+ return [d, m.length - 1];
1314
+ }
1315
+ function v(c, m = 0) {
1316
+ const d = s[m], _ = c.length, S = Object.keys(d);
1317
+ let $ = 0, w = !1, u = null, p = "", E = null, R, j = "", M = "", f = "", k = "", C = 0;
1318
+ const V = (F, N) => {
1319
+ F ? f += N : p += N;
1320
+ };
1321
+ for (let F = 0; F < _; F++)
1322
+ if (j = M, M = c.charAt(F), (M === "'" || M === '"') && j !== "\\" && ($ === 0 && !w || $ && !k)) {
1323
+ $ ? k = M : w = M, V($, M);
1324
+ continue;
1325
+ } else if (w && (M !== w || j === "\\") || k && (M !== k || j === "\\")) {
1326
+ V($, M);
1327
+ continue;
1328
+ } else if (w === M) {
1329
+ w = !1, V($, M);
1330
+ continue;
1331
+ } else if (k === M) {
1332
+ k = !1, V($, M);
1333
+ continue;
1334
+ } else {
1335
+ if (M === " ")
1336
+ continue;
1337
+ if (M === "(")
1338
+ $ === 0 ? C = F : f += M, $++;
1339
+ else if (M === ")")
1340
+ if ($--, $ === 0) {
1341
+ const N = typeof p == "string" && p.startsWith("$") ? p : void 0, ce = N && c.charAt(F + 1) === ".";
1342
+ let Q = "";
1343
+ ce && ([Q, F] = y(F + 2, c));
1344
+ const ve = u ? m : o(C, c, 0), pe = o(F, c);
1345
+ ve === -1 && pe === -1 ? (p = h(f, -1, N, Q), typeof p == "string" && (p = f)) : u && (ve >= pe || pe === -1) && m === ve ? (E = u.bind(null, h(f, -1, N, Q)), u = null, p = "") : pe > ve && m === pe ? p = h(f, -1, N, Q) : p += `(${f})${ce ? `.${Q}` : ""}`, f = "";
1346
+ } else
1347
+ f += M;
1348
+ else if ($ === 0 && (R = l(S, M, F, c))) {
1349
+ F === 0 && W(103, [R, c]), F += R.length - 1, F === c.length - 1 && W(104, [R, c]), u ? p && (E = u.bind(null, h(p, m)), u = d[R].bind(null, E), p = "") : E ? (u = d[R].bind(null, h(E, m)), E = null) : (u = d[R].bind(null, h(p, m)), p = "");
1350
+ continue;
1351
+ } else
1352
+ V($, M);
1353
+ }
1354
+ return p && u && (u = u.bind(null, h(p, m))), u = !u && E ? E : u, !u && p && (u = (F, N) => typeof F == "function" ? F(N) : F, u = u.bind(null, h(p, m))), !u && !p && W(105, c), u;
1355
+ }
1356
+ function h(c, m, d, _) {
1357
+ if (d) {
1358
+ const S = h(d, s.length);
1359
+ let $, w = _ ? Y(`$${_}`) : !1;
1360
+ if (typeof S == "function") {
1361
+ const u = On(String(c)).map(
1362
+ (p) => h(p, -1)
1363
+ );
1364
+ return (p) => {
1365
+ const E = S(p);
1366
+ return typeof E != "function" ? (ye(150, d), E) : ($ = E(
1367
+ ...u.map(
1368
+ (R) => typeof R == "function" ? R(p) : R
1369
+ )
1370
+ ), w && (w = w.provide((R) => {
1371
+ const j = t(R);
1372
+ return R.reduce(
1373
+ (f, k) => {
1374
+ if (k === _ || (_ == null ? void 0 : _.startsWith(`${k}(`))) {
1375
+ const V = In($, k);
1376
+ f[k] = () => V;
1377
+ } else
1378
+ f[k] = j[k];
1379
+ return f;
1380
+ },
1381
+ {}
1382
+ );
1383
+ })), w ? w() : $);
1384
+ };
1385
+ }
1386
+ } else if (typeof c == "string") {
1387
+ if (c === "true")
1388
+ return !0;
1389
+ if (c === "false")
1390
+ return !1;
1391
+ if (c === "undefined")
1392
+ return;
1393
+ if (Pn(c))
1394
+ return En(c.substring(1, c.length - 1));
1395
+ if (!isNaN(+c))
1396
+ return Number(c);
1397
+ if (m < s.length - 1)
1398
+ return v(c, m + 1);
1399
+ if (c.startsWith("$")) {
1400
+ const S = c.substring(1);
1401
+ return r.add(S), function(w) {
1402
+ return S in w ? w[S]() : void 0;
1403
+ };
1404
+ }
1405
+ return c;
1406
+ }
1407
+ return c;
1408
+ }
1409
+ const O = v(
1410
+ e.startsWith("$:") ? e.substring(2) : e
1411
+ ), g = Array.from(r);
1412
+ function b(c) {
1413
+ return t = c, Object.assign(
1414
+ // @ts-ignore - @rollup/plugin-typescript doesn't like this
1415
+ O.bind(null, c(g)),
1416
+ { provide: b }
1417
+ );
1418
+ }
1419
+ return Object.assign(O, {
1420
+ provide: b
1421
+ });
1422
+ }
1423
+ function He(e, t, r) {
1424
+ return r ? typeof r == "string" ? r.split(" ").reduce(
1425
+ (s, i) => Object.assign(s, { [i]: !0 }),
1426
+ {}
1427
+ ) : typeof r == "function" ? He(
1428
+ e,
1429
+ t,
1430
+ r(t, e)
1431
+ ) : r : {};
1432
+ }
1433
+ function Us(e, t, ...r) {
1434
+ const n = r.reduce((s, i) => {
1435
+ if (!i)
1436
+ return at(s);
1437
+ const { $reset: a, ...l } = i;
1438
+ return at(a ? l : Object.assign(s, l));
1439
+ }, {});
1440
+ return Object.keys(
1441
+ e.hook.classes.dispatch({ property: t, classes: n }).classes
1442
+ ).filter((s) => n[s]).join(" ") || null;
1443
+ }
1444
+ function at(e) {
1445
+ const t = "$remove:";
1446
+ let r = !1;
1447
+ const n = Object.keys(e).filter((s) => (e[s] && s.startsWith(t) && (r = !0), e[s]));
1448
+ return n.length > 1 && r && n.filter((i) => i.startsWith(t)).map((i) => {
1449
+ const a = i.substring(t.length);
1450
+ e[a] = !1, e[i] = !1;
1451
+ }), e;
1452
+ }
1453
+ function Zs(e, t, r) {
1454
+ const n = Ve(e);
1455
+ n ? n.setErrors(t, r) : ye(651, e);
1456
+ }
1457
+ function Ys(e, t = !0) {
1458
+ const r = Ve(e);
1459
+ r ? r.clearErrors(t) : ye(652, e);
1460
+ }
1461
+ var Ye = "1.6.9", xr = /* @__PURE__ */ new WeakSet();
1462
+ function st(e, t) {
1463
+ const r = t || Object.assign(/* @__PURE__ */ new Map(), { active: !1 }), n = /* @__PURE__ */ new Map(), s = function(v) {
1464
+ var h;
1465
+ r.active && (r.has(e) || r.set(e, /* @__PURE__ */ new Set()), (h = r.get(e)) == null || h.add(v));
1466
+ }, i = function(v) {
1467
+ return new Proxy(v, {
1468
+ get(...h) {
1469
+ return typeof h[1] == "string" && s(`prop:${h[1]}`), Reflect.get(...h);
1470
+ }
1471
+ });
1472
+ }, a = function(v) {
1473
+ return new Proxy(v, {
1474
+ get(...h) {
1475
+ return h[1] === "value" ? (O) => (s(`count:${O}`), v.value(O)) : Reflect.get(...h);
1476
+ }
1477
+ });
1478
+ }, l = function(v, h) {
1479
+ return Ne(v) ? st(v, r) : (h === "value" && s("commit"), h === "_value" && s("input"), h === "props" ? i(v) : h === "ledger" ? a(v) : (h === "children" && (s("child"), s("childRemoved")), v));
1480
+ }, {
1481
+ proxy: o,
1482
+ revoke: y
1483
+ } = Proxy.revocable(e, {
1484
+ get(...v) {
1485
+ switch (v[1]) {
1486
+ case "_node":
1487
+ return e;
1488
+ case "deps":
1489
+ return r;
1490
+ case "watch":
1491
+ return (O, g, b) => Fr(o, O, g, b);
1492
+ case "observe":
1493
+ return () => {
1494
+ const O = new Map(r);
1495
+ return r.clear(), r.active = !0, O;
1496
+ };
1497
+ case "stopObserve":
1498
+ return () => {
1499
+ const O = new Map(r);
1500
+ return r.active = !1, O;
1501
+ };
1502
+ case "receipts":
1503
+ return n;
1504
+ case "kill":
1505
+ return () => {
1506
+ jr(n), xr.add(v[2]), y();
1507
+ };
1508
+ }
1509
+ const h = Reflect.get(...v);
1510
+ return typeof h == "function" ? (...O) => {
1511
+ const g = h(...O);
1512
+ return l(g, v[1]);
1513
+ } : l(h, v[1]);
1514
+ }
1515
+ });
1516
+ return o;
1517
+ }
1518
+ function Rr(e, [t, r], n, s) {
1519
+ t.forEach((i, a) => {
1520
+ i.forEach((l) => {
1521
+ e.receipts.has(a) || e.receipts.set(a, {});
1522
+ const o = e.receipts.get(a) ?? {};
1523
+ o[l] = o[l] ?? [], o[l].push(a.on(l, n, s)), e.receipts.set(a, o);
1524
+ });
1525
+ }), r.forEach((i, a) => {
1526
+ i.forEach((l) => {
1527
+ if (e.receipts.has(a)) {
1528
+ const o = e.receipts.get(a);
1529
+ o && P(o, l) && (o[l].map(a.off), delete o[l], e.receipts.set(a, o));
1530
+ }
1531
+ });
1532
+ });
1533
+ }
1534
+ function jr(e) {
1535
+ e.forEach((t, r) => {
1536
+ for (const n in t)
1537
+ t[n].map(r.off);
1538
+ }), e.clear();
1539
+ }
1540
+ function Fr(e, t, r, n) {
1541
+ const s = (l) => {
1542
+ const o = e.stopObserve();
1543
+ Rr(
1544
+ e,
1545
+ Vr(i, o),
1546
+ () => Fr(e, t, r, n),
1547
+ n
1548
+ ), r && r(l);
1549
+ }, i = new Map(e.deps);
1550
+ e.observe();
1551
+ const a = t(e);
1552
+ a instanceof Promise ? a.then((l) => s(l)) : s(a);
1553
+ }
1554
+ function Vr(e, t) {
1555
+ const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1556
+ return t.forEach((s, i) => {
1557
+ if (!e.has(i))
1558
+ r.set(i, s);
1559
+ else {
1560
+ const a = /* @__PURE__ */ new Set(), l = e.get(i);
1561
+ s.forEach(
1562
+ (o) => !(l != null && l.has(o)) && a.add(o)
1563
+ ), r.set(i, a);
1564
+ }
1565
+ }), e.forEach((s, i) => {
1566
+ if (!t.has(i))
1567
+ n.set(i, s);
1568
+ else {
1569
+ const a = /* @__PURE__ */ new Set(), l = t.get(i);
1570
+ s.forEach(
1571
+ (o) => !(l != null && l.has(o)) && a.add(o)
1572
+ ), n.set(i, a);
1573
+ }
1574
+ }), [r, n];
1575
+ }
1576
+ function xt(e) {
1577
+ return xr.has(e);
1578
+ }
1579
+ var Nr = function({ value: t }) {
1580
+ return ["yes", "on", "1", 1, !0, "true"].includes(t);
1581
+ };
1582
+ Nr.skipEmpty = !1;
1583
+ var Gs = Nr, Js = function({ value: e }, t = !1) {
1584
+ const r = Date.parse(t || /* @__PURE__ */ new Date()), n = Date.parse(String(e));
1585
+ return isNaN(n) ? !1 : n > r;
1586
+ }, Qs = Js, Xs = function({ value: e }, t = !1) {
1587
+ const r = Date.parse(t || /* @__PURE__ */ new Date()), n = Date.parse(String(e));
1588
+ return isNaN(n) ? !1 : n > r || n === r;
1589
+ }, ei = Xs, ti = function(e, t) {
1590
+ var s;
1591
+ if (!t)
1592
+ return !1;
1593
+ const r = Date.parse(String(e.value)), n = Date.parse(String((s = e.at(t)) == null ? void 0 : s.value));
1594
+ return isNaN(n) ? !0 : isNaN(r) ? !1 : r > n;
1595
+ }, ri = ti, ni = function({ value: e }, t = "default") {
1596
+ const r = {
1597
+ default: new RegExp("^\\p{L}+$", "u"),
1598
+ latin: /^[a-z]+$/i
1599
+ }, n = P(r, t) ? t : "default";
1600
+ return r[n].test(String(e));
1601
+ }, si = ni, ii = function({ value: e }, t = "default") {
1602
+ const r = {
1603
+ default: /^[\p{L} ]+$/u,
1604
+ latin: /^[a-z ]+$/i
1605
+ }, n = P(r, t) ? t : "default";
1606
+ return r[n].test(String(e));
1607
+ }, ai = ii, li = function({ value: e }, t = "default") {
1608
+ const r = {
1609
+ default: /^[0-9\p{L}]+$/u,
1610
+ latin: /^[0-9a-z]+$/i
1611
+ }, n = P(r, t) ? t : "default";
1612
+ return r[n].test(String(e));
1613
+ }, oi = li, ui = function({ value: e }, t = !1) {
1614
+ const r = Date.parse(t || /* @__PURE__ */ new Date()), n = Date.parse(String(e));
1615
+ return isNaN(n) ? !1 : n < r;
1616
+ }, fi = ui, ci = function(e, t) {
1617
+ var s;
1618
+ if (!t)
1619
+ return !1;
1620
+ const r = Date.parse(String(e.value)), n = Date.parse(String((s = e.at(t)) == null ? void 0 : s.value));
1621
+ return isNaN(n) ? !0 : isNaN(r) ? !1 : r < n;
1622
+ }, pi = ci, mi = function({ value: e }, t = !1) {
1623
+ const r = Date.parse(t || /* @__PURE__ */ new Date()), n = Date.parse(String(e));
1624
+ return isNaN(n) ? !1 : n < r || n === r;
1625
+ }, di = mi, yi = function({ value: t }, r, n) {
1626
+ if (!isNaN(t) && !isNaN(r) && !isNaN(n)) {
1627
+ const s = 1 * t;
1628
+ r = Number(r), n = Number(n);
1629
+ const [i, a] = r <= n ? [r, n] : [n, r];
1630
+ return s >= 1 * i && s <= 1 * a;
1631
+ }
1632
+ return !1;
1633
+ }, vi = yi, Wt = /(_confirm(?:ed)?)$/, gi = function(t, r, n = "loose") {
1634
+ var i;
1635
+ r || (r = Wt.test(t.name) ? t.name.replace(Wt, "") : `${t.name}_confirm`);
1636
+ const s = (i = t.at(r)) == null ? void 0 : i.value;
1637
+ return n === "strict" ? t.value === s : t.value == s;
1638
+ }, hi = gi, bi = function({ value: e }, t = "default") {
1639
+ const r = {
1640
+ default: new RegExp("\\p{L}", "u"),
1641
+ latin: /[a-z]/i
1642
+ }, n = P(r, t) ? t : "default";
1643
+ return r[n].test(String(e));
1644
+ }, $i = bi, _i = function({ value: e }, t = "default") {
1645
+ const r = {
1646
+ default: /[\p{L} ]/u,
1647
+ latin: /[a-z ]/i
1648
+ }, n = P(r, t) ? t : "default";
1649
+ return r[n].test(String(e));
1650
+ }, wi = _i, ki = function({ value: e }, t = "default") {
1651
+ const r = {
1652
+ default: /[0-9\p{L}]/u,
1653
+ latin: /[0-9a-z]/i
1654
+ }, n = P(r, t) ? t : "default";
1655
+ return r[n].test(String(e));
1656
+ }, Si = ki, Ai = function({ value: e }, t = "default") {
1657
+ const r = {
1658
+ default: new RegExp("\\p{Ll}", "u"),
1659
+ latin: /[a-z]/
1660
+ }, n = P(r, t) ? t : "default";
1661
+ return r[n].test(String(e));
1662
+ }, Ci = Ai, Pi = function({ value: t }) {
1663
+ return /[0-9]/.test(String(t));
1664
+ }, Ei = Pi, Oi = function({ value: e }) {
1665
+ return /[!-/:-@[-`{-~]/.test(String(e));
1666
+ }, Ii = Oi, Mi = function({ value: e }, t = "default") {
1667
+ const r = {
1668
+ default: new RegExp("\\p{Lu}", "u"),
1669
+ latin: /[A-Z]/
1670
+ }, n = P(r, t) ? t : "default";
1671
+ return r[n].test(String(e));
1672
+ }, xi = Mi, Ri = function({ value: t }, r, n) {
1673
+ r = r instanceof Date ? r.getTime() : Date.parse(r), n = n instanceof Date ? n.getTime() : Date.parse(n);
1674
+ const s = t instanceof Date ? t.getTime() : Date.parse(String(t));
1675
+ if (r && !n)
1676
+ n = r, r = Date.now();
1677
+ else if (!r || !s)
1678
+ return !1;
1679
+ return s >= r && s <= n;
1680
+ }, ji = Ri, Fi = function({ value: t }, r) {
1681
+ return r && typeof r == "string" ? Cn(r).test(String(t)) : !isNaN(Date.parse(String(t)));
1682
+ }, Vi = Fi, Ni = function({ value: t }) {
1683
+ return /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(String(t));
1684
+ }, Di = Ni, Li = function({ value: t }, ...r) {
1685
+ return typeof t == "string" && r.length ? r.some((n) => t.endsWith(n)) : typeof t == "string" && r.length === 0;
1686
+ }, qi = Li, Ti = function({ value: t }, ...r) {
1687
+ return r.some((n) => typeof n == "object" ? T(n, t) : n == t);
1688
+ }, Ki = Ti, zi = function({ value: t }, r = 0, n = 1 / 0) {
1689
+ r = parseInt(r), n = isNaN(parseInt(n)) ? 1 / 0 : parseInt(n);
1690
+ const s = r <= n ? r : n, i = n >= r ? n : r;
1691
+ if (typeof t == "string" || Array.isArray(t))
1692
+ return t.length >= s && t.length <= i;
1693
+ if (t && typeof t == "object") {
1694
+ const a = Object.keys(t).length;
1695
+ return a >= s && a <= i;
1696
+ }
1697
+ return !1;
1698
+ }, Wi = zi, Hi = function({ value: e }, t = "default") {
1699
+ const r = {
1700
+ default: new RegExp("^\\p{Ll}+$", "u"),
1701
+ allow_non_alpha: /^[0-9\p{Ll}!-/:-@[-`{-~]+$/u,
1702
+ allow_numeric: /^[0-9\p{Ll}]+$/u,
1703
+ allow_numeric_dashes: /^[0-9\p{Ll}-]+$/u,
1704
+ latin: /^[a-z]+$/
1705
+ }, n = P(r, t) ? t : "default";
1706
+ return r[n].test(String(e));
1707
+ }, Bi = Hi, Ui = function({ value: t }, ...r) {
1708
+ return r.some((n) => (typeof n == "string" && n.substr(0, 1) === "/" && n.substr(-1) === "/" && (n = new RegExp(n.substr(1, n.length - 2))), n instanceof RegExp ? n.test(String(t)) : n === t));
1709
+ }, Zi = Ui, Yi = function({ value: t }, r = 10) {
1710
+ return Array.isArray(t) ? t.length <= r : Number(t) <= Number(r);
1711
+ }, Gi = Yi, Ji = function({ value: t }, r = 1) {
1712
+ return Array.isArray(t) ? t.length >= r : Number(t) >= Number(r);
1713
+ }, Qi = Ji, Xi = function({ value: t }, ...r) {
1714
+ return !r.some((n) => typeof n == "object" ? T(n, t) : n === t);
1715
+ }, ea = Xi, ta = function({ value: t }) {
1716
+ return !isNaN(t);
1717
+ }, ra = ta, Dr = function(e, ...t) {
1718
+ return Z(e.value) ? t.map((n) => {
1719
+ var s;
1720
+ return (s = e.at(n)) == null ? void 0 : s.value;
1721
+ }).some((n) => !Z(n)) : !0;
1722
+ };
1723
+ Dr.skipEmpty = !1;
1724
+ var na = Dr, Lr = function({ value: t }, r = "default") {
1725
+ return r === "trim" && typeof t == "string" ? !Z(t.trim()) : !Z(t);
1726
+ };
1727
+ Lr.skipEmpty = !1;
1728
+ var sa = Lr, ia = function({ value: t }, ...r) {
1729
+ return typeof t == "string" && r.length ? r.some((n) => t.startsWith(n)) : typeof t == "string" && r.length === 0;
1730
+ }, aa = ia, la = function({ value: e }) {
1731
+ return /^[!-/:-@[-`{-~]+$/.test(String(e));
1732
+ }, oa = la, ua = function({ value: e }, t = "default") {
1733
+ const r = {
1734
+ default: new RegExp("^\\p{Lu}+$", "u"),
1735
+ latin: /^[A-Z]+$/
1736
+ }, n = P(r, t) ? t : "default";
1737
+ return r[n].test(String(e));
1738
+ }, fa = ua, ca = function({ value: t }, ...r) {
1739
+ try {
1740
+ const n = r.length ? r : ["http:", "https:"], s = new URL(String(t));
1741
+ return n.includes(s.protocol);
1742
+ } catch {
1743
+ return !1;
1744
+ }
1745
+ }, pa = ca;
1746
+ const ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1747
+ __proto__: null,
1748
+ accepted: Gs,
1749
+ alpha: si,
1750
+ alpha_spaces: ai,
1751
+ alphanumeric: oi,
1752
+ between: vi,
1753
+ confirm: hi,
1754
+ contains_alpha: $i,
1755
+ contains_alpha_spaces: wi,
1756
+ contains_alphanumeric: Si,
1757
+ contains_lowercase: Ci,
1758
+ contains_numeric: Ei,
1759
+ contains_symbol: Ii,
1760
+ contains_uppercase: xi,
1761
+ date_after: Qs,
1762
+ date_after_node: ri,
1763
+ date_after_or_equal: ei,
1764
+ date_before: fi,
1765
+ date_before_node: pi,
1766
+ date_before_or_equal: di,
1767
+ date_between: ji,
1768
+ date_format: Vi,
1769
+ email: Di,
1770
+ ends_with: qi,
1771
+ is: Ki,
1772
+ length: Wi,
1773
+ lowercase: Bi,
1774
+ matches: Zi,
1775
+ max: Gi,
1776
+ min: Qi,
1777
+ not: ea,
1778
+ number: ra,
1779
+ require_one: na,
1780
+ required: sa,
1781
+ starts_with: aa,
1782
+ symbol: oa,
1783
+ uppercase: fa,
1784
+ url: pa
1785
+ }, Symbol.toStringTag, { value: "Module" }));
1786
+ var _t = /* @__PURE__ */ H({
1787
+ type: "state",
1788
+ blocking: !0,
1789
+ visible: !1,
1790
+ value: !0,
1791
+ key: "validating"
1792
+ });
1793
+ function da(e = {}) {
1794
+ return function(r) {
1795
+ let n = U(r.props.validationRules || {}), s = { ...e, ...n };
1796
+ const i = { input: Ee(), rerun: null, isPassing: !0 };
1797
+ let a = U(r.props.validation);
1798
+ r.on("prop:validation", ({ payload: o }) => l(o, n)), r.on(
1799
+ "prop:validationRules",
1800
+ ({ payload: o }) => l(a, o)
1801
+ );
1802
+ function l(o, y) {
1803
+ var v;
1804
+ T(Object.keys(n || {}), Object.keys(y || {})) && T(a, o) || (n = U(y), a = U(o), s = { ...e, ...n }, (v = r.props.parsedRules) == null || v.forEach((h) => {
1805
+ qr(h), jr(h.observer.receipts), h.observer.kill();
1806
+ }), r.store.filter(() => !1, "validation"), r.props.parsedRules = Bt(o, s, r), i.isPassing = !0, wt(r, r.props.parsedRules, i));
1807
+ }
1808
+ r.props.parsedRules = Bt(a, s, r), wt(r, r.props.parsedRules, i);
1809
+ };
1810
+ }
1811
+ function wt(e, t, r) {
1812
+ xt(e) || (r.input = Ee(), e.store.set(
1813
+ /* @__PURE__ */ H({
1814
+ key: "failing",
1815
+ value: !r.isPassing,
1816
+ visible: !1
1817
+ })
1818
+ ), r.isPassing = !0, e.store.filter((n) => !n.meta.removeImmediately, "validation"), t.forEach(
1819
+ (n) => n.debounce && clearTimeout(n.timer)
1820
+ ), t.length && (e.store.set(_t), kt(0, t, r, !1, () => {
1821
+ e.store.remove(_t.key), e.store.set(
1822
+ /* @__PURE__ */ H({
1823
+ key: "failing",
1824
+ value: !r.isPassing,
1825
+ visible: !1
1826
+ })
1827
+ );
1828
+ })));
1829
+ }
1830
+ function kt(e, t, r, n, s) {
1831
+ const i = t[e];
1832
+ if (!i)
1833
+ return s();
1834
+ const a = i.observer;
1835
+ if (xt(a))
1836
+ return;
1837
+ const l = r.input;
1838
+ i.state = null;
1839
+ function o(y, v) {
1840
+ if (r.input !== l)
1841
+ return;
1842
+ r.isPassing = r.isPassing && !!v, i.queued = !1;
1843
+ const h = a.stopObserve(), O = Vr(i.deps, h);
1844
+ if (Rr(
1845
+ a,
1846
+ O,
1847
+ function() {
1848
+ try {
1849
+ a.store.set(_t);
1850
+ } catch {
1851
+ }
1852
+ i.queued = !0, r.rerun && clearTimeout(r.rerun), r.rerun = setTimeout(
1853
+ wt,
1854
+ 0,
1855
+ a,
1856
+ t,
1857
+ r
1858
+ );
1859
+ },
1860
+ "unshift"
1861
+ // We want these listeners to run before other events are emitted so the 'state.validating' will be reliable.
1862
+ ), i.deps = h, i.state = v, v === !1 ? va(i, n || y) : qr(i), t.length > e + 1) {
1863
+ const g = t[e + 1];
1864
+ (v || g.force || !g.skipEmpty) && g.state === null && (g.queued = !0), kt(e + 1, t, r, n || y, s);
1865
+ } else
1866
+ s();
1867
+ }
1868
+ (!Z(a.value) || !i.skipEmpty) && (r.isPassing || i.force) ? i.queued ? ya(i, a, (y) => {
1869
+ y instanceof Promise ? y.then((v) => o(!0, v)) : o(!1, y);
1870
+ }) : kt(e + 1, t, r, n, s) : Z(a.value) && i.skipEmpty && r.isPassing ? (a.observe(), a.value, o(!1, r.isPassing)) : o(!1, null);
1871
+ }
1872
+ function ya(e, t, r) {
1873
+ e.debounce ? e.timer = setTimeout(() => {
1874
+ t.observe(), r(e.rule(t, ...e.args));
1875
+ }, e.debounce) : (t.observe(), r(e.rule(t, ...e.args)));
1876
+ }
1877
+ function qr(e) {
1878
+ const t = `rule_${e.name}`;
1879
+ e.messageObserver && (e.messageObserver = e.messageObserver.kill()), P(e.observer.store, t) && e.observer.store.remove(t);
1880
+ }
1881
+ function va(e, t) {
1882
+ const r = e.observer;
1883
+ xt(r) || (e.messageObserver || (e.messageObserver = st(r._node)), e.messageObserver.watch(
1884
+ (n) => ha(
1885
+ n,
1886
+ e
1887
+ ),
1888
+ (n) => {
1889
+ const s = ga(r, e, n), i = /* @__PURE__ */ H({
1890
+ blocking: e.blocking,
1891
+ key: `rule_${e.name}`,
1892
+ meta: {
1893
+ /**
1894
+ * Use this key instead of the message root key to produce i18n validation
1895
+ * messages.
1896
+ */
1897
+ messageKey: e.name,
1898
+ /**
1899
+ * For messages that were created *by or after* a debounced or async
1900
+ * validation rule — we make note of it so we can immediately remove them
1901
+ * as soon as the next commit happens.
1902
+ */
1903
+ removeImmediately: t,
1904
+ /**
1905
+ * Determines if this message should be passed to localization.
1906
+ */
1907
+ localize: !s,
1908
+ /**
1909
+ * The arguments that will be passed to the validation rules
1910
+ */
1911
+ i18nArgs: n
1912
+ },
1913
+ type: "validation",
1914
+ value: s || "This field is not valid."
1915
+ });
1916
+ r.store.set(i);
1917
+ }
1918
+ ));
1919
+ }
1920
+ function ga(e, t, r) {
1921
+ const n = e.props.validationMessages && P(e.props.validationMessages, t.name) ? e.props.validationMessages[t.name] : void 0;
1922
+ return typeof n == "function" ? n(...r) : n;
1923
+ }
1924
+ function ha(e, t) {
1925
+ return [
1926
+ {
1927
+ node: e,
1928
+ name: Tr(e),
1929
+ args: t.args
1930
+ }
1931
+ ];
1932
+ }
1933
+ function Tr(e) {
1934
+ return typeof e.props.validationLabel == "function" ? e.props.validationLabel(e) : e.props.validationLabel || e.props.label || e.props.name || String(e.name);
1935
+ }
1936
+ var Kr = "(?:[\\*+?()0-9]+)", zr = "[a-zA-Z][a-zA-Z0-9_]+", ba = new RegExp(
1937
+ `^(${Kr}?${zr})(?:\\:(.*)+)?$`,
1938
+ "i"
1939
+ ), $a = new RegExp(`^(${Kr})(${zr})$`, "i"), _a = /([\*+?]+)?(\(\d+\))([\*+?]+)?/, Ht = /\(\d+\)/, wa = {
1940
+ blocking: !0,
1941
+ debounce: 0,
1942
+ force: !1,
1943
+ skipEmpty: !0,
1944
+ name: ""
1945
+ };
1946
+ function Bt(e, t, r) {
1947
+ return e ? (typeof e == "string" ? ka(e) : Ae(e)).reduce((s, i) => {
1948
+ let a = i.shift();
1949
+ const l = {};
1950
+ if (typeof a == "string") {
1951
+ const [o, y] = Aa(a);
1952
+ P(t, o) && (a = t[o], Object.assign(l, y));
1953
+ }
1954
+ return typeof a == "function" && s.push({
1955
+ observer: st(r),
1956
+ rule: a,
1957
+ args: i,
1958
+ timer: 0,
1959
+ state: null,
1960
+ queued: !0,
1961
+ deps: /* @__PURE__ */ new Map(),
1962
+ ...wa,
1963
+ ...Ca(l, a)
1964
+ }), s;
1965
+ }, []) : [];
1966
+ }
1967
+ function ka(e) {
1968
+ return e.split("|").reduce((t, r) => {
1969
+ const n = Sa(r);
1970
+ return n && t.push(n), t;
1971
+ }, []);
1972
+ }
1973
+ function Sa(e) {
1974
+ const t = e.trim();
1975
+ if (t) {
1976
+ const r = t.match(ba);
1977
+ if (r && typeof r[1] == "string") {
1978
+ const n = r[1].trim(), s = r[2] && typeof r[2] == "string" ? r[2].split(",").map((i) => i.trim()) : [];
1979
+ return [n, ...s];
1980
+ }
1981
+ }
1982
+ return !1;
1983
+ }
1984
+ function Aa(e) {
1985
+ const t = e.match($a);
1986
+ if (!t)
1987
+ return [e, { name: e }];
1988
+ const r = {
1989
+ "*": { force: !0 },
1990
+ "+": { skipEmpty: !1 },
1991
+ "?": { blocking: !1 }
1992
+ }, [, n, s] = t, i = Ht.test(n) ? n.match(_a) || [] : [, n];
1993
+ return [
1994
+ s,
1995
+ [i[1], i[2], i[3]].reduce(
1996
+ (a, l) => (l && (Ht.test(l) ? a.debounce = parseInt(l.substr(1, l.length - 1)) : l.split("").forEach(
1997
+ (o) => P(r, o) && Object.assign(a, r[o])
1998
+ )), a),
1999
+ { name: s }
2000
+ )
2001
+ ];
2002
+ }
2003
+ function Ca(e, t) {
2004
+ return e.name || (e.name = t.ruleName || t.name), ["skipEmpty", "force", "debounce", "blocking"].reduce(
2005
+ (r, n) => (P(t, n) && !P(r, n) && Object.assign(r, {
2006
+ [n]: t[n]
2007
+ }), r),
2008
+ e
2009
+ );
2010
+ }
2011
+ function I(e) {
2012
+ return e[0].toUpperCase() + e.substr(1);
2013
+ }
2014
+ function Ut(e, t = "or") {
2015
+ return e.reduce((r, n, s) => (r += n, s <= e.length - 2 && e.length > 2 && (r += ", "), s === e.length - 2 && (r += `${e.length === 2 ? " " : ""}${t} `), r), "");
2016
+ }
2017
+ function Ke(e) {
2018
+ const t = typeof e == "string" ? new Date(Date.parse(e)) : e;
2019
+ return t instanceof Date ? new Intl.DateTimeFormat(void 0, {
2020
+ dateStyle: "medium",
2021
+ timeZone: "UTC"
2022
+ }).format(t) : "(unknown)";
2023
+ }
2024
+ function Pa(e, t) {
2025
+ return Number(e) >= Number(t) ? [t, e] : [e, t];
2026
+ }
2027
+ var Ea = {
2028
+ /**
2029
+ * Shown on a button for adding additional items.
2030
+ */
2031
+ add: "Add",
2032
+ /**
2033
+ * Shown when a button to remove items is visible.
2034
+ */
2035
+ remove: "Remove",
2036
+ /**
2037
+ * Shown when there are multiple items to remove at the same time.
2038
+ */
2039
+ removeAll: "Remove all",
2040
+ /**
2041
+ * Shown when all fields are not filled out correctly.
2042
+ */
2043
+ incomplete: "Sorry, not all fields are filled out correctly.",
2044
+ /**
2045
+ * Shown in a button inside a form to submit the form.
2046
+ */
2047
+ submit: "Submit",
2048
+ /**
2049
+ * Shown when no files are selected.
2050
+ */
2051
+ noFiles: "No file chosen",
2052
+ /**
2053
+ * Shown on buttons that move fields up in a list.
2054
+ */
2055
+ moveUp: "Move up",
2056
+ /**
2057
+ * Shown on buttons that move fields down in a list.
2058
+ */
2059
+ moveDown: "Move down",
2060
+ /**
2061
+ * Shown when something is actively loading.
2062
+ */
2063
+ isLoading: "Loading...",
2064
+ /**
2065
+ * Shown when there is more to load.
2066
+ */
2067
+ loadMore: "Load more",
2068
+ /**
2069
+ * Show on buttons that navigate state forward
2070
+ */
2071
+ next: "Next",
2072
+ /**
2073
+ * Show on buttons that navigate state backward
2074
+ */
2075
+ prev: "Previous",
2076
+ /**
2077
+ * Shown when adding all values.
2078
+ */
2079
+ addAllValues: "Add all values",
2080
+ /**
2081
+ * Shown when adding selected values.
2082
+ */
2083
+ addSelectedValues: "Add selected values",
2084
+ /**
2085
+ * Shown when removing all values.
2086
+ */
2087
+ removeAllValues: "Remove all values",
2088
+ /**
2089
+ * Shown when removing selected values.
2090
+ */
2091
+ removeSelectedValues: "Remove selected values",
2092
+ /**
2093
+ * Shown when there is a date to choose.
2094
+ */
2095
+ chooseDate: "Choose date",
2096
+ /**
2097
+ * Shown when there is a date to change.
2098
+ */
2099
+ changeDate: "Change date",
2100
+ /**
2101
+ * Shown above error summaries when someone attempts to submit a form with
2102
+ * errors and the developer has implemented `<FormKitSummary />`.
2103
+ */
2104
+ summaryHeader: "There were errors in your form.",
2105
+ /*
2106
+ * Shown when there is something to close
2107
+ */
2108
+ close: "Close",
2109
+ /**
2110
+ * Shown when there is something to open.
2111
+ */
2112
+ open: "Open"
2113
+ }, Oa = {
2114
+ /**
2115
+ * The value is not an accepted value.
2116
+ * @see {@link https://formkit.com/essentials/validation#accepted}
2117
+ */
2118
+ accepted({ name: e }) {
2119
+ return `Please accept the ${e}.`;
2120
+ },
2121
+ /**
2122
+ * The date is not after
2123
+ * @see {@link https://formkit.com/essentials/validation#date-after}
2124
+ */
2125
+ date_after({ name: e, args: t }) {
2126
+ return Array.isArray(t) && t.length ? `${I(e)} must be after ${Ke(t[0])}.` : `${I(e)} must be in the future.`;
2127
+ },
2128
+ /**
2129
+ * The value is not a letter.
2130
+ * @see {@link https://formkit.com/essentials/validation#alpha}
2131
+ */
2132
+ alpha({ name: e }) {
2133
+ return `${I(e)} can only contain alphabetical characters.`;
2134
+ },
2135
+ /**
2136
+ * The value is not alphanumeric
2137
+ * @see {@link https://formkit.com/essentials/validation#alphanumeric}
2138
+ */
2139
+ alphanumeric({ name: e }) {
2140
+ return `${I(e)} can only contain letters and numbers.`;
2141
+ },
2142
+ /**
2143
+ * The value is not letter and/or spaces
2144
+ * @see {@link https://formkit.com/essentials/validation#alpha-spaces}
2145
+ */
2146
+ alpha_spaces({ name: e }) {
2147
+ return `${I(e)} can only contain letters and spaces.`;
2148
+ },
2149
+ /**
2150
+ * The value have no letter.
2151
+ * @see {@link https://formkit.com/essentials/validation#contains_alpha}
2152
+ */
2153
+ contains_alpha({ name: e }) {
2154
+ return `${I(e)} must contain alphabetical characters.`;
2155
+ },
2156
+ /**
2157
+ * The value have no alphanumeric
2158
+ * @see {@link https://formkit.com/essentials/validation#contains_alphanumeric}
2159
+ */
2160
+ contains_alphanumeric({ name: e }) {
2161
+ return `${I(e)} must contain letters or numbers.`;
2162
+ },
2163
+ /**
2164
+ * The value have no letter and/or spaces
2165
+ * @see {@link https://formkit.com/essentials/validation#contains_alpha-spaces}
2166
+ */
2167
+ contains_alpha_spaces({ name: e }) {
2168
+ return `${I(e)} must contain letters or spaces.`;
2169
+ },
2170
+ /**
2171
+ * The value have no symbol
2172
+ * @see {@link https://formkit.com/essentials/validation#contains_symbol}
2173
+ */
2174
+ contains_symbol({ name: e }) {
2175
+ return `${I(e)} must contain a symbol.`;
2176
+ },
2177
+ /**
2178
+ * The value have no uppercase
2179
+ * @see {@link https://formkit.com/essentials/validation#contains_uppercase}
2180
+ */
2181
+ contains_uppercase({ name: e }) {
2182
+ return `${I(e)} must contain an uppercase letter.`;
2183
+ },
2184
+ /**
2185
+ * The value have no lowercase
2186
+ * @see {@link https://formkit.com/essentials/validation#contains_lowercase}
2187
+ */
2188
+ contains_lowercase({ name: e }) {
2189
+ return `${I(e)} must contain a lowercase letter.`;
2190
+ },
2191
+ /**
2192
+ * The value have no numeric
2193
+ * @see {@link https://formkit.com/essentials/validation#contains_numeric}
2194
+ */
2195
+ contains_numeric({ name: e }) {
2196
+ return `${I(e)} must contain numbers.`;
2197
+ },
2198
+ /**
2199
+ * The value is not symbol
2200
+ * @see {@link https://formkit.com/essentials/validation#symbol}
2201
+ */
2202
+ symbol({ name: e }) {
2203
+ return `${I(e)} must be a symbol.`;
2204
+ },
2205
+ /**
2206
+ * The value is not uppercase
2207
+ * @see {@link https://formkit.com/essentials/validation#uppercase}
2208
+ */
2209
+ uppercase({ name: e }) {
2210
+ return `${I(e)} can only contain uppercase letters.`;
2211
+ },
2212
+ /**
2213
+ * The value is not lowercase
2214
+ * @see {@link https://formkit.com/essentials/validation#lowercase}
2215
+ */
2216
+ lowercase({ name: e, args: t }) {
2217
+ let r = "";
2218
+ return Array.isArray(t) && t.length && (t[0] === "allow_non_alpha" && (r = ", numbers and symbols"), t[0] === "allow_numeric" && (r = " and numbers"), t[0] === "allow_numeric_dashes" && (r = ", numbers and dashes")), `${I(e)} can only contain lowercase letters${r}.`;
2219
+ },
2220
+ /**
2221
+ * The date is not before
2222
+ * @see {@link https://formkit.com/essentials/validation#date-before}
2223
+ */
2224
+ date_before({ name: e, args: t }) {
2225
+ return Array.isArray(t) && t.length ? `${I(e)} must be before ${Ke(t[0])}.` : `${I(e)} must be in the past.`;
2226
+ },
2227
+ /**
2228
+ * The value is not between two numbers
2229
+ * @see {@link https://formkit.com/essentials/validation#between}
2230
+ */
2231
+ between({ name: e, args: t }) {
2232
+ if (isNaN(t[0]) || isNaN(t[1]))
2233
+ return "This field was configured incorrectly and can’t be submitted.";
2234
+ const [r, n] = Pa(t[0], t[1]);
2235
+ return `${I(e)} must be between ${r} and ${n}.`;
2236
+ },
2237
+ /**
2238
+ * The confirmation field does not match
2239
+ * @see {@link https://formkit.com/essentials/validation#confirm}
2240
+ */
2241
+ confirm({ name: e }) {
2242
+ return `${I(e)} does not match.`;
2243
+ },
2244
+ /**
2245
+ * The value is not a valid date
2246
+ * @see {@link https://formkit.com/essentials/validation#date-format}
2247
+ */
2248
+ date_format({ name: e, args: t }) {
2249
+ return Array.isArray(t) && t.length ? `${I(e)} is not a valid date, please use the format ${t[0]}` : "This field was configured incorrectly and can’t be submitted";
2250
+ },
2251
+ /**
2252
+ * Is not within expected date range
2253
+ * @see {@link https://formkit.com/essentials/validation#date-between}
2254
+ */
2255
+ date_between({ name: e, args: t }) {
2256
+ return `${I(e)} must be between ${Ke(t[0])} and ${Ke(t[1])}`;
2257
+ },
2258
+ /**
2259
+ * Shown when the user-provided value is not a valid email address.
2260
+ * @see {@link https://formkit.com/essentials/validation#email}
2261
+ */
2262
+ email: "Please enter a valid email address.",
2263
+ /**
2264
+ * Does not end with the specified value
2265
+ * @see {@link https://formkit.com/essentials/validation#ends-with}
2266
+ */
2267
+ ends_with({ name: e, args: t }) {
2268
+ return `${I(e)} doesn’t end with ${Ut(t)}.`;
2269
+ },
2270
+ /**
2271
+ * Is not an allowed value
2272
+ * @see {@link https://formkit.com/essentials/validation#is}
2273
+ */
2274
+ is({ name: e }) {
2275
+ return `${I(e)} is not an allowed value.`;
2276
+ },
2277
+ /**
2278
+ * Does not match specified length
2279
+ * @see {@link https://formkit.com/essentials/validation#length}
2280
+ */
2281
+ length({ name: e, args: [t = 0, r = 1 / 0] }) {
2282
+ const n = Number(t) <= Number(r) ? t : r, s = Number(r) >= Number(t) ? r : t;
2283
+ return n == 1 && s === 1 / 0 ? `${I(e)} must be at least one character.` : n == 0 && s ? `${I(e)} must be less than or equal to ${s} characters.` : n === s ? `${I(e)} should be ${s} characters long.` : n && s === 1 / 0 ? `${I(e)} must be greater than or equal to ${n} characters.` : `${I(e)} must be between ${n} and ${s} characters.`;
2284
+ },
2285
+ /**
2286
+ * Value is not a match
2287
+ * @see {@link https://formkit.com/essentials/validation#matches}
2288
+ */
2289
+ matches({ name: e }) {
2290
+ return `${I(e)} is not an allowed value.`;
2291
+ },
2292
+ /**
2293
+ * Exceeds maximum allowed value
2294
+ * @see {@link https://formkit.com/essentials/validation#max}
2295
+ */
2296
+ max({ name: e, node: { value: t }, args: r }) {
2297
+ return Array.isArray(t) ? `Cannot have more than ${r[0]} ${e}.` : `${I(e)} must be no more than ${r[0]}.`;
2298
+ },
2299
+ /**
2300
+ * The (field-level) value does not match specified mime type
2301
+ * @see {@link https://formkit.com/essentials/validation#mime}
2302
+ */
2303
+ mime({ name: e, args: t }) {
2304
+ return t[0] ? `${I(e)} must be of the type: ${t[0]}` : "No file formats allowed.";
2305
+ },
2306
+ /**
2307
+ * Does not fulfill minimum allowed value
2308
+ * @see {@link https://formkit.com/essentials/validation#min}
2309
+ */
2310
+ min({ name: e, node: { value: t }, args: r }) {
2311
+ return Array.isArray(t) ? `Cannot have fewer than ${r[0]} ${e}.` : `${I(e)} must be at least ${r[0]}.`;
2312
+ },
2313
+ /**
2314
+ * Is not an allowed value
2315
+ * @see {@link https://formkit.com/essentials/validation#not}
2316
+ */
2317
+ not({ name: e, node: { value: t } }) {
2318
+ return `“${t}” is not an allowed ${e}.`;
2319
+ },
2320
+ /**
2321
+ * Is not a number
2322
+ * @see {@link https://formkit.com/essentials/validation#number}
2323
+ */
2324
+ number({ name: e }) {
2325
+ return `${I(e)} must be a number.`;
2326
+ },
2327
+ /**
2328
+ * Require one field.
2329
+ * @see {@link https://formkit.com/essentials/validation#require-one}
2330
+ */
2331
+ require_one: ({ name: e, node: t, args: r }) => {
2332
+ const n = r.map((s) => {
2333
+ const i = t.at(s);
2334
+ return i ? Tr(i) : !1;
2335
+ }).filter((s) => !!s);
2336
+ return n.unshift(e), `${n.join(" or ")} is required.`;
2337
+ },
2338
+ /**
2339
+ * Required field.
2340
+ * @see {@link https://formkit.com/essentials/validation#required}
2341
+ */
2342
+ required({ name: e }) {
2343
+ return `${I(e)} is required.`;
2344
+ },
2345
+ /**
2346
+ * Does not start with specified value
2347
+ * @see {@link https://formkit.com/essentials/validation#starts-with}
2348
+ */
2349
+ starts_with({ name: e, args: t }) {
2350
+ return `${I(e)} doesn’t start with ${Ut(t)}.`;
2351
+ },
2352
+ /**
2353
+ * Is not a url
2354
+ * @see {@link https://formkit.com/essentials/validation#url}
2355
+ */
2356
+ url() {
2357
+ return "Please enter a valid URL.";
2358
+ },
2359
+ /**
2360
+ * Shown when the date is invalid.
2361
+ */
2362
+ invalidDate: "The selected date is invalid."
2363
+ }, Ia = { ui: Ea, validation: Oa }, Zt = /* @__PURE__ */ new Set();
2364
+ function Ma(e) {
2365
+ return function(r) {
2366
+ Zt.add(r), r.on("destroying", () => Zt.delete(r));
2367
+ let n = Yt(r.config.locale, e), s = n ? e[n] : {};
2368
+ r.on("prop:locale", ({ payload: i }) => {
2369
+ n = Yt(i, e), s = n ? e[n] : {}, r.store.touch();
2370
+ }), r.on("prop:label", () => r.store.touch()), r.on("prop:validationLabel", () => r.store.touch()), r.hook.text((i, a) => {
2371
+ var o, y;
2372
+ const l = ((o = i.meta) == null ? void 0 : o.messageKey) || i.key;
2373
+ if (P(s, i.type) && P(s[i.type], l)) {
2374
+ const v = s[i.type][l];
2375
+ typeof v == "function" ? i.value = Array.isArray((y = i.meta) == null ? void 0 : y.i18nArgs) ? v(...i.meta.i18nArgs) : v(i) : i.value = v;
2376
+ }
2377
+ return a(i);
2378
+ });
2379
+ };
2380
+ }
2381
+ function Yt(e, t) {
2382
+ if (P(t, e))
2383
+ return e;
2384
+ const [r] = e.split("-");
2385
+ if (P(t, r))
2386
+ return r;
2387
+ for (const n in t)
2388
+ return n;
2389
+ return !1;
2390
+ }
2391
+ function xa(...e) {
2392
+ const t = e.reduce(
2393
+ (n, s) => le(n, s),
2394
+ {}
2395
+ ), r = () => {
2396
+ };
2397
+ return r.library = function(n) {
2398
+ const s = $e(n.props.type);
2399
+ P(t, s) && n.define(t[s]);
2400
+ }, r;
2401
+ }
2402
+ var Ra = [
2403
+ "classes",
2404
+ "config",
2405
+ "delay",
2406
+ "errors",
2407
+ "id",
2408
+ "index",
2409
+ "inputErrors",
2410
+ "library",
2411
+ "modelValue",
2412
+ "onUpdate:modelValue",
2413
+ "name",
2414
+ "number",
2415
+ "parent",
2416
+ "plugins",
2417
+ "sectionsSchema",
2418
+ "type",
2419
+ "validation",
2420
+ "validationLabel",
2421
+ "validationMessages",
2422
+ "validationRules",
2423
+ // Runtime event props:
2424
+ "onInput",
2425
+ "onInputRaw",
2426
+ "onUpdate:modelValue",
2427
+ "onNode",
2428
+ "onSubmit",
2429
+ "onSubmitInvalid",
2430
+ "onSubmitRaw"
2431
+ ];
2432
+ function it(e) {
2433
+ return e && typeof e == "object" && "group" in e && Array.isArray(e.options);
2434
+ }
2435
+ function Wr(e, t = { count: 1 }) {
2436
+ return Array.isArray(e) ? e.map(
2437
+ (r) => {
2438
+ if (typeof r == "string" || typeof r == "number")
2439
+ return {
2440
+ label: String(r),
2441
+ value: String(r)
2442
+ };
2443
+ if (typeof r == "object") {
2444
+ if ("group" in r)
2445
+ return r.options = Wr(r.options || [], t), r;
2446
+ "value" in r && typeof r.value != "string" && Object.assign(r, {
2447
+ value: `__mask_${t.count++}`,
2448
+ __original: r.value
2449
+ });
2450
+ }
2451
+ return r;
2452
+ }
2453
+ ) : Object.keys(e).map((r) => ({
2454
+ label: e[r],
2455
+ value: r
2456
+ }));
2457
+ }
2458
+ function de(e, t, r = !1) {
2459
+ if (Array.isArray(e)) {
2460
+ for (const n of e)
2461
+ if (!(typeof n != "object" && n)) {
2462
+ if (it(n)) {
2463
+ const s = de(n.options, t, !0);
2464
+ if (s !== void 0)
2465
+ return s;
2466
+ } else if (t == n.value)
2467
+ return "__original" in n ? n.__original : n.value;
2468
+ }
2469
+ }
2470
+ return r ? void 0 : t;
2471
+ }
2472
+ function Pe(e, t) {
2473
+ return e === null && t === void 0 || e === void 0 && t === null ? !1 : e == t ? !0 : Se(e) && Se(t) ? T(e, t) : !1;
2474
+ }
2475
+ function Rt(e) {
2476
+ e.hook.prop((t, r) => {
2477
+ var n;
2478
+ return t.prop === "options" && (typeof t.value == "function" ? (e.props.optionsLoader = t.value, t.value = []) : ((n = e.props)._normalizeCounter ?? (n._normalizeCounter = { count: 1 }), t.value = Wr(t.value, e.props._normalizeCounter))), r(t);
2479
+ });
2480
+ }
2481
+ // @__NO_SIDE_EFFECTS__
2482
+ function A(e, t, r = !1) {
2483
+ return (...n) => {
2484
+ const s = (i) => {
2485
+ const a = !t || typeof t == "string" ? { $el: t } : t();
2486
+ return (bt(a) || $t(a)) && (a.meta ? a.meta.section = e : a.meta = { section: e }, n.length && !a.children && (a.children = [
2487
+ ...n.map(
2488
+ (l) => typeof l == "function" ? l(i) : l
2489
+ )
2490
+ ]), bt(a) && (a.attrs = {
2491
+ class: `$classes.${e}`,
2492
+ ...a.attrs || {}
2493
+ })), {
2494
+ if: `$slots.${e}`,
2495
+ then: `$slots.${e}`,
2496
+ else: e in i ? /* @__PURE__ */ Me(a, i[e]) : a
2497
+ };
2498
+ };
2499
+ return s._s = e, r ? /* @__PURE__ */ ja(s) : s;
2500
+ };
2501
+ }
2502
+ // @__NO_SIDE_EFFECTS__
2503
+ function ja(e) {
2504
+ return (t) => [e(t)];
2505
+ }
2506
+ function Ge(e) {
2507
+ return !!(e && typeof e == "object" && ("$el" in e || "$cmp" in e || "$formkit" in e));
2508
+ }
2509
+ // @__NO_SIDE_EFFECTS__
2510
+ function Me(e, t = {}) {
2511
+ return typeof e == "string" ? Ge(t) || typeof t == "string" ? t : e : Array.isArray(e) ? Ge(t) ? t : e : le(e, t);
2512
+ }
2513
+ var Fa = /* @__PURE__ */ A("actions", () => ({
2514
+ $el: "div",
2515
+ if: "$actions"
2516
+ })), Je = /* @__PURE__ */ A("input", () => ({
2517
+ $el: "input",
2518
+ bind: "$attrs",
2519
+ attrs: {
2520
+ type: "$type",
2521
+ name: "$node.props.altName || $node.name",
2522
+ disabled: "$option.attrs.disabled || $disabled",
2523
+ onInput: "$handlers.toggleChecked",
2524
+ checked: "$fns.eq($_value, $onValue)",
2525
+ onBlur: "$handlers.blur",
2526
+ value: "$: true",
2527
+ id: "$id",
2528
+ "aria-describedby": {
2529
+ if: "$options.length",
2530
+ then: {
2531
+ if: "$option.help",
2532
+ then: '$: "help-" + $option.attrs.id',
2533
+ else: void 0
2534
+ },
2535
+ else: {
2536
+ if: "$help",
2537
+ then: '$: "help-" + $id',
2538
+ else: void 0
2539
+ }
2540
+ }
2541
+ }
2542
+ })), Hr = /* @__PURE__ */ A("optionHelp", () => ({
2543
+ $el: "div",
2544
+ if: "$option.help",
2545
+ attrs: {
2546
+ id: '$: "help-" + $option.attrs.id'
2547
+ }
2548
+ })), Qe = /* @__PURE__ */ A("inner", "span"), Xe = /* @__PURE__ */ A("label", "span"), Br = /* @__PURE__ */ A("option", () => ({
2549
+ $el: "li",
2550
+ for: ["option", "$options"],
2551
+ attrs: {
2552
+ "data-disabled": "$option.attrs.disabled || $disabled || undefined"
2553
+ }
2554
+ })), Ur = /* @__PURE__ */ A("options", "ul"), et = /* @__PURE__ */ A("wrapper", () => ({
2555
+ $el: "label",
2556
+ attrs: {
2557
+ "data-disabled": {
2558
+ if: "$options.length",
2559
+ then: void 0,
2560
+ else: "$disabled || undefined"
2561
+ },
2562
+ "data-checked": {
2563
+ if: "$options == undefined",
2564
+ then: "$fns.eq($_value, $onValue) || undefined",
2565
+ else: "$fns.isChecked($option.value) || undefined"
2566
+ }
2567
+ }
2568
+ })), Va = /* @__PURE__ */ A("input", () => ({
2569
+ $el: "button",
2570
+ bind: "$attrs",
2571
+ attrs: {
2572
+ type: "$type",
2573
+ disabled: "$disabled",
2574
+ name: "$node.name",
2575
+ id: "$id"
2576
+ }
2577
+ })), Na = /* @__PURE__ */ A("default", null), tt = /* @__PURE__ */ A("decorator", () => ({
2578
+ $el: "span",
2579
+ attrs: {
2580
+ "aria-hidden": "true"
2581
+ }
2582
+ })), Zr = /* @__PURE__ */ A("fieldset", () => ({
2583
+ $el: "fieldset",
2584
+ attrs: {
2585
+ id: "$id",
2586
+ "aria-describedby": {
2587
+ if: "$help",
2588
+ then: '$: "help-" + $id',
2589
+ else: void 0
2590
+ }
2591
+ }
2592
+ })), Da = /* @__PURE__ */ A("input", () => ({
2593
+ $el: "input",
2594
+ bind: "$attrs",
2595
+ attrs: {
2596
+ type: "file",
2597
+ disabled: "$disabled",
2598
+ name: "$node.name",
2599
+ onChange: "$handlers.files",
2600
+ onBlur: "$handlers.blur",
2601
+ id: "$id",
2602
+ "aria-describedby": "$describedBy",
2603
+ "aria-required": "$state.required || undefined"
2604
+ }
2605
+ })), La = /* @__PURE__ */ A("fileItem", () => ({
2606
+ $el: "li",
2607
+ for: ["file", "$value"]
2608
+ })), qa = /* @__PURE__ */ A("fileList", () => ({
2609
+ $el: "ul",
2610
+ if: "$value.length",
2611
+ attrs: {
2612
+ "data-has-multiple": "$_hasMultipleFiles"
2613
+ }
2614
+ })), Ta = /* @__PURE__ */ A("fileName", () => ({
2615
+ $el: "span",
2616
+ attrs: {
2617
+ class: "$classes.fileName"
2618
+ }
2619
+ })), Gt = /* @__PURE__ */ A("fileRemove", () => ({
2620
+ $el: "button",
2621
+ attrs: {
2622
+ type: "button",
2623
+ onClick: "$handlers.resetFiles"
2624
+ }
2625
+ })), Ka = /* @__PURE__ */ A("form", () => ({
2626
+ $el: "form",
2627
+ bind: "$attrs",
2628
+ meta: {
2629
+ autoAnimate: !0
2630
+ },
2631
+ attrs: {
2632
+ id: "$id",
2633
+ name: "$node.name",
2634
+ onSubmit: "$handlers.submit",
2635
+ "data-loading": "$state.loading || undefined"
2636
+ }
2637
+ })), jt = /* @__PURE__ */ A("wrapper", null, !0), ee = /* @__PURE__ */ A("help", () => ({
2638
+ $el: "div",
2639
+ if: "$help",
2640
+ attrs: {
2641
+ id: '$: "help-" + $id'
2642
+ }
2643
+ })), D = (e, t) => (/* @__PURE__ */ A(`${e}Icon`, () => {
2644
+ const r = `_raw${e.charAt(0).toUpperCase()}${e.slice(1)}Icon`;
2645
+ return {
2646
+ if: `$${e}Icon && $${r}`,
2647
+ $el: `${t || "span"}`,
2648
+ attrs: {
2649
+ class: `$classes.${e}Icon + " " + $classes.icon`,
2650
+ innerHTML: `$${r}`,
2651
+ onClick: `$handlers.iconClick(${e})`,
2652
+ role: `$fns.iconRole(${e})`,
2653
+ tabindex: `$fns.iconRole(${e}) === "button" && "0" || undefined`,
2654
+ for: {
2655
+ if: `${t === "label"}`,
2656
+ then: "$id"
2657
+ }
2658
+ }
2659
+ };
2660
+ }))(), De = /* @__PURE__ */ A("inner", "div"), Le = /* @__PURE__ */ A("label", () => ({
2661
+ $el: "label",
2662
+ if: "$label",
2663
+ attrs: {
2664
+ for: "$id"
2665
+ }
2666
+ })), Yr = /* @__PURE__ */ A("legend", () => ({
2667
+ $el: "legend",
2668
+ if: "$label"
2669
+ })), oe = /* @__PURE__ */ A("message", () => ({
2670
+ $el: "li",
2671
+ for: ["message", "$messages"],
2672
+ attrs: {
2673
+ key: "$message.key",
2674
+ id: "$id + '-' + $message.key",
2675
+ "data-message-type": "$message.type"
2676
+ }
2677
+ })), ue = /* @__PURE__ */ A("messages", () => ({
2678
+ $el: "ul",
2679
+ if: "$defaultMessagePlacement && $fns.length($messages)"
2680
+ })), za = /* @__PURE__ */ A("noFiles", () => ({
2681
+ $el: "span",
2682
+ if: "$value == null || $value.length == 0"
2683
+ })), Wa = /* @__PURE__ */ A("optGroup", () => ({
2684
+ $el: "optgroup",
2685
+ bind: "$option.attrs",
2686
+ attrs: {
2687
+ label: "$option.group"
2688
+ }
2689
+ })), Jt = /* @__PURE__ */ A("option", () => ({
2690
+ $el: "option",
2691
+ bind: "$option.attrs",
2692
+ attrs: {
2693
+ class: "$classes.option",
2694
+ value: "$option.value",
2695
+ selected: "$fns.isSelected($option)"
2696
+ }
2697
+ })), Qt = /* @__PURE__ */ A("options", () => ({
2698
+ $el: null,
2699
+ if: "$options.length",
2700
+ for: ["option", "$option.options || $options"]
2701
+ })), fe = /* @__PURE__ */ A("outer", () => ({
2702
+ $el: "div",
2703
+ meta: {
2704
+ autoAnimate: !0
2705
+ },
2706
+ attrs: {
2707
+ key: "$id",
2708
+ "data-family": "$family || undefined",
2709
+ "data-type": "$type",
2710
+ "data-multiple": '$attrs.multiple || ($type != "select" && $options != undefined) || undefined',
2711
+ "data-has-multiple": "$_hasMultipleFiles",
2712
+ "data-disabled": '$: ($disabled !== "false" && $disabled) || undefined',
2713
+ "data-empty": "$state.empty || undefined",
2714
+ "data-complete": "$state.complete || undefined",
2715
+ "data-invalid": "$state.invalid || undefined",
2716
+ "data-errors": "$state.errors || undefined",
2717
+ "data-submitted": "$state.submitted || undefined",
2718
+ "data-prefix-icon": "$_rawPrefixIcon !== undefined || undefined",
2719
+ "data-suffix-icon": "$_rawSuffixIcon !== undefined || undefined",
2720
+ "data-prefix-icon-click": "$onPrefixIconClick !== undefined || undefined",
2721
+ "data-suffix-icon-click": "$onSuffixIconClick !== undefined || undefined"
2722
+ }
2723
+ })), te = /* @__PURE__ */ A("prefix", null), Ha = /* @__PURE__ */ A("input", () => ({
2724
+ $el: "select",
2725
+ bind: "$attrs",
2726
+ attrs: {
2727
+ id: "$id",
2728
+ "data-placeholder": "$fns.showPlaceholder($_value, $placeholder)",
2729
+ disabled: "$disabled",
2730
+ class: "$classes.input",
2731
+ name: "$node.name",
2732
+ onChange: "$handlers.onChange",
2733
+ onInput: "$handlers.selectInput",
2734
+ onBlur: "$handlers.blur",
2735
+ "aria-describedby": "$describedBy",
2736
+ "aria-required": "$state.required || undefined"
2737
+ }
2738
+ })), Ba = /* @__PURE__ */ A("submit", () => ({
2739
+ $cmp: "FormKit",
2740
+ bind: "$submitAttrs",
2741
+ props: {
2742
+ type: "submit",
2743
+ label: "$submitLabel"
2744
+ }
2745
+ })), re = /* @__PURE__ */ A("suffix", null), Gr = /* @__PURE__ */ A("input", () => ({
2746
+ $el: "input",
2747
+ bind: "$attrs",
2748
+ attrs: {
2749
+ type: "$type",
2750
+ disabled: "$disabled",
2751
+ name: "$node.name",
2752
+ onInput: "$handlers.DOMInput",
2753
+ onBlur: "$handlers.blur",
2754
+ value: "$_value",
2755
+ id: "$id",
2756
+ "aria-describedby": "$describedBy",
2757
+ "aria-required": "$state.required || undefined"
2758
+ }
2759
+ })), Ua = /* @__PURE__ */ A("input", () => ({
2760
+ $el: "textarea",
2761
+ bind: "$attrs",
2762
+ attrs: {
2763
+ disabled: "$disabled",
2764
+ name: "$node.name",
2765
+ onInput: "$handlers.DOMInput",
2766
+ onBlur: "$handlers.blur",
2767
+ value: "$_value",
2768
+ id: "$id",
2769
+ "aria-describedby": "$describedBy",
2770
+ "aria-required": "$state.required || undefined"
2771
+ },
2772
+ children: "$initialValue"
2773
+ })), Oe = /* @__PURE__ */ A("wrapper", "div"), Za = 0;
2774
+ function Jr(e) {
2775
+ (e.type === "group" || e.type === "list") && e.plugins.add(Ya);
2776
+ }
2777
+ function Ya(e) {
2778
+ e.props.type === "radio" && (e.addProps(["altName"]), e.props.altName = `${e.name}_${Za++}`);
2779
+ }
2780
+ function Qr(e) {
2781
+ return function(t, r) {
2782
+ return t.prop === "options" && Array.isArray(t.value) && (t.value = t.value.map((n) => {
2783
+ var s;
2784
+ return (s = n.attrs) != null && s.id ? n : le(n, {
2785
+ attrs: {
2786
+ id: `${e.props.id}-option-${At(String(n.value))}`
2787
+ }
2788
+ });
2789
+ }), e.props.type === "checkbox" && !Array.isArray(e.value) && (e.isCreated ? e.input([], !1) : e.on("created", () => {
2790
+ Array.isArray(e.value) || e.input([], !1);
2791
+ }))), r(t);
2792
+ };
2793
+ }
2794
+ function Ga(e, t) {
2795
+ const r = t.target;
2796
+ if (r instanceof HTMLInputElement) {
2797
+ const n = Array.isArray(e.props.options) ? de(e.props.options, r.value) : r.value;
2798
+ Array.isArray(e.props.options) && e.props.options.length ? Array.isArray(e._value) ? e._value.some((s) => Pe(n, s)) ? e.input(
2799
+ e._value.filter(
2800
+ (s) => !Pe(n, s)
2801
+ )
2802
+ ) : e.input([...e._value, n]) : e.input([n]) : r.checked ? e.input(e.props.onValue) : e.input(e.props.offValue);
2803
+ }
2804
+ }
2805
+ function Ja(e, t) {
2806
+ var r, n;
2807
+ return (r = e.context) == null || r.value, (n = e.context) == null || n._value, Array.isArray(e._value) ? e._value.some(
2808
+ (s) => Pe(de(e.props.options, t), s)
2809
+ ) : !1;
2810
+ }
2811
+ function Qa(e) {
2812
+ e.on("created", () => {
2813
+ var t, r;
2814
+ (t = e.context) != null && t.handlers && (e.context.handlers.toggleChecked = Ga.bind(null, e)), (r = e.context) != null && r.fns && (e.context.fns.isChecked = Ja.bind(null, e)), P(e.props, "onValue") || (e.props.onValue = !0), P(e.props, "offValue") || (e.props.offValue = !1);
2815
+ }), e.hook.prop(Qr(e));
2816
+ }
2817
+ function _e(e, t) {
2818
+ return (r) => {
2819
+ r.props[`${e}Icon`] === void 0 && (r.props[`${e}Icon`] = t.startsWith("<svg") ? t : `default:${t}`);
2820
+ };
2821
+ }
2822
+ function Ft(e) {
2823
+ e.on("created", () => {
2824
+ "disabled" in e.props && (e.props.disabled = G(e.props.disabled), e.config.disabled = G(e.props.disabled));
2825
+ }), e.hook.prop(({ prop: t, value: r }, n) => (r = t === "disabled" ? G(r) : r, n({ prop: t, value: r }))), e.on("prop:disabled", ({ payload: t }) => {
2826
+ e.config.disabled = G(t);
2827
+ });
2828
+ }
2829
+ function Be(e, t) {
2830
+ return (r) => {
2831
+ r.store.set(
2832
+ /* @__PURE__ */ H({
2833
+ key: e,
2834
+ type: "ui",
2835
+ value: t || e,
2836
+ meta: {
2837
+ localize: !0,
2838
+ i18nArgs: [r]
2839
+ }
2840
+ })
2841
+ );
2842
+ };
2843
+ }
2844
+ var lt = typeof window < "u";
2845
+ function Xr(e) {
2846
+ e.target instanceof HTMLElement && e.target.hasAttribute("data-file-hover") && e.target.removeAttribute("data-file-hover");
2847
+ }
2848
+ function Xt(e, t) {
2849
+ t.target instanceof HTMLInputElement ? e === "dragover" && t.target.setAttribute("data-file-hover", "true") : t.preventDefault(), e === "drop" && Xr(t);
2850
+ }
2851
+ function Xa(e) {
2852
+ Be("noFiles", "Select file")(e), Be("removeAll", "Remove all")(e), Be("remove")(e), e.addProps(["_hasMultipleFiles"]), lt && (window._FormKit_File_Drop || (window.addEventListener(
2853
+ "dragover",
2854
+ Xt.bind(null, "dragover")
2855
+ ), window.addEventListener("drop", Xt.bind(null, "drop")), window.addEventListener("dragleave", Xr), window._FormKit_File_Drop = !0)), e.hook.input((t, r) => r(Array.isArray(t) ? t : [])), e.on("input", ({ payload: t }) => {
2856
+ e.props._hasMultipleFiles = Array.isArray(t) && t.length > 1 ? !0 : void 0;
2857
+ }), e.on("reset", () => {
2858
+ if (e.props.id && lt) {
2859
+ const t = document.getElementById(e.props.id);
2860
+ t && (t.value = "");
2861
+ }
2862
+ }), e.on("created", () => {
2863
+ Array.isArray(e.value) || e.input([], !1), e.context && (e.context.handlers.resetFiles = (t) => {
2864
+ if (t.preventDefault(), e.input([]), e.props.id && lt) {
2865
+ const r = document.getElementById(e.props.id);
2866
+ r && (r.value = ""), r == null || r.focus();
2867
+ }
2868
+ }, e.context.handlers.files = (t) => {
2869
+ var n, s;
2870
+ const r = [];
2871
+ if (t.target instanceof HTMLInputElement && t.target.files) {
2872
+ for (let i = 0; i < t.target.files.length; i++) {
2873
+ let a;
2874
+ (a = t.target.files.item(i)) && r.push({ name: a.name, file: a });
2875
+ }
2876
+ e.input(r);
2877
+ }
2878
+ e.context && (e.context.files = r), typeof ((n = e.props.attrs) == null ? void 0 : n.onChange) == "function" && ((s = e.props.attrs) == null || s.onChange(t));
2879
+ });
2880
+ });
2881
+ }
2882
+ var er = /* @__PURE__ */ H({
2883
+ key: "loading",
2884
+ value: !0,
2885
+ visible: !1
2886
+ });
2887
+ async function el(e, t) {
2888
+ const r = Math.random();
2889
+ if (e.props._submitNonce = r, t.preventDefault(), await e.settled, e.ledger.value("validating") && (e.store.set(er), await e.ledger.settled("validating"), e.store.remove("loading"), e.props._submitNonce !== r))
2890
+ return;
2891
+ const n = (s) => s.store.set(
2892
+ /* @__PURE__ */ H({
2893
+ key: "submitted",
2894
+ value: !0,
2895
+ visible: !1
2896
+ })
2897
+ );
2898
+ if (e.walk(n), n(e), e.emit("submit-raw"), typeof e.props.onSubmitRaw == "function" && e.props.onSubmitRaw(t, e), e.ledger.value("blocking"))
2899
+ typeof e.props.onSubmitInvalid == "function" && e.props.onSubmitInvalid(e), e.props.incompleteMessage !== !1 && en(e);
2900
+ else if (typeof e.props.onSubmit == "function") {
2901
+ const s = e.props.onSubmit(
2902
+ e.hook.submit.dispatch(Ae(e.value)),
2903
+ e
2904
+ );
2905
+ if (s instanceof Promise) {
2906
+ const i = e.props.disabled === void 0 && e.props.submitBehavior !== "live";
2907
+ i && (e.props.disabled = !0), e.store.set(er), await s, i && (e.props.disabled = !1), e.store.remove("loading");
2908
+ }
2909
+ } else
2910
+ t.target instanceof HTMLFormElement && t.target.submit();
2911
+ }
2912
+ function en(e) {
2913
+ e.store.set(
2914
+ /* @__PURE__ */ H({
2915
+ blocking: !1,
2916
+ key: "incomplete",
2917
+ meta: {
2918
+ localize: e.props.incompleteMessage === void 0,
2919
+ i18nArgs: [{ node: e }],
2920
+ showAsMessage: !0
2921
+ },
2922
+ type: "ui",
2923
+ value: e.props.incompleteMessage || "Form incomplete."
2924
+ })
2925
+ );
2926
+ }
2927
+ function tl(e) {
2928
+ var t;
2929
+ e.props.isForm = !0, e.ledger.count("validating", (r) => r.key === "validating"), (t = e.props).submitAttrs ?? (t.submitAttrs = {
2930
+ disabled: e.props.disabled
2931
+ }), e.on("prop:disabled", ({ payload: r }) => {
2932
+ e.props.submitAttrs = { ...e.props.submitAttrs, disabled: r };
2933
+ }), e.on("created", () => {
2934
+ var r;
2935
+ (r = e.context) != null && r.handlers && (e.context.handlers.submit = el.bind(null, e)), P(e.props, "actions") || (e.props.actions = !0);
2936
+ }), e.on("prop:incompleteMessage", () => {
2937
+ e.store.incomplete && en(e);
2938
+ }), e.on("settled:blocking", () => e.store.remove("incomplete"));
2939
+ }
2940
+ function rl(e) {
2941
+ e.props.ignore === void 0 && (e.props.ignore = !0, e.parent = null);
2942
+ }
2943
+ function nl(e) {
2944
+ e.on("created", () => {
2945
+ e.context && (e.context.initialValue = e.value || "");
2946
+ });
2947
+ }
2948
+ function tn(e) {
2949
+ if (typeof e.props.number > "u")
2950
+ return;
2951
+ const t = ["number", "range", "hidden"].includes(e.props.type);
2952
+ e.hook.input((r, n) => {
2953
+ if (r === "")
2954
+ return n(void 0);
2955
+ const s = e.props.number === "integer" ? parseInt(r) : parseFloat(r);
2956
+ return Number.isFinite(s) ? n(s) : n(t ? void 0 : r);
2957
+ });
2958
+ }
2959
+ function sl(e, t) {
2960
+ t.target instanceof HTMLInputElement && e.input(de(e.props.options, t.target.value));
2961
+ }
2962
+ function il(e, t) {
2963
+ var r, n;
2964
+ return (r = e.context) == null || r.value, (n = e.context) == null || n._value, Pe(de(e.props.options, t), e._value);
2965
+ }
2966
+ function al(e) {
2967
+ e.on("created", () => {
2968
+ var t, r;
2969
+ Array.isArray(e.props.options) || ye(350, {
2970
+ node: e,
2971
+ inputType: "radio"
2972
+ }), (t = e.context) != null && t.handlers && (e.context.handlers.toggleChecked = sl.bind(null, e)), (r = e.context) != null && r.fns && (e.context.fns.isChecked = il.bind(null, e));
2973
+ }), e.hook.prop(Qr(e));
2974
+ }
2975
+ function ll(e, t) {
2976
+ if (it(t))
2977
+ return !1;
2978
+ e.context && e.context.value;
2979
+ const r = "__original" in t ? t.__original : t.value;
2980
+ return Array.isArray(e._value) ? e._value.some((n) => Pe(n, r)) : (e._value === void 0 || e._value === null && !rn(e.props.options, null)) && t.attrs && t.attrs["data-is-placeholder"] ? !0 : Pe(r, e._value);
2981
+ }
2982
+ function rn(e, t) {
2983
+ return e.some((r) => it(r) ? rn(r.options, t) : ("__original" in r ? r.__original : r.value) === t);
2984
+ }
2985
+ async function ol(e, t) {
2986
+ var r;
2987
+ typeof ((r = e.props.attrs) == null ? void 0 : r.onChange) == "function" && (await new Promise((n) => setTimeout(n, 0)), await e.settled, e.props.attrs.onChange(t));
2988
+ }
2989
+ function ul(e, t) {
2990
+ const r = t.target, n = r.hasAttribute("multiple") ? Array.from(r.selectedOptions).map(
2991
+ (s) => de(e.props.options, s.value)
2992
+ ) : de(e.props.options, r.value);
2993
+ e.input(n);
2994
+ }
2995
+ function tr(e, t) {
2996
+ return e.some(
2997
+ (r) => r.attrs && r.attrs["data-is-placeholder"]
2998
+ ) ? e : [
2999
+ {
3000
+ label: t,
3001
+ value: "",
3002
+ attrs: {
3003
+ hidden: !0,
3004
+ disabled: !0,
3005
+ "data-is-placeholder": "true"
3006
+ }
3007
+ },
3008
+ ...e
3009
+ ];
3010
+ }
3011
+ function nn(e) {
3012
+ const t = e.length > 0 ? e[0] : void 0;
3013
+ if (t)
3014
+ return it(t) ? nn(t.options) : "__original" in t ? t.__original : t.value;
3015
+ }
3016
+ function fl(e) {
3017
+ e.on("created", () => {
3018
+ var r, n, s;
3019
+ const t = G((r = e.props.attrs) == null ? void 0 : r.multiple);
3020
+ !t && e.props.placeholder && Array.isArray(e.props.options) && (e.hook.prop(({ prop: i, value: a }, l) => (i === "options" && (a = tr(a, e.props.placeholder)), l({ prop: i, value: a }))), e.props.options = tr(
3021
+ e.props.options,
3022
+ e.props.placeholder
3023
+ )), t ? e.value === void 0 && e.input([], !1) : e.context && !e.context.options && (e.props.attrs = Object.assign({}, e.props.attrs, {
3024
+ value: e._value
3025
+ }), e.on("input", ({ payload: i }) => {
3026
+ e.props.attrs = Object.assign({}, e.props.attrs, {
3027
+ value: i
3028
+ });
3029
+ })), (n = e.context) != null && n.handlers && (e.context.handlers.selectInput = ul.bind(null, e), e.context.handlers.onChange = ol.bind(null, e)), (s = e.context) != null && s.fns && (e.context.fns.isSelected = ll.bind(null, e), e.context.fns.showPlaceholder = (i, a) => {
3030
+ if (!Array.isArray(e.props.options))
3031
+ return !1;
3032
+ const l = e.props.options.some(
3033
+ (o) => {
3034
+ if (o.attrs && "data-is-placeholder" in o.attrs)
3035
+ return !1;
3036
+ const y = "__original" in o ? o.__original : o.value;
3037
+ return T(i, y);
3038
+ }
3039
+ );
3040
+ return a && !l ? !0 : void 0;
3041
+ });
3042
+ }), e.hook.input((t, r) => {
3043
+ var n, s, i;
3044
+ return !e.props.placeholder && t === void 0 && Array.isArray((n = e.props) == null ? void 0 : n.options) && e.props.options.length && !G((i = (s = e.props) == null ? void 0 : s.attrs) == null ? void 0 : i.multiple) && (t = nn(e.props.options)), r(t);
3045
+ });
3046
+ }
3047
+ // @__NO_SIDE_EFFECTS__
3048
+ function St(e) {
3049
+ return !!(he(e) && e.if && e.if.startsWith("$slots.") && typeof e.then == "string" && e.then.startsWith("$slots.") && "else" in e);
3050
+ }
3051
+ // @__NO_SIDE_EFFECTS__
3052
+ function cl(e, t = {}) {
3053
+ const r = /* @__PURE__ */ fe(
3054
+ /* @__PURE__ */ Oe(
3055
+ /* @__PURE__ */ Le("$label"),
3056
+ /* @__PURE__ */ De(/* @__PURE__ */ D("prefix"), /* @__PURE__ */ te(), e(), /* @__PURE__ */ re(), /* @__PURE__ */ D("suffix"))
3057
+ ),
3058
+ /* @__PURE__ */ ee("$help"),
3059
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value"))
3060
+ );
3061
+ return (n = {}) => r(le(t, n));
3062
+ }
3063
+ // @__NO_SIDE_EFFECTS__
3064
+ function ie(e, t, r) {
3065
+ const n = (s) => {
3066
+ const i = t(s);
3067
+ if (r || Ge(i) && "if" in i || /* @__PURE__ */ St(i)) {
3068
+ const a = {
3069
+ if: e,
3070
+ then: i
3071
+ };
3072
+ return r && (a.else = r(s)), a;
3073
+ } else /* @__PURE__ */ St(i) ? Object.assign(i.else, { if: e }) : Ge(i) && Object.assign(i, { if: e });
3074
+ return i;
3075
+ };
3076
+ return n._s = Ee(), n;
3077
+ }
3078
+ // @__NO_SIDE_EFFECTS__
3079
+ function we(e, t) {
3080
+ const r = (n) => {
3081
+ const s = e({});
3082
+ return /* @__PURE__ */ St(s) ? (Array.isArray(s.else) || (s.else = /* @__PURE__ */ Me(
3083
+ /* @__PURE__ */ Me(s.else, t),
3084
+ e._s ? n[e._s] : {}
3085
+ )), s) : /* @__PURE__ */ Me(
3086
+ /* @__PURE__ */ Me(s, t),
3087
+ e._s ? n[e._s] : {}
3088
+ );
3089
+ };
3090
+ return r._s = e._s, r;
3091
+ }
3092
+ var rr = {
3093
+ /**
3094
+ * The actual schema of the input, or a function that returns the schema.
3095
+ */
3096
+ schema: /* @__PURE__ */ fe(
3097
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value")),
3098
+ /* @__PURE__ */ Oe(
3099
+ /* @__PURE__ */ Va(
3100
+ /* @__PURE__ */ D("prefix"),
3101
+ /* @__PURE__ */ te(),
3102
+ /* @__PURE__ */ Na("$label || $ui.submit.value"),
3103
+ /* @__PURE__ */ re(),
3104
+ /* @__PURE__ */ D("suffix")
3105
+ )
3106
+ ),
3107
+ /* @__PURE__ */ ee("$help")
3108
+ ),
3109
+ /**
3110
+ * The type of node, can be a list, group, or input.
3111
+ */
3112
+ type: "input",
3113
+ /**
3114
+ * The family of inputs this one belongs too. For example "text" and "email"
3115
+ * are both part of the "text" family. This is primary used for styling.
3116
+ */
3117
+ family: "button",
3118
+ /**
3119
+ * An array of extra props to accept for this input.
3120
+ */
3121
+ props: [],
3122
+ /**
3123
+ * Additional features that should be added to your input
3124
+ */
3125
+ features: [Be("submit"), rl],
3126
+ /**
3127
+ * A key to use for memoizing the schema. This is used to prevent the schema
3128
+ * from needing to be stringified when performing a memo lookup.
3129
+ */
3130
+ schemaMemoKey: "h6st4epl3j8"
3131
+ }, pl = {
3132
+ /**
3133
+ * The actual schema of the input, or a function that returns the schema.
3134
+ */
3135
+ schema: /* @__PURE__ */ fe(
3136
+ /* @__PURE__ */ ie(
3137
+ "$options == undefined",
3138
+ /**
3139
+ * Single checkbox structure.
3140
+ */
3141
+ /* @__PURE__ */ et(
3142
+ /* @__PURE__ */ Qe(/* @__PURE__ */ te(), /* @__PURE__ */ Je(), /* @__PURE__ */ tt(/* @__PURE__ */ D("decorator")), /* @__PURE__ */ re()),
3143
+ /* @__PURE__ */ we(/* @__PURE__ */ Xe("$label"), {
3144
+ if: "$label"
3145
+ })
3146
+ ),
3147
+ /**
3148
+ * Multi checkbox structure.
3149
+ */
3150
+ /* @__PURE__ */ Zr(
3151
+ /* @__PURE__ */ Yr("$label"),
3152
+ /* @__PURE__ */ ee("$help"),
3153
+ /* @__PURE__ */ Ur(
3154
+ /* @__PURE__ */ Br(
3155
+ /* @__PURE__ */ et(
3156
+ /* @__PURE__ */ Qe(
3157
+ /* @__PURE__ */ te(),
3158
+ /* @__PURE__ */ we(/* @__PURE__ */ Je(), {
3159
+ bind: "$option.attrs",
3160
+ attrs: {
3161
+ id: "$option.attrs.id",
3162
+ value: "$option.value",
3163
+ checked: "$fns.isChecked($option.value)"
3164
+ }
3165
+ }),
3166
+ /* @__PURE__ */ tt(/* @__PURE__ */ D("decorator")),
3167
+ /* @__PURE__ */ re()
3168
+ ),
3169
+ /* @__PURE__ */ we(/* @__PURE__ */ Xe("$option.label"), {
3170
+ if: "$option.label"
3171
+ })
3172
+ ),
3173
+ /* @__PURE__ */ Hr("$option.help")
3174
+ )
3175
+ )
3176
+ )
3177
+ ),
3178
+ // Help text only goes under the input when it is a single.
3179
+ /* @__PURE__ */ ie("$options == undefined && $help", /* @__PURE__ */ ee("$help")),
3180
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value"))
3181
+ ),
3182
+ /**
3183
+ * The type of node, can be a list, group, or input.
3184
+ */
3185
+ type: "input",
3186
+ /**
3187
+ * The family of inputs this one belongs too. For example "text" and "email"
3188
+ * are both part of the "text" family. This is primary used for styling.
3189
+ */
3190
+ family: "box",
3191
+ /**
3192
+ * An array of extra props to accept for this input.
3193
+ */
3194
+ props: ["options", "onValue", "offValue", "optionsLoader"],
3195
+ /**
3196
+ * Additional features that should be added to your input
3197
+ */
3198
+ features: [
3199
+ Rt,
3200
+ Qa,
3201
+ _e("decorator", "checkboxDecorator")
3202
+ ],
3203
+ /**
3204
+ * The key used to memoize the schema.
3205
+ */
3206
+ schemaMemoKey: "qje02tb3gu8"
3207
+ }, ml = {
3208
+ /**
3209
+ * The actual schema of the input, or a function that returns the schema.
3210
+ */
3211
+ schema: /* @__PURE__ */ fe(
3212
+ /* @__PURE__ */ Oe(
3213
+ /* @__PURE__ */ Le("$label"),
3214
+ /* @__PURE__ */ De(
3215
+ /* @__PURE__ */ D("prefix", "label"),
3216
+ /* @__PURE__ */ te(),
3217
+ /* @__PURE__ */ Da(),
3218
+ /* @__PURE__ */ qa(
3219
+ /* @__PURE__ */ La(
3220
+ /* @__PURE__ */ D("fileItem"),
3221
+ /* @__PURE__ */ Ta("$file.name"),
3222
+ /* @__PURE__ */ ie(
3223
+ "$value.length === 1",
3224
+ /* @__PURE__ */ Gt(
3225
+ /* @__PURE__ */ D("fileRemove"),
3226
+ '$ui.remove.value + " " + $file.name'
3227
+ )
3228
+ )
3229
+ )
3230
+ ),
3231
+ /* @__PURE__ */ ie("$value.length > 1", /* @__PURE__ */ Gt("$ui.removeAll.value")),
3232
+ /* @__PURE__ */ za(/* @__PURE__ */ D("noFiles"), "$ui.noFiles.value"),
3233
+ /* @__PURE__ */ re(),
3234
+ /* @__PURE__ */ D("suffix")
3235
+ )
3236
+ ),
3237
+ /* @__PURE__ */ ee("$help"),
3238
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value"))
3239
+ ),
3240
+ /**
3241
+ * The type of node, can be a list, group, or input.
3242
+ */
3243
+ type: "input",
3244
+ /**
3245
+ * The family of inputs this one belongs too. For example "text" and "email"
3246
+ * are both part of the "text" family. This is primary used for styling.
3247
+ */
3248
+ family: "text",
3249
+ /**
3250
+ * An array of extra props to accept for this input.
3251
+ */
3252
+ props: [],
3253
+ /**
3254
+ * Additional features that should be added to your input
3255
+ */
3256
+ features: [
3257
+ Xa,
3258
+ _e("fileItem", "fileItem"),
3259
+ _e("fileRemove", "fileRemove"),
3260
+ _e("noFiles", "noFiles")
3261
+ ],
3262
+ /**
3263
+ * The key used to memoize the schema.
3264
+ */
3265
+ schemaMemoKey: "9kqc4852fv8"
3266
+ }, dl = {
3267
+ /**
3268
+ * The actual schema of the input, or a function that returns the schema.
3269
+ */
3270
+ schema: /* @__PURE__ */ Ka(
3271
+ "$slots.default",
3272
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value")),
3273
+ /* @__PURE__ */ Fa(/* @__PURE__ */ Ba())
3274
+ ),
3275
+ /**
3276
+ * The type of node, can be a list, group, or input.
3277
+ */
3278
+ type: "group",
3279
+ /**
3280
+ * An array of extra props to accept for this input.
3281
+ */
3282
+ props: [
3283
+ "actions",
3284
+ "submit",
3285
+ "submitLabel",
3286
+ "submitAttrs",
3287
+ "submitBehavior",
3288
+ "incompleteMessage"
3289
+ ],
3290
+ /**
3291
+ * Additional features that should be added to your input
3292
+ */
3293
+ features: [tl, Ft],
3294
+ /**
3295
+ * The key used to memoize the schema.
3296
+ */
3297
+ schemaMemoKey: "5bg016redjo"
3298
+ }, yl = {
3299
+ /**
3300
+ * The actual schema of the input, or a function that returns the schema.
3301
+ */
3302
+ schema: /* @__PURE__ */ jt("$slots.default"),
3303
+ /**
3304
+ * The type of node, can be a list, group, or input.
3305
+ */
3306
+ type: "group",
3307
+ /**
3308
+ * An array of extra props to accept for this input.
3309
+ */
3310
+ props: [],
3311
+ /**
3312
+ * Additional features that should be added to your input
3313
+ */
3314
+ features: [Ft, Jr]
3315
+ }, vl = {
3316
+ /**
3317
+ * The actual schema of the input, or a function that returns the schema.
3318
+ */
3319
+ schema: /* @__PURE__ */ Gr(),
3320
+ /**
3321
+ * The type of node, can be a list, group, or input.
3322
+ */
3323
+ type: "input",
3324
+ /**
3325
+ * An array of extra props to accept for this input.
3326
+ */
3327
+ props: [],
3328
+ /**
3329
+ * Additional features that should be added to your input
3330
+ */
3331
+ features: [tn]
3332
+ }, gl = {
3333
+ /**
3334
+ * The actual schema of the input, or a function that returns the schema.
3335
+ */
3336
+ schema: /* @__PURE__ */ jt("$slots.default"),
3337
+ /**
3338
+ * The type of node, can be a list, group, or input.
3339
+ */
3340
+ type: "list",
3341
+ /**
3342
+ * An array of extra props to accept for this input.
3343
+ */
3344
+ props: ["sync", "dynamic"],
3345
+ /**
3346
+ * Additional features that should be added to your input
3347
+ */
3348
+ features: [Ft, Jr]
3349
+ }, hl = {
3350
+ /**
3351
+ * The actual schema of the input, or a function that returns the schema.
3352
+ */
3353
+ schema: /* @__PURE__ */ jt(),
3354
+ /**
3355
+ * The type of node, can be a list, group, or input.
3356
+ */
3357
+ type: "input",
3358
+ /**
3359
+ * An array of extra props to accept for this input.
3360
+ */
3361
+ props: [],
3362
+ /**
3363
+ * Additional features that should be added to your input
3364
+ */
3365
+ features: []
3366
+ }, bl = {
3367
+ /**
3368
+ * The actual schema of the input, or a function that returns the schema.
3369
+ */
3370
+ schema: /* @__PURE__ */ fe(
3371
+ /* @__PURE__ */ ie(
3372
+ "$options == undefined",
3373
+ /**
3374
+ * Single radio structure.
3375
+ */
3376
+ /* @__PURE__ */ et(
3377
+ /* @__PURE__ */ Qe(/* @__PURE__ */ te(), /* @__PURE__ */ Je(), /* @__PURE__ */ tt(/* @__PURE__ */ D("decorator")), /* @__PURE__ */ re()),
3378
+ /* @__PURE__ */ we(/* @__PURE__ */ Xe("$label"), {
3379
+ if: "$label"
3380
+ })
3381
+ ),
3382
+ /**
3383
+ * Multi radio structure.
3384
+ */
3385
+ /* @__PURE__ */ Zr(
3386
+ /* @__PURE__ */ Yr("$label"),
3387
+ /* @__PURE__ */ ee("$help"),
3388
+ /* @__PURE__ */ Ur(
3389
+ /* @__PURE__ */ Br(
3390
+ /* @__PURE__ */ et(
3391
+ /* @__PURE__ */ Qe(
3392
+ /* @__PURE__ */ te(),
3393
+ /* @__PURE__ */ we(/* @__PURE__ */ Je(), {
3394
+ bind: "$option.attrs",
3395
+ attrs: {
3396
+ id: "$option.attrs.id",
3397
+ value: "$option.value",
3398
+ checked: "$fns.isChecked($option.value)"
3399
+ }
3400
+ }),
3401
+ /* @__PURE__ */ tt(/* @__PURE__ */ D("decorator")),
3402
+ /* @__PURE__ */ re()
3403
+ ),
3404
+ /* @__PURE__ */ we(/* @__PURE__ */ Xe("$option.label"), {
3405
+ if: "$option.label"
3406
+ })
3407
+ ),
3408
+ /* @__PURE__ */ Hr("$option.help")
3409
+ )
3410
+ )
3411
+ )
3412
+ ),
3413
+ // Help text only goes under the input when it is a single.
3414
+ /* @__PURE__ */ ie("$options == undefined && $help", /* @__PURE__ */ ee("$help")),
3415
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value"))
3416
+ ),
3417
+ /**
3418
+ * The type of node, can be a list, group, or input.
3419
+ */
3420
+ type: "input",
3421
+ /**
3422
+ * The family of inputs this one belongs too. For example "text" and "email"
3423
+ * are both part of the "text" family. This is primary used for styling.
3424
+ */
3425
+ family: "box",
3426
+ /**
3427
+ * An array of extra props to accept for this input.
3428
+ */
3429
+ props: ["options", "onValue", "offValue", "optionsLoader"],
3430
+ /**
3431
+ * Additional features that should be added to your input
3432
+ */
3433
+ features: [Rt, al, _e("decorator", "radioDecorator")],
3434
+ /**
3435
+ * The key used to memoize the schema.
3436
+ */
3437
+ schemaMemoKey: "qje02tb3gu8"
3438
+ }, $l = {
3439
+ /**
3440
+ * The actual schema of the input, or a function that returns the schema.
3441
+ */
3442
+ schema: /* @__PURE__ */ fe(
3443
+ /* @__PURE__ */ Oe(
3444
+ /* @__PURE__ */ Le("$label"),
3445
+ /* @__PURE__ */ De(
3446
+ /* @__PURE__ */ D("prefix"),
3447
+ /* @__PURE__ */ te(),
3448
+ /* @__PURE__ */ Ha(
3449
+ /* @__PURE__ */ ie(
3450
+ "$slots.default",
3451
+ () => "$slots.default",
3452
+ /* @__PURE__ */ Qt(
3453
+ /* @__PURE__ */ ie(
3454
+ "$option.group",
3455
+ /* @__PURE__ */ Wa(/* @__PURE__ */ Qt(/* @__PURE__ */ Jt("$option.label"))),
3456
+ /* @__PURE__ */ Jt("$option.label")
3457
+ )
3458
+ )
3459
+ )
3460
+ ),
3461
+ /* @__PURE__ */ ie("$attrs.multiple !== undefined", () => "", /* @__PURE__ */ D("select")),
3462
+ /* @__PURE__ */ re(),
3463
+ /* @__PURE__ */ D("suffix")
3464
+ )
3465
+ ),
3466
+ /* @__PURE__ */ ee("$help"),
3467
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value"))
3468
+ ),
3469
+ /**
3470
+ * The type of node, can be a list, group, or input.
3471
+ */
3472
+ type: "input",
3473
+ /**
3474
+ * An array of extra props to accept for this input.
3475
+ */
3476
+ props: ["options", "placeholder", "optionsLoader"],
3477
+ /**
3478
+ * Additional features that should be added to your input
3479
+ */
3480
+ features: [Rt, fl, _e("select", "select")],
3481
+ /**
3482
+ * The key used to memoize the schema.
3483
+ */
3484
+ schemaMemoKey: "cb119h43krg"
3485
+ }, _l = {
3486
+ /**
3487
+ * The actual schema of the input, or a function that returns the schema.
3488
+ */
3489
+ schema: /* @__PURE__ */ fe(
3490
+ /* @__PURE__ */ Oe(
3491
+ /* @__PURE__ */ Le("$label"),
3492
+ /* @__PURE__ */ De(
3493
+ /* @__PURE__ */ D("prefix", "label"),
3494
+ /* @__PURE__ */ te(),
3495
+ /* @__PURE__ */ Ua(),
3496
+ /* @__PURE__ */ re(),
3497
+ /* @__PURE__ */ D("suffix")
3498
+ )
3499
+ ),
3500
+ /* @__PURE__ */ ee("$help"),
3501
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value"))
3502
+ ),
3503
+ /**
3504
+ * The type of node, can be a list, group, or input.
3505
+ */
3506
+ type: "input",
3507
+ /**
3508
+ * An array of extra props to accept for this input.
3509
+ */
3510
+ props: [],
3511
+ /**
3512
+ * Additional features that should be added to your input
3513
+ */
3514
+ features: [nl],
3515
+ /**
3516
+ * The key used to memoize the schema.
3517
+ */
3518
+ schemaMemoKey: "b1n0td79m9g"
3519
+ }, K = {
3520
+ /**
3521
+ * The actual schema of the input, or a function that returns the schema.
3522
+ */
3523
+ schema: /* @__PURE__ */ fe(
3524
+ /* @__PURE__ */ Oe(
3525
+ /* @__PURE__ */ Le("$label"),
3526
+ /* @__PURE__ */ De(
3527
+ /* @__PURE__ */ D("prefix", "label"),
3528
+ /* @__PURE__ */ te(),
3529
+ /* @__PURE__ */ Gr(),
3530
+ /* @__PURE__ */ re(),
3531
+ /* @__PURE__ */ D("suffix")
3532
+ )
3533
+ ),
3534
+ /* @__PURE__ */ ee("$help"),
3535
+ /* @__PURE__ */ ue(/* @__PURE__ */ oe("$message.value"))
3536
+ ),
3537
+ /**
3538
+ * The type of node, can be a list, group, or input.
3539
+ */
3540
+ type: "input",
3541
+ /**
3542
+ * The family of inputs this one belongs too. For example "text" and "email"
3543
+ * are both part of the "text" family. This is primary used for styling.
3544
+ */
3545
+ family: "text",
3546
+ /**
3547
+ * An array of extra props to accept for this input.
3548
+ */
3549
+ props: [],
3550
+ /**
3551
+ * Additional features that should be added to your input
3552
+ */
3553
+ features: [tn],
3554
+ /**
3555
+ * The key used to memoize the schema.
3556
+ */
3557
+ schemaMemoKey: "c3cc4kflsg"
3558
+ }, wl = {
3559
+ button: rr,
3560
+ submit: rr,
3561
+ checkbox: pl,
3562
+ file: ml,
3563
+ form: dl,
3564
+ group: yl,
3565
+ hidden: vl,
3566
+ list: gl,
3567
+ meta: hl,
3568
+ radio: bl,
3569
+ select: $l,
3570
+ textarea: _l,
3571
+ text: K,
3572
+ color: K,
3573
+ date: K,
3574
+ datetimeLocal: K,
3575
+ email: K,
3576
+ month: K,
3577
+ number: K,
3578
+ password: K,
3579
+ search: K,
3580
+ tel: K,
3581
+ time: K,
3582
+ url: K,
3583
+ week: K,
3584
+ range: K
3585
+ }, J = void 0, X = null, rt, sn = !1, xe = !1, kl = /* @__PURE__ */ new Promise((e) => {
3586
+ rt = () => {
3587
+ sn = !0, e();
3588
+ };
3589
+ }), ae = typeof window < "u" && typeof fetch < "u";
3590
+ J = ae ? /* @__PURE__ */ getComputedStyle(document.documentElement) : void 0;
3591
+ var be = {}, ot = {};
3592
+ function Sl(e, t, r, n) {
3593
+ t && Object.assign(be, t), ae && !xe && (J != null && J.getPropertyValue("--formkit-theme")) ? (rt(), xe = !0) : e && !xe && ae ? Al(e) : !xe && ae && rt();
3594
+ const s = function(a) {
3595
+ var l, o;
3596
+ a.addProps(["iconLoader", "iconLoaderUrl"]), a.props.iconHandler = nr(
3597
+ (l = a.props) != null && l.iconLoader ? a.props.iconLoader : n,
3598
+ (o = a.props) != null && o.iconLoaderUrl ? a.props.iconLoaderUrl : r
3599
+ ), El(a, a.props.iconHandler), a.on("created", () => {
3600
+ var y, v;
3601
+ (y = a == null ? void 0 : a.context) != null && y.handlers && (a.context.handlers.iconClick = (h) => {
3602
+ const O = `on${h.charAt(0).toUpperCase()}${h.slice(1)}IconClick`, g = a.props[O];
3603
+ if (g && typeof g == "function")
3604
+ return (b) => g(a, b);
3605
+ }), (v = a == null ? void 0 : a.context) != null && v.fns && (a.context.fns.iconRole = (h) => {
3606
+ const O = `on${h.charAt(0).toUpperCase()}${h.slice(1)}IconClick`;
3607
+ return typeof a.props[O] == "function" ? "button" : null;
3608
+ });
3609
+ });
3610
+ };
3611
+ return s.iconHandler = nr(n, r), s;
3612
+ }
3613
+ function Al(e) {
3614
+ if (!(!e || !ae || typeof getComputedStyle != "function") && (xe = !0, X = document.getElementById("formkit-theme"), e && // if we have a window object
3615
+ ae && // we don't have an existing theme OR the theme being set up is different
3616
+ (!(J != null && J.getPropertyValue("--formkit-theme")) && !X || X != null && X.getAttribute("data-theme") && (X == null ? void 0 : X.getAttribute("data-theme")) !== e))) {
3617
+ const r = `https://cdn.jsdelivr.net/npm/@formkit/themes@${Ye.startsWith("__") ? "latest" : Ye}/dist/${e}/theme.css`, n = document.createElement("link");
3618
+ n.type = "text/css", n.rel = "stylesheet", n.id = "formkit-theme", n.setAttribute("data-theme", e), n.onload = () => {
3619
+ J = getComputedStyle(document.documentElement), rt();
3620
+ }, document.head.appendChild(n), n.href = r, X && X.remove();
3621
+ }
3622
+ }
3623
+ function nr(e, t) {
3624
+ return (r) => {
3625
+ if (typeof r != "string")
3626
+ return;
3627
+ if (r.startsWith("<svg"))
3628
+ return r;
3629
+ const n = r.startsWith("default:");
3630
+ r = n ? r.split(":")[1] : r;
3631
+ const s = r in be;
3632
+ let i;
3633
+ if (s)
3634
+ return be[r];
3635
+ if (!ot[r]) {
3636
+ if (i = Cl(r), i = ae && typeof i > "u" ? Promise.resolve(i) : i, i instanceof Promise)
3637
+ ot[r] = i.then((a) => !a && typeof r == "string" && !n ? i = typeof e == "function" ? e(r) : Pl(r, t) : a).then((a) => (typeof r == "string" && (be[n ? `default:${r}` : r] = a), a));
3638
+ else if (typeof i == "string")
3639
+ return be[n ? `default:${r}` : r] = i, i;
3640
+ }
3641
+ return ot[r];
3642
+ };
3643
+ }
3644
+ function Cl(e) {
3645
+ if (ae)
3646
+ return sn ? sr(e) : kl.then(() => sr(e));
3647
+ }
3648
+ function sr(e) {
3649
+ const t = J == null ? void 0 : J.getPropertyValue(`--fk-icon-${e}`);
3650
+ if (t) {
3651
+ const r = atob(t);
3652
+ if (r.startsWith("<svg"))
3653
+ return be[e] = r, r;
3654
+ }
3655
+ }
3656
+ function Pl(e, t) {
3657
+ const r = Ye.startsWith("__") ? "latest" : Ye, n = typeof t == "function" ? t(e) : `https://cdn.jsdelivr.net/npm/@formkit/icons@${r}/dist/icons/${e}.svg`;
3658
+ if (ae)
3659
+ return fetch(`${n}`).then(async (s) => {
3660
+ const i = await s.text();
3661
+ if (i.startsWith("<svg"))
3662
+ return i;
3663
+ }).catch((s) => {
3664
+ console.error(s);
3665
+ });
3666
+ }
3667
+ function El(e, t) {
3668
+ const r = /^[a-zA-Z-]+(?:-icon|Icon)$/;
3669
+ Object.keys(e.props).filter((s) => r.test(s)).forEach((s) => Ol(e, t, s));
3670
+ }
3671
+ function Ol(e, t, r) {
3672
+ const n = e.props[r], s = t(n), i = `_raw${r.charAt(0).toUpperCase()}${r.slice(1)}`, a = `on${r.charAt(0).toUpperCase()}${r.slice(1)}Click`;
3673
+ if (e.addProps([i, a]), e.on(`prop:${r}`, Il), s instanceof Promise)
3674
+ return s.then((l) => {
3675
+ e.props[i] = l;
3676
+ });
3677
+ e.props[i] = s;
3678
+ }
3679
+ function Il(e) {
3680
+ var a;
3681
+ const t = e.origin, r = e.payload, n = (a = t == null ? void 0 : t.props) == null ? void 0 : a.iconHandler, s = e.name.split(":")[1], i = `_raw${s.charAt(0).toUpperCase()}${s.slice(1)}`;
3682
+ if (n && typeof n == "function") {
3683
+ const l = n(r);
3684
+ if (l instanceof Promise)
3685
+ return l.then((o) => {
3686
+ t.props[i] = o;
3687
+ });
3688
+ t.props[i] = l;
3689
+ }
3690
+ }
3691
+ var ir = {
3692
+ /**
3693
+ * FormKit errors:
3694
+ */
3695
+ 100: ({ data: e }) => `Only groups, lists, and forms can have children (${e.name}).`,
3696
+ 101: ({ data: e }) => `You cannot directly modify the store (${e.name}). See: https://formkit.com/advanced/core#message-store`,
3697
+ 102: ({
3698
+ data: [e, t]
3699
+ }) => `You cannot directly assign node.${t} (${e.name})`,
3700
+ 103: ({ data: [e] }) => `Schema expressions cannot start with an operator (${e})`,
3701
+ 104: ({ data: [e, t] }) => `Schema expressions cannot end with an operator (${e} in "${t}")`,
3702
+ 105: ({ data: e }) => `Invalid schema expression: ${e}`,
3703
+ 106: ({ data: e }) => `Cannot submit because (${e}) is not in a form.`,
3704
+ 107: ({ data: [e, t] }) => `Cannot set ${e.name} to non object value: ${t}`,
3705
+ 108: ({ data: [e, t] }) => `Cannot set ${e.name} to non array value: ${t}`,
3706
+ /**
3707
+ * Input specific errors:
3708
+ */
3709
+ 300: ({ data: [e] }) => `Cannot set behavior prop to overscroll (on ${e.name} input) when options prop is a function.`,
3710
+ /**
3711
+ * FormKit vue errors:
3712
+ */
3713
+ 600: ({ data: e }) => `Unknown input type${typeof e.props.type == "string" ? ' "' + e.props.type + '"' : ""} ("${e.name}")`,
3714
+ 601: ({ data: e }) => `Input definition${typeof e.props.type == "string" ? ' "' + e.props.type + '"' : ""} is missing a schema or component property (${e.name}).`
3715
+ }, ar = {
3716
+ /**
3717
+ * Core warnings:
3718
+ */
3719
+ 150: ({ data: e }) => `Schema function "${e}()" is not a valid function.`,
3720
+ 151: ({ data: e }) => `No form element with id: ${e}`,
3721
+ 152: ({ data: e }) => `No input element with id: ${e}`,
3722
+ /**
3723
+ * Input specific warnings:
3724
+ */
3725
+ 350: ({
3726
+ data: { node: e, inputType: t }
3727
+ }) => `Invalid options prop for ${e.name} input (${t}). See https://formkit.com/inputs/${t}`,
3728
+ /**
3729
+ * Vue warnings:
3730
+ */
3731
+ 650: 'Schema "$get()" must use the id of an input to access.',
3732
+ 651: ({ data: e }) => `Cannot setErrors() on "${e}" because no such id exists.`,
3733
+ 652: ({ data: e }) => `Cannot clearErrors() on "${e}" because no such id exists.`,
3734
+ /**
3735
+ * Deprecation warnings:
3736
+ */
3737
+ 800: ({ data: e }) => `${e} is deprecated.`
3738
+ }, Ml = (e, t) => {
3739
+ if (e.code in ir) {
3740
+ const r = ir[e.code];
3741
+ e.message = typeof r == "function" ? r(e) : r;
3742
+ }
3743
+ return t(e);
3744
+ }, lr = !1;
3745
+ function xl() {
3746
+ lr || (Pt(Ml), Et(Rl), lr = !0);
3747
+ }
3748
+ var Rl = (e, t) => {
3749
+ if (e.code in ar) {
3750
+ const r = ar[e.code];
3751
+ e.message = typeof r == "function" ? r(e) : r;
3752
+ }
3753
+ return t(e);
3754
+ }, jl = Object.defineProperty, Fl = Object.getOwnPropertyNames, an = (e, t) => function() {
3755
+ return e && (t = (0, e[Fl(e)[0]])(e = 0)), t;
3756
+ }, Vl = (e, t) => {
3757
+ for (var r in t)
3758
+ jl(e, r, { get: t[r], enumerable: !0 });
3759
+ }, or, ln, on = an({
3760
+ "packages/vue/src/bindings.ts"() {
3761
+ or = function(t) {
3762
+ t.ledger.count("blocking", (f) => f.blocking);
3763
+ const r = z(!t.ledger.value("blocking"));
3764
+ t.ledger.count("errors", (f) => f.type === "error");
3765
+ const n = z(!!t.ledger.value("errors"));
3766
+ let s = !1;
3767
+ $n(() => {
3768
+ s = !0;
3769
+ });
3770
+ const i = Ie(
3771
+ t.store.reduce((f, k) => (k.visible && (f[k.key] = k), f), {})
3772
+ ), a = z(
3773
+ t.props.validationVisibility || (t.props.type === "checkbox" ? "dirty" : "blur")
3774
+ );
3775
+ t.on("prop:validationVisibility", ({ payload: f }) => {
3776
+ a.value = f;
3777
+ });
3778
+ const l = z(a.value === "live"), o = z(!1), y = (f) => {
3779
+ o.value = (f ?? []).some(
3780
+ (k) => k.name === "required"
3781
+ );
3782
+ };
3783
+ y(t.props.parsedRules), t.on("prop:parsedRules", ({ payload: f }) => y(f));
3784
+ const v = z(t.children.map((f) => f.uid)), h = me(() => {
3785
+ if (!p.state)
3786
+ return !1;
3787
+ if (p.state.submitted)
3788
+ return !0;
3789
+ if (!l.value && !p.state.settled)
3790
+ return !1;
3791
+ switch (a.value) {
3792
+ case "live":
3793
+ return !0;
3794
+ case "blur":
3795
+ return p.state.blurred;
3796
+ case "dirty":
3797
+ return p.state.dirty;
3798
+ default:
3799
+ return !1;
3800
+ }
3801
+ }), O = me(() => p.state.failing && h.value), g = me(() => p && b.value ? r.value && !n.value : p.state.dirty && !Z(p.value)), b = z(
3802
+ Array.isArray(t.props.parsedRules) && t.props.parsedRules.length > 0
3803
+ );
3804
+ t.on("prop:parsedRules", ({ payload: f }) => {
3805
+ b.value = Array.isArray(f) && f.length > 0;
3806
+ });
3807
+ const c = me(() => {
3808
+ const f = {};
3809
+ for (const k in i) {
3810
+ const C = i[k];
3811
+ (C.type !== "validation" || h.value) && (f[k] = C);
3812
+ }
3813
+ return f;
3814
+ }), m = Ie(
3815
+ t.store.reduce((f, k) => (k.type === "ui" && k.visible && (f[k.key] = k), f), {})
3816
+ ), d = me(() => !p.state.failing), _ = Ie({}), S = new Proxy(_, {
3817
+ get(...f) {
3818
+ if (!t)
3819
+ return "";
3820
+ const [k, C] = f;
3821
+ let V = Reflect.get(...f);
3822
+ return !V && typeof C == "string" && !P(k, C) && !C.startsWith("__v") && st(t).watch((N) => {
3823
+ const ce = typeof N.config.rootClasses == "function" ? N.config.rootClasses(C, N) : {}, Q = N.config.classes ? He(C, N, N.config.classes[C]) : {}, ve = He(
3824
+ C,
3825
+ N,
3826
+ N.props[`_${C}Class`]
3827
+ ), pe = He(
3828
+ C,
3829
+ N,
3830
+ N.props[`${C}Class`]
3831
+ );
3832
+ V = Us(
3833
+ N,
3834
+ C,
3835
+ ce,
3836
+ Q,
3837
+ ve,
3838
+ pe
3839
+ ), k[C] = V ?? "";
3840
+ }), V;
3841
+ }
3842
+ });
3843
+ t.on("prop:rootClasses", () => {
3844
+ const f = Object.keys(_);
3845
+ for (const k of f)
3846
+ delete _[k];
3847
+ });
3848
+ const $ = me(() => {
3849
+ if (!t)
3850
+ return;
3851
+ const f = [];
3852
+ p.help && f.push(`help-${t.props.id}`);
3853
+ for (const k in c.value)
3854
+ f.push(`${t.props.id}-${k}`);
3855
+ return f.length ? f.join(" ") : void 0;
3856
+ }), w = z(t.value), u = z(t.value), p = Ie({
3857
+ _value: u,
3858
+ attrs: t.props.attrs,
3859
+ disabled: t.props.disabled,
3860
+ describedBy: $,
3861
+ fns: {
3862
+ length: (f) => Object.keys(f).length,
3863
+ number: (f) => Number(f),
3864
+ string: (f) => String(f),
3865
+ json: (f) => JSON.stringify(f),
3866
+ eq: T
3867
+ },
3868
+ handlers: {
3869
+ blur: (f) => {
3870
+ t && (t.store.set(
3871
+ /* @__PURE__ */ H({ key: "blurred", visible: !1, value: !0 })
3872
+ ), typeof t.props.attrs.onBlur == "function" && t.props.attrs.onBlur(f));
3873
+ },
3874
+ touch: () => {
3875
+ var C;
3876
+ const f = p.dirtyBehavior === "compare";
3877
+ if ((C = t.store.dirty) != null && C.value && !f)
3878
+ return;
3879
+ const k = !T(t.props._init, t._value);
3880
+ !k && !f || t.store.set(
3881
+ /* @__PURE__ */ H({ key: "dirty", visible: !1, value: k })
3882
+ );
3883
+ },
3884
+ DOMInput: (f) => {
3885
+ t.input(f.target.value), t.emit("dom-input-event", f);
3886
+ }
3887
+ },
3888
+ help: t.props.help,
3889
+ id: t.props.id,
3890
+ items: v,
3891
+ label: t.props.label,
3892
+ messages: c,
3893
+ didMount: !1,
3894
+ node: nt(t),
3895
+ options: t.props.options,
3896
+ defaultMessagePlacement: !0,
3897
+ slots: t.props.__slots,
3898
+ state: {
3899
+ blurred: !1,
3900
+ complete: g,
3901
+ dirty: !1,
3902
+ empty: Z(w),
3903
+ submitted: !1,
3904
+ settled: t.isSettled,
3905
+ valid: r,
3906
+ invalid: O,
3907
+ errors: n,
3908
+ rules: b,
3909
+ validationVisible: h,
3910
+ required: o,
3911
+ failing: !1,
3912
+ passing: d
3913
+ },
3914
+ type: t.props.type,
3915
+ family: t.props.family,
3916
+ ui: m,
3917
+ value: w,
3918
+ classes: S
3919
+ });
3920
+ t.on("created", () => {
3921
+ T(p.value, t.value) || (u.value = t.value, w.value = t.value, Te(w), Te(u)), (async () => (await t.settled, t && (t.props._init = U(t.value))))();
3922
+ }), t.on("mounted", () => {
3923
+ p.didMount = !0;
3924
+ }), t.on("settled", ({ payload: f }) => {
3925
+ p.state.settled = f;
3926
+ });
3927
+ function E(f) {
3928
+ (Array.isArray(f) ? f : Object.keys(f)).forEach((C) => {
3929
+ C = $e(C), P(p, C) || (p[C] = t.props[C]), t.on(`prop:${C}`, ({ payload: V }) => {
3930
+ p[C] = V;
3931
+ });
3932
+ });
3933
+ }
3934
+ E((() => {
3935
+ const f = [
3936
+ "__root",
3937
+ "help",
3938
+ "label",
3939
+ "disabled",
3940
+ "options",
3941
+ "type",
3942
+ "attrs",
3943
+ "preserve",
3944
+ "preserveErrors",
3945
+ "id",
3946
+ "dirtyBehavior"
3947
+ ], k = /^[a-zA-Z-]+(?:-icon|Icon)$/, C = Object.keys(t.props).filter((V) => k.test(V));
3948
+ return f.concat(C);
3949
+ })());
3950
+ function j(f) {
3951
+ f.props && E(f.props);
3952
+ }
3953
+ t.props.definition && j(t.props.definition), t.on("added-props", ({ payload: f }) => E(f)), t.on("input", ({ payload: f }) => {
3954
+ t.type !== "input" && !pt(f) && !Dt(f) ? u.value = dt(f) : (u.value = f, Te(u));
3955
+ }), t.on("commitRaw", ({ payload: f }) => {
3956
+ t.type !== "input" && !pt(f) && !Dt(f) ? w.value = u.value = dt(f) : (w.value = u.value = f, Te(w)), t.emit("modelUpdated");
3957
+ }), t.on("commit", ({ payload: f }) => {
3958
+ var k;
3959
+ if ((!p.state.dirty || p.dirtyBehavior === "compare") && t.isCreated && s)
3960
+ if (!((k = t.store.validating) != null && k.value))
3961
+ p.handlers.touch();
3962
+ else {
3963
+ const C = t.on("message-removed", ({ payload: V }) => {
3964
+ V.key === "validating" && (p.handlers.touch(), t.off(C));
3965
+ });
3966
+ }
3967
+ g && t.type === "input" && n.value && !G(t.props.preserveErrors) && t.store.filter(
3968
+ (C) => {
3969
+ var V;
3970
+ return !(C.type === "error" && ((V = C.meta) == null ? void 0 : V.autoClear) === !0);
3971
+ }
3972
+ ), t.type === "list" && t.sync && (v.value = t.children.map((C) => C.uid)), p.state.empty = Z(f);
3973
+ });
3974
+ const M = async (f) => {
3975
+ f.type === "ui" && f.visible && !f.meta.showAsMessage ? m[f.key] = f : f.visible ? i[f.key] = f : f.type === "state" && (p.state[f.key] = !!f.value);
3976
+ };
3977
+ t.on("message-added", (f) => M(f.payload)), t.on("message-updated", (f) => M(f.payload)), t.on("message-removed", ({ payload: f }) => {
3978
+ delete m[f.key], delete i[f.key], delete p.state[f.key];
3979
+ }), t.on("settled:blocking", () => {
3980
+ r.value = !0;
3981
+ }), t.on("unsettled:blocking", () => {
3982
+ r.value = !1;
3983
+ }), t.on("settled:errors", () => {
3984
+ n.value = !1;
3985
+ }), t.on("unsettled:errors", () => {
3986
+ n.value = !0;
3987
+ }), Re(h, (f) => {
3988
+ f && (l.value = !0);
3989
+ }), t.context = p, t.emit("context", t, !1), t.on("destroyed", () => {
3990
+ t.context = void 0, t = null;
3991
+ });
3992
+ }, ln = or;
3993
+ }
3994
+ }), Nl = {};
3995
+ Vl(Nl, {
3996
+ defaultConfig: () => Vt
3997
+ });
3998
+ var Vt, Dl = an({
3999
+ "packages/vue/src/defaultConfig.ts"() {
4000
+ on(), Vt = (e = {}) => {
4001
+ xl();
4002
+ const {
4003
+ rules: t = {},
4004
+ locales: r = {},
4005
+ inputs: n = {},
4006
+ messages: s = {},
4007
+ locale: i = void 0,
4008
+ theme: a = void 0,
4009
+ iconLoaderUrl: l = void 0,
4010
+ iconLoader: o = void 0,
4011
+ icons: y = {},
4012
+ ...v
4013
+ } = e, h = da({
4014
+ ...ma,
4015
+ ...t || {}
4016
+ }), O = Ma(
4017
+ le({ en: Ia, ...r || {} }, s)
4018
+ ), g = xa(wl, n), b = Sl(a, y, l, o);
4019
+ return le(
4020
+ {
4021
+ plugins: [g, b, ln, O, h],
4022
+ ...i ? { config: { locale: i } } : {}
4023
+ },
4024
+ v || {},
4025
+ !0
4026
+ );
4027
+ };
4028
+ }
4029
+ }), Ll = typeof window > "u", ut = /* @__PURE__ */ new Map();
4030
+ function ql(e, t) {
4031
+ var r;
4032
+ !Ll || !e || (ut.has(e) || ut.set(e, /* @__PURE__ */ new Set()), (r = ut.get(e)) == null || r.add(t));
4033
+ }
4034
+ var un = typeof window > "u", Fe = {}, ke = {}, q, se = /* @__PURE__ */ new WeakMap(), Tl = "__raw__", Kl = /[a-zA-Z0-9\-][cC]lass$/;
4035
+ function zl(e, t) {
4036
+ const r = z(null);
4037
+ if (e === "get") {
4038
+ const s = {};
4039
+ return r.value = Wl.bind(null, s), r;
4040
+ }
4041
+ const n = e.split(".");
4042
+ return ne(() => {
4043
+ r.value = Nt(
4044
+ pt(t) ? t.value : t,
4045
+ n
4046
+ );
4047
+ }), r;
4048
+ }
4049
+ function Nt(e, t) {
4050
+ if (Array.isArray(e)) {
4051
+ for (const s of e) {
4052
+ const i = s !== !1 && Nt(s, t);
4053
+ if (i !== void 0)
4054
+ return i;
4055
+ }
4056
+ return;
4057
+ }
4058
+ let r, n = e;
4059
+ for (const s in t) {
4060
+ const i = t[s];
4061
+ if (typeof n != "object" || n === null) {
4062
+ r = void 0;
4063
+ break;
4064
+ }
4065
+ const a = n[i];
4066
+ if (Number(s) === t.length - 1 && a !== void 0) {
4067
+ r = typeof a == "function" ? a.bind(n) : a;
4068
+ break;
4069
+ }
4070
+ n = a;
4071
+ }
4072
+ return r;
4073
+ }
4074
+ function Wl(e, t) {
4075
+ if (typeof t != "string")
4076
+ return ye(650);
4077
+ if (t in e || (e[t] = z(void 0)), e[t].value === void 0) {
4078
+ e[t].value = null;
4079
+ const r = Ve(t);
4080
+ r && (e[t].value = r.context), Qn(t, ({ payload: n }) => {
4081
+ e[t].value = Ne(n) ? n.context : n;
4082
+ });
4083
+ }
4084
+ return e[t].value;
4085
+ }
4086
+ function ur(e, t, r) {
4087
+ function n(g, b) {
4088
+ const c = h(Y(b.if), { if: !0 }), m = y(g, b.then), d = b.else ? y(g, b.else) : null;
4089
+ return [c, m, d];
4090
+ }
4091
+ function s(g, b) {
4092
+ var _, S;
4093
+ const c = h(Y(g.if));
4094
+ let m = () => b, d = () => b;
4095
+ return typeof g.then == "object" ? d = i(g.then, void 0) : typeof g.then == "string" && ((_ = g.then) != null && _.startsWith("$")) ? d = h(Y(g.then)) : d = () => g.then, P(g, "else") && (typeof g.else == "object" ? m = i(g.else) : typeof g.else == "string" && ((S = g.else) != null && S.startsWith("$")) ? m = h(Y(g.else)) : m = () => g.else), () => c() ? d() : m();
4096
+ }
4097
+ function i(g, b, c = {}) {
4098
+ const m = new Set(Object.keys(g || {})), d = b ? h(Y(b)) : () => ({}), _ = [
4099
+ (S) => {
4100
+ const $ = d();
4101
+ for (const w in $)
4102
+ m.has(w) || (S[w] = $[w]);
4103
+ }
4104
+ ];
4105
+ if (g) {
4106
+ if (he(g))
4107
+ return s(
4108
+ g,
4109
+ c
4110
+ );
4111
+ for (let S in g) {
4112
+ const $ = g[S];
4113
+ let w;
4114
+ const u = typeof $ == "string";
4115
+ S.startsWith(Tl) ? (S = S.substring(7), w = () => $) : u && $.startsWith("$") && $.length > 1 && !($.startsWith("$reset") && Kl.test(S)) ? w = h(Y($)) : typeof $ == "object" && he($) ? w = s($, void 0) : typeof $ == "object" && Se($) ? w = i($) : w = () => $, _.push((p) => {
4116
+ p[S] = w();
4117
+ });
4118
+ }
4119
+ }
4120
+ return () => {
4121
+ const S = Array.isArray(g) ? [] : {};
4122
+ return _.forEach(($) => $(S)), S;
4123
+ };
4124
+ }
4125
+ function a(g, b) {
4126
+ let c = null, m = () => null, d = !1, _ = null, S = null, $ = null, w = !1;
4127
+ const u = Bs(b);
4128
+ if (bt(u) ? (c = u.$el, m = u.$el !== "text" ? i(u.attrs, u.bind) : () => null) : $t(u) ? (typeof u.$cmp == "string" ? P(g, u.$cmp) ? c = g[u.$cmp] : (c = u.$cmp, w = !0) : c = u.$cmp, m = i(u.props, u.bind)) : he(u) && ([d, _, S] = n(g, u)), !he(u) && "if" in u ? d = h(Y(u.if)) : !he(u) && c === null && (d = () => !0), "children" in u && u.children)
4129
+ if (typeof u.children == "string")
4130
+ if (u.children.startsWith("$slots."))
4131
+ c = c === "text" ? "slot" : c, _ = h(Y(u.children));
4132
+ else if (u.children.startsWith("$") && u.children.length > 1) {
4133
+ const p = h(Y(u.children));
4134
+ _ = () => String(p());
4135
+ } else
4136
+ _ = () => String(u.children);
4137
+ else if (Array.isArray(u.children))
4138
+ _ = y(g, u.children);
4139
+ else {
4140
+ const [p, E, R] = n(g, u.children);
4141
+ _ = (j) => p && p() ? E && E(j) : R && R(j);
4142
+ }
4143
+ if ($t(u))
4144
+ if (_) {
4145
+ const p = _;
4146
+ _ = (E) => ({
4147
+ default(R, j) {
4148
+ var k, C, V, F;
4149
+ const M = q;
4150
+ j && (q = j), R && ((k = se.get(q)) == null || k.unshift(R)), E && ((C = se.get(q)) == null || C.unshift(E));
4151
+ const f = p(E);
4152
+ return R && ((V = se.get(q)) == null || V.shift()), E && ((F = se.get(q)) == null || F.shift()), q = M, f;
4153
+ }
4154
+ }), _.slot = !0;
4155
+ } else
4156
+ _ = () => ({});
4157
+ if ("for" in u && u.for) {
4158
+ const p = u.for.length === 3 ? u.for[2] : u.for[1];
4159
+ $ = [
4160
+ typeof p == "string" && p.startsWith("$") ? h(Y(p)) : () => p,
4161
+ u.for[0],
4162
+ u.for.length === 3 ? String(u.for[1]) : null
4163
+ ];
4164
+ }
4165
+ return [d, c, m, _, S, $, w];
4166
+ }
4167
+ function l(g, b) {
4168
+ const c = g(b), m = q;
4169
+ return Object.keys(c).reduce((d, _) => {
4170
+ const S = c && c[_];
4171
+ return d[_] = ($) => S && S($, m) || null, d;
4172
+ }, {});
4173
+ }
4174
+ function o(g, b) {
4175
+ const [c, m, d, _, S, $, w] = a(g, b);
4176
+ let u = (p) => {
4177
+ if (c && m === null && _)
4178
+ return c() ? _(p) : S && S(p);
4179
+ if (m && (!c || c())) {
4180
+ if (m === "text" && _)
4181
+ return _n(String(_()));
4182
+ if (m === "slot" && _)
4183
+ return _(p);
4184
+ const E = w ? wn(m) : m, R = _ != null && _.slot ? l(_, p) : null;
4185
+ return mt(
4186
+ E,
4187
+ d(),
4188
+ R || (_ ? _(p) : [])
4189
+ );
4190
+ }
4191
+ return typeof S == "function" ? S(p) : S;
4192
+ };
4193
+ if ($) {
4194
+ const p = u, [E, R, j] = $;
4195
+ u = () => {
4196
+ const M = E(), f = Number.isFinite(M) ? Array(Number(M)).fill(0).map((F, N) => N) : M, k = [];
4197
+ if (typeof f != "object")
4198
+ return null;
4199
+ const C = se.get(q) || [], V = Array.isArray(f);
4200
+ for (const F in f) {
4201
+ if (V && F in Array.prototype)
4202
+ continue;
4203
+ const N = Object.defineProperty(
4204
+ {
4205
+ ...C.reduce(
4206
+ (ce, Q) => ce.__idata ? { ...ce, ...Q } : Q,
4207
+ {}
4208
+ ),
4209
+ [R]: f[F],
4210
+ ...j !== null ? { [j]: V ? Number(F) : F } : {}
4211
+ },
4212
+ "__idata",
4213
+ { enumerable: !1, value: !0 }
4214
+ );
4215
+ C.unshift(N), k.push(p.bind(null, N)()), C.shift();
4216
+ }
4217
+ return k;
4218
+ };
4219
+ }
4220
+ return u;
4221
+ }
4222
+ function y(g, b) {
4223
+ if (Array.isArray(b)) {
4224
+ const m = b.map(o.bind(null, g));
4225
+ return (d) => m.map((_) => _(d));
4226
+ }
4227
+ const c = o(g, b);
4228
+ return (m) => c(m);
4229
+ }
4230
+ const v = [];
4231
+ function h(g, b = {}) {
4232
+ const c = /* @__PURE__ */ new WeakMap();
4233
+ return v.push((m, d) => {
4234
+ c.set(
4235
+ d,
4236
+ g.provide((_) => m(_, b))
4237
+ );
4238
+ }), () => c.get(q)();
4239
+ }
4240
+ function O(g, b) {
4241
+ r ?? (r = cn(t));
4242
+ const [c, m] = P(Fe, r) ? Fe[r] : [y(e, t), v];
4243
+ return un || (ke[r] ?? (ke[r] = 0), ke[r]++, Fe[r] = [c, m]), m.forEach((d) => {
4244
+ d(g, b);
4245
+ }), () => (q = b, c());
4246
+ }
4247
+ return O;
4248
+ }
4249
+ function fn(e, t) {
4250
+ const r = se.get(q) || [];
4251
+ let n;
4252
+ return r.length && (n = Nt(r, e.split("."))), n === void 0 ? t : n;
4253
+ }
4254
+ function Hl(e, t) {
4255
+ return new Proxy(e, {
4256
+ get(...r) {
4257
+ let n;
4258
+ const s = r[1];
4259
+ if (typeof s == "string") {
4260
+ const i = q;
4261
+ q = t, n = fn(s, void 0), q = i;
4262
+ }
4263
+ return n !== void 0 ? n : Reflect.get(...r);
4264
+ }
4265
+ });
4266
+ }
4267
+ function fr(e, t, r) {
4268
+ return e(
4269
+ (n, s = {}) => n.reduce((i, a) => {
4270
+ if (a.startsWith("slots.")) {
4271
+ const l = a.substring(6), o = () => t.slots && P(t.slots, l) && typeof t.slots[l] == "function";
4272
+ if (s.if)
4273
+ i[a] = o;
4274
+ else if (t.slots) {
4275
+ const y = Hl(t, r);
4276
+ i[a] = () => o() ? t.slots[l](y) : null;
4277
+ }
4278
+ } else {
4279
+ const l = zl(a, t);
4280
+ i[a] = () => fn(a, l.value);
4281
+ }
4282
+ return i;
4283
+ }, {}),
4284
+ r
4285
+ );
4286
+ }
4287
+ function cr(e, t, r) {
4288
+ if (t ?? (t = cn(e)), ke[t]--, ke[t] === 0) {
4289
+ delete ke[t];
4290
+ const [, n] = Fe[t];
4291
+ delete Fe[t], n.length = 0;
4292
+ }
4293
+ se.delete(r);
4294
+ }
4295
+ function cn(e) {
4296
+ return JSON.stringify(e, (t, r) => typeof r == "function" ? r.toString() : r);
4297
+ }
4298
+ var pn = /* @__PURE__ */ dr({
4299
+ name: "FormKitSchema",
4300
+ props: {
4301
+ schema: {
4302
+ type: [Array, Object],
4303
+ required: !0
4304
+ },
4305
+ data: {
4306
+ type: Object,
4307
+ default: () => ({})
4308
+ },
4309
+ library: {
4310
+ type: Object,
4311
+ default: () => ({})
4312
+ },
4313
+ memoKey: {
4314
+ type: String,
4315
+ required: !1
4316
+ }
4317
+ },
4318
+ emits: ["mounted"],
4319
+ setup(e, t) {
4320
+ var y;
4321
+ const r = ct();
4322
+ let n = {};
4323
+ se.set(n, []);
4324
+ const s = { FormKit: nt(dn), ...e.library };
4325
+ let i = ur(s, e.schema, e.memoKey), a, l;
4326
+ un || Re(
4327
+ () => e.schema,
4328
+ (v, h) => {
4329
+ var g;
4330
+ const O = n;
4331
+ n = {}, se.set(n, []), i = ur(s, e.schema, e.memoKey), a = fr(i, l, n), v === h && ((g = r == null ? void 0 : r.proxy) == null ? void 0 : g.$forceUpdate).call(g), cr(e.schema, e.memoKey, O);
4332
+ },
4333
+ { deep: !0 }
4334
+ ), ne(() => {
4335
+ l = Object.assign(Ie(e.data ?? {}), {
4336
+ slots: t.slots
4337
+ }), t.slots, a = fr(i, l, n);
4338
+ });
4339
+ function o() {
4340
+ cr(e.schema, e.memoKey, n), l && (l.node && l.node.destroy(), l.slots = null, l = null), a = null;
4341
+ }
4342
+ return yr(() => t.emit("mounted")), vn(o), ql((y = ct()) == null ? void 0 : y.appContext.app, o), () => a ? a() : null;
4343
+ }
4344
+ }), Bl = pn, Ul = typeof window > "u", pr = Symbol("FormKitParent"), Zl = Symbol("FormKitComponentCallback");
4345
+ function Yl(e, t) {
4346
+ const r = no(e, t);
4347
+ if (r.props.definition || W(600, r), r.props.definition.component)
4348
+ return () => {
4349
+ var y;
4350
+ return mt(
4351
+ (y = r.props.definition) == null ? void 0 : y.component,
4352
+ {
4353
+ context: r.context
4354
+ },
4355
+ { ...t.slots }
4356
+ );
4357
+ };
4358
+ const n = z([]);
4359
+ let s = r.props.definition.schemaMemoKey;
4360
+ const i = () => {
4361
+ var v, h;
4362
+ const y = (h = (v = r.props) == null ? void 0 : v.definition) == null ? void 0 : h.schema;
4363
+ y || W(601, r), typeof y == "function" ? (n.value = y({ ...e.sectionsSchema || {} }), (s && e.sectionsSchema || "memoKey" in y && typeof y.memoKey == "string") && (s = (s ?? (y == null ? void 0 : y.memoKey)) + JSON.stringify(e.sectionsSchema))) : n.value = y;
4364
+ };
4365
+ i(), Ul || r.on("schema", () => {
4366
+ s += "♻️", i();
4367
+ }), t.emit("node", r);
4368
+ const a = r.props.definition.library, l = {
4369
+ FormKit: nt(mn),
4370
+ ...a,
4371
+ ...e.library ?? {}
4372
+ };
4373
+ function o() {
4374
+ r.emit("mounted");
4375
+ }
4376
+ return t.expose({ node: r }), () => mt(
4377
+ pn,
4378
+ {
4379
+ schema: n.value,
4380
+ data: r.context,
4381
+ onMounted: o,
4382
+ library: l,
4383
+ memoKey: s
4384
+ },
4385
+ { ...t.slots }
4386
+ );
4387
+ }
4388
+ var mn = /* @__PURE__ */ dr(
4389
+ Yl,
4390
+ {
4391
+ props: Ra,
4392
+ inheritAttrs: !1
4393
+ }
4394
+ ), dn = mn, Gl = Symbol();
4395
+ function Jl(e, t) {
4396
+ return e.component(t.alias || "FormKit", dn).component(t.schemaAlias || "FormKitSchema", Bl), {
4397
+ get: Ve,
4398
+ setLocale: (r) => {
4399
+ var n;
4400
+ (n = t.config) != null && n.rootConfig && (t.config.rootConfig.locale = r);
4401
+ },
4402
+ clearErrors: Ys,
4403
+ setErrors: Zs,
4404
+ submit: wr,
4405
+ reset: kr
4406
+ };
4407
+ }
4408
+ var yn = Symbol.for("FormKitOptions"), Ql = Symbol.for("FormKitConfig"), Xl = {
4409
+ install(e, t) {
4410
+ const r = Object.assign(
4411
+ {
4412
+ alias: "FormKit",
4413
+ schemaAlias: "FormKitSchema"
4414
+ },
4415
+ typeof t == "function" ? t() : t
4416
+ ), n = Xn(r.config || {});
4417
+ r.config = { rootConfig: n }, e.config.globalProperties.$formkit = Jl(e, r), e.provide(yn, r), e.provide(Ql, n), typeof window < "u" && (globalThis.__FORMKIT_CONFIGS__ = (globalThis.__FORMKIT_CONFIGS__ || []).concat([n]));
4418
+ }
4419
+ }, eo = typeof window < "u", ft = [
4420
+ // Boolean props
4421
+ "ignore",
4422
+ "disabled",
4423
+ "preserve",
4424
+ // String props
4425
+ "help",
4426
+ "label",
4427
+ /^preserve(-e|E)rrors/,
4428
+ /^[a-z]+(?:-visibility|Visibility|-behavior|Behavior)$/,
4429
+ /^[a-zA-Z-]+(?:-class|Class)$/,
4430
+ "prefixIcon",
4431
+ "suffixIcon",
4432
+ /^[a-zA-Z-]+(?:-icon|Icon)$/
4433
+ ], to = ["disabled", "ignore", "preserve"];
4434
+ function mr(e, t) {
4435
+ t.classes && Object.keys(t.classes).forEach(
4436
+ (r) => {
4437
+ typeof r == "string" && (e.props[`_${r}Class`] = t.classes[r], je(t.classes[r]) && r === "inner" && Object.values(t.classes[r]));
4438
+ }
4439
+ );
4440
+ }
4441
+ function ro(e) {
4442
+ return e ? ["Submit", "SubmitRaw", "SubmitInvalid"].reduce(
4443
+ (r, n) => {
4444
+ const s = `on${n}`;
4445
+ return s in e && typeof e[s] == "function" && (r[s] = e[s]), r;
4446
+ },
4447
+ {}
4448
+ ) : {};
4449
+ }
4450
+ function no(e, t, r = {}) {
4451
+ const n = Object.assign({}, qe(yn) || {}, r), s = qe(Gl, z(eo ? document : void 0)), i = qe(Zl, () => {
4452
+ }), a = ct(), l = ro(a == null ? void 0 : a.vnode.props), o = ["modelValue", "model-value"].some(
4453
+ (u) => u in ((a == null ? void 0 : a.vnode.props) ?? {})
4454
+ );
4455
+ let y = !1;
4456
+ yr(() => {
4457
+ y = !0;
4458
+ });
4459
+ const v = e.modelValue !== void 0 ? e.modelValue : U(t.attrs.value);
4460
+ function h() {
4461
+ const u = {
4462
+ ...ge(e),
4463
+ ...l,
4464
+ type: e.type ?? "text",
4465
+ __root: s.value,
4466
+ __slots: t.slots
4467
+ }, p = Lt(ge(t.attrs), ft);
4468
+ p.key || (p.key = Ee()), u.attrs = p;
4469
+ const E = qt(ge(t.attrs), ft);
4470
+ for (const j in E)
4471
+ to.includes(j) && E[j] === "" && (E[j] = !0), u[$e(j)] = E[j];
4472
+ const R = { props: {} };
4473
+ return mr(R, e), Object.assign(u, R.props), typeof u.type != "string" && (u.definition = u.type, delete u.type), u;
4474
+ }
4475
+ const O = h(), g = O.ignore ? null : e.parent || qe(pr, null), b = Ws(
4476
+ le(
4477
+ n || {},
4478
+ {
4479
+ name: e.name || void 0,
4480
+ value: v,
4481
+ parent: g,
4482
+ plugins: (n.plugins || []).concat(e.plugins ?? []),
4483
+ config: e.config || {},
4484
+ props: O,
4485
+ index: e.index,
4486
+ sync: !!G(t.attrs.sync || t.attrs.dynamic)
4487
+ },
4488
+ !1,
4489
+ !0
4490
+ )
4491
+ );
4492
+ i(b), b.props.definition || W(600, b);
4493
+ const c = z(
4494
+ new Set(
4495
+ Array.isArray(b.props.__propDefs) ? b.props.__propDefs : Object.keys(b.props.__propDefs ?? {})
4496
+ )
4497
+ );
4498
+ b.on(
4499
+ "added-props",
4500
+ ({ payload: u }) => {
4501
+ (Array.isArray(u) ? u : Object.keys(u ?? {})).forEach((E) => c.value.add(E));
4502
+ }
4503
+ );
4504
+ const m = me(
4505
+ () => ft.concat([...c.value]).reduce((u, p) => (typeof p == "string" ? (u.push($e(p)), u.push(gr(p))) : u.push(p), u), [])
4506
+ );
4507
+ ne(() => mr(b, e));
4508
+ const d = ge(e);
4509
+ for (const u in d)
4510
+ Re(
4511
+ () => e[u],
4512
+ () => {
4513
+ e[u] !== void 0 && (b.props[u] = e[u]);
4514
+ }
4515
+ );
4516
+ ne(() => {
4517
+ b.props.__root = s.value;
4518
+ });
4519
+ const _ = /* @__PURE__ */ new Set(), S = ge(t.attrs);
4520
+ ne(() => {
4521
+ $(qt(S, m.value));
4522
+ });
4523
+ function $(u) {
4524
+ _.forEach((p) => {
4525
+ p(), _.delete(p);
4526
+ });
4527
+ for (const p in u) {
4528
+ const E = $e(p);
4529
+ _.add(
4530
+ Re(
4531
+ () => t.attrs[p],
4532
+ () => {
4533
+ b.props[E] = t.attrs[p];
4534
+ }
4535
+ )
4536
+ );
4537
+ }
4538
+ }
4539
+ if (ne(() => {
4540
+ const u = Lt(ge(t.attrs), m.value);
4541
+ "multiple" in u && (u.multiple = G(u.multiple)), typeof u.onBlur == "function" && (u.onBlur = xn(u.onBlur)), b.props.attrs = Object.assign({}, b.props.attrs || {}, u);
4542
+ }), ne(() => {
4543
+ const u = (e.errors ?? []).map(
4544
+ (p) => /* @__PURE__ */ H({
4545
+ key: At(p),
4546
+ type: "error",
4547
+ value: p,
4548
+ meta: { source: "prop" }
4549
+ })
4550
+ );
4551
+ b.store.apply(
4552
+ u,
4553
+ (p) => p.type === "error" && p.meta.source === "prop"
4554
+ );
4555
+ }), b.type !== "input") {
4556
+ const u = `${b.name}-prop`;
4557
+ ne(() => {
4558
+ const p = e.inputErrors ?? {}, E = Object.keys(p);
4559
+ E.length || b.clearErrors(!0, u);
4560
+ const R = E.reduce((j, M) => {
4561
+ let f = p[M];
4562
+ return typeof f == "string" && (f = [f]), Array.isArray(f) && (j[M] = f.map(
4563
+ (k) => /* @__PURE__ */ H({
4564
+ key: k,
4565
+ type: "error",
4566
+ value: k,
4567
+ meta: { source: u }
4568
+ })
4569
+ )), j;
4570
+ }, {});
4571
+ b.store.apply(
4572
+ R,
4573
+ (j) => j.type === "error" && j.meta.source === u
4574
+ );
4575
+ });
4576
+ }
4577
+ ne(() => Object.assign(b.config, e.config)), b.type !== "input" && gn(pr, b);
4578
+ let w;
4579
+ return b.on("modelUpdated", () => {
4580
+ var u, p;
4581
+ t.emit("inputRaw", (u = b.context) == null ? void 0 : u.value, b), y && t.emit("input", (p = b.context) == null ? void 0 : p.value, b), o && b.context && (w = U(b.value), t.emit("update:modelValue", dt(b.value)));
4582
+ }), o && (Re(
4583
+ hn(e, "modelValue"),
4584
+ (u) => {
4585
+ T(w, u) || b.input(u, !1);
4586
+ },
4587
+ { deep: !0 }
4588
+ ), b.value !== v && b.emit("modelUpdated")), bn(() => b.destroy()), b;
4589
+ }
4590
+ var so = 1;
4591
+ function io(e) {
4592
+ return typeof e == "function" && e.length === 2 || typeof e == "object" && !Array.isArray(e) && !("$el" in e) && !("$cmp" in e) && !("if" in e);
4593
+ }
4594
+ function B(e, t = {}, r = {}) {
4595
+ const n = {
4596
+ type: "input",
4597
+ ...t
4598
+ };
4599
+ let s;
4600
+ if (io(e)) {
4601
+ const i = `SchemaComponent${so++}`;
4602
+ s = /* @__PURE__ */ A("input", () => ({
4603
+ $cmp: i,
4604
+ props: {
4605
+ context: "$node.context"
4606
+ }
4607
+ })), n.library = { [i]: nt(e) };
4608
+ } else typeof e == "function" ? s = e : s = /* @__PURE__ */ A("input", () => U(e));
4609
+ return n.schema = /* @__PURE__ */ cl(s || "Schema undefined", r), n.schemaMemoKey || (n.schemaMemoKey = `${Math.random()}`), n;
4610
+ }
4611
+ var ao = /* @__PURE__ */ A("messages", () => ({
4612
+ $el: "ul",
4613
+ if: "$fns.length($messages)"
4614
+ })), lo = /* @__PURE__ */ A("message", () => ({
4615
+ $el: "li",
4616
+ for: ["message", "$messages"],
4617
+ attrs: {
4618
+ key: "$message.key",
4619
+ id: "$id + '-' + $message.key",
4620
+ "data-message-type": "$message.type"
4621
+ }
4622
+ }));
4623
+ ao(lo("$message.value"));
4624
+ var oo = /* @__PURE__ */ A("summary", () => ({
4625
+ $el: "div",
4626
+ attrs: {
4627
+ "aria-live": "polite"
4628
+ }
4629
+ })), uo = /* @__PURE__ */ A("summaryInner", () => ({
4630
+ $el: "div",
4631
+ if: "$summaries.length && $showSummaries"
4632
+ })), fo = /* @__PURE__ */ A("messages", () => ({
4633
+ $el: "ul",
4634
+ if: "$summaries.length && $showSummaries"
4635
+ })), co = /* @__PURE__ */ A("message", () => ({
4636
+ $el: "li",
4637
+ for: ["summary", "$summaries"],
4638
+ attrs: {
4639
+ key: "$summary.key",
4640
+ "data-message-type": "$summary.type"
4641
+ }
4642
+ })), po = /* @__PURE__ */ A("summaryHeader", () => ({
4643
+ $el: "h2",
4644
+ attrs: {
4645
+ id: "$id"
4646
+ }
4647
+ })), mo = /* @__PURE__ */ A("messageLink", () => ({
4648
+ $el: "a",
4649
+ attrs: {
4650
+ id: "$summary.key",
4651
+ href: '$: "#" + $summary.id',
4652
+ onClick: "$jumpLink"
4653
+ }
4654
+ }));
4655
+ oo(
4656
+ uo(
4657
+ po("$summaryHeader"),
4658
+ fo(co(mo("$summary.message")))
4659
+ )
4660
+ );
4661
+ Dl();
4662
+ on();
4663
+ const go = (e) => {
4664
+ e.use(
4665
+ Xl,
4666
+ Vt({
4667
+ inputs: {
4668
+ BaTextField: B(L(() => import("./TextField-BiVH5rLX.js"))),
4669
+ BaStepperField: B(L(() => import("./StepperField-DrHM9EDn.js")), { props: ["suffix", "disabled"] }),
4670
+ BaColorPicker: B(L(() => import("./ColorPicker-DAysa9fA.js"))),
4671
+ BaSelect: B(L(() => import("./Select-CbQFoAzb.js")), { props: ["selectItems"] }),
4672
+ BaListRepeater: B(L(() => import("./ListRepeater-CvaT0Cul.js"))),
4673
+ BaTextStyleList: B(L(() => import("./TextStyleList-CuPE80Py.js"))),
4674
+ BaTextAlign: B(L(() => import("./TextAlign-BOC8ekaH.js"))),
4675
+ BaTextDecorators: B(L(() => import("./TextDecorators-BJC4umDR.js"))),
4676
+ BaImageUpload: B(L(() => import("./ImageUpload-oPECradZ.js"))),
4677
+ BaLinkButton: B(L(() => import("./LinkButton-UPu99O28.js"))),
4678
+ BaSwitch: B(L(() => import("./Switch-8mmNQUDo.js"))),
4679
+ BaButtonGroup: B(L(() => import("./ButtonGroup-B3ba45VA.js")), { props: ["groupItems"] })
4680
+ }
4681
+ })
4682
+ );
4683
+ }, ho = L(() => import("./App-C0R20Irk.js"));
4684
+ export {
4685
+ dn as F,
4686
+ pn as a,
4687
+ ho as b,
4688
+ go as c,
4689
+ vo as r
4690
+ };