import { a$ as bn, b0 as Pe, b1 as wn, b2 as Tt, as as Ye, b3 as xn, ar as qe, b4 as $n, b5 as It, b6 as Fn, b7 as An, b8 as jt, b9 as On, ba as lt, bb as st, bc as Je, bd as Ze, be as _t, bf as Ce, bg as Cn, bh as Mt, at as Lt, bi as Sn, bj as Rt, bk as En, bl as Pn, bm as ut, bn as qn, bo as Tn, d as P, D as Ne, E as In, aL as jn, c as pe, y as _n, bp as Mn, aM as Ln, _ as W, g as Rn, m as Nn, bq as Nt, aK as Vn, r as Vt, aB as Dn, aC as Bn, az as Gn, aG as Dt, u as Bt, br as Wn, V as zn, a1 as Un, bs as Hn, bt as Kn, bu as Xn, P as de, bv as Qe, bw as Yn, bx as Gt, by as Jn, bz as Zn, bA as Qn, i as kn, av as ue, ax as me, ay as ft, aw as ct, f as er, e as $e, bB as _e, U as tr, bC as Ve } from "./index2.js"; import { cloneVNode as nr, inject as Wt, computed as F, provide as zt, createVNode as j, Fragment as Se, defineComponent as Te, ref as ke, watch as se, Transition as rr, withDirectives as ir, TransitionGroup as ar, vShow as or, shallowRef as ee, watchEffect as De, onBeforeUnmount as lr, reactive as Ut, onMounted as sr, toRaw as Be, nextTick as Ht, unref as ae } from "vue"; import { a as Kt, s as ur, o as fr, i as Xt, b as et, c as Yt, t as Ee, h as cr, d as Jt, e as Zt, f as dr } from "./hasIn.js"; import { C as Qt, A as mr } from "./Col.js"; import { s as gr } from "./index3.js"; var dt = 1 / 0, vr = 17976931348623157e292; function hr(e) { if (!e) return e === 0 ? e : 0; if (e = bn(e), e === dt || e === -dt) { var t = e < 0 ? -1 : 1; return t * vr; } return e === e ? e : 0; } function pr(e) { var t = hr(e), n = t % 1; return t === t ? n ? t - n : t : 0; } var mt = Object.create, yr = /* @__PURE__ */ function() { function e() { } return function(t) { if (!Pe(t)) return {}; if (mt) return mt(t); e.prototype = t; var n = new e(); return e.prototype = void 0, n; }; }(); function br(e, t) { var n = -1, r = e.length; for (t || (t = Array(r)); ++n < r; ) t[n] = e[n]; return t; } function wr(e, t) { for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1; ) ; return e; } function be(e, t, n, r) { var i = !n; n || (n = {}); for (var o = -1, a = t.length; ++o < a; ) { var l = t[o], s = void 0; s === void 0 && (s = e[l]), i ? wn(n, l, s) : Kt(n, l, s); } return n; } function xr(e, t) { return ur(fr(e, t, Xt), e + ""); } function $r(e) { var t = []; if (e != null) for (var n in Object(e)) t.push(n); return t; } var Fr = Object.prototype, Ar = Fr.hasOwnProperty; function Or(e) { if (!Pe(e)) return $r(e); var t = Tt(e), n = []; for (var r in e) r == "constructor" && (t || !Ar.call(e, r)) || n.push(r); return n; } function tt(e) { return Ye(e) ? xn(e, !0) : Or(e); } function Cr(e, t, n) { var r = e == null ? void 0 : et(e, t); return r === void 0 ? n : r; } function Sr(e, t, n) { var r = -1, i = e.length; t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0; for (var o = Array(i); ++r < i; ) o[r] = e[r + t]; return o; } function Er(e, t) { return e && be(t, qe(t), e); } function Pr(e, t) { return e && be(t, tt(t), e); } var kt = typeof exports == "object" && exports && !exports.nodeType && exports, gt = kt && typeof module == "object" && module && !module.nodeType && module, qr = gt && gt.exports === kt, vt = qr ? $n.Buffer : void 0, ht = vt ? vt.allocUnsafe : void 0; function Tr(e, t) { if (t) return e.slice(); var n = e.length, r = ht ? ht(n) : new e.constructor(n); return e.copy(r), r; } function Ir(e, t) { return be(e, It(e), t); } var jr = Object.getOwnPropertySymbols, en = jr ? function(e) { for (var t = []; e; ) An(t, It(e)), e = jt(e); return t; } : Fn; function _r(e, t) { return be(e, en(e), t); } function tn(e) { return On(e, tt, en); } var Mr = Object.prototype, Lr = Mr.hasOwnProperty; function Rr(e) { var t = e.length, n = new e.constructor(t); return t && typeof e[0] == "string" && Lr.call(e, "index") && (n.index = e.index, n.input = e.input), n; } function nt(e) { var t = new e.constructor(e.byteLength); return new lt(t).set(new lt(e)), t; } function Nr(e, t) { var n = t ? nt(e.buffer) : e.buffer; return new e.constructor(n, e.byteOffset, e.byteLength); } var Vr = /\w*$/; function Dr(e) { var t = new e.constructor(e.source, Vr.exec(e)); return t.lastIndex = e.lastIndex, t; } var pt = st ? st.prototype : void 0, yt = pt ? pt.valueOf : void 0; function Br(e) { return yt ? Object(yt.call(e)) : {}; } function Gr(e, t) { var n = t ? nt(e.buffer) : e.buffer; return new e.constructor(n, e.byteOffset, e.length); } var Wr = "[object Boolean]", zr = "[object Date]", Ur = "[object Map]", Hr = "[object Number]", Kr = "[object RegExp]", Xr = "[object Set]", Yr = "[object String]", Jr = "[object Symbol]", Zr = "[object ArrayBuffer]", Qr = "[object DataView]", kr = "[object Float32Array]", ei = "[object Float64Array]", ti = "[object Int8Array]", ni = "[object Int16Array]", ri = "[object Int32Array]", ii = "[object Uint8Array]", ai = "[object Uint8ClampedArray]", oi = "[object Uint16Array]", li = "[object Uint32Array]"; function si(e, t, n) { var r = e.constructor; switch (t) { case Zr: return nt(e); case Wr: case zr: return new r(+e); case Qr: return Nr(e, n); case kr: case ei: case ti: case ni: case ri: case ii: case ai: case oi: case li: return Gr(e, n); case Ur: return new r(); case Hr: case Yr: return new r(e); case Kr: return Dr(e); case Xr: return new r(); case Jr: return Br(e); } } function ui(e) { return typeof e.constructor == "function" && !Tt(e) ? yr(jt(e)) : {}; } var fi = "[object Map]"; function ci(e) { return Je(e) && Ze(e) == fi; } var bt = Ce && Ce.isMap, di = bt ? _t(bt) : ci, mi = "[object Set]"; function gi(e) { return Je(e) && Ze(e) == mi; } var wt = Ce && Ce.isSet, vi = wt ? _t(wt) : gi, hi = 1, pi = 2, yi = 4, nn = "[object Arguments]", bi = "[object Array]", wi = "[object Boolean]", xi = "[object Date]", $i = "[object Error]", rn = "[object Function]", Fi = "[object GeneratorFunction]", Ai = "[object Map]", Oi = "[object Number]", an = "[object Object]", Ci = "[object RegExp]", Si = "[object Set]", Ei = "[object String]", Pi = "[object Symbol]", qi = "[object WeakMap]", Ti = "[object ArrayBuffer]", Ii = "[object DataView]", ji = "[object Float32Array]", _i = "[object Float64Array]", Mi = "[object Int8Array]", Li = "[object Int16Array]", Ri = "[object Int32Array]", Ni = "[object Uint8Array]", Vi = "[object Uint8ClampedArray]", Di = "[object Uint16Array]", Bi = "[object Uint32Array]", _ = {}; _[nn] = _[bi] = _[Ti] = _[Ii] = _[wi] = _[xi] = _[ji] = _[_i] = _[Mi] = _[Li] = _[Ri] = _[Ai] = _[Oi] = _[an] = _[Ci] = _[Si] = _[Ei] = _[Pi] = _[Ni] = _[Vi] = _[Di] = _[Bi] = !0; _[$i] = _[rn] = _[qi] = !1; function ve(e, t, n, r, i, o) { var a, l = t & hi, s = t & pi, v = t & yi; if (n && (a = i ? n(e, r, i, o) : n(e)), a !== void 0) return a; if (!Pe(e)) return e; var f = Lt(e); if (f) { if (a = Rr(e), !l) return br(e, a); } else { var g = Ze(e), h = g == rn || g == Fi; if (Cn(e)) return Tr(e, l); if (g == an || g == nn || h && !i) { if (a = s || h ? {} : ui(e), !l) return s ? _r(e, Pr(a, e)) : Ir(e, Er(a, e)); } else { if (!_[g]) return i ? e : {}; a = si(e, g, l); } } o || (o = new Mt()); var w = o.get(e); if (w) return w; o.set(e, a), vi(e) ? e.forEach(function(y) { a.add(ve(y, t, n, y, e, o)); }) : di(e) && e.forEach(function(y, m) { a.set(m, ve(y, t, n, m, e, o)); }); var $ = v ? s ? tn : Sn : s ? tt : qe, d = f ? void 0 : $(e); return wr(d || e, function(y, m) { d && (m = y, y = e[m]), Kt(a, m, ve(y, t, n, m, e, o)); }), a; } var Gi = 1, Wi = 4; function Ae(e) { return ve(e, Gi | Wi); } var zi = 1, Ui = 2; function Hi(e, t, n, r) { var i = n.length, o = i; if (e == null) return !o; for (e = Object(e); i--; ) { var a = n[i]; if (a[2] ? a[1] !== e[a[0]] : !(a[0] in e)) return !1; } for (; ++i < o; ) { a = n[i]; var l = a[0], s = e[l], v = a[1]; if (a[2]) { if (s === void 0 && !(l in e)) return !1; } else { var f = new Mt(), g; if (!(g === void 0 ? Rt(v, s, zi | Ui, r, f) : g)) return !1; } } return !0; } function on(e) { return e === e && !Pe(e); } function Ki(e) { for (var t = qe(e), n = t.length; n--; ) { var r = t[n], i = e[r]; t[n] = [r, i, on(i)]; } return t; } function ln(e, t) { return function(n) { return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n)); }; } function Xi(e) { var t = Ki(e); return t.length == 1 && t[0][2] ? ln(t[0][0], t[0][1]) : function(n) { return n === e || Hi(n, e, t); }; } var Yi = 1, Ji = 2; function Zi(e, t) { return Yt(e) && on(t) ? ln(Ee(e), t) : function(n) { var r = Cr(n, e); return r === void 0 && r === t ? cr(n, e) : Rt(t, r, Yi | Ji); }; } function Qi(e) { return function(t) { return t == null ? void 0 : t[e]; }; } function ki(e) { return function(t) { return et(t, e); }; } function ea(e) { return Yt(e) ? Qi(Ee(e)) : ki(e); } function sn(e) { return typeof e == "function" ? e : e == null ? Xt : typeof e == "object" ? Lt(e) ? Zi(e[0], e[1]) : Xi(e) : ea(e); } function ta(e) { return Je(e) && Ye(e); } function na(e) { var t = e == null ? 0 : e.length; return t ? e[t - 1] : void 0; } function ra(e) { return function(t, n, r) { var i = Object(t); if (!Ye(t)) { var o = sn(n); t = qe(t), n = function(l) { return o(i[l], l, i); }; } var a = e(t, n, r); return a > -1 ? i[o ? t[a] : a] : void 0; }; } var ia = Math.max; function aa(e, t, n) { var r = e == null ? 0 : e.length; if (!r) return -1; var i = n == null ? 0 : pr(n); return i < 0 && (i = ia(r + i, 0)), En(e, sn(t), i); } var oa = ra(aa), la = Math.min; function sa(e, t, n) { for (var r = qn, i = e[0].length, o = e.length, a = o, l = Array(o), s = 1 / 0, v = []; a--; ) { var f = e[a]; s = la(f.length, s), l[a] = i >= 120 && f.length >= 120 ? new Pn(a && f) : void 0; } f = e[0]; var g = -1, h = l[0]; e: for (; ++g < i && v.length < s; ) { var w = f[g], $ = w; if (w = w !== 0 ? w : 0, !(h ? ut(h, $) : r(v, $))) { for (a = o; --a; ) { var d = l[a]; if (!(d ? ut(d, $) : r(e[a], $))) continue e; } h && h.push($), v.push(w); } } return v; } function ua(e) { return ta(e) ? e : []; } var fa = xr(function(e) { var t = Jt(e, ua); return t.length && t[0] === e[0] ? sa(t) : []; }); function ca(e, t) { return t.length < 2 ? e : et(e, Sr(t, 0, -1)); } var da = Object.prototype, ma = da.hasOwnProperty; function ga(e, t) { t = Zt(t, e); var n = -1, r = t.length; if (!r) return !0; for (; ++n < r; ) { var i = Ee(t[n]); if (i === "__proto__" && !ma.call(e, "__proto__") || (i === "constructor" || i === "prototype") && n < r - 1) return !1; } var o = ca(e, t); return o == null || delete o[Ee(na(t))]; } function va(e) { return Tn(e) ? void 0 : e; } var ha = 1, pa = 2, ya = 4, ba = dr(function(e, t) { var n = {}; if (e == null) return n; var r = !1; t = Jt(t, function(o) { return o = Zt(o, e), r || (r = o.length > 1), o; }), be(e, tn(e), n), r && (n = ve(n, ha | pa | ya, va)); for (var i = t.length; i--; ) ga(n, t[i]); return n; }); function le() { return le = Object.assign ? Object.assign.bind() : function(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]); } return e; }, le.apply(this, arguments); } function wa(e, t) { e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ye(e, t); } function Ge(e) { return Ge = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) { return n.__proto__ || Object.getPrototypeOf(n); }, Ge(e); } function ye(e, t) { return ye = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) { return r.__proto__ = i, r; }, ye(e, t); } function xa() { if (typeof Reflect == "undefined" || !Reflect.construct || Reflect.construct.sham) return !1; if (typeof Proxy == "function") return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), !0; } catch (e) { return !1; } } function Oe(e, t, n) { return xa() ? Oe = Reflect.construct.bind() : Oe = function(i, o, a) { var l = [null]; l.push.apply(l, o); var s = Function.bind.apply(i, l), v = new s(); return a && ye(v, a.prototype), v; }, Oe.apply(null, arguments); } function $a(e) { return Function.toString.call(e).indexOf("[native code]") !== -1; } function We(e) { var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0; return We = function(r) { if (r === null || !$a(r)) return r; if (typeof r != "function") throw new TypeError("Super expression must either be null or a function"); if (typeof t != "undefined") { if (t.has(r)) return t.get(r); t.set(r, i); } function i() { return Oe(r, arguments, Ge(this).constructor); } return i.prototype = Object.create(r.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), ye(i, r); }, We(e); } var Fa = /%[sdj%]/g, un = function() { }; typeof process != "undefined" && process.env && process.env.NODE_ENV !== "production" && typeof window != "undefined" && typeof document != "undefined" && (un = function(t, n) { typeof console != "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING == "undefined" && n.every(function(r) { return typeof r == "string"; }) && console.warn(t, n); }); function ze(e) { if (!e || !e.length) return null; var t = {}; return e.forEach(function(n) { var r = n.field; t[r] = t[r] || [], t[r].push(n); }), t; } function J(e) { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r]; var i = 0, o = n.length; if (typeof e == "function") return e.apply(null, n); if (typeof e == "string") { var a = e.replace(Fa, function(l) { if (l === "%%") return "%"; if (i >= o) return l; switch (l) { case "%s": return String(n[i++]); case "%d": return Number(n[i++]); case "%j": try { return JSON.stringify(n[i++]); } catch (s) { return "[Circular]"; } break; default: return l; } }); return a; } return e; } function Aa(e) { return e === "string" || e === "url" || e === "hex" || e === "email" || e === "date" || e === "pattern"; } function B(e, t) { return !!(e == null || t === "array" && Array.isArray(e) && !e.length || Aa(t) && typeof e == "string" && !e); } function Oa(e, t, n) { var r = [], i = 0, o = e.length; function a(l) { r.push.apply(r, l || []), i++, i === o && n(r); } e.forEach(function(l) { t(l, a); }); } function xt(e, t, n) { var r = 0, i = e.length; function o(a) { if (a && a.length) { n(a); return; } var l = r; r = r + 1, l < i ? t(e[l], o) : n([]); } o([]); } function Ca(e) { var t = []; return Object.keys(e).forEach(function(n) { t.push.apply(t, e[n] || []); }), t; } var $t = /* @__PURE__ */ function(e) { wa(t, e); function t(n, r) { var i; return i = e.call(this, "Async Validation Error") || this, i.errors = n, i.fields = r, i; } return t; }(/* @__PURE__ */ We(Error)); function Sa(e, t, n, r, i) { if (t.first) { var o = new Promise(function(h, w) { var $ = function(m) { return r(m), m.length ? w(new $t(m, ze(m))) : h(i); }, d = Ca(e); xt(d, n, $); }); return o.catch(function(h) { return h; }), o; } var a = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], l = Object.keys(e), s = l.length, v = 0, f = [], g = new Promise(function(h, w) { var $ = function(y) { if (f.push.apply(f, y), v++, v === s) return r(f), f.length ? w(new $t(f, ze(f))) : h(i); }; l.length || (r(f), h(i)), l.forEach(function(d) { var y = e[d]; a.indexOf(d) !== -1 ? xt(y, n, $) : Oa(y, n, $); }); }); return g.catch(function(h) { return h; }), g; } function Ea(e) { return !!(e && e.message !== void 0); } function Pa(e, t) { for (var n = e, r = 0; r < t.length; r++) { if (n == null) return n; n = n[t[r]]; } return n; } function Ft(e, t) { return function(n) { var r; return e.fullFields ? r = Pa(t, e.fullFields) : r = t[n.field || e.fullField], Ea(n) ? (n.field = n.field || e.fullField, n.fieldValue = r, n) : { message: typeof n == "function" ? n() : n, fieldValue: r, field: n.field || e.fullField }; }; } function At(e, t) { if (t) { for (var n in t) if (t.hasOwnProperty(n)) { var r = t[n]; typeof r == "object" && typeof e[n] == "object" ? e[n] = le({}, e[n], r) : e[n] = r; } } return e; } var fn = function(t, n, r, i, o, a) { t.required && (!r.hasOwnProperty(t.field) || B(n, a || t.type)) && i.push(J(o.messages.required, t.fullField)); }, qa = function(t, n, r, i, o) { (/^\s+$/.test(n) || n === "") && i.push(J(o.messages.whitespace, t.fullField)); }, Fe, Ta = function() { if (Fe) return Fe; var e = "[a-fA-F\\d:]", t = function(c) { return c && c.includeBoundaries ? "(?:(?<=\\s|^)(?=" + e + ")|(?<=" + e + ")(?=\\s|$))" : ""; }, n = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", r = "[a-fA-F\\d]{1,4}", i = (` (?: (?:` + r + ":){7}(?:" + r + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 (?:` + r + ":){6}(?:" + n + "|:" + r + `|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 (?:` + r + ":){5}(?::" + n + "|(?::" + r + `){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 (?:` + r + ":){4}(?:(?::" + r + "){0,1}:" + n + "|(?::" + r + `){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 (?:` + r + ":){3}(?:(?::" + r + "){0,2}:" + n + "|(?::" + r + `){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 (?:` + r + ":){2}(?:(?::" + r + "){0,3}:" + n + "|(?::" + r + `){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 (?:` + r + ":){1}(?:(?::" + r + "){0,4}:" + n + "|(?::" + r + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 (?::(?:(?::` + r + "){0,5}:" + n + "|(?::" + r + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), o = new RegExp("(?:^" + n + "$)|(?:^" + i + "$)"), a = new RegExp("^" + n + "$"), l = new RegExp("^" + i + "$"), s = function(c) { return c && c.exact ? o : new RegExp("(?:" + t(c) + n + t(c) + ")|(?:" + t(c) + i + t(c) + ")", "g"); }; s.v4 = function(u) { return u && u.exact ? a : new RegExp("" + t(u) + n + t(u), "g"); }, s.v6 = function(u) { return u && u.exact ? l : new RegExp("" + t(u) + i + t(u), "g"); }; var v = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", g = s.v4().source, h = s.v6().source, w = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", $ = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", d = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", y = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', q = "(?:" + v + "|www\\.)" + f + "(?:localhost|" + g + "|" + h + "|" + w + $ + d + ")" + y + m; return Fe = new RegExp("(?:^" + q + "$)", "i"), Fe; }, Ot = { // http://emailregex.com/ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/, // url: new RegExp( // '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', // 'i', // ), hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i }, ge = { integer: function(t) { return ge.number(t) && parseInt(t, 10) === t; }, float: function(t) { return ge.number(t) && !ge.integer(t); }, array: function(t) { return Array.isArray(t); }, regexp: function(t) { if (t instanceof RegExp) return !0; try { return !!new RegExp(t); } catch (n) { return !1; } }, date: function(t) { return typeof t.getTime == "function" && typeof t.getMonth == "function" && typeof t.getYear == "function" && !isNaN(t.getTime()); }, number: function(t) { return isNaN(t) ? !1 : typeof t == "number"; }, object: function(t) { return typeof t == "object" && !ge.array(t); }, method: function(t) { return typeof t == "function"; }, email: function(t) { return typeof t == "string" && t.length <= 320 && !!t.match(Ot.email); }, url: function(t) { return typeof t == "string" && t.length <= 2048 && !!t.match(Ta()); }, hex: function(t) { return typeof t == "string" && !!t.match(Ot.hex); } }, Ia = function(t, n, r, i, o) { if (t.required && n === void 0) { fn(t, n, r, i, o); return; } var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], l = t.type; a.indexOf(l) > -1 ? ge[l](n) || i.push(J(o.messages.types[l], t.fullField, t.type)) : l && typeof n !== t.type && i.push(J(o.messages.types[l], t.fullField, t.type)); }, ja = function(t, n, r, i, o) { var a = typeof t.len == "number", l = typeof t.min == "number", s = typeof t.max == "number", v = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = n, g = null, h = typeof n == "number", w = typeof n == "string", $ = Array.isArray(n); if (h ? g = "number" : w ? g = "string" : $ && (g = "array"), !g) return !1; $ && (f = n.length), w && (f = n.replace(v, "_").length), a ? f !== t.len && i.push(J(o.messages[g].len, t.fullField, t.len)) : l && !s && f < t.min ? i.push(J(o.messages[g].min, t.fullField, t.min)) : s && !l && f > t.max ? i.push(J(o.messages[g].max, t.fullField, t.max)) : l && s && (f < t.min || f > t.max) && i.push(J(o.messages[g].range, t.fullField, t.min, t.max)); }, fe = "enum", _a = function(t, n, r, i, o) { t[fe] = Array.isArray(t[fe]) ? t[fe] : [], t[fe].indexOf(n) === -1 && i.push(J(o.messages[fe], t.fullField, t[fe].join(", "))); }, Ma = function(t, n, r, i, o) { if (t.pattern) { if (t.pattern instanceof RegExp) t.pattern.lastIndex = 0, t.pattern.test(n) || i.push(J(o.messages.pattern.mismatch, t.fullField, n, t.pattern)); else if (typeof t.pattern == "string") { var a = new RegExp(t.pattern); a.test(n) || i.push(J(o.messages.pattern.mismatch, t.fullField, n, t.pattern)); } } }, E = { required: fn, whitespace: qa, type: Ia, range: ja, enum: _a, pattern: Ma }, La = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n, "string") && !t.required) return r(); E.required(t, n, i, a, o, "string"), B(n, "string") || (E.type(t, n, i, a, o), E.range(t, n, i, a, o), E.pattern(t, n, i, a, o), t.whitespace === !0 && E.whitespace(t, n, i, a, o)); } r(a); }, Ra = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o), n !== void 0 && E.type(t, n, i, a, o); } r(a); }, Na = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (n === "" && (n = void 0), B(n) && !t.required) return r(); E.required(t, n, i, a, o), n !== void 0 && (E.type(t, n, i, a, o), E.range(t, n, i, a, o)); } r(a); }, Va = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o), n !== void 0 && E.type(t, n, i, a, o); } r(a); }, Da = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o), B(n) || E.type(t, n, i, a, o); } r(a); }, Ba = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o), n !== void 0 && (E.type(t, n, i, a, o), E.range(t, n, i, a, o)); } r(a); }, Ga = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o), n !== void 0 && (E.type(t, n, i, a, o), E.range(t, n, i, a, o)); } r(a); }, Wa = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (n == null && !t.required) return r(); E.required(t, n, i, a, o, "array"), n != null && (E.type(t, n, i, a, o), E.range(t, n, i, a, o)); } r(a); }, za = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o), n !== void 0 && E.type(t, n, i, a, o); } r(a); }, Ua = "enum", Ha = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o), n !== void 0 && E[Ua](t, n, i, a, o); } r(a); }, Ka = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n, "string") && !t.required) return r(); E.required(t, n, i, a, o), B(n, "string") || E.pattern(t, n, i, a, o); } r(a); }, Xa = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n, "date") && !t.required) return r(); if (E.required(t, n, i, a, o), !B(n, "date")) { var s; n instanceof Date ? s = n : s = new Date(n), E.type(t, s, i, a, o), s && E.range(t, s.getTime(), i, a, o); } } r(a); }, Ya = function(t, n, r, i, o) { var a = [], l = Array.isArray(n) ? "array" : typeof n; E.required(t, n, i, a, o, l), r(a); }, Me = function(t, n, r, i, o) { var a = t.type, l = [], s = t.required || !t.required && i.hasOwnProperty(t.field); if (s) { if (B(n, a) && !t.required) return r(); E.required(t, n, i, l, o, a), B(n, a) || E.type(t, n, i, l, o); } r(l); }, Ja = function(t, n, r, i, o) { var a = [], l = t.required || !t.required && i.hasOwnProperty(t.field); if (l) { if (B(n) && !t.required) return r(); E.required(t, n, i, a, o); } r(a); }, he = { string: La, method: Ra, number: Na, boolean: Va, regexp: Da, integer: Ba, float: Ga, array: Wa, object: za, enum: Ha, pattern: Ka, date: Xa, url: Me, hex: Me, email: Me, required: Ya, any: Ja }; function Ue() { return { default: "Validation error on field %s", required: "%s is required", enum: "%s must be one of %s", whitespace: "%s cannot be empty", date: { format: "%s date %s is invalid for format %s", parse: "%s date could not be parsed, %s is invalid ", invalid: "%s date %s is invalid" }, types: { string: "%s is not a %s", method: "%s is not a %s (function)", array: "%s is not an %s", object: "%s is not an %s", number: "%s is not a %s", date: "%s is not a %s", boolean: "%s is not a %s", integer: "%s is not an %s", float: "%s is not a %s", regexp: "%s is not a valid %s", email: "%s is not a valid %s", url: "%s is not a valid %s", hex: "%s is not a valid %s" }, string: { len: "%s must be exactly %s characters", min: "%s must be at least %s characters", max: "%s cannot be longer than %s characters", range: "%s must be between %s and %s characters" }, number: { len: "%s must equal %s", min: "%s cannot be less than %s", max: "%s cannot be greater than %s", range: "%s must be between %s and %s" }, array: { len: "%s must be exactly %s in length", min: "%s cannot be less than %s in length", max: "%s cannot be greater than %s in length", range: "%s must be between %s and %s in length" }, pattern: { mismatch: "%s value %s does not match pattern %s" }, clone: function() { var t = JSON.parse(JSON.stringify(this)); return t.clone = this.clone, t; } }; } var He = Ue(), we = /* @__PURE__ */ function() { function e(n) { this.rules = null, this._messages = He, this.define(n); } var t = e.prototype; return t.define = function(r) { var i = this; if (!r) throw new Error("Cannot configure a schema with no rules"); if (typeof r != "object" || Array.isArray(r)) throw new Error("Rules must be an object"); this.rules = {}, Object.keys(r).forEach(function(o) { var a = r[o]; i.rules[o] = Array.isArray(a) ? a : [a]; }); }, t.messages = function(r) { return r && (this._messages = At(Ue(), r)), this._messages; }, t.validate = function(r, i, o) { var a = this; i === void 0 && (i = {}), o === void 0 && (o = function() { }); var l = r, s = i, v = o; if (typeof s == "function" && (v = s, s = {}), !this.rules || Object.keys(this.rules).length === 0) return v && v(null, l), Promise.resolve(l); function f(d) { var y = [], m = {}; function q(c) { if (Array.isArray(c)) { var b; y = (b = y).concat.apply(b, c); } else y.push(c); } for (var u = 0; u < d.length; u++) q(d[u]); y.length ? (m = ze(y), v(y, m)) : v(null, l); } if (s.messages) { var g = this.messages(); g === He && (g = Ue()), At(g, s.messages), s.messages = g; } else s.messages = this.messages(); var h = {}, w = s.keys || Object.keys(this.rules); w.forEach(function(d) { var y = a.rules[d], m = l[d]; y.forEach(function(q) { var u = q; typeof u.transform == "function" && (l === r && (l = le({}, l)), m = l[d] = u.transform(m)), typeof u == "function" ? u = { validator: u } : u = le({}, u), u.validator = a.getValidationMethod(u), u.validator && (u.field = d, u.fullField = u.fullField || d, u.type = a.getType(u), h[d] = h[d] || [], h[d].push({ rule: u, value: m, source: l, field: d })); }); }); var $ = {}; return Sa(h, s, function(d, y) { var m = d.rule, q = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object"); q = q && (m.required || !m.required && d.value), m.field = d.field; function u(S, A) { return le({}, A, { fullField: m.fullField + "." + S, fullFields: m.fullFields ? [].concat(m.fullFields, [S]) : [S] }); } function c(S) { S === void 0 && (S = []); var A = Array.isArray(S) ? S : [S]; !s.suppressWarning && A.length && e.warning("async-validator:", A), A.length && m.message !== void 0 && (A = [].concat(m.message)); var O = A.map(Ft(m, l)); if (s.first && O.length) return $[m.field] = 1, y(O); if (!q) y(O); else { if (m.required && !d.value) return m.message !== void 0 ? O = [].concat(m.message).map(Ft(m, l)) : s.error && (O = [s.error(m, J(s.messages.required, m.field))]), y(O); var V = {}; m.defaultField && Object.keys(d.value).map(function(T) { V[T] = m.defaultField; }), V = le({}, V, d.rule.fields); var M = {}; Object.keys(V).forEach(function(T) { var N = V[T], Z = Array.isArray(N) ? N : [N]; M[T] = Z.map(u.bind(null, T)); }); var L = new e(M); L.messages(s.messages), d.rule.options && (d.rule.options.messages = s.messages, d.rule.options.error = s.error), L.validate(d.value, d.rule.options || s, function(T) { var N = []; O && O.length && N.push.apply(N, O), T && T.length && N.push.apply(N, T), y(N.length ? N : null); }); } } var b; if (m.asyncValidator) b = m.asyncValidator(m, d.value, c, d.source, s); else if (m.validator) { try { b = m.validator(m, d.value, c, d.source, s); } catch (S) { console.error == null || console.error(S), s.suppressValidatorError || setTimeout(function() { throw S; }, 0), c(S.message); } b === !0 ? c() : b === !1 ? c(typeof m.message == "function" ? m.message(m.fullField || m.field) : m.message || (m.fullField || m.field) + " fails") : b instanceof Array ? c(b) : b instanceof Error && c(b.message); } b && b.then && b.then(function() { return c(); }, function(S) { return c(S); }); }, function(d) { f(d); }, l); }, t.getType = function(r) { if (r.type === void 0 && r.pattern instanceof RegExp && (r.type = "pattern"), typeof r.validator != "function" && r.type && !he.hasOwnProperty(r.type)) throw new Error(J("Unknown rule type %s", r.type)); return r.type || "string"; }, t.getValidationMethod = function(r) { if (typeof r.validator == "function") return r.validator; var i = Object.keys(r), o = i.indexOf("message"); return o !== -1 && i.splice(o, 1), i.length === 1 && i[0] === "required" ? he.required : he[this.getType(r)] || void 0; }, e; }(); we.register = function(t, n) { if (typeof n != "function") throw new Error("Cannot register a validator by type, validator is not a function"); he[t] = n; }; we.warning = un; we.messages = He; we.validators = he; function ne(e) { return e == null ? [] : Array.isArray(e) ? e : [e]; } function cn(e, t) { let n = e; for (let r = 0; r < t.length; r += 1) { if (n == null) return; n = n[t[r]]; } return n; } function dn(e, t, n, r) { if (!t.length) return n; const [i, ...o] = t; let a; return !e && typeof i == "number" ? a = [] : Array.isArray(e) ? a = [...e] : a = P({}, e), r && n === void 0 && o.length === 1 ? delete a[i][o[0]] : a[i] = dn(a[i], o, n, r), a; } function Za(e, t, n) { let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; return t.length && r && n === void 0 && !cn(e, t.slice(0, -1)) ? e : dn(e, t, n, r); } function Ke(e) { return ne(e); } function Qa(e, t) { return cn(e, t); } function ka(e, t, n) { let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; return Za(e, t, n, r); } function eo(e, t) { return e && e.some((n) => no(n, t)); } function Ct(e) { return typeof e == "object" && e !== null && Object.getPrototypeOf(e) === Object.prototype; } function mn(e, t) { const n = Array.isArray(e) ? [...e] : P({}, e); return t && Object.keys(t).forEach((r) => { const i = n[r], o = t[r], a = Ct(i) && Ct(o); n[r] = a ? mn(i, o || {}) : o; }), n; } function to(e) { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r]; return n.reduce((i, o) => mn(i, o), e); } function St(e, t) { let n = {}; return t.forEach((r) => { const i = Qa(e, r); n = ka(n, r, i); }), n; } function no(e, t) { return !e || !t || e.length !== t.length ? !1 : e.every((n, r) => t[r] === n); } const Y = "'${name}' is not a valid ${type}", Ie = { default: "Validation error on field '${name}'", required: "'${name}' is required", enum: "'${name}' must be one of [${enum}]", whitespace: "'${name}' cannot be empty", date: { format: "'${name}' is invalid for format date", parse: "'${name}' could not be parsed as date", invalid: "'${name}' is invalid date" }, types: { string: Y, method: Y, array: Y, object: Y, number: Y, date: Y, boolean: Y, integer: Y, float: Y, regexp: Y, email: Y, url: Y, hex: Y }, string: { len: "'${name}' must be exactly ${len} characters", min: "'${name}' must be at least ${min} characters", max: "'${name}' cannot be longer than ${max} characters", range: "'${name}' must be between ${min} and ${max} characters" }, number: { len: "'${name}' must equal ${len}", min: "'${name}' cannot be less than ${min}", max: "'${name}' cannot be greater than ${max}", range: "'${name}' must be between ${min} and ${max}" }, array: { len: "'${name}' must be exactly ${len} in length", min: "'${name}' cannot be less than ${min} in length", max: "'${name}' cannot be greater than ${max} in length", range: "'${name}' must be between ${min} and ${max} in length" }, pattern: { mismatch: "'${name}' does not match pattern ${pattern}" } }; var je = function(e, t, n, r) { function i(o) { return o instanceof n ? o : new n(function(a) { a(o); }); } return new (n || (n = Promise))(function(o, a) { function l(f) { try { v(r.next(f)); } catch (g) { a(g); } } function s(f) { try { v(r.throw(f)); } catch (g) { a(g); } } function v(f) { f.done ? o(f.value) : i(f.value).then(l, s); } v((r = r.apply(e, t || [])).next()); }); }; const ro = we; function io(e, t) { return e.replace(/\$\{\w+\}/g, (n) => { const r = n.slice(2, -1); return t[r]; }); } function Xe(e, t, n, r, i) { return je(this, void 0, void 0, function* () { const o = P({}, n); delete o.ruleIndex, delete o.trigger; let a = null; o && o.type === "array" && o.defaultField && (a = o.defaultField, delete o.defaultField); const l = new ro({ [e]: [o] }), s = to({}, Ie, r.validateMessages); l.messages(s); let v = []; try { yield Promise.resolve(l.validate({ [e]: t }, P({}, r))); } catch (h) { h.errors ? v = h.errors.map((w, $) => { let { message: d } = w; return ( // Wrap VueNode with `key` In(d) ? nr(d, { key: `error_${$}` }) : d ); }) : (console.error(h), v = [s.default()]); } if (!v.length && a) return (yield Promise.all(t.map((w, $) => Xe(`${e}.${$}`, w, a, r, i)))).reduce((w, $) => [...w, ...$], []); const f = P(P(P({}, n), { name: e, enum: (n.enum || []).join(", ") }), i); return v.map((h) => typeof h == "string" ? io(h, f) : h); }); } function gn(e, t, n, r, i, o) { const a = e.join("."), l = n.map((v, f) => { const g = v.validator, h = P(P({}, v), { ruleIndex: f }); return g && (h.validator = (w, $, d) => { let y = !1; const q = g(w, $, function() { for (var u = arguments.length, c = new Array(u), b = 0; b < u; b++) c[b] = arguments[b]; Promise.resolve().then(() => { Ne(!y, "Your validator function has already return a promise. `callback` will be ignored."), y || d(...c); }); }); y = q && typeof q.then == "function" && typeof q.catch == "function", Ne(y, "`callback` is deprecated. Please return a promise instead."), y && q.then(() => { d(); }).catch((u) => { d(u || " "); }); }), h; }).sort((v, f) => { let { warningOnly: g, ruleIndex: h } = v, { warningOnly: w, ruleIndex: $ } = f; return !!g == !!w ? h - $ : g ? 1 : -1; }); let s; if (i === !0) s = new Promise((v, f) => je(this, void 0, void 0, function* () { for (let g = 0; g < l.length; g += 1) { const h = l[g], w = yield Xe(a, t, h, r, o); if (w.length) { f([{ errors: w, rule: h }]); return; } } v([]); })); else { const v = l.map((f) => Xe(a, t, f, r, o).then((g) => ({ errors: g, rule: f }))); s = (i ? oo(v) : ao(v)).then((f) => Promise.reject(f)); } return s.catch((v) => v), s; } function ao(e) { return je(this, void 0, void 0, function* () { return Promise.all(e).then((t) => [].concat(...t)); }); } function oo(e) { return je(this, void 0, void 0, function* () { let t = 0; return new Promise((n) => { e.forEach((r) => { r.then((i) => { i.errors.length && n([i]), t += 1, t === e.length && n([]); }); }); }); }); } const vn = Symbol("formContextKey"), hn = (e) => { zt(vn, e); }, rt = () => Wt(vn, { name: F(() => { }), labelAlign: F(() => "right"), vertical: F(() => !1), // eslint-disable-next-line @typescript-eslint/no-unused-vars addField: (e, t) => { }, // eslint-disable-next-line @typescript-eslint/no-unused-vars removeField: (e) => { }, model: F(() => { }), rules: F(() => { }), colon: F(() => { }), labelWrap: F(() => { }), labelCol: F(() => { }), requiredMark: F(() => !1), validateTrigger: F(() => { }), onValidate: () => { }, validateMessages: F(() => Ie) }), pn = Symbol("formItemPrefixContextKey"), lo = (e) => { zt(pn, e); }, so = () => Wt(pn, { prefixCls: F(() => "") }), it = (e, t) => { let { slots: n, emit: r, attrs: i } = t; var o, a, l, s, v; const { prefixCls: f, htmlFor: g, labelCol: h, labelAlign: w, colon: $, required: d, requiredMark: y } = P(P({}, e), i), [m] = jn("Form"), q = (o = e.label) !== null && o !== void 0 ? o : (a = n.label) === null || a === void 0 ? void 0 : a.call(n); if (!q) return null; const { vertical: u, labelAlign: c, labelCol: b, labelWrap: S, colon: A } = rt(), O = h || (b == null ? void 0 : b.value) || {}, V = w || (c == null ? void 0 : c.value), M = `${f}-item-label`, L = pe(M, V === "left" && `${M}-left`, O.class, { [`${M}-wrap`]: !!S.value }); let T = q; const N = $ === !0 || (A == null ? void 0 : A.value) !== !1 && $ !== !1; if (N && !u.value && typeof q == "string" && q.trim() !== "" && (T = q.replace(/[:|:]\s*$/, "")), e.tooltip || n.tooltip) { const K = j("span", { class: `${f}-item-tooltip` }, [j(_n, { title: e.tooltip }, { default: () => [j(Mn, null, null)] })]); T = j(Se, null, [T, n.tooltip ? (l = n.tooltip) === null || l === void 0 ? void 0 : l.call(n, { class: `${f}-item-tooltip` }) : K]); } y === "optional" && !d && (T = j(Se, null, [T, j("span", { class: `${f}-item-optional` }, [((s = m.value) === null || s === void 0 ? void 0 : s.optional) || ((v = Ln.Form) === null || v === void 0 ? void 0 : v.optional)])])); const Q = pe({ [`${f}-item-required`]: d, [`${f}-item-required-mark-optional`]: y === "optional", [`${f}-item-no-colon`]: !N }); return j(Qt, W(W({}, O), {}, { class: L }), { default: () => [j("label", { for: g, class: Q, title: typeof q == "string" ? q : "", onClick: (K) => r("click", K) }, [T])] }); }; it.displayName = "FormItemLabel"; it.inheritAttrs = !1; const uo = (e) => { const { componentCls: t } = e, n = `${t}-show-help`, r = `${t}-show-help-item`; return { [n]: { // Explain holder transition: `opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`, "&-appear, &-enter": { opacity: 0, "&-active": { opacity: 1 } }, "&-leave": { opacity: 1, "&-active": { opacity: 0 } }, // Explain [r]: { overflow: "hidden", transition: `height ${e.motionDurationSlow} ${e.motionEaseInOut}, opacity ${e.motionDurationSlow} ${e.motionEaseInOut}, transform ${e.motionDurationSlow} ${e.motionEaseInOut} !important`, [`&${r}-appear, &${r}-enter`]: { transform: "translateY(-5px)", opacity: 0, "&-active": { transform: "translateY(0)", opacity: 1 } }, [`&${r}-leave-active`]: { transform: "translateY(-5px)" } } } }; }, fo = (e) => ({ legend: { display: "block", width: "100%", marginBottom: e.marginLG, padding: 0, color: e.colorTextDescription, fontSize: e.fontSizeLG, lineHeight: "inherit", border: 0, borderBottom: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}` }, label: { fontSize: e.fontSize }, 'input[type="search"]': { boxSizing: "border-box" }, // Position radios and checkboxes better 'input[type="radio"], input[type="checkbox"]': { lineHeight: "normal" }, 'input[type="file"]': { display: "block" }, // Make range inputs behave like textual form controls 'input[type="range"]': { display: "block", width: "100%" }, // Make multiple select elements height not fixed "select[multiple], select[size]": { height: "auto" }, // Focus for file, radio, and checkbox "input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus": { outline: 0, boxShadow: `0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}` }, // Adjust output element output: { display: "block", paddingTop: 15, color: e.colorText, fontSize: e.fontSize, lineHeight: e.lineHeight } }), Et = (e, t) => { const { formItemCls: n } = e; return { [n]: { [`${n}-label > label`]: { height: t }, [`${n}-control-input`]: { minHeight: t } } }; }, co = (e) => { const { componentCls: t } = e; return { [e.componentCls]: P(P(P({}, Vt(e)), fo(e)), { [`${t}-text`]: { display: "inline-block", paddingInlineEnd: e.paddingSM }, // ================================================================ // = Size = // ================================================================ "&-small": P({}, Et(e, e.controlHeightSM)), "&-large": P({}, Et(e, e.controlHeightLG)) }) }; }, mo = (e) => { const { formItemCls: t, iconCls: n, componentCls: r, rootPrefixCls: i } = e; return { [t]: P(P({}, Vt(e)), { marginBottom: e.marginLG, verticalAlign: "top", "&-with-help": { transition: "none" }, [`&-hidden, &-hidden.${i}-row`]: { // https://github.com/ant-design/ant-design/issues/26141 display: "none" }, "&-has-warning": { [`${t}-split`]: { color: e.colorError } }, "&-has-error": { [`${t}-split`]: { color: e.colorWarning } }, // ============================================================== // = Label = // ============================================================== [`${t}-label`]: { display: "inline-block", flexGrow: 0, overflow: "hidden", whiteSpace: "nowrap", textAlign: "end", verticalAlign: "middle", "&-left": { textAlign: "start" }, "&-wrap": { overflow: "unset", lineHeight: `${e.lineHeight} - 0.25em`, whiteSpace: "unset" }, "> label": { position: "relative", display: "inline-flex", alignItems: "center", maxWidth: "100%", height: e.controlHeight, color: e.colorTextHeading, fontSize: e.fontSize, [`> ${n}`]: { fontSize: e.fontSize, verticalAlign: "top" }, // Required mark [`&${t}-required:not(${t}-required-mark-optional)::before`]: { display: "inline-block", marginInlineEnd: e.marginXXS, color: e.colorError, fontSize: e.fontSize, fontFamily: "SimSun, sans-serif", lineHeight: 1, content: '"*"', [`${r}-hide-required-mark &`]: { display: "none" } }, // Optional mark [`${t}-optional`]: { display: "inline-block", marginInlineStart: e.marginXXS, color: e.colorTextDescription, [`${r}-hide-required-mark &`]: { display: "none" } }, // Optional mark [`${t}-tooltip`]: { color: e.colorTextDescription, cursor: "help", writingMode: "horizontal-tb", marginInlineStart: e.marginXXS }, "&::after": { content: '":"', position: "relative", marginBlock: 0, marginInlineStart: e.marginXXS / 2, marginInlineEnd: e.marginXS }, [`&${t}-no-colon::after`]: { content: '" "' } } }, // ============================================================== // = Input = // ============================================================== [`${t}-control`]: { display: "flex", flexDirection: "column", flexGrow: 1, [`&:first-child:not([class^="'${i}-col-'"]):not([class*="' ${i}-col-'"])`]: { width: "100%" }, "&-input": { position: "relative", display: "flex", alignItems: "center", minHeight: e.controlHeight, "&-content": { flex: "auto", maxWidth: "100%" } } }, // ============================================================== // = Explain = // ============================================================== [t]: { "&-explain, &-extra": { clear: "both", color: e.colorTextDescription, fontSize: e.fontSize, lineHeight: e.lineHeight }, "&-explain-connected": { width: "100%" }, "&-extra": { minHeight: e.controlHeightSM, transition: `color ${e.motionDurationMid} ${e.motionEaseOut}` // sync input color transition }, "&-explain": { "&-error": { color: e.colorError }, "&-warning": { color: e.colorWarning } } }, [`&-with-help ${t}-explain`]: { height: "auto", opacity: 1 }, // ============================================================== // = Feedback Icon = // ============================================================== [`${t}-feedback-icon`]: { fontSize: e.fontSize, textAlign: "center", visibility: "visible", animationName: Nt, animationDuration: e.motionDurationMid, animationTimingFunction: e.motionEaseOutBack, pointerEvents: "none", "&-success": { color: e.colorSuccess }, "&-error": { color: e.colorError }, "&-warning": { color: e.colorWarning }, "&-validating": { color: e.colorPrimary } } }) }; }, go = (e) => { const { componentCls: t, formItemCls: n, rootPrefixCls: r } = e; return { [`${t}-horizontal`]: { [`${n}-label`]: { flexGrow: 0 }, [`${n}-control`]: { flex: "1 1 0", // https://github.com/ant-design/ant-design/issues/32777 // https://github.com/ant-design/ant-design/issues/33773 minWidth: 0 }, // https://github.com/ant-design/ant-design/issues/32980 [`${n}-label.${r}-col-24 + ${n}-control`]: { minWidth: "unset" } } }; }, vo = (e) => { const { componentCls: t, formItemCls: n } = e; return { [`${t}-inline`]: { display: "flex", flexWrap: "wrap", [n]: { flex: "none", flexWrap: "nowrap", marginInlineEnd: e.margin, marginBottom: 0, "&-with-help": { marginBottom: e.marginLG }, [`> ${n}-label, > ${n}-control`]: { display: "inline-block", verticalAlign: "top" }, [`> ${n}-label`]: { flex: "none" }, [`${t}-text`]: { display: "inline-block" }, [`${n}-has-feedback`]: { display: "inline-block" } } } }; }, ce = (e) => ({ margin: 0, padding: `0 0 ${e.paddingXS}px`, whiteSpace: "initial", textAlign: "start", "> label": { margin: 0, "&::after": { display: "none" } } }), ho = (e) => { const { componentCls: t, formItemCls: n } = e; return { [`${n} ${n}-label`]: ce(e), [t]: { [n]: { flexWrap: "wrap", [`${n}-label, ${n}-control`]: { flex: "0 0 100%", maxWidth: "100%" } } } }; }, po = (e) => { const { componentCls: t, formItemCls: n, rootPrefixCls: r } = e; return { [`${t}-vertical`]: { [n]: { "&-row": { flexDirection: "column" }, "&-label > label": { height: "auto" }, [`${t}-item-control`]: { width: "100%" } } }, [`${t}-vertical ${n}-label, .${r}-col-24${n}-label, .${r}-col-xl-24${n}-label`]: ce(e), [`@media (max-width: ${e.screenXSMax}px)`]: [ho(e), { [t]: { [`.${r}-col-xs-24${n}-label`]: ce(e) } }], [`@media (max-width: ${e.screenSMMax}px)`]: { [t]: { [`.${r}-col-sm-24${n}-label`]: ce(e) } }, [`@media (max-width: ${e.screenMDMax}px)`]: { [t]: { [`.${r}-col-md-24${n}-label`]: ce(e) } }, [`@media (max-width: ${e.screenLGMax}px)`]: { [t]: { [`.${r}-col-lg-24${n}-label`]: ce(e) } } }; }, at = Rn("Form", (e, t) => { let { rootPrefixCls: n } = t; const r = Nn(e, { formItemCls: `${e.componentCls}-item`, rootPrefixCls: n }); return [co(r), mo(r), uo(r), go(r), vo(r), po(r), Vn(r), Nt]; }), yo = Te({ compatConfig: { MODE: 3 }, name: "ErrorList", inheritAttrs: !1, props: ["errors", "help", "onErrorVisibleChanged", "helpStatus", "warnings"], setup(e, t) { let { attrs: n } = t; const { prefixCls: r, status: i } = so(), o = F(() => `${r.value}-item-explain`), a = F(() => !!(e.errors && e.errors.length)), l = ke(i.value), [, s] = at(r); return se([a, i], () => { a.value && (l.value = i.value); }), () => { var v, f; const g = Dn(`${r.value}-show-help-item`), h = Bn(`${r.value}-show-help-item`, g); return h.role = "alert", h.class = [s.value, o.value, n.class, `${r.value}-show-help`], j(rr, W(W({}, Gn(`${r.value}-show-help`)), {}, { onAfterEnter: () => e.onErrorVisibleChanged(!0), onAfterLeave: () => e.onErrorVisibleChanged(!1) }), { default: () => [ir(j(ar, W(W({}, h), {}, { tag: "div" }), { default: () => [(f = e.errors) === null || f === void 0 ? void 0 : f.map((w, $) => j("div", { key: $, class: l.value ? `${o.value}-${l.value}` : "" }, [w]))] }), [[or, !!(!((v = e.errors) === null || v === void 0) && v.length)]])] }); }; } }), bo = Te({ compatConfig: { MODE: 3 }, slots: Object, inheritAttrs: !1, props: ["prefixCls", "errors", "hasFeedback", "onDomErrorVisibleChange", "wrapperCol", "help", "extra", "status", "marginBottom", "onErrorVisibleChanged"], setup(e, t) { let { slots: n } = t; const r = rt(), { wrapperCol: i } = r, o = P({}, r); return delete o.labelCol, delete o.wrapperCol, hn(o), lo({ prefixCls: F(() => e.prefixCls), status: F(() => e.status) }), () => { var a, l, s; const { prefixCls: v, wrapperCol: f, marginBottom: g, onErrorVisibleChanged: h, help: w = (a = n.help) === null || a === void 0 ? void 0 : a.call(n), errors: $ = Dt((l = n.errors) === null || l === void 0 ? void 0 : l.call(n)), // hasFeedback, // status, extra: d = (s = n.extra) === null || s === void 0 ? void 0 : s.call(n) } = e, y = `${v}-item`, m = f || (i == null ? void 0 : i.value) || {}, q = pe(`${y}-control`, m.class); return j(Qt, W(W({}, m), {}, { class: q }), { default: () => { var u; return j(Se, null, [j("div", { class: `${y}-control-input` }, [j("div", { class: `${y}-control-input-content` }, [(u = n.default) === null || u === void 0 ? void 0 : u.call(n)])]), g !== null || $.length ? j("div", { style: { display: "flex", flexWrap: "nowrap" } }, [j(yo, { errors: $, help: w, class: `${y}-explain-connected`, onErrorVisibleChanged: h }, null), !!g && j("div", { style: { width: 0, height: `${g}px` } }, null)]) : null, d ? j("div", { class: `${y}-extra` }, [d]) : null]); } }); }; } }); function wo(e) { const t = ee(e.value.slice()); let n = null; return De(() => { clearTimeout(n), n = setTimeout(() => { t.value = e.value; }, e.value.length ? 0 : 10); }), t; } Qe("success", "warning", "error", "validating", ""); const xo = { success: Xn, warning: Kn, error: Hn, validating: Un }; function Le(e, t, n) { let r = e; const i = t; let o = 0; try { for (let a = i.length; o < a - 1 && !(!r && !n); ++o) { const l = i[o]; if (l in r) r = r[l]; else { if (n) throw Error("please transfer a valid name path to form item!"); break; } } if (n && !r) throw Error("please transfer a valid name path to form item!"); } catch (a) { console.error("please transfer a valid name path to form item!"); } return { o: r, k: i[o], v: r ? r[i[o]] : void 0 }; } const $o = () => ({ htmlFor: String, prefixCls: String, label: de.any, help: de.any, extra: de.any, labelCol: { type: Object }, wrapperCol: { type: Object }, hasFeedback: { type: Boolean, default: !1 }, colon: { type: Boolean, default: void 0 }, labelAlign: String, prop: { type: [String, Number, Array] }, name: { type: [String, Number, Array] }, rules: [Array, Object], autoLink: { type: Boolean, default: !0 }, required: { type: Boolean, default: void 0 }, validateFirst: { type: Boolean, default: void 0 }, validateStatus: de.oneOf(Qe("", "success", "warning", "error", "validating")), validateTrigger: { type: [String, Array] }, messageVariables: { type: Object }, hidden: Boolean, noStyle: Boolean, tooltip: String }); let Fo = 0; const Ao = "form_item", Oo = Te({ compatConfig: { MODE: 3 }, name: "AFormItem", inheritAttrs: !1, __ANT_NEW_FORM_ITEM: !0, props: $o(), slots: Object, setup(e, t) { let { slots: n, attrs: r, expose: i } = t; Ne(e.prop === void 0, "`prop` is deprecated. Please use `name` instead."); const o = `form-item-${++Fo}`, { prefixCls: a } = Bt("form", e), [l, s] = at(a), v = ee(), f = rt(), g = F(() => e.name || e.prop), h = ee([]), w = ee(!1), $ = ee(), d = F(() => { const p = g.value; return Ke(p); }), y = F(() => { if (d.value.length) { const p = f.name.value, I = d.value.join("_"); return p ? `${p}_${I}` : `${Ao}_${I}`; } else return; }), m = () => { const p = f.model.value; if (!(!p || !g.value)) return Le(p, d.value, !0).v; }, q = F(() => m()), u = ee(Ae(q.value)), c = F(() => { let p = e.validateTrigger !== void 0 ? e.validateTrigger : f.validateTrigger.value; return p = p === void 0 ? "change" : p, ne(p); }), b = F(() => { let p = f.rules.value; const I = e.rules, D = e.required !== void 0 ? { required: !!e.required, trigger: c.value } : [], G = Le(p, d.value); p = p ? G.o[G.k] || G.v : []; const z = [].concat(I || p || []); return oa(z, (U) => U.required) ? z : z.concat(D); }), S = F(() => { const p = b.value; let I = !1; return p && p.length && p.every((D) => D.required ? (I = !0, !1) : !0), I || e.required; }), A = ee(); De(() => { A.value = e.validateStatus; }); const O = F(() => { let p = {}; return typeof e.label == "string" ? p.label = e.label : e.name && (p.label = String(e.name)), e.messageVariables && (p = P(P({}, p), e.messageVariables)), p; }), V = (p) => { if (d.value.length === 0) return; const { validateFirst: I = !1 } = e, { triggerName: D } = p || {}; let G = b.value; if (D && (G = G.filter((U) => { const { trigger: re } = U; return !re && !c.value.length ? !0 : ne(re || c.value).includes(D); })), !G.length) return Promise.resolve(); const z = gn(d.value, q.value, G, P({ validateMessages: f.validateMessages.value }, p), I, O.value); return A.value = "validating", h.value = [], z.catch((U) => U).then(function() { let U = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; if (A.value === "validating") { const re = U.filter((ie) => ie && ie.errors.length); A.value = re.length ? "error" : "success", h.value = re.map((ie) => ie.errors), f.onValidate(g.value, !h.value.length, h.value.length ? Be(h.value[0]) : null); } }), z; }, M = () => { V({ triggerName: "blur" }); }, L = () => { if (w.value) { w.value = !1; return; } V({ triggerName: "change" }); }, T = () => { A.value = e.validateStatus, w.value = !1, h.value = []; }, N = () => { var p; A.value = e.validateStatus, w.value = !0, h.value = []; const I = f.model.value || {}, D = q.value, G = Le(I, d.value, !0); Array.isArray(D) ? G.o[G.k] = [].concat((p = u.value) !== null && p !== void 0 ? p : []) : G.o[G.k] = u.value, Ht(() => { w.value = !1; }); }, Z = F(() => e.htmlFor === void 0 ? y.value : e.htmlFor), Q = () => { const p = Z.value; if (!p || !$.value) return; const I = $.value.$el.querySelector(`[id="${p}"]`); I && I.focus && I.focus(); }; i({ onFieldBlur: M, onFieldChange: L, clearValidate: T, resetField: N }), Wn({ id: y, onFieldBlur: () => { e.autoLink && M(); }, onFieldChange: () => { e.autoLink && L(); }, clearValidate: T }, F(() => !!(e.autoLink && f.model.value && g.value))); let K = !1; se(g, (p) => { p ? K || (K = !0, f.addField(o, { fieldValue: q, fieldId: y, fieldName: g, resetField: N, clearValidate: T, namePath: d, validateRules: V, rules: b })) : (K = !1, f.removeField(o)); }, { immediate: !0 }), lr(() => { f.removeField(o); }); const x = wo(h), C = F(() => e.validateStatus !== void 0 ? e.validateStatus : x.value.length ? "error" : A.value), R = F(() => ({ [`${a.value}-item`]: !0, [s.value]: !0, // Status [`${a.value}-item-has-feedback`]: C.value && e.hasFeedback, [`${a.value}-item-has-success`]: C.value === "success", [`${a.value}-item-has-warning`]: C.value === "warning", [`${a.value}-item-has-error`]: C.value === "error", [`${a.value}-item-is-validating`]: C.value === "validating", [`${a.value}-item-hidden`]: e.hidden })), H = Ut({}); zn.useProvide(H), De(() => { let p; if (e.hasFeedback) { const I = C.value && xo[C.value]; p = I ? j("span", { class: pe(`${a.value}-item-feedback-icon`, `${a.value}-item-feedback-icon-${C.value}`) }, [j(I, null, null)]) : null; } P(H, { status: C.value, hasFeedback: e.hasFeedback, feedbackIcon: p, isFormItemInput: !0 }); }); const X = ee(null), te = ee(!1), xe = () => { if (v.value) { const p = getComputedStyle(v.value); X.value = parseInt(p.marginBottom, 10); } }; sr(() => { se(te, () => { te.value && xe(); }, { flush: "post", immediate: !0 }); }); const k = (p) => { p || (X.value = null); }; return () => { var p, I; if (e.noStyle) return (p = n.default) === null || p === void 0 ? void 0 : p.call(n); const D = (I = e.help) !== null && I !== void 0 ? I : n.help ? Dt(n.help()) : null, G = !!(D != null && Array.isArray(D) && D.length || x.value.length); return te.value = G, l(j("div", { class: [R.value, G ? `${a.value}-item-with-help` : "", r.class], ref: v }, [j(mr, W(W({}, r), {}, { class: `${a.value}-item-row`, key: "row" }), { default: () => { var z, U; return j(Se, null, [j(it, W(W({}, e), {}, { htmlFor: Z.value, required: S.value, requiredMark: f.requiredMark.value, prefixCls: a.value, onClick: Q, label: e.label }), { label: n.label, tooltip: n.tooltip }), j(bo, W(W({}, e), {}, { errors: D != null ? ne(D) : x.value, marginBottom: X.value, prefixCls: a.value, status: C.value, ref: $, help: D, extra: (z = e.extra) !== null && z !== void 0 ? z : (U = n.extra) === null || U === void 0 ? void 0 : U.call(n), onErrorVisibleChanged: k }), { default: n.default })]); } }), !!X.value && j("div", { class: `${a.value}-margin-offset`, style: { marginBottom: `-${X.value}px` } }, null)])); }; } }); function yn(e) { let t = !1, n = e.length; const r = []; return e.length ? new Promise((i, o) => { e.forEach((a, l) => { a.catch((s) => (t = !0, s)).then((s) => { n -= 1, r[l] = s, !(n > 0) && (t && o(r), i(r)); }); }); }) : Promise.resolve([]); } function Pt(e) { let t = !1; return e && e.length && e.every((n) => n.required ? (t = !0, !1) : !0), t; } function qt(e) { return e == null ? [] : Array.isArray(e) ? e : [e]; } function Re(e, t, n) { let r = e; t = t.replace(/\[(\w+)\]/g, ".$1"), t = t.replace(/^\./, ""); const i = t.split("."); let o = 0; for (let a = i.length; o < a - 1 && !(!r && !n); ++o) { const l = i[o]; if (l in r) r = r[l]; else { if (n) throw new Error("please transfer a valid name path to validate!"); break; } } return { o: r, k: i[o], v: r ? r[i[o]] : null, isValid: r && i[o] in r }; } function Co(e) { let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ke({}), n = arguments.length > 2 ? arguments[2] : void 0; const r = Ae(ae(e)), i = Ut({}), o = ee([]), a = (u) => { P(ae(e), P(P({}, Ae(r)), u)), Ht(() => { Object.keys(i).forEach((c) => { i[c] = { autoLink: !1, required: Pt(ae(t)[c]) }; }); }); }, l = function() { let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], c = arguments.length > 1 ? arguments[1] : void 0; return c.length ? u.filter((b) => { const S = qt(b.trigger || "change"); return fa(S, c).length; }) : u; }; let s = null; const v = function(u) { let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, b = arguments.length > 2 ? arguments[2] : void 0; const S = [], A = {}; for (let M = 0; M < u.length; M++) { const L = u[M], T = Re(ae(e), L, b); if (!T.isValid) continue; A[L] = T.v; const N = l(ae(t)[L], qt(c && c.trigger)); N.length && S.push(f(L, T.v, N, c || {}).then(() => ({ name: L, errors: [], warnings: [] })).catch((Z) => { const Q = [], K = []; return Z.forEach((x) => { let { rule: { warningOnly: C }, errors: R } = x; C ? K.push(...R) : Q.push(...R); }), Q.length ? Promise.reject({ name: L, errors: Q, warnings: K }) : { name: L, errors: Q, warnings: K }; })); } const O = yn(S); s = O; const V = O.then(() => s === O ? Promise.resolve(A) : Promise.reject([])).catch((M) => { const L = M.filter((T) => T && T.errors.length); return L.length ? Promise.reject({ values: A, errorFields: L, outOfDate: s !== O }) : Promise.resolve(A); }); return V.catch((M) => M), V; }, f = function(u, c, b) { let S = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; const A = gn([u], c, b, P({ validateMessages: Ie }, S), !!S.validateFirst); return i[u] ? (i[u].validateStatus = "validating", A.catch((O) => O).then(function() { let O = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; var V; if (i[u].validateStatus === "validating") { const M = O.filter((L) => L && L.errors.length); i[u].validateStatus = M.length ? "error" : "success", i[u].help = M.length ? M.map((L) => L.errors) : null, (V = n == null ? void 0 : n.onValidate) === null || V === void 0 || V.call(n, u, !M.length, M.length ? Be(i[u].help[0]) : null); } }), A) : A.catch((O) => O); }, g = (u, c) => { let b = [], S = !0; u ? Array.isArray(u) ? b = u : b = [u] : (S = !1, b = o.value); const A = v(b, c || {}, S); return A.catch((O) => O), A; }, h = (u) => { let c = []; u ? Array.isArray(u) ? c = u : c = [u] : c = o.value, c.forEach((b) => { i[b] && P(i[b], { validateStatus: "", help: null }); }); }, w = (u) => { const c = { autoLink: !1 }, b = [], S = Array.isArray(u) ? u : [u]; for (let A = 0; A < S.length; A++) { const O = S[A]; (O == null ? void 0 : O.validateStatus) === "error" && (c.validateStatus = "error", O.help && b.push(O.help)), c.required = c.required || (O == null ? void 0 : O.required); } return c.help = b, c; }; let $ = r, d = !0; const y = (u) => { const c = []; o.value.forEach((b) => { const S = Re(u, b, !1), A = Re($, b, !1); (d && (n == null ? void 0 : n.immediate) && S.isValid || !Gt(S.v, A.v)) && c.push(b); }), g(c, { trigger: "change" }), d = !1, $ = Ae(Be(u)); }, m = n == null ? void 0 : n.debounce; let q = !0; return se(t, () => { o.value = t ? Object.keys(ae(t)) : [], !q && n && n.validateOnRuleChange && g(), q = !1; }, { deep: !0, immediate: !0 }), se(o, () => { const u = {}; o.value.forEach((c) => { u[c] = P({}, i[c], { autoLink: !1, required: Pt(ae(t)[c]) }), delete i[c]; }); for (const c in i) Object.prototype.hasOwnProperty.call(i, c) && delete i[c]; P(i, u); }, { immediate: !0 }), se(e, m && m.wait ? Yn(y, m.wait, ba(m, ["wait"])) : y, { immediate: n && !!n.immediate, deep: !0 }), { modelRef: e, rulesRef: t, initialModel: r, validateInfos: i, resetFields: a, validate: g, validateField: f, mergeValidateInfo: w, clearValidate: h }; } const So = () => ({ layout: de.oneOf(Qe("horizontal", "inline", "vertical")), labelCol: $e(), wrapperCol: $e(), colon: me(), labelAlign: ft(), labelWrap: me(), prefixCls: String, requiredMark: ct([String, Boolean]), /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */ hideRequiredMark: me(), model: de.object, rules: $e(), validateMessages: $e(), validateOnRuleChange: me(), // 提交失败自动滚动到第一个错误字段 scrollToFirstError: er(), onSubmit: ue(), name: String, validateTrigger: ct([String, Array]), size: ft(), disabled: me(), onValuesChange: ue(), onFieldsChange: ue(), onFinish: ue(), onFinishFailed: ue(), onValidate: ue() }); function Eo(e, t) { return Gt(ne(e), ne(t)); } const oe = Te({ compatConfig: { MODE: 3 }, name: "AForm", inheritAttrs: !1, props: kn(So(), { layout: "horizontal", hideRequiredMark: !1, colon: !0 }), Item: Oo, useForm: Co, // emits: ['finishFailed', 'submit', 'finish', 'validate'], setup(e, t) { let { emit: n, slots: r, expose: i, attrs: o } = t; const { prefixCls: a, direction: l, form: s, size: v, disabled: f } = Bt("form", e), g = F(() => e.requiredMark === "" || e.requiredMark), h = F(() => { var x; return g.value !== void 0 ? g.value : s && ((x = s.value) === null || x === void 0 ? void 0 : x.requiredMark) !== void 0 ? s.value.requiredMark : !e.hideRequiredMark; }); Jn(v), Zn(f); const w = F(() => { var x, C; return (x = e.colon) !== null && x !== void 0 ? x : (C = s.value) === null || C === void 0 ? void 0 : C.colon; }), { validateMessages: $ } = Qn(), d = F(() => P(P(P({}, Ie), $.value), e.validateMessages)), [y, m] = at(a), q = F(() => pe(a.value, { [`${a.value}-${e.layout}`]: !0, [`${a.value}-hide-required-mark`]: h.value === !1, [`${a.value}-rtl`]: l.value === "rtl", [`${a.value}-${v.value}`]: v.value }, m.value)), u = ke(), c = {}, b = (x, C) => { c[x] = C; }, S = (x) => { delete c[x]; }, A = (x) => { const C = !!x, R = C ? ne(x).map(Ke) : []; return C ? Object.values(c).filter((H) => R.findIndex((X) => Eo(X, H.fieldName.value)) > -1) : Object.values(c); }, O = (x) => { if (!e.model) { _e(!1, "Form", "model is required for resetFields to work."); return; } A(x).forEach((C) => { C.resetField(); }); }, V = (x) => { A(x).forEach((C) => { C.clearValidate(); }); }, M = (x) => { const { scrollToFirstError: C } = e; if (n("finishFailed", x), C && x.errorFields.length) { let R = {}; typeof C == "object" && (R = C), T(x.errorFields[0].name, R); } }, L = function() { return Q(...arguments); }, T = function(x) { let C = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const R = A(x ? [x] : void 0); if (R.length) { const H = R[0].fieldId.value, X = H ? document.getElementById(H) : null; X && gr(X, P({ scrollMode: "if-needed", block: "nearest" }, C)); } }, N = function() { let x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0; if (x === !0) { const C = []; return Object.values(c).forEach((R) => { let { namePath: H } = R; C.push(H.value); }), St(e.model, C); } else return St(e.model, x); }, Z = (x, C) => { if (_e(!(x instanceof Function), "Form", "validateFields/validateField/validate not support callback, please use promise instead"), !e.model) return _e(!1, "Form", "model is required for validateFields to work."), Promise.reject("Form `model` is required for validateFields to work."); const R = !!x, H = R ? ne(x).map(Ke) : [], X = []; Object.values(c).forEach((k) => { var p; if (R || H.push(k.namePath.value), !(!((p = k.rules) === null || p === void 0) && p.value.length)) return; const I = k.namePath.value; if (!R || eo(H, I)) { const D = k.validateRules(P({ validateMessages: d.value }, C)); X.push(D.then(() => ({ name: I, errors: [], warnings: [] })).catch((G) => { const z = [], U = []; return G.forEach((re) => { let { rule: { warningOnly: ie }, errors: ot } = re; ie ? U.push(...ot) : z.push(...ot); }), z.length ? Promise.reject({ name: I, errors: z, warnings: U }) : { name: I, errors: z, warnings: U }; })); } }); const te = yn(X); u.value = te; const xe = te.then(() => u.value === te ? Promise.resolve(N(H)) : Promise.reject([])).catch((k) => { const p = k.filter((I) => I && I.errors.length); return Promise.reject({ values: N(H), errorFields: p, outOfDate: u.value !== te }); }); return xe.catch((k) => k), xe; }, Q = function() { return Z(...arguments); }, K = (x) => { x.preventDefault(), x.stopPropagation(), n("submit", x), e.model && Z().then((R) => { n("finish", R); }).catch((R) => { M(R); }); }; return i({ resetFields: O, clearValidate: V, validateFields: Z, getFieldsValue: N, validate: L, scrollToField: T }), hn({ model: F(() => e.model), name: F(() => e.name), labelAlign: F(() => e.labelAlign), labelCol: F(() => e.labelCol), labelWrap: F(() => e.labelWrap), wrapperCol: F(() => e.wrapperCol), vertical: F(() => e.layout === "vertical"), colon: w, requiredMark: h, validateTrigger: F(() => e.validateTrigger), rules: F(() => e.rules), addField: b, removeField: S, onValidate: (x, C, R) => { n("validate", x, C, R); }, validateMessages: d }), se(() => e.rules, () => { e.validateOnRuleChange && Z(); }), () => { var x; return y(j("form", W(W({}, o), {}, { onSubmit: K, class: [q.value, o.class] }), [(x = r.default) === null || x === void 0 ? void 0 : x.call(r)])); }; } }); oe.useInjectFormItemContext = tr; oe.ItemRest = Ve; oe.install = function(e) { return e.component(oe.name, oe), e.component(oe.Item.name, oe.Item), e.component(Ve.name, Ve), e; }; export { oe as F, Oo as _, sn as b };