UNPKG

@vue-js-cron/light

Version:
1,999 lines (1,998 loc) 57.3 kB
import { defineComponent as G, watch as g, ref as S, computed as de, openBlock as O, createElementBlock as V, createElementVNode as E, normalizeClass as se, createTextVNode as be, toDisplayString as L, createCommentVNode as K, Fragment as B, renderList as te, withModifiers as Ae, resolveComponent as We, createVNode as oe } from "vue"; var Oe = Object.defineProperty, Ve = (e, t, r) => t in e ? Oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, d = (e, t, r) => (Ve(e, typeof t != "symbol" ? t + "" : t, r), r), I = /* @__PURE__ */ ((e) => (e.Empty = "empty", e.Value = "value", e.Range = "range", e.EveryX = "everyX", e.Combined = "combined", e.NoSpecific = "noSpecific", e))(I || {}), $ = /* @__PURE__ */ ((e) => (e.Prefix = "prefix", e.Suffix = "suffix", e.Text = "text", e))($ || {}); class qe { constructor(t) { d(this, "field"), d(this, "itemMap"), this.field = t, this.itemMap = this.field.items.reduce( (r, i) => (r[i.value] = i, r), {} ); } get id() { return this.field.id; } get items() { return this.field.items; } get onChange() { return this.field.onChange; } get segmentFactories() { return this.field.segmentFactories; } get min() { return this.items[0].value; } get max() { return this.items[this.items.length - 1].value; } getItem(t) { return this.itemMap[t]; } } function Xe(e, t, r = 1) { const i = []; for (let n = e; n <= t; n += r) i.push(n); return i; } class je { constructor(t, r, i = 1) { return d(this, "start"), d(this, "end"), d(this, "step"), this.start = t, this.end = r, this.step = i, new Proxy(this, { get: function(n, a) { const o = typeof a == "string" ? parseInt(a) : a; return typeof o == "number" && o >= 0 && o <= n.length ? n.start + n.step * o : Reflect.get(n, a); } }); } get length() { return (this.end - this.start) / this.step + 1; } [Symbol.iterator]() { let t = -1; return { next: () => ({ value: this[++t], done: this[t + 1] === void 0 }) }; } } function T(e, t, r = (n) => n + "", i = (n) => n + "") { const n = []; for (const a of new je(e, t)) n.push({ text: r(a), alt: i(a), value: a }); return n; } function Me(e, t = "crontab") { const r = (n, a = !1) => new Date(2021, n - 1, 1).toLocaleDateString(e, { month: a ? "short" : "long" }), i = (n, a = !1) => new Date(2021, 0, 3 + n).toLocaleDateString(e, { weekday: a ? "short" : "long" }); return { secondItems: T(0, 59, (n) => Q(n, 2)), minuteItems: T(0, 59, (n) => Q(n, 2)), hourItems: T(0, 23, (n) => Q(n, 2)), dayItems: T(1, 31), monthItems: T(1, 12, r, (n) => r(n, !0)), dayOfWeekItems: t === "quartz" ? T( 1, 7, (n) => i(n - 1), (n) => i(n - 1, !0) ) : T(0, 6, i, (n) => i(n, !0)) }; } function Q(e, t) { const r = e + ""; return r.length < t ? new Array(t - r.length).fill("0").join("") + e : r; } function z(e) { return e && typeof e == "object" && !Array.isArray(e); } function re(e, ...t) { if (!z(e) || t.length === 0) return; const r = t.shift(); if (z(r)) for (const [i, n] of Object.entries(r)) z(n) ? (z(e[i]) || (e[i] = {}), re(e[i], r[i])) : e[i] = r[i]; return t.length > 0 && re(e, t), e; } function ce(e, ...t) { if (t.length === 0) return e; for (const r of t[0]) if (r in e) { const i = ce(e[r], ...t.slice(1)); if (i !== void 0) return i; } } function Te(e) { for (let t = 1; t < e.length; t++) if (e[t - 1] + 1 !== e[t]) return !1; return !0; } function Ee() { throw new Error("not implemented"); } function $e(e, t, r = !0) { const i = []; for (let n = 0; n < e.length; n += t) { const a = e.slice(n, n + t); for (; r && a.length < t; ) a.push(null); i.push(a); } return i; } class J { constructor(t) { d(this, "field"), d(this, "type", I.NoSpecific), this.field = t; } toCron() { return "?"; } toArray() { return []; } get items() { return {}; } static fromString(t, r) { return t !== "?" ? null : new J(r); } } class j { constructor(t) { d(this, "field"), d(this, "type", I.Empty), this.field = t; } toCron() { return "*"; } toArray() { return []; } get items() { return {}; } static fromString(t, r) { return t !== "*" ? null : new j(r); } static fromArray(t, r) { const { items: i } = r; if (t.length === 0) return new j(r); if (t.length !== i.length) return null; for (const n of i) if (!t.includes(n.value)) return null; return Te(i.map((n) => n.value)) ? new j(r) : null; } } const me = class ne { constructor(t, r, i) { d(this, "field"), d(this, "type", I.Range), d(this, "start"), d(this, "end"), this.field = t, this.start = r, this.end = i; } toCron() { return `${this.start}-${this.end}`; } toArray() { const t = this.start, r = this.end; return Xe(t, r); } get items() { return { start: this.field.itemMap[this.start], end: this.field.itemMap[this.end] }; } static fromString(t, r) { if (!ne.re.test(t)) return null; const { min: i, max: n } = r, a = t.split("-"), o = parseInt(a[0]), s = parseInt(a[1]); return o > s || o < i || s > n ? null : new ne(r, o, s); } }; d(me, "re", /^\d+-\d+$/); let _ = me; const le = (e, t, r) => { const i = []; for (let n = t; n <= r; n += e) i.push(n); return i; }, ve = class H { constructor(t, r, i, n) { d(this, "field"), d(this, "type", I.EveryX), d(this, "every"), d(this, "start"), d(this, "end"), this.field = t, this.every = r, this.start = i ?? t.min, this.end = n ?? t.max; } toCron() { return this.start == this.field.min && this.end == this.field.max ? `*/${this.every}` : `${this.start}-${this.end}/${this.every}`; } toArray() { return le(this.every, this.start, this.end); } get items() { return { every: this.field.itemMap[this.every], start: this.field.itemMap[this.start], end: this.field.itemMap[this.end] }; } static fromString(t, r) { if (!H.re.test(t)) return null; const [i, n] = t.split("/"), a = parseInt(n); if (a > r.items.length) return null; const o = t.split("-").map((f) => parseInt(f)), s = i == "*" ? r.min : o[0], l = i == "*" ? r.max : o[1]; return le(a, s, l).length == 0 ? null : new H(r, a, s, l); } static fromArray(t, r) { const { min: i, max: n } = r; if (t.length < 3) return null; const a = t[1] - t[0]; if (a <= 1 || t[0] != i) return null; const o = t[t.length - 1]; if (n - o >= a) return null; for (let s = 2; s < t.length; s++) if (t[s] - t[s - 1] != a) return null; return new H(r, a, i, n); } }; d(ve, "re", /^(\*|\d+-\d+)\/\d+$/); let Y = ve; class U { constructor(t, r) { d(this, "field"), d(this, "type", I.Value), d(this, "value"), this.field = t, this.value = r; } toCron() { return `${this.value}`; } toArray() { return [this.value]; } get items() { return { value: this.field.itemMap[this.value] }; } static fromString(t, r) { const { min: i, max: n } = r, a = parseInt(t); return String(a) === t && a >= i && a <= n ? new U(r, a) : null; } static fromArray(t, r) { const { min: i, max: n } = r; if (t.length != 1) return null; const a = t[0]; return a < i || a > n ? null : a; } } const he = class N { constructor(t, r = []) { d(this, "field"), d(this, "segments"), this.field = t, this.segments = r; } get type() { return this.segments.length == 1 ? this.segments[0].type : I.Range; } addSegment(t) { this.segments.push(t); } toCron() { return this.segments.map((t) => t.toCron()).join(","); } toArray() { const t = /* @__PURE__ */ new Set(); for (const r of this.segments) r.toArray().forEach((i) => t.add(i)); return Array.from(t); } get items() { return Ee(); } static fromString(t, r) { const i = r.segmentFactories ?? N.segmentFactories; let n = []; for (const a of t.split(",")) { if (a === "*") { n = [new j(r)]; break; } let o = null; for (const s of i) if (o = s(a, r), o !== null) break; if (o === null) return null; n.push(o); } return new N(r, n); } static fromArray(t, r) { const { min: i, max: n } = r, a = t[0], o = t[t.length - 1]; if (a < i || o > n) return null; const s = []; let l = 0; for (let f = 0; f < t.length; f++) (t[f + 1] === void 0 || t[f + 1] - t[f] > 1) && (f === l ? s.push(new U(r, t[l])) : s.push(new _(r, t[l], t[f])), l = f + 1); return new N(r, s); } }; d(he, "segmentFactories", [ j.fromString, Y.fromString, _.fromString, U.fromString ]); let ie = he; function ue(e, t) { return ie.fromString(e, t); } function Ie(e, t) { for (const r of [ j.fromArray, Y.fromArray, ie.fromArray ]) { const i = r(e, t); if (i != null) return i; } return null; } /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ var Le = Object.prototype.toString, R = Array.isArray || function(e) { return Le.call(e) === "[object Array]"; }; function ae(e) { return typeof e == "function"; } function Ue(e) { return R(e) ? "array" : typeof e; } function Z(e) { return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); } function xe(e, t) { return e != null && typeof e == "object" && t in e; } function Pe(e, t) { return e != null && typeof e != "object" && e.hasOwnProperty && e.hasOwnProperty(t); } var Re = RegExp.prototype.test; function De(e, t) { return Re.call(e, t); } var Fe = /\S/; function ze(e) { return !De(Fe, e); } var He = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;", "/": "&#x2F;", "`": "&#x60;", "=": "&#x3D;" }; function Ne(e) { return String(e).replace(/[&<>"'`=\/]/g, function(t) { return He[t]; }); } var Be = /\s*/, Je = /\s+/, fe = /\s*=/, _e = /\s*\}/, Ye = /#|\^|\/|>|\{|&|=|!/; function Ge(e, t) { if (!e) return []; var r = !1, i = [], n = [], a = [], o = !1, s = !1, l = "", f = 0; function v() { if (o && !s) for (; a.length; ) delete n[a.pop()]; else a = []; o = !1, s = !1; } var h, y, X; function q(A) { if (typeof A == "string" && (A = A.split(Je, 2)), !R(A) || A.length !== 2) throw new Error("Invalid tags: " + A); h = new RegExp(Z(A[0]) + "\\s*"), y = new RegExp("\\s*" + Z(A[1])), X = new RegExp("\\s*" + Z("}" + A[1])); } q(t || W.tags); for (var u = new F(e), c, x, m, b, M, p; !u.eos(); ) { if (c = u.pos, m = u.scanUntil(h), m) for (var k = 0, w = m.length; k < w; ++k) b = m.charAt(k), ze(b) ? (a.push(n.length), l += b) : (s = !0, r = !0, l += " "), n.push(["text", b, c, c + 1]), c += 1, b === ` ` && (v(), l = "", f = 0, r = !1); if (!u.scan(h)) break; if (o = !0, x = u.scan(Ye) || "name", u.scan(Be), x === "=" ? (m = u.scanUntil(fe), u.scan(fe), u.scanUntil(y)) : x === "{" ? (m = u.scanUntil(X), u.scan(_e), u.scanUntil(y), x = "&") : m = u.scanUntil(y), !u.scan(y)) throw new Error("Unclosed tag at " + u.pos); if (x == ">" ? M = [x, m, c, u.pos, l, f, r] : M = [x, m, c, u.pos], f++, n.push(M), x === "#" || x === "^") i.push(M); else if (x === "/") { if (p = i.pop(), !p) throw new Error('Unopened section "' + m + '" at ' + c); if (p[1] !== m) throw new Error('Unclosed section "' + p[1] + '" at ' + c); } else x === "name" || x === "{" || x === "&" ? s = !0 : x === "=" && q(m); } if (v(), p = i.pop(), p) throw new Error('Unclosed section "' + p[1] + '" at ' + u.pos); return Qe(Ke(n)); } function Ke(e) { for (var t = [], r, i, n = 0, a = e.length; n < a; ++n) r = e[n], r && (r[0] === "text" && i && i[0] === "text" ? (i[1] += r[1], i[3] = r[3]) : (t.push(r), i = r)); return t; } function Qe(e) { for (var t = [], r = t, i = [], n, a, o = 0, s = e.length; o < s; ++o) switch (n = e[o], n[0]) { case "#": case "^": r.push(n), i.push(n), r = n[4] = []; break; case "/": a = i.pop(), a[5] = n[2], r = i.length > 0 ? i[i.length - 1][4] : t; break; default: r.push(n); } return t; } function F(e) { this.string = e, this.tail = e, this.pos = 0; } F.prototype.eos = function() { return this.tail === ""; }; F.prototype.scan = function(e) { var t = this.tail.match(e); if (!t || t.index !== 0) return ""; var r = t[0]; return this.tail = this.tail.substring(r.length), this.pos += r.length, r; }; F.prototype.scanUntil = function(e) { var t = this.tail.search(e), r; switch (t) { case -1: r = this.tail, this.tail = ""; break; case 0: r = ""; break; default: r = this.tail.substring(0, t), this.tail = this.tail.substring(t); } return this.pos += r.length, r; }; function P(e, t) { this.view = e, this.cache = { ".": this.view }, this.parent = t; } P.prototype.push = function(e) { return new P(e, this); }; P.prototype.lookup = function(e) { var t = this.cache, r; if (t.hasOwnProperty(e)) r = t[e]; else { for (var i = this, n, a, o, s = !1; i; ) { if (e.indexOf(".") > 0) for (n = i.view, a = e.split("."), o = 0; n != null && o < a.length; ) o === a.length - 1 && (s = xe(n, a[o]) || Pe(n, a[o])), n = n[a[o++]]; else n = i.view[e], s = xe(i.view, e); if (s) { r = n; break; } i = i.parent; } t[e] = r; } return ae(r) && (r = r.call(this.view)), r; }; function C() { this.templateCache = { _cache: {}, set: function(e, t) { this._cache[e] = t; }, get: function(e) { return this._cache[e]; }, clear: function() { this._cache = {}; } }; } C.prototype.clearCache = function() { typeof this.templateCache < "u" && this.templateCache.clear(); }; C.prototype.parse = function(e, t) { var r = this.templateCache, i = e + ":" + (t || W.tags).join(":"), n = typeof r < "u", a = n ? r.get(i) : void 0; return a == null && (a = Ge(e, t), n && r.set(i, a)), a; }; C.prototype.render = function(e, t, r, i) { var n = this.getConfigTags(i), a = this.parse(e, n), o = t instanceof P ? t : new P(t, void 0); return this.renderTokens(a, o, r, e, i); }; C.prototype.renderTokens = function(e, t, r, i, n) { for (var a = "", o, s, l, f = 0, v = e.length; f < v; ++f) l = void 0, o = e[f], s = o[0], s === "#" ? l = this.renderSection(o, t, r, i, n) : s === "^" ? l = this.renderInverted(o, t, r, i, n) : s === ">" ? l = this.renderPartial(o, t, r, n) : s === "&" ? l = this.unescapedValue(o, t) : s === "name" ? l = this.escapedValue(o, t, n) : s === "text" && (l = this.rawValue(o)), l !== void 0 && (a += l); return a; }; C.prototype.renderSection = function(e, t, r, i, n) { var a = this, o = "", s = t.lookup(e[1]); function l(h) { return a.render(h, t, r, n); } if (s) { if (R(s)) for (var f = 0, v = s.length; f < v; ++f) o += this.renderTokens(e[4], t.push(s[f]), r, i, n); else if (typeof s == "object" || typeof s == "string" || typeof s == "number") o += this.renderTokens(e[4], t.push(s), r, i, n); else if (ae(s)) { if (typeof i != "string") throw new Error("Cannot use higher-order sections without the original template"); s = s.call(t.view, i.slice(e[3], e[5]), l), s != null && (o += s); } else o += this.renderTokens(e[4], t, r, i, n); return o; } }; C.prototype.renderInverted = function(e, t, r, i, n) { var a = t.lookup(e[1]); if (!a || R(a) && a.length === 0) return this.renderTokens(e[4], t, r, i, n); }; C.prototype.indentPartial = function(e, t, r) { for (var i = t.replace(/[^ \t]/g, ""), n = e.split(` `), a = 0; a < n.length; a++) n[a].length && (a > 0 || !r) && (n[a] = i + n[a]); return n.join(` `); }; C.prototype.renderPartial = function(e, t, r, i) { if (r) { var n = this.getConfigTags(i), a = ae(r) ? r(e[1]) : r[e[1]]; if (a != null) { var o = e[6], s = e[5], l = e[4], f = a; s == 0 && l && (f = this.indentPartial(a, l, o)); var v = this.parse(f, n); return this.renderTokens(v, t, r, f, i); } } }; C.prototype.unescapedValue = function(e, t) { var r = t.lookup(e[1]); if (r != null) return r; }; C.prototype.escapedValue = function(e, t, r) { var i = this.getConfigEscape(r) || W.escape, n = t.lookup(e[1]); if (n != null) return typeof n == "number" && i === W.escape ? String(n) : i(n); }; C.prototype.rawValue = function(e) { return e[1]; }; C.prototype.getConfigTags = function(e) { return R(e) ? e : e && typeof e == "object" ? e.tags : void 0; }; C.prototype.getConfigEscape = function(e) { if (e && typeof e == "object" && !R(e)) return e.escape; }; var W = { name: "mustache.js", version: "4.2.0", tags: ["{{", "}}"], clearCache: void 0, escape: void 0, parse: void 0, render: void 0, Scanner: void 0, Context: void 0, Writer: void 0, /** * Allows a user to override the default caching strategy, by providing an * object with set, get and clear methods. This can also be used to disable * the cache by setting it to the literal `undefined`. */ set templateCache(e) { D.templateCache = e; }, /** * Gets the default or overridden caching object from the default writer. */ get templateCache() { return D.templateCache; } }, D = new C(); W.clearCache = function() { return D.clearCache(); }; W.parse = function(e, t) { return D.parse(e, t); }; W.render = function(e, t, r, i) { if (typeof e != "string") throw new TypeError('Invalid template! Template should be a "string" but "' + Ue(e) + '" was given as the first argument for mustache#render(template, view, partials)'); return D.render(e, t, r, i); }; W.escape = Ne; W.Scanner = F; W.Context = P; W.Writer = C; const pe = { "*": { prefix: "每", suffix: "", text: "未知", "*": { empty: { text: "每 {{field.id}}" }, value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "每 {{every.value}}" } }, month: { "*": { prefix: "的" }, empty: { text: "每月" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "的" }, empty: { text: "每日" }, value: { text: "{{value.alt}}号" }, range: { text: "{{start.alt}}号-{{end.alt}}号" } }, dayOfWeek: { "*": { prefix: "的" }, empty: { text: "一周的每一天" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, hour: { "*": { prefix: "的" }, empty: { text: "每小时" } }, minute: { "*": { prefix: ":" }, empty: { text: "每分钟" } }, second: { "*": { prefix: ":" }, empty: { text: "每秒" } } }, minute: { text: "分" }, hour: { text: "小时", minute: { "*": { prefix: ":", suffix: "分钟" }, empty: { text: "每" } } }, day: { text: "天" }, week: { text: "周", dayOfWeek: { "*": { prefix: "的" }, empty: { text: "每天" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } } }, month: { text: "月", dayOfWeek: { "*": { prefix: "和" } }, day: { "*": { prefix: "的" } } }, year: { text: "年", dayOfWeek: { "*": { prefix: "和" } } }, //quartz format "q-second": { text: "秒" }, "q-minute": { text: "分钟", second: { "*": { prefix: ":", suffix: "秒" }, empty: { text: "每" } } }, "q-hour": { text: "小时", minute: { "*": { prefix: ":" } } } }, Ze = { "*": { prefix: "Hver", suffix: "", text: "Ukendt", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "hver {{every.value}}" } }, month: { "*": { prefix: "i" }, empty: { text: "hver måned" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "og" }, empty: { text: "hver dag i måneden" }, value: { text: "{{value.alt}}." }, range: { text: "{{start.alt}}.-{{end.alt}}." }, noSpecific: { text: "ingen specifik dag" } }, dayOfWeek: { "*": { prefix: "på" }, empty: { text: "hver dag i ugen" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { text: "ingen specifik dag i ugen" } }, hour: { "*": { prefix: "klokken" }, empty: { text: "hver time" } }, minute: { "*": { prefix: ":" }, empty: { text: "hvert minut" } }, second: { "*": { prefix: ":" }, empty: { text: "hvert sekund" } } }, second: { prefix: "Hvert" }, minute: { prefix: "Hvert", text: "Minut" }, hour: { text: "Time", minute: { "*": { prefix: "ved", suffix: "minutter" }, empty: { text: "alle" } } }, day: { text: "Dag" }, week: { text: "Uge" }, month: { text: "Måned", dayOfWeek: { "*": { prefix: "og" } } }, year: { prefix: "Hvert", text: "År", dayOfWeek: { "*": { prefix: "og" } } }, // quartz format "q-second": { text: "Sekund" }, "q-minute": { text: "Minut", second: { "*": { suffix: "sekund(er)" }, empty: { text: "hvert" } } }, "q-hour": { text: "Time", minute: { "*": { prefix: "på" } } } }, et = { "*": { prefix: "Jede", suffix: "", text: "Unknown", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "alle {{every.value}}" } }, month: { "*": { prefix: "im" }, empty: { prefix: "in", text: "jedem Monat" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "den" }, empty: { prefix: "an", text: "jedem Tag" }, everyX: { prefix: "", text: "alle {{every.value}} Tage" }, noSpecific: { prefix: "an", text: "keinem bestimmten Tag" } }, dayOfWeek: { "*": { prefix: "am" }, empty: { prefix: "an", text: "jedem Wochentag" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { prefix: "und", text: "keinem bestimmten Wochentag" } }, hour: { "*": { prefix: "um" }, empty: { prefix: "zu", text: "jeder Stunde" }, everyX: { prefix: "", text: "alle {{every.value}} Stunden" } }, minute: { "*": { prefix: ":" }, empty: { text: "jede Minute" }, everyX: { prefix: "", text: "alle {{every.value}} Minuten" } }, second: { "*": { prefix: ":" }, empty: { text: "jede Sekunde" }, everyX: { prefix: "", text: "alle {{every.value}} Sekunden" } } }, minute: { text: "Minute" }, hour: { text: "Stunde", minute: { "*": { prefix: "zu", suffix: "Minute(n)" }, empty: { text: "jeder" } } }, day: { prefix: "Jeden", text: "Tag" }, week: { text: "Woche" }, month: { prefix: "Jedes", text: "Monat" }, year: { prefix: "Jedes", text: "Jahr" }, //quartz format "q-second": { text: "Sekunde" }, "q-minute": { text: "Minute", second: { "*": { prefix: "und" } } }, "q-hour": { text: "Stunde", minute: { "*": { prefix: "und" } }, second: { "*": { prefix: "und" } } } }, tt = { "*": { prefix: "Every", suffix: "", text: "Unknown", "*": { empty: { text: "every {{field.id}}" }, value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "every {{every.value}}" } }, month: { "*": { prefix: "in" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "on" }, noSpecific: { text: "no specific day" } }, dayOfWeek: { "*": { prefix: "on" }, empty: { text: "every day of the week" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { text: "no specific day of the week" } }, hour: { "*": { prefix: "at" } }, minute: { "*": { prefix: ":" } }, second: { "*": { prefix: ":" } } }, minute: { text: "Minute" }, hour: { text: "Hour", minute: { "*": { prefix: "at", suffix: "minute(s)" }, empty: { text: "every" } } }, day: { text: "Day" }, week: { text: "Week" }, month: { text: "Month", dayOfWeek: { "*": { prefix: "and" } } }, year: { text: "Year", dayOfWeek: { "*": { prefix: "and" } } }, //quartz format "q-second": { text: "Second" }, "q-minute": { text: "Minute", second: { "*": { prefix: "at", suffix: "second(s)" }, empty: { text: "every" } } }, "q-hour": { text: "Hour", minute: { "*": { prefix: "at" } } } }, rt = { "*": { prefix: "todos los", suffix: "", text: "Desconocido", "*": { empty: { text: "todos los {{ field.id }}" }, value: { text: "{{ value.text }}" }, range: { text: "{{ start.text }}-{{ end.text }}" }, everyX: { text: "todos/as {{ every.value }}" } }, month: { "*": { prefix: "en" }, empty: { text: "todos los meses" }, value: { text: "{{ value.alt }}" }, range: { text: "{{ start.alt }}-{{ end.alt }}" } }, day: { "*": { prefix: "en" }, empty: { text: "todos los días" }, value: { text: "los días {{ value.alt }}" } }, dayOfWeek: { "*": { prefix: "de" }, empty: { text: "todos los días de la semana" }, value: { text: "los {{ value.alt }}" }, range: { text: "{{ start.alt }}-{{ end.alt }}" } }, hour: { "*": { prefix: "a" }, empty: { text: "todas las horas" }, value: { text: "las {{ value.text }}" } }, minute: { "*": { prefix: ":" }, empty: { text: "todos los minutos" } } }, minute: { prefix: "todos los", text: "minutos" }, hour: { prefix: "todas las", text: "horas", minute: { "*": { prefix: "a los", suffix: "minutos" }, empty: { text: "todos", prefix: "a", suffix: "los minutos" } } }, day: { text: "Días" }, week: { text: "Semanas" }, month: { text: "Meses", dayOfWeek: { "*": { prefix: "y" } } }, year: { text: "años", dayOfWeek: { "*": { prefix: "y" } } } }, nt = { "*": { prefix: "Toutes", suffix: "", text: "Inconnu", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "tous les {{every.value}}" } }, month: { "*": { prefix: "en" }, empty: { prefix: "en", text: "tous les mois" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "le" }, empty: { prefix: "à", text: "tous les jours" }, everyX: { prefix: "", text: "tous les {{every.value}} jours" }, noSpecific: { prefix: "à", text: "aucun jour particulier" } }, dayOfWeek: { "*": { prefix: "le" }, empty: { prefix: "à", text: "tous les jours de la semaine" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { prefix: "et", text: "aucun jour de la semaine particulier" } }, hour: { "*": { prefix: "à" }, empty: { prefix: "à", text: "toutes les heures" }, everyX: { prefix: "", text: "toutes les {{every.value}} heures" } }, minute: { "*": { prefix: ":" }, empty: { text: "toutes les minutes" }, everyX: { prefix: "", text: "toutes les {{every.value}} minutes" } }, second: { "*": { prefix: ":" }, empty: { text: "toutes les secondes" }, everyX: { prefix: "", text: "toutes les {{every.value}} secondes" } } }, minute: { text: "Minute" }, hour: { text: "Heure", minute: { "*": { prefix: "à", suffix: "minute(s)" }, empty: { text: "toutes" } } }, day: { prefix: "Tous", text: "Jour" }, week: { text: "Semaine" }, month: { prefix: "Tous", text: "Mois" }, year: { prefix: "Tous", text: "Année" }, //quartz format "q-second": { text: "Seconde" }, "q-minute": { text: "Minute", second: { "*": { prefix: "et" } } }, "q-hour": { text: "Heure", minute: { "*": { prefix: "et" } }, second: { "*": { prefix: "et" } } } }, it = { "*": { prefix: "בכל", suffix: "", text: "לא ידוע", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "כל {{every.value}}" } }, month: { "*": { prefix: "ב" }, empty: { text: "כל חודש" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "ב" }, empty: { text: "כל יום" }, value: { text: "יום {{value.alt}} לחודש" }, noSpecific: { text: "ללא יום מוגדר" } }, dayOfWeek: { "*": { prefix: "ב" }, empty: { text: "כל יום מימות השבוע" }, value: { text: "ימי {{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { text: "ללא יום בשבוע מוגדר" } }, hour: { "*": { prefix: "ב" }, empty: { text: "כל שעה" }, value: { text: "שעה {{value.text}}" } }, minute: { "*": { prefix: ":" }, empty: { text: "כל דקה" } }, second: { "*": { prefix: ":" }, empty: { text: "כל שניה" } } }, minute: { text: "דקה" }, hour: { text: "שעה", minute: { "*": { prefix: "ב", suffix: "דקות" }, empty: { text: "כל" } } }, day: { text: "יום" }, week: { text: "שבוע" }, month: { text: "חודש", dayOfWeek: { "*": { prefix: "ו" } } }, year: { text: "שנה", dayOfWeek: { "*": { prefix: "ו" } } }, //quartz format "q-second": { text: "שניה" }, "q-minute": { text: "דקה", second: { "*": { prefix: "ב", suffix: "שניות" }, empty: { text: "כל" } } }, "q-hour": { text: "שעה", minute: { "*": { prefix: "ב" } } } }, at = { "*": { prefix: "हर", suffix: "", text: "अज्ञात", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "{{every.value}} हर" } }, month: { "*": { prefix: "में" }, empty: { prefix: "के", text: "हर महीने" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "के" }, empty: { prefix: "पर", text: "हर दिन" }, everyX: { prefix: "", text: "{{every.value}} दिन हर" }, noSpecific: { prefix: "पर", text: "कोई विशेष दिन नहीं" } }, dayOfWeek: { "*": { prefix: "पर" }, empty: { prefix: "पर", text: "हर सप्ताह" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { prefix: "और", text: "कोई विशेष सप्ताह नहीं" } }, hour: { "*": { prefix: "को" }, empty: { prefix: "पर", text: "हर घंटे" }, everyX: { prefix: "", text: "{{every.value}} घंटे हर" } }, minute: { "*": { prefix: ":" }, empty: { text: "हर मिनट" }, everyX: { prefix: "", text: "{{every.value}} मिनट हर" } }, second: { "*": { prefix: ":" }, empty: { text: "हर सेकंड" }, everyX: { prefix: "", text: "{{every.value}} सेकंड हर" } } }, minute: { text: "मिनट" }, hour: { text: "घंटा", minute: { "*": { prefix: "पर", suffix: "मिनट" }, empty: { text: "हर" } } }, day: { prefix: "हर", text: "दिन" }, week: { text: "सप्ताह" }, month: { prefix: "हर", text: "महीना" }, year: { prefix: "हर", text: "साल" }, //quartz format "q-second": { text: "सेकंड" }, "q-minute": { text: "मिनट", second: { "*": { prefix: "और" } } }, "q-hour": { text: "घंटा", minute: { "*": { prefix: "और" } }, second: { "*": { prefix: "और" } } } }, st = { "*": { prefix: "毎", suffix: "", text: "不明", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "{{every.value}}ごとに" } }, month: { "*": { prefix: "に" }, empty: { prefix: "の", text: "毎月" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "の" }, empty: { prefix: "に", text: "毎日" }, everyX: { prefix: "", text: "{{every.value}}日ごとに" }, noSpecific: { prefix: "に", text: "特定の日はなし" } }, dayOfWeek: { "*": { prefix: "の" }, empty: { prefix: "に", text: "毎週" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { prefix: "と", text: "特定の曜日はなし" } }, hour: { "*": { prefix: "の" }, empty: { prefix: "に", text: "毎時" }, everyX: { prefix: "", text: "{{every.value}}時間ごとに" } }, minute: { "*": { prefix: ":" }, empty: { text: "毎分" }, everyX: { prefix: "", text: "{{every.value}}分ごとに" } }, second: { "*": { prefix: ":" }, empty: { text: "毎秒" }, everyX: { prefix: "", text: "{{every.value}}秒ごとに" } } }, minute: { text: "分" }, hour: { text: "時", minute: { "*": { prefix: "に", suffix: "分" }, empty: { text: "毎" } } }, day: { prefix: "毎", text: "日" }, week: { text: "週" }, month: { prefix: "毎", text: "月" }, year: { prefix: "毎", text: "年" }, //quartz format "q-second": { text: "秒" }, "q-minute": { text: "分", second: { "*": { prefix: "と" } } }, "q-hour": { text: "時", minute: { "*": { prefix: "と" } }, second: { "*": { prefix: "と" } } } }, ot = { "*": { prefix: "매", suffix: "", text: "알 수 없음", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "{{every.value}}마다" } }, month: { "*": { prefix: "에" }, empty: { prefix: "의", text: "매월" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "의" }, empty: { prefix: "에", text: "매일" }, everyX: { prefix: "", text: "{{every.value}}일마다" }, noSpecific: { prefix: "에", text: "특정한 날 없음" } }, dayOfWeek: { "*": { prefix: "의" }, empty: { prefix: "에", text: "매주" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { prefix: "과", text: "특정한 요일 없음" } }, hour: { "*": { prefix: "의" }, empty: { prefix: "에", text: "매시" }, everyX: { prefix: "", text: "{{every.value}}시간마다" } }, minute: { "*": { prefix: ":" }, empty: { text: "매분" }, everyX: { prefix: "", text: "{{every.value}}분마다" } }, second: { "*": { prefix: ":" }, empty: { text: "매초" }, everyX: { prefix: "", text: "{{every.value}}초마다" } } }, minute: { text: "분" }, hour: { text: "시", minute: { "*": { prefix: "에", suffix: "분" }, empty: { text: "매" } } }, day: { prefix: "매", text: "일" }, week: { text: "주" }, month: { prefix: "매", text: "월" }, year: { prefix: "매", text: "년" }, //quartz format "q-second": { text: "초" }, "q-minute": { text: "분", second: { "*": { prefix: "와" } } }, "q-hour": { text: "시", minute: { "*": { prefix: "와" } }, second: { "*": { prefix: "와" } } } }, lt = { "*": { prefix: "Todo(a)", suffix: "", text: "Desconhecido", "*": { empty: { text: "todo {{field.id}}" }, value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "todo {{every.value}}" } }, month: { "*": { prefix: "de" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, empty: { text: "todo mês" } }, day: { "*": { prefix: "no(s) dia(s)" }, empty: { text: "todos" } }, dayOfWeek: { "*": { prefix: "de" }, empty: { text: "todos dias da semana" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, hour: { "*": { prefix: "às" }, empty: { text: "cada hora" } }, minute: { "*": { prefix: ":" }, empty: { text: "cada minuto" } } }, minute: { text: "Minuto" }, hour: { text: "Hora", minute: { "*": { prefix: "e", suffix: "minuto(s)" }, empty: { text: "cada" } } }, day: { text: "Dia" }, week: { text: "Semana" }, month: { text: "Mês", dayOfWeek: { "*": { prefix: "e de" } } }, year: { text: "Ano", dayOfWeek: { "*": { prefix: "e de" } } } }, ut = { "*": { prefix: "Каждый", suffix: "", text: "Неизвестно", "*": { value: { text: "{{value.text}}" }, range: { text: "{{start.text}}-{{end.text}}" }, everyX: { text: "каждый {{every.value}}" } }, month: { "*": { prefix: "в" }, empty: { prefix: "в", text: "каждом месяце" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" } }, day: { "*": { prefix: "в" }, empty: { prefix: "в", text: "каждый день" }, everyX: { prefix: "", text: "каждые {{every.value}} дня" }, noSpecific: { prefix: "в", text: "нет определенного дня" } }, dayOfWeek: { "*": { prefix: "по" }, empty: { prefix: "по", text: "каждому дню недели" }, value: { text: "{{value.alt}}" }, range: { text: "{{start.alt}}-{{end.alt}}" }, noSpecific: { prefix: "и", text: "нет определенного дня недели" } }, hour: { "*": { prefix: "в" }, empty: { prefix: "в", text: "каждый час" }, everyX: { prefix: "", text: "каждые {{every.value}} часа" } }, minute: { "*": { prefix: ":" }, empty: { text: "каждую минуту" }, everyX: { prefix: "", text: "каждые {{every.value}} минуты" } }, second: { "*": { prefix: ":" }, empty: { text: "каждую секунду" }, everyX: { prefix: "", text: "каждые {{every.value}} секунды" } } }, minute: { text: "Минута" }, hour: { text: "Час", minute: { "*": { prefix: "в", suffix: "минут(а/ы)" }, empty: { text: "каждый" } } }, day: { prefix: "Каждый", text: "День" }, week: { text: "Неделя" }, month: { prefix: "Каждый", text: "Месяц" }, year: { prefix: "Каждый", text: "Год" }, //quartz format "q-second": { text: "Секунда" }, "q-minute": { text: "Минута", second: { "*": { prefix: "и" } } }, "q-hour": { text: "Час", minute: { "*": { prefix: "и" } }, second: { "*": { prefix: "и" } } } }, ee = { empty: {}, en: tt, de: et, pt: lt, es: rt, da: Ze, zh: pe, "zh-cn": pe, he: it, ru: ut, fr: nt, hi: at, ja: st, ko: ot }; class xt { constructor(t) { d(this, "dict"), this.dict = t; } getLocaleStr(...t) { const r = t.map((i) => [i, "*"]); return ce(this.dict, ...r) || ""; } render(t, r, i, n, a) { const o = this.getLocaleStr(t, r, i, n); return W.render(o, a || {}); } } function ft(e, t) { const [r] = e.split("-"), i = ee[e.toLowerCase()] || ee[r.toLowerCase()] || ee.en, n = re(i, t || {}); return new xt(n); } function pt(e) { const { period: t, field: r, initialCron: i = "*", locale: n } = e, a = S(i), o = S(""), s = S([]), l = S(""), f = S(""), v = S(""), h = (u) => { const c = u instanceof ie ? u.segments : [u]; l.value = c.map((x) => n.render(t.value.id, r.id, x.type, $.Text, { field: r, ...x.items })).join(","), f.value = n.getLocaleStr(t.value.id, r.id, u.type, $.Prefix), v.value = n.getLocaleStr(t.value.id, r.id, u.type, $.Suffix); }, y = (u) => { const c = ue(u, r); c != null ? (s.value = c.toArray(), h(c)) : o.value = `${u} is not a valid cron segment (${r.id})`; }, X = (u) => { if (a.value == "?" && u.length == 0) return; const c = Ie(u, r); c != null ? (a.value = c.toCron(), h(c)) : o.value = `failed to convert ${u} to cron (${r.id})`; }; y(i); const q = (u) => { const c = Array.from(u).sort((x, m) => x > m ? 1 : -1); s.value = c; }; return g(a, (u) => { y(u); }), g(s, (u) => { X(u); }), g(t, () => { const u = ue(a.value, r); u != null && h(u); }), { id: r.id, items: r.items, cron: a, selected: s, error: o, select: q, text: l, prefix: f, suffix: v }; } function ye(e, t = "*") { return new Array(e).fill(t).join(" "); } function dt(e) { return e !== void 0; } class ct { constructor() { d(this, "locale", "en"), d(this, "format", "crontab"); } initialValue(t, r = "*") { return ye(t, r); } fields(t, r) { const i = t == "quartz" || t == "spring", n = Me(r, t), a = (o) => (s, { segmentMap: l }) => { if (s.cron.value == "?") return; const f = l.get(o); f && (f.cron.value = "?"); }; return [ ...i ? [{ id: "second", items: n.secondItems }] : [], { id: "minute", items: n.minuteItems }, { id: "hour", items: n.hourItems }, { id: "day", items: n.dayItems, onChange: i ? a("dayOfWeek") : void 0, segmentFactories: i ? [ j.fromString, J.fromString, Y.fromString, _.fromString, U.fromString ] : void 0 }, { id: "month", items: n.monthItems }, { id: "dayOfWeek", items: n.dayOfWeekItems, onChange: i ? a("day") : void 0, segmentFactories: i ? [ j.fromString, J.fromString, Y.fromString, _.fromString, U.fromString ] : void 0 } ]; } periods(t) { const r = t == "quartz" || t == "spring", i = r ? [{ id: "q-second", value: [] }] : [], n = r ? ["second"] : [], a = r ? "q-" : ""; return [ ...i, { id: a + "minute", value: [...n] }, { id: a + "hour", value: ["minute", ...n] }, { id: "day", value: ["hour", "minute", ...n] }, { id: "week", value: ["dayOfWeek", "hour", "minute", ...n] }, { id: "month", value: ["day", "dayOfWeek", "hour", "minute", ...n] }, { id: "year", value: ["month", "day", "dayOfWeek", "hour", "minute", ...n] } ]; } } function mt(e, t, r) { const i = t.split(" "); if (i.length !== r.length) return; const n = r.filter((a, o) => !["*", "?"].includes(i[o])).map((a) => a.id); return e.find((a) => { const o = new Set(a.value); return n.every((s) => o.has(s)); }); } function vt(e) { const t = new ct(), r = e.locale ?? t.locale, i = e.format ?? t.format, { customLocale: n, fields: a = t.fields(i, r) } = e, o = e.initialValue ?? t.initialValue(a.length), s = ft(r, n), l = (e.periods ?? t.periods(i)).map((p) => ({ ...p, text: p.text ?? s.getLocaleStr(p.id, $.Text) })), f = (e.initialPeriod ? l.find((p) => p.id == e.initialPeriod) : void 0) ?? mt([...l].reverse(), o, a) ?? l[l.length - 1], v = S(o), h = S(""), y = S(f), X = S(""), q = S(""), u = a.map((p) => pt({ field: new qe(p), locale: s, period: y })), c = new Map(u.map((p) => [p.id, p])), x = de(() => y.value.value.map((p) => { const k = c.get(p); if (dt(k)) return k; throw Error("${fieldId} not found"); })), m = (p) => { if (!p) { v.value = ye(a.length); return; } const k = p.split(" "); if (k.length !== a.length) { h.value = "invalid pattern"; return; } for (let w = 0; w < k.length; w++) u[w].cron.value != k[w] && (u[w].cron.value = k[w]); h.value = ""; }; m(o); const b = () => { v.value = u.map((p) => y.value.value.includes(p.id) || p.cron.value == "?" ? p.cron.value : "*").join(" "); }, M = () => { X.value = s.getLocaleStr(y.value.id, $.Prefix), q.value = s.getLocaleStr(y.value.id, $.Suffix); }; return M(), g(v, m), g(y, () => { b(), M(); }), u.forEach((p, k) => { g(p.cron, () => { var w, A; (A = (w = a[k]).onChange) == null || A.call(w, p, { segmentMap: c }), b(); }), g(p.error, (w) => { h.value = w; }); }), { cron: v, error: h, segments: u, selected: x, period: { select: (p) => { const k = l.map((w) => w.id).indexOf(p); k != -1 && (y.value = l[k]); }, selected: y, items: l, prefix: X, suffix: q } }; } function ge(e, { emit: t }) { const r = { ...e, initialValue: e.modelValue, initialPeriod: e.period }, i = vt(r); return g( () => e.modelValue, (n) => { n && (i.cron.value = n); } ), g( () => e.period, (n) => { n && i.period.select(n); } ), g(i.cron, (n) => { t("update:model-value", n); }), g(i.period.selected, (n) => { t("update:period", n.id); }), g(i.error, (n) => { t("error", n); }), i; } const ke = () => ({ /** * The value of the cron expression * * @defaultValue crontab: `* * * * *`, quartz: `* * * * * *` */ modelValue: { type: String }, /** * The id of a period to select * * @defaultValue last entry of `CronCoreProps.periods` */ period: { type: String }, /** * The format of the cron expression, either crontab or quartz * * @defaultValue `crontab` */ format: { type: String }, /** * The locale of the component, such as `en`, `de`, etc. * * @defaultValue `en` */ locale: { type: String }, /** The segments of the cron expression, such as second, minute, hour, etc. */ fields: { type: Array }, /** The periods to select, e.g. Every month, day, etc. */ periods: { type: Array }, /** The custom locale object, used to override values of the current {@link Localization} */ customLocale: { type: Object }, /** Number of columns in the dropdown, * e.g. the possible values of minute (0-59) will be displayed in a grid with 5 columns * * @defaultValue * ``` * { * second: 5, * minute: 5, * hour: 4, * day: 4, * } * ``` */ cols: { type: Object, default: () => ({ second: 5, minute: 5, hour: 4, day: 4 }) }, /** Disable the cron editor */ disabled: { type: Boolean, default: !1 } }); G({ name: "VueCronCore", props: ke(), emits: ["update:model-value", "update:period", "error"], setup(e, t) { const { error: r, selected: i, period: n } = ge(e, t); return () => { var a, o; const s = { error: r, fields: i.value.map((l) => ({ id: l.id, items: l.items, cron: l.cron.value, selectedStr: l.text.value, events: { "update:model-value": l.select }, attrs: { modelValue: l.selected.value }, prefix: l.prefix.value, suffix: l.suffix.value })), period: { attrs: { modelValue: n.selected.value.id }, events: { "update:model-value": n.select }, items: n.items, prefix: n.prefix.value, suffix: n.suffix.value } }; return (o = (a = t.slots).default) == null ? void 0 : o.call(a, s); }; } }); function ht(e) { const { items: t } = e, r = /* @__PURE__ */ new Set(), i = S(0), n = () => { i.value = i.value + 1; }, a = (l) => { t.indexOf(l) != -1 && (r.add(l), n()); }, o = (l) => r.has(l), s = (l) => { r.delete(l) && n(); }; return { values: r, add: a, toggle: (l) => { o(l) ? s(l) : a(l); }, remove: s, clear: () => { r.clear(), n(); }, updated: i, equals: (l) => { if (l.length != r.size) return !1; for (const f of l) if (!r.has(f)) return !1; return !0; } }; } function Se() { return { modelValue: { type: [String, Number, Array] }, selection: { type: String }, clearable: { type: Boolean, default: !1 }, items: { type: Array, default: () => [] }, multiple: { type: Boolean, default: !1 }, cols: { type: Number, default: 1 }, itemText: { type: [String, Function], default: "text" }, itemValue: { type: [String, Function], default: "value" }, disabled: { type: Boolean,