@signal24/vue-foundation 4.26.0 → 4.27.0

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,19 +1,16 @@
1
- var $t = Object.defineProperty;
2
- var Bt = (e, t, n) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var O = (e, t, n) => Bt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as R, ref as S, computed as T, watch as D, onMounted as _, createElementBlock as k, withDirectives as le, openBlock as E, createElementVNode as $, toDisplayString as W, createCommentVNode as V, Fragment as re, renderList as ae, vModelSelect as _t, getCurrentInstance as Ee, withModifiers as ke, normalizeStyle as Nt, normalizeClass as A, renderSlot as j, reactive as Rt, h as ue, Teleport as Wt, markRaw as jt, onBeforeUnmount as ce, resolveDirective as Ut, createBlock as tt, createSlots as Pt, withCtx as ye, createTextVNode as Z, vModelText as qt, onActivated as nt, onDeactivated as ot } from "vue";
5
- import { compact as st, cloneDeep as zt, uniq as Kt, groupBy as Yt, debounce as Xt, isEqual as it, startCase as Zt, upperFirst as Gt, remove as Jt, last as Qt } from "lodash";
6
- import { configureOpenApiClient as en, OpenApiError as tn } from "@signal24/openapi-client-codegen/browser";
7
- import { escapeHtml as nn } from "@vue/shared";
8
- import { escapeHtml as ws } from "@vue/shared";
9
- import { format as P, addDays as on, parse as sn } from "date-fns";
10
- const ln = {
1
+ import { defineComponent as N, ref as S, computed as T, watch as O, onMounted as B, createElementBlock as k, withDirectives as se, openBlock as b, createElementVNode as A, toDisplayString as R, createCommentVNode as H, Fragment as ie, renderList as re, vModelSelect as Dt, getCurrentInstance as we, withModifiers as Ee, normalizeStyle as Ht, normalizeClass as V, renderSlot as W, reactive as Vt, h as le, Teleport as At, markRaw as $t, onBeforeUnmount as ae, resolveDirective as Bt, createBlock as Ze, createSlots as _t, withCtx as me, createTextVNode as Y, vModelText as Nt, onActivated as Ge, onDeactivated as Je } from "vue";
2
+ import { compact as Qe, cloneDeep as Rt, uniq as Wt, groupBy as jt, debounce as Ut, isEqual as et, startCase as Pt, upperFirst as qt, remove as zt, last as Kt } from "lodash";
3
+ import { configureOpenApiClient as Yt, OpenApiError as Xt } from "@signal24/openapi-client-codegen/browser";
4
+ import { escapeHtml as Zt } from "@vue/shared";
5
+ import { escapeHtml as fs } from "@vue/shared";
6
+ import { format as U, addDays as Gt, parse as Jt } from "date-fns";
7
+ const Qt = {
11
8
  key: 0,
12
9
  disabled: ""
13
- }, rn = {
10
+ }, en = {
14
11
  key: 0,
15
12
  value: null
16
- }, an = ["value"], Po = /* @__PURE__ */ R({
13
+ }, tn = ["value"], Bo = /* @__PURE__ */ N({
17
14
  __name: "vf-ajax-select",
18
15
  props: {
19
16
  modelValue: {},
@@ -25,188 +22,185 @@ const ln = {
25
22
  },
26
23
  emits: ["update:modelValue"],
27
24
  setup(e, { emit: t }) {
28
- const n = e, o = t, l = S(null), s = T(() => l.value ? l.value.map((m) => {
29
- const b = m;
30
- return n.preprocesor ? n.preprocesor(b) : n.displayKey ? b[n.displayKey] : "";
25
+ const n = e, o = t, r = S(null), s = T(() => r.value ? r.value.map((d) => {
26
+ const E = d;
27
+ return n.preprocesor ? n.preprocesor(E) : n.displayKey ? E[n.displayKey] : "";
31
28
  }) : null), a = S(n.modelValue ?? null);
32
- D(() => n.loadFn, r), D(
29
+ O(() => n.loadFn, l), O(
33
30
  () => n.modelValue,
34
31
  () => a.value = n.modelValue
35
- ), D(a, () => o("update:modelValue", a.value));
36
- async function r() {
37
- l.value = await n.loadFn();
32
+ ), O(a, () => o("update:modelValue", a.value));
33
+ async function l() {
34
+ r.value = await n.loadFn();
38
35
  }
39
- return _(r), (u, m) => s.value ? le((E(), k("select", {
36
+ return B(l), (u, d) => s.value ? se((b(), k("select", {
40
37
  key: 1,
41
- "onUpdate:modelValue": m[0] || (m[0] = (b) => a.value = b)
38
+ "onUpdate:modelValue": d[0] || (d[0] = (E) => a.value = E)
42
39
  }, [
43
- n.nullText ? (E(), k("option", rn, W(n.nullText), 1)) : V("", !0),
44
- (E(!0), k(re, null, ae(s.value, (b, p) => {
45
- var y;
46
- return E(), k("option", {
47
- key: p,
48
- value: (y = l.value) == null ? void 0 : y[p]
49
- }, W(b), 9, an);
50
- }), 128))
40
+ n.nullText ? (b(), k("option", en, R(n.nullText), 1)) : H("", !0),
41
+ (b(!0), k(ie, null, re(s.value, (E, h) => (b(), k("option", {
42
+ key: h,
43
+ value: r.value?.[h]
44
+ }, R(E), 9, tn))), 128))
51
45
  ], 512)), [
52
- [_t, a.value]
53
- ]) : (E(), k("select", ln, [
54
- $("option", null, W(n.loadingText || "Loading..."), 1)
46
+ [Dt, a.value]
47
+ ]) : (b(), k("select", Qt, [
48
+ A("option", null, R(n.loadingText || "Loading..."), 1)
55
49
  ]));
56
50
  }
57
- }), un = /* @__PURE__ */ R({
51
+ }), nn = /* @__PURE__ */ N({
58
52
  __name: "overlay-anchor",
59
53
  props: {
60
54
  overlayId: {},
61
55
  anchor: {}
62
56
  },
63
57
  setup(e) {
64
- const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = S({ visibility: "hidden", top: "0", left: "0" }), l = S([]), s = Ee();
65
- _(a);
58
+ const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = S({ visibility: "hidden", top: "0", left: "0" }), r = S([]), s = we();
59
+ B(a);
66
60
  function a() {
67
61
  if (!s) return;
68
- const m = s.vnode.el, { styles: b, classes: p } = r(m, n);
69
- o.value = b, l.value = p;
62
+ const d = s.vnode.el, { styles: E, classes: h } = l(d, n);
63
+ o.value = E, r.value = h;
70
64
  }
71
- function r(m, b) {
72
- const p = t.anchor instanceof HTMLElement ? {} : t.anchor, y = b.getBoundingClientRect(), c = m.getBoundingClientRect();
73
- p.matchWidth && (c.width = y.width), p.matchHeight && (c.height = y.height);
74
- const f = p.class ? Array.isArray(p.class) ? p.class : [p.class] : [];
75
- let g, M;
76
- if (p.y === "center")
77
- g = y.top + y.height / 2 - c.height / 2, f.push("anchored-center-y");
65
+ function l(d, E) {
66
+ const h = t.anchor instanceof HTMLElement ? {} : t.anchor, g = E.getBoundingClientRect(), c = d.getBoundingClientRect();
67
+ h.matchWidth && (c.width = g.width), h.matchHeight && (c.height = g.height);
68
+ const f = h.class ? Array.isArray(h.class) ? h.class : [h.class] : [];
69
+ let m, C;
70
+ if (h.y === "center")
71
+ m = g.top + g.height / 2 - c.height / 2, f.push("anchored-center-y");
78
72
  else {
79
- const B = (y.bottom + c.height < window.innerHeight || p.y === "below") && p.y !== "above";
80
- g = B ? y.bottom : y.top - c.height, f.push(B ? "anchored-top" : "anchored-bottom");
73
+ const $ = (g.bottom + c.height < window.innerHeight || h.y === "below") && h.y !== "above";
74
+ m = $ ? g.bottom : g.top - c.height, f.push($ ? "anchored-top" : "anchored-bottom");
81
75
  }
82
- if (p.x === "center")
83
- M = y.left + y.width / 2 - c.width / 2, f.push("anchored-center-x");
76
+ if (h.x === "center")
77
+ C = g.left + g.width / 2 - c.width / 2, f.push("anchored-center-x");
84
78
  else {
85
- const B = (y.left + c.width < window.innerWidth || p.x === "left") && p.x !== "right";
86
- M = B ? y.left : y.right - c.width, f.push(B ? "anchored-left" : "anchored-right");
79
+ const $ = (g.left + c.width < window.innerWidth || h.x === "left") && h.x !== "right";
80
+ C = $ ? g.left : g.right - c.width, f.push($ ? "anchored-left" : "anchored-right");
87
81
  }
88
82
  return {
89
83
  styles: {
90
- top: `${g}px`,
91
- left: `${M}px`,
92
- ...p.matchWidth ? { width: `${c.width}px` } : {},
93
- ...p.matchHeight ? { height: `${c.height}px` } : {}
84
+ top: `${m}px`,
85
+ left: `${C}px`,
86
+ ...h.matchWidth ? { width: `${c.width}px` } : {},
87
+ ...h.matchHeight ? { height: `${c.height}px` } : {}
94
88
  },
95
89
  classes: f
96
90
  };
97
91
  }
98
92
  function u() {
99
- window.removeEventListener("click", u), fn(t.overlayId);
93
+ window.removeEventListener("click", u), rn(t.overlayId);
100
94
  }
101
- return _(() => {
95
+ return B(() => {
102
96
  setTimeout(() => {
103
97
  window.addEventListener("click", u);
104
98
  }, 10);
105
- }), (m, b) => (E(), k("div", {
106
- class: A(["vf-overlay-anchor", l.value]),
107
- style: Nt(o.value),
108
- onClick: ke(u, ["stop"])
99
+ }), (d, E) => (b(), k("div", {
100
+ class: V(["vf-overlay-anchor", r.value]),
101
+ style: Ht(o.value),
102
+ onClick: Ee(u, ["stop"])
109
103
  }, [
110
- j(m.$slots, "default")
104
+ W(d.$slots, "default")
111
105
  ], 6));
112
106
  }
113
107
  });
114
- let cn = 0;
115
- const N = Rt([]), qo = R({
108
+ let on = 0;
109
+ const _ = Vt([]), _o = N({
116
110
  setup() {
117
- return () => ue("div", [
118
- ae(N, (e) => ue(Wt, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
111
+ return () => le("div", [
112
+ re(_, (e) => le(At, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
119
113
  ]);
120
114
  }
121
115
  });
122
- function de(e, t, n) {
116
+ function ue(e, t, n) {
123
117
  const o = document.getElementById("vf-overlay-target") ?? document.createElement("div");
124
118
  o.id = "vf-overlay-target", o.removeAttribute("inert"), document.body.appendChild(o);
125
- const l = String(++cn), s = jt(e), a = ue(s, t), r = n != null && n.anchor ? ue(un, { overlayId: l, anchor: n.anchor }, () => [a]) : void 0, u = {
126
- id: l,
119
+ const r = String(++on), s = $t(e), a = le(s, t), l = n?.anchor ? le(nn, { overlayId: r, anchor: n.anchor }, () => [a]) : void 0, u = {
120
+ id: r,
127
121
  component: s,
128
122
  props: t,
129
123
  options: n ?? {},
130
124
  vnode: a,
131
- wrapperVnode: r
125
+ wrapperVnode: l
132
126
  };
133
- return N.push(u), u;
127
+ return _.push(u), u;
134
128
  }
135
- function zo(e) {
136
- e.$ && lt(e.$);
129
+ function No(e) {
130
+ e.$ && tt(e.$);
137
131
  }
138
- function lt(e) {
132
+ function tt(e) {
139
133
  let t = e;
140
- for (; t && !dn(t.vnode); )
134
+ for (; t && !sn(t.vnode); )
141
135
  t = t.parent;
142
136
  }
143
- function dn(e) {
144
- const t = N.findIndex((n) => n.vnode.component === e.component);
145
- return t >= 0 ? (N[t].props.callback(), !0) : !1;
137
+ function sn(e) {
138
+ const t = _.findIndex((n) => n.vnode.component === e.component);
139
+ return t >= 0 ? (_[t].props.callback(), !0) : !1;
146
140
  }
147
- function fn(e) {
148
- const t = N.findIndex((n) => n.id === e);
149
- return t >= 0 ? (N[t].props.callback(), !0) : !1;
141
+ function rn(e) {
142
+ const t = _.findIndex((n) => n.id === e);
143
+ return t >= 0 ? (_[t].props.callback(), !0) : !1;
150
144
  }
151
- function ee(e) {
152
- const t = N.indexOf(e);
153
- t >= 0 && N.splice(t, 1);
145
+ function J(e) {
146
+ const t = _.indexOf(e);
147
+ t >= 0 && _.splice(t, 1);
154
148
  }
155
- async function Te(e, t, n) {
149
+ async function be(e, t, n) {
156
150
  return new Promise((o) => {
157
- let l = null;
158
- const a = { ...t, callback: async (r) => {
159
- if (n != null && n.onCallback) {
160
- const u = n.onCallback(r);
151
+ let r = null;
152
+ const a = { ...t, callback: async (l) => {
153
+ if (n?.onCallback) {
154
+ const u = n.onCallback(l);
161
155
  if (typeof u == "object" && "then" in u && typeof u.then == "function" && await u === !1)
162
156
  return;
163
157
  }
164
- ee(l), o(r);
158
+ J(r), o(l);
165
159
  } };
166
- l = de(e, a, n);
160
+ r = ue(e, a, n);
167
161
  });
168
162
  }
169
- async function vn(e, t) {
163
+ async function ln(e, t) {
170
164
  const n = e.vnode.component.props;
171
165
  for (const o in t)
172
166
  n[o] = t[o];
173
167
  }
174
- function ne(e, t) {
168
+ function ee(e, t) {
175
169
  return typeof e == "object" && !(e instanceof Error) ? {
176
170
  ...e,
177
171
  classes: e.classes ?? []
178
172
  } : { title: t ? e : void 0, message: t ?? e, classes: [] };
179
173
  }
180
- async function mn(e, t) {
181
- await Te(oe, ne(e, t));
174
+ async function an(e, t) {
175
+ await be(te, ee(e, t));
182
176
  }
183
- async function Ko(e, t) {
184
- const n = ne(e, t);
185
- return await Te(oe, {
177
+ async function Ro(e, t) {
178
+ const n = ee(e, t);
179
+ return await be(te, {
186
180
  ...n,
187
181
  shouldConfirm: !0
188
182
  }) === !0;
189
183
  }
190
- async function Yo(e, t) {
191
- const n = ne(e, t);
192
- return await Te(oe, {
184
+ async function Wo(e, t) {
185
+ const n = ee(e, t);
186
+ return await be(te, {
193
187
  ...n,
194
188
  shouldConfirm: !0,
195
189
  classes: ["destructive", ...n.classes]
196
190
  }) === !0;
197
191
  }
198
- function Xo(e, t) {
199
- const n = ne(e, t), o = de(oe, {
192
+ function jo(e, t) {
193
+ const n = ee(e, t), o = ue(te, {
200
194
  ...n,
201
195
  isBare: !0,
202
196
  classes: ["wait", ...n.classes],
203
197
  callback: () => {
204
198
  }
205
199
  });
206
- return () => ee(o);
200
+ return () => J(o);
207
201
  }
208
- function Zo(e, t) {
209
- const n = ne(e, t), o = de(oe, {
202
+ function Uo(e, t) {
203
+ const n = ee(e, t), o = ue(te, {
210
204
  ...n,
211
205
  isBare: !0,
212
206
  classes: ["wait", ...n.classes],
@@ -214,107 +208,104 @@ function Zo(e, t) {
214
208
  }
215
209
  });
216
210
  return {
217
- update: (l) => {
218
- vn(o, { message: l });
211
+ update: (r) => {
212
+ ln(o, { message: r });
219
213
  },
220
- dismiss: () => ee(o)
214
+ dismiss: () => J(o)
221
215
  };
222
216
  }
223
- const I = {
217
+ const F = {
224
218
  unhandledErrorSupportText: "please contact support",
225
219
  errorHandler: (e) => console.error("Unhandled error:", e),
226
220
  defaultDateFormat: "M/d/yy",
227
221
  defaultTimeFormat: "H:mm",
228
222
  defaultCurrencyDivisor: 1
229
223
  };
230
- function Go(e) {
231
- Object.assign(I, e);
224
+ function Po(e) {
225
+ Object.assign(F, e);
232
226
  }
233
- class fe extends Error {
227
+ class ce extends Error {
234
228
  constructor(t) {
235
229
  super(t), this.name = "UserError";
236
230
  }
237
231
  }
238
- function pn(e) {
239
- return e instanceof fe ? e.message : `An application error has occurred:
232
+ function un(e) {
233
+ return e instanceof ce ? e.message : `An application error has occurred:
240
234
 
241
- ${Ce(e).message}
235
+ ${ke(e).message}
242
236
 
243
- Please refresh the page and try again. If this error persists, ${I.unhandledErrorSupportText}.`;
237
+ Please refresh the page and try again. If this error persists, ${F.unhandledErrorSupportText}.`;
244
238
  }
245
- function Ce(e) {
246
- return hn(e) ? e : new Error(String(e));
239
+ function ke(e) {
240
+ return cn(e) ? e : new Error(String(e));
247
241
  }
248
- function hn(e) {
242
+ function cn(e) {
249
243
  return e instanceof Error || typeof e == "object" && e !== null && "message" in e && "name" in e;
250
244
  }
251
- async function Jo(e, t) {
252
- const n = Ce(e);
253
- return n instanceof fe || I.errorHandler(n), mn({
254
- title: t == null ? void 0 : t.title,
245
+ async function qo(e, t) {
246
+ const n = ke(e);
247
+ return n instanceof ce || F.errorHandler(n), an({
248
+ title: t?.title,
255
249
  message: n,
256
- classes: t == null ? void 0 : t.classes
250
+ classes: t?.classes
257
251
  });
258
252
  }
259
- async function Qo(e) {
260
- const t = Ce(e);
261
- t instanceof fe || I.errorHandler(t);
253
+ async function zo(e) {
254
+ const t = ke(e);
255
+ t instanceof ce || F.errorHandler(t);
262
256
  }
263
- const G = Symbol("MaskState");
264
- function es(e, t) {
265
- var l;
266
- const n = (l = e.$) == null ? void 0 : l.vnode.el, o = n.closest(".vf-modal");
267
- return yn(o ?? n, t);
257
+ const X = Symbol("MaskState");
258
+ function Ko(e, t) {
259
+ const n = e.$?.vnode.el, o = n.closest(".vf-modal");
260
+ return dn(o ?? n, t);
268
261
  }
269
- function ts(e) {
270
- var o;
271
- const t = (o = e.$) == null ? void 0 : o.vnode.el, n = t.closest(".vf-modal");
272
- return rt(n ?? t);
262
+ function Yo(e) {
263
+ const t = e.$?.vnode.el, n = t.closest(".vf-modal");
264
+ return nt(n ?? t);
273
265
  }
274
- function yn(e, t) {
275
- if (!e[G]) {
266
+ function dn(e, t) {
267
+ if (!e[X]) {
276
268
  const n = document.createElement("div");
277
- n.classList.add("vf-mask"), e.appendChild(n), e[G] = { maskEl: n };
269
+ n.classList.add("vf-mask"), e.appendChild(n), e[X] = { maskEl: n };
278
270
  }
279
- return e[G].maskEl.innerText = t ?? "", () => rt(e);
271
+ return e[X].maskEl.innerText = t ?? "", () => nt(e);
280
272
  }
281
- function rt(e) {
282
- e[G] && e.removeChild(e[G].maskEl);
273
+ function nt(e) {
274
+ e[X] && e.removeChild(e[X].maskEl);
283
275
  }
284
- const be = Symbol("FormMaskState");
285
- function gn(e, t, n) {
286
- const o = e instanceof Element ? e : ut(e);
276
+ const ge = Symbol("FormMaskState");
277
+ function fn(e, t, n) {
278
+ const o = e instanceof Element ? e : st(e);
287
279
  if (!o) return () => {
288
280
  };
289
281
  o.classList.add("vf-masked");
290
- const l = t instanceof Element ? t : o.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
282
+ const r = t instanceof Element ? t : o.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
291
283
  let s;
292
- l && (s = l.tagName === "INPUT" ? l.value : l.innerHTML, l.setAttribute("disabled", "disabled"), l.innerText = n ?? "Please wait...");
293
- const r = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
294
- return r.forEach((u) => u.setAttribute("disabled", "disabled")), o[be] = {
295
- disabledElements: r,
296
- waitButton: l,
284
+ r && (s = r.tagName === "INPUT" ? r.value : r.innerHTML, r.setAttribute("disabled", "disabled"), r.innerText = n ?? "Please wait...");
285
+ const l = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
286
+ return l.forEach((u) => u.setAttribute("disabled", "disabled")), o[ge] = {
287
+ disabledElements: l,
288
+ waitButton: r,
297
289
  buttonHtml: s
298
- }, () => at(o);
290
+ }, () => ot(o);
299
291
  }
300
- function at(e) {
301
- const t = e instanceof Element ? e : ut(e);
292
+ function ot(e) {
293
+ const t = e instanceof Element ? e : st(e);
302
294
  if (!t) return;
303
- const n = t[be];
304
- n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((o) => o.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[be]);
295
+ const n = t[ge];
296
+ n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((o) => o.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[ge]);
305
297
  }
306
- function ut(e) {
307
- var n;
308
- const t = (n = e == null ? void 0 : e.$) == null ? void 0 : n.vnode.el;
298
+ function st(e) {
299
+ const t = e?.$?.vnode.el;
309
300
  return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
310
301
  }
311
- const wn = ["id"], bn = {
302
+ const pn = ["id"], vn = {
312
303
  key: 0,
313
304
  class: "vf-modal-header"
314
- }, En = { class: "vf-modal-content" }, kn = {
305
+ }, mn = { class: "vf-modal-content" }, hn = {
315
306
  key: 1,
316
307
  class: "vf-modal-footer"
317
- }, Tn = /* @__PURE__ */ R({
308
+ }, yn = /* @__PURE__ */ N({
318
309
  __name: "vf-modal",
319
310
  props: {
320
311
  id: {},
@@ -325,32 +316,31 @@ const wn = ["id"], bn = {
325
316
  },
326
317
  emits: ["formSubmit"],
327
318
  setup(e, { expose: t }) {
328
- const n = Ee(), o = e;
329
- t({ mask: p, unmask: y, hide: c, unhide: f });
330
- const l = S(), s = S(), a = S(!1), r = T(() => st([...Array.isArray(o.class) ? o.class : [o.class], a.value && "hidden"]));
331
- _(() => {
332
- var g;
333
- document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", m), (g = l.value) == null || g.addEventListener("click", u));
334
- }), ce(() => {
335
- window.removeEventListener("keydown", m), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
319
+ const n = we(), o = e;
320
+ t({ mask: h, unmask: g, hide: c, unhide: f });
321
+ const r = S(), s = S(), a = S(!1), l = T(() => Qe([...Array.isArray(o.class) ? o.class : [o.class], a.value && "hidden"]));
322
+ B(() => {
323
+ document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", d), r.value?.addEventListener("click", u));
324
+ }), ae(() => {
325
+ window.removeEventListener("keydown", d), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
336
326
  });
337
- function u(g) {
338
- g.target == l.value && b();
327
+ function u(m) {
328
+ m.target == r.value && E();
339
329
  }
340
- function m(g) {
341
- if (g.key === "Esc" || g.key === "Escape") {
342
- const M = document.querySelectorAll(".vf-modal-wrap");
343
- M[M.length - 1] === l.value && b();
330
+ function d(m) {
331
+ if (m.key === "Esc" || m.key === "Escape") {
332
+ const C = document.querySelectorAll(".vf-modal-wrap");
333
+ C[C.length - 1] === r.value && E();
344
334
  }
345
335
  }
346
- function b() {
347
- lt(n);
336
+ function E() {
337
+ tt(n);
348
338
  }
349
- function p() {
350
- return gn(s.value), () => y();
339
+ function h() {
340
+ return fn(s.value), () => g();
351
341
  }
352
- function y() {
353
- at(s.value);
342
+ function g() {
343
+ ot(s.value);
354
344
  }
355
345
  function c() {
356
346
  return a.value = !0, () => f();
@@ -358,37 +348,37 @@ const wn = ["id"], bn = {
358
348
  function f() {
359
349
  a.value = !1;
360
350
  }
361
- return (g, M) => (E(), k("div", {
362
- id: g.id,
351
+ return (m, C) => (b(), k("div", {
352
+ id: m.id,
363
353
  ref_key: "overlay",
364
- ref: l,
365
- class: A(["vf-overlay vf-modal-wrap", r.value])
354
+ ref: r,
355
+ class: V(["vf-overlay vf-modal-wrap", l.value])
366
356
  }, [
367
- $("form", {
357
+ A("form", {
368
358
  ref_key: "form",
369
359
  ref: s,
370
360
  action: ".",
371
- class: A(["vf-modal", { scrolls: g.scrolls }]),
372
- onSubmit: M[0] || (M[0] = ke((L) => g.$emit("formSubmit"), ["prevent"]))
361
+ class: V(["vf-modal", { scrolls: m.scrolls }]),
362
+ onSubmit: C[0] || (C[0] = Ee((x) => m.$emit("formSubmit"), ["prevent"]))
373
363
  }, [
374
- g.$slots.header ? (E(), k("div", bn, [
375
- j(g.$slots, "header"),
376
- o.closeX ? (E(), k("i", {
364
+ m.$slots.header ? (b(), k("div", vn, [
365
+ W(m.$slots, "header"),
366
+ o.closeX ? (b(), k("i", {
377
367
  key: 0,
378
368
  class: "close",
379
- onClick: b
380
- })) : V("", !0)
381
- ])) : V("", !0),
382
- $("div", En, [
383
- j(g.$slots, "default")
369
+ onClick: E
370
+ })) : H("", !0)
371
+ ])) : H("", !0),
372
+ A("div", mn, [
373
+ W(m.$slots, "default")
384
374
  ]),
385
- g.$slots.footer ? (E(), k("div", kn, [
386
- j(g.$slots, "footer")
387
- ])) : V("", !0)
375
+ m.$slots.footer ? (b(), k("div", hn, [
376
+ W(m.$slots, "footer")
377
+ ])) : H("", !0)
388
378
  ], 34)
389
- ], 10, wn));
379
+ ], 10, pn));
390
380
  }
391
- }), Cn = ["innerHtml"], Sn = ["innerText"], oe = /* @__PURE__ */ R({
381
+ }), gn = ["innerHtml"], wn = ["innerText"], te = /* @__PURE__ */ N({
392
382
  __name: "vf-alert-modal",
393
383
  props: {
394
384
  isBare: { type: Boolean },
@@ -401,57 +391,57 @@ const wn = ["id"], bn = {
401
391
  callback: { type: Function }
402
392
  },
403
393
  setup(e) {
404
- const t = e, n = T(() => t.message instanceof Error ? pn(t.message) : t.message);
405
- return (o, l) => {
406
- const s = Ut("autofocus");
407
- return E(), tt(Tn, {
408
- class: A(["vf-alert", ...o.classes ?? []])
409
- }, Pt({
410
- default: ye(() => [
411
- o.iconClass ? (E(), k("i", {
394
+ const t = e, n = T(() => t.message instanceof Error ? un(t.message) : t.message);
395
+ return (o, r) => {
396
+ const s = Bt("autofocus");
397
+ return b(), Ze(yn, {
398
+ class: V(["vf-alert", ...o.classes ?? []])
399
+ }, _t({
400
+ default: me(() => [
401
+ o.iconClass ? (b(), k("i", {
412
402
  key: 0,
413
- class: A(["vf-alert-icon", o.iconClass])
414
- }, null, 2)) : V("", !0),
415
- o.isHtml ? (E(), k("div", {
403
+ class: V(["vf-alert-icon", o.iconClass])
404
+ }, null, 2)) : H("", !0),
405
+ o.isHtml ? (b(), k("div", {
416
406
  key: 1,
417
407
  innerHtml: o.message,
418
408
  class: "user-message"
419
- }, null, 8, Cn)) : (E(), k("div", {
409
+ }, null, 8, gn)) : (b(), k("div", {
420
410
  key: 2,
421
411
  innerText: n.value
422
- }, null, 8, Sn))
412
+ }, null, 8, wn))
423
413
  ]),
424
414
  _: 2
425
415
  }, [
426
416
  o.title ? {
427
417
  name: "header",
428
- fn: ye(() => [
429
- Z(W(o.title), 1)
418
+ fn: me(() => [
419
+ Y(R(o.title), 1)
430
420
  ]),
431
421
  key: "0"
432
422
  } : void 0,
433
423
  o.isBare ? void 0 : {
434
424
  name: "footer",
435
- fn: ye(() => [
436
- o.shouldConfirm ? (E(), k(re, { key: 0 }, [
437
- le((E(), k("button", {
425
+ fn: me(() => [
426
+ o.shouldConfirm ? (b(), k(ie, { key: 0 }, [
427
+ se((b(), k("button", {
438
428
  class: "primary",
439
- onClick: l[0] || (l[0] = () => o.callback(!0))
440
- }, l[3] || (l[3] = [
441
- Z("Confirm")
429
+ onClick: r[0] || (r[0] = () => o.callback(!0))
430
+ }, r[3] || (r[3] = [
431
+ Y("Confirm")
442
432
  ]))), [
443
433
  [s]
444
434
  ]),
445
- $("button", {
435
+ A("button", {
446
436
  class: "default",
447
- onClick: l[1] || (l[1] = () => o.callback(!1))
437
+ onClick: r[1] || (r[1] = () => o.callback(!1))
448
438
  }, "Cancel")
449
- ], 64)) : le((E(), k("button", {
439
+ ], 64)) : se((b(), k("button", {
450
440
  key: 1,
451
441
  class: "default",
452
- onClick: l[2] || (l[2] = () => o.callback(!0))
453
- }, l[4] || (l[4] = [
454
- Z("OK")
442
+ onClick: r[2] || (r[2] = () => o.callback(!0))
443
+ }, r[4] || (r[4] = [
444
+ Y("OK")
455
445
  ]))), [
456
446
  [s]
457
447
  ])
@@ -462,67 +452,66 @@ const wn = ["id"], bn = {
462
452
  };
463
453
  }
464
454
  });
465
- function ns(e, t, n) {
455
+ function Xo(e, t, n) {
466
456
  const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
467
457
  return o === -1 ? !1 : (e.splice(o, 1, n), !0);
468
458
  }
469
- function os(e, t) {
459
+ function Zo(e, t) {
470
460
  const n = document.createElement("div");
471
- n.classList.add("vf-overlay"), n.addEventListener("click", p), document.body.appendChild(n);
461
+ n.classList.add("vf-overlay"), n.addEventListener("click", h), document.body.appendChild(n);
472
462
  const o = document.createElement("div");
473
463
  o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
474
- const l = e.currentTarget;
475
- l.style.userSelect = "none", l.classList.add("context-menu-active"), t.targetClass && l.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((c) => {
464
+ const r = e.currentTarget;
465
+ r.style.userSelect = "none", r.classList.add("context-menu-active"), t.targetClass && r.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((c) => {
476
466
  if (c == "-") {
477
- const g = document.createElement("div");
478
- g.classList.add("separator"), o.appendChild(g);
467
+ const m = document.createElement("div");
468
+ m.classList.add("separator"), o.appendChild(m);
479
469
  return;
480
470
  }
481
471
  const f = document.createElement("div");
482
- f.classList.add("item"), f.style.userSelect = "none", f.innerText = c.title, o.appendChild(f), c.class && f.classList.add(c.class), c.shouldConfirm ? f.addEventListener("click", (g) => y(g, f, c.handler)) : f.addEventListener("click", () => c.handler());
472
+ f.classList.add("item"), f.style.userSelect = "none", f.innerText = c.title, o.appendChild(f), c.class && f.classList.add(c.class), c.shouldConfirm ? f.addEventListener("click", (m) => g(m, f, c.handler)) : f.addEventListener("click", () => c.handler());
483
473
  });
484
- const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, r = o.offsetHeight, u = o.offsetWidth, m = s < u ? e.clientX - u - 1 : e.clientX + 1, b = a < r ? e.clientY - r - 1 : e.clientY + 1;
485
- o.style.left = m + "px", o.style.top = b + "px", setTimeout(() => {
474
+ const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, l = o.offsetHeight, u = o.offsetWidth, d = s < u ? e.clientX - u - 1 : e.clientX + 1, E = a < l ? e.clientY - l - 1 : e.clientY + 1;
475
+ o.style.left = d + "px", o.style.top = E + "px", setTimeout(() => {
486
476
  o.style.width = o.offsetWidth + "px";
487
477
  }, 50);
488
- function p() {
489
- t.targetClass && l.classList.remove(t.targetClass), l.classList.remove("context-menu-active"), l.style.userSelect = "", n.remove();
478
+ function h() {
479
+ t.targetClass && r.classList.remove(t.targetClass), r.classList.remove("context-menu-active"), r.style.userSelect = "", n.remove();
490
480
  }
491
- function y(c, f, g) {
481
+ function g(c, f, m) {
492
482
  if (f.classList.contains("pending-confirm"))
493
- return g();
494
- const M = f.innerHTML;
483
+ return m();
484
+ const C = f.innerHTML;
495
485
  f.classList.add("pending-confirm"), f.innerText = "Confirm";
496
- const L = () => {
497
- f.classList.remove("pending-confirm"), f.innerHTML = M, f.removeEventListener("mouseleave", L);
486
+ const x = () => {
487
+ f.classList.remove("pending-confirm"), f.innerHTML = C, f.removeEventListener("mouseleave", x);
498
488
  };
499
- f.addEventListener("mouseleave", L), c.stopPropagation();
489
+ f.addEventListener("mouseleave", x), c.stopPropagation();
500
490
  }
501
491
  }
502
- const Mn = (e) => new Promise((t) => setTimeout(t, e)), ss = (e) => Mn(e * 1e3);
503
- function Ln(e) {
492
+ const En = (e) => new Promise((t) => setTimeout(t, e)), Go = (e) => En(e * 1e3);
493
+ function bn(e) {
504
494
  return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
505
495
  }
506
- function is(e, t) {
507
- return e != null ? zt(e) : t;
496
+ function Jo(e, t) {
497
+ return e != null ? Rt(e) : t;
508
498
  }
509
- function ls(e, t) {
499
+ function Qo(e, t) {
510
500
  const n = { ...e };
511
501
  for (const o of t)
512
502
  n[o] === "" && (n[o] = null);
513
503
  return n;
514
504
  }
515
- function Pe(e) {
505
+ function Ne(e) {
516
506
  return e != null;
517
507
  }
518
- function rs(e, t) {
519
- en(e, {
508
+ function es(e, t) {
509
+ Yt(e, {
520
510
  ...t,
521
511
  onError(n, o) {
522
- var s;
523
- n instanceof tn && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new fe(n.body.error));
524
- const l = (s = t.onError) == null ? void 0 : s.call(t, n, o);
525
- return l !== void 0 ? l : n;
512
+ n instanceof Xt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new ce(n.body.error));
513
+ const r = t.onError?.(n, o);
514
+ return r !== void 0 ? r : n;
526
515
  }
527
516
  });
528
517
  }
@@ -533,7 +522,7 @@ function rs(e, t) {
533
522
  * Copyright (c) 2021 Jason Wilson
534
523
  * Released under MIT license
535
524
  */
536
- var xn = {
525
+ var kn = {
537
526
  symbol: "$",
538
527
  separator: ",",
539
528
  decimal: ".",
@@ -541,51 +530,51 @@ var xn = {
541
530
  precision: 2,
542
531
  pattern: "!#",
543
532
  negativePattern: "-!#",
544
- format: Dn,
533
+ format: xn,
545
534
  fromCents: !1
546
- }, ct = function(t) {
535
+ }, it = function(t) {
547
536
  return Math.round(t);
548
- }, Se = function(t) {
537
+ }, Te = function(t) {
549
538
  return Math.pow(10, t);
550
- }, Fn = function(t, n) {
551
- return ct(t / n) * n;
552
- }, In = /(\d)(?=(\d{3})+\b)/g, On = /(\d)(?=(\d\d)+\d\b)/g;
553
- function H(e, t) {
539
+ }, Tn = function(t, n) {
540
+ return it(t / n) * n;
541
+ }, Sn = /(\d)(?=(\d{3})+\b)/g, Cn = /(\d)(?=(\d\d)+\d\b)/g;
542
+ function D(e, t) {
554
543
  var n = this;
555
- if (!(n instanceof H))
556
- return new H(e, t);
557
- var o = Object.assign({}, xn, t), l = Se(o.precision), s = ie(e, o);
558
- n.intValue = s, n.value = s / l, o.increment = o.increment || 1 / l, o.useVedic ? o.groups = On : o.groups = In, this.s = o, this.p = l;
559
- }
560
- function ie(e, t) {
561
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, l = t.decimal, s = t.errorOnInvalid, a = t.precision, r = t.fromCents, u = Se(a), m = typeof e == "number", b = e instanceof H;
562
- if (b && r)
544
+ if (!(n instanceof D))
545
+ return new D(e, t);
546
+ var o = Object.assign({}, kn, t), r = Te(o.precision), s = oe(e, o);
547
+ n.intValue = s, n.value = s / r, o.increment = o.increment || 1 / r, o.useVedic ? o.groups = Cn : o.groups = Sn, this.s = o, this.p = r;
548
+ }
549
+ function oe(e, t) {
550
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, r = t.decimal, s = t.errorOnInvalid, a = t.precision, l = t.fromCents, u = Te(a), d = typeof e == "number", E = e instanceof D;
551
+ if (E && l)
563
552
  return e.intValue;
564
- if (m || b)
565
- o = b ? e.value : e;
553
+ if (d || E)
554
+ o = E ? e.value : e;
566
555
  else if (typeof e == "string") {
567
- var p = new RegExp("[^-\\d" + l + "]", "g"), y = new RegExp("\\" + l, "g");
568
- o = e.replace(/\((.*)\)/, "-$1").replace(p, "").replace(y, "."), o = o || 0;
556
+ var h = new RegExp("[^-\\d" + r + "]", "g"), g = new RegExp("\\" + r, "g");
557
+ o = e.replace(/\((.*)\)/, "-$1").replace(h, "").replace(g, "."), o = o || 0;
569
558
  } else {
570
559
  if (s)
571
560
  throw Error("Invalid Input");
572
561
  o = 0;
573
562
  }
574
- return r || (o *= u, o = o.toFixed(4)), n ? ct(o) : o;
563
+ return l || (o *= u, o = o.toFixed(4)), n ? it(o) : o;
575
564
  }
576
- function Dn(e, t) {
577
- var n = t.pattern, o = t.negativePattern, l = t.symbol, s = t.separator, a = t.decimal, r = t.groups, u = ("" + e).replace(/^-/, "").split("."), m = u[0], b = u[1];
578
- return (e.value >= 0 ? n : o).replace("!", l).replace("#", m.replace(r, "$1" + s) + (b ? a + b : ""));
565
+ function xn(e, t) {
566
+ var n = t.pattern, o = t.negativePattern, r = t.symbol, s = t.separator, a = t.decimal, l = t.groups, u = ("" + e).replace(/^-/, "").split("."), d = u[0], E = u[1];
567
+ return (e.value >= 0 ? n : o).replace("!", r).replace("#", d.replace(l, "$1" + s) + (E ? a + E : ""));
579
568
  }
580
- H.prototype = {
569
+ D.prototype = {
581
570
  /**
582
571
  * Adds values together.
583
572
  * @param {number} number
584
573
  * @returns {currency}
585
574
  */
586
575
  add: function(t) {
587
- var n = this.intValue, o = this.s, l = this.p;
588
- return H((n += ie(t, o)) / (o.fromCents ? 1 : l), o);
576
+ var n = this.intValue, o = this.s, r = this.p;
577
+ return D((n += oe(t, o)) / (o.fromCents ? 1 : r), o);
589
578
  },
590
579
  /**
591
580
  * Subtracts value.
@@ -593,8 +582,8 @@ H.prototype = {
593
582
  * @returns {currency}
594
583
  */
595
584
  subtract: function(t) {
596
- var n = this.intValue, o = this.s, l = this.p;
597
- return H((n -= ie(t, o)) / (o.fromCents ? 1 : l), o);
585
+ var n = this.intValue, o = this.s, r = this.p;
586
+ return D((n -= oe(t, o)) / (o.fromCents ? 1 : r), o);
598
587
  },
599
588
  /**
600
589
  * Multiplies values.
@@ -603,7 +592,7 @@ H.prototype = {
603
592
  */
604
593
  multiply: function(t) {
605
594
  var n = this.intValue, o = this.s;
606
- return H((n *= t) / (o.fromCents ? 1 : Se(o.precision)), o);
595
+ return D((n *= t) / (o.fromCents ? 1 : Te(o.precision)), o);
607
596
  },
608
597
  /**
609
598
  * Divides value.
@@ -612,7 +601,7 @@ H.prototype = {
612
601
  */
613
602
  divide: function(t) {
614
603
  var n = this.intValue, o = this.s;
615
- return H(n /= ie(t, o, !1), o);
604
+ return D(n /= oe(t, o, !1), o);
616
605
  },
617
606
  /**
618
607
  * Takes the currency amount and distributes the values evenly. Any extra pennies
@@ -621,9 +610,9 @@ H.prototype = {
621
610
  * @returns {array}
622
611
  */
623
612
  distribute: function(t) {
624
- for (var n = this.intValue, o = this.p, l = this.s, s = [], a = Math[n >= 0 ? "floor" : "ceil"](n / t), r = Math.abs(n - a * t), u = l.fromCents ? 1 : o; t !== 0; t--) {
625
- var m = H(a / u, l);
626
- r-- > 0 && (m = m[n >= 0 ? "add" : "subtract"](1 / u)), s.push(m);
613
+ for (var n = this.intValue, o = this.p, r = this.s, s = [], a = Math[n >= 0 ? "floor" : "ceil"](n / t), l = Math.abs(n - a * t), u = r.fromCents ? 1 : o; t !== 0; t--) {
614
+ var d = D(a / u, r);
615
+ l-- > 0 && (d = d[n >= 0 ? "add" : "subtract"](1 / u)), s.push(d);
627
616
  }
628
617
  return s;
629
618
  },
@@ -657,7 +646,7 @@ H.prototype = {
657
646
  */
658
647
  toString: function() {
659
648
  var t = this.intValue, n = this.p, o = this.s;
660
- return Fn(t / n, o.increment).toFixed(o.precision);
649
+ return Tn(t / n, o.increment).toFixed(o.precision);
661
650
  },
662
651
  /**
663
652
  * Value for JSON serialization.
@@ -667,59 +656,58 @@ H.prototype = {
667
656
  return this.value;
668
657
  }
669
658
  };
670
- const x = [];
659
+ const M = [];
671
660
  for (let e = 0; e < 256; ++e)
672
- x.push((e + 256).toString(16).slice(1));
673
- function Hn(e, t = 0) {
674
- return (x[e[t + 0]] + x[e[t + 1]] + x[e[t + 2]] + x[e[t + 3]] + "-" + x[e[t + 4]] + x[e[t + 5]] + "-" + x[e[t + 6]] + x[e[t + 7]] + "-" + x[e[t + 8]] + x[e[t + 9]] + "-" + x[e[t + 10]] + x[e[t + 11]] + x[e[t + 12]] + x[e[t + 13]] + x[e[t + 14]] + x[e[t + 15]]).toLowerCase();
675
- }
676
- let ge;
677
- const Vn = new Uint8Array(16);
678
- function An() {
679
- if (!ge) {
661
+ M.push((e + 256).toString(16).slice(1));
662
+ function Mn(e, t = 0) {
663
+ return (M[e[t + 0]] + M[e[t + 1]] + M[e[t + 2]] + M[e[t + 3]] + "-" + M[e[t + 4]] + M[e[t + 5]] + "-" + M[e[t + 6]] + M[e[t + 7]] + "-" + M[e[t + 8]] + M[e[t + 9]] + "-" + M[e[t + 10]] + M[e[t + 11]] + M[e[t + 12]] + M[e[t + 13]] + M[e[t + 14]] + M[e[t + 15]]).toLowerCase();
664
+ }
665
+ let he;
666
+ const Ln = new Uint8Array(16);
667
+ function Fn() {
668
+ if (!he) {
680
669
  if (typeof crypto > "u" || !crypto.getRandomValues)
681
670
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
682
- ge = crypto.getRandomValues.bind(crypto);
671
+ he = crypto.getRandomValues.bind(crypto);
683
672
  }
684
- return ge(Vn);
673
+ return he(Ln);
685
674
  }
686
- const $n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), qe = { randomUUID: $n };
687
- function Bn(e, t, n) {
688
- var l;
689
- if (qe.randomUUID && !e)
690
- return qe.randomUUID();
675
+ const In = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Re = { randomUUID: In };
676
+ function On(e, t, n) {
677
+ if (Re.randomUUID && !e)
678
+ return Re.randomUUID();
691
679
  e = e || {};
692
- const o = e.random ?? ((l = e.rng) == null ? void 0 : l.call(e)) ?? An();
680
+ const o = e.random ?? e.rng?.() ?? Fn();
693
681
  if (o.length < 16)
694
682
  throw new Error("Random bytes length must be >= 16");
695
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Hn(o);
683
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Mn(o);
696
684
  }
697
- function as(e) {
685
+ function ts(e) {
698
686
  return e.replace(/\n/g, "<br>");
699
687
  }
700
- function _n(e) {
688
+ function Dn(e) {
701
689
  return e.replace(/_/g, " ");
702
690
  }
703
- function Nn(e) {
691
+ function Hn(e) {
704
692
  const t = e.replace(/\D/g, "").replace(/^1/, "");
705
693
  return t.length !== 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
706
694
  }
707
- function Rn(e, t) {
708
- return H(e).divide(t ?? I.defaultCurrencyDivisor).format();
695
+ function Vn(e, t) {
696
+ return D(e).divide(t ?? F.defaultCurrencyDivisor).format();
709
697
  }
710
- function us() {
711
- return Bn();
698
+ function ns() {
699
+ return On();
712
700
  }
713
- const Wn = ["disabled", "placeholder", "required", "name"], jn = {
701
+ const An = ["disabled", "placeholder", "required", "name"], $n = {
714
702
  key: 0,
715
703
  class: "no-results"
716
- }, Un = {
704
+ }, Bn = {
717
705
  key: 0,
718
706
  class: "group-title"
719
- }, Pn = ["onMousemove", "onMousedown"], qn = ["innerHTML"], zn = ["innerHTML"], Kn = {
707
+ }, _n = ["onMousemove", "onMousedown"], Nn = ["innerHTML"], Rn = ["innerHTML"], Wn = {
720
708
  key: 1,
721
709
  class: "no-results"
722
- }, Yn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Xn = /* @__PURE__ */ R({
710
+ }, jn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Un = /* @__PURE__ */ N({
723
711
  __name: "vf-smart-select",
724
712
  props: {
725
713
  modelValue: {},
@@ -756,40 +744,36 @@ const Wn = ["disabled", "placeholder", "required", "name"], jn = {
756
744
  },
757
745
  emits: ["optionsLoaded", "update:modelValue"],
758
746
  setup(e, { expose: t, emit: n }) {
759
- const o = Symbol("null"), l = Symbol("create"), s = e, a = n;
747
+ const o = Symbol("null"), r = Symbol("create"), s = e, a = n;
760
748
  t({
761
- addRemoteOption: At
749
+ addRemoteOption: Ot
762
750
  });
763
- const r = S(), u = S(), m = S(), b = S(!1), p = S(), y = S(!1), c = S(""), f = S(null), g = S(null), M = S(!1), L = S(null), B = S(!1), wt = T(() => s.showCreateTextOnNewItem ?? !0), q = T(() => !!(s.options || p.value)), bt = T(() => s.options ?? p.value ?? []), Et = T(() => s.prependOptions ?? []), kt = T(() => s.appendOptions ?? []), xe = T(() => !!s.disabled || !q.value && !s.loadOptions), Tt = T(() => !q.value && s.preload ? "Loading..." : s.nullTitle ? s.nullTitle : s.placeholder || ""), Ct = T(() => s.noResultsText || "No options match your search."), z = T(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), K = T(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : z.value ? (i) => String(z.value(i)) : null), ve = T(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Fe = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Ie = T(() => s.selectionFormatter ? s.selectionFormatter : Fe.value), Oe = T(() => [...Et.value, ...bt.value, ...kt.value]), De = T(() => !!(s.groupField || s.groupFormatter)), me = T(() => Oe.value.map((i, v) => {
764
- var Re, We, je;
765
- const h = (Re = ve.value) == null ? void 0 : Re.call(ve, i), d = Fe.value(i), w = (We = s.subtitleFormatter) == null ? void 0 : We.call(s, i), C = d ? d.trim().toLowerCase() : "", Ne = w ? w.trim().toLowerCase() : "", se = [];
766
- return s.searchFields ? s.searchFields.forEach((Ue) => {
767
- i[Ue] && se.push(String(i[Ue]).toLowerCase());
768
- }) : (se.push(C), Ne && se.push(Ne)), {
769
- key: ((je = K.value) == null ? void 0 : je.call(K, i)) ?? String(v),
770
- group: h,
771
- title: d,
772
- subtitle: w,
773
- searchContent: se.join(""),
751
+ const l = S(), u = S(), d = S(), E = S(!1), h = S(), g = S(!1), c = S(""), f = S(null), m = S(null), C = S(!1), x = S(null), $ = S(!1), vt = T(() => s.showCreateTextOnNewItem ?? !0), P = T(() => !!(s.options || h.value)), mt = T(() => s.options ?? h.value ?? []), ht = T(() => s.prependOptions ?? []), yt = T(() => s.appendOptions ?? []), xe = T(() => !!s.disabled || !P.value && !s.loadOptions), gt = T(() => !P.value && s.preload ? "Loading..." : s.nullTitle ? s.nullTitle : s.placeholder || ""), wt = T(() => s.noResultsText || "No options match your search."), q = T(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), de = T(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), Et = T(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Me = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Le = T(() => s.selectionFormatter ? s.selectionFormatter : Me.value), Fe = T(() => [...ht.value, ...mt.value, ...yt.value]), Ie = T(() => !!(s.groupField || s.groupFormatter)), fe = T(() => Fe.value.map((i, w) => {
752
+ const v = Et.value?.(i), p = Me.value(i), y = s.subtitleFormatter?.(i), I = p ? p.trim().toLowerCase() : "", Be = y ? y.trim().toLowerCase() : "", ne = [];
753
+ return s.searchFields ? s.searchFields.forEach((_e) => {
754
+ i[_e] && ne.push(String(i[_e]).toLowerCase());
755
+ }) : (ne.push(I), Be && ne.push(Be)), {
756
+ key: de.value?.(i) ?? String(w),
757
+ group: v,
758
+ title: p,
759
+ subtitle: y,
760
+ searchContent: ne.join(""),
774
761
  ref: i
775
762
  };
776
- })), F = T(() => {
777
- let i = [...me.value];
778
- if (y.value) {
779
- const v = c.value.trim().toLowerCase();
780
- if (v.length) {
781
- i = i.filter((w) => w.searchContent.includes(v));
782
- const h = nn(c.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), d = new RegExp(`(${h})`, "ig");
783
- i = i.map((w) => {
784
- var C;
785
- return {
786
- ...w,
787
- title: w.title.replace(d, "<mark>$1</mark>"),
788
- subtitle: (C = w.subtitle) == null ? void 0 : C.replace(d, "<mark>$1</mark>")
789
- };
790
- }), B.value && (i.find((C) => C.searchContent === v) !== void 0 || i.push({
791
- key: l,
792
- title: wt.value ? "Create <strong>" + c.value.trim() + "</strong>..." : c.value.trim()
763
+ })), L = T(() => {
764
+ let i = [...fe.value];
765
+ if (g.value) {
766
+ const w = c.value.trim().toLowerCase();
767
+ if (w.length) {
768
+ i = i.filter((y) => y.searchContent.includes(w));
769
+ const v = Zt(c.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${v})`, "ig");
770
+ i = i.map((y) => ({
771
+ ...y,
772
+ title: y.title.replace(p, "<mark>$1</mark>"),
773
+ subtitle: y.subtitle?.replace(p, "<mark>$1</mark>")
774
+ })), $.value && (i.find((I) => I.searchContent === w) !== void 0 || i.push({
775
+ key: r,
776
+ title: vt.value ? "Create <strong>" + c.value.trim() + "</strong>..." : c.value.trim()
793
777
  }));
794
778
  }
795
779
  } else s.nullTitle && i.unshift({
@@ -797,59 +781,56 @@ const Wn = ["disabled", "placeholder", "required", "name"], jn = {
797
781
  title: s.nullTitle
798
782
  });
799
783
  return i;
800
- }), St = T(() => {
801
- if (!De.value)
784
+ }), bt = T(() => {
785
+ if (!Ie.value)
802
786
  return [
803
787
  {
804
788
  groupTitle: "",
805
- options: F.value
789
+ options: L.value
806
790
  }
807
791
  ];
808
- const i = Kt(F.value.map((h) => h.group ?? "")), v = Yt(F.value, (h) => h.group ?? "");
809
- return i.map((h) => ({
810
- groupTitle: h,
811
- options: v[h]
792
+ const i = Wt(L.value.map((v) => v.group ?? "")), w = jt(L.value, (v) => v.group ?? "");
793
+ return i.map((v) => ({
794
+ groupTitle: v,
795
+ options: w[v]
812
796
  }));
813
797
  });
814
- D(() => s.modelValue, he), D(me, () => {
815
- M.value && setTimeout($e, 0);
816
- }), D(c, () => {
817
- y.value && !s.remoteSearch && !c.value.trim().length && (y.value = !1);
818
- }), D(M, () => {
819
- M.value ? setTimeout(Dt, 0) : (y.value = !1, c.value = g.value ?? "", m.value && (m.value.style.visibility = "hidden"));
820
- }), D(F, () => {
821
- var i;
822
- s.modelValue !== null && f.value === null && he(), (L.value !== null || y.value) && !F.value.find((v) => v.key == L.value) && (L.value = ((i = F.value[0]) == null ? void 0 : i.key) ?? o);
823
- }), _(async () => {
824
- B.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && await He(), !s.options && (s.valueField || s.valueExtractor) && (!s.loadOptions || s.preload) ? c.value = s.loadingText ?? "..." : he(), D(f, () => {
798
+ O(() => s.modelValue, ve), O(fe, () => {
799
+ C.value && setTimeout(Ve, 0);
800
+ }), O(c, () => {
801
+ g.value && !s.remoteSearch && !c.value.trim().length && (g.value = !1);
802
+ }), O(C, () => {
803
+ C.value ? setTimeout(Lt, 0) : (g.value = !1, c.value = m.value ?? "", d.value && (d.value.style.visibility = "hidden"));
804
+ }), O(L, () => {
805
+ s.modelValue !== null && f.value === null && ve(), (x.value !== null || g.value) && !L.value.find((i) => i.key == x.value) && (x.value = L.value[0]?.key ?? o);
806
+ }), B(async () => {
807
+ $.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && await Oe(), !s.options && (s.valueField || s.valueExtractor) && (!s.loadOptions || s.preload) ? c.value = s.loadingText ?? "..." : ve(), O(f, () => {
825
808
  f.value !== s.modelValue && a(
826
809
  "update:modelValue",
827
- Pe(f.value) && z.value !== null ? z.value(f.value) : f.value
810
+ Ne(f.value) && q.value !== null ? q.value(f.value) : f.value
828
811
  );
829
- }), s.remoteSearch && D(c, Xt(Mt, 250));
830
- }), ce(() => {
831
- var i;
832
- (i = m.value) == null || i.remove();
812
+ }), s.remoteSearch && O(c, Ut(kt, 250));
813
+ }), ae(() => {
814
+ d.value?.remove();
833
815
  });
834
- async function He() {
835
- await Ve(), p.value && a("optionsLoaded", p.value);
816
+ async function Oe() {
817
+ await De(), h.value && a("optionsLoaded", h.value);
836
818
  }
837
- async function Ve() {
838
- var v;
839
- const i = s.remoteSearch && y.value && c.value.length ? c.value : null;
840
- b.value = !0, p.value = await ((v = s.loadOptions) == null ? void 0 : v.call(s, i)) ?? [], b.value = !1, Ae();
819
+ async function De() {
820
+ const i = s.remoteSearch && g.value && c.value.length ? c.value : null;
821
+ E.value = !0, h.value = await s.loadOptions?.(i) ?? [], E.value = !1, He();
841
822
  }
842
- function Mt() {
843
- y.value && (Ve(), y.value = c.value.trim().length > 0);
823
+ function kt() {
824
+ g.value && (De(), g.value = c.value.trim().length > 0);
844
825
  }
845
- function Lt(i) {
826
+ function Tt(i) {
846
827
  if (i.key == "Escape") {
847
- i.stopPropagation(), i.target.blur(), _e();
828
+ i.stopPropagation(), i.target.blur(), $e();
848
829
  return;
849
830
  }
850
831
  if (!(i.key == "ArrowLeft" || i.key == "ArrowRight") && i.key != "Tab") {
851
- if (!q.value) {
852
- y.value || i.preventDefault();
832
+ if (!P.value) {
833
+ g.value || i.preventDefault();
853
834
  return;
854
835
  }
855
836
  if (i.key == "ArrowUp" || i.key == "ArrowDown")
@@ -860,170 +841,160 @@ const Wn = ["disabled", "placeholder", "required", "name"], jn = {
860
841
  return i.preventDefault(), pe(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
861
842
  if (i.key == "Enter") {
862
843
  i.preventDefault();
863
- const v = F.value.find((h) => h.key == L.value);
864
- if (v) return Be(v);
844
+ const w = L.value.find((v) => v.key == x.value);
845
+ if (w) return Ae(w);
865
846
  }
866
847
  if (i.key === "Delete" || i.key === "Backspace") {
867
- c.value.length > 1 && (y.value = !0);
848
+ c.value.length > 1 && (g.value = !0);
868
849
  return;
869
850
  }
870
- !i.metaKey && Yn.includes(i.key) && (y.value = !0);
851
+ !i.metaKey && jn.includes(i.key) && (g.value = !0);
871
852
  }
872
853
  }
873
- function xt() {
874
- Ae(), M.value = !0, setTimeout(() => {
875
- var i;
876
- return (i = u.value) == null ? void 0 : i.select();
877
- }, 0);
854
+ function St() {
855
+ He(), C.value = !0, setTimeout(() => u.value?.select(), 0);
878
856
  }
879
- function Ae(i) {
880
- f.value ? L.value = Ft(f.value) : s.nullTitle && (L.value = o);
857
+ function He(i) {
858
+ f.value ? x.value = Ct(f.value) : s.nullTitle && (x.value = o);
881
859
  }
882
- function Ft(i) {
883
- var v;
884
- return K.value ? K.value(f.value) : ((v = It(i)) == null ? void 0 : v.key) ?? "";
860
+ function Ct(i) {
861
+ return de.value ? de.value(f.value) : xt(i)?.key ?? "";
885
862
  }
886
- function It(i) {
887
- const v = F.value.find((w) => w.ref === i);
888
- if (v)
889
- return v;
890
- const h = s.keyExtractor ? (w, C) => s.keyExtractor(w) === s.keyExtractor(C) : it, d = F.value.find((w) => h(w.ref, i));
891
- return d || null;
863
+ function xt(i) {
864
+ const w = L.value.find((y) => y.ref === i);
865
+ if (w)
866
+ return w;
867
+ const v = s.keyExtractor ? (y, I) => s.keyExtractor(y) === s.keyExtractor(I) : et, p = L.value.find((y) => v(y.ref, i));
868
+ return p || null;
892
869
  }
893
- function Ot() {
894
- s.debug || (!c.value.length && s.nullTitle && (f.value = null, g.value = null), M.value = !1);
870
+ function Mt() {
871
+ s.debug || (!c.value.length && s.nullTitle && (f.value = null, m.value = null), C.value = !1);
895
872
  }
896
- function Dt() {
897
- var i;
898
- q.value || He(), s.optionsListId && ((i = m.value) == null || i.setAttribute("id", s.optionsListId)), Ht();
873
+ function Lt() {
874
+ P.value || Oe(), s.optionsListId && d.value?.setAttribute("id", s.optionsListId), Ft();
899
875
  }
900
- function Ht() {
901
- const i = r.value.getBoundingClientRect(), v = i.y + i.height + 2, h = i.x, d = m.value, w = window.getComputedStyle(r.value);
902
- for (let C in w)
903
- /^(font|text)/.test(C) && (d.style[C] = w[C]);
904
- if (d.style.top = v + "px", d.style.left = h + "px", d.style.minWidth = i.width + "px", !w.maxHeight || w.maxHeight == "none") {
905
- const C = window.innerHeight - v - 12;
906
- d.style.maxHeight = C + "px";
876
+ function Ft() {
877
+ const i = l.value.getBoundingClientRect(), w = i.y + i.height + 2, v = i.x, p = d.value, y = window.getComputedStyle(l.value);
878
+ for (let I in y)
879
+ /^(font|text)/.test(I) && (p.style[I] = y[I]);
880
+ if (p.style.top = w + "px", p.style.left = v + "px", p.style.minWidth = i.width + "px", !y.maxHeight || y.maxHeight == "none") {
881
+ const I = window.innerHeight - w - 12;
882
+ p.style.maxHeight = I + "px";
907
883
  }
908
- d.style.visibility = "visible", document.body.appendChild(d), setTimeout($e, 0);
884
+ p.style.visibility = "visible", document.body.appendChild(p), setTimeout(Ve, 0);
909
885
  }
910
- function $e() {
911
- if (!q.value || !L.value) return;
912
- const i = F.value.findIndex((d) => d.key == L.value), v = m.value, h = v == null ? void 0 : v.querySelectorAll(".option")[i];
913
- h && (v.scrollTop = h.offsetTop);
886
+ function Ve() {
887
+ if (!P.value || !x.value) return;
888
+ const i = L.value.findIndex((p) => p.key == x.value), w = d.value, v = w?.querySelectorAll(".option")[i];
889
+ v && (w.scrollTop = v.offsetTop);
914
890
  }
915
- function Vt(i) {
916
- L.value = i ? i.key : null;
891
+ function It(i) {
892
+ x.value = i ? i.key : null;
917
893
  }
918
894
  function pe(i) {
919
- const v = F.value.findIndex((C) => C.key == L.value);
920
- let h = v + i;
921
- if (h < 0 ? h = 0 : h >= F.value.length && (h = F.value.length - 1), v == h) return;
922
- L.value = F.value[h].key;
923
- const d = m.value, w = d == null ? void 0 : d.querySelectorAll(".option")[h];
924
- w && (w.offsetTop < d.scrollTop ? d.scrollTop = w.offsetTop : w.offsetTop + w.offsetHeight > d.scrollTop + d.clientHeight && (d.scrollTop = w.offsetTop + w.offsetHeight - d.clientHeight));
895
+ const w = L.value.findIndex((I) => I.key == x.value);
896
+ let v = w + i;
897
+ if (v < 0 ? v = 0 : v >= L.value.length && (v = L.value.length - 1), w == v) return;
898
+ x.value = L.value[v].key;
899
+ const p = d.value, y = p?.querySelectorAll(".option")[v];
900
+ y && (y.offsetTop < p.scrollTop ? p.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > p.scrollTop + p.clientHeight && (p.scrollTop = y.offsetTop + y.offsetHeight - p.clientHeight));
925
901
  }
926
- function Be(i) {
927
- var v, h;
928
- if (y.value = !1, i.key === o)
929
- c.value = "", f.value = null, g.value = null;
930
- else if (i.key === l) {
931
- const d = c.value.trim();
932
- c.value = "", f.value = null, g.value = null, (v = s.onCreateItem) == null || v.call(s, d);
902
+ function Ae(i) {
903
+ if (g.value = !1, i.key === o)
904
+ c.value = "", f.value = null, m.value = null;
905
+ else if (i.key === r) {
906
+ const w = c.value.trim();
907
+ c.value = "", f.value = null, m.value = null, s.onCreateItem?.(w);
933
908
  } else {
934
- const w = me.value.find((C) => C.key == i.key).ref;
935
- f.value = w, g.value = Ie.value(w), c.value = g.value ?? "";
909
+ const v = fe.value.find((p) => p.key == i.key).ref;
910
+ f.value = v, m.value = Le.value(v), c.value = m.value ?? "";
936
911
  }
937
- (h = u.value) == null || h.blur(), _e();
912
+ u.value?.blur(), $e();
938
913
  }
939
- function he() {
940
- s.modelValue !== null ? (f.value = z.value ? Oe.value.find((i) => s.modelValue === z.value(i)) : s.modelValue, g.value = Pe(f.value) ? Ie.value(f.value) : null, c.value = g.value ?? "") : (f.value = null, g.value = null, c.value = "");
914
+ function ve() {
915
+ s.modelValue !== null ? (f.value = q.value ? Fe.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, m.value = Ne(f.value) ? Le.value(f.value) : null, c.value = m.value ?? "") : (f.value = null, m.value = null, c.value = "");
941
916
  }
942
- function At(i) {
943
- p.value.unshift(i);
917
+ function Ot(i) {
918
+ h.value.unshift(i);
944
919
  }
945
- function _e() {
946
- var w;
920
+ function $e() {
947
921
  if (!s.autoNext) return;
948
- let i = (w = r.value) == null ? void 0 : w.parentElement;
922
+ let i = l.value?.parentElement;
949
923
  for (; i && i.tagName !== "FORM" && i.tagName !== "BODY"; )
950
924
  i = i.parentElement;
951
925
  if (!i) return;
952
- const v = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
953
- if (!v) return;
954
- const h = Array.from(v).findIndex((C) => C === u.value), d = v[h + 1];
955
- d && setTimeout(() => d.focus(), 0);
926
+ const w = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
927
+ if (!w) return;
928
+ const v = Array.from(w).findIndex((y) => y === u.value), p = w[v + 1];
929
+ p && setTimeout(() => p.focus(), 0);
956
930
  }
957
- return (i, v) => (E(), k("div", {
931
+ return (i, w) => (b(), k("div", {
958
932
  ref_key: "el",
959
- ref: r,
960
- class: A(["vf-smart-select", { disabled: xe.value, open: M.value }])
933
+ ref: l,
934
+ class: V(["vf-smart-select", { disabled: xe.value, open: C.value }])
961
935
  }, [
962
- le($("input", {
936
+ se(A("input", {
963
937
  ref_key: "searchField",
964
938
  ref: u,
965
- "onUpdate:modelValue": v[0] || (v[0] = (h) => c.value = h),
939
+ "onUpdate:modelValue": w[0] || (w[0] = (v) => c.value = v),
966
940
  type: "text",
967
941
  disabled: xe.value,
968
- class: A({ nullable: !!i.nullTitle }),
969
- placeholder: Tt.value,
942
+ class: V({ nullable: !!i.nullTitle }),
943
+ placeholder: gt.value,
970
944
  required: i.required,
971
945
  name: i.name,
972
946
  "data-1p-ignore": "",
973
- onKeydown: Lt,
974
- onFocus: xt,
975
- onBlur: Ot
976
- }, null, 42, Wn), [
977
- [qt, c.value]
947
+ onKeydown: Tt,
948
+ onFocus: St,
949
+ onBlur: Mt
950
+ }, null, 42, An), [
951
+ [Nt, c.value]
978
952
  ]),
979
- M.value ? (E(), k("div", {
953
+ C.value ? (b(), k("div", {
980
954
  key: 0,
981
955
  ref_key: "optionsContainer",
982
- ref: m,
983
- class: A(["vf-smart-select-options", { grouped: De.value }])
956
+ ref: d,
957
+ class: V(["vf-smart-select-options", { grouped: Ie.value }])
984
958
  }, [
985
- q.value ? (E(!0), k(re, { key: 1 }, ae(St.value, (h) => (E(), k("div", {
986
- key: h.groupTitle,
959
+ P.value ? (b(!0), k(ie, { key: 1 }, re(bt.value, (v) => (b(), k("div", {
960
+ key: v.groupTitle,
987
961
  class: "group"
988
962
  }, [
989
- h.groupTitle ? (E(), k("div", Un, [
990
- j(i.$slots, "group", {
991
- group: h.groupTitle
963
+ v.groupTitle ? (b(), k("div", Bn, [
964
+ W(i.$slots, "group", {
965
+ group: v.groupTitle
992
966
  }, () => [
993
- Z(W(h.groupTitle), 1)
967
+ Y(R(v.groupTitle), 1)
994
968
  ])
995
- ])) : V("", !0),
996
- (E(!0), k(re, null, ae(h.options, (d) => {
997
- var w;
998
- return E(), k("div", {
999
- key: d.key,
1000
- class: A(["option", [L.value === d.key && "highlighted", d.ref && ((w = i.classForOption) == null ? void 0 : w.call(i, d.ref))]]),
1001
- onMousemove: (C) => Vt(d),
1002
- onMousedown: (C) => Be(d)
1003
- }, [
1004
- j(i.$slots, "option", { option: d }, () => [
1005
- $("div", {
1006
- class: "title",
1007
- innerHTML: d.title
1008
- }, null, 8, qn),
1009
- d.subtitle ? (E(), k("div", {
1010
- key: 0,
1011
- class: "subtitle",
1012
- innerHTML: d.subtitle
1013
- }, null, 8, zn)) : V("", !0)
1014
- ])
1015
- ], 42, Pn);
1016
- }), 128)),
1017
- !F.value.length && c.value ? (E(), k("div", Kn, [
1018
- j(i.$slots, "no-results", {}, () => [
1019
- Z(W(Ct.value), 1)
969
+ ])) : H("", !0),
970
+ (b(!0), k(ie, null, re(v.options, (p) => (b(), k("div", {
971
+ key: p.key,
972
+ class: V(["option", [x.value === p.key && "highlighted", p.ref && i.classForOption?.(p.ref)]]),
973
+ onMousemove: (y) => It(p),
974
+ onMousedown: (y) => Ae(p)
975
+ }, [
976
+ W(i.$slots, "option", { option: p }, () => [
977
+ A("div", {
978
+ class: "title",
979
+ innerHTML: p.title
980
+ }, null, 8, Nn),
981
+ p.subtitle ? (b(), k("div", {
982
+ key: 0,
983
+ class: "subtitle",
984
+ innerHTML: p.subtitle
985
+ }, null, 8, Rn)) : H("", !0)
1020
986
  ])
1021
- ])) : V("", !0)
1022
- ]))), 128)) : (E(), k("div", jn, "Loading..."))
1023
- ], 2)) : V("", !0)
987
+ ], 42, _n))), 128)),
988
+ !L.value.length && c.value ? (b(), k("div", Wn, [
989
+ W(i.$slots, "no-results", {}, () => [
990
+ Y(R(wt.value), 1)
991
+ ])
992
+ ])) : H("", !0)
993
+ ]))), 128)) : (b(), k("div", $n, "Loading..."))
994
+ ], 2)) : H("", !0)
1024
995
  ], 2));
1025
996
  }
1026
- }), cs = /* @__PURE__ */ R({
997
+ }), os = /* @__PURE__ */ N({
1027
998
  __name: "vf-ez-smart-select",
1028
999
  props: {
1029
1000
  modelValue: {},
@@ -1035,40 +1006,39 @@ const Wn = ["disabled", "placeholder", "required", "name"], jn = {
1035
1006
  },
1036
1007
  emits: ["update:modelValue"],
1037
1008
  setup(e, { emit: t }) {
1038
- const n = e, o = T(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: String(r) })) : Object.entries(n.options).map(([r, u]) => ({
1039
- value: r,
1009
+ const n = e, o = T(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: String(l) })) : Object.entries(n.options).map(([l, u]) => ({
1010
+ value: l,
1040
1011
  label: u
1041
- }))), l = T(() => n.formatter ? (r) => n.formatter(r.label, r.value) : (r) => r.label), s = t, a = S(o.value.find((r) => r.value === n.modelValue) ?? null);
1042
- return D(
1012
+ }))), r = T(() => n.formatter ? (l) => n.formatter(l.label, l.value) : (l) => l.label), s = t, a = S(o.value.find((l) => l.value === n.modelValue) ?? null);
1013
+ return O(
1043
1014
  () => n.modelValue,
1044
- (r) => {
1045
- a.value = o.value.find((u) => u.value === r) ?? null;
1015
+ (l) => {
1016
+ a.value = o.value.find((u) => u.value === l) ?? null;
1046
1017
  }
1047
- ), D(a, (r) => {
1048
- var m;
1049
- const u = r ? (m = o.value.find((b) => it(b, r))) == null ? void 0 : m.value : null;
1018
+ ), O(a, (l) => {
1019
+ const u = l ? o.value.find((d) => et(d, l))?.value : null;
1050
1020
  s("update:modelValue", u ?? null);
1051
- }), (r, u) => (E(), tt(Xn, {
1021
+ }), (l, u) => (b(), Ze(Un, {
1052
1022
  modelValue: a.value,
1053
- "onUpdate:modelValue": u[0] || (u[0] = (m) => a.value = m),
1023
+ "onUpdate:modelValue": u[0] || (u[0] = (d) => a.value = d),
1054
1024
  options: o.value,
1055
- formatter: l.value,
1056
- "null-title": r.nullTitle,
1057
- placeholder: r.placeholder,
1058
- name: r.name
1025
+ formatter: r.value,
1026
+ "null-title": l.nullTitle,
1027
+ placeholder: l.placeholder,
1028
+ name: l.name
1059
1029
  }, null, 8, ["modelValue", "options", "formatter", "null-title", "placeholder", "name"]));
1060
1030
  }
1061
1031
  });
1062
- function ds() {
1032
+ function ss() {
1063
1033
  return S();
1064
1034
  }
1065
- const Zn = { class: "content" }, Gn = { class: "message" }, Jn = {
1035
+ const Pn = { class: "content" }, qn = { class: "message" }, zn = {
1066
1036
  key: 0,
1067
1037
  class: "close"
1068
- }, Qn = {
1038
+ }, Kn = {
1069
1039
  key: 0,
1070
1040
  class: "progress-bar"
1071
- }, eo = /* @__PURE__ */ R({
1041
+ }, Yn = /* @__PURE__ */ N({
1072
1042
  __name: "vf-toast",
1073
1043
  props: {
1074
1044
  message: {},
@@ -1084,177 +1054,173 @@ const Zn = { class: "content" }, Gn = { class: "message" }, Jn = {
1084
1054
  t.onClick ? t.onClick() : t.disableClose || t.callback();
1085
1055
  }
1086
1056
  const o = S();
1087
- return t.durationSecs !== null && _(() => {
1088
- var s;
1089
- const l = t.durationSecs ?? 5;
1090
- (s = o.value) == null || s.animate([{ width: "0%" }, { width: "100%" }], {
1091
- duration: l * 1e3,
1057
+ return t.durationSecs !== null && B(() => {
1058
+ const r = t.durationSecs ?? 5;
1059
+ o.value?.animate([{ width: "0%" }, { width: "100%" }], {
1060
+ duration: r * 1e3,
1092
1061
  easing: "linear"
1093
- }), setTimeout(() => t.callback(), l * 1e3);
1094
- }), (l, s) => (E(), k("div", {
1095
- class: A(["vf-toast", l.className]),
1096
- onClick: ke(n, ["stop"])
1062
+ }), setTimeout(() => t.callback(), r * 1e3);
1063
+ }), (r, s) => (b(), k("div", {
1064
+ class: V(["vf-toast", r.className]),
1065
+ onClick: Ee(n, ["stop"])
1097
1066
  }, [
1098
- $("div", Zn, [
1099
- $("div", Gn, W(l.message), 1),
1100
- l.disableClose ? V("", !0) : (E(), k("div", Jn, "x"))
1067
+ A("div", Pn, [
1068
+ A("div", qn, R(r.message), 1),
1069
+ r.disableClose ? H("", !0) : (b(), k("div", zn, "x"))
1101
1070
  ]),
1102
- l.durationSecs !== null ? (E(), k("div", Qn, [
1103
- $("div", {
1071
+ r.durationSecs !== null ? (b(), k("div", Kn, [
1072
+ A("div", {
1104
1073
  ref_key: "progressInnerEl",
1105
1074
  ref: o,
1106
1075
  class: "inner"
1107
1076
  }, null, 512)
1108
- ])) : V("", !0)
1077
+ ])) : H("", !0)
1109
1078
  ], 2));
1110
1079
  }
1111
1080
  });
1112
- function fs(e) {
1113
- const t = de(eo, {
1081
+ function is(e) {
1082
+ const t = ue(Yn, {
1114
1083
  ...e,
1115
- callback: () => ee(t)
1084
+ callback: () => J(t)
1116
1085
  });
1117
- return () => ee(t);
1086
+ return () => J(t);
1118
1087
  }
1119
- function to(e) {
1120
- const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), l = ["B", "KB", "MB", "GB", "TB"][t];
1121
- return `${o} ${l}`;
1088
+ function Xn(e) {
1089
+ const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), r = ["B", "KB", "MB", "GB", "TB"][t];
1090
+ return `${o} ${r}`;
1122
1091
  }
1123
- function no(e) {
1092
+ function Zn(e) {
1124
1093
  return e != null && String(e).length ? e : "-";
1125
1094
  }
1126
- function oo(e) {
1095
+ function Gn(e) {
1127
1096
  return e || "-";
1128
1097
  }
1129
- function so(e) {
1130
- return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Ln(Number(e));
1098
+ function Jn(e) {
1099
+ return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : bn(Number(e));
1131
1100
  }
1132
- function io(e) {
1133
- return e && Nn(e);
1101
+ function Qn(e) {
1102
+ return e && Hn(e);
1134
1103
  }
1135
- function lo(e) {
1136
- return e ? Gt(e) : null;
1104
+ function eo(e) {
1105
+ return e ? qt(e) : null;
1137
1106
  }
1138
- function dt(e) {
1139
- return e ? Zt(e) : null;
1107
+ function rt(e) {
1108
+ return e ? Pt(e) : null;
1140
1109
  }
1141
- function ro(e) {
1110
+ function to(e) {
1142
1111
  return e ? e.toUpperCase() : null;
1143
1112
  }
1144
- function ao(e) {
1145
- return e ? dt(e.toLowerCase()) : null;
1113
+ function no(e) {
1114
+ return e ? rt(e.toLowerCase()) : null;
1115
+ }
1116
+ function oo(e) {
1117
+ return e ? Dn(e) : null;
1146
1118
  }
1147
- function uo(e) {
1148
- return e ? _n(e) : null;
1119
+ function so(e, t) {
1120
+ return Vn(e, t);
1149
1121
  }
1150
- function co(e, t) {
1151
- return Rn(e, t);
1122
+ function io(e, t) {
1123
+ return D(e).divide(t).value;
1152
1124
  }
1153
- function fo(e, t) {
1154
- return H(e).divide(t).value;
1125
+ function ro(e, t) {
1126
+ return e && U(new Date(e), t ?? F.defaultDateFormat);
1155
1127
  }
1156
- function vo(e, t) {
1157
- return e && P(new Date(e), t ?? I.defaultDateFormat);
1128
+ function lo(e, t) {
1129
+ return e && U(new Date(e), t ?? F.defaultTimeFormat);
1158
1130
  }
1159
- function mo(e, t) {
1160
- return e && P(new Date(e), t ?? I.defaultTimeFormat);
1161
- }
1162
- function po(e, t) {
1163
- return e && P(new Date(e), t ?? `${I.defaultDateFormat} ${I.defaultTimeFormat}`);
1164
- }
1165
- function ho(e) {
1166
- return e && P(on(sn(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), I.defaultDateFormat);
1167
- }
1168
- const ze = {
1169
- bytes: to,
1170
- dash: no,
1171
- dashZeros: oo,
1172
- number: so,
1173
- phone: io,
1174
- upperFirst: lo,
1175
- startCase: dt,
1176
- upperCase: ro,
1177
- upperWords: ao,
1178
- desnake: uo,
1179
- usCurrency: co,
1180
- divide: fo,
1181
- date: vo,
1182
- time: mo,
1183
- dateTime: po,
1184
- oneDayForward: ho
1185
- }, vs = (e) => ({
1186
- ...ze,
1187
- ...e(ze)
1188
- }), Me = Symbol("HookState");
1189
- function ms(e, t) {
1190
- const n = t ?? Ee();
1191
- _(() => yo(n, e), n), nt(() => go(n), n), ot(() => Ke(n), n), ce(() => Ke(n), n);
1192
- }
1193
- function yo(e, t) {
1131
+ function ao(e, t) {
1132
+ return e && U(new Date(e), t ?? `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1133
+ }
1134
+ function uo(e) {
1135
+ return e && U(Gt(Jt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), F.defaultDateFormat);
1136
+ }
1137
+ const We = {
1138
+ bytes: Xn,
1139
+ dash: Zn,
1140
+ dashZeros: Gn,
1141
+ number: Jn,
1142
+ phone: Qn,
1143
+ upperFirst: eo,
1144
+ startCase: rt,
1145
+ upperCase: to,
1146
+ upperWords: no,
1147
+ desnake: oo,
1148
+ usCurrency: so,
1149
+ divide: io,
1150
+ date: ro,
1151
+ time: lo,
1152
+ dateTime: ao,
1153
+ oneDayForward: uo
1154
+ }, rs = (e) => ({
1155
+ ...We,
1156
+ ...e(We)
1157
+ }), Se = Symbol("HookState");
1158
+ function ls(e, t) {
1159
+ const n = t ?? we();
1160
+ B(() => co(n, e), n), Ge(() => fo(n), n), Je(() => je(n), n), ae(() => je(n), n);
1161
+ }
1162
+ function co(e, t) {
1194
1163
  const n = {};
1195
- if (t.elScrolledToBottom && (n.el = new J(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
1196
- const o = ft(e.vnode.el);
1197
- o ? n.ancestor = new J(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
1164
+ if (t.elScrolledToBottom && (n.el = new Z(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
1165
+ const o = lt(e.vnode.el);
1166
+ o ? n.ancestor = new Z(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
1198
1167
  }
1199
- t.windowScrolledToBottom && (n.window = new J(window, t.windowScrolledToBottom)), e[Me] = n;
1168
+ t.windowScrolledToBottom && (n.window = new Z(window, t.windowScrolledToBottom)), e[Se] = n;
1200
1169
  }
1201
- function go(e) {
1202
- var n, o, l;
1203
- const t = e[Me];
1204
- (n = t == null ? void 0 : t.el) == null || n.install(), (o = t == null ? void 0 : t.ancestor) == null || o.install(), (l = t == null ? void 0 : t.window) == null || l.install();
1170
+ function fo(e) {
1171
+ const t = e[Se];
1172
+ t?.el?.install(), t?.ancestor?.install(), t?.window?.install();
1205
1173
  }
1206
- function Ke(e) {
1207
- var n, o, l;
1208
- const t = e[Me];
1209
- (n = t == null ? void 0 : t.el) == null || n.uninstall(), (o = t == null ? void 0 : t.ancestor) == null || o.uninstall(), (l = t == null ? void 0 : t.window) == null || l.uninstall();
1174
+ function je(e) {
1175
+ const t = e[Se];
1176
+ t?.el?.uninstall(), t?.ancestor?.uninstall(), t?.window?.uninstall();
1210
1177
  }
1211
- const we = ["auto", "scroll"];
1212
- function ft(e) {
1178
+ const ye = ["auto", "scroll"];
1179
+ function lt(e) {
1213
1180
  const t = e.parentElement;
1214
1181
  if (!t) return null;
1215
1182
  const n = window.getComputedStyle(t);
1216
- return we.includes(n.overflow) || we.includes(n.overflowX) || we.includes(n.overflowY) ? t : ft(t);
1183
+ return ye.includes(n.overflow) || ye.includes(n.overflowX) || ye.includes(n.overflowY) ? t : lt(t);
1217
1184
  }
1218
- class J {
1185
+ class Z {
1219
1186
  constructor(t, n) {
1220
- O(this, "isTripped", !1);
1221
- O(this, "onScrollWithContext", this.onScroll.bind(this));
1222
1187
  this.el = t, this.handler = n, this.install();
1223
1188
  }
1189
+ isTripped = !1;
1224
1190
  install() {
1225
1191
  this.el.addEventListener("scroll", this.onScrollWithContext);
1226
1192
  }
1227
1193
  uninstall() {
1228
1194
  this.el.removeEventListener("scroll", this.onScrollWithContext);
1229
1195
  }
1196
+ onScrollWithContext = this.onScroll.bind(this);
1230
1197
  onScroll(t) {
1231
1198
  Math.ceil(this.el.scrollTop + this.el.clientHeight + 5) >= this.el.scrollHeight ? this.isTripped || (this.handler(t), this.isTripped = !0) : this.isTripped && (this.isTripped = !1);
1232
1199
  }
1233
1200
  }
1234
- function ps(e) {
1235
- _(() => window.addEventListener("resize", e)), nt(() => window.addEventListener("resize", e)), ot(() => window.removeEventListener("resize", e)), ce(() => window.removeEventListener("resize", e));
1236
- }
1237
- const wo = {
1238
- mounted: Xe,
1239
- updated: Xe
1240
- }, Ye = Symbol("HasAutoFocused");
1241
- function Xe(e, t) {
1242
- if (t.value === void 0 && e[Ye] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1243
- e[Ye] = !0;
1201
+ function as(e) {
1202
+ B(() => window.addEventListener("resize", e)), Ge(() => window.addEventListener("resize", e)), Je(() => window.removeEventListener("resize", e)), ae(() => window.removeEventListener("resize", e));
1203
+ }
1204
+ const po = {
1205
+ mounted: Pe,
1206
+ updated: Pe
1207
+ }, Ue = Symbol("HasAutoFocused");
1208
+ function Pe(e, t) {
1209
+ if (t.value === void 0 && e[Ue] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1210
+ e[Ue] = !0;
1244
1211
  const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
1245
1212
  setTimeout(() => n.focus(), 10);
1246
1213
  }
1247
- const bo = {
1248
- mounted: Eo
1249
- }, Y = Symbol("ConfirmState");
1250
- function Eo(e, t) {
1214
+ const vo = {
1215
+ mounted: mo
1216
+ }, z = Symbol("ConfirmState");
1217
+ function mo(e, t) {
1251
1218
  e.addEventListener("click", (n) => {
1252
- var a, r;
1253
- const o = Date.now(), l = ((a = t.value) == null ? void 0 : a.text) !== void 0 ? t.value.text : "Confirm";
1254
- if (e[Y]) {
1255
- if (o - e[Y].initTime < 300)
1219
+ const o = Date.now(), r = t.value?.text !== void 0 ? t.value.text : "Confirm";
1220
+ if (e[z]) {
1221
+ if (o - e[z].initTime < 300)
1256
1222
  return;
1257
- e[Y].resetHandler(), e.dispatchEvent(new Event("confirm"));
1223
+ e[z].resetHandler(), e.dispatchEvent(new Event("confirm"));
1258
1224
  return;
1259
1225
  }
1260
1226
  n.preventDefault(), n.stopImmediatePropagation();
@@ -1262,181 +1228,171 @@ function Eo(e, t) {
1262
1228
  initTime: o,
1263
1229
  preconfirmHtml: e.innerHTML,
1264
1230
  resetHandler: () => {
1265
- var u;
1266
- l && (e.innerHTML = s.preconfirmHtml), (u = t.value) != null && u.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[Y];
1231
+ r && (e.innerHTML = s.preconfirmHtml), t.value?.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[z];
1267
1232
  }
1268
1233
  };
1269
- e[Y] = s, l && (e.innerHTML = l), (r = t.value) != null && r.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
1234
+ e[z] = s, r && (e.innerHTML = r), t.value?.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
1270
1235
  });
1271
1236
  }
1272
- const ko = {
1273
- beforeMount: To
1237
+ const ho = {
1238
+ beforeMount: yo
1274
1239
  };
1275
- function To(e) {
1240
+ function yo(e) {
1276
1241
  e.addEventListener("blur", () => {
1277
1242
  let t = e.value;
1278
- /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + P(/* @__PURE__ */ new Date(), "yy"));
1243
+ /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + U(/* @__PURE__ */ new Date(), "yy"));
1279
1244
  const n = Date.parse(t);
1280
- isNaN(n) ? e.value = "" : e.value = P(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1245
+ isNaN(n) ? e.value = "" : e.value = U(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1281
1246
  });
1282
1247
  }
1283
- const Co = {
1284
- beforeMount: Ze,
1285
- updated: Ze
1248
+ const go = {
1249
+ beforeMount: qe,
1250
+ updated: qe
1286
1251
  };
1287
- function Ze(e, t) {
1288
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = So(e, t));
1252
+ function qe(e, t) {
1253
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = wo(e, t));
1289
1254
  }
1290
- function So(e, t) {
1291
- var m, b;
1255
+ function wo(e, t) {
1292
1256
  if (!t.value)
1293
- return ((m = e.attributes.getNamedItem("placeholder")) == null ? void 0 : m.value) ?? "";
1257
+ return e.attributes.getNamedItem("placeholder")?.value ?? "";
1294
1258
  let n = "";
1295
- const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), l = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), s = new Date(l);
1259
+ const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), r = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), s = new Date(r);
1296
1260
  e.attributes.getNamedItem("display-utc") !== null && s.setMinutes(s.getMinutes() - s.getTimezoneOffset());
1297
- let a = (b = e.attributes.getNamedItem("format")) == null ? void 0 : b.value;
1298
- const r = e.attributes.getNamedItem("date-only") !== null;
1261
+ let a = e.attributes.getNamedItem("format")?.value;
1262
+ const l = e.attributes.getNamedItem("date-only") !== null;
1299
1263
  if (!a && e.attributes.getNamedItem("relative-date") !== null) {
1300
- const p = /* @__PURE__ */ new Date();
1301
- p.getFullYear() === s.getFullYear() && p.getMonth() === s.getMonth() && p.getDate() === s.getDate() && (n = "at", a = "HH:mm");
1264
+ const d = /* @__PURE__ */ new Date();
1265
+ d.getFullYear() === s.getFullYear() && d.getMonth() === s.getMonth() && d.getDate() === s.getDate() && (n = "at", a = "HH:mm");
1302
1266
  }
1303
1267
  if (!a && e.attributes.getNamedItem("simplified-date") !== null) {
1304
- let p = null;
1305
- const y = /* @__PURE__ */ new Date();
1306
- y.getFullYear() === s.getFullYear() ? (y.getMonth() !== s.getMonth() || y.getDate() !== s.getDate()) && (p = "M/d") : p = "M/d/yy";
1307
- const c = r ? null : I.defaultTimeFormat;
1308
- a = st([p, c]).join(" ");
1268
+ let d = null;
1269
+ const E = /* @__PURE__ */ new Date();
1270
+ E.getFullYear() === s.getFullYear() ? (E.getMonth() !== s.getMonth() || E.getDate() !== s.getDate()) && (d = "M/d") : d = "M/d/yy";
1271
+ const h = l ? null : F.defaultTimeFormat;
1272
+ a = Qe([d, h]).join(" ");
1309
1273
  }
1310
- a || (r ? a = I.defaultDateFormat : a = `${I.defaultDateFormat} ${I.defaultTimeFormat}`);
1311
- let u = P(s, a);
1274
+ a || (l ? a = F.defaultDateFormat : a = `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1275
+ let u = U(s, a);
1312
1276
  return n && (u = n + " " + u), u;
1313
1277
  }
1314
- const Mo = {
1315
- beforeMount: Ge,
1316
- updated: Ge,
1317
- unmounted: Lo
1278
+ const Eo = {
1279
+ beforeMount: ze,
1280
+ updated: ze,
1281
+ unmounted: bo
1318
1282
  };
1319
- function Ge(e, t) {
1283
+ function ze(e, t) {
1320
1284
  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");
1321
1285
  }
1322
- function Lo(e) {
1286
+ function bo(e) {
1323
1287
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
1324
1288
  }
1325
- const xo = {
1326
- beforeMount: Je,
1327
- updated: Je,
1328
- unmounted: mt
1329
- }, te = Symbol("HasAutoFocused"), Le = [];
1330
- function Fo() {
1331
- Le.forEach(vt);
1332
- }
1333
- setInterval(Fo, 1e3);
1334
- function Je(e, t) {
1335
- var a;
1289
+ const ko = {
1290
+ beforeMount: Ke,
1291
+ updated: Ke,
1292
+ unmounted: ut
1293
+ }, Q = Symbol("HasAutoFocused"), Ce = [];
1294
+ function To() {
1295
+ Ce.forEach(at);
1296
+ }
1297
+ setInterval(To, 1e3);
1298
+ function Ke(e, t) {
1336
1299
  if (t.value == t.oldValue) return;
1337
- if (!t.value) return mt(e);
1338
- const n = new Date(t.value), o = (a = e.attributes.getNamedItem("base-time")) == null ? void 0 : a.value, l = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), s = e.getAttribute("no-seconds") === null;
1339
- e[te] || Le.push(e), e[te] = {
1340
- startTs: l,
1300
+ if (!t.value) return ut(e);
1301
+ const n = new Date(t.value), o = e.attributes.getNamedItem("base-time")?.value, r = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), s = e.getAttribute("no-seconds") === null;
1302
+ e[Q] || Ce.push(e), e[Q] = {
1303
+ startTs: r,
1341
1304
  includeSeconds: s
1342
- }, vt(e);
1305
+ }, at(e);
1343
1306
  }
1344
- function vt(e) {
1345
- const t = e[te], n = Math.round((Date.now() - t.startTs) / 1e3);
1346
- e.innerText = Io(n, t.includeSeconds);
1307
+ function at(e) {
1308
+ const t = e[Q], n = Math.round((Date.now() - t.startTs) / 1e3);
1309
+ e.innerText = So(n, t.includeSeconds);
1347
1310
  }
1348
- function mt(e) {
1349
- e[te] && (Jt(Le, e), delete e[te]), e.innerText = "-";
1311
+ function ut(e) {
1312
+ e[Q] && (zt(Ce, e), delete e[Q]), e.innerText = "-";
1350
1313
  }
1351
- function Io(e, t) {
1314
+ function So(e, t) {
1352
1315
  const n = [], o = Math.floor(e / 86400);
1353
1316
  o && n.push(o + "d"), e -= o * 86400;
1354
- const l = Math.floor(e / 3600);
1355
- (o || l) && n.push(l + "h"), e -= l * 3600;
1317
+ const r = Math.floor(e / 3600);
1318
+ (o || r) && n.push(r + "h"), e -= r * 3600;
1356
1319
  const s = Math.floor(e / 60);
1357
- return (o || l || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
1358
- }
1359
- const Oo = {
1360
- mounted: pt,
1361
- updated: Do,
1362
- unmounted: ht
1363
- }, U = /* @__PURE__ */ new Map();
1364
- function pt(e, t) {
1365
- U.size === 0 && window.addEventListener("keydown", yt), U.set(t.value.toLowerCase(), [...U.get(t.value.toLowerCase()) ?? [], e]);
1366
- }
1367
- function ht(e, t) {
1368
- const n = U.get(t.value.toLowerCase());
1320
+ return (o || r || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
1321
+ }
1322
+ const Co = {
1323
+ mounted: ct,
1324
+ updated: xo,
1325
+ unmounted: dt
1326
+ }, j = /* @__PURE__ */ new Map();
1327
+ function ct(e, t) {
1328
+ j.size === 0 && window.addEventListener("keydown", ft), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
1329
+ }
1330
+ function dt(e, t) {
1331
+ const n = j.get(t.value.toLowerCase());
1369
1332
  if (n) {
1370
1333
  const o = n.indexOf(e);
1371
- o !== -1 && n.splice(o, 1), n.length === 0 && U.delete(t.value.toLowerCase());
1334
+ o !== -1 && n.splice(o, 1), n.length === 0 && j.delete(t.value.toLowerCase());
1372
1335
  }
1373
- U.size === 0 && window.removeEventListener("keydown", yt);
1336
+ j.size === 0 && window.removeEventListener("keydown", ft);
1374
1337
  }
1375
- function Do(e, t) {
1376
- ht(e, t), pt(e, t);
1338
+ function xo(e, t) {
1339
+ dt(e, t), ct(e, t);
1377
1340
  }
1378
- function yt(e) {
1341
+ function ft(e) {
1379
1342
  if (typeof e.key != "string") return;
1380
- const t = e.key.toLowerCase(), n = U.get(t);
1381
- if (n) {
1382
- const o = Qt(n);
1383
- o == null || o.click(), e.preventDefault();
1384
- }
1343
+ const t = e.key.toLowerCase(), n = j.get(t);
1344
+ n && (Kt(n)?.click(), e.preventDefault());
1385
1345
  }
1386
- const X = Symbol("InfiniteScrollHandler"), Ho = {
1346
+ const K = Symbol("InfiniteScrollHandler"), Mo = {
1387
1347
  mounted(e, t) {
1388
- e[X] = new J(e, t.value);
1348
+ e[K] = new Z(e, t.value);
1389
1349
  },
1390
1350
  updated(e, t) {
1391
- var n;
1392
- (n = e[X]) == null || n.uninstall(), e[X] = new J(e, t.value);
1351
+ e[K]?.uninstall(), e[K] = new Z(e, t.value);
1393
1352
  },
1394
1353
  unmounted(e) {
1395
- var t;
1396
- (t = e[X]) == null || t.uninstall(), delete e[X];
1354
+ e[K]?.uninstall(), delete e[K];
1397
1355
  }
1398
- }, Vo = {
1399
- beforeMount: Qe,
1400
- updated: Qe
1356
+ }, Lo = {
1357
+ beforeMount: Ye,
1358
+ updated: Ye
1401
1359
  };
1402
- function Qe(e, t) {
1360
+ function Ye(e, t) {
1403
1361
  e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1404
1362
  }
1405
- const Ao = {
1406
- mounted: et,
1407
- updated: et,
1408
- unmounted: gt
1409
- }, Q = Symbol("TooltipState");
1410
- function et(e, t) {
1411
- var o;
1412
- let n = ((o = e.attributes.getNamedItem("tip")) == null ? void 0 : o.value) ?? t.value;
1363
+ const Fo = {
1364
+ mounted: Xe,
1365
+ updated: Xe,
1366
+ unmounted: pt
1367
+ }, G = Symbol("TooltipState");
1368
+ function Xe(e, t) {
1369
+ let n = e.attributes.getNamedItem("tip")?.value ?? t.value;
1413
1370
  if (t.value || (n = null), n) {
1414
- const l = {
1371
+ const o = {
1415
1372
  content: n,
1416
1373
  html: e.getAttribute("html") !== null
1417
1374
  };
1418
- e[Q] ? e[Q].configure(l) : e[Q] = new $o(e, l);
1375
+ e[G] ? e[G].configure(o) : e[G] = new Io(e, o);
1419
1376
  } else
1420
- gt(e);
1377
+ pt(e);
1421
1378
  }
1422
- function gt(e) {
1423
- var t;
1424
- (t = e[Q]) == null || t.destroy(), delete e[Q];
1379
+ function pt(e) {
1380
+ e[G]?.destroy(), delete e[G];
1425
1381
  }
1426
- class $o {
1382
+ class Io {
1427
1383
  constructor(t, n) {
1428
- O(this, "lastMoveEvt");
1429
- O(this, "checkInterval");
1430
- O(this, "shouldShow", !1);
1431
- O(this, "tipEl");
1432
- O(this, "titleEl");
1433
- O(this, "contentEl");
1434
- O(this, "mouseMoveBound", !1);
1435
- O(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1436
- O(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1437
- O(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1438
1384
  this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
1439
1385
  }
1386
+ lastMoveEvt;
1387
+ checkInterval;
1388
+ shouldShow = !1;
1389
+ tipEl;
1390
+ titleEl;
1391
+ contentEl;
1392
+ mouseMoveBound = !1;
1393
+ handleMouseMoveWithContext = this.handleMouseMove.bind(this);
1394
+ handleTargetMouseEnterWithContext = this.handleTargetMouseEnter.bind(this);
1395
+ handleTargetMouseLeaveWithContext = this.handleTargetMouseLeave.bind(this);
1440
1396
  configure(t) {
1441
1397
  this.config = t;
1442
1398
  }
@@ -1459,76 +1415,75 @@ class $o {
1459
1415
  this.shouldShow || this.tipEl && (this.tipEl.remove(), this.tipEl = void 0, this.titleEl = void 0, this.contentEl = void 0, this.checkInterval && (clearInterval(this.checkInterval), this.checkInterval = void 0), window.removeEventListener("mousemove", this.handleMouseMoveWithContext), this.mouseMoveBound = !1);
1460
1416
  }
1461
1417
  handleMouseMove(t) {
1462
- const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight, l = window.innerWidth, s = window.innerHeight;
1463
- let a = t.pageX + 10, r = t.pageY + 20;
1464
- a + n > l && (a = t.pageX - 5 - n), r + o > s && (r = t.pageY - 5 - o), this.tipEl.style.left = a + "px", this.tipEl.style.top = r + "px", this.lastMoveEvt = t;
1418
+ const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight, r = window.innerWidth, s = window.innerHeight;
1419
+ let a = t.pageX + 10, l = t.pageY + 20;
1420
+ a + n > r && (a = t.pageX - 5 - n), l + o > s && (l = t.pageY - 5 - o), this.tipEl.style.left = a + "px", this.tipEl.style.top = l + "px", this.lastMoveEvt = t;
1465
1421
  }
1466
1422
  checkMoveEvent() {
1467
- var t;
1468
- this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && ((t = this.tipEl) != null && t.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
1423
+ this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && (this.tipEl?.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
1469
1424
  }
1470
1425
  destroy() {
1471
1426
  this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
1472
1427
  }
1473
1428
  }
1474
- function Bo(e) {
1475
- e.directive("autofocus", wo), e.directive("confirm-button", bo), e.directive("date-input", ko), e.directive("datetime", Co), e.directive("disabled", Mo), e.directive("duration", xo), e.directive("hotkey", Oo), e.directive("infinite-scroll", Ho), e.directive("readonly", Vo), e.directive("tooltip", Ao);
1429
+ function Oo(e) {
1430
+ e.directive("autofocus", po), e.directive("confirm-button", vo), e.directive("date-input", ho), e.directive("datetime", go), e.directive("disabled", Eo), e.directive("duration", ko), e.directive("hotkey", Co), e.directive("infinite-scroll", Mo), e.directive("readonly", Lo), e.directive("tooltip", Fo);
1476
1431
  }
1477
- function hs(e) {
1478
- Bo(e);
1432
+ function us(e) {
1433
+ Oo(e);
1479
1434
  }
1480
1435
  export {
1481
- qo as OverlayContainer,
1482
- fe as UserError,
1483
- Po as VfAjaxSelect,
1484
- oe as VfAlertModal,
1485
- cs as VfEzSmartSelect,
1486
- Tn as VfModal,
1487
- Xn as VfSmartSelect,
1488
- is as cloneProp,
1489
- Go as configureVf,
1490
- rs as configureVfOpenApiClient,
1491
- vs as createFilters,
1492
- de as createOverlayInjection,
1493
- _n as desnakeCase,
1494
- fn as dismissOverlayInjectionById,
1495
- zo as dismissOverlayInjectionByInstance,
1496
- lt as dismissOverlayInjectionByInternalInstance,
1497
- dn as dismissOverlayInjectionByVnode,
1498
- ws as escapeHtml,
1499
- pn as formatError,
1500
- Ln as formatNumber,
1501
- Nn as formatPhone,
1502
- Rn as formatUSCurrency,
1503
- Qo as handleError,
1504
- Jo as handleErrorAndAlert,
1505
- hs as installVf,
1506
- hn as isError,
1507
- Pe as isNotNullOrUndefined,
1508
- es as maskComponent,
1509
- yn as maskEl,
1510
- gn as maskForm,
1511
- as as nl2br,
1512
- ls as nullifyEmptyInputs,
1513
- Te as presentOverlay,
1514
- ee as removeOverlayInjection,
1515
- ns as replaceElement,
1516
- mn as showAlert,
1517
- Ko as showConfirm,
1518
- Yo as showConfirmDestroy,
1519
- os as showContextMenu,
1520
- Zo as showMutableWait,
1521
- fs as showToast,
1522
- Xo as showWait,
1523
- Mn as sleep,
1524
- ss as sleepSecs,
1525
- Ce as toError,
1526
- ts as unmaskComponent,
1527
- rt as unmaskEl,
1528
- at as unmaskForm,
1529
- vn as updateOverlayProps,
1530
- ms as useInfiniteScroll,
1531
- ps as useResizeWatcher,
1532
- us as uuid,
1533
- ds as vfModalRef
1436
+ _o as OverlayContainer,
1437
+ ce as UserError,
1438
+ Bo as VfAjaxSelect,
1439
+ te as VfAlertModal,
1440
+ os as VfEzSmartSelect,
1441
+ yn as VfModal,
1442
+ Un as VfSmartSelect,
1443
+ Jo as cloneProp,
1444
+ Po as configureVf,
1445
+ es as configureVfOpenApiClient,
1446
+ rs as createFilters,
1447
+ ue as createOverlayInjection,
1448
+ Dn as desnakeCase,
1449
+ rn as dismissOverlayInjectionById,
1450
+ No as dismissOverlayInjectionByInstance,
1451
+ tt as dismissOverlayInjectionByInternalInstance,
1452
+ sn as dismissOverlayInjectionByVnode,
1453
+ fs as escapeHtml,
1454
+ un as formatError,
1455
+ bn as formatNumber,
1456
+ Hn as formatPhone,
1457
+ Vn as formatUSCurrency,
1458
+ zo as handleError,
1459
+ qo as handleErrorAndAlert,
1460
+ us as installVf,
1461
+ cn as isError,
1462
+ Ne as isNotNullOrUndefined,
1463
+ Ko as maskComponent,
1464
+ dn as maskEl,
1465
+ fn as maskForm,
1466
+ ts as nl2br,
1467
+ Qo as nullifyEmptyInputs,
1468
+ be as presentOverlay,
1469
+ J as removeOverlayInjection,
1470
+ Xo as replaceElement,
1471
+ an as showAlert,
1472
+ Ro as showConfirm,
1473
+ Wo as showConfirmDestroy,
1474
+ Zo as showContextMenu,
1475
+ Uo as showMutableWait,
1476
+ is as showToast,
1477
+ jo as showWait,
1478
+ En as sleep,
1479
+ Go as sleepSecs,
1480
+ ke as toError,
1481
+ Yo as unmaskComponent,
1482
+ nt as unmaskEl,
1483
+ ot as unmaskForm,
1484
+ ln as updateOverlayProps,
1485
+ ls as useInfiniteScroll,
1486
+ as as useResizeWatcher,
1487
+ ns as uuid,
1488
+ ss as vfModalRef
1534
1489
  };