@oneclick.dev/cms-core-modules 0.0.123 → 0.0.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppointmentListTable-CWzbwqR-.js +1 -0
- package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
- package/dist/ContentEditor-BlNbqkAz.js +324 -0
- package/dist/{ContentEditor-MDGolnIP.mjs → ContentEditor-D754iLJS.mjs} +7985 -26820
- package/dist/{Detail-Dk8E6_uF.mjs → Detail-BOxWQ1QQ.mjs} +15 -14
- package/dist/{Detail-Cn9Bk0u0.mjs → Detail-BfKW0uZE.mjs} +26 -25
- package/dist/Detail-DFVu2F38.mjs +11 -0
- package/dist/Detail-DJea_fCd.js +1 -0
- package/dist/Detail-DPJacXfm.js +1 -0
- package/dist/Detail-DSLZ7_bM.js +1 -0
- package/dist/Detail-DUGThL9Y.js +1 -0
- package/dist/{Detail-B_scnidb.mjs → Detail-D_LlEeHu.mjs} +35 -34
- package/dist/Editor-D4evcdhv.mjs +768 -0
- package/dist/Editor-gLLtuJbY.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
- package/dist/Knowledge-B66vxz--.js +1 -0
- package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
- package/dist/Overview-0hFXiuYo.js +1 -0
- package/dist/Overview-BE4uYPx0.mjs +745 -0
- package/dist/Overview-BTx5LF4J.js +1 -0
- package/dist/Overview-CCu2PHai.mjs +289 -0
- package/dist/Overview-CQRpFhbJ.mjs +286 -0
- package/dist/Overview-CTs7sX4d.js +1 -0
- package/dist/Overview-Cj89XXKN.js +1 -0
- package/dist/Overview-D2u-leeO.js +1 -0
- package/dist/Overview-D_2wozCG.mjs +1733 -0
- package/dist/Overview-D_c18mbR.mjs +248 -0
- package/dist/Overview-Dffo-zH4.mjs +11 -0
- package/dist/Overview-g4Rcj245.js +1 -0
- package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
- package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
- package/dist/TableDataWidget-BwqWFH4A.js +1 -0
- package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
- package/dist/TableOverviewCard-BPWCqo56.js +1 -0
- package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
- package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
- package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
- package/dist/TableView-CwhZ9YN2.js +4 -0
- package/dist/TableView-DX9PKS8N.mjs +9673 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
- package/dist/Test-CzmOmi53.mjs +447 -0
- package/dist/Test-USDtNFY1.js +1 -0
- package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
- package/dist/UserDetail-KRIfxaYd.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
- package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
- package/dist/index-6hZ6MYY6.js +1 -0
- package/dist/index-BVmmicu3.mjs +14 -0
- package/dist/index-CQuN5rKx.js +1 -0
- package/dist/index-ChHD_1Cf.js +144 -0
- package/dist/index-CnDGeInm.js +1 -0
- package/dist/index-CqDTc5Ig.mjs +20 -0
- package/dist/index-CvV4nVWI.js +1 -0
- package/dist/index-CyvvAdt4.js +1 -0
- package/dist/index-DH2z0W_w.mjs +19012 -0
- package/dist/index-DIRD7t5_.mjs +20 -0
- package/dist/index-DZKzj48V.mjs +17 -0
- package/dist/index-OJuBYR60.mjs +57 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +480 -103
- package/dist/orders-C_sz8J9b.js +1 -0
- package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +2696 -605
- package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
- package/dist/src/appointments/index.d.ts +93 -3
- package/dist/src/appointments/reservation-summary.d.ts +48 -0
- package/dist/src/appointments/server.d.ts +1 -0
- package/dist/src/appointments/tools.d.ts +93 -3
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
- package/dist/src/filezone/config.d.ts +31 -0
- package/dist/src/filezone/index.d.ts +43 -0
- package/dist/src/filezone/index.vue.d.ts +2 -0
- package/dist/src/filezone/metadata.d.ts +2 -0
- package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
- package/dist/src/filezone/permissions.d.ts +5 -0
- package/dist/src/filezone/routes.d.ts +5 -0
- package/dist/src/filezone/server.d.ts +36 -0
- package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
- package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
- package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
- package/dist/src/firebaseAuthManager/config.d.ts +151 -0
- package/dist/src/firebaseAuthManager/index.d.ts +163 -0
- package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
- package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
- package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
- package/dist/src/firebaseAuthManager/server.d.ts +162 -0
- package/dist/src/firebaseAuthManager/types.d.ts +84 -0
- package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
- package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
- package/dist/src/formBuilder/config.d.ts +31 -0
- package/dist/src/formBuilder/index.d.ts +44 -0
- package/dist/src/formBuilder/index.vue.d.ts +14 -0
- package/dist/src/formBuilder/lib/forms.d.ts +11 -0
- package/dist/src/formBuilder/metadata.d.ts +2 -0
- package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
- package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
- package/dist/src/formBuilder/permissions.d.ts +5 -0
- package/dist/src/formBuilder/routes.d.ts +5 -0
- package/dist/src/formBuilder/server.d.ts +87 -0
- package/dist/src/formBuilder/tools.d.ts +1 -0
- package/dist/src/formBuilder/types.d.ts +46 -0
- package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
- package/dist/src/helpbot/config.d.ts +17 -0
- package/dist/src/helpbot/index.d.ts +29 -0
- package/dist/src/helpbot/index.vue.d.ts +2 -0
- package/dist/src/helpbot/metadata.d.ts +2 -0
- package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
- package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
- package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
- package/dist/src/helpbot/permissions.d.ts +5 -0
- package/dist/src/helpbot/routes.d.ts +5 -0
- package/dist/src/helpbot/types.d.ts +42 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/mailTemplates/builder-types.d.ts +40 -0
- package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
- package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
- package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
- package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
- package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
- package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
- package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
- package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
- package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
- package/dist/src/mailTemplates/config.d.ts +10 -4
- package/dist/src/mailTemplates/defaults.d.ts +10 -0
- package/dist/src/mailTemplates/editor-state.d.ts +21 -0
- package/dist/src/mailTemplates/index.d.ts +11 -5
- package/dist/src/mailTemplates/index.vue.d.ts +2 -4
- package/dist/src/mailTemplates/metadata.d.ts +1 -1
- package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
- package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
- package/dist/src/mailTemplates/server.d.ts +23 -0
- package/dist/src/server-handlers.d.ts +6 -0
- package/dist/src/table/badge-filter-utils.d.ts +8 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
- package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
- package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
- package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
- package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
- package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
- package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
- package/dist/src/table/composables/useTableClock.d.ts +4 -0
- package/dist/src/table/display-utils.d.ts +35 -0
- package/dist/src/table/row-value.d.ts +1 -0
- package/dist/src/table/stat-utils.d.ts +9 -0
- package/dist/src/table/tool-utils.d.ts +1 -1
- package/dist/src/table/types.d.ts +54 -1
- package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
- package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
- package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
- package/dist/src/whatsappBusiness/config.d.ts +51 -0
- package/dist/src/whatsappBusiness/connection.d.ts +77 -0
- package/dist/src/whatsappBusiness/index.d.ts +63 -0
- package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
- package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
- package/dist/src/whatsappBusiness/provider.d.ts +21 -0
- package/dist/src/whatsappBusiness/routes.d.ts +5 -0
- package/dist/src/whatsappBusiness/server.d.ts +14 -0
- package/dist/src/whatsappBusiness/templates.d.ts +94 -0
- package/dist/src/whatsappBusiness/types.d.ts +162 -0
- package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
- package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
- package/dist/types-9N-DKxNj.mjs +250 -0
- package/dist/types-B5MifmeF.mjs +2696 -0
- package/dist/types-Cem0vPo_.js +1 -0
- package/dist/types-D5dgTskW.js +1 -0
- package/dist/useHelpbotApi-BIIungOh.js +1 -0
- package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
- package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
- package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
- package/dist/vee-validate-zod-CWZwNTWE.js +1 -0
- package/dist/vee-validate-zod-D0WaDgDZ.mjs +1780 -0
- package/package.json +2 -2
- package/src/appointments/tools.ts +52 -2
- package/src/formBuilder/tools.ts +1 -0
- package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
- package/dist/AppointmentListTable-Dieu9US_.js +0 -1
- package/dist/ContentEditor-C-Wm48ai.js +0 -467
- package/dist/Detail-BCUUNWvp.js +0 -1
- package/dist/Detail-Byk781b4.mjs +0 -26
- package/dist/Detail-DGg_xXZc.js +0 -1
- package/dist/Detail-Sc2qZdxj.js +0 -1
- package/dist/Detail-mvSGbnFU.js +0 -1
- package/dist/Overview-BDlBCUI_.js +0 -1
- package/dist/Overview-Su8ZUbMs.mjs +0 -26
- package/dist/TableDataWidget-7qvC3Egd.js +0 -1
- package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
- package/dist/TableOverviewCard-AFq-puJs.js +0 -1
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
- package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
- package/dist/TableView-BkwoKREo.js +0 -4
- package/dist/TableView-C4Zyp8d7.mjs +0 -8228
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
- package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
- package/dist/dateRangePresets-CPWqst_x.js +0 -1
- package/dist/orders-DUa2PVoa.js +0 -1
- package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
- package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
|
@@ -0,0 +1,1780 @@
|
|
|
1
|
+
import { ref as Q, reactive as De, computed as A, toValue as m, unref as C, onMounted as Ct, isRef as Re, watch as oe, provide as et, readonly as un, inject as wt, watchEffect as sn, nextTick as X, shallowRef as cn, warn as dn, getCurrentInstance as Ve, onUnmounted as It, onBeforeUnmount as fn } from "vue";
|
|
2
|
+
import { Z as ft, g as vn, h as Pt } from "./types-B5MifmeF.mjs";
|
|
3
|
+
function W(e) {
|
|
4
|
+
return typeof e == "function";
|
|
5
|
+
}
|
|
6
|
+
function Ft(e) {
|
|
7
|
+
return e == null;
|
|
8
|
+
}
|
|
9
|
+
const ce = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
|
|
10
|
+
function it(e) {
|
|
11
|
+
return Number(e) >= 0;
|
|
12
|
+
}
|
|
13
|
+
function hn(e) {
|
|
14
|
+
const t = parseFloat(e);
|
|
15
|
+
return isNaN(t) ? e : t;
|
|
16
|
+
}
|
|
17
|
+
function mn(e) {
|
|
18
|
+
return typeof e == "object" && e !== null;
|
|
19
|
+
}
|
|
20
|
+
function pn(e) {
|
|
21
|
+
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
22
|
+
}
|
|
23
|
+
function vt(e) {
|
|
24
|
+
if (!mn(e) || pn(e) !== "[object Object]")
|
|
25
|
+
return !1;
|
|
26
|
+
if (Object.getPrototypeOf(e) === null)
|
|
27
|
+
return !0;
|
|
28
|
+
let t = e;
|
|
29
|
+
for (; Object.getPrototypeOf(t) !== null; )
|
|
30
|
+
t = Object.getPrototypeOf(t);
|
|
31
|
+
return Object.getPrototypeOf(e) === t;
|
|
32
|
+
}
|
|
33
|
+
function Pe(e, t) {
|
|
34
|
+
return Object.keys(t).forEach((n) => {
|
|
35
|
+
if (vt(t[n]) && vt(e[n])) {
|
|
36
|
+
e[n] || (e[n] = {}), Pe(e[n], t[n]);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
e[n] = t[n];
|
|
40
|
+
}), e;
|
|
41
|
+
}
|
|
42
|
+
function Ee(e) {
|
|
43
|
+
const t = e.split(".");
|
|
44
|
+
if (!t.length)
|
|
45
|
+
return "";
|
|
46
|
+
let n = String(t[0]);
|
|
47
|
+
for (let r = 1; r < t.length; r++) {
|
|
48
|
+
if (it(t[r])) {
|
|
49
|
+
n += `[${t[r]}]`;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
n += `.${t[r]}`;
|
|
53
|
+
}
|
|
54
|
+
return n;
|
|
55
|
+
}
|
|
56
|
+
const yn = {};
|
|
57
|
+
function gn(e) {
|
|
58
|
+
return yn[e];
|
|
59
|
+
}
|
|
60
|
+
function ht(e, t, n) {
|
|
61
|
+
typeof n.value == "object" && (n.value = j(n.value)), !n.enumerable || n.get || n.set || !n.configurable || !n.writable || t === "__proto__" ? Object.defineProperty(e, t, n) : e[t] = n.value;
|
|
62
|
+
}
|
|
63
|
+
function j(e) {
|
|
64
|
+
if (typeof e != "object") return e;
|
|
65
|
+
var t = 0, n, r, o, a = Object.prototype.toString.call(e);
|
|
66
|
+
if (a === "[object Object]" ? o = Object.create(e.__proto__ || null) : a === "[object Array]" ? o = Array(e.length) : a === "[object Set]" ? (o = /* @__PURE__ */ new Set(), e.forEach(function(s) {
|
|
67
|
+
o.add(j(s));
|
|
68
|
+
})) : a === "[object Map]" ? (o = /* @__PURE__ */ new Map(), e.forEach(function(s, d) {
|
|
69
|
+
o.set(j(d), j(s));
|
|
70
|
+
})) : a === "[object Date]" ? o = /* @__PURE__ */ new Date(+e) : a === "[object RegExp]" ? o = new RegExp(e.source, e.flags) : a === "[object DataView]" ? o = new e.constructor(j(e.buffer)) : a === "[object ArrayBuffer]" ? o = e.slice(0) : a.slice(-6) === "Array]" && (o = new e.constructor(e)), o) {
|
|
71
|
+
for (r = Object.getOwnPropertySymbols(e); t < r.length; t++)
|
|
72
|
+
ht(o, r[t], Object.getOwnPropertyDescriptor(e, r[t]));
|
|
73
|
+
for (t = 0, r = Object.getOwnPropertyNames(e); t < r.length; t++)
|
|
74
|
+
Object.hasOwnProperty.call(o, n = r[t]) && o[n] === e[n] || ht(o, n, Object.getOwnPropertyDescriptor(e, n));
|
|
75
|
+
}
|
|
76
|
+
return o || e;
|
|
77
|
+
}
|
|
78
|
+
const lt = /* @__PURE__ */ Symbol("vee-validate-form"), Nt = /* @__PURE__ */ Symbol("vee-validate-form-context"), bn = /* @__PURE__ */ Symbol("vee-validate-field-instance"), mt = /* @__PURE__ */ Symbol("Default empty value"), Tt = typeof window < "u";
|
|
79
|
+
function tt(e) {
|
|
80
|
+
return W(e) && !!e.__locatorRef;
|
|
81
|
+
}
|
|
82
|
+
function ee(e) {
|
|
83
|
+
return !!e && W(e.parse) && e.__type === "VVTypedSchema";
|
|
84
|
+
}
|
|
85
|
+
function Me(e) {
|
|
86
|
+
return !!e && W(e.validate);
|
|
87
|
+
}
|
|
88
|
+
function kt(e) {
|
|
89
|
+
return e === "checkbox" || e === "radio";
|
|
90
|
+
}
|
|
91
|
+
function On(e) {
|
|
92
|
+
return ce(e) || Array.isArray(e);
|
|
93
|
+
}
|
|
94
|
+
function Vn(e) {
|
|
95
|
+
return Array.isArray(e) ? e.length === 0 : ce(e) && Object.keys(e).length === 0;
|
|
96
|
+
}
|
|
97
|
+
function Fe(e) {
|
|
98
|
+
return /^\[.+\]$/i.test(e);
|
|
99
|
+
}
|
|
100
|
+
function _n(e) {
|
|
101
|
+
return xt(e) && e.multiple;
|
|
102
|
+
}
|
|
103
|
+
function xt(e) {
|
|
104
|
+
return e.tagName === "SELECT";
|
|
105
|
+
}
|
|
106
|
+
function Sn(e) {
|
|
107
|
+
return Dt(e) && e.target && "submit" in e.target;
|
|
108
|
+
}
|
|
109
|
+
function Dt(e) {
|
|
110
|
+
return e ? !!(typeof Event < "u" && W(Event) && e instanceof Event || e && e.srcElement) : !1;
|
|
111
|
+
}
|
|
112
|
+
function B(e, t) {
|
|
113
|
+
if (e === t)
|
|
114
|
+
return !0;
|
|
115
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
116
|
+
if (e.constructor !== t.constructor)
|
|
117
|
+
return !1;
|
|
118
|
+
var n, r, o;
|
|
119
|
+
if (Array.isArray(e)) {
|
|
120
|
+
if (n = e.length, n != t.length)
|
|
121
|
+
return !1;
|
|
122
|
+
for (r = n; r-- !== 0; )
|
|
123
|
+
if (!B(e[r], t[r]))
|
|
124
|
+
return !1;
|
|
125
|
+
return !0;
|
|
126
|
+
}
|
|
127
|
+
if (e instanceof Map && t instanceof Map) {
|
|
128
|
+
if (e.size !== t.size)
|
|
129
|
+
return !1;
|
|
130
|
+
for (r of e.entries())
|
|
131
|
+
if (!t.has(r[0]))
|
|
132
|
+
return !1;
|
|
133
|
+
for (r of e.entries())
|
|
134
|
+
if (!B(r[1], t.get(r[0])))
|
|
135
|
+
return !1;
|
|
136
|
+
return !0;
|
|
137
|
+
}
|
|
138
|
+
if (yt(e) && yt(t))
|
|
139
|
+
return !(e.size !== t.size || e.name !== t.name || e.lastModified !== t.lastModified || e.type !== t.type);
|
|
140
|
+
if (e instanceof Set && t instanceof Set) {
|
|
141
|
+
if (e.size !== t.size)
|
|
142
|
+
return !1;
|
|
143
|
+
for (r of e.entries())
|
|
144
|
+
if (!t.has(r[0]))
|
|
145
|
+
return !1;
|
|
146
|
+
return !0;
|
|
147
|
+
}
|
|
148
|
+
if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
|
|
149
|
+
if (n = e.length, n != t.length)
|
|
150
|
+
return !1;
|
|
151
|
+
for (r = n; r-- !== 0; )
|
|
152
|
+
if (e[r] !== t[r])
|
|
153
|
+
return !1;
|
|
154
|
+
return !0;
|
|
155
|
+
}
|
|
156
|
+
if (e.constructor === RegExp)
|
|
157
|
+
return e.source === t.source && e.flags === t.flags;
|
|
158
|
+
if (e.valueOf !== Object.prototype.valueOf)
|
|
159
|
+
return e.valueOf() === t.valueOf();
|
|
160
|
+
if (e.toString !== Object.prototype.toString)
|
|
161
|
+
return e.toString() === t.toString();
|
|
162
|
+
if (e = pt(e), t = pt(t), o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
|
|
163
|
+
return !1;
|
|
164
|
+
for (r = n; r-- !== 0; )
|
|
165
|
+
if (!Object.prototype.hasOwnProperty.call(t, o[r]))
|
|
166
|
+
return !1;
|
|
167
|
+
for (r = n; r-- !== 0; ) {
|
|
168
|
+
var a = o[r];
|
|
169
|
+
if (!B(e[a], t[a]))
|
|
170
|
+
return !1;
|
|
171
|
+
}
|
|
172
|
+
return !0;
|
|
173
|
+
}
|
|
174
|
+
return e !== e && t !== t;
|
|
175
|
+
}
|
|
176
|
+
function pt(e) {
|
|
177
|
+
return Object.fromEntries(Object.entries(e).filter(([, t]) => t !== void 0));
|
|
178
|
+
}
|
|
179
|
+
function yt(e) {
|
|
180
|
+
return Tt ? e instanceof File : !1;
|
|
181
|
+
}
|
|
182
|
+
function Be(e) {
|
|
183
|
+
return Fe(e) ? e.replace(/\[|\]/gi, "") : e;
|
|
184
|
+
}
|
|
185
|
+
function q(e, t, n) {
|
|
186
|
+
return e ? Fe(t) ? e[Be(t)] : (t || "").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((o, a) => On(o) && a in o ? o[a] : n, e) : n;
|
|
187
|
+
}
|
|
188
|
+
function ne(e, t, n) {
|
|
189
|
+
if (Fe(t)) {
|
|
190
|
+
e[Be(t)] = n;
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const r = t.split(/\.|\[(\d+)\]/).filter(Boolean);
|
|
194
|
+
let o = e;
|
|
195
|
+
for (let a = 0; a < r.length; a++) {
|
|
196
|
+
if (a === r.length - 1) {
|
|
197
|
+
o[r[a]] = n;
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
(!(r[a] in o) || Ft(o[r[a]])) && (o[r[a]] = it(r[a + 1]) ? [] : {}), o = o[r[a]];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function Xe(e, t) {
|
|
204
|
+
if (Array.isArray(e) && it(t)) {
|
|
205
|
+
e.splice(Number(t), 1);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
ce(e) && delete e[t];
|
|
209
|
+
}
|
|
210
|
+
function gt(e, t) {
|
|
211
|
+
if (Fe(t)) {
|
|
212
|
+
delete e[Be(t)];
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const n = t.split(/\.|\[(\d+)\]/).filter(Boolean);
|
|
216
|
+
let r = e;
|
|
217
|
+
for (let a = 0; a < n.length; a++) {
|
|
218
|
+
if (a === n.length - 1) {
|
|
219
|
+
Xe(r, n[a]);
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
if (!(n[a] in r) || Ft(r[n[a]]))
|
|
223
|
+
break;
|
|
224
|
+
r = r[n[a]];
|
|
225
|
+
}
|
|
226
|
+
const o = n.map((a, s) => q(e, n.slice(0, s).join(".")));
|
|
227
|
+
for (let a = o.length - 1; a >= 0; a--)
|
|
228
|
+
if (Vn(o[a])) {
|
|
229
|
+
if (a === 0) {
|
|
230
|
+
Xe(e, n[0]);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
Xe(o[a - 1], n[a - 1]);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function L(e) {
|
|
237
|
+
return Object.keys(e);
|
|
238
|
+
}
|
|
239
|
+
function Rt(e, t = void 0) {
|
|
240
|
+
const n = Ve();
|
|
241
|
+
return n?.provides[e] || wt(e, t);
|
|
242
|
+
}
|
|
243
|
+
function jn(e, t, n) {
|
|
244
|
+
if (Array.isArray(e)) {
|
|
245
|
+
const r = [...e], o = r.findIndex((a) => B(a, t));
|
|
246
|
+
return o >= 0 ? r.splice(o, 1) : r.push(t), r;
|
|
247
|
+
}
|
|
248
|
+
return B(e, t) ? n : t;
|
|
249
|
+
}
|
|
250
|
+
function En(e, t) {
|
|
251
|
+
let n, r;
|
|
252
|
+
return function(...o) {
|
|
253
|
+
const a = this;
|
|
254
|
+
return n || (n = !0, setTimeout(() => n = !1, t), r = e.apply(a, o)), r;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function bt(e, t = 0) {
|
|
258
|
+
let n = null, r = [];
|
|
259
|
+
return function(...o) {
|
|
260
|
+
return n && clearTimeout(n), n = setTimeout(() => {
|
|
261
|
+
const a = e(...o);
|
|
262
|
+
r.forEach((s) => s(a)), r = [];
|
|
263
|
+
}, t), new Promise((a) => r.push(a));
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function An(e, t) {
|
|
267
|
+
return ce(t) && t.number ? hn(e) : e;
|
|
268
|
+
}
|
|
269
|
+
function nt(e, t) {
|
|
270
|
+
let n;
|
|
271
|
+
return async function(...o) {
|
|
272
|
+
const a = e(...o);
|
|
273
|
+
n = a;
|
|
274
|
+
const s = await a;
|
|
275
|
+
return a !== n ? s : (n = void 0, t(s, o));
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function rt(e) {
|
|
279
|
+
return Array.isArray(e) ? e : e ? [e] : [];
|
|
280
|
+
}
|
|
281
|
+
function ke(e, t) {
|
|
282
|
+
const n = {};
|
|
283
|
+
for (const r in e)
|
|
284
|
+
t.includes(r) || (n[r] = e[r]);
|
|
285
|
+
return n;
|
|
286
|
+
}
|
|
287
|
+
function Cn(e) {
|
|
288
|
+
let t = null, n = [];
|
|
289
|
+
return function(...r) {
|
|
290
|
+
const o = X(() => {
|
|
291
|
+
if (t !== o)
|
|
292
|
+
return;
|
|
293
|
+
const a = e(...r);
|
|
294
|
+
n.forEach((s) => s(a)), n = [], t = null;
|
|
295
|
+
});
|
|
296
|
+
return t = o, new Promise((a) => n.push(a));
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function Qe(e) {
|
|
300
|
+
if (Mt(e))
|
|
301
|
+
return e._value;
|
|
302
|
+
}
|
|
303
|
+
function Mt(e) {
|
|
304
|
+
return "_value" in e;
|
|
305
|
+
}
|
|
306
|
+
function wn(e) {
|
|
307
|
+
return e.type === "number" || e.type === "range" ? Number.isNaN(e.valueAsNumber) ? e.value : e.valueAsNumber : e.value;
|
|
308
|
+
}
|
|
309
|
+
function Ue(e) {
|
|
310
|
+
if (!Dt(e))
|
|
311
|
+
return e;
|
|
312
|
+
const t = e.target;
|
|
313
|
+
if (kt(t.type) && Mt(t))
|
|
314
|
+
return Qe(t);
|
|
315
|
+
if (t.type === "file" && t.files) {
|
|
316
|
+
const n = Array.from(t.files);
|
|
317
|
+
return t.multiple ? n : n[0];
|
|
318
|
+
}
|
|
319
|
+
if (_n(t))
|
|
320
|
+
return Array.from(t.options).filter((n) => n.selected && !n.disabled).map(Qe);
|
|
321
|
+
if (xt(t)) {
|
|
322
|
+
const n = Array.from(t.options).find((r) => r.selected);
|
|
323
|
+
return n ? Qe(n) : t.value;
|
|
324
|
+
}
|
|
325
|
+
return wn(t);
|
|
326
|
+
}
|
|
327
|
+
function Ut(e) {
|
|
328
|
+
const t = {};
|
|
329
|
+
return Object.defineProperty(t, "_$$isNormalized", {
|
|
330
|
+
value: !0,
|
|
331
|
+
writable: !1,
|
|
332
|
+
enumerable: !1,
|
|
333
|
+
configurable: !1
|
|
334
|
+
}), e ? ce(e) && e._$$isNormalized ? e : ce(e) ? Object.keys(e).reduce((n, r) => {
|
|
335
|
+
const o = In(e[r]);
|
|
336
|
+
return e[r] !== !1 && (n[r] = Ot(o)), n;
|
|
337
|
+
}, t) : typeof e != "string" ? t : e.split("|").reduce((n, r) => {
|
|
338
|
+
const o = Pn(r);
|
|
339
|
+
return o.name && (n[o.name] = Ot(o.params)), n;
|
|
340
|
+
}, t) : t;
|
|
341
|
+
}
|
|
342
|
+
function In(e) {
|
|
343
|
+
return e === !0 ? [] : Array.isArray(e) || ce(e) ? e : [e];
|
|
344
|
+
}
|
|
345
|
+
function Ot(e) {
|
|
346
|
+
const t = (n) => typeof n == "string" && n[0] === "@" ? Fn(n.slice(1)) : n;
|
|
347
|
+
return Array.isArray(e) ? e.map(t) : e instanceof RegExp ? [e] : Object.keys(e).reduce((n, r) => (n[r] = t(e[r]), n), {});
|
|
348
|
+
}
|
|
349
|
+
const Pn = (e) => {
|
|
350
|
+
let t = [];
|
|
351
|
+
const n = e.split(":")[0];
|
|
352
|
+
return e.includes(":") && (t = e.split(":").slice(1).join(":").split(",")), { name: n, params: t };
|
|
353
|
+
};
|
|
354
|
+
function Fn(e) {
|
|
355
|
+
const t = (n) => {
|
|
356
|
+
var r;
|
|
357
|
+
return (r = q(n, e)) !== null && r !== void 0 ? r : n[e];
|
|
358
|
+
};
|
|
359
|
+
return t.__locatorRef = e, t;
|
|
360
|
+
}
|
|
361
|
+
function Nn(e) {
|
|
362
|
+
return Array.isArray(e) ? e.filter(tt) : L(e).filter((t) => tt(e[t])).map((t) => e[t]);
|
|
363
|
+
}
|
|
364
|
+
const Tn = {
|
|
365
|
+
generateMessage: ({ field: e }) => `${e} is not valid.`,
|
|
366
|
+
bails: !0,
|
|
367
|
+
validateOnBlur: !0,
|
|
368
|
+
validateOnChange: !0,
|
|
369
|
+
validateOnInput: !1,
|
|
370
|
+
validateOnModelUpdate: !0
|
|
371
|
+
};
|
|
372
|
+
let kn = Object.assign({}, Tn);
|
|
373
|
+
const Ae = () => kn;
|
|
374
|
+
async function Bt(e, t, n = {}) {
|
|
375
|
+
const r = n?.bails, o = {
|
|
376
|
+
name: n?.name || "{field}",
|
|
377
|
+
rules: t,
|
|
378
|
+
label: n?.label,
|
|
379
|
+
bails: r ?? !0,
|
|
380
|
+
formData: n?.values || {}
|
|
381
|
+
}, a = await xn(o, e);
|
|
382
|
+
return Object.assign(Object.assign({}, a), { valid: !a.errors.length });
|
|
383
|
+
}
|
|
384
|
+
async function xn(e, t) {
|
|
385
|
+
const n = e.rules;
|
|
386
|
+
if (ee(n) || Me(n))
|
|
387
|
+
return Rn(t, Object.assign(Object.assign({}, e), { rules: n }));
|
|
388
|
+
if (W(n) || Array.isArray(n)) {
|
|
389
|
+
const d = {
|
|
390
|
+
field: e.label || e.name,
|
|
391
|
+
name: e.name,
|
|
392
|
+
label: e.label,
|
|
393
|
+
form: e.formData,
|
|
394
|
+
value: t
|
|
395
|
+
}, v = Array.isArray(n) ? n : [n], c = v.length, p = [];
|
|
396
|
+
for (let _ = 0; _ < c; _++) {
|
|
397
|
+
const w = v[_], V = await w(t, d);
|
|
398
|
+
if (!(typeof V != "string" && !Array.isArray(V) && V)) {
|
|
399
|
+
if (Array.isArray(V))
|
|
400
|
+
p.push(...V);
|
|
401
|
+
else {
|
|
402
|
+
const K = typeof V == "string" ? V : Lt(d);
|
|
403
|
+
p.push(K);
|
|
404
|
+
}
|
|
405
|
+
if (e.bails)
|
|
406
|
+
return {
|
|
407
|
+
errors: p
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return {
|
|
412
|
+
errors: p
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
const r = Object.assign(Object.assign({}, e), { rules: Ut(n) }), o = [], a = Object.keys(r.rules), s = a.length;
|
|
416
|
+
for (let d = 0; d < s; d++) {
|
|
417
|
+
const v = a[d], c = await Mn(r, t, {
|
|
418
|
+
name: v,
|
|
419
|
+
params: r.rules[v]
|
|
420
|
+
});
|
|
421
|
+
if (c.error && (o.push(c.error), e.bails))
|
|
422
|
+
return {
|
|
423
|
+
errors: o
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
errors: o
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function Dn(e) {
|
|
431
|
+
return !!e && e.name === "ValidationError";
|
|
432
|
+
}
|
|
433
|
+
function $t(e) {
|
|
434
|
+
return {
|
|
435
|
+
__type: "VVTypedSchema",
|
|
436
|
+
async parse(n, r) {
|
|
437
|
+
var o;
|
|
438
|
+
try {
|
|
439
|
+
return {
|
|
440
|
+
output: await e.validate(n, { abortEarly: !1, context: r?.formData || {} }),
|
|
441
|
+
errors: []
|
|
442
|
+
};
|
|
443
|
+
} catch (a) {
|
|
444
|
+
if (!Dn(a))
|
|
445
|
+
throw a;
|
|
446
|
+
if (!(!((o = a.inner) === null || o === void 0) && o.length) && a.errors.length)
|
|
447
|
+
return { errors: [{ path: a.path, errors: a.errors }] };
|
|
448
|
+
const s = a.inner.reduce((d, v) => {
|
|
449
|
+
const c = v.path || "";
|
|
450
|
+
return d[c] || (d[c] = { errors: [], path: c }), d[c].errors.push(...v.errors), d;
|
|
451
|
+
}, {});
|
|
452
|
+
return { errors: Object.values(s) };
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
async function Rn(e, t) {
|
|
458
|
+
const r = await (ee(t.rules) ? t.rules : $t(t.rules)).parse(e, { formData: t.formData }), o = [];
|
|
459
|
+
for (const a of r.errors)
|
|
460
|
+
a.errors.length && o.push(...a.errors);
|
|
461
|
+
return {
|
|
462
|
+
value: r.value,
|
|
463
|
+
errors: o
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
async function Mn(e, t, n) {
|
|
467
|
+
const r = gn(n.name);
|
|
468
|
+
if (!r)
|
|
469
|
+
throw new Error(`No such validator '${n.name}' exists.`);
|
|
470
|
+
const o = Un(n.params, e.formData), a = {
|
|
471
|
+
field: e.label || e.name,
|
|
472
|
+
name: e.name,
|
|
473
|
+
label: e.label,
|
|
474
|
+
value: t,
|
|
475
|
+
form: e.formData,
|
|
476
|
+
rule: Object.assign(Object.assign({}, n), { params: o })
|
|
477
|
+
}, s = await r(t, o, a);
|
|
478
|
+
return typeof s == "string" ? {
|
|
479
|
+
error: s
|
|
480
|
+
} : {
|
|
481
|
+
error: s ? void 0 : Lt(a)
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
function Lt(e) {
|
|
485
|
+
const t = Ae().generateMessage;
|
|
486
|
+
return t ? t(e) : "Field is invalid";
|
|
487
|
+
}
|
|
488
|
+
function Un(e, t) {
|
|
489
|
+
const n = (r) => tt(r) ? r(t) : r;
|
|
490
|
+
return Array.isArray(e) ? e.map(n) : Object.keys(e).reduce((r, o) => (r[o] = n(e[o]), r), {});
|
|
491
|
+
}
|
|
492
|
+
async function Bn(e, t) {
|
|
493
|
+
const r = await (ee(e) ? e : $t(e)).parse(j(t), { formData: j(t) }), o = {}, a = {};
|
|
494
|
+
for (const s of r.errors) {
|
|
495
|
+
const d = s.errors, v = (s.path || "").replace(/\["(\d+)"\]/g, (c, p) => `[${p}]`);
|
|
496
|
+
o[v] = { valid: !d.length, errors: d }, d.length && (a[v] = d[0]);
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
valid: !r.errors.length,
|
|
500
|
+
results: o,
|
|
501
|
+
errors: a,
|
|
502
|
+
values: r.value,
|
|
503
|
+
source: "schema"
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
async function $n(e, t, n) {
|
|
507
|
+
const o = L(e).map(async (c) => {
|
|
508
|
+
var p, _, w;
|
|
509
|
+
const V = (p = n?.names) === null || p === void 0 ? void 0 : p[c], N = await Bt(q(t, c), e[c], {
|
|
510
|
+
name: V?.name || c,
|
|
511
|
+
label: V?.label,
|
|
512
|
+
values: t,
|
|
513
|
+
bails: (w = (_ = n?.bailsMap) === null || _ === void 0 ? void 0 : _[c]) !== null && w !== void 0 ? w : !0
|
|
514
|
+
});
|
|
515
|
+
return Object.assign(Object.assign({}, N), { path: c });
|
|
516
|
+
});
|
|
517
|
+
let a = !0;
|
|
518
|
+
const s = await Promise.all(o), d = {}, v = {};
|
|
519
|
+
for (const c of s)
|
|
520
|
+
d[c.path] = {
|
|
521
|
+
valid: c.valid,
|
|
522
|
+
errors: c.errors
|
|
523
|
+
}, c.valid || (a = !1, v[c.path] = c.errors[0]);
|
|
524
|
+
return {
|
|
525
|
+
valid: a,
|
|
526
|
+
results: d,
|
|
527
|
+
errors: v,
|
|
528
|
+
source: "schema"
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
let Vt = 0;
|
|
532
|
+
function Ln(e, t) {
|
|
533
|
+
const { value: n, initialValue: r, setInitialValue: o } = zn(e, t.modelValue, t.form);
|
|
534
|
+
if (!t.form) {
|
|
535
|
+
let w = function(V) {
|
|
536
|
+
var N;
|
|
537
|
+
"value" in V && (n.value = V.value), "errors" in V && c(V.errors), "touched" in V && (_.touched = (N = V.touched) !== null && N !== void 0 ? N : _.touched), "initialValue" in V && o(V.initialValue);
|
|
538
|
+
};
|
|
539
|
+
const { errors: v, setErrors: c } = Kn(), p = Vt >= Number.MAX_SAFE_INTEGER ? 0 : ++Vt, _ = qn(n, r, v, t.schema);
|
|
540
|
+
return {
|
|
541
|
+
id: p,
|
|
542
|
+
path: e,
|
|
543
|
+
value: n,
|
|
544
|
+
initialValue: r,
|
|
545
|
+
meta: _,
|
|
546
|
+
flags: { pendingUnmount: { [p]: !1 }, pendingReset: !1 },
|
|
547
|
+
errors: v,
|
|
548
|
+
setState: w
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
const a = t.form.createPathState(e, {
|
|
552
|
+
bails: t.bails,
|
|
553
|
+
label: t.label,
|
|
554
|
+
type: t.type,
|
|
555
|
+
validate: t.validate,
|
|
556
|
+
schema: t.schema
|
|
557
|
+
}), s = A(() => a.errors);
|
|
558
|
+
function d(v) {
|
|
559
|
+
var c, p, _;
|
|
560
|
+
"value" in v && (n.value = v.value), "errors" in v && ((c = t.form) === null || c === void 0 || c.setFieldError(C(e), v.errors)), "touched" in v && ((p = t.form) === null || p === void 0 || p.setFieldTouched(C(e), (_ = v.touched) !== null && _ !== void 0 ? _ : !1)), "initialValue" in v && o(v.initialValue);
|
|
561
|
+
}
|
|
562
|
+
return {
|
|
563
|
+
id: Array.isArray(a.id) ? a.id[a.id.length - 1] : a.id,
|
|
564
|
+
path: e,
|
|
565
|
+
value: n,
|
|
566
|
+
errors: s,
|
|
567
|
+
meta: a,
|
|
568
|
+
initialValue: r,
|
|
569
|
+
flags: a.__flags,
|
|
570
|
+
setState: d
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
function zn(e, t, n) {
|
|
574
|
+
const r = Q(C(t));
|
|
575
|
+
function o() {
|
|
576
|
+
return n ? q(n.initialValues.value, C(e), C(r)) : C(r);
|
|
577
|
+
}
|
|
578
|
+
function a(c) {
|
|
579
|
+
if (!n) {
|
|
580
|
+
r.value = c;
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
n.setFieldInitialValue(C(e), c, !0);
|
|
584
|
+
}
|
|
585
|
+
const s = A(o);
|
|
586
|
+
if (!n)
|
|
587
|
+
return {
|
|
588
|
+
value: Q(o()),
|
|
589
|
+
initialValue: s,
|
|
590
|
+
setInitialValue: a
|
|
591
|
+
};
|
|
592
|
+
const d = Wn(t, n, s, e);
|
|
593
|
+
return n.stageInitialValue(C(e), d, !0), {
|
|
594
|
+
value: A({
|
|
595
|
+
get() {
|
|
596
|
+
return q(n.values, C(e));
|
|
597
|
+
},
|
|
598
|
+
set(c) {
|
|
599
|
+
n.setFieldValue(C(e), c, !1);
|
|
600
|
+
}
|
|
601
|
+
}),
|
|
602
|
+
initialValue: s,
|
|
603
|
+
setInitialValue: a
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function Wn(e, t, n, r) {
|
|
607
|
+
return Re(e) ? C(e) : e !== void 0 ? e : q(t.values, C(r), C(n));
|
|
608
|
+
}
|
|
609
|
+
function qn(e, t, n, r) {
|
|
610
|
+
const o = A(() => {
|
|
611
|
+
var s, d, v;
|
|
612
|
+
return (v = (d = (s = m(r)) === null || s === void 0 ? void 0 : s.describe) === null || d === void 0 ? void 0 : d.call(s).required) !== null && v !== void 0 ? v : !1;
|
|
613
|
+
}), a = De({
|
|
614
|
+
touched: !1,
|
|
615
|
+
pending: !1,
|
|
616
|
+
valid: !0,
|
|
617
|
+
required: o,
|
|
618
|
+
validated: !!C(n).length,
|
|
619
|
+
initialValue: A(() => C(t)),
|
|
620
|
+
dirty: A(() => !B(C(e), C(t)))
|
|
621
|
+
});
|
|
622
|
+
return oe(n, (s) => {
|
|
623
|
+
a.valid = !s.length;
|
|
624
|
+
}, {
|
|
625
|
+
immediate: !0,
|
|
626
|
+
flush: "sync"
|
|
627
|
+
}), a;
|
|
628
|
+
}
|
|
629
|
+
function Kn() {
|
|
630
|
+
const e = Q([]);
|
|
631
|
+
return {
|
|
632
|
+
errors: e,
|
|
633
|
+
setErrors: (t) => {
|
|
634
|
+
e.value = rt(t);
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
const Ce = {}, we = {}, Ie = "vee-validate-inspector", z = {
|
|
639
|
+
error: 12405579,
|
|
640
|
+
success: 448379,
|
|
641
|
+
unknown: 5522283,
|
|
642
|
+
white: 16777215,
|
|
643
|
+
black: 0,
|
|
644
|
+
blue: 218007,
|
|
645
|
+
purple: 12157168,
|
|
646
|
+
orange: 16099682,
|
|
647
|
+
gray: 12304330
|
|
648
|
+
};
|
|
649
|
+
let k = null, le;
|
|
650
|
+
async function zt(e) {
|
|
651
|
+
if (process.env.NODE_ENV !== "production") {
|
|
652
|
+
if (!Tt)
|
|
653
|
+
return;
|
|
654
|
+
(await import("./index-DE8rdSjd.mjs")).setupDevtoolsPlugin({
|
|
655
|
+
id: "vee-validate-devtools-plugin",
|
|
656
|
+
label: "VeeValidate Plugin",
|
|
657
|
+
packageName: "vee-validate",
|
|
658
|
+
homepage: "https://vee-validate.logaretm.com/v4",
|
|
659
|
+
app: e,
|
|
660
|
+
logo: "https://vee-validate.logaretm.com/v4/logo.png"
|
|
661
|
+
}, (n) => {
|
|
662
|
+
le = n, n.addInspector({
|
|
663
|
+
id: Ie,
|
|
664
|
+
icon: "rule",
|
|
665
|
+
label: "vee-validate",
|
|
666
|
+
noSelectionText: "Select a vee-validate node to inspect",
|
|
667
|
+
actions: [
|
|
668
|
+
{
|
|
669
|
+
icon: "done_outline",
|
|
670
|
+
tooltip: "Validate selected item",
|
|
671
|
+
action: async () => {
|
|
672
|
+
if (!k) {
|
|
673
|
+
console.error("There is not a valid selected vee-validate node or component");
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
if (k.type === "field") {
|
|
677
|
+
await k.field.validate();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
if (k.type === "form") {
|
|
681
|
+
await k.form.validate();
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
k.type === "pathState" && await k.form.validateField(k.state.path);
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
icon: "delete_sweep",
|
|
689
|
+
tooltip: "Clear validation state of the selected item",
|
|
690
|
+
action: () => {
|
|
691
|
+
if (!k) {
|
|
692
|
+
console.error("There is not a valid selected vee-validate node or component");
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
if (k.type === "field") {
|
|
696
|
+
k.field.resetField();
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
k.type === "form" && k.form.resetForm(), k.type === "pathState" && k.form.resetField(k.state.path);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
]
|
|
703
|
+
}), n.on.getInspectorTree((r) => {
|
|
704
|
+
if (r.inspectorId !== Ie)
|
|
705
|
+
return;
|
|
706
|
+
const o = Object.values(Ce), a = Object.values(we);
|
|
707
|
+
r.rootNodes = [
|
|
708
|
+
...o.map(Hn),
|
|
709
|
+
...a.map((s) => Jn(s))
|
|
710
|
+
];
|
|
711
|
+
}), n.on.getInspectorState((r) => {
|
|
712
|
+
if (r.inspectorId !== Ie)
|
|
713
|
+
return;
|
|
714
|
+
const { form: o, field: a, state: s, type: d } = Xn(r.nodeId);
|
|
715
|
+
if (n.unhighlightElement(), o && d === "form") {
|
|
716
|
+
r.state = Qn(o), k = { type: "form", form: o }, n.highlightElement(o._vm);
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
if (s && d === "pathState" && o) {
|
|
720
|
+
r.state = _t(s), k = { type: "pathState", state: s, form: o };
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
if (a && d === "field") {
|
|
724
|
+
r.state = _t({
|
|
725
|
+
errors: a.errors.value,
|
|
726
|
+
dirty: a.meta.dirty,
|
|
727
|
+
valid: a.meta.valid,
|
|
728
|
+
touched: a.meta.touched,
|
|
729
|
+
value: a.value.value,
|
|
730
|
+
initialValue: a.meta.initialValue
|
|
731
|
+
}), k = { field: a, type: "field" }, n.highlightElement(a._vm);
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
k = null, n.unhighlightElement();
|
|
735
|
+
});
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
const _e = En(() => {
|
|
740
|
+
setTimeout(async () => {
|
|
741
|
+
await X(), le?.sendInspectorState(Ie), le?.sendInspectorTree(Ie);
|
|
742
|
+
}, 100);
|
|
743
|
+
}, 100);
|
|
744
|
+
function Zn(e) {
|
|
745
|
+
const t = Ve();
|
|
746
|
+
if (!le) {
|
|
747
|
+
const n = t?.appContext.app;
|
|
748
|
+
if (!n)
|
|
749
|
+
return;
|
|
750
|
+
zt(n);
|
|
751
|
+
}
|
|
752
|
+
Ce[e.formId] = Object.assign({}, e), Ce[e.formId]._vm = t, It(() => {
|
|
753
|
+
delete Ce[e.formId], _e();
|
|
754
|
+
}), _e();
|
|
755
|
+
}
|
|
756
|
+
function Gn(e) {
|
|
757
|
+
const t = Ve();
|
|
758
|
+
if (!le) {
|
|
759
|
+
const n = t?.appContext.app;
|
|
760
|
+
if (!n)
|
|
761
|
+
return;
|
|
762
|
+
zt(n);
|
|
763
|
+
}
|
|
764
|
+
we[e.id] = Object.assign({}, e), we[e.id]._vm = t, It(() => {
|
|
765
|
+
delete we[e.id], _e();
|
|
766
|
+
}), _e();
|
|
767
|
+
}
|
|
768
|
+
function Hn(e) {
|
|
769
|
+
const { textColor: t, bgColor: n } = qt(e.meta.value.valid), r = {};
|
|
770
|
+
Object.values(e.getAllPathStates()).forEach((s) => {
|
|
771
|
+
ne(r, m(s.path), Yn(s, e));
|
|
772
|
+
});
|
|
773
|
+
function o(s, d = []) {
|
|
774
|
+
const v = [...d].pop();
|
|
775
|
+
return "id" in s ? Object.assign(Object.assign({}, s), { label: v || s.label }) : ce(s) ? {
|
|
776
|
+
id: `${d.join(".")}`,
|
|
777
|
+
label: v || "",
|
|
778
|
+
children: Object.keys(s).map((c) => o(s[c], [...d, c]))
|
|
779
|
+
} : Array.isArray(s) ? {
|
|
780
|
+
id: `${d.join(".")}`,
|
|
781
|
+
label: `${v}[]`,
|
|
782
|
+
children: s.map((c, p) => o(c, [...d, String(p)]))
|
|
783
|
+
} : { id: "", label: "", children: [] };
|
|
784
|
+
}
|
|
785
|
+
const { children: a } = o(r);
|
|
786
|
+
return {
|
|
787
|
+
id: ot(e),
|
|
788
|
+
label: e.name,
|
|
789
|
+
children: a,
|
|
790
|
+
tags: [
|
|
791
|
+
{
|
|
792
|
+
label: "Form",
|
|
793
|
+
textColor: t,
|
|
794
|
+
backgroundColor: n
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
label: `${e.getAllPathStates().length} fields`,
|
|
798
|
+
textColor: z.white,
|
|
799
|
+
backgroundColor: z.unknown
|
|
800
|
+
}
|
|
801
|
+
]
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
function Yn(e, t) {
|
|
805
|
+
return {
|
|
806
|
+
id: ot(t, e),
|
|
807
|
+
label: m(e.path),
|
|
808
|
+
tags: Wt(e.multiple, e.fieldsCount, e.type, e.valid, t)
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
function Jn(e, t) {
|
|
812
|
+
return {
|
|
813
|
+
id: ot(t, e),
|
|
814
|
+
label: C(e.name),
|
|
815
|
+
tags: Wt(!1, 1, e.type, e.meta.valid, t)
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
function Wt(e, t, n, r, o) {
|
|
819
|
+
const { textColor: a, bgColor: s } = qt(r);
|
|
820
|
+
return [
|
|
821
|
+
e ? void 0 : {
|
|
822
|
+
label: "Field",
|
|
823
|
+
textColor: a,
|
|
824
|
+
backgroundColor: s
|
|
825
|
+
},
|
|
826
|
+
o ? void 0 : {
|
|
827
|
+
label: "Standalone",
|
|
828
|
+
textColor: z.black,
|
|
829
|
+
backgroundColor: z.gray
|
|
830
|
+
},
|
|
831
|
+
n === "checkbox" ? {
|
|
832
|
+
label: "Checkbox",
|
|
833
|
+
textColor: z.white,
|
|
834
|
+
backgroundColor: z.blue
|
|
835
|
+
} : void 0,
|
|
836
|
+
n === "radio" ? {
|
|
837
|
+
label: "Radio",
|
|
838
|
+
textColor: z.white,
|
|
839
|
+
backgroundColor: z.purple
|
|
840
|
+
} : void 0,
|
|
841
|
+
e ? {
|
|
842
|
+
label: "Multiple",
|
|
843
|
+
textColor: z.black,
|
|
844
|
+
backgroundColor: z.orange
|
|
845
|
+
} : void 0
|
|
846
|
+
].filter(Boolean);
|
|
847
|
+
}
|
|
848
|
+
function ot(e, t) {
|
|
849
|
+
const n = t ? "path" in t ? "pathState" : "field" : "form", r = t ? "path" in t ? t?.path : m(t?.name) : "", o = { f: e?.formId, ff: t?.id || r, type: n };
|
|
850
|
+
return btoa(encodeURIComponent(JSON.stringify(o)));
|
|
851
|
+
}
|
|
852
|
+
function Xn(e) {
|
|
853
|
+
try {
|
|
854
|
+
const t = JSON.parse(decodeURIComponent(atob(e))), n = Ce[t.f];
|
|
855
|
+
if (!n && t.ff) {
|
|
856
|
+
const o = we[t.ff];
|
|
857
|
+
return o ? {
|
|
858
|
+
type: t.type,
|
|
859
|
+
field: o
|
|
860
|
+
} : {};
|
|
861
|
+
}
|
|
862
|
+
if (!n)
|
|
863
|
+
return {};
|
|
864
|
+
const r = n.getPathState(t.ff);
|
|
865
|
+
return {
|
|
866
|
+
type: t.type,
|
|
867
|
+
form: n,
|
|
868
|
+
state: r
|
|
869
|
+
};
|
|
870
|
+
} catch {
|
|
871
|
+
}
|
|
872
|
+
return {};
|
|
873
|
+
}
|
|
874
|
+
function _t(e) {
|
|
875
|
+
return {
|
|
876
|
+
"Field state": [
|
|
877
|
+
{ key: "errors", value: e.errors },
|
|
878
|
+
{
|
|
879
|
+
key: "initialValue",
|
|
880
|
+
value: e.initialValue
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
key: "currentValue",
|
|
884
|
+
value: e.value
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
key: "touched",
|
|
888
|
+
value: e.touched
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
key: "dirty",
|
|
892
|
+
value: e.dirty
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
key: "valid",
|
|
896
|
+
value: e.valid
|
|
897
|
+
}
|
|
898
|
+
]
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
function Qn(e) {
|
|
902
|
+
const { errorBag: t, meta: n, values: r, isSubmitting: o, isValidating: a, submitCount: s } = e;
|
|
903
|
+
return {
|
|
904
|
+
"Form state": [
|
|
905
|
+
{
|
|
906
|
+
key: "submitCount",
|
|
907
|
+
value: s.value
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
key: "isSubmitting",
|
|
911
|
+
value: o.value
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
key: "isValidating",
|
|
915
|
+
value: a.value
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
key: "touched",
|
|
919
|
+
value: n.value.touched
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
key: "dirty",
|
|
923
|
+
value: n.value.dirty
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
key: "valid",
|
|
927
|
+
value: n.value.valid
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
key: "initialValues",
|
|
931
|
+
value: n.value.initialValues
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
key: "currentValues",
|
|
935
|
+
value: r
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
key: "errors",
|
|
939
|
+
value: L(t.value).reduce((d, v) => {
|
|
940
|
+
var c;
|
|
941
|
+
const p = (c = t.value[v]) === null || c === void 0 ? void 0 : c[0];
|
|
942
|
+
return p && (d[v] = p), d;
|
|
943
|
+
}, {})
|
|
944
|
+
}
|
|
945
|
+
]
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
function qt(e) {
|
|
949
|
+
return {
|
|
950
|
+
bgColor: e ? z.success : z.error,
|
|
951
|
+
textColor: e ? z.black : z.white
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
function hr(e, t, n) {
|
|
955
|
+
return kt(void 0) ? tr(e, t) : Kt(e, t);
|
|
956
|
+
}
|
|
957
|
+
function Kt(e, t, n) {
|
|
958
|
+
const { initialValue: r, validateOnMount: o, bails: a, type: s, checkedValue: d, label: v, validateOnValueUpdate: c, uncheckedValue: p, controlled: _, keepValueOnUnmount: w, syncVModel: V, form: N } = er(), K = _ ? Rt(lt) : void 0, S = N || K, Z = A(() => Ee(m(e))), J = A(() => {
|
|
959
|
+
if (m(S?.schema))
|
|
960
|
+
return;
|
|
961
|
+
const O = C(t);
|
|
962
|
+
return Me(O) || ee(O) || W(O) || Array.isArray(O) ? O : Ut(O);
|
|
963
|
+
}), $e = !W(J.value) && ee(m(t)), { id: pe, value: de, initialValue: fe, meta: x, setState: ye, errors: ge, flags: ve } = Ln(Z, {
|
|
964
|
+
modelValue: r,
|
|
965
|
+
form: S,
|
|
966
|
+
bails: a,
|
|
967
|
+
label: v,
|
|
968
|
+
type: s,
|
|
969
|
+
validate: J.value ? ue : void 0,
|
|
970
|
+
schema: $e ? t : void 0
|
|
971
|
+
}), G = A(() => ge.value[0]);
|
|
972
|
+
V && nr({
|
|
973
|
+
value: de,
|
|
974
|
+
prop: V,
|
|
975
|
+
handleChange: D,
|
|
976
|
+
shouldValidate: () => c && !ve.pendingReset
|
|
977
|
+
});
|
|
978
|
+
const be = (h, O = !1) => {
|
|
979
|
+
x.touched = !0, O && ae();
|
|
980
|
+
};
|
|
981
|
+
async function Ne(h) {
|
|
982
|
+
var O, I;
|
|
983
|
+
if (S?.validateSchema) {
|
|
984
|
+
const { results: E } = await S.validateSchema(h);
|
|
985
|
+
return (O = E[m(Z)]) !== null && O !== void 0 ? O : { valid: !0, errors: [] };
|
|
986
|
+
}
|
|
987
|
+
return J.value ? Bt(de.value, J.value, {
|
|
988
|
+
name: m(Z),
|
|
989
|
+
label: m(v),
|
|
990
|
+
values: (I = S?.values) !== null && I !== void 0 ? I : {},
|
|
991
|
+
bails: a
|
|
992
|
+
}) : { valid: !0, errors: [] };
|
|
993
|
+
}
|
|
994
|
+
const ae = nt(async () => (x.pending = !0, x.validated = !0, Ne("validated-only")), (h) => (ve.pendingUnmount[R.id] || (ye({ errors: h.errors }), x.pending = !1, x.valid = h.valid), h)), re = nt(async () => Ne("silent"), (h) => (x.valid = h.valid, h));
|
|
995
|
+
function ue(h) {
|
|
996
|
+
return h?.mode === "silent" ? re() : ae();
|
|
997
|
+
}
|
|
998
|
+
function D(h, O = !0) {
|
|
999
|
+
const I = Ue(h);
|
|
1000
|
+
Se(I, O);
|
|
1001
|
+
}
|
|
1002
|
+
Ct(() => {
|
|
1003
|
+
if (o)
|
|
1004
|
+
return ae();
|
|
1005
|
+
(!S || !S.validateSchema) && re();
|
|
1006
|
+
});
|
|
1007
|
+
function Le(h) {
|
|
1008
|
+
x.touched = h;
|
|
1009
|
+
}
|
|
1010
|
+
function se(h) {
|
|
1011
|
+
var O;
|
|
1012
|
+
const I = h && "value" in h ? h.value : fe.value;
|
|
1013
|
+
ye({
|
|
1014
|
+
value: j(I),
|
|
1015
|
+
initialValue: j(I),
|
|
1016
|
+
touched: (O = h?.touched) !== null && O !== void 0 ? O : !1,
|
|
1017
|
+
errors: h?.errors || []
|
|
1018
|
+
}), x.pending = !1, x.validated = !1, re();
|
|
1019
|
+
}
|
|
1020
|
+
const he = Ve();
|
|
1021
|
+
function Se(h, O = !0) {
|
|
1022
|
+
de.value = he && V ? An(h, he.props.modelModifiers) : h, (O ? ae : re)();
|
|
1023
|
+
}
|
|
1024
|
+
function Te(h) {
|
|
1025
|
+
ye({ errors: Array.isArray(h) ? h : [h] });
|
|
1026
|
+
}
|
|
1027
|
+
const at = A({
|
|
1028
|
+
get() {
|
|
1029
|
+
return de.value;
|
|
1030
|
+
},
|
|
1031
|
+
set(h) {
|
|
1032
|
+
Se(h, c);
|
|
1033
|
+
}
|
|
1034
|
+
}), R = {
|
|
1035
|
+
id: pe,
|
|
1036
|
+
name: Z,
|
|
1037
|
+
label: v,
|
|
1038
|
+
value: at,
|
|
1039
|
+
meta: x,
|
|
1040
|
+
errors: ge,
|
|
1041
|
+
errorMessage: G,
|
|
1042
|
+
type: s,
|
|
1043
|
+
checkedValue: d,
|
|
1044
|
+
uncheckedValue: p,
|
|
1045
|
+
bails: a,
|
|
1046
|
+
keepValueOnUnmount: w,
|
|
1047
|
+
resetField: se,
|
|
1048
|
+
handleReset: () => se(),
|
|
1049
|
+
validate: ue,
|
|
1050
|
+
handleChange: D,
|
|
1051
|
+
handleBlur: be,
|
|
1052
|
+
setState: ye,
|
|
1053
|
+
setTouched: Le,
|
|
1054
|
+
setErrors: Te,
|
|
1055
|
+
setValue: Se
|
|
1056
|
+
};
|
|
1057
|
+
if (et(bn, R), Re(t) && typeof C(t) != "function" && oe(t, (h, O) => {
|
|
1058
|
+
B(h, O) || (x.validated ? ae() : re());
|
|
1059
|
+
}, {
|
|
1060
|
+
deep: !0
|
|
1061
|
+
}), process.env.NODE_ENV !== "production" && (R._vm = Ve(), oe(() => Object.assign(Object.assign({ errors: ge.value }, x), { value: de.value }), _e, {
|
|
1062
|
+
deep: !0
|
|
1063
|
+
}), S || Gn(R)), !S)
|
|
1064
|
+
return R;
|
|
1065
|
+
const ze = A(() => {
|
|
1066
|
+
const h = J.value;
|
|
1067
|
+
return !h || W(h) || Me(h) || ee(h) || Array.isArray(h) ? {} : Object.keys(h).reduce((O, I) => {
|
|
1068
|
+
const E = Nn(h[I]).map((ie) => ie.__locatorRef).reduce((ie, te) => {
|
|
1069
|
+
const H = q(S.values, te) || S.values[te];
|
|
1070
|
+
return H !== void 0 && (ie[te] = H), ie;
|
|
1071
|
+
}, {});
|
|
1072
|
+
return Object.assign(O, E), O;
|
|
1073
|
+
}, {});
|
|
1074
|
+
});
|
|
1075
|
+
return oe(ze, (h, O) => {
|
|
1076
|
+
if (!Object.keys(h).length)
|
|
1077
|
+
return;
|
|
1078
|
+
!B(h, O) && (x.validated ? ae() : re());
|
|
1079
|
+
}), fn(() => {
|
|
1080
|
+
var h;
|
|
1081
|
+
const O = (h = m(R.keepValueOnUnmount)) !== null && h !== void 0 ? h : m(S.keepValuesOnUnmount), I = m(Z);
|
|
1082
|
+
if (O || !S || ve.pendingUnmount[R.id]) {
|
|
1083
|
+
S?.removePathState(I, pe);
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
ve.pendingUnmount[R.id] = !0;
|
|
1087
|
+
const E = S.getPathState(I);
|
|
1088
|
+
if (Array.isArray(E?.id) && E?.multiple ? E?.id.includes(R.id) : E?.id === R.id) {
|
|
1089
|
+
if (E?.multiple && Array.isArray(E.value)) {
|
|
1090
|
+
const te = E.value.findIndex((H) => B(H, m(R.checkedValue)));
|
|
1091
|
+
if (te > -1) {
|
|
1092
|
+
const H = [...E.value];
|
|
1093
|
+
H.splice(te, 1), S.setFieldValue(I, H);
|
|
1094
|
+
}
|
|
1095
|
+
Array.isArray(E.id) && E.id.splice(E.id.indexOf(R.id), 1);
|
|
1096
|
+
} else
|
|
1097
|
+
S.unsetPathValue(m(Z));
|
|
1098
|
+
S.removePathState(I, pe);
|
|
1099
|
+
}
|
|
1100
|
+
}), R;
|
|
1101
|
+
}
|
|
1102
|
+
function er(e) {
|
|
1103
|
+
return Object.assign(Object.assign({}, {
|
|
1104
|
+
initialValue: void 0,
|
|
1105
|
+
validateOnMount: !1,
|
|
1106
|
+
bails: !0,
|
|
1107
|
+
label: void 0,
|
|
1108
|
+
validateOnValueUpdate: !0,
|
|
1109
|
+
keepValueOnUnmount: void 0,
|
|
1110
|
+
syncVModel: !1,
|
|
1111
|
+
controlled: !0
|
|
1112
|
+
}), { initialValue: void 0 });
|
|
1113
|
+
}
|
|
1114
|
+
function tr(e, t, n) {
|
|
1115
|
+
const r = Rt(lt), o = void 0, a = void 0;
|
|
1116
|
+
function s(d) {
|
|
1117
|
+
const v = d.handleChange, c = A(() => {
|
|
1118
|
+
const _ = m(d.value), w = m(o);
|
|
1119
|
+
return Array.isArray(_) ? _.findIndex((V) => B(V, w)) >= 0 : B(w, _);
|
|
1120
|
+
});
|
|
1121
|
+
function p(_, w = !0) {
|
|
1122
|
+
var V, N;
|
|
1123
|
+
if (c.value === ((V = _?.target) === null || V === void 0 ? void 0 : V.checked)) {
|
|
1124
|
+
w && d.validate();
|
|
1125
|
+
return;
|
|
1126
|
+
}
|
|
1127
|
+
const K = m(e), S = r?.getPathState(K), Z = Ue(_);
|
|
1128
|
+
let J = (N = m(o)) !== null && N !== void 0 ? N : Z;
|
|
1129
|
+
r && S?.multiple && S.type === "checkbox" && (J = jn(q(r.values, K) || [], J, void 0)), v(J, w);
|
|
1130
|
+
}
|
|
1131
|
+
return Object.assign(Object.assign({}, d), {
|
|
1132
|
+
checked: c,
|
|
1133
|
+
checkedValue: o,
|
|
1134
|
+
uncheckedValue: a,
|
|
1135
|
+
handleChange: p
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
return s(Kt(e, t));
|
|
1139
|
+
}
|
|
1140
|
+
function nr({ prop: e, value: t, handleChange: n, shouldValidate: r }) {
|
|
1141
|
+
const o = Ve();
|
|
1142
|
+
if (!o || !e) {
|
|
1143
|
+
process.env.NODE_ENV !== "production" && console.warn("Failed to setup model events because `useField` was not called in setup.");
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
const a = typeof e == "string" ? e : "modelValue", s = `update:${a}`;
|
|
1147
|
+
a in o.props && (oe(t, (d) => {
|
|
1148
|
+
B(d, St(o, a)) || o.emit(s, d);
|
|
1149
|
+
}), oe(() => St(o, a), (d) => {
|
|
1150
|
+
if (d === mt && t.value === void 0)
|
|
1151
|
+
return;
|
|
1152
|
+
const v = d === mt ? void 0 : d;
|
|
1153
|
+
B(v, t.value) || n(v, r());
|
|
1154
|
+
}));
|
|
1155
|
+
}
|
|
1156
|
+
function St(e, t) {
|
|
1157
|
+
if (e)
|
|
1158
|
+
return e.props[t];
|
|
1159
|
+
}
|
|
1160
|
+
let rr = 0;
|
|
1161
|
+
const xe = ["bails", "fieldsCount", "id", "multiple", "type", "validate"];
|
|
1162
|
+
function Zt(e) {
|
|
1163
|
+
const t = e?.initialValues || {}, n = Object.assign({}, m(t)), r = C(e?.validationSchema);
|
|
1164
|
+
return r && ee(r) && W(r.cast) ? j(r.cast(n) || {}) : j(n);
|
|
1165
|
+
}
|
|
1166
|
+
function mr(e) {
|
|
1167
|
+
var t;
|
|
1168
|
+
const n = rr++, r = e?.name || "Form";
|
|
1169
|
+
let o = 0;
|
|
1170
|
+
const a = Q(!1), s = Q(!1), d = Q(0), v = [], c = De(Zt(e)), p = Q([]), _ = Q({}), w = Q({}), V = Cn(() => {
|
|
1171
|
+
w.value = p.value.reduce((l, i) => (l[Ee(m(i.path))] = i, l), {});
|
|
1172
|
+
});
|
|
1173
|
+
function N(l, i) {
|
|
1174
|
+
const u = D(l);
|
|
1175
|
+
if (!u) {
|
|
1176
|
+
typeof l == "string" && (_.value[Ee(l)] = rt(i));
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
if (typeof l == "string") {
|
|
1180
|
+
const f = Ee(l);
|
|
1181
|
+
_.value[f] && delete _.value[f];
|
|
1182
|
+
}
|
|
1183
|
+
u.errors = rt(i), u.valid = !u.errors.length;
|
|
1184
|
+
}
|
|
1185
|
+
function K(l) {
|
|
1186
|
+
L(l).forEach((i) => {
|
|
1187
|
+
N(i, l[i]);
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
e?.initialErrors && K(e.initialErrors);
|
|
1191
|
+
const S = A(() => {
|
|
1192
|
+
const l = p.value.reduce((i, u) => (u.errors.length && (i[m(u.path)] = u.errors), i), {});
|
|
1193
|
+
return Object.assign(Object.assign({}, _.value), l);
|
|
1194
|
+
}), Z = A(() => L(S.value).reduce((l, i) => {
|
|
1195
|
+
const u = S.value[i];
|
|
1196
|
+
return u?.length && (l[i] = u[0]), l;
|
|
1197
|
+
}, {})), J = A(() => p.value.reduce((l, i) => (l[m(i.path)] = { name: m(i.path) || "", label: i.label || "" }, l), {})), $e = A(() => p.value.reduce((l, i) => {
|
|
1198
|
+
var u;
|
|
1199
|
+
return l[m(i.path)] = (u = i.bails) !== null && u !== void 0 ? u : !0, l;
|
|
1200
|
+
}, {})), pe = Object.assign({}, e?.initialErrors || {}), de = (t = e?.keepValuesOnUnmount) !== null && t !== void 0 ? t : !1, { initialValues: fe, originalInitialValues: x, setInitialValues: ye } = lr(p, c, e), ge = ir(p, c, x, Z), ve = A(() => p.value.reduce((l, i) => {
|
|
1201
|
+
const u = q(c, m(i.path));
|
|
1202
|
+
return ne(l, m(i.path), u), l;
|
|
1203
|
+
}, {})), G = e?.validationSchema;
|
|
1204
|
+
function be(l, i) {
|
|
1205
|
+
var u, f;
|
|
1206
|
+
const g = A(() => q(fe.value, m(l))), b = w.value[m(l)], y = i?.type === "checkbox" || i?.type === "radio";
|
|
1207
|
+
if (b && y) {
|
|
1208
|
+
b.multiple = !0;
|
|
1209
|
+
const Y = o++;
|
|
1210
|
+
return Array.isArray(b.id) ? b.id.push(Y) : b.id = [b.id, Y], b.fieldsCount++, b.__flags.pendingUnmount[Y] = !1, b;
|
|
1211
|
+
}
|
|
1212
|
+
const F = A(() => q(c, m(l))), T = m(l), M = se.findIndex((Y) => Y === T);
|
|
1213
|
+
M !== -1 && se.splice(M, 1);
|
|
1214
|
+
const P = A(() => {
|
|
1215
|
+
var Y, je, Ge, He;
|
|
1216
|
+
const Ye = m(G);
|
|
1217
|
+
if (ee(Ye))
|
|
1218
|
+
return (je = (Y = Ye.describe) === null || Y === void 0 ? void 0 : Y.call(Ye, m(l)).required) !== null && je !== void 0 ? je : !1;
|
|
1219
|
+
const Je = m(i?.schema);
|
|
1220
|
+
return ee(Je) && (He = (Ge = Je.describe) === null || Ge === void 0 ? void 0 : Ge.call(Je).required) !== null && He !== void 0 ? He : !1;
|
|
1221
|
+
}), U = o++, $ = De({
|
|
1222
|
+
id: U,
|
|
1223
|
+
path: l,
|
|
1224
|
+
touched: !1,
|
|
1225
|
+
pending: !1,
|
|
1226
|
+
valid: !0,
|
|
1227
|
+
validated: !!(!((u = pe[T]) === null || u === void 0) && u.length),
|
|
1228
|
+
required: P,
|
|
1229
|
+
initialValue: g,
|
|
1230
|
+
errors: cn([]),
|
|
1231
|
+
bails: (f = i?.bails) !== null && f !== void 0 ? f : !1,
|
|
1232
|
+
label: i?.label,
|
|
1233
|
+
type: i?.type || "default",
|
|
1234
|
+
value: F,
|
|
1235
|
+
multiple: !1,
|
|
1236
|
+
__flags: {
|
|
1237
|
+
pendingUnmount: { [U]: !1 },
|
|
1238
|
+
pendingReset: !1
|
|
1239
|
+
},
|
|
1240
|
+
fieldsCount: 1,
|
|
1241
|
+
validate: i?.validate,
|
|
1242
|
+
dirty: A(() => !B(C(F), C(g)))
|
|
1243
|
+
});
|
|
1244
|
+
return p.value.push($), w.value[T] = $, V(), Z.value[T] && !pe[T] && X(() => {
|
|
1245
|
+
me(T, { mode: "silent" });
|
|
1246
|
+
}), Re(l) && oe(l, (Y) => {
|
|
1247
|
+
V();
|
|
1248
|
+
const je = j(F.value);
|
|
1249
|
+
w.value[Y] = $, X(() => {
|
|
1250
|
+
ne(c, Y, je);
|
|
1251
|
+
});
|
|
1252
|
+
}), $;
|
|
1253
|
+
}
|
|
1254
|
+
const Ne = bt(ct, 5), ae = bt(ct, 5), re = nt(async (l) => await (l === "silent" ? Ne() : ae()), (l, [i]) => {
|
|
1255
|
+
const u = L(O.errorBag.value), g = [
|
|
1256
|
+
.../* @__PURE__ */ new Set([...L(l.results), ...p.value.map((b) => b.path), ...u])
|
|
1257
|
+
].sort().reduce((b, y) => {
|
|
1258
|
+
var F;
|
|
1259
|
+
const T = y, M = D(T) || Le(T), P = ((F = l.results[T]) === null || F === void 0 ? void 0 : F.errors) || [], U = m(M?.path) || T, $ = or({ errors: P, valid: !P.length }, b.results[U]);
|
|
1260
|
+
return b.results[U] = $, $.valid || (b.errors[U] = $.errors[0]), M && _.value[U] && delete _.value[U], M ? (M.valid = $.valid, i === "silent" || i === "validated-only" && !M.validated || N(M, $.errors), b) : (N(U, P), b);
|
|
1261
|
+
}, {
|
|
1262
|
+
valid: l.valid,
|
|
1263
|
+
results: {},
|
|
1264
|
+
errors: {},
|
|
1265
|
+
source: l.source
|
|
1266
|
+
});
|
|
1267
|
+
return l.values && (g.values = l.values, g.source = l.source), L(g.results).forEach((b) => {
|
|
1268
|
+
var y;
|
|
1269
|
+
const F = D(b);
|
|
1270
|
+
F && i !== "silent" && (i === "validated-only" && !F.validated || N(F, (y = g.results[b]) === null || y === void 0 ? void 0 : y.errors));
|
|
1271
|
+
}), g;
|
|
1272
|
+
});
|
|
1273
|
+
function ue(l) {
|
|
1274
|
+
p.value.forEach(l);
|
|
1275
|
+
}
|
|
1276
|
+
function D(l) {
|
|
1277
|
+
const i = typeof l == "string" ? Ee(l) : l;
|
|
1278
|
+
return typeof i == "string" ? w.value[i] : i;
|
|
1279
|
+
}
|
|
1280
|
+
function Le(l) {
|
|
1281
|
+
return p.value.filter((u) => l.startsWith(m(u.path))).reduce((u, f) => u ? f.path.length > u.path.length ? f : u : f, void 0);
|
|
1282
|
+
}
|
|
1283
|
+
let se = [], he;
|
|
1284
|
+
function Se(l) {
|
|
1285
|
+
return se.push(l), he || (he = X(() => {
|
|
1286
|
+
[...se].sort().reverse().forEach((u) => {
|
|
1287
|
+
gt(c, u);
|
|
1288
|
+
}), se = [], he = null;
|
|
1289
|
+
})), he;
|
|
1290
|
+
}
|
|
1291
|
+
function Te(l) {
|
|
1292
|
+
return function(u, f) {
|
|
1293
|
+
return function(b) {
|
|
1294
|
+
return b instanceof Event && (b.preventDefault(), b.stopPropagation()), ue((y) => y.touched = !0), a.value = !0, d.value++, Oe().then((y) => {
|
|
1295
|
+
const F = j(c);
|
|
1296
|
+
if (y.valid && typeof u == "function") {
|
|
1297
|
+
const T = j(ve.value);
|
|
1298
|
+
let M = l ? T : F;
|
|
1299
|
+
return y.values && (M = y.source === "schema" ? y.values : Object.assign({}, M, y.values)), u(M, {
|
|
1300
|
+
evt: b,
|
|
1301
|
+
controlledValues: T,
|
|
1302
|
+
setErrors: K,
|
|
1303
|
+
setFieldError: N,
|
|
1304
|
+
setTouched: We,
|
|
1305
|
+
setFieldTouched: H,
|
|
1306
|
+
setValues: ie,
|
|
1307
|
+
setFieldValue: I,
|
|
1308
|
+
resetForm: qe,
|
|
1309
|
+
resetField: ut
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
!y.valid && typeof f == "function" && f({
|
|
1313
|
+
values: F,
|
|
1314
|
+
evt: b,
|
|
1315
|
+
errors: y.errors,
|
|
1316
|
+
results: y.results
|
|
1317
|
+
});
|
|
1318
|
+
}).then((y) => (a.value = !1, y), (y) => {
|
|
1319
|
+
throw a.value = !1, y;
|
|
1320
|
+
});
|
|
1321
|
+
};
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
const R = Te(!1);
|
|
1325
|
+
R.withControlled = Te(!0);
|
|
1326
|
+
function ze(l, i) {
|
|
1327
|
+
const u = p.value.findIndex((g) => g.path === l && (Array.isArray(g.id) ? g.id.includes(i) : g.id === i)), f = p.value[u];
|
|
1328
|
+
if (!(u === -1 || !f)) {
|
|
1329
|
+
if (X(() => {
|
|
1330
|
+
me(l, { mode: "silent", warn: !1 });
|
|
1331
|
+
}), f.multiple && f.fieldsCount && f.fieldsCount--, Array.isArray(f.id)) {
|
|
1332
|
+
const g = f.id.indexOf(i);
|
|
1333
|
+
g >= 0 && f.id.splice(g, 1), delete f.__flags.pendingUnmount[i];
|
|
1334
|
+
}
|
|
1335
|
+
(!f.multiple || f.fieldsCount <= 0) && (p.value.splice(u, 1), st(l), V(), delete w.value[l]);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
function h(l) {
|
|
1339
|
+
L(w.value).forEach((i) => {
|
|
1340
|
+
i.startsWith(l) && delete w.value[i];
|
|
1341
|
+
}), p.value = p.value.filter((i) => !i.path.startsWith(l)), X(() => {
|
|
1342
|
+
V();
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
const O = {
|
|
1346
|
+
name: r,
|
|
1347
|
+
formId: n,
|
|
1348
|
+
values: c,
|
|
1349
|
+
controlledValues: ve,
|
|
1350
|
+
errorBag: S,
|
|
1351
|
+
errors: Z,
|
|
1352
|
+
schema: G,
|
|
1353
|
+
submitCount: d,
|
|
1354
|
+
meta: ge,
|
|
1355
|
+
isSubmitting: a,
|
|
1356
|
+
isValidating: s,
|
|
1357
|
+
fieldArrays: v,
|
|
1358
|
+
keepValuesOnUnmount: de,
|
|
1359
|
+
validateSchema: C(G) ? re : void 0,
|
|
1360
|
+
validate: Oe,
|
|
1361
|
+
setFieldError: N,
|
|
1362
|
+
validateField: me,
|
|
1363
|
+
setFieldValue: I,
|
|
1364
|
+
setValues: ie,
|
|
1365
|
+
setErrors: K,
|
|
1366
|
+
setFieldTouched: H,
|
|
1367
|
+
setTouched: We,
|
|
1368
|
+
resetForm: qe,
|
|
1369
|
+
resetField: ut,
|
|
1370
|
+
handleSubmit: R,
|
|
1371
|
+
useFieldModel: ln,
|
|
1372
|
+
defineInputBinds: on,
|
|
1373
|
+
defineComponentBinds: an,
|
|
1374
|
+
defineField: Ze,
|
|
1375
|
+
stageInitialValue: nn,
|
|
1376
|
+
unsetInitialValue: st,
|
|
1377
|
+
setFieldInitialValue: Ke,
|
|
1378
|
+
createPathState: be,
|
|
1379
|
+
getPathState: D,
|
|
1380
|
+
unsetPathValue: Se,
|
|
1381
|
+
removePathState: ze,
|
|
1382
|
+
initialValues: fe,
|
|
1383
|
+
getAllPathStates: () => p.value,
|
|
1384
|
+
destroyPath: h,
|
|
1385
|
+
isFieldTouched: Qt,
|
|
1386
|
+
isFieldDirty: en,
|
|
1387
|
+
isFieldValid: tn
|
|
1388
|
+
};
|
|
1389
|
+
function I(l, i, u = !0) {
|
|
1390
|
+
const f = j(i), g = typeof l == "string" ? l : l.path;
|
|
1391
|
+
D(g) || be(g), ne(c, g, f), u && me(g);
|
|
1392
|
+
}
|
|
1393
|
+
function E(l, i = !0) {
|
|
1394
|
+
L(c).forEach((u) => {
|
|
1395
|
+
delete c[u];
|
|
1396
|
+
}), L(l).forEach((u) => {
|
|
1397
|
+
I(u, l[u], !1);
|
|
1398
|
+
}), i && Oe();
|
|
1399
|
+
}
|
|
1400
|
+
function ie(l, i = !0) {
|
|
1401
|
+
Pe(c, l), v.forEach((u) => u && u.reset()), i && Oe();
|
|
1402
|
+
}
|
|
1403
|
+
function te(l, i) {
|
|
1404
|
+
const u = D(m(l)) || be(l);
|
|
1405
|
+
return A({
|
|
1406
|
+
get() {
|
|
1407
|
+
return u.value;
|
|
1408
|
+
},
|
|
1409
|
+
set(f) {
|
|
1410
|
+
var g;
|
|
1411
|
+
const b = m(l);
|
|
1412
|
+
I(b, f, (g = m(i)) !== null && g !== void 0 ? g : !1);
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
}
|
|
1416
|
+
function H(l, i) {
|
|
1417
|
+
const u = D(l);
|
|
1418
|
+
u && (u.touched = i);
|
|
1419
|
+
}
|
|
1420
|
+
function Qt(l) {
|
|
1421
|
+
const i = D(l);
|
|
1422
|
+
return i ? i.touched : p.value.filter((u) => u.path.startsWith(l)).some((u) => u.touched);
|
|
1423
|
+
}
|
|
1424
|
+
function en(l) {
|
|
1425
|
+
const i = D(l);
|
|
1426
|
+
return i ? i.dirty : p.value.filter((u) => u.path.startsWith(l)).some((u) => u.dirty);
|
|
1427
|
+
}
|
|
1428
|
+
function tn(l) {
|
|
1429
|
+
const i = D(l);
|
|
1430
|
+
return i ? i.valid : p.value.filter((u) => u.path.startsWith(l)).every((u) => u.valid);
|
|
1431
|
+
}
|
|
1432
|
+
function We(l) {
|
|
1433
|
+
if (typeof l == "boolean") {
|
|
1434
|
+
ue((i) => {
|
|
1435
|
+
i.touched = l;
|
|
1436
|
+
});
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
L(l).forEach((i) => {
|
|
1440
|
+
H(i, !!l[i]);
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
function ut(l, i) {
|
|
1444
|
+
var u;
|
|
1445
|
+
const f = i && "value" in i ? i.value : q(fe.value, l), g = D(l);
|
|
1446
|
+
g && (g.__flags.pendingReset = !0), Ke(l, j(f), !0), I(l, f, !1), H(l, (u = i?.touched) !== null && u !== void 0 ? u : !1), N(l, i?.errors || []), X(() => {
|
|
1447
|
+
g && (g.__flags.pendingReset = !1);
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
function qe(l, i) {
|
|
1451
|
+
let u = j(l?.values ? l.values : x.value);
|
|
1452
|
+
u = i?.force ? u : Pe(x.value, u), u = ee(G) && W(G.cast) ? G.cast(u) : u, ye(u, { force: i?.force }), ue((f) => {
|
|
1453
|
+
var g;
|
|
1454
|
+
f.__flags.pendingReset = !0, f.validated = !1, f.touched = ((g = l?.touched) === null || g === void 0 ? void 0 : g[m(f.path)]) || !1, I(m(f.path), q(u, m(f.path)), !1), N(m(f.path), void 0);
|
|
1455
|
+
}), i?.force ? E(u, !1) : ie(u, !1), K(l?.errors || {}), d.value = l?.submitCount || 0, X(() => {
|
|
1456
|
+
Oe({ mode: "silent" }), ue((f) => {
|
|
1457
|
+
f.__flags.pendingReset = !1;
|
|
1458
|
+
});
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
async function Oe(l) {
|
|
1462
|
+
const i = l?.mode || "force";
|
|
1463
|
+
if (i === "force" && ue((y) => y.validated = !0), O.validateSchema)
|
|
1464
|
+
return O.validateSchema(i);
|
|
1465
|
+
s.value = !0;
|
|
1466
|
+
const u = await Promise.all(p.value.map((y) => y.validate ? y.validate(l).then((F) => ({
|
|
1467
|
+
key: m(y.path),
|
|
1468
|
+
valid: F.valid,
|
|
1469
|
+
errors: F.errors,
|
|
1470
|
+
value: F.value
|
|
1471
|
+
})) : Promise.resolve({
|
|
1472
|
+
key: m(y.path),
|
|
1473
|
+
valid: !0,
|
|
1474
|
+
errors: [],
|
|
1475
|
+
value: void 0
|
|
1476
|
+
})));
|
|
1477
|
+
s.value = !1;
|
|
1478
|
+
const f = {}, g = {}, b = {};
|
|
1479
|
+
for (const y of u)
|
|
1480
|
+
f[y.key] = {
|
|
1481
|
+
valid: y.valid,
|
|
1482
|
+
errors: y.errors
|
|
1483
|
+
}, y.value && ne(b, y.key, y.value), y.errors.length && (g[y.key] = y.errors[0]);
|
|
1484
|
+
return {
|
|
1485
|
+
valid: u.every((y) => y.valid),
|
|
1486
|
+
results: f,
|
|
1487
|
+
errors: g,
|
|
1488
|
+
values: b,
|
|
1489
|
+
source: "fields"
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
async function me(l, i) {
|
|
1493
|
+
var u;
|
|
1494
|
+
const f = D(l);
|
|
1495
|
+
if (f && i?.mode !== "silent" && (f.validated = !0), G) {
|
|
1496
|
+
const { results: b } = await re(i?.mode || "validated-only");
|
|
1497
|
+
return b[l] || { errors: [], valid: !0 };
|
|
1498
|
+
}
|
|
1499
|
+
return f?.validate ? f.validate(i) : (!f && (!((u = i?.warn) !== null && u !== void 0) || u) && process.env.NODE_ENV !== "production" && dn(`field with path ${l} was not found`), Promise.resolve({ errors: [], valid: !0 }));
|
|
1500
|
+
}
|
|
1501
|
+
function st(l) {
|
|
1502
|
+
gt(fe.value, l);
|
|
1503
|
+
}
|
|
1504
|
+
function nn(l, i, u = !1) {
|
|
1505
|
+
Ke(l, i), ne(c, l, i), u && !e?.initialValues && ne(x.value, l, j(i));
|
|
1506
|
+
}
|
|
1507
|
+
function Ke(l, i, u = !1) {
|
|
1508
|
+
ne(fe.value, l, j(i)), u && ne(x.value, l, j(i));
|
|
1509
|
+
}
|
|
1510
|
+
async function ct() {
|
|
1511
|
+
const l = C(G);
|
|
1512
|
+
if (!l)
|
|
1513
|
+
return { valid: !0, results: {}, errors: {}, source: "none" };
|
|
1514
|
+
s.value = !0;
|
|
1515
|
+
const i = Me(l) || ee(l) ? await Bn(l, c) : await $n(l, c, {
|
|
1516
|
+
names: J.value,
|
|
1517
|
+
bailsMap: $e.value
|
|
1518
|
+
});
|
|
1519
|
+
return s.value = !1, i;
|
|
1520
|
+
}
|
|
1521
|
+
const rn = R((l, { evt: i }) => {
|
|
1522
|
+
Sn(i) && i.target.submit();
|
|
1523
|
+
});
|
|
1524
|
+
Ct(() => {
|
|
1525
|
+
if (e?.initialErrors && K(e.initialErrors), e?.initialTouched && We(e.initialTouched), e?.validateOnMount) {
|
|
1526
|
+
Oe();
|
|
1527
|
+
return;
|
|
1528
|
+
}
|
|
1529
|
+
O.validateSchema && O.validateSchema("silent");
|
|
1530
|
+
}), Re(G) && oe(G, () => {
|
|
1531
|
+
var l;
|
|
1532
|
+
(l = O.validateSchema) === null || l === void 0 || l.call(O, "validated-only");
|
|
1533
|
+
}), et(lt, O), process.env.NODE_ENV !== "production" && (Zn(O), oe(() => Object.assign(Object.assign({ errors: S.value }, ge.value), { values: c, isSubmitting: a.value, isValidating: s.value, submitCount: d.value }), _e, {
|
|
1534
|
+
deep: !0
|
|
1535
|
+
}));
|
|
1536
|
+
function Ze(l, i) {
|
|
1537
|
+
const u = W(i) ? void 0 : i?.label, f = D(m(l)) || be(l, { label: u }), g = () => W(i) ? i(ke(f, xe)) : i || {};
|
|
1538
|
+
function b() {
|
|
1539
|
+
var P;
|
|
1540
|
+
f.touched = !0, ((P = g().validateOnBlur) !== null && P !== void 0 ? P : Ae().validateOnBlur) && me(m(f.path));
|
|
1541
|
+
}
|
|
1542
|
+
function y() {
|
|
1543
|
+
var P;
|
|
1544
|
+
((P = g().validateOnInput) !== null && P !== void 0 ? P : Ae().validateOnInput) && X(() => {
|
|
1545
|
+
me(m(f.path));
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
function F() {
|
|
1549
|
+
var P;
|
|
1550
|
+
((P = g().validateOnChange) !== null && P !== void 0 ? P : Ae().validateOnChange) && X(() => {
|
|
1551
|
+
me(m(f.path));
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
const T = A(() => {
|
|
1555
|
+
const P = {
|
|
1556
|
+
onChange: F,
|
|
1557
|
+
onInput: y,
|
|
1558
|
+
onBlur: b
|
|
1559
|
+
};
|
|
1560
|
+
return W(i) ? Object.assign(Object.assign({}, P), i(ke(f, xe)).props || {}) : i?.props ? Object.assign(Object.assign({}, P), i.props(ke(f, xe))) : P;
|
|
1561
|
+
});
|
|
1562
|
+
return [te(l, () => {
|
|
1563
|
+
var P, U, $;
|
|
1564
|
+
return ($ = (P = g().validateOnModelUpdate) !== null && P !== void 0 ? P : (U = Ae()) === null || U === void 0 ? void 0 : U.validateOnModelUpdate) !== null && $ !== void 0 ? $ : !0;
|
|
1565
|
+
}), T];
|
|
1566
|
+
}
|
|
1567
|
+
function ln(l) {
|
|
1568
|
+
return Array.isArray(l) ? l.map((i) => te(i, !0)) : te(l);
|
|
1569
|
+
}
|
|
1570
|
+
function on(l, i) {
|
|
1571
|
+
const [u, f] = Ze(l, i);
|
|
1572
|
+
function g() {
|
|
1573
|
+
f.value.onBlur();
|
|
1574
|
+
}
|
|
1575
|
+
function b(F) {
|
|
1576
|
+
const T = Ue(F);
|
|
1577
|
+
I(m(l), T, !1), f.value.onInput();
|
|
1578
|
+
}
|
|
1579
|
+
function y(F) {
|
|
1580
|
+
const T = Ue(F);
|
|
1581
|
+
I(m(l), T, !1), f.value.onChange();
|
|
1582
|
+
}
|
|
1583
|
+
return A(() => Object.assign(Object.assign({}, f.value), {
|
|
1584
|
+
onBlur: g,
|
|
1585
|
+
onInput: b,
|
|
1586
|
+
onChange: y,
|
|
1587
|
+
value: u.value
|
|
1588
|
+
}));
|
|
1589
|
+
}
|
|
1590
|
+
function an(l, i) {
|
|
1591
|
+
const [u, f] = Ze(l, i), g = D(m(l));
|
|
1592
|
+
function b(y) {
|
|
1593
|
+
u.value = y;
|
|
1594
|
+
}
|
|
1595
|
+
return A(() => {
|
|
1596
|
+
const y = W(i) ? i(ke(g, xe)) : i || {};
|
|
1597
|
+
return Object.assign({ [y.model || "modelValue"]: u.value, [`onUpdate:${y.model || "modelValue"}`]: b }, f.value);
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
const dt = Object.assign(Object.assign({}, O), { values: un(c), handleReset: () => qe(), submitForm: rn });
|
|
1601
|
+
return et(Nt, dt), dt;
|
|
1602
|
+
}
|
|
1603
|
+
function ir(e, t, n, r) {
|
|
1604
|
+
const o = {
|
|
1605
|
+
touched: "some",
|
|
1606
|
+
pending: "some",
|
|
1607
|
+
valid: "every"
|
|
1608
|
+
}, a = A(() => !B(t, C(n)));
|
|
1609
|
+
function s() {
|
|
1610
|
+
const v = e.value;
|
|
1611
|
+
return L(o).reduce((c, p) => {
|
|
1612
|
+
const _ = o[p];
|
|
1613
|
+
return c[p] = v[_]((w) => w[p]), c;
|
|
1614
|
+
}, {});
|
|
1615
|
+
}
|
|
1616
|
+
const d = De(s());
|
|
1617
|
+
return sn(() => {
|
|
1618
|
+
const v = s();
|
|
1619
|
+
d.touched = v.touched, d.valid = v.valid, d.pending = v.pending;
|
|
1620
|
+
}), A(() => Object.assign(Object.assign({ initialValues: C(n) }, d), { valid: d.valid && !L(r.value).length, dirty: a.value }));
|
|
1621
|
+
}
|
|
1622
|
+
function lr(e, t, n) {
|
|
1623
|
+
const r = Zt(n), o = Q(r), a = Q(j(r));
|
|
1624
|
+
function s(d, v) {
|
|
1625
|
+
v?.force ? (o.value = j(d), a.value = j(d)) : (o.value = Pe(j(o.value) || {}, j(d)), a.value = Pe(j(a.value) || {}, j(d))), v?.updateFields && e.value.forEach((c) => {
|
|
1626
|
+
if (c.touched)
|
|
1627
|
+
return;
|
|
1628
|
+
const _ = q(o.value, m(c.path));
|
|
1629
|
+
ne(t, m(c.path), j(_));
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
return {
|
|
1633
|
+
initialValues: o,
|
|
1634
|
+
originalInitialValues: a,
|
|
1635
|
+
setInitialValues: s
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
function or(e, t) {
|
|
1639
|
+
return t ? {
|
|
1640
|
+
valid: e.valid && t.valid,
|
|
1641
|
+
errors: [...e.errors, ...t.errors]
|
|
1642
|
+
} : e;
|
|
1643
|
+
}
|
|
1644
|
+
function pr() {
|
|
1645
|
+
return wt(Nt);
|
|
1646
|
+
}
|
|
1647
|
+
const jt = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
|
|
1648
|
+
function Gt(e) {
|
|
1649
|
+
return Number(e) >= 0;
|
|
1650
|
+
}
|
|
1651
|
+
function ar(e) {
|
|
1652
|
+
return typeof e == "object" && e !== null;
|
|
1653
|
+
}
|
|
1654
|
+
function ur(e) {
|
|
1655
|
+
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
1656
|
+
}
|
|
1657
|
+
function Et(e) {
|
|
1658
|
+
if (!ar(e) || ur(e) !== "[object Object]")
|
|
1659
|
+
return !1;
|
|
1660
|
+
if (Object.getPrototypeOf(e) === null)
|
|
1661
|
+
return !0;
|
|
1662
|
+
let t = e;
|
|
1663
|
+
for (; Object.getPrototypeOf(t) !== null; )
|
|
1664
|
+
t = Object.getPrototypeOf(t);
|
|
1665
|
+
return Object.getPrototypeOf(e) === t;
|
|
1666
|
+
}
|
|
1667
|
+
function Ht(e, t) {
|
|
1668
|
+
return Object.keys(t).forEach((n) => {
|
|
1669
|
+
if (Et(t[n]) && Et(e[n])) {
|
|
1670
|
+
e[n] || (e[n] = {}), Ht(e[n], t[n]);
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
e[n] = t[n];
|
|
1674
|
+
}), e;
|
|
1675
|
+
}
|
|
1676
|
+
function sr(e) {
|
|
1677
|
+
const t = e.split(".");
|
|
1678
|
+
if (!t.length)
|
|
1679
|
+
return "";
|
|
1680
|
+
let n = String(t[0]);
|
|
1681
|
+
for (let r = 1; r < t.length; r++) {
|
|
1682
|
+
if (Gt(t[r])) {
|
|
1683
|
+
n += `[${t[r]}]`;
|
|
1684
|
+
continue;
|
|
1685
|
+
}
|
|
1686
|
+
n += `.${t[r]}`;
|
|
1687
|
+
}
|
|
1688
|
+
return n;
|
|
1689
|
+
}
|
|
1690
|
+
function yr(e, t) {
|
|
1691
|
+
return {
|
|
1692
|
+
__type: "VVTypedSchema",
|
|
1693
|
+
async parse(r) {
|
|
1694
|
+
const o = await e.safeParseAsync(r, t);
|
|
1695
|
+
if (o.success)
|
|
1696
|
+
return {
|
|
1697
|
+
value: o.data,
|
|
1698
|
+
errors: []
|
|
1699
|
+
};
|
|
1700
|
+
const a = {};
|
|
1701
|
+
return Yt(o.error.issues, a), {
|
|
1702
|
+
errors: Object.values(a)
|
|
1703
|
+
};
|
|
1704
|
+
},
|
|
1705
|
+
cast(r) {
|
|
1706
|
+
try {
|
|
1707
|
+
return e.parse(r);
|
|
1708
|
+
} catch {
|
|
1709
|
+
const a = Jt(e);
|
|
1710
|
+
return jt(a) && jt(r) ? Ht(a, r) : r;
|
|
1711
|
+
}
|
|
1712
|
+
},
|
|
1713
|
+
describe(r) {
|
|
1714
|
+
try {
|
|
1715
|
+
if (!r)
|
|
1716
|
+
return {
|
|
1717
|
+
required: !e.isOptional(),
|
|
1718
|
+
exists: !0
|
|
1719
|
+
};
|
|
1720
|
+
const o = cr(r, e);
|
|
1721
|
+
return o ? {
|
|
1722
|
+
required: !o.isOptional(),
|
|
1723
|
+
exists: !0
|
|
1724
|
+
} : {
|
|
1725
|
+
required: !1,
|
|
1726
|
+
exists: !1
|
|
1727
|
+
};
|
|
1728
|
+
} catch {
|
|
1729
|
+
return process.env.NODE_ENV !== "production" && console.warn(`Failed to describe path ${r} on the schema, returning a default description.`), {
|
|
1730
|
+
required: !1,
|
|
1731
|
+
exists: !1
|
|
1732
|
+
};
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
}
|
|
1737
|
+
function Yt(e, t) {
|
|
1738
|
+
e.forEach((n) => {
|
|
1739
|
+
const r = sr(n.path.join("."));
|
|
1740
|
+
n.code === "invalid_union" && (Yt(n.unionErrors.flatMap((o) => o.issues), t), !r) || (t[r] || (t[r] = { errors: [], path: r }), t[r].errors.push(n.message));
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
function Jt(e) {
|
|
1744
|
+
if (e instanceof ft)
|
|
1745
|
+
return Object.fromEntries(Object.entries(e.shape).map(([t, n]) => n instanceof vn ? [t, n._def.defaultValue()] : n instanceof ft ? [t, Jt(n)] : [t, void 0]));
|
|
1746
|
+
}
|
|
1747
|
+
function cr(e, t) {
|
|
1748
|
+
if (!At(t))
|
|
1749
|
+
return null;
|
|
1750
|
+
if (Fe(e))
|
|
1751
|
+
return t.shape[Be(e)];
|
|
1752
|
+
const n = (e || "").split(/\.|\[(\d+)\]/).filter(Boolean);
|
|
1753
|
+
let r = t;
|
|
1754
|
+
for (let o = 0; o <= n.length; o++) {
|
|
1755
|
+
const a = n[o];
|
|
1756
|
+
if (!a || !r)
|
|
1757
|
+
return r;
|
|
1758
|
+
if (At(r)) {
|
|
1759
|
+
r = r.shape[a] || null;
|
|
1760
|
+
continue;
|
|
1761
|
+
}
|
|
1762
|
+
Gt(a) && dr(r) && (r = r._def.type);
|
|
1763
|
+
}
|
|
1764
|
+
return null;
|
|
1765
|
+
}
|
|
1766
|
+
function Xt(e) {
|
|
1767
|
+
return e._def.typeName;
|
|
1768
|
+
}
|
|
1769
|
+
function dr(e) {
|
|
1770
|
+
return Xt(e) === Pt.ZodArray;
|
|
1771
|
+
}
|
|
1772
|
+
function At(e) {
|
|
1773
|
+
return Xt(e) === Pt.ZodObject;
|
|
1774
|
+
}
|
|
1775
|
+
export {
|
|
1776
|
+
hr as a,
|
|
1777
|
+
mr as b,
|
|
1778
|
+
yr as t,
|
|
1779
|
+
pr as u
|
|
1780
|
+
};
|