@signal24/vue-foundation 4.3.2 → 4.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- var De = Object.defineProperty;
2
- var Ae = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var p = (e, t, n) => (Ae(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { defineComponent as I, defineProps as $e, defineEmits as Ve, ref as $, computed as V, openBlock as c, createElementBlock as d, createElementVNode as g, toDisplayString as k, withDirectives as B, createCommentVNode as y, Fragment as F, renderList as q, vModelSelect as Be, reactive as Fe, h as me, markRaw as _e, getCurrentInstance as ve, onMounted as z, onBeforeUnmount as X, createBlock as Y, Teleport as Ne, normalizeClass as T, withModifiers as Ke, renderSlot as R, resolveDirective as ge, createSlots as Re, withCtx as U, createTextVNode as te, vModelText as Ue, watch as ne, onActivated as ye, onDeactivated as Ee } from "vue";
5
- import { debounce as je, isEqual as Te, upperFirst as Pe, startCase as We, cloneDeep as qe, remove as ze } from "lodash";
6
- import { escapeHtml as Xe } from "@vue/shared";
1
+ var $e = Object.defineProperty;
2
+ var Ae = (e, t, n) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var m = (e, t, n) => (Ae(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { defineComponent as D, defineProps as Ve, defineEmits as Be, ref as I, computed as B, openBlock as c, createElementBlock as u, createElementVNode as y, toDisplayString as M, withDirectives as F, createCommentVNode as T, Fragment as _, renderList as z, vModelSelect as Fe, reactive as _e, h as ve, markRaw as Ne, getCurrentInstance as ge, onMounted as X, onBeforeUnmount as Y, createBlock as Z, Teleport as Ke, normalizeClass as b, withModifiers as Re, renderSlot as U, resolveDirective as ye, createSlots as Ue, withCtx as j, createTextVNode as ne, vModelText as je, watch as ie, onActivated as Ee, onDeactivated as Te } from "vue";
5
+ import { debounce as Pe, isEqual as Oe, upperFirst as We, startCase as qe, cloneDeep as ze, remove as Xe } from "lodash";
6
+ import { escapeHtml as Ye } from "@vue/shared";
7
7
  import { escapeHtml as Un } from "@vue/shared";
8
- import { format as P } from "date-fns";
9
- const Ye = I({
8
+ import { format as W } from "date-fns";
9
+ const Ze = D({
10
10
  setup() {
11
- const e = $e();
12
- Ve(["update:modelValue"]);
13
- const t = $(null), n = V(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = $(e.modelValue ?? null);
11
+ const e = Ve();
12
+ Be(["update:modelValue"]);
13
+ const t = I(null), n = B(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = I(e.modelValue ?? null);
14
14
  return { props: e, options: t, renderOptions: n, selectedItem: i };
15
15
  },
16
16
  watch: {
@@ -32,148 +32,188 @@ const Ye = I({
32
32
  this.options = await this.props.loadFn();
33
33
  }
34
34
  }
35
- }), Oe = (e, t) => {
35
+ }), be = (e, t) => {
36
36
  const n = e.__vccOpts || e;
37
37
  for (const [i, s] of t)
38
38
  n[i] = s;
39
39
  return n;
40
- }, Ze = {
40
+ }, Ge = {
41
41
  key: 0,
42
42
  disabled: ""
43
- }, Ge = {
43
+ }, Qe = {
44
44
  key: 0,
45
45
  value: null
46
- }, Qe = ["value"];
47
- function Je(e, t, n, i, s, o) {
48
- return e.renderOptions ? B((c(), d("select", {
46
+ }, Je = ["value"];
47
+ function et(e, t, n, i, s, o) {
48
+ return e.renderOptions ? F((c(), u("select", {
49
49
  key: 1,
50
50
  "onUpdate:modelValue": t[0] || (t[0] = (r) => e.selectedItem = r)
51
51
  }, [
52
- e.props.nullText ? (c(), d("option", Ge, k(e.props.nullText), 1)) : y("", !0),
53
- (c(!0), d(F, null, q(e.renderOptions, (r, l) => {
52
+ e.props.nullText ? (c(), u("option", Qe, M(e.props.nullText), 1)) : T("", !0),
53
+ (c(!0), u(_, null, z(e.renderOptions, (r, l) => {
54
54
  var a;
55
- return c(), d("option", {
55
+ return c(), u("option", {
56
56
  key: l,
57
57
  value: (a = e.options) == null ? void 0 : a[l]
58
- }, k(r), 9, Qe);
58
+ }, M(r), 9, Je);
59
59
  }), 128))
60
60
  ], 512)), [
61
- [Be, e.selectedItem]
62
- ]) : (c(), d("select", Ze, [
63
- g("option", null, k(e.props.loadingText || "Loading..."), 1)
61
+ [Fe, e.selectedItem]
62
+ ]) : (c(), u("select", Ge, [
63
+ y("option", null, M(e.props.loadingText || "Loading..."), 1)
64
64
  ]));
65
65
  }
66
- const mn = /* @__PURE__ */ Oe(Ye, [["render", Je]]);
67
- let et = 0;
68
- const E = Fe([]), vn = I({
66
+ const vn = /* @__PURE__ */ be(Ze, [["render", et]]);
67
+ let tt = 0;
68
+ const O = _e([]), gn = D({
69
69
  setup() {
70
- return () => me("div", { id: "modal-container" }, [
71
- q(E, (e) => e.vnode)
70
+ return () => ve("div", { id: "modal-container" }, [
71
+ z(O, (e) => e.vnode)
72
72
  ]);
73
73
  }
74
74
  });
75
- function be(e, t) {
75
+ function we(e, t) {
76
76
  const n = document.getElementById("vf-modal-target") ?? document.createElement("div");
77
77
  n.id = "vf-modal-target", n.removeAttribute("inert"), document.body.appendChild(n);
78
- const i = _e(e), s = {
79
- id: String(++et),
78
+ const i = Ne(e), s = {
79
+ id: String(++tt),
80
80
  component: i,
81
81
  props: t,
82
- vnode: me(i, t)
82
+ vnode: ve(i, t)
83
83
  };
84
- return E.push(s), s;
84
+ return O.push(s), s;
85
85
  }
86
- function we(e) {
87
- const t = E.indexOf(e);
88
- t >= 0 && E.splice(t, 1);
86
+ function Se(e) {
87
+ const t = O.indexOf(e);
88
+ t >= 0 && O.splice(t, 1);
89
89
  }
90
- function gn(e) {
91
- Se(e.$);
90
+ function yn(e) {
91
+ ke(e.$);
92
92
  }
93
- function Se(e) {
93
+ function ke(e) {
94
94
  let t = e;
95
- for (; t && !tt(t.vnode); )
95
+ for (; t && !nt(t.vnode); )
96
96
  t = t.parent;
97
97
  }
98
- function tt(e) {
98
+ function nt(e) {
99
99
  var n, i;
100
- const t = E.findIndex((s) => s.vnode.component === e.component);
101
- return t >= 0 ? ((i = (n = E[t].props).callback) == null || i.call(n, void 0), E.splice(t, 1), !0) : !1;
100
+ const t = O.findIndex((s) => s.vnode.component === e.component);
101
+ return t >= 0 ? ((i = (n = O[t].props).callback) == null || i.call(n, void 0), O.splice(t, 1), !0) : !1;
102
102
  }
103
- async function Z(e, t) {
103
+ async function G(e, t) {
104
104
  return new Promise((n) => {
105
105
  let i = null;
106
106
  const o = { ...t, callback: (r) => {
107
- we(i), n(r);
107
+ Se(i), n(r);
108
108
  } };
109
- i = be(e, o);
109
+ i = we(e, o);
110
110
  });
111
111
  }
112
- function _(e, t) {
112
+ function N(e, t) {
113
113
  return { title: t ? e : void 0, message: t ?? e };
114
114
  }
115
- async function ie(e, t) {
116
- await Z(K, _(e, t));
115
+ async function se(e, t) {
116
+ await G(R, N(e, t));
117
117
  }
118
- async function yn(e, t) {
119
- return await Z(K, {
120
- ..._(e, t),
118
+ async function En(e, t) {
119
+ return await G(R, {
120
+ ...N(e, t),
121
121
  shouldConfirm: !0
122
122
  }) === !0;
123
123
  }
124
- async function En(e, t) {
125
- return await Z(K, {
126
- ..._(e, t),
124
+ async function Tn(e, t) {
125
+ return await G(R, {
126
+ ...N(e, t),
127
127
  shouldConfirm: !0,
128
128
  classes: ["destructive"]
129
129
  }) === !0;
130
130
  }
131
- function Tn(e, t) {
132
- const n = be(K, {
133
- ..._(e, t),
131
+ function On(e, t) {
132
+ const n = we(R, {
133
+ ...N(e, t),
134
134
  callback: () => {
135
135
  }
136
136
  });
137
- return () => we(n);
137
+ return () => Se(n);
138
138
  }
139
- const H = {
139
+ const $ = {
140
140
  unhandledErrorSupportText: "please contact support",
141
141
  errorHandler: (e) => console.error("Unhandled error:", e),
142
142
  defaultDateTimeFormat: "MM/dd/yy HH:mm"
143
143
  };
144
- function On(e) {
145
- Object.assign(H, e);
144
+ function bn(e) {
145
+ Object.assign($, e);
146
146
  }
147
- class N extends Error {
147
+ class K extends Error {
148
148
  constructor(t) {
149
149
  super(t), this.name = "UserError";
150
150
  }
151
151
  }
152
- function nt(e) {
153
- return e instanceof N ? e.message : `An application error has occurred:
152
+ function it(e) {
153
+ return e instanceof K ? e.message : `An application error has occurred:
154
154
 
155
- ${G(e).message}
155
+ ${Q(e).message}
156
156
 
157
- Please refresh the page and try again. If this error persists, ${H.unhandledErrorSupportText}.`;
157
+ Please refresh the page and try again. If this error persists, ${$.unhandledErrorSupportText}.`;
158
158
  }
159
- function G(e) {
159
+ function Q(e) {
160
160
  return e instanceof Error ? e : new Error(String(e));
161
161
  }
162
- async function bn(e, t) {
163
- const n = G(e);
164
- return n instanceof N || H.errorHandler(n), t ? ie(t, n) : ie(n);
162
+ async function wn(e, t) {
163
+ const n = Q(e);
164
+ return n instanceof K || $.errorHandler(n), t ? se(t, n) : se(n);
165
+ }
166
+ async function Sn(e) {
167
+ const t = Q(e);
168
+ t instanceof K || $.errorHandler(t);
169
+ }
170
+ const x = Symbol("MaskState");
171
+ function kn(e, t) {
172
+ const n = e.$.vnode.el, i = n.closest(".vf-modal");
173
+ return st(i ?? n, t);
174
+ }
175
+ function Mn(e) {
176
+ const t = e.$.vnode.el, n = t.closest(".vf-modal");
177
+ return Me(n ?? t);
165
178
  }
166
- async function wn(e) {
167
- const t = G(e);
168
- t instanceof N || H.errorHandler(t);
179
+ function st(e, t) {
180
+ if (!e[x]) {
181
+ const n = document.createElement("div");
182
+ n.classList.add("vf-mask"), e.appendChild(n), e[x] = { maskEl: n };
183
+ }
184
+ return e[x].maskEl.innerText = t ?? "", () => Me(e);
185
+ }
186
+ function Me(e) {
187
+ e[x] && e.removeChild(e[x].maskEl);
188
+ }
189
+ const q = Symbol("FormMaskState");
190
+ function ot(e, t, n) {
191
+ const i = e instanceof Element ? e : Le(e);
192
+ i.classList.add("vf-masked");
193
+ const s = t instanceof Element ? t : i.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
194
+ s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
195
+ const l = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
196
+ return l.forEach((a) => a.setAttribute("disabled", "disabled")), i[q] = {
197
+ disabledElements: l,
198
+ waitButton: s,
199
+ buttonHtml: o
200
+ }, () => xe(i);
201
+ }
202
+ function xe(e) {
203
+ const t = e instanceof Element ? e : Le(e), n = t[q];
204
+ n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled"), delete t[q]);
169
205
  }
170
- const it = ["id"], st = {
206
+ function Le(e) {
207
+ const t = e.$.vnode.el;
208
+ return t.tagName === "FORM" ? t : t.querySelector("form");
209
+ }
210
+ const lt = ["id"], rt = {
171
211
  key: 0,
172
212
  class: "vf-modal-header"
173
- }, ot = { class: "vf-modal-content" }, lt = {
213
+ }, at = { class: "vf-modal-content" }, ct = {
174
214
  key: 1,
175
215
  class: "vf-modal-footer"
176
- }, rt = /* @__PURE__ */ I({
216
+ }, dt = /* @__PURE__ */ D({
177
217
  __name: "modal",
178
218
  props: {
179
219
  id: {},
@@ -183,58 +223,68 @@ const it = ["id"], st = {
183
223
  class: {}
184
224
  },
185
225
  emits: ["formSubmit"],
186
- setup(e) {
187
- const t = e, n = ve(), i = $();
188
- z(() => {
189
- var l;
190
- document.body.classList.add("vf-modal-open"), t.closeOnMaskClick && (window.addEventListener("keydown", o), (l = i.value) == null || l.addEventListener("click", s));
191
- }), X(() => {
192
- window.removeEventListener("keydown", o), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
226
+ setup(e, { expose: t }) {
227
+ const n = e, i = ge();
228
+ t({ mask: v, unmask: h });
229
+ const s = I(), o = I();
230
+ X(() => {
231
+ var d;
232
+ document.body.classList.add("vf-modal-open"), n.closeOnMaskClick && (window.addEventListener("keydown", l), (d = s.value) == null || d.addEventListener("click", r));
233
+ }), Y(() => {
234
+ window.removeEventListener("keydown", l), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
193
235
  });
194
- function s(l) {
195
- l.target == i.value && r();
236
+ function r(d) {
237
+ d.target == s.value && a();
196
238
  }
197
- function o(l) {
198
- if (l.key === "Esc" || l.key === "Escape") {
199
- const a = document.querySelectorAll(".vf-modal-wrap");
200
- a[a.length - 1] === i.value && r();
239
+ function l(d) {
240
+ if (d.key === "Esc" || d.key === "Escape") {
241
+ const E = document.querySelectorAll(".vf-modal-wrap");
242
+ E[E.length - 1] === s.value && a();
201
243
  }
202
244
  }
203
- function r() {
204
- Se(n);
245
+ function a() {
246
+ ke(i);
247
+ }
248
+ function v() {
249
+ ot(o.value);
205
250
  }
206
- return (l, a) => (c(), Y(Ne, { to: "#vf-modal-target" }, [
207
- g("div", {
208
- id: l.id,
209
- class: T(["vf-overlay vf-modal-wrap", t.class]),
251
+ function h() {
252
+ xe(o.value);
253
+ }
254
+ return (d, E) => (c(), Z(Ke, { to: "#vf-modal-target" }, [
255
+ y("div", {
256
+ id: d.id,
257
+ class: b(["vf-overlay vf-modal-wrap", n.class]),
210
258
  ref_key: "overlay",
211
- ref: i
259
+ ref: s
212
260
  }, [
213
- g("form", {
261
+ y("form", {
214
262
  action: ".",
215
- class: T(["vf-modal", { scrolls: l.scrolls }]),
216
- onSubmit: a[0] || (a[0] = Ke((m) => l.$emit("formSubmit"), ["prevent"]))
263
+ class: b(["vf-modal", { scrolls: d.scrolls }]),
264
+ onSubmit: E[0] || (E[0] = Re((f) => d.$emit("formSubmit"), ["prevent"])),
265
+ ref_key: "form",
266
+ ref: o
217
267
  }, [
218
- l.$slots.header ? (c(), d("div", st, [
219
- R(l.$slots, "header"),
220
- t.closeX ? (c(), d("i", {
268
+ d.$slots.header ? (c(), u("div", rt, [
269
+ U(d.$slots, "header"),
270
+ n.closeX ? (c(), u("i", {
221
271
  key: 0,
222
272
  class: "close",
223
- onClick: r
224
- })) : y("", !0)
225
- ])) : y("", !0),
226
- g("div", ot, [
227
- R(l.$slots, "default")
273
+ onClick: a
274
+ })) : T("", !0)
275
+ ])) : T("", !0),
276
+ y("div", at, [
277
+ U(d.$slots, "default")
228
278
  ]),
229
- l.$slots.footer ? (c(), d("div", lt, [
230
- R(l.$slots, "footer")
231
- ])) : y("", !0)
279
+ d.$slots.footer ? (c(), u("div", ct, [
280
+ U(d.$slots, "footer")
281
+ ])) : T("", !0)
232
282
  ], 34)
233
- ], 10, it)
283
+ ], 10, lt)
234
284
  ]));
235
285
  }
236
286
  });
237
- const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
287
+ const ut = ["innerHtml"], ht = ["innerText"], R = /* @__PURE__ */ D({
238
288
  __name: "alert-modal",
239
289
  props: {
240
290
  isBare: { type: Boolean },
@@ -246,53 +296,53 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
246
296
  callback: { type: Function }
247
297
  },
248
298
  setup(e) {
249
- const t = e, n = V(() => t.message instanceof Error ? nt(t.message) : t.message);
299
+ const t = e, n = B(() => t.message instanceof Error ? it(t.message) : t.message);
250
300
  return (i, s) => {
251
- const o = ge("autofocus");
252
- return c(), Y(rt, {
253
- class: T(["vf-alert", i.classes])
254
- }, Re({
255
- default: U(() => [
256
- i.isHtml ? (c(), d("div", {
301
+ const o = ye("autofocus");
302
+ return c(), Z(dt, {
303
+ class: b(["vf-alert", i.classes])
304
+ }, Ue({
305
+ default: j(() => [
306
+ i.isHtml ? (c(), u("div", {
257
307
  key: 0,
258
308
  innerHtml: i.message,
259
309
  class: "user-message"
260
- }, null, 8, at)) : (c(), d("div", {
310
+ }, null, 8, ut)) : (c(), u("div", {
261
311
  key: 1,
262
312
  innerText: n.value
263
- }, null, 8, ct))
313
+ }, null, 8, ht))
264
314
  ]),
265
315
  _: 2
266
316
  }, [
267
317
  !i.isBare && i.title ? {
268
318
  name: "header",
269
- fn: U(() => [
270
- g("h1", null, k(i.title), 1)
319
+ fn: j(() => [
320
+ y("h1", null, M(i.title), 1)
271
321
  ]),
272
322
  key: "0"
273
323
  } : void 0,
274
324
  i.isBare ? void 0 : {
275
325
  name: "footer",
276
- fn: U(() => [
277
- i.shouldConfirm ? (c(), d(F, { key: 0 }, [
278
- B((c(), d("button", {
326
+ fn: j(() => [
327
+ i.shouldConfirm ? (c(), u(_, { key: 0 }, [
328
+ F((c(), u("button", {
279
329
  class: "primary",
280
330
  onClick: s[0] || (s[0] = () => i.callback(!0))
281
331
  }, [
282
- te("Confirm")
332
+ ne("Confirm")
283
333
  ])), [
284
334
  [o]
285
335
  ]),
286
- g("button", {
336
+ y("button", {
287
337
  class: "default",
288
338
  onClick: s[1] || (s[1] = () => i.callback(!1))
289
339
  }, "Cancel")
290
- ], 64)) : B((c(), d("button", {
340
+ ], 64)) : F((c(), u("button", {
291
341
  key: 1,
292
342
  class: "default",
293
343
  onClick: s[2] || (s[2] = () => i.callback(!0))
294
344
  }, [
295
- te("OK")
345
+ ne("OK")
296
346
  ])), [
297
347
  [o]
298
348
  ])
@@ -303,52 +353,52 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
303
353
  };
304
354
  }
305
355
  });
306
- let A;
307
- const dt = new Uint8Array(16);
308
- function ut() {
309
- if (!A && (A = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !A))
356
+ let V;
357
+ const ft = new Uint8Array(16);
358
+ function pt() {
359
+ if (!V && (V = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !V))
310
360
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
311
- return A(dt);
361
+ return V(ft);
312
362
  }
313
- const u = [];
363
+ const p = [];
314
364
  for (let e = 0; e < 256; ++e)
315
- u.push((e + 256).toString(16).slice(1));
316
- function ht(e, t = 0) {
317
- return (u[e[t + 0]] + u[e[t + 1]] + u[e[t + 2]] + u[e[t + 3]] + "-" + u[e[t + 4]] + u[e[t + 5]] + "-" + u[e[t + 6]] + u[e[t + 7]] + "-" + u[e[t + 8]] + u[e[t + 9]] + "-" + u[e[t + 10]] + u[e[t + 11]] + u[e[t + 12]] + u[e[t + 13]] + u[e[t + 14]] + u[e[t + 15]]).toLowerCase();
365
+ p.push((e + 256).toString(16).slice(1));
366
+ function mt(e, t = 0) {
367
+ return (p[e[t + 0]] + p[e[t + 1]] + p[e[t + 2]] + p[e[t + 3]] + "-" + p[e[t + 4]] + p[e[t + 5]] + "-" + p[e[t + 6]] + p[e[t + 7]] + "-" + p[e[t + 8]] + p[e[t + 9]] + "-" + p[e[t + 10]] + p[e[t + 11]] + p[e[t + 12]] + p[e[t + 13]] + p[e[t + 14]] + p[e[t + 15]]).toLowerCase();
318
368
  }
319
- const ft = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), se = {
320
- randomUUID: ft
369
+ const vt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = {
370
+ randomUUID: vt
321
371
  };
322
- function pt(e, t, n) {
323
- if (se.randomUUID && !t && !e)
324
- return se.randomUUID();
372
+ function gt(e, t, n) {
373
+ if (oe.randomUUID && !t && !e)
374
+ return oe.randomUUID();
325
375
  e = e || {};
326
- const i = e.random || (e.rng || ut)();
376
+ const i = e.random || (e.rng || pt)();
327
377
  if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
328
378
  n = n || 0;
329
379
  for (let s = 0; s < 16; ++s)
330
380
  t[n + s] = i[s];
331
381
  return t;
332
382
  }
333
- return ht(i);
383
+ return mt(i);
334
384
  }
335
- function Sn(e) {
385
+ function xn(e) {
336
386
  return e.replace(/\n/g, "<br>");
337
387
  }
338
- function mt(e) {
388
+ function yt(e) {
339
389
  return e.replace(/_/g, " ");
340
390
  }
341
- function vt(e) {
391
+ function Et(e) {
342
392
  const t = e.replace(/\D/g, "").replace(/^1/, "");
343
393
  return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
344
394
  }
345
- function gt(e) {
395
+ function Tt(e) {
346
396
  return "$" + Number(e).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
347
397
  }
348
- function kn() {
349
- return pt();
398
+ function Ln() {
399
+ return gt();
350
400
  }
351
- const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Et = {
401
+ const w = Symbol("null"), le = Symbol("create"), Ot = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", bt = {
352
402
  props: {
353
403
  modelValue: {
354
404
  type: null,
@@ -427,8 +477,8 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
427
477
  return this.allOptions.map((e, t) => {
428
478
  var l, a;
429
479
  const n = this.formatter(e), i = (l = this.subtitleFormatter) == null ? void 0 : l.call(this, e), s = n ? n.trim().toLowerCase() : "", o = i ? i.trim().toLowerCase() : "", r = [];
430
- return this.searchFields ? this.searchFields.forEach((m) => {
431
- e[m] && r.push(String(e[m]).toLowerCase());
480
+ return this.searchFields ? this.searchFields.forEach((v) => {
481
+ e[v] && r.push(String(e[v]).toLowerCase());
432
482
  }) : (r.push(s), o && r.push(o)), {
433
483
  // eslint-disable-next-line vue/no-use-computed-property-like-method
434
484
  key: ((a = this.effectiveKeyExtractor) == null ? void 0 : a.call(this, e)) ?? String(t),
@@ -445,7 +495,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
445
495
  const t = this.searchText.trim().toLowerCase();
446
496
  if (t.length) {
447
497
  e = e.filter((s) => s.searchContent.includes(t));
448
- const n = Xe(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), i = new RegExp(`(${n})`, "ig");
498
+ const n = Ye(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), i = new RegExp(`(${n})`, "ig");
449
499
  e = e.map((s) => {
450
500
  var o;
451
501
  return {
@@ -454,13 +504,13 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
454
504
  subtitle: (o = s.subtitle) == null ? void 0 : o.replace(i, "<mark>$1</mark>")
455
505
  };
456
506
  }), this.shouldShowCreateOption && (e.find((o) => o.searchContent === t) !== void 0 || e.push({
457
- key: oe,
507
+ key: le,
458
508
  title: "Create <strong>" + this.searchText.trim() + "</strong>..."
459
509
  }));
460
510
  }
461
511
  } else
462
512
  this.nullTitle && e.unshift({
463
- key: b,
513
+ key: w,
464
514
  title: this.nullTitle
465
515
  });
466
516
  return e;
@@ -486,7 +536,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
486
536
  },
487
537
  effectiveOptions() {
488
538
  var e;
489
- this.modelValue && !this.selectedOption && this.handleValueChanged(), this.highlightedOptionKey && !this.effectiveOptions.find((t) => t.key == this.highlightedOptionKey) && (this.highlightedOptionKey = ((e = this.effectiveOptions[0]) == null ? void 0 : e.key) ?? b);
539
+ this.modelValue && !this.selectedOption && this.handleValueChanged(), this.highlightedOptionKey && !this.effectiveOptions.find((t) => t.key == this.highlightedOptionKey) && (this.highlightedOptionKey = ((e = this.effectiveOptions[0]) == null ? void 0 : e.key) ?? w);
490
540
  }
491
541
  },
492
542
  async mounted() {
@@ -495,7 +545,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
495
545
  "update:modelValue",
496
546
  this.selectedOption && this.valueExtractor ? this.valueExtractor(this.selectedOption) : this.selectedOption
497
547
  );
498
- }), this.remoteSearch && this.$watch("searchText", je(this.reloadOptionsIfSearching, 250));
548
+ }), this.remoteSearch && this.$watch("searchText", Pe(this.reloadOptionsIfSearching, 250));
499
549
  },
500
550
  methods: {
501
551
  async loadRemoteOptions() {
@@ -540,7 +590,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
540
590
  this.searchText.length > 1 && (this.isSearching = !0);
541
591
  return;
542
592
  }
543
- !e.metaKey && yt.includes(e.key) && (this.isSearching = !0);
593
+ !e.metaKey && Ot.includes(e.key) && (this.isSearching = !0);
544
594
  }
545
595
  },
546
596
  handleInputFocused() {
@@ -548,7 +598,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
548
598
  },
549
599
  setHighlightedOptionKey(e) {
550
600
  var t;
551
- this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ?? b : this.nullTitle && (this.highlightedOptionKey = b);
601
+ this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ?? w : this.nullTitle && (this.highlightedOptionKey = w);
552
602
  },
553
603
  getOptionKey(e) {
554
604
  var t;
@@ -558,7 +608,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
558
608
  const t = this.effectiveOptions.find((i) => i.ref === e);
559
609
  if (t)
560
610
  return t;
561
- const n = this.effectiveOptions.find((i) => Te(i.ref, e));
611
+ const n = this.effectiveOptions.find((i) => Oe(i.ref, e));
562
612
  return n || null;
563
613
  },
564
614
  handleInputBlurred() {
@@ -596,9 +646,9 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
596
646
  s.offsetTop < i.scrollTop ? i.scrollTop = s.offsetTop : s.offsetTop + s.offsetHeight > i.scrollTop + i.clientHeight && (i.scrollTop = s.offsetTop + s.offsetHeight - i.clientHeight);
597
647
  },
598
648
  selectOption(e) {
599
- if (this.isSearching = !1, e.key == b)
649
+ if (this.isSearching = !1, e.key == w)
600
650
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
601
- else if (e.key === oe) {
651
+ else if (e.key === le) {
602
652
  const t = this.searchText.trim();
603
653
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, this.$emit("createItem", t);
604
654
  } else {
@@ -615,61 +665,61 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
615
665
  }
616
666
  }
617
667
  };
618
- const Tt = ["placeholder"], Ot = {
668
+ const wt = ["placeholder"], St = {
619
669
  key: 0,
620
670
  ref: "optionsContainer",
621
671
  class: "vf-smart-select-options"
622
- }, bt = {
672
+ }, kt = {
623
673
  key: 0,
624
674
  class: "no-results"
625
- }, wt = ["onMousemove", "onMousedown"], St = ["innerHTML"], kt = ["innerHTML"], Mt = {
675
+ }, Mt = ["onMousemove", "onMousedown"], xt = ["innerHTML"], Lt = ["innerHTML"], Ct = {
626
676
  key: 0,
627
677
  class: "no-results"
628
678
  };
629
- function Lt(e, t, n, i, s, o) {
630
- const r = ge("disabled");
631
- return c(), d("div", {
632
- class: T(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
679
+ function It(e, t, n, i, s, o) {
680
+ const r = ye("disabled");
681
+ return c(), u("div", {
682
+ class: b(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
633
683
  }, [
634
- B(g("input", {
684
+ F(y("input", {
635
685
  "onUpdate:modelValue": t[0] || (t[0] = (l) => e.searchText = l),
636
686
  ref: "searchField",
637
687
  type: "text",
638
- class: T({ nullable: !!n.nullTitle }),
688
+ class: b({ nullable: !!n.nullTitle }),
639
689
  onKeydown: t[1] || (t[1] = (...l) => o.handleKeyDown && o.handleKeyDown(...l)),
640
690
  placeholder: o.effectivePlaceholder,
641
691
  onFocus: t[2] || (t[2] = (...l) => o.handleInputFocused && o.handleInputFocused(...l)),
642
692
  onBlur: t[3] || (t[3] = (...l) => o.handleInputBlurred && o.handleInputBlurred(...l))
643
- }, null, 42, Tt), [
644
- [Ue, e.searchText],
693
+ }, null, 42, wt), [
694
+ [je, e.searchText],
645
695
  [r, o.effectiveDisabled]
646
696
  ]),
647
- e.shouldDisplayOptions ? (c(), d("div", Ot, [
648
- e.isLoaded ? (c(), d(F, { key: 1 }, [
649
- (c(!0), d(F, null, q(o.effectiveOptions, (l) => (c(), d("div", {
697
+ e.shouldDisplayOptions ? (c(), u("div", St, [
698
+ e.isLoaded ? (c(), u(_, { key: 1 }, [
699
+ (c(!0), u(_, null, z(o.effectiveOptions, (l) => (c(), u("div", {
650
700
  key: String(l.key),
651
- class: T(["option", {
701
+ class: b(["option", {
652
702
  highlighted: e.highlightedOptionKey === l.key
653
703
  }]),
654
704
  onMousemove: (a) => o.handleOptionHover(l),
655
705
  onMousedown: (a) => o.selectOption(l)
656
706
  }, [
657
- g("div", {
707
+ y("div", {
658
708
  class: "title",
659
709
  innerHTML: l.title
660
- }, null, 8, St),
661
- l.subtitle ? (c(), d("div", {
710
+ }, null, 8, xt),
711
+ l.subtitle ? (c(), u("div", {
662
712
  key: 0,
663
713
  class: "subtitle",
664
714
  innerHTML: l.subtitle
665
- }, null, 8, kt)) : y("", !0)
666
- ], 42, wt))), 128)),
667
- !o.effectiveOptions.length && e.searchText ? (c(), d("div", Mt, k(o.effectiveNoResultsText), 1)) : y("", !0)
668
- ], 64)) : (c(), d("div", bt, "Loading..."))
669
- ], 512)) : y("", !0)
715
+ }, null, 8, Lt)) : T("", !0)
716
+ ], 42, Mt))), 128)),
717
+ !o.effectiveOptions.length && e.searchText ? (c(), u("div", Ct, M(o.effectiveNoResultsText), 1)) : T("", !0)
718
+ ], 64)) : (c(), u("div", kt, "Loading..."))
719
+ ], 512)) : T("", !0)
670
720
  ], 2);
671
721
  }
672
- const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
722
+ const Ht = /* @__PURE__ */ be(bt, [["render", It]]), Cn = /* @__PURE__ */ D({
673
723
  __name: "ez-smart-select",
674
724
  props: {
675
725
  modelValue: {},
@@ -680,22 +730,22 @@ const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
680
730
  },
681
731
  emits: ["update:modelValue"],
682
732
  setup(e, { emit: t }) {
683
- const n = e, i = V(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, l]) => ({
733
+ const n = e, i = B(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, l]) => ({
684
734
  value: r,
685
735
  label: l
686
- }))), s = V(() => n.formatter ? (r) => {
736
+ }))), s = B(() => n.formatter ? (r) => {
687
737
  var l;
688
738
  return (l = n.formatter) == null ? void 0 : l.call(n, r.label);
689
- } : (r) => r.label), o = $(i.value.find((r) => r.value === n.modelValue) ?? null);
690
- return ne(
739
+ } : (r) => r.label), o = I(i.value.find((r) => r.value === n.modelValue) ?? null);
740
+ return ie(
691
741
  () => n.modelValue,
692
742
  (r) => {
693
743
  o.value = i.value.find((l) => l.value === r) ?? null;
694
744
  }
695
- ), ne(o, (r) => {
745
+ ), ie(o, (r) => {
696
746
  var l;
697
- t("update:modelValue", r ? ((l = i.value.find((a) => Te(a, r))) == null ? void 0 : l.value) ?? null : null);
698
- }), (r, l) => (c(), Y(xt, {
747
+ t("update:modelValue", r ? ((l = i.value.find((a) => Oe(a, r))) == null ? void 0 : l.value) ?? null : null);
748
+ }), (r, l) => (c(), Z(Ht, {
699
749
  modelValue: o.value,
700
750
  "onUpdate:modelValue": l[0] || (l[0] = (a) => o.value = a),
701
751
  options: i.value,
@@ -704,134 +754,95 @@ const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
704
754
  }, null, 8, ["modelValue", "options", "formatter", "null-title"]));
705
755
  }
706
756
  });
707
- function Ct(e) {
757
+ function Dt(e) {
708
758
  const t = Math.floor(Math.log(e) / Math.log(1024)), i = (e / Math.pow(1024, t)).toFixed(2), s = ["B", "KB", "MB", "GB", "TB"][t];
709
759
  return `${i} ${s}`;
710
760
  }
711
- function It(e) {
761
+ function $t(e) {
712
762
  return e != null && String(e).length ? e : "-";
713
763
  }
714
- function Ht(e) {
715
- return e || "-";
716
- }
717
- function Dt(e) {
718
- return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Ut(Number(e));
719
- }
720
764
  function At(e) {
721
- return e && vt(e);
722
- }
723
- function $t(e) {
724
- return e ? Pe(e) : null;
765
+ return e || "-";
725
766
  }
726
767
  function Vt(e) {
727
- return e ? We(e) : null;
768
+ return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : jt(Number(e));
728
769
  }
729
770
  function Bt(e) {
730
- return e ? e.toUpperCase() : null;
771
+ return e && Et(e);
731
772
  }
732
773
  function Ft(e) {
733
- return e ? mt(e) : null;
774
+ return e ? We(e) : null;
734
775
  }
735
776
  function _t(e) {
736
- return gt(e);
737
- }
738
- const le = {
739
- bytes: Ct,
740
- dash: It,
741
- dashZeros: Ht,
742
- number: Dt,
743
- phone: At,
744
- upperFirst: $t,
745
- startCase: Vt,
746
- upperCase: Bt,
747
- desnake: Ft,
748
- usCurrency: _t
749
- }, Ln = (e) => ({
750
- ...le,
751
- ...e(le)
777
+ return e ? qe(e) : null;
778
+ }
779
+ function Nt(e) {
780
+ return e ? e.toUpperCase() : null;
781
+ }
782
+ function Kt(e) {
783
+ return e ? yt(e) : null;
784
+ }
785
+ function Rt(e) {
786
+ return Tt(e);
787
+ }
788
+ const re = {
789
+ bytes: Dt,
790
+ dash: $t,
791
+ dashZeros: At,
792
+ number: Vt,
793
+ phone: Bt,
794
+ upperFirst: Ft,
795
+ startCase: _t,
796
+ upperCase: Nt,
797
+ desnake: Kt,
798
+ usCurrency: Rt
799
+ }, In = (e) => ({
800
+ ...re,
801
+ ...e(re)
752
802
  });
753
- function xn(e, t, n) {
803
+ function Hn(e, t, n) {
754
804
  const i = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
755
805
  return i === -1 ? !1 : (e.splice(i, 1, n), !0);
756
806
  }
757
- function Cn(e, t) {
807
+ function Dn(e, t) {
758
808
  const n = document.createElement("div");
759
- n.classList.add("vf-overlay"), n.addEventListener("click", O), document.body.appendChild(n);
809
+ n.classList.add("vf-overlay"), n.addEventListener("click", d), document.body.appendChild(n);
760
810
  const i = document.createElement("div");
761
811
  i.classList.add("vf-context-menu"), i.style.position = "absolute", n.appendChild(i);
762
812
  const s = e.currentTarget;
763
- s.style.userSelect = "none", s.classList.add("context-menu-active"), t.targetClass && s.classList.add(t.targetClass), t.class && i.classList.add(t.class), t.items.forEach((h) => {
764
- if (h == "-") {
765
- const D = document.createElement("div");
766
- D.classList.add("separator"), i.appendChild(D);
813
+ s.style.userSelect = "none", s.classList.add("context-menu-active"), t.targetClass && s.classList.add(t.targetClass), t.class && i.classList.add(t.class), t.items.forEach((f) => {
814
+ if (f == "-") {
815
+ const A = document.createElement("div");
816
+ A.classList.add("separator"), i.appendChild(A);
767
817
  return;
768
818
  }
769
- const v = document.createElement("div");
770
- v.classList.add("item"), v.style.userSelect = "none", v.innerText = h.title, i.appendChild(v), h.class && v.classList.add(h.class), h.shouldConfirm ? v.addEventListener("click", () => h.handler()) : v.addEventListener("click", () => He(v, h.handler));
819
+ const g = document.createElement("div");
820
+ g.classList.add("item"), g.style.userSelect = "none", g.innerText = f.title, i.appendChild(g), f.class && g.classList.add(f.class), f.shouldConfirm ? g.addEventListener("click", () => f.handler()) : g.addEventListener("click", () => E(g, f.handler));
771
821
  });
772
- const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, a = i.offsetWidth, m = o < a ? e.clientX - a - 1 : e.clientX + 1, f = r < l ? e.clientY - l - 1 : e.clientY + 1;
773
- i.style.left = m + "px", i.style.top = f + "px", setTimeout(() => {
822
+ const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, a = i.offsetWidth, v = o < a ? e.clientX - a - 1 : e.clientX + 1, h = r < l ? e.clientY - l - 1 : e.clientY + 1;
823
+ i.style.left = v + "px", i.style.top = h + "px", setTimeout(() => {
774
824
  i.style.width = i.offsetWidth + "px";
775
825
  }, 50);
776
- function O() {
826
+ function d() {
777
827
  t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
778
828
  }
779
- function He(h, v) {
780
- if (h.classList.contains("pending-confirm"))
781
- return v();
782
- const D = h.innerHTML;
783
- h.classList.add("pending-confirm"), h.innerText = "Confirm";
784
- const ee = () => {
785
- h.classList.remove("pending-confirm"), h.innerHTML = D, h.removeEventListener("mouseleave", ee);
829
+ function E(f, g) {
830
+ if (f.classList.contains("pending-confirm"))
831
+ return g();
832
+ const A = f.innerHTML;
833
+ f.classList.add("pending-confirm"), f.innerText = "Confirm";
834
+ const te = () => {
835
+ f.classList.remove("pending-confirm"), f.innerHTML = A, f.removeEventListener("mouseleave", te);
786
836
  };
787
- h.addEventListener("mouseleave", ee), e.stopPropagation();
788
- }
789
- }
790
- const Nt = (e) => new Promise((t) => setTimeout(t, e)), In = (e) => Nt(e * 1e3), M = Symbol("MaskState");
791
- function Hn(e, t) {
792
- const n = e.$.vnode.el, i = n.closest(".vf-modal");
793
- return Kt(i ?? n, t);
794
- }
795
- function Dn(e) {
796
- const t = e.$.vnode.el, n = t.closest(".vf-modal");
797
- return ke(n ?? t);
798
- }
799
- function Kt(e, t) {
800
- if (!e[M]) {
801
- const n = document.createElement("div");
802
- n.classList.add("vf-mask"), e.appendChild(n), e[M] = { maskEl: n };
837
+ f.addEventListener("mouseleave", te), e.stopPropagation();
803
838
  }
804
- return e[M].maskEl.innerText = t ?? "", () => ke(e);
805
- }
806
- function ke(e) {
807
- e[M] && e.removeChild(e[M].maskEl);
808
839
  }
809
- const W = Symbol("FormMaskState");
810
- function An(e, t, n) {
811
- const i = e instanceof Element ? e : Me(e);
812
- i.classList.add("vf-masked");
813
- const s = t instanceof Element ? t : i.querySelectorAll(t ?? "button:not([disabled])")[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
814
- s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
815
- const l = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
816
- return l.forEach((a) => a.setAttribute("disabled", "disabled")), i[W] = {
817
- disabledElements: l,
818
- waitButton: s,
819
- buttonHtml: o
820
- }, () => Rt(i);
821
- }
822
- function Rt(e) {
823
- const t = e instanceof Element ? e : Me(e), n = t[W];
824
- n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled"), delete t[W]);
825
- }
826
- function Me(e) {
827
- const t = e.$.vnode.el;
828
- return t.tagName === "FORM" ? t : t.querySelector("form");
829
- }
830
- function Ut(e) {
840
+ const Ut = (e) => new Promise((t) => setTimeout(t, e)), $n = (e) => Ut(e * 1e3);
841
+ function jt(e) {
831
842
  return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
832
843
  }
833
- function $n(e, t) {
834
- return e != null ? qe(e) : t;
844
+ function An(e, t) {
845
+ return e != null ? ze(e) : t;
835
846
  }
836
847
  function Vn(e, t) {
837
848
  const n = { ...e };
@@ -839,62 +850,65 @@ function Vn(e, t) {
839
850
  n[i] === "" && (n[i] = null);
840
851
  return n;
841
852
  }
842
- function jt(e) {
853
+ function Pt(e) {
843
854
  return e instanceof Error && "status" in e && "body" in e;
844
855
  }
845
856
  function Bn({ apiClient: e, onRequest: t, onError: n, CancelablePromise: i }) {
846
857
  const s = e.request.request.bind(e.request);
847
858
  e.request.request = (o) => (t && (o = t(o)), new i((r, l, a) => {
848
- const m = s(o);
849
- a(m.cancel), m.then(r).catch((f) => {
850
- if (jt(f) && typeof f.body == "object" && "error" in f.body && f.status === 422)
851
- return l(new N(f.body.error));
859
+ const v = s(o);
860
+ a(v.cancel), v.then(r).catch((h) => {
861
+ if (Pt(h) && typeof h.body == "object" && "error" in h.body) {
862
+ if (h.status === 422)
863
+ return l(new K(h.body.error));
864
+ h.message = `${h.body.error} (${h.status})`;
865
+ }
852
866
  if (n) {
853
- const O = n(f, o);
854
- if (O === null)
867
+ const d = n(h, o);
868
+ if (d === null)
855
869
  return;
856
- if (O instanceof Error)
857
- return l(O);
870
+ if (d instanceof Error)
871
+ return l(d);
858
872
  }
859
- l(f);
873
+ l(h);
860
874
  });
861
875
  }));
862
876
  }
863
- const Q = Symbol("HookState");
877
+ const J = Symbol("HookState");
864
878
  function Fn(e, t) {
865
- const n = t ?? ve();
866
- z(() => Pt(n, e), n), ye(() => Wt(n), n), Ee(() => re(n), n), X(() => re(n), n);
879
+ const n = t ?? ge();
880
+ X(() => Wt(n, e), n), Ee(() => qt(n), n), Te(() => ae(n), n), Y(() => ae(n), n);
867
881
  }
868
- function Pt(e, t) {
882
+ function Wt(e, t) {
869
883
  const n = {};
870
884
  if (t.elScrolledToBottom && (n.el = new L(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
871
- const i = Le(e.vnode.el);
885
+ const i = Ce(e.vnode.el);
872
886
  i ? n.ancestor = new L(i, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
873
887
  }
874
- t.windowScrolledToBottom && (n.window = new L(window, t.windowScrolledToBottom)), e[Q] = n;
888
+ t.windowScrolledToBottom && (n.window = new L(window, t.windowScrolledToBottom)), e[J] = n;
875
889
  }
876
- function Wt(e) {
890
+ function qt(e) {
877
891
  var n, i, s;
878
- const t = e[Q];
892
+ const t = e[J];
879
893
  (n = t == null ? void 0 : t.el) == null || n.install(), (i = t == null ? void 0 : t.ancestor) == null || i.install(), (s = t == null ? void 0 : t.window) == null || s.install();
880
894
  }
881
- function re(e) {
895
+ function ae(e) {
882
896
  var n, i, s;
883
- const t = e[Q];
897
+ const t = e[J];
884
898
  (n = t == null ? void 0 : t.el) == null || n.uninstall(), (i = t == null ? void 0 : t.ancestor) == null || i.uninstall(), (s = t == null ? void 0 : t.window) == null || s.uninstall();
885
899
  }
886
- const j = ["auto", "scroll"];
887
- function Le(e) {
900
+ const P = ["auto", "scroll"];
901
+ function Ce(e) {
888
902
  const t = e.parentElement;
889
903
  if (!t)
890
904
  return null;
891
905
  const n = window.getComputedStyle(t);
892
- return j.includes(n.overflow) || j.includes(n.overflowX) || j.includes(n.overflowY) ? t : Le(t);
906
+ return P.includes(n.overflow) || P.includes(n.overflowX) || P.includes(n.overflowY) ? t : Ce(t);
893
907
  }
894
908
  class L {
895
909
  constructor(t, n) {
896
- p(this, "isTripped", !1);
897
- p(this, "onScrollWithContext", this.onScroll.bind(this));
910
+ m(this, "isTripped", !1);
911
+ m(this, "onScrollWithContext", this.onScroll.bind(this));
898
912
  this.el = t, this.handler = n, this.install();
899
913
  }
900
914
  install() {
@@ -908,29 +922,29 @@ class L {
908
922
  }
909
923
  }
910
924
  function _n(e) {
911
- z(() => window.addEventListener("resize", e)), ye(() => window.addEventListener("resize", e)), Ee(() => window.removeEventListener("resize", e)), X(() => window.removeEventListener("resize", e));
912
- }
913
- const qt = {
914
- mounted: ce,
915
- updated: ce
916
- }, ae = Symbol("HasAutoFocused");
917
- function ce(e, t) {
918
- if (t.value === void 0 && e[ae] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue)
925
+ X(() => window.addEventListener("resize", e)), Ee(() => window.addEventListener("resize", e)), Te(() => window.removeEventListener("resize", e)), Y(() => window.removeEventListener("resize", e));
926
+ }
927
+ const zt = {
928
+ mounted: de,
929
+ updated: de
930
+ }, ce = Symbol("HasAutoFocused");
931
+ function de(e, t) {
932
+ if (t.value === void 0 && e[ce] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue)
919
933
  return;
920
- e[ae] = !0;
934
+ e[ce] = !0;
921
935
  const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
922
936
  setTimeout(() => n.focus(), 10);
923
937
  }
924
- const zt = {
925
- mounted: Xt
926
- }, w = Symbol("ConfirmState");
927
- function Xt(e) {
938
+ const Xt = {
939
+ mounted: Yt
940
+ }, S = Symbol("ConfirmState");
941
+ function Yt(e) {
928
942
  e.addEventListener("click", (t) => {
929
943
  const n = Date.now();
930
- if (e[w]) {
931
- if (n - e[w].initTime < 300)
944
+ if (e[S]) {
945
+ if (n - e[S].initTime < 300)
932
946
  return;
933
- e[w].resetHandler(), e.dispatchEvent(new Event("confirm"));
947
+ e[S].resetHandler(), e.dispatchEvent(new Event("confirm"));
934
948
  return;
935
949
  }
936
950
  t.preventDefault(), t.stopImmediatePropagation();
@@ -938,86 +952,86 @@ function Xt(e) {
938
952
  initTime: n,
939
953
  preconfirmHtml: e.innerHTML,
940
954
  resetHandler: () => {
941
- e.innerHTML = i.preconfirmHtml, e.blur(), e.removeEventListener("mouseout", i.resetHandler), delete e[w];
955
+ e.innerHTML = i.preconfirmHtml, e.blur(), e.removeEventListener("mouseout", i.resetHandler), delete e[S];
942
956
  }
943
957
  };
944
- e[w] = i, e.innerHTML = "Confirm", e.addEventListener("mouseout", i.resetHandler);
958
+ e[S] = i, e.innerHTML = "Confirm", e.addEventListener("mouseout", i.resetHandler);
945
959
  });
946
960
  }
947
- const Yt = {
948
- beforeMount: Zt
961
+ const Zt = {
962
+ beforeMount: Gt
949
963
  };
950
- function Zt(e) {
964
+ function Gt(e) {
951
965
  e.addEventListener("blur", () => {
952
966
  let t = e.value;
953
- /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + P(/* @__PURE__ */ new Date(), "yy"));
967
+ /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + W(/* @__PURE__ */ new Date(), "yy"));
954
968
  const n = Date.parse(t);
955
- isNaN(n) ? e.value = "" : e.value = P(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
969
+ isNaN(n) ? e.value = "" : e.value = W(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
956
970
  });
957
971
  }
958
- const Gt = {
959
- beforeMount: de,
960
- updated: de
972
+ const Qt = {
973
+ beforeMount: ue,
974
+ updated: ue
961
975
  };
962
- function de(e, t) {
963
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = Qt(e, t));
976
+ function ue(e, t) {
977
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = Jt(e, t));
964
978
  }
965
- function Qt(e, t) {
966
- var a, m;
979
+ function Jt(e, t) {
980
+ var a, v;
967
981
  if (!t.value)
968
982
  return ((a = e.attributes.getNamedItem("placeholder")) == null ? void 0 : a.value) ?? "";
969
983
  let n = "";
970
984
  const i = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), s = e.attributes.getNamedItem("local") !== null ? i.replace(/Z$/, "") : i.replace(/(Z|\+00:00)?$/, "Z"), o = new Date(s);
971
985
  e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
972
- let r = (m = e.attributes.getNamedItem("format")) == null ? void 0 : m.value;
986
+ let r = (v = e.attributes.getNamedItem("format")) == null ? void 0 : v.value;
973
987
  if (!r && e.attributes.getNamedItem("relative-date") !== null) {
974
- const f = /* @__PURE__ */ new Date();
975
- f.getFullYear() == o.getFullYear() && f.getMonth() == o.getMonth() && f.getDate() == o.getDate() && (n = "at", r = "HH:mm");
988
+ const h = /* @__PURE__ */ new Date();
989
+ h.getFullYear() == o.getFullYear() && h.getMonth() == o.getMonth() && h.getDate() == o.getDate() && (n = "at", r = "HH:mm");
976
990
  }
977
- r || (r = H.defaultDateTimeFormat);
978
- let l = P(o, r);
991
+ r || (r = $.defaultDateTimeFormat);
992
+ let l = W(o, r);
979
993
  return n && (l = n + " " + l), l;
980
994
  }
981
- const Jt = {
982
- beforeMount: ue,
983
- updated: ue,
984
- unmounted: en
995
+ const en = {
996
+ beforeMount: he,
997
+ updated: he,
998
+ unmounted: tn
985
999
  };
986
- function ue(e, t) {
1000
+ function he(e, t) {
987
1001
  e.tagName === "LABEL" && (t.value ? e.classList.remove("disabled") : e.classList.add("disabled"), e = e.querySelector("input")), t.value ? e.setAttribute("disabled", "disabled") : e.removeAttribute("disabled");
988
1002
  }
989
- function en(e) {
1003
+ function tn(e) {
990
1004
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
991
1005
  }
992
- const tn = {
993
- beforeMount: he,
994
- updated: he,
995
- unmounted: Ce
996
- }, C = Symbol("HasAutoFocused"), J = [];
997
- function nn() {
998
- J.forEach(xe);
1006
+ const nn = {
1007
+ beforeMount: fe,
1008
+ updated: fe,
1009
+ unmounted: He
1010
+ }, H = Symbol("HasAutoFocused"), ee = [];
1011
+ function sn() {
1012
+ ee.forEach(Ie);
999
1013
  }
1000
- setInterval(nn, 1e3);
1001
- function he(e, t) {
1014
+ setInterval(sn, 1e3);
1015
+ function fe(e, t) {
1002
1016
  var r;
1003
1017
  if (t.value == t.oldValue)
1004
1018
  return;
1005
1019
  if (!t.value)
1006
- return Ce(e);
1020
+ return He(e);
1007
1021
  const n = new Date(t.value), i = (r = e.attributes.getNamedItem("base-time")) == null ? void 0 : r.value, s = n.getTime() - (i ? new Date(i).getTime() - t.value * 1e3 : 0), o = e.getAttribute("no-seconds") === null;
1008
- e[C] || J.push(e), e[C] = {
1022
+ e[H] || ee.push(e), e[H] = {
1009
1023
  startTs: s,
1010
1024
  includeSeconds: o
1011
- }, xe(e);
1025
+ }, Ie(e);
1012
1026
  }
1013
- function xe(e) {
1014
- const t = e[C], n = Math.round((Date.now() - t.startTs) / 1e3);
1015
- e.innerText = sn(n, t.includeSeconds);
1027
+ function Ie(e) {
1028
+ const t = e[H], n = Math.round((Date.now() - t.startTs) / 1e3);
1029
+ e.innerText = on(n, t.includeSeconds);
1016
1030
  }
1017
- function Ce(e) {
1018
- e[C] && (ze(J, e), delete e[C]), e.innerText = "-";
1031
+ function He(e) {
1032
+ e[H] && (Xe(ee, e), delete e[H]), e.innerText = "-";
1019
1033
  }
1020
- function sn(e, t) {
1034
+ function on(e, t) {
1021
1035
  const n = [], i = Math.floor(e / 86400);
1022
1036
  i && n.push(i + "d"), e -= i * 86400;
1023
1037
  const s = Math.floor(e / 3600);
@@ -1025,31 +1039,31 @@ function sn(e, t) {
1025
1039
  const o = Math.floor(e / 60);
1026
1040
  return (i || s || o) && n.push(o + "m"), t ? n.length || n.push("0m") : (e -= o * 60, n.push(e + "s")), n.join(" ");
1027
1041
  }
1028
- const S = Symbol("InfiniteScrollHandler"), on = {
1042
+ const k = Symbol("InfiniteScrollHandler"), ln = {
1029
1043
  mounted(e, t) {
1030
- e[S] = new L(e, t.value);
1044
+ e[k] = new L(e, t.value);
1031
1045
  },
1032
1046
  updated(e, t) {
1033
1047
  var n;
1034
- (n = e[S]) == null || n.uninstall(), e[S] = new L(e, t.value);
1048
+ (n = e[k]) == null || n.uninstall(), e[k] = new L(e, t.value);
1035
1049
  },
1036
1050
  unmounted(e) {
1037
1051
  var t;
1038
- (t = e[S]) == null || t.uninstall(), delete e[S];
1052
+ (t = e[k]) == null || t.uninstall(), delete e[k];
1039
1053
  }
1040
- }, ln = {
1041
- beforeMount: fe,
1042
- updated: fe
1054
+ }, rn = {
1055
+ beforeMount: pe,
1056
+ updated: pe
1043
1057
  };
1044
- function fe(e, t) {
1058
+ function pe(e, t) {
1045
1059
  e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1046
1060
  }
1047
- const rn = {
1048
- mounted: pe,
1049
- updated: pe,
1050
- unmounted: Ie
1051
- }, x = Symbol("TooltipState");
1052
- function pe(e, t) {
1061
+ const an = {
1062
+ mounted: me,
1063
+ updated: me,
1064
+ unmounted: De
1065
+ }, C = Symbol("TooltipState");
1066
+ function me(e, t) {
1053
1067
  var i;
1054
1068
  let n = ((i = e.attributes.getNamedItem("tip")) == null ? void 0 : i.value) ?? t.value;
1055
1069
  if (t.value || (n = null), n) {
@@ -1057,26 +1071,26 @@ function pe(e, t) {
1057
1071
  content: n,
1058
1072
  html: e.getAttribute("html") !== null
1059
1073
  };
1060
- e[x] ? e[x].configure(s) : e[x] = new an(e, s);
1074
+ e[C] ? e[C].configure(s) : e[C] = new cn(e, s);
1061
1075
  } else
1062
- Ie(e);
1076
+ De(e);
1063
1077
  }
1064
- function Ie(e) {
1078
+ function De(e) {
1065
1079
  var t;
1066
- (t = e[x]) == null || t.destroy(), delete e[x];
1080
+ (t = e[C]) == null || t.destroy(), delete e[C];
1067
1081
  }
1068
- class an {
1082
+ class cn {
1069
1083
  constructor(t, n) {
1070
- p(this, "lastMoveEvt");
1071
- p(this, "checkInterval");
1072
- p(this, "shouldShow", !1);
1073
- p(this, "tipEl");
1074
- p(this, "titleEl");
1075
- p(this, "contentEl");
1076
- p(this, "mouseMoveBound", !1);
1077
- p(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1078
- p(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1079
- p(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1084
+ m(this, "lastMoveEvt");
1085
+ m(this, "checkInterval");
1086
+ m(this, "shouldShow", !1);
1087
+ m(this, "tipEl");
1088
+ m(this, "titleEl");
1089
+ m(this, "contentEl");
1090
+ m(this, "mouseMoveBound", !1);
1091
+ m(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1092
+ m(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1093
+ m(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1080
1094
  this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
1081
1095
  }
1082
1096
  configure(t) {
@@ -1113,58 +1127,58 @@ class an {
1113
1127
  this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
1114
1128
  }
1115
1129
  }
1116
- function cn(e) {
1117
- e.directive("autofocus", qt), e.directive("confirm-button", zt), e.directive("date-input", Yt), e.directive("datetime", Gt), e.directive("disabled", Jt), e.directive("duration", tn), e.directive("infinite-scroll", on), e.directive("readonly", ln), e.directive("tooltip", rn);
1130
+ function dn(e) {
1131
+ e.directive("autofocus", zt), e.directive("confirm-button", Xt), e.directive("date-input", Zt), e.directive("datetime", Qt), e.directive("disabled", en), e.directive("duration", nn), e.directive("infinite-scroll", ln), e.directive("readonly", rn), e.directive("tooltip", an);
1118
1132
  }
1119
1133
  function Nn(e) {
1120
- cn(e);
1134
+ dn(e);
1121
1135
  }
1122
1136
  export {
1123
- vn as ModalContainer,
1124
- N as UserError,
1125
- mn as VfAjaxSelect,
1126
- K as VfAlertModal,
1127
- Mn as VfEzSmartSelect,
1128
- rt as VfModal,
1129
- xt as VfSmartSelect,
1130
- $n as cloneProp,
1131
- On as configureVf,
1132
- Ln as createFilters,
1133
- be as createModalInjection,
1134
- mt as desnakeCase,
1137
+ gn as ModalContainer,
1138
+ K as UserError,
1139
+ vn as VfAjaxSelect,
1140
+ R as VfAlertModal,
1141
+ Cn as VfEzSmartSelect,
1142
+ dt as VfModal,
1143
+ Ht as VfSmartSelect,
1144
+ An as cloneProp,
1145
+ bn as configureVf,
1146
+ In as createFilters,
1147
+ we as createModalInjection,
1148
+ yt as desnakeCase,
1135
1149
  Un as escapeHtml,
1136
- nt as formatError,
1137
- Ut as formatNumber,
1138
- vt as formatPhone,
1139
- gt as formatUSCurrency,
1140
- wn as handleError,
1141
- bn as handleErrorAndAlert,
1150
+ it as formatError,
1151
+ jt as formatNumber,
1152
+ Et as formatPhone,
1153
+ Tt as formatUSCurrency,
1154
+ Sn as handleError,
1155
+ wn as handleErrorAndAlert,
1142
1156
  Bn as installApiClientInterceptors,
1143
1157
  Nn as installVf,
1144
- jt as isApiError,
1145
- Hn as maskComponent,
1146
- Kt as maskEl,
1147
- An as maskForm,
1148
- Sn as nl2br,
1158
+ Pt as isApiError,
1159
+ kn as maskComponent,
1160
+ st as maskEl,
1161
+ ot as maskForm,
1162
+ xn as nl2br,
1149
1163
  Vn as nullifyEmptyInputs,
1150
- Z as presentModal,
1151
- we as removeModalInjection,
1152
- gn as removeModalInjectionByInstance,
1153
- Se as removeModalInjectionByInternalInstance,
1154
- tt as removeModalInjectionByVnode,
1155
- xn as replaceElement,
1156
- ie as showAlert,
1157
- yn as showConfirm,
1158
- En as showConfirmDestroy,
1159
- Cn as showContextMenu,
1160
- Tn as showWait,
1161
- Nt as sleep,
1162
- In as sleepSecs,
1163
- G as toError,
1164
- Dn as unmaskComponent,
1165
- ke as unmaskEl,
1166
- Rt as unmaskForm,
1164
+ G as presentModal,
1165
+ Se as removeModalInjection,
1166
+ yn as removeModalInjectionByInstance,
1167
+ ke as removeModalInjectionByInternalInstance,
1168
+ nt as removeModalInjectionByVnode,
1169
+ Hn as replaceElement,
1170
+ se as showAlert,
1171
+ En as showConfirm,
1172
+ Tn as showConfirmDestroy,
1173
+ Dn as showContextMenu,
1174
+ On as showWait,
1175
+ Ut as sleep,
1176
+ $n as sleepSecs,
1177
+ Q as toError,
1178
+ Mn as unmaskComponent,
1179
+ Me as unmaskEl,
1180
+ xe as unmaskForm,
1167
1181
  Fn as useInfiniteScroll,
1168
1182
  _n as useResizeWatcher,
1169
- kn as uuid
1183
+ Ln as uuid
1170
1184
  };