@signal24/vue-foundation 3.7.4 → 3.8.1

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.
@@ -0,0 +1,2129 @@
1
+ import { createApp as gr, h as yr, openBlock as O, createElementBlock as w, createElementVNode as P, toDisplayString as Y, withDirectives as X, createCommentVNode as L, Fragment as re, renderList as Lt, vModelSelect as mr, markRaw as $r, createBlock as kt, Teleport as br, normalizeClass as F, withModifiers as _r, renderSlot as ye, resolveComponent as Tr, resolveDirective as Se, createSlots as Or, withCtx as me, createTextVNode as Be, vModelText as Sr } from "vue";
2
+ import u from "jquery";
3
+ import k from "moment";
4
+ import ne from "axios";
5
+ import wr from "vue-stash-nested";
6
+ let Dt;
7
+ function Ar(e) {
8
+ Dt = e;
9
+ }
10
+ const f = gr({
11
+ data() {
12
+ return {
13
+ store: {
14
+ session: null,
15
+ globalError: window.gErr || null,
16
+ rootInjections: []
17
+ }
18
+ };
19
+ },
20
+ render() {
21
+ return yr(Dt);
22
+ }
23
+ }), oe = (e, t) => {
24
+ const r = e.__vccOpts || e;
25
+ for (const [n, i] of t)
26
+ r[n] = i;
27
+ return r;
28
+ }, Cr = {
29
+ props: ["modelValue", "url", "params", "itemsKey", "preprocessor", "textKey", "nullText", "loadingText"],
30
+ data() {
31
+ return {
32
+ options: null,
33
+ selectedItem: null
34
+ };
35
+ },
36
+ watch: {
37
+ params() {
38
+ this.load();
39
+ },
40
+ selectedItem() {
41
+ this.$emit("update:modelValue", this.selectedItem);
42
+ },
43
+ modelValue() {
44
+ this.selectedItem = this.modelValue;
45
+ }
46
+ },
47
+ mounted() {
48
+ this.load();
49
+ },
50
+ methods: {
51
+ async load() {
52
+ this.options = null;
53
+ let e = this.params ? { params: this.params } : void 0, t = await this.$http.get(this.url, e), r = this.itemsKey ? t.data[this.itemsKey] : t.data;
54
+ this.preprocessor && this.preprocessor(r), this.options = r, this.selectedItem = this.modelValue;
55
+ }
56
+ }
57
+ }, xr = {
58
+ key: 0,
59
+ disabled: ""
60
+ }, Er = {
61
+ key: 0,
62
+ value: null
63
+ }, Ir = ["value"];
64
+ function jr(e, t, r, n, i, a) {
65
+ return i.options ? X((O(), w("select", {
66
+ key: 1,
67
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => i.selectedItem = s)
68
+ }, [
69
+ r.nullText ? (O(), w("option", Er, Y(r.nullText), 1)) : L("", !0),
70
+ (O(!0), w(re, null, Lt(i.options, (s) => (O(), w("option", {
71
+ key: s.id,
72
+ value: s
73
+ }, Y(r.textKey ? s[r.textKey] : s), 9, Ir))), 128))
74
+ ], 512)), [
75
+ [mr, i.selectedItem]
76
+ ]) : (O(), w("select", xr, [
77
+ P("option", null, Y(r.loadingText || "Loading..."), 1)
78
+ ]));
79
+ }
80
+ const Pr = /* @__PURE__ */ oe(Cr, [["render", jr]]);
81
+ var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
82
+ function Hr() {
83
+ this.__data__ = [], this.size = 0;
84
+ }
85
+ var Mr = Hr;
86
+ function Lr(e, t) {
87
+ return e === t || e !== e && t !== t;
88
+ }
89
+ var Ie = Lr, kr = Ie;
90
+ function Dr(e, t) {
91
+ for (var r = e.length; r--; )
92
+ if (kr(e[r][0], t))
93
+ return r;
94
+ return -1;
95
+ }
96
+ var le = Dr, Kr = le, Rr = Array.prototype, Fr = Rr.splice;
97
+ function Br(e) {
98
+ var t = this.__data__, r = Kr(t, e);
99
+ if (r < 0)
100
+ return !1;
101
+ var n = t.length - 1;
102
+ return r == n ? t.pop() : Fr.call(t, r, 1), --this.size, !0;
103
+ }
104
+ var Nr = Br, Ur = le;
105
+ function Gr(e) {
106
+ var t = this.__data__, r = Ur(t, e);
107
+ return r < 0 ? void 0 : t[r][1];
108
+ }
109
+ var Vr = Gr, Wr = le;
110
+ function zr(e) {
111
+ return Wr(this.__data__, e) > -1;
112
+ }
113
+ var qr = zr, Yr = le;
114
+ function Xr(e, t) {
115
+ var r = this.__data__, n = Yr(r, e);
116
+ return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this;
117
+ }
118
+ var Jr = Xr, Zr = Mr, Qr = Nr, en = Vr, tn = qr, rn = Jr;
119
+ function U(e) {
120
+ var t = -1, r = e == null ? 0 : e.length;
121
+ for (this.clear(); ++t < r; ) {
122
+ var n = e[t];
123
+ this.set(n[0], n[1]);
124
+ }
125
+ }
126
+ U.prototype.clear = Zr;
127
+ U.prototype.delete = Qr;
128
+ U.prototype.get = en;
129
+ U.prototype.has = tn;
130
+ U.prototype.set = rn;
131
+ var ce = U, nn = ce;
132
+ function an() {
133
+ this.__data__ = new nn(), this.size = 0;
134
+ }
135
+ var sn = an;
136
+ function on(e) {
137
+ var t = this.__data__, r = t.delete(e);
138
+ return this.size = t.size, r;
139
+ }
140
+ var ln = on;
141
+ function cn(e) {
142
+ return this.__data__.get(e);
143
+ }
144
+ var un = cn;
145
+ function fn(e) {
146
+ return this.__data__.has(e);
147
+ }
148
+ var dn = fn, hn = typeof Z == "object" && Z && Z.Object === Object && Z, Kt = hn, pn = Kt, vn = typeof self == "object" && self && self.Object === Object && self, gn = pn || vn || Function("return this")(), E = gn, yn = E, mn = yn.Symbol, ue = mn, Ne = ue, Rt = Object.prototype, $n = Rt.hasOwnProperty, bn = Rt.toString, q = Ne ? Ne.toStringTag : void 0;
149
+ function _n(e) {
150
+ var t = $n.call(e, q), r = e[q];
151
+ try {
152
+ e[q] = void 0;
153
+ var n = !0;
154
+ } catch {
155
+ }
156
+ var i = bn.call(e);
157
+ return n && (t ? e[q] = r : delete e[q]), i;
158
+ }
159
+ var Tn = _n, On = Object.prototype, Sn = On.toString;
160
+ function wn(e) {
161
+ return Sn.call(e);
162
+ }
163
+ var An = wn, Ue = ue, Cn = Tn, xn = An, En = "[object Null]", In = "[object Undefined]", Ge = Ue ? Ue.toStringTag : void 0;
164
+ function jn(e) {
165
+ return e == null ? e === void 0 ? In : En : Ge && Ge in Object(e) ? Cn(e) : xn(e);
166
+ }
167
+ var J = jn;
168
+ function Pn(e) {
169
+ var t = typeof e;
170
+ return e != null && (t == "object" || t == "function");
171
+ }
172
+ var D = Pn, Hn = J, Mn = D, Ln = "[object AsyncFunction]", kn = "[object Function]", Dn = "[object GeneratorFunction]", Kn = "[object Proxy]";
173
+ function Rn(e) {
174
+ if (!Mn(e))
175
+ return !1;
176
+ var t = Hn(e);
177
+ return t == kn || t == Dn || t == Ln || t == Kn;
178
+ }
179
+ var Ft = Rn, Fn = E, Bn = Fn["__core-js_shared__"], Nn = Bn, $e = Nn, Ve = function() {
180
+ var e = /[^.]+$/.exec($e && $e.keys && $e.keys.IE_PROTO || "");
181
+ return e ? "Symbol(src)_1." + e : "";
182
+ }();
183
+ function Un(e) {
184
+ return !!Ve && Ve in e;
185
+ }
186
+ var Gn = Un, Vn = Function.prototype, Wn = Vn.toString;
187
+ function zn(e) {
188
+ if (e != null) {
189
+ try {
190
+ return Wn.call(e);
191
+ } catch {
192
+ }
193
+ try {
194
+ return e + "";
195
+ } catch {
196
+ }
197
+ }
198
+ return "";
199
+ }
200
+ var Bt = zn, qn = Ft, Yn = Gn, Xn = D, Jn = Bt, Zn = /[\\^$.*+?()[\]{}|]/g, Qn = /^\[object .+?Constructor\]$/, ei = Function.prototype, ti = Object.prototype, ri = ei.toString, ni = ti.hasOwnProperty, ii = RegExp(
201
+ "^" + ri.call(ni).replace(Zn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
202
+ );
203
+ function ai(e) {
204
+ if (!Xn(e) || Yn(e))
205
+ return !1;
206
+ var t = qn(e) ? ii : Qn;
207
+ return t.test(Jn(e));
208
+ }
209
+ var si = ai;
210
+ function oi(e, t) {
211
+ return e == null ? void 0 : e[t];
212
+ }
213
+ var li = oi, ci = si, ui = li;
214
+ function fi(e, t) {
215
+ var r = ui(e, t);
216
+ return ci(r) ? r : void 0;
217
+ }
218
+ var K = fi, di = K, hi = E, pi = di(hi, "Map"), je = pi, vi = K, gi = vi(Object, "create"), fe = gi, We = fe;
219
+ function yi() {
220
+ this.__data__ = We ? We(null) : {}, this.size = 0;
221
+ }
222
+ var mi = yi;
223
+ function $i(e) {
224
+ var t = this.has(e) && delete this.__data__[e];
225
+ return this.size -= t ? 1 : 0, t;
226
+ }
227
+ var bi = $i, _i = fe, Ti = "__lodash_hash_undefined__", Oi = Object.prototype, Si = Oi.hasOwnProperty;
228
+ function wi(e) {
229
+ var t = this.__data__;
230
+ if (_i) {
231
+ var r = t[e];
232
+ return r === Ti ? void 0 : r;
233
+ }
234
+ return Si.call(t, e) ? t[e] : void 0;
235
+ }
236
+ var Ai = wi, Ci = fe, xi = Object.prototype, Ei = xi.hasOwnProperty;
237
+ function Ii(e) {
238
+ var t = this.__data__;
239
+ return Ci ? t[e] !== void 0 : Ei.call(t, e);
240
+ }
241
+ var ji = Ii, Pi = fe, Hi = "__lodash_hash_undefined__";
242
+ function Mi(e, t) {
243
+ var r = this.__data__;
244
+ return this.size += this.has(e) ? 0 : 1, r[e] = Pi && t === void 0 ? Hi : t, this;
245
+ }
246
+ var Li = Mi, ki = mi, Di = bi, Ki = Ai, Ri = ji, Fi = Li;
247
+ function G(e) {
248
+ var t = -1, r = e == null ? 0 : e.length;
249
+ for (this.clear(); ++t < r; ) {
250
+ var n = e[t];
251
+ this.set(n[0], n[1]);
252
+ }
253
+ }
254
+ G.prototype.clear = ki;
255
+ G.prototype.delete = Di;
256
+ G.prototype.get = Ki;
257
+ G.prototype.has = Ri;
258
+ G.prototype.set = Fi;
259
+ var Bi = G, ze = Bi, Ni = ce, Ui = je;
260
+ function Gi() {
261
+ this.size = 0, this.__data__ = {
262
+ hash: new ze(),
263
+ map: new (Ui || Ni)(),
264
+ string: new ze()
265
+ };
266
+ }
267
+ var Vi = Gi;
268
+ function Wi(e) {
269
+ var t = typeof e;
270
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
271
+ }
272
+ var zi = Wi, qi = zi;
273
+ function Yi(e, t) {
274
+ var r = e.__data__;
275
+ return qi(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
276
+ }
277
+ var de = Yi, Xi = de;
278
+ function Ji(e) {
279
+ var t = Xi(this, e).delete(e);
280
+ return this.size -= t ? 1 : 0, t;
281
+ }
282
+ var Zi = Ji, Qi = de;
283
+ function ea(e) {
284
+ return Qi(this, e).get(e);
285
+ }
286
+ var ta = ea, ra = de;
287
+ function na(e) {
288
+ return ra(this, e).has(e);
289
+ }
290
+ var ia = na, aa = de;
291
+ function sa(e, t) {
292
+ var r = aa(this, e), n = r.size;
293
+ return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
294
+ }
295
+ var oa = sa, la = Vi, ca = Zi, ua = ta, fa = ia, da = oa;
296
+ function V(e) {
297
+ var t = -1, r = e == null ? 0 : e.length;
298
+ for (this.clear(); ++t < r; ) {
299
+ var n = e[t];
300
+ this.set(n[0], n[1]);
301
+ }
302
+ }
303
+ V.prototype.clear = la;
304
+ V.prototype.delete = ca;
305
+ V.prototype.get = ua;
306
+ V.prototype.has = fa;
307
+ V.prototype.set = da;
308
+ var Nt = V, ha = ce, pa = je, va = Nt, ga = 200;
309
+ function ya(e, t) {
310
+ var r = this.__data__;
311
+ if (r instanceof ha) {
312
+ var n = r.__data__;
313
+ if (!pa || n.length < ga - 1)
314
+ return n.push([e, t]), this.size = ++r.size, this;
315
+ r = this.__data__ = new va(n);
316
+ }
317
+ return r.set(e, t), this.size = r.size, this;
318
+ }
319
+ var ma = ya, $a = ce, ba = sn, _a = ln, Ta = un, Oa = dn, Sa = ma;
320
+ function W(e) {
321
+ var t = this.__data__ = new $a(e);
322
+ this.size = t.size;
323
+ }
324
+ W.prototype.clear = ba;
325
+ W.prototype.delete = _a;
326
+ W.prototype.get = Ta;
327
+ W.prototype.has = Oa;
328
+ W.prototype.set = Sa;
329
+ var Ut = W;
330
+ function wa(e, t) {
331
+ for (var r = -1, n = e == null ? 0 : e.length; ++r < n && t(e[r], r, e) !== !1; )
332
+ ;
333
+ return e;
334
+ }
335
+ var Aa = wa, Ca = K, xa = function() {
336
+ try {
337
+ var e = Ca(Object, "defineProperty");
338
+ return e({}, "", {}), e;
339
+ } catch {
340
+ }
341
+ }(), Ea = xa, qe = Ea;
342
+ function Ia(e, t, r) {
343
+ t == "__proto__" && qe ? qe(e, t, {
344
+ configurable: !0,
345
+ enumerable: !0,
346
+ value: r,
347
+ writable: !0
348
+ }) : e[t] = r;
349
+ }
350
+ var Gt = Ia, ja = Gt, Pa = Ie, Ha = Object.prototype, Ma = Ha.hasOwnProperty;
351
+ function La(e, t, r) {
352
+ var n = e[t];
353
+ (!(Ma.call(e, t) && Pa(n, r)) || r === void 0 && !(t in e)) && ja(e, t, r);
354
+ }
355
+ var Vt = La, ka = Vt, Da = Gt;
356
+ function Ka(e, t, r, n) {
357
+ var i = !r;
358
+ r || (r = {});
359
+ for (var a = -1, s = t.length; ++a < s; ) {
360
+ var o = t[a], l = n ? n(r[o], e[o], o, r, e) : void 0;
361
+ l === void 0 && (l = e[o]), i ? Da(r, o, l) : ka(r, o, l);
362
+ }
363
+ return r;
364
+ }
365
+ var he = Ka;
366
+ function Ra(e, t) {
367
+ for (var r = -1, n = Array(e); ++r < e; )
368
+ n[r] = t(r);
369
+ return n;
370
+ }
371
+ var Fa = Ra;
372
+ function Ba(e) {
373
+ return e != null && typeof e == "object";
374
+ }
375
+ var R = Ba, Na = J, Ua = R, Ga = "[object Arguments]";
376
+ function Va(e) {
377
+ return Ua(e) && Na(e) == Ga;
378
+ }
379
+ var Wa = Va, Ye = Wa, za = R, Wt = Object.prototype, qa = Wt.hasOwnProperty, Ya = Wt.propertyIsEnumerable, Xa = Ye(function() {
380
+ return arguments;
381
+ }()) ? Ye : function(e) {
382
+ return za(e) && qa.call(e, "callee") && !Ya.call(e, "callee");
383
+ }, Ja = Xa, Za = Array.isArray, pe = Za, B = {}, Qa = {
384
+ get exports() {
385
+ return B;
386
+ },
387
+ set exports(e) {
388
+ B = e;
389
+ }
390
+ };
391
+ function es() {
392
+ return !1;
393
+ }
394
+ var ts = es;
395
+ (function(e, t) {
396
+ var r = E, n = ts, i = t && !t.nodeType && t, a = i && !0 && e && !e.nodeType && e, s = a && a.exports === i, o = s ? r.Buffer : void 0, l = o ? o.isBuffer : void 0, c = l || n;
397
+ e.exports = c;
398
+ })(Qa, B);
399
+ var rs = 9007199254740991, ns = /^(?:0|[1-9]\d*)$/;
400
+ function is(e, t) {
401
+ var r = typeof e;
402
+ return t = t ?? rs, !!t && (r == "number" || r != "symbol" && ns.test(e)) && e > -1 && e % 1 == 0 && e < t;
403
+ }
404
+ var as = is, ss = 9007199254740991;
405
+ function os(e) {
406
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= ss;
407
+ }
408
+ var zt = os, ls = J, cs = zt, us = R, fs = "[object Arguments]", ds = "[object Array]", hs = "[object Boolean]", ps = "[object Date]", vs = "[object Error]", gs = "[object Function]", ys = "[object Map]", ms = "[object Number]", $s = "[object Object]", bs = "[object RegExp]", _s = "[object Set]", Ts = "[object String]", Os = "[object WeakMap]", Ss = "[object ArrayBuffer]", ws = "[object DataView]", As = "[object Float32Array]", Cs = "[object Float64Array]", xs = "[object Int8Array]", Es = "[object Int16Array]", Is = "[object Int32Array]", js = "[object Uint8Array]", Ps = "[object Uint8ClampedArray]", Hs = "[object Uint16Array]", Ms = "[object Uint32Array]", $ = {};
409
+ $[As] = $[Cs] = $[xs] = $[Es] = $[Is] = $[js] = $[Ps] = $[Hs] = $[Ms] = !0;
410
+ $[fs] = $[ds] = $[Ss] = $[hs] = $[ws] = $[ps] = $[vs] = $[gs] = $[ys] = $[ms] = $[$s] = $[bs] = $[_s] = $[Ts] = $[Os] = !1;
411
+ function Ls(e) {
412
+ return us(e) && cs(e.length) && !!$[ls(e)];
413
+ }
414
+ var ks = Ls;
415
+ function Ds(e) {
416
+ return function(t) {
417
+ return e(t);
418
+ };
419
+ }
420
+ var Pe = Ds, N = {}, Ks = {
421
+ get exports() {
422
+ return N;
423
+ },
424
+ set exports(e) {
425
+ N = e;
426
+ }
427
+ };
428
+ (function(e, t) {
429
+ var r = Kt, n = t && !t.nodeType && t, i = n && !0 && e && !e.nodeType && e, a = i && i.exports === n, s = a && r.process, o = function() {
430
+ try {
431
+ var l = i && i.require && i.require("util").types;
432
+ return l || s && s.binding && s.binding("util");
433
+ } catch {
434
+ }
435
+ }();
436
+ e.exports = o;
437
+ })(Ks, N);
438
+ var Rs = ks, Fs = Pe, Xe = N, Je = Xe && Xe.isTypedArray, Bs = Je ? Fs(Je) : Rs, qt = Bs, Ns = Fa, Us = Ja, Gs = pe, Vs = B, Ws = as, zs = qt, qs = Object.prototype, Ys = qs.hasOwnProperty;
439
+ function Xs(e, t) {
440
+ var r = Gs(e), n = !r && Us(e), i = !r && !n && Vs(e), a = !r && !n && !i && zs(e), s = r || n || i || a, o = s ? Ns(e.length, String) : [], l = o.length;
441
+ for (var c in e)
442
+ (t || Ys.call(e, c)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
443
+ (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
444
+ i && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
445
+ a && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties.
446
+ Ws(c, l))) && o.push(c);
447
+ return o;
448
+ }
449
+ var Yt = Xs, Js = Object.prototype;
450
+ function Zs(e) {
451
+ var t = e && e.constructor, r = typeof t == "function" && t.prototype || Js;
452
+ return e === r;
453
+ }
454
+ var He = Zs;
455
+ function Qs(e, t) {
456
+ return function(r) {
457
+ return e(t(r));
458
+ };
459
+ }
460
+ var Xt = Qs, eo = Xt, to = eo(Object.keys, Object), ro = to, no = He, io = ro, ao = Object.prototype, so = ao.hasOwnProperty;
461
+ function oo(e) {
462
+ if (!no(e))
463
+ return io(e);
464
+ var t = [];
465
+ for (var r in Object(e))
466
+ so.call(e, r) && r != "constructor" && t.push(r);
467
+ return t;
468
+ }
469
+ var lo = oo, co = Ft, uo = zt;
470
+ function fo(e) {
471
+ return e != null && uo(e.length) && !co(e);
472
+ }
473
+ var Jt = fo, ho = Yt, po = lo, vo = Jt;
474
+ function go(e) {
475
+ return vo(e) ? ho(e) : po(e);
476
+ }
477
+ var Me = go, yo = he, mo = Me;
478
+ function $o(e, t) {
479
+ return e && yo(t, mo(t), e);
480
+ }
481
+ var bo = $o;
482
+ function _o(e) {
483
+ var t = [];
484
+ if (e != null)
485
+ for (var r in Object(e))
486
+ t.push(r);
487
+ return t;
488
+ }
489
+ var To = _o, Oo = D, So = He, wo = To, Ao = Object.prototype, Co = Ao.hasOwnProperty;
490
+ function xo(e) {
491
+ if (!Oo(e))
492
+ return wo(e);
493
+ var t = So(e), r = [];
494
+ for (var n in e)
495
+ n == "constructor" && (t || !Co.call(e, n)) || r.push(n);
496
+ return r;
497
+ }
498
+ var Eo = xo, Io = Yt, jo = Eo, Po = Jt;
499
+ function Ho(e) {
500
+ return Po(e) ? Io(e, !0) : jo(e);
501
+ }
502
+ var Le = Ho, Mo = he, Lo = Le;
503
+ function ko(e, t) {
504
+ return e && Mo(t, Lo(t), e);
505
+ }
506
+ var Do = ko, ie = {}, Ko = {
507
+ get exports() {
508
+ return ie;
509
+ },
510
+ set exports(e) {
511
+ ie = e;
512
+ }
513
+ };
514
+ (function(e, t) {
515
+ var r = E, n = t && !t.nodeType && t, i = n && !0 && e && !e.nodeType && e, a = i && i.exports === n, s = a ? r.Buffer : void 0, o = s ? s.allocUnsafe : void 0;
516
+ function l(c, b) {
517
+ if (b)
518
+ return c.slice();
519
+ var d = c.length, h = o ? o(d) : new c.constructor(d);
520
+ return c.copy(h), h;
521
+ }
522
+ e.exports = l;
523
+ })(Ko, ie);
524
+ function Ro(e, t) {
525
+ var r = -1, n = e.length;
526
+ for (t || (t = Array(n)); ++r < n; )
527
+ t[r] = e[r];
528
+ return t;
529
+ }
530
+ var Fo = Ro;
531
+ function Bo(e, t) {
532
+ for (var r = -1, n = e == null ? 0 : e.length, i = 0, a = []; ++r < n; ) {
533
+ var s = e[r];
534
+ t(s, r, e) && (a[i++] = s);
535
+ }
536
+ return a;
537
+ }
538
+ var No = Bo;
539
+ function Uo() {
540
+ return [];
541
+ }
542
+ var Zt = Uo, Go = No, Vo = Zt, Wo = Object.prototype, zo = Wo.propertyIsEnumerable, Ze = Object.getOwnPropertySymbols, qo = Ze ? function(e) {
543
+ return e == null ? [] : (e = Object(e), Go(Ze(e), function(t) {
544
+ return zo.call(e, t);
545
+ }));
546
+ } : Vo, ke = qo, Yo = he, Xo = ke;
547
+ function Jo(e, t) {
548
+ return Yo(e, Xo(e), t);
549
+ }
550
+ var Zo = Jo;
551
+ function Qo(e, t) {
552
+ for (var r = -1, n = t.length, i = e.length; ++r < n; )
553
+ e[i + r] = t[r];
554
+ return e;
555
+ }
556
+ var Qt = Qo, el = Xt, tl = el(Object.getPrototypeOf, Object), er = tl, rl = Qt, nl = er, il = ke, al = Zt, sl = Object.getOwnPropertySymbols, ol = sl ? function(e) {
557
+ for (var t = []; e; )
558
+ rl(t, il(e)), e = nl(e);
559
+ return t;
560
+ } : al, tr = ol, ll = he, cl = tr;
561
+ function ul(e, t) {
562
+ return ll(e, cl(e), t);
563
+ }
564
+ var fl = ul, dl = Qt, hl = pe;
565
+ function pl(e, t, r) {
566
+ var n = t(e);
567
+ return hl(e) ? n : dl(n, r(e));
568
+ }
569
+ var rr = pl, vl = rr, gl = ke, yl = Me;
570
+ function ml(e) {
571
+ return vl(e, yl, gl);
572
+ }
573
+ var nr = ml, $l = rr, bl = tr, _l = Le;
574
+ function Tl(e) {
575
+ return $l(e, _l, bl);
576
+ }
577
+ var Ol = Tl, Sl = K, wl = E, Al = Sl(wl, "DataView"), Cl = Al, xl = K, El = E, Il = xl(El, "Promise"), jl = Il, Pl = K, Hl = E, Ml = Pl(Hl, "Set"), Ll = Ml, kl = K, Dl = E, Kl = kl(Dl, "WeakMap"), Rl = Kl, we = Cl, Ae = je, Ce = jl, xe = Ll, Ee = Rl, ir = J, z = Bt, Qe = "[object Map]", Fl = "[object Object]", et = "[object Promise]", tt = "[object Set]", rt = "[object WeakMap]", nt = "[object DataView]", Bl = z(we), Nl = z(Ae), Ul = z(Ce), Gl = z(xe), Vl = z(Ee), M = ir;
578
+ (we && M(new we(new ArrayBuffer(1))) != nt || Ae && M(new Ae()) != Qe || Ce && M(Ce.resolve()) != et || xe && M(new xe()) != tt || Ee && M(new Ee()) != rt) && (M = function(e) {
579
+ var t = ir(e), r = t == Fl ? e.constructor : void 0, n = r ? z(r) : "";
580
+ if (n)
581
+ switch (n) {
582
+ case Bl:
583
+ return nt;
584
+ case Nl:
585
+ return Qe;
586
+ case Ul:
587
+ return et;
588
+ case Gl:
589
+ return tt;
590
+ case Vl:
591
+ return rt;
592
+ }
593
+ return t;
594
+ });
595
+ var ve = M, Wl = Object.prototype, zl = Wl.hasOwnProperty;
596
+ function ql(e) {
597
+ var t = e.length, r = new e.constructor(t);
598
+ return t && typeof e[0] == "string" && zl.call(e, "index") && (r.index = e.index, r.input = e.input), r;
599
+ }
600
+ var Yl = ql, Xl = E, Jl = Xl.Uint8Array, ar = Jl, it = ar;
601
+ function Zl(e) {
602
+ var t = new e.constructor(e.byteLength);
603
+ return new it(t).set(new it(e)), t;
604
+ }
605
+ var De = Zl, Ql = De;
606
+ function ec(e, t) {
607
+ var r = t ? Ql(e.buffer) : e.buffer;
608
+ return new e.constructor(r, e.byteOffset, e.byteLength);
609
+ }
610
+ var tc = ec, rc = /\w*$/;
611
+ function nc(e) {
612
+ var t = new e.constructor(e.source, rc.exec(e));
613
+ return t.lastIndex = e.lastIndex, t;
614
+ }
615
+ var ic = nc, at = ue, st = at ? at.prototype : void 0, ot = st ? st.valueOf : void 0;
616
+ function ac(e) {
617
+ return ot ? Object(ot.call(e)) : {};
618
+ }
619
+ var sc = ac, oc = De;
620
+ function lc(e, t) {
621
+ var r = t ? oc(e.buffer) : e.buffer;
622
+ return new e.constructor(r, e.byteOffset, e.length);
623
+ }
624
+ var cc = lc, uc = De, fc = tc, dc = ic, hc = sc, pc = cc, vc = "[object Boolean]", gc = "[object Date]", yc = "[object Map]", mc = "[object Number]", $c = "[object RegExp]", bc = "[object Set]", _c = "[object String]", Tc = "[object Symbol]", Oc = "[object ArrayBuffer]", Sc = "[object DataView]", wc = "[object Float32Array]", Ac = "[object Float64Array]", Cc = "[object Int8Array]", xc = "[object Int16Array]", Ec = "[object Int32Array]", Ic = "[object Uint8Array]", jc = "[object Uint8ClampedArray]", Pc = "[object Uint16Array]", Hc = "[object Uint32Array]";
625
+ function Mc(e, t, r) {
626
+ var n = e.constructor;
627
+ switch (t) {
628
+ case Oc:
629
+ return uc(e);
630
+ case vc:
631
+ case gc:
632
+ return new n(+e);
633
+ case Sc:
634
+ return fc(e, r);
635
+ case wc:
636
+ case Ac:
637
+ case Cc:
638
+ case xc:
639
+ case Ec:
640
+ case Ic:
641
+ case jc:
642
+ case Pc:
643
+ case Hc:
644
+ return pc(e, r);
645
+ case yc:
646
+ return new n();
647
+ case mc:
648
+ case _c:
649
+ return new n(e);
650
+ case $c:
651
+ return dc(e);
652
+ case bc:
653
+ return new n();
654
+ case Tc:
655
+ return hc(e);
656
+ }
657
+ }
658
+ var Lc = Mc, kc = D, lt = Object.create, Dc = function() {
659
+ function e() {
660
+ }
661
+ return function(t) {
662
+ if (!kc(t))
663
+ return {};
664
+ if (lt)
665
+ return lt(t);
666
+ e.prototype = t;
667
+ var r = new e();
668
+ return e.prototype = void 0, r;
669
+ };
670
+ }(), Kc = Dc, Rc = Kc, Fc = er, Bc = He;
671
+ function Nc(e) {
672
+ return typeof e.constructor == "function" && !Bc(e) ? Rc(Fc(e)) : {};
673
+ }
674
+ var Uc = Nc, Gc = ve, Vc = R, Wc = "[object Map]";
675
+ function zc(e) {
676
+ return Vc(e) && Gc(e) == Wc;
677
+ }
678
+ var qc = zc, Yc = qc, Xc = Pe, ct = N, ut = ct && ct.isMap, Jc = ut ? Xc(ut) : Yc, Zc = Jc, Qc = ve, eu = R, tu = "[object Set]";
679
+ function ru(e) {
680
+ return eu(e) && Qc(e) == tu;
681
+ }
682
+ var nu = ru, iu = nu, au = Pe, ft = N, dt = ft && ft.isSet, su = dt ? au(dt) : iu, ou = su, lu = Ut, cu = Aa, uu = Vt, fu = bo, du = Do, hu = ie, pu = Fo, vu = Zo, gu = fl, yu = nr, mu = Ol, $u = ve, bu = Yl, _u = Lc, Tu = Uc, Ou = pe, Su = B, wu = Zc, Au = D, Cu = ou, xu = Me, Eu = Le, Iu = 1, ju = 2, Pu = 4, sr = "[object Arguments]", Hu = "[object Array]", Mu = "[object Boolean]", Lu = "[object Date]", ku = "[object Error]", or = "[object Function]", Du = "[object GeneratorFunction]", Ku = "[object Map]", Ru = "[object Number]", lr = "[object Object]", Fu = "[object RegExp]", Bu = "[object Set]", Nu = "[object String]", Uu = "[object Symbol]", Gu = "[object WeakMap]", Vu = "[object ArrayBuffer]", Wu = "[object DataView]", zu = "[object Float32Array]", qu = "[object Float64Array]", Yu = "[object Int8Array]", Xu = "[object Int16Array]", Ju = "[object Int32Array]", Zu = "[object Uint8Array]", Qu = "[object Uint8ClampedArray]", ef = "[object Uint16Array]", tf = "[object Uint32Array]", y = {};
683
+ y[sr] = y[Hu] = y[Vu] = y[Wu] = y[Mu] = y[Lu] = y[zu] = y[qu] = y[Yu] = y[Xu] = y[Ju] = y[Ku] = y[Ru] = y[lr] = y[Fu] = y[Bu] = y[Nu] = y[Uu] = y[Zu] = y[Qu] = y[ef] = y[tf] = !0;
684
+ y[ku] = y[or] = y[Gu] = !1;
685
+ function ee(e, t, r, n, i, a) {
686
+ var s, o = t & Iu, l = t & ju, c = t & Pu;
687
+ if (r && (s = i ? r(e, n, i, a) : r(e)), s !== void 0)
688
+ return s;
689
+ if (!Au(e))
690
+ return e;
691
+ var b = Ou(e);
692
+ if (b) {
693
+ if (s = bu(e), !o)
694
+ return pu(e, s);
695
+ } else {
696
+ var d = $u(e), h = d == or || d == Du;
697
+ if (Su(e))
698
+ return hu(e, o);
699
+ if (d == lr || d == sr || h && !i) {
700
+ if (s = l || h ? {} : Tu(e), !o)
701
+ return l ? gu(e, du(s, e)) : vu(e, fu(s, e));
702
+ } else {
703
+ if (!y[d])
704
+ return i ? e : {};
705
+ s = _u(e, d, o);
706
+ }
707
+ }
708
+ a || (a = new lu());
709
+ var p = a.get(e);
710
+ if (p)
711
+ return p;
712
+ a.set(e, s), Cu(e) ? e.forEach(function(_) {
713
+ s.add(ee(_, t, r, _, e, a));
714
+ }) : wu(e) && e.forEach(function(_, S) {
715
+ s.set(S, ee(_, t, r, S, e, a));
716
+ });
717
+ var v = c ? l ? mu : yu : l ? Eu : xu, T = b ? void 0 : v(e);
718
+ return cu(T || e, function(_, S) {
719
+ T && (S = _, _ = e[S]), uu(s, S, ee(_, t, r, S, e, a));
720
+ }), s;
721
+ }
722
+ var rf = ee, nf = rf, af = 1, sf = 4;
723
+ function of(e) {
724
+ return nf(e, af | sf);
725
+ }
726
+ var lf = of;
727
+ const cf = {
728
+ props: ["id", "closeOnMaskClick", "scrolls", "closeX", "class"],
729
+ emits: ["formSubmit"],
730
+ beforeCreate() {
731
+ const e = document.getElementById("vf-modal-target") ?? document.createElement("div");
732
+ e.id = "vf-modal-target", e.removeAttribute("inert"), document.body.appendChild(e);
733
+ },
734
+ mounted() {
735
+ window.addEventListener("keydown", this.handleEscapeKey), document.body.classList.add("vf-modal-open"), this.$isPropTruthy(this.closeOnMaskClick) && this.$el.addEventListener("click", (e) => {
736
+ e.target == this.$el && this.$parent.$dismiss();
737
+ });
738
+ },
739
+ unmounted() {
740
+ window.removeEventListener("keydown", this.handleEscapeKey), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
741
+ },
742
+ methods: {
743
+ handleEscapeKey(e) {
744
+ if (e.key === "Esc" || e.key === "Escape") {
745
+ const t = document.querySelectorAll(".vf-modal-wrap");
746
+ t[t.length - 1] === this.$el && this.$parent.$dismiss();
747
+ }
748
+ }
749
+ }
750
+ };
751
+ let ae = {};
752
+ function uf(e) {
753
+ const t = ae[e];
754
+ this.$modalOpener = t.opener, this.$modalResult = void 0, this.$options.storeParent = this.$modalOpener;
755
+ let r = this.$options.data;
756
+ this.$options.data = function() {
757
+ const n = t.injectedData || {}, i = this.$options.keepOriginal || [];
758
+ let a = r ? r.apply(this) : {};
759
+ for (let s in n)
760
+ i.includes(s) || (n[s] !== null && typeof n[s] == "object" && n[s].constructor === Object ? a[s] = lf(n[s]) : a[s] = n[s]);
761
+ return a;
762
+ }, this.$dismiss = (...n) => new Promise((i) => {
763
+ setTimeout(() => {
764
+ delete ae[e];
765
+ let a = f.vm.store.rootInjections;
766
+ const s = a.find((o) => o.__modalId === e);
767
+ s && (a.remove(s), this.$nextTick(() => {
768
+ t.resolve.apply(this, n[0] !== void 0 ? n : this.$modalResult), i();
769
+ }));
770
+ }, 0);
771
+ }), t.instanceCreationCallback && t.instanceCreationCallback(this);
772
+ }
773
+ f.mixin({
774
+ beforeCreate() {
775
+ const e = this.$options.__modalId || this.$options.__file;
776
+ e && ae[e] && uf.call(this, e);
777
+ }
778
+ });
779
+ f.config.globalProperties.$modal = function(e, t, r) {
780
+ return new Promise((n, i) => {
781
+ const a = e.__modalId || e.__file || Math.random().toString(36).substring(2, 10);
782
+ e.__modalId = a, ae[a] = {
783
+ opener: this,
784
+ injectedData: t,
785
+ instanceCreationCallback: r,
786
+ resolve: n
787
+ }, this.$nextTick(() => {
788
+ f.vm.store.rootInjections.push($r(e));
789
+ });
790
+ });
791
+ };
792
+ const ff = ["id"], df = {
793
+ key: 0,
794
+ class: "vf-modal-header"
795
+ }, hf = { class: "vf-modal-content" }, pf = {
796
+ key: 1,
797
+ class: "vf-modal-footer"
798
+ };
799
+ function vf(e, t, r, n, i, a) {
800
+ return O(), kt(br, { to: "#vf-modal-target" }, [
801
+ P("div", {
802
+ id: r.id,
803
+ class: F(["vf-overlay vf-modal-wrap", r.class])
804
+ }, [
805
+ P("form", {
806
+ action: ".",
807
+ class: F(["vf-modal", { scrolls: e.$isPropTruthy(this.scrolls) }]),
808
+ onSubmit: t[1] || (t[1] = _r((s) => e.$emit("formSubmit"), ["prevent"]))
809
+ }, [
810
+ e.$slots.header ? (O(), w("div", df, [
811
+ ye(e.$slots, "header"),
812
+ e.$isPropTruthy(this.closeX) ? (O(), w("i", {
813
+ key: 0,
814
+ class: "close",
815
+ onClick: t[0] || (t[0] = (s) => e.$parent.$dismiss())
816
+ })) : L("", !0)
817
+ ])) : L("", !0),
818
+ P("div", hf, [
819
+ ye(e.$slots, "default")
820
+ ]),
821
+ e.$slots.footer ? (O(), w("div", pf, [
822
+ ye(e.$slots, "footer")
823
+ ])) : L("", !0)
824
+ ], 34)
825
+ ], 10, ff)
826
+ ]);
827
+ }
828
+ const cr = /* @__PURE__ */ oe(cf, [["render", vf]]);
829
+ const ge = {
830
+ components: {
831
+ Modal: cr
832
+ },
833
+ data() {
834
+ return {
835
+ isBare: !1,
836
+ isHtml: !1,
837
+ classes: [],
838
+ title: null,
839
+ message: null,
840
+ shouldConfirm: !1
841
+ };
842
+ },
843
+ created() {
844
+ if (typeof this.message == "object") {
845
+ if (this.message.html)
846
+ this.isHtml = !0, this.message = this.message.html;
847
+ else if (this.message instanceof Error) {
848
+ let e = this.message;
849
+ e.handle(), this.message = e.userMessage;
850
+ }
851
+ }
852
+ },
853
+ methods: {
854
+ ok() {
855
+ this.$dismiss(!0);
856
+ }
857
+ }
858
+ }, gf = ge;
859
+ async function Ke(e, t, ...r) {
860
+ return t = { ...t, __modalId: Math.random().toString(36).substring(2, 10) }, await e.$modal.apply(e, [t, ...r]);
861
+ }
862
+ f.config.globalProperties.$alert = async function(e, t) {
863
+ return await Ke(this, ge, { title: e, message: t });
864
+ };
865
+ f.config.globalProperties.$confirm = async function(e, t, r) {
866
+ return r = r || {}, !!await Ke(this, ge, { title: e, message: t, shouldConfirm: !0, ...r });
867
+ };
868
+ f.config.globalProperties.$confirmDestroy = function(e, t, r) {
869
+ return r = r || {}, r.classes = r.classes || [], r.classes.push("destructive"), this.$confirm(e, t, r);
870
+ };
871
+ f.config.globalProperties.$wait = function(e, t) {
872
+ e && !t ? (t = e, e = void 0) : !e && !t && (t = "Please wait...");
873
+ let r = null, n = new Promise((i, a) => {
874
+ Ke(this, ge, { title: e, message: t, isBare: !0, classes: ["wait"] }, i);
875
+ }).then((i) => r = i);
876
+ return this.$endWait = async () => {
877
+ delete this.$endWait, r ? await r.$dismiss() : await n.then(() => r.$dismiss());
878
+ }, this.$endWait;
879
+ };
880
+ const yf = ["innerHTML"], mf = { key: 1 };
881
+ function $f(e, t, r, n, i, a) {
882
+ const s = Tr("Modal"), o = Se("user-text"), l = Se("autofocus");
883
+ return O(), kt(s, {
884
+ class: F(["vf-alert", e.classes])
885
+ }, Or({
886
+ default: me(() => [
887
+ e.isHtml ? (O(), w("div", {
888
+ key: 0,
889
+ innerHTML: e.message,
890
+ class: "user-message"
891
+ }, null, 8, yf)) : X((O(), w("div", mf, null, 512)), [
892
+ [o, e.message]
893
+ ])
894
+ ]),
895
+ _: 2
896
+ }, [
897
+ this.isBare ? void 0 : {
898
+ name: "header",
899
+ fn: me(() => [
900
+ P("h1", null, Y(e.title), 1)
901
+ ]),
902
+ key: "0"
903
+ },
904
+ this.isBare ? void 0 : {
905
+ name: "footer",
906
+ fn: me(() => [
907
+ e.shouldConfirm ? (O(), w(re, { key: 0 }, [
908
+ X((O(), w("button", {
909
+ class: "primary",
910
+ onClick: t[0] || (t[0] = (...c) => e.ok && e.ok(...c))
911
+ }, [
912
+ Be("Confirm")
913
+ ])), [
914
+ [l]
915
+ ]),
916
+ P("button", {
917
+ class: "default",
918
+ onClick: t[1] || (t[1] = (c) => e.$dismiss())
919
+ }, "Cancel")
920
+ ], 64)) : X((O(), w("button", {
921
+ key: 1,
922
+ class: "default",
923
+ onClick: t[2] || (t[2] = (...c) => e.ok && e.ok(...c))
924
+ }, [
925
+ Be("OK")
926
+ ])), [
927
+ [l]
928
+ ])
929
+ ]),
930
+ key: "1"
931
+ }
932
+ ]), 1032, ["class"]);
933
+ }
934
+ const bf = /* @__PURE__ */ oe(gf, [["render", $f]]);
935
+ var _f = E, Tf = function() {
936
+ return _f.Date.now();
937
+ }, Of = Tf, Sf = /\s/;
938
+ function wf(e) {
939
+ for (var t = e.length; t-- && Sf.test(e.charAt(t)); )
940
+ ;
941
+ return t;
942
+ }
943
+ var Af = wf, Cf = Af, xf = /^\s+/;
944
+ function Ef(e) {
945
+ return e && e.slice(0, Cf(e) + 1).replace(xf, "");
946
+ }
947
+ var If = Ef, jf = J, Pf = R, Hf = "[object Symbol]";
948
+ function Mf(e) {
949
+ return typeof e == "symbol" || Pf(e) && jf(e) == Hf;
950
+ }
951
+ var Lf = Mf, kf = If, ht = D, Df = Lf, pt = 0 / 0, Kf = /^[-+]0x[0-9a-f]+$/i, Rf = /^0b[01]+$/i, Ff = /^0o[0-7]+$/i, Bf = parseInt;
952
+ function Nf(e) {
953
+ if (typeof e == "number")
954
+ return e;
955
+ if (Df(e))
956
+ return pt;
957
+ if (ht(e)) {
958
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
959
+ e = ht(t) ? t + "" : t;
960
+ }
961
+ if (typeof e != "string")
962
+ return e === 0 ? e : +e;
963
+ e = kf(e);
964
+ var r = Rf.test(e);
965
+ return r || Ff.test(e) ? Bf(e.slice(2), r ? 2 : 8) : Kf.test(e) ? pt : +e;
966
+ }
967
+ var Uf = Nf, Gf = D, be = Of, vt = Uf, Vf = "Expected a function", Wf = Math.max, zf = Math.min;
968
+ function qf(e, t, r) {
969
+ var n, i, a, s, o, l, c = 0, b = !1, d = !1, h = !0;
970
+ if (typeof e != "function")
971
+ throw new TypeError(Vf);
972
+ t = vt(t) || 0, Gf(r) && (b = !!r.leading, d = "maxWait" in r, a = d ? Wf(vt(r.maxWait) || 0, t) : a, h = "trailing" in r ? !!r.trailing : h);
973
+ function p(m) {
974
+ var C = n, j = i;
975
+ return n = i = void 0, c = m, s = e.apply(j, C), s;
976
+ }
977
+ function v(m) {
978
+ return c = m, o = setTimeout(S, t), b ? p(m) : s;
979
+ }
980
+ function T(m) {
981
+ var C = m - l, j = m - c, Fe = t - C;
982
+ return d ? zf(Fe, a - j) : Fe;
983
+ }
984
+ function _(m) {
985
+ var C = m - l, j = m - c;
986
+ return l === void 0 || C >= t || C < 0 || d && j >= a;
987
+ }
988
+ function S() {
989
+ var m = be();
990
+ if (_(m))
991
+ return g(m);
992
+ o = setTimeout(S, T(m));
993
+ }
994
+ function g(m) {
995
+ return o = void 0, h && n ? p(m) : (n = i = void 0, s);
996
+ }
997
+ function I() {
998
+ o !== void 0 && clearTimeout(o), c = 0, n = l = i = o = void 0;
999
+ }
1000
+ function x() {
1001
+ return o === void 0 ? s : g(be());
1002
+ }
1003
+ function A() {
1004
+ var m = be(), C = _(m);
1005
+ if (n = arguments, i = this, l = m, C) {
1006
+ if (o === void 0)
1007
+ return v(l);
1008
+ if (d)
1009
+ return clearTimeout(o), o = setTimeout(S, t), p(l);
1010
+ }
1011
+ return o === void 0 && (o = setTimeout(S, t)), s;
1012
+ }
1013
+ return A.cancel = I, A.flush = x, A;
1014
+ }
1015
+ var Yf = qf, Xf = "__lodash_hash_undefined__";
1016
+ function Jf(e) {
1017
+ return this.__data__.set(e, Xf), this;
1018
+ }
1019
+ var Zf = Jf;
1020
+ function Qf(e) {
1021
+ return this.__data__.has(e);
1022
+ }
1023
+ var ed = Qf, td = Nt, rd = Zf, nd = ed;
1024
+ function se(e) {
1025
+ var t = -1, r = e == null ? 0 : e.length;
1026
+ for (this.__data__ = new td(); ++t < r; )
1027
+ this.add(e[t]);
1028
+ }
1029
+ se.prototype.add = se.prototype.push = rd;
1030
+ se.prototype.has = nd;
1031
+ var id = se;
1032
+ function ad(e, t) {
1033
+ for (var r = -1, n = e == null ? 0 : e.length; ++r < n; )
1034
+ if (t(e[r], r, e))
1035
+ return !0;
1036
+ return !1;
1037
+ }
1038
+ var sd = ad;
1039
+ function od(e, t) {
1040
+ return e.has(t);
1041
+ }
1042
+ var ld = od, cd = id, ud = sd, fd = ld, dd = 1, hd = 2;
1043
+ function pd(e, t, r, n, i, a) {
1044
+ var s = r & dd, o = e.length, l = t.length;
1045
+ if (o != l && !(s && l > o))
1046
+ return !1;
1047
+ var c = a.get(e), b = a.get(t);
1048
+ if (c && b)
1049
+ return c == t && b == e;
1050
+ var d = -1, h = !0, p = r & hd ? new cd() : void 0;
1051
+ for (a.set(e, t), a.set(t, e); ++d < o; ) {
1052
+ var v = e[d], T = t[d];
1053
+ if (n)
1054
+ var _ = s ? n(T, v, d, t, e, a) : n(v, T, d, e, t, a);
1055
+ if (_ !== void 0) {
1056
+ if (_)
1057
+ continue;
1058
+ h = !1;
1059
+ break;
1060
+ }
1061
+ if (p) {
1062
+ if (!ud(t, function(S, g) {
1063
+ if (!fd(p, g) && (v === S || i(v, S, r, n, a)))
1064
+ return p.push(g);
1065
+ })) {
1066
+ h = !1;
1067
+ break;
1068
+ }
1069
+ } else if (!(v === T || i(v, T, r, n, a))) {
1070
+ h = !1;
1071
+ break;
1072
+ }
1073
+ }
1074
+ return a.delete(e), a.delete(t), h;
1075
+ }
1076
+ var ur = pd;
1077
+ function vd(e) {
1078
+ var t = -1, r = Array(e.size);
1079
+ return e.forEach(function(n, i) {
1080
+ r[++t] = [i, n];
1081
+ }), r;
1082
+ }
1083
+ var gd = vd;
1084
+ function yd(e) {
1085
+ var t = -1, r = Array(e.size);
1086
+ return e.forEach(function(n) {
1087
+ r[++t] = n;
1088
+ }), r;
1089
+ }
1090
+ var md = yd, gt = ue, yt = ar, $d = Ie, bd = ur, _d = gd, Td = md, Od = 1, Sd = 2, wd = "[object Boolean]", Ad = "[object Date]", Cd = "[object Error]", xd = "[object Map]", Ed = "[object Number]", Id = "[object RegExp]", jd = "[object Set]", Pd = "[object String]", Hd = "[object Symbol]", Md = "[object ArrayBuffer]", Ld = "[object DataView]", mt = gt ? gt.prototype : void 0, _e = mt ? mt.valueOf : void 0;
1091
+ function kd(e, t, r, n, i, a, s) {
1092
+ switch (r) {
1093
+ case Ld:
1094
+ if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
1095
+ return !1;
1096
+ e = e.buffer, t = t.buffer;
1097
+ case Md:
1098
+ return !(e.byteLength != t.byteLength || !a(new yt(e), new yt(t)));
1099
+ case wd:
1100
+ case Ad:
1101
+ case Ed:
1102
+ return $d(+e, +t);
1103
+ case Cd:
1104
+ return e.name == t.name && e.message == t.message;
1105
+ case Id:
1106
+ case Pd:
1107
+ return e == t + "";
1108
+ case xd:
1109
+ var o = _d;
1110
+ case jd:
1111
+ var l = n & Od;
1112
+ if (o || (o = Td), e.size != t.size && !l)
1113
+ return !1;
1114
+ var c = s.get(e);
1115
+ if (c)
1116
+ return c == t;
1117
+ n |= Sd, s.set(e, t);
1118
+ var b = bd(o(e), o(t), n, i, a, s);
1119
+ return s.delete(e), b;
1120
+ case Hd:
1121
+ if (_e)
1122
+ return _e.call(e) == _e.call(t);
1123
+ }
1124
+ return !1;
1125
+ }
1126
+ var Dd = kd, $t = nr, Kd = 1, Rd = Object.prototype, Fd = Rd.hasOwnProperty;
1127
+ function Bd(e, t, r, n, i, a) {
1128
+ var s = r & Kd, o = $t(e), l = o.length, c = $t(t), b = c.length;
1129
+ if (l != b && !s)
1130
+ return !1;
1131
+ for (var d = l; d--; ) {
1132
+ var h = o[d];
1133
+ if (!(s ? h in t : Fd.call(t, h)))
1134
+ return !1;
1135
+ }
1136
+ var p = a.get(e), v = a.get(t);
1137
+ if (p && v)
1138
+ return p == t && v == e;
1139
+ var T = !0;
1140
+ a.set(e, t), a.set(t, e);
1141
+ for (var _ = s; ++d < l; ) {
1142
+ h = o[d];
1143
+ var S = e[h], g = t[h];
1144
+ if (n)
1145
+ var I = s ? n(g, S, h, t, e, a) : n(S, g, h, e, t, a);
1146
+ if (!(I === void 0 ? S === g || i(S, g, r, n, a) : I)) {
1147
+ T = !1;
1148
+ break;
1149
+ }
1150
+ _ || (_ = h == "constructor");
1151
+ }
1152
+ if (T && !_) {
1153
+ var x = e.constructor, A = t.constructor;
1154
+ x != A && "constructor" in e && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof A == "function" && A instanceof A) && (T = !1);
1155
+ }
1156
+ return a.delete(e), a.delete(t), T;
1157
+ }
1158
+ var Nd = Bd, Te = Ut, Ud = ur, Gd = Dd, Vd = Nd, bt = ve, _t = pe, Tt = B, Wd = qt, zd = 1, Ot = "[object Arguments]", St = "[object Array]", Q = "[object Object]", qd = Object.prototype, wt = qd.hasOwnProperty;
1159
+ function Yd(e, t, r, n, i, a) {
1160
+ var s = _t(e), o = _t(t), l = s ? St : bt(e), c = o ? St : bt(t);
1161
+ l = l == Ot ? Q : l, c = c == Ot ? Q : c;
1162
+ var b = l == Q, d = c == Q, h = l == c;
1163
+ if (h && Tt(e)) {
1164
+ if (!Tt(t))
1165
+ return !1;
1166
+ s = !0, b = !1;
1167
+ }
1168
+ if (h && !b)
1169
+ return a || (a = new Te()), s || Wd(e) ? Ud(e, t, r, n, i, a) : Gd(e, t, l, r, n, i, a);
1170
+ if (!(r & zd)) {
1171
+ var p = b && wt.call(e, "__wrapped__"), v = d && wt.call(t, "__wrapped__");
1172
+ if (p || v) {
1173
+ var T = p ? e.value() : e, _ = v ? t.value() : t;
1174
+ return a || (a = new Te()), i(T, _, r, n, a);
1175
+ }
1176
+ }
1177
+ return h ? (a || (a = new Te()), Vd(e, t, r, n, i, a)) : !1;
1178
+ }
1179
+ var Xd = Yd, Jd = Xd, At = R;
1180
+ function fr(e, t, r, n, i) {
1181
+ return e === t ? !0 : e == null || t == null || !At(e) && !At(t) ? e !== e && t !== t : Jd(e, t, r, n, fr, i);
1182
+ }
1183
+ var Zd = fr, Qd = Zd;
1184
+ function eh(e, t) {
1185
+ return Qd(e, t);
1186
+ }
1187
+ var th = eh;
1188
+ const Oe = Symbol(null), Ct = Symbol("create"), rh = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", nh = {
1189
+ emits: ["optionsLoaded", "createItem", "update:modelValue"],
1190
+ props: [
1191
+ "modelValue",
1192
+ "options",
1193
+ "prependOptions",
1194
+ "appendOptions",
1195
+ "preload",
1196
+ "url",
1197
+ "urlParams",
1198
+ "remoteSearch",
1199
+ "searchFields",
1200
+ "placeholder",
1201
+ "valueKey",
1202
+ "idKey",
1203
+ "titleKey",
1204
+ "titleFormatter",
1205
+ "subtitleKey",
1206
+ "subtitleFormatter",
1207
+ "nullTitle",
1208
+ "noResultsText",
1209
+ "disabled",
1210
+ "optionsListId",
1211
+ "debug"
1212
+ ],
1213
+ data() {
1214
+ return {
1215
+ isLoaded: !1,
1216
+ loadedOptions: [],
1217
+ isSearching: !1,
1218
+ searchText: "",
1219
+ selectedOption: null,
1220
+ selectedOptionTitle: null,
1221
+ shouldDisplayOptions: !1,
1222
+ highlightedOptionKey: null,
1223
+ shouldShowCreateOption: !1
1224
+ };
1225
+ },
1226
+ computed: {
1227
+ /**
1228
+ * EFFECTIVE PROPS
1229
+ */
1230
+ effectiveDisabled() {
1231
+ return this.disabled || !this.loadedOptions;
1232
+ },
1233
+ effectivePlaceholder() {
1234
+ return !this.isLoaded && this.$isPropTruthy(this.preload) ? "Loading..." : this.nullTitle ? this.nullTitle : this.placeholder || "";
1235
+ },
1236
+ effectiveIdKey() {
1237
+ return this.idKey || "id";
1238
+ },
1239
+ effectiveTitleKey() {
1240
+ return this.titleKey || "name";
1241
+ },
1242
+ effectiveValueKey() {
1243
+ if (this.valueKey)
1244
+ return this.valueKey;
1245
+ if (this.options && !Array.isArray(this.options))
1246
+ return this.effectiveIdKey;
1247
+ },
1248
+ effectiveNoResultsText() {
1249
+ return this.noResultsText || "No options match your search.";
1250
+ },
1251
+ effectiveRemoteSearch() {
1252
+ return this.$isPropTruthy(this.remoteSearch);
1253
+ },
1254
+ /**
1255
+ * OPTIONS GENERATION
1256
+ */
1257
+ loadedOptionsArray() {
1258
+ return this.arrayifyOptions(this.loadedOptions);
1259
+ },
1260
+ prependOptionsArray() {
1261
+ return this.prependOptions ? this.arrayifyOptions(this.prependOptions) : [];
1262
+ },
1263
+ appendOptionsArray() {
1264
+ return this.appendOptions ? this.arrayifyOptions(this.appendOptions) : [];
1265
+ },
1266
+ fullOptionsArray() {
1267
+ return [...this.prependOptionsArray, ...this.loadedOptionsArray, ...this.appendOptionsArray];
1268
+ },
1269
+ optionsDescriptors() {
1270
+ return this.fullOptionsArray.map((e, t) => {
1271
+ const r = this.getOptionTitle(e), n = this.getOptionSubtitle(e), i = r ? r.text.trim().toLowerCase() : "", a = n ? n.text.trim().toLowerCase() : "";
1272
+ let s = [];
1273
+ return this.searchFields ? this.searchFields.forEach((o) => {
1274
+ e[o] && s.push(String(e[o]).toLowerCase());
1275
+ }) : (s.push(i), a && s.push(a)), {
1276
+ key: typeof e == "object" ? e[this.effectiveIdKey] || t : e,
1277
+ titleHtml: r.html,
1278
+ subtitleHtml: n == null ? void 0 : n.html,
1279
+ searchContent: s.join(""),
1280
+ ref: e
1281
+ };
1282
+ });
1283
+ },
1284
+ effectiveOptions() {
1285
+ let e = [...this.optionsDescriptors];
1286
+ if (this.isSearching) {
1287
+ const t = this.searchText.trim().toLowerCase();
1288
+ if (t.length) {
1289
+ e = e.filter((i) => i.searchContent.includes(t));
1290
+ const r = this.searchText.escapeHtml().replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), n = new RegExp(`(${r})`, "ig");
1291
+ e = e.map((i) => (i = { ...i }, i.titleHtml = i.titleHtml.replace(n, "<mark>$1</mark>"), i.subtitleHtml && (i.subtitleHtml = i.subtitleHtml.replace(n, "<mark>$1</mark>")), i)), this.shouldShowCreateOption && (e.find((a) => a.searchContent === t) !== void 0 || e.push({
1292
+ key: Ct,
1293
+ titleHtml: "Create <strong>" + this.searchText.trim() + "</strong>..."
1294
+ }));
1295
+ }
1296
+ } else
1297
+ this.nullTitle && e.unshift({
1298
+ key: Oe,
1299
+ titleHtml: this.nullTitle
1300
+ });
1301
+ return e;
1302
+ }
1303
+ },
1304
+ watch: {
1305
+ // props
1306
+ modelValue() {
1307
+ this.handleValueChanged();
1308
+ },
1309
+ options() {
1310
+ this.loadedOptions = this.options;
1311
+ },
1312
+ url() {
1313
+ console.log("url changed"), this.handleSourceUpdate();
1314
+ },
1315
+ // we should probably solve this more consistently across the board,
1316
+ // but for now: urlParams may be a hardcoded object in the parent, so
1317
+ // on re-render, a new object literal may be created, which is *technically*
1318
+ // a change that will fire this
1319
+ urlParams(e, t) {
1320
+ th(t, e) || this.handleSourceUpdate();
1321
+ },
1322
+ // data
1323
+ optionsDescriptors() {
1324
+ this.shouldDisplayOptions && setTimeout(this.highlightInitialOption, 0);
1325
+ },
1326
+ searchText() {
1327
+ this.isSearching && !this.effectiveRemoteSearch && !this.searchText.trim().length && (this.isSearching = !1);
1328
+ },
1329
+ shouldDisplayOptions() {
1330
+ this.shouldDisplayOptions ? setTimeout(this.handleOptionsDisplayed, 0) : (this.isSearching = !1, this.searchText = this.selectedOptionTitle || "");
1331
+ },
1332
+ effectiveOptions() {
1333
+ (!this.highlightedOptionKey || !this.effectiveOptions.find((e) => e.key == this.highlightedOptionKey)) && (this.highlightedOptionKey = this.effectiveOptions.length ? this.effectiveOptions[0].key : null);
1334
+ }
1335
+ },
1336
+ async mounted() {
1337
+ this.shouldShowCreateOption = this.$attrs.onCreateItem !== void 0, this.options ? (this.loadedOptions = this.options, this.isLoaded = !0) : this.$isPropTruthy(this.preload) && await this.loadRemoteOptions(), this.handleValueChanged(), this.$watch("selectedOption", () => {
1338
+ const e = this.selectedOption && this.effectiveValueKey ? this.selectedOption[this.effectiveValueKey] : this.selectedOption;
1339
+ e !== this.modelValue && this.$emit("update:modelValue", e);
1340
+ }), this.effectiveRemoteSearch && this.$watch("searchText", Yf(this.reloadOptionsIfSearching, 250));
1341
+ },
1342
+ methods: {
1343
+ async loadRemoteOptions() {
1344
+ await this.reloadOptions(), this.$emit("optionsLoaded", this.loadedOptions);
1345
+ },
1346
+ handleSourceUpdate() {
1347
+ if (console.log("source updated"), this.preload)
1348
+ return this.reloadOptions();
1349
+ this.isLoaded && (this.isLoaded = !1, this.loadedOptions = []);
1350
+ },
1351
+ async reloadOptions() {
1352
+ let e = {};
1353
+ this.urlParams && Object.assign(e, this.urlParams), this.effectiveRemoteSearch && this.isSearching && this.searchText && (e.q = this.searchText);
1354
+ const t = await this.$http.get(this.url, { params: e });
1355
+ this.loadedOptions = t.data, this.isLoaded = !0;
1356
+ },
1357
+ reloadOptionsIfSearching() {
1358
+ this.isSearching && (this.reloadOptions(), this.isSearching = this.searchText.trim().length > 0);
1359
+ },
1360
+ handleKeyDown(e) {
1361
+ if (e.key == "Escape") {
1362
+ e.stopPropagation(), e.target.blur();
1363
+ return;
1364
+ }
1365
+ if (!(e.key == "ArrowLeft" || e.key == "ArrowRight") && e.key != "Tab") {
1366
+ if (!this.isLoaded) {
1367
+ this.isSearching || e.preventDefault();
1368
+ return;
1369
+ }
1370
+ if (e.key == "ArrowUp" || e.key == "ArrowDown")
1371
+ return e.preventDefault(), this.incrementHighlightedOption(e.key == "ArrowUp" ? -1 : 1);
1372
+ if (e.key == "PageUp" || e.key == "PageDown")
1373
+ return e.preventDefault(), this.incrementHighlightedOption(e.key == "PageUp" ? -10 : 10);
1374
+ if (e.key == "Home" || e.key == "End")
1375
+ return e.preventDefault(), this.incrementHighlightedOption(
1376
+ e.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER
1377
+ );
1378
+ if (e.key == "Enter") {
1379
+ e.preventDefault();
1380
+ const t = this.effectiveOptions.find((r) => r.key == this.highlightedOptionKey);
1381
+ if (t)
1382
+ return this.selectOption(t);
1383
+ }
1384
+ if (e.key === "Delete" || e.key === "Backspace") {
1385
+ this.searchText.length > 1 && (this.isSearching = !0);
1386
+ return;
1387
+ }
1388
+ !e.metaKey && rh.includes(e.key) && (this.isSearching = !0);
1389
+ }
1390
+ },
1391
+ handleInputFocused() {
1392
+ this.selectedOption ? this.highlightedOptionKey = typeof this.selectedOption == "object" && this.selectedOption !== null ? this.selectedOption[this.effectiveIdKey] : this.selectedOption : this.nullTitle && (this.highlightedOptionKey = Oe), this.shouldDisplayOptions = !0;
1393
+ },
1394
+ handleInputBlurred() {
1395
+ this.$isPropTruthy(this.debug) || (!this.searchText.length && this.nullTitle && (this.selectedOption = null, this.selectedOptionTitle = null), this.shouldDisplayOptions = !1);
1396
+ },
1397
+ handleOptionsDisplayed() {
1398
+ this.isLoaded || this.loadRemoteOptions(), this.teleportOptionsContainer(), this.optionsListId && this.$refs.optionsContainer.setAttribute("id", this.optionsListId);
1399
+ },
1400
+ teleportOptionsContainer() {
1401
+ const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, r = e.x, n = this.$refs.optionsContainer, i = window.getComputedStyle(this.$el);
1402
+ for (let a in i)
1403
+ /^(font|text)/.test(a) && (n.style[a] = i[a]);
1404
+ if (n.style.top = t + "px", n.style.left = r + "px", n.style.minWidth = e.width + "px", !i.maxHeight || i.maxHeight == "none") {
1405
+ const a = window.innerHeight - t - 12;
1406
+ n.style.maxHeight = a + "px";
1407
+ }
1408
+ document.body.appendChild(n), setTimeout(this.highlightInitialOption, 0);
1409
+ },
1410
+ highlightInitialOption() {
1411
+ if (!this.isLoaded || !this.highlightedOptionKey)
1412
+ return;
1413
+ const e = this.effectiveOptions.findIndex(
1414
+ (n) => n.key == this.highlightedOptionKey
1415
+ ), t = this.$refs.optionsContainer, r = t.querySelectorAll(".option")[e];
1416
+ t.scrollTop = r.offsetTop;
1417
+ },
1418
+ handleOptionHover(e) {
1419
+ this.highlightedOptionKey = e ? e.key : null;
1420
+ },
1421
+ incrementHighlightedOption(e) {
1422
+ const t = this.effectiveOptions.findIndex(
1423
+ (a) => a.key == this.highlightedOptionKey
1424
+ );
1425
+ let r = t + e;
1426
+ if (r < 0 ? r = 0 : r >= this.effectiveOptions.length && (r = this.effectiveOptions.length - 1), t == r)
1427
+ return;
1428
+ this.highlightedOptionKey = this.effectiveOptions[r].key;
1429
+ const n = this.$refs.optionsContainer, i = n.querySelectorAll(".option")[r];
1430
+ i.offsetTop < n.scrollTop ? n.scrollTop = i.offsetTop : i.offsetTop + i.offsetHeight > n.scrollTop + n.clientHeight && (n.scrollTop = i.offsetTop + i.offsetHeight - n.clientHeight);
1431
+ },
1432
+ selectOption(e) {
1433
+ if (this.isSearching = !1, e.key == Oe)
1434
+ this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
1435
+ else if (e.key === Ct) {
1436
+ const t = this.searchText.trim();
1437
+ this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, this.$emit("createItem", t);
1438
+ } else {
1439
+ const r = this.optionsDescriptors.find(
1440
+ (n) => n.key == e.key
1441
+ ).ref;
1442
+ this.selectedOption = r, this.selectedOptionTitle = this.getOptionTitle(this.selectedOption).text, this.searchText = this.selectedOptionTitle || "";
1443
+ }
1444
+ this.$refs.searchField.blur();
1445
+ },
1446
+ handleValueChanged() {
1447
+ this.modelValue ? (this.effectiveValueKey ? this.selectedOption = this.fullOptionsArray.find(
1448
+ (e) => e[this.effectiveValueKey] === this.modelValue
1449
+ ) : this.selectedOption = this.modelValue, this.selectedOptionTitle = this.getOptionTitle(this.selectedOption).text, this.searchText = this.selectedOptionTitle || "") : (this.selectedOption = null, this.selectedOptionTitle = null, this.searchText = "");
1450
+ },
1451
+ getOptionTitle(e) {
1452
+ if (e === null)
1453
+ return null;
1454
+ if (this.titleFormatter) {
1455
+ const r = this.titleFormatter(e);
1456
+ return typeof r == "object" ? {
1457
+ text: r.text || r.html.replace(/<[^>]+>/g, ""),
1458
+ html: r.html
1459
+ } : {
1460
+ text: r,
1461
+ html: r.escapeHtml()
1462
+ };
1463
+ }
1464
+ const t = String(typeof e != "object" ? e : e[this.effectiveTitleKey]);
1465
+ return { text: t, html: t.escapeHtml() };
1466
+ },
1467
+ getOptionSubtitle(e) {
1468
+ if (e === null)
1469
+ return null;
1470
+ if (this.subtitleFormatter) {
1471
+ const r = this.subtitleFormatter(e);
1472
+ return r ? typeof r == "object" ? {
1473
+ text: r.text || r.html.replace(/<[^>]+>/g, ""),
1474
+ html: r.html
1475
+ } : {
1476
+ text: r,
1477
+ html: r.escapeHtml()
1478
+ } : null;
1479
+ }
1480
+ let t = typeof e != "object" ? null : e[this.subtitleKey];
1481
+ return t ? (t = String(t), { text: t, html: t.escapeHtml() }) : null;
1482
+ },
1483
+ addRemoteOption(e) {
1484
+ this.loadedOptions.push(e);
1485
+ },
1486
+ arrayifyOptions(e) {
1487
+ return Array.isArray(e) ? e : Object.entries(e).map((t) => ({
1488
+ [this.effectiveIdKey]: t[0],
1489
+ [this.effectiveTitleKey]: t[1]
1490
+ }));
1491
+ }
1492
+ }
1493
+ }, ih = ["placeholder"], ah = {
1494
+ key: 0,
1495
+ ref: "optionsContainer",
1496
+ class: "vf-smart-select-options"
1497
+ }, sh = {
1498
+ key: 0,
1499
+ class: "no-results"
1500
+ }, oh = ["onMousemove", "onMousedown"], lh = ["innerHTML"], ch = ["innerHTML"], uh = {
1501
+ key: 0,
1502
+ class: "no-results"
1503
+ };
1504
+ function fh(e, t, r, n, i, a) {
1505
+ const s = Se("disabled");
1506
+ return O(), w("div", {
1507
+ class: F(["vf-smart-select", { disabled: a.effectiveDisabled, open: i.shouldDisplayOptions }])
1508
+ }, [
1509
+ X(P("input", {
1510
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => i.searchText = o),
1511
+ ref: "searchField",
1512
+ type: "text",
1513
+ class: F({ nullable: !!r.nullTitle }),
1514
+ onKeydown: t[1] || (t[1] = (...o) => a.handleKeyDown && a.handleKeyDown(...o)),
1515
+ placeholder: a.effectivePlaceholder,
1516
+ onFocus: t[2] || (t[2] = (...o) => a.handleInputFocused && a.handleInputFocused(...o)),
1517
+ onBlur: t[3] || (t[3] = (...o) => a.handleInputBlurred && a.handleInputBlurred(...o))
1518
+ }, null, 42, ih), [
1519
+ [Sr, i.searchText],
1520
+ [s, a.effectiveDisabled]
1521
+ ]),
1522
+ i.shouldDisplayOptions ? (O(), w("div", ah, [
1523
+ i.isLoaded ? (O(), w(re, { key: 1 }, [
1524
+ (O(!0), w(re, null, Lt(a.effectiveOptions, (o) => (O(), w("div", {
1525
+ key: o.key,
1526
+ class: F(["option", {
1527
+ highlighted: i.highlightedOptionKey === o.key
1528
+ }]),
1529
+ onMousemove: (l) => a.handleOptionHover(o),
1530
+ onMousedown: (l) => a.selectOption(o)
1531
+ }, [
1532
+ P("div", {
1533
+ class: "title",
1534
+ innerHTML: o.titleHtml
1535
+ }, null, 8, lh),
1536
+ o.subtitleHtml ? (O(), w("div", {
1537
+ key: 0,
1538
+ class: "subtitle",
1539
+ innerHTML: o.subtitleHtml
1540
+ }, null, 8, ch)) : L("", !0)
1541
+ ], 42, oh))), 128)),
1542
+ !a.effectiveOptions.length && i.searchText ? (O(), w("div", uh, Y(a.effectiveNoResultsText), 1)) : L("", !0)
1543
+ ], 64)) : (O(), w("div", sh, "Loading..."))
1544
+ ], 512)) : L("", !0)
1545
+ ], 2);
1546
+ }
1547
+ const dh = /* @__PURE__ */ oe(nh, [["render", fh]]);
1548
+ f.component("AjaxSelect", Pr);
1549
+ f.component("Alert", bf);
1550
+ f.component("Modal", cr);
1551
+ f.component("SmartSelect", dh);
1552
+ f.directive("autofocus", {
1553
+ mounted: xt,
1554
+ updated: xt
1555
+ });
1556
+ function xt(e, t) {
1557
+ t.value === void 0 && e.hasAutoFocused || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue || (e.hasAutoFocused = !0, e = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : u(e).find("input:first")[0], setTimeout(() => e.focus(), 10));
1558
+ }
1559
+ f.directive("confirm-button", {
1560
+ mounted(e) {
1561
+ e.addEventListener("click", (t) => {
1562
+ let r = Date.now();
1563
+ if (e._isConfirming) {
1564
+ if (r - e._confirmInitTime < 300)
1565
+ return;
1566
+ e._resetHandler(), e.dispatchEvent(new Event("confirm"));
1567
+ return;
1568
+ }
1569
+ t.preventDefault(), t.stopImmediatePropagation(), e._resetHandler = () => {
1570
+ e.innerHTML = e._preConfirmHTML, e.blur(), e.removeEventListener("mouseout", e._resetHandler), delete e._isConfirming, delete e._preConfirmHTML, delete e._resetHandler;
1571
+ }, e._isConfirming = !0, e._confirmInitTime = r, e._preConfirmHTML = e.innerHTML, e.innerHTML = "Confirm", e.addEventListener("mouseout", e._resetHandler);
1572
+ });
1573
+ }
1574
+ });
1575
+ f.directive("datetime", {
1576
+ beforeMount: Et,
1577
+ updated: Et
1578
+ });
1579
+ function Et(e, t) {
1580
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = hh(e, t));
1581
+ }
1582
+ function hh(e, t) {
1583
+ if (!t.value)
1584
+ return e.attributes.placeholder ? e.attributes.placeholder.value : "";
1585
+ let r = "", n = e.attributes.local ? k(t.value) : k.utc(t.value);
1586
+ e.attributes["display-utc"] || n.local();
1587
+ let i = e.attributes.format ? e.attributes.format.value : null;
1588
+ if (!i && e.attributes["relative-date"]) {
1589
+ let s = k();
1590
+ s.year() == n.year() && s.month() == n.month() && s.date() == n.date() && (r = "at", i = "HH:mm");
1591
+ }
1592
+ i || (i = "MM/DD/YY HH:mm");
1593
+ let a = n.format(i);
1594
+ return r && (a = r + " " + a), a;
1595
+ }
1596
+ f.directive("date-input", {
1597
+ beforeMount: ph
1598
+ });
1599
+ function ph(e) {
1600
+ e.addEventListener("blur", () => {
1601
+ let t = e.value;
1602
+ /^[0-9]{1,2}\/[0-9]{1,2}$/.test(t) && (t += "/" + k().format("YY"));
1603
+ let r = Date.parse(t);
1604
+ isNaN(r) ? e.value = "" : e.value = k(r).format("MM/DD/YYYY"), e.dispatchEvent(new Event("input"));
1605
+ });
1606
+ }
1607
+ f.directive("disabled", {
1608
+ beforeMount: It,
1609
+ updated: It,
1610
+ unmounted: vh
1611
+ });
1612
+ function It(e, t) {
1613
+ e.tagName == "LABEL" && (u(e).toggleClass("disabled", !!t.value), e = u(e).find("input")[0]), t.value ? u(e).attr("disabled", "disabled") : u(e).removeAttr("disabled");
1614
+ }
1615
+ function vh(e) {
1616
+ e.tagName == "LABEL" && (u(e).removeClass("disabled"), e = u(e).find("input")[0]), u(e).removeAttr("disabled");
1617
+ }
1618
+ let Re = [];
1619
+ function gh() {
1620
+ Re.forEach(dr);
1621
+ }
1622
+ setInterval(gh, 1e3);
1623
+ f.directive("duration", {
1624
+ beforeMount: jt,
1625
+ updated: jt,
1626
+ unmounted: hr
1627
+ });
1628
+ function jt(e, t) {
1629
+ if (t.value == t.oldValue)
1630
+ return;
1631
+ if (!t.value)
1632
+ return hr(e);
1633
+ e.$includeSeconds = typeof e.attributes["no-seconds"] > "u";
1634
+ let r = e.attributes["base-time"];
1635
+ r ? e.$startTs = k(r.value).valueOf() - t.value * 1e3 : e.$startTs = k(t.value).valueOf(), e.$isConfigured || (e.$isConfigured = !0, Re.push(e)), dr(e);
1636
+ }
1637
+ function dr(e) {
1638
+ let t = e.$startTs, r = Math.round((Date.now() - t) / 1e3);
1639
+ e.innerText = yh(r, e.$includeSeconds === !1);
1640
+ }
1641
+ function hr(e) {
1642
+ e.$isConfigured && (Re.remove(e), e.$isConfigured = !1), e.innerText = "-";
1643
+ }
1644
+ function yh(e, t) {
1645
+ let r = [], n = Math.floor(e / 86400);
1646
+ n && r.push(n + "d"), e -= n * 86400;
1647
+ let i = Math.floor(e / 3600);
1648
+ (n || i) && r.push(i + "h"), e -= i * 3600;
1649
+ let a = Math.floor(e / 60);
1650
+ return (n || i || a) && r.push(a + "m"), t ? r.length || r.push("0m") : (e -= a * 60, r.push(e + "s")), r.join(" ");
1651
+ }
1652
+ class te {
1653
+ constructor(t, r) {
1654
+ this.el = t, this.handler = r, this.isTripped = !1, this.onScroll = this._onScroll.bind(this);
1655
+ }
1656
+ install() {
1657
+ this.el.addEventListener("scroll", this.onScroll);
1658
+ }
1659
+ uninstall() {
1660
+ this.el.removeEventListener("scroll", this.onScroll);
1661
+ }
1662
+ _onScroll(t) {
1663
+ 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);
1664
+ }
1665
+ }
1666
+ f.directive("infinite-scroll", {
1667
+ beforeMount(e, t) {
1668
+ t.value && (e._infiniteScrollHook = new te(e, t.value), e._infiniteScrollHook.install());
1669
+ },
1670
+ unmounted(e) {
1671
+ e._infiniteScrollHook && e._infiniteScrollHook.uninstall();
1672
+ }
1673
+ });
1674
+ f.directive("readonly", {
1675
+ beforeMount: Pt,
1676
+ updated: Pt
1677
+ });
1678
+ function Pt(e, t) {
1679
+ e.tagName == "LABEL" && (e = u(e).find("input")[0]), t.value ? u(e).attr("readonly", "readonly") : u(e).removeAttr("readonly");
1680
+ }
1681
+ f.directive("tip", {
1682
+ mounted: Ht,
1683
+ updated: Ht,
1684
+ unmounted: mh
1685
+ });
1686
+ function Ht(e, t) {
1687
+ let r = e.attributes.tip ? e.attributes.tip.value : t.value;
1688
+ if (t.value === !1 && (r = null), r) {
1689
+ let n = {};
1690
+ n[t.modifiers.html ? "html" : "text"] = r, e.attributes["tip-class"] && (n.class = e.attributes["tip-class"].value), u(e).vfTooltip(n);
1691
+ } else
1692
+ u(e).vfTooltip("destroy");
1693
+ }
1694
+ function mh(e) {
1695
+ u(e).vfTooltip("destroy");
1696
+ }
1697
+ u.fn.vfTooltip = function(e) {
1698
+ return this.each(function(t, r) {
1699
+ var n = u(r).data("vf-tooltip");
1700
+ if (typeof e == "string") {
1701
+ if (!n)
1702
+ return;
1703
+ n[e]();
1704
+ } else if (n)
1705
+ n.configure(e);
1706
+ else {
1707
+ var i = new $h(r, e);
1708
+ u(r).data("vf-tooltip", i);
1709
+ }
1710
+ });
1711
+ };
1712
+ function $h(e, t) {
1713
+ this.configure = l, this.destroy = S;
1714
+ var r, n, i, a, s = !1;
1715
+ this.configure(t);
1716
+ var o = u(e);
1717
+ o.on("mouseenter", c), o.on("mouseleave", b), n.now && c(n.now);
1718
+ function l(g) {
1719
+ n = u.extend(
1720
+ {
1721
+ delay: 0
1722
+ },
1723
+ g
1724
+ );
1725
+ }
1726
+ function c(g) {
1727
+ s || (s = !0, setTimeout(function() {
1728
+ s && (d(), n.static ? v() : T(g), r.show());
1729
+ }, n.delay));
1730
+ }
1731
+ function b() {
1732
+ s = !1, h();
1733
+ }
1734
+ function d() {
1735
+ r ? r.remove() : n.static || u(window).on("mousemove", T), r = u('<div class="vf-tooltip">').css("position", "absolute").css("z-index", "1000000").addClass(n.class).appendTo(document.body), n.title && u('<div class="title">').text(n.title).appendTo(r);
1736
+ var g = u('<div class="content">').appendTo(r);
1737
+ n.callback ? n.callback(g[0]) : n.text ? g.text(n.text).html(g.html().replace(/\n/g, "<br>")) : n.html && g.html(n.html), n.static ? r.mouseover(function() {
1738
+ s = !0;
1739
+ }).mouseout(function() {
1740
+ s = !1, h();
1741
+ }) : a = setInterval(_, 250);
1742
+ }
1743
+ function h() {
1744
+ n.static ? setTimeout(p, 50) : p();
1745
+ }
1746
+ function p() {
1747
+ s || r && (r.remove(), r = null, clearInterval(a), n.static || u(window).off("mousemove", T));
1748
+ }
1749
+ function v() {
1750
+ var g = o.position(), I = r.height(), x = o.outerWidth(!0), A = g.left, m = g.top - I - 1;
1751
+ m - 2 < 0 && (m = g.top + o.outerHeight(!0) + 1), r.css("min-width", x + "px").css("left", A + "px").css("top", m + "px");
1752
+ }
1753
+ function T(g) {
1754
+ var I = r.outerWidth(), x = r.outerHeight(), A = window.innerWidth, m = window.innerHeight, C = g.pageX + 10, j = g.pageY + 20;
1755
+ C + I > A && (C = g.pageX - 5 - I), j + x > m && (j = g.pageY - 5 - x), r.css("left", C + "px").css("top", j + "px"), i = g;
1756
+ }
1757
+ function _() {
1758
+ i && e != i.target && !u.contains(e, i.target) && b();
1759
+ }
1760
+ function S() {
1761
+ s = !1, p(), o.off("mouseenter", c), o.off("mouseleave", b), o.removeData("vf-tooltip");
1762
+ }
1763
+ }
1764
+ f.directive("user-text", {
1765
+ beforeMount: Mt,
1766
+ updated: Mt
1767
+ });
1768
+ function Mt(e, t) {
1769
+ t.value != t.oldValue && (e.innerHTML = t.value.escapeHtml().nl2br());
1770
+ }
1771
+ Object.defineProperty(Array.prototype, "diff", {
1772
+ enumerable: !1,
1773
+ value: function(...e) {
1774
+ return this.filter((t) => {
1775
+ for (let r = 0; r < e.length; r++)
1776
+ if (e[r].includes(t))
1777
+ return !1;
1778
+ return !0;
1779
+ });
1780
+ }
1781
+ });
1782
+ Object.defineProperty(Array.prototype, "first", {
1783
+ enumerable: !1,
1784
+ value: function() {
1785
+ return this[0] || void 0;
1786
+ }
1787
+ });
1788
+ Object.defineProperty(Array.prototype, "intersect", {
1789
+ enumerable: !1,
1790
+ value: function(...e) {
1791
+ return this.filter((t) => {
1792
+ for (let r = 0; r < e.length; r++)
1793
+ if (e[r].includes(t))
1794
+ return !0;
1795
+ return !1;
1796
+ });
1797
+ }
1798
+ });
1799
+ Object.defineProperty(Array.prototype, "keyBy", {
1800
+ enumerable: !1,
1801
+ value: function(e) {
1802
+ let t = {};
1803
+ return this.forEach((r) => {
1804
+ t[r[e]] = r;
1805
+ }), t;
1806
+ }
1807
+ });
1808
+ Object.defineProperty(Array.prototype, "last", {
1809
+ enumerable: !1,
1810
+ value: function() {
1811
+ return this.length ? this[this.length - 1] : void 0;
1812
+ }
1813
+ });
1814
+ Object.defineProperty(Array.prototype, "pluck", {
1815
+ enumerable: !1,
1816
+ value: function(e, t) {
1817
+ if (typeof t > "u")
1818
+ return this.map((n) => n[e]);
1819
+ let r = {};
1820
+ return this.forEach((n) => {
1821
+ r[n[t]] = n[e];
1822
+ }), r;
1823
+ }
1824
+ });
1825
+ Object.defineProperty(Array.prototype, "remove", {
1826
+ enumerable: !1,
1827
+ value: function(e) {
1828
+ const t = this.indexOf(e);
1829
+ t > -1 && this.splice(t, 1);
1830
+ }
1831
+ });
1832
+ Object.defineProperty(Array.prototype, "replace", {
1833
+ enumerable: !1,
1834
+ value: function(e, t) {
1835
+ const r = this.indexOf(e);
1836
+ r > -1 && this.splice(r, 1, t);
1837
+ }
1838
+ });
1839
+ Object.defineProperty(Array.prototype, "sortBy", {
1840
+ enumerable: !1,
1841
+ value: function(e) {
1842
+ this.sort((t, r) => String(t[e]).toLowerCase().localeCompare(String(r[e]).toLowerCase()));
1843
+ }
1844
+ });
1845
+ Object.defineProperty(Array.prototype, "unique", {
1846
+ enumerable: !1,
1847
+ value: function() {
1848
+ return [...new Set(this)];
1849
+ }
1850
+ });
1851
+ f.config.globalProperties.$contextMenu = function(e, t) {
1852
+ var r = u('<div class="vf-overlay">').click(d).appendTo(document.body), n = u('<div class="vf-context-menu">').css("position", "absolute").appendTo(r), i = u(e.currentTarget);
1853
+ i.css("user-select", "none"), i.addClass("context-menu-active"), t.targetClass && i.addClass(t.targetClass), t.class && n.addClass(t.class), t.items && t.items.forEach((p) => {
1854
+ if (p == "-")
1855
+ return u('<div class="separator">').appendTo(n);
1856
+ var v = u('<div class="item">').css("user-select", "none").text(p.title).appendTo(n);
1857
+ p.class && v.addClass(p.class), p.shouldConfirm ? v.data("handler", p.handler).click(h) : p.handler && v.click(p.handler);
1858
+ });
1859
+ const a = window.innerWidth - e.clientX, s = window.innerHeight - e.clientY, o = n.outerHeight(), l = n.outerWidth(), c = a < l ? e.clientX - l - 1 : e.clientX + 1, b = s < o ? e.clientY - o - 1 : e.clientY + 1;
1860
+ n.css("left", c + "px"), n.css("top", b + "px"), t.onCreate && t.onCreate(n[0]), setTimeout(() => {
1861
+ n.css("width", n.outerWidth() + "px");
1862
+ }, 50);
1863
+ function d() {
1864
+ t.targetClass && i.removeClass(t.targetClass), i.removeClass("context-menu-active"), i.css("user-select", ""), r.remove();
1865
+ }
1866
+ function h(p) {
1867
+ var v = u(p.currentTarget);
1868
+ if (v.hasClass("pending-confirm")) {
1869
+ var T = v.data("handler");
1870
+ T && T();
1871
+ } else {
1872
+ var _ = v.html();
1873
+ v.addClass("pending-confirm").text("Confirm"), v.one("mouseleave", function() {
1874
+ v.removeClass("pending-confirm").html(_);
1875
+ }), p.stopPropagation();
1876
+ }
1877
+ }
1878
+ };
1879
+ f.config.globalProperties.$delay = (e) => new Promise((t) => setTimeout(t, e));
1880
+ let H = {
1881
+ unhandledErrorSupportText: "please contact support"
1882
+ };
1883
+ function bh(e) {
1884
+ Object.assign(H, e);
1885
+ }
1886
+ Object.defineProperty(H, "set", { value: bh, enumerable: !1 });
1887
+ f.config.globalProperties.$reportError = (e) => {
1888
+ e instanceof Error || (e = new Error(e)), H.reportErrorHandler ? H.reportErrorHandler(e) : console.error(e);
1889
+ };
1890
+ f.config.globalProperties.$throwUserError = (e) => {
1891
+ let t = new Error(e);
1892
+ throw t.code = "USERERR", t;
1893
+ };
1894
+ Object.defineProperty(Error.prototype, "userMessage", {
1895
+ get() {
1896
+ return this.code == "USERERR" ? this.message : `An application error has occurred:
1897
+
1898
+ ${this.message}
1899
+
1900
+ Please refresh the page and try again. If this error persists, ${H.unhandledErrorSupportText}.`;
1901
+ }
1902
+ });
1903
+ Error.prototype.handle = function() {
1904
+ return this.code != "USERERR" && f.config.globalProperties.$reportError(this), this;
1905
+ };
1906
+ f.config.globalProperties.$http = ne;
1907
+ ne.postOrPut = (e, t, ...r) => {
1908
+ const n = t ? "put" : "post", i = t ? `${e}/${t}` : e;
1909
+ return ne[n](i, ...r);
1910
+ };
1911
+ ne.interceptors.response.use(
1912
+ (e) => {
1913
+ if (e.data && typeof e.data != "object")
1914
+ throw new Error("response was not JSON");
1915
+ return e;
1916
+ },
1917
+ (e) => {
1918
+ if (e.response && e.response.status == 401 && H.unauthorizedHttpResponseHandler && H.unauthorizedHttpResponseHandler(e.response))
1919
+ return new Promise(() => {
1920
+ });
1921
+ throw e.response && e.response.data && e.response.data.error && (e.code = e.response.status == 422 ? "USERERR" : "APIERR", e.message = e.response.data.error, e.field = e.response.data.errorField), e;
1922
+ }
1923
+ );
1924
+ f.config.globalProperties.$mask = function(e) {
1925
+ let t = u(this.$el);
1926
+ this.$maskEl(t.hasClass("vf-overlay") ? t.find(".vf-modal")[0] : this.$el, e);
1927
+ };
1928
+ f.config.globalProperties.$maskEl = function(e, t) {
1929
+ this._currentMask || (this._currentMask = u('<div class="mask">').text(t || "Please wait...").appendTo(e));
1930
+ };
1931
+ f.config.globalProperties.$unmask = function() {
1932
+ this._currentMask && (u(this._currentMask).remove(), delete this._currentMask);
1933
+ };
1934
+ f.config.globalProperties.$maskForm = function(e, t) {
1935
+ let r = this.$el;
1936
+ e !== void 0 && e.tagName == "FORM" && (r = e, e = void 0);
1937
+ let n = r.tagName == "FORM" ? u(r) : u(r).find("form"), i = n.find("input, select, textarea, button").not("[disabled]");
1938
+ if (n.addClass("masked"), n.data("vf-masked-inputs", i), i.attr("disabled", "disabled"), e === void 0 && (e = n.find("button:first")), e) {
1939
+ let a = n.find(e);
1940
+ a.disable(t || "Please wait..."), n.data("vf-masked-wait-btn", a);
1941
+ }
1942
+ };
1943
+ f.config.globalProperties.$unmaskForm = function() {
1944
+ let e = this.$el.tagName == "FORM" ? u(this.$el) : u(this.$el).find("form.masked");
1945
+ if (!e.length)
1946
+ return;
1947
+ e.data("vf-masked-inputs").removeAttr("disabled"), e.removeData("vf-masked-inputs");
1948
+ let r = e.data("vf-masked-wait-btn");
1949
+ r && (e.removeData("vf-masked-wait-btn"), r.enable()), e.removeClass("masked");
1950
+ };
1951
+ u.fn.disable = function(e) {
1952
+ return this.each(function(t, r) {
1953
+ var n = u(r), i = r.tagName == "INPUT";
1954
+ e && n.data("originalValue", i ? n.val() : n.html()) && n[i ? "val" : "text"](e), n.attr("disabled", "disabled");
1955
+ }), this;
1956
+ };
1957
+ u.fn.enable = function() {
1958
+ return this.each(function(e, t) {
1959
+ var r = u(t);
1960
+ r.removeAttr("disabled");
1961
+ var n = r.data("originalValue");
1962
+ n != null && r[t.tagName == "INPUT" ? "val" : "html"](n) && r.removeData("originalValue");
1963
+ }), this;
1964
+ };
1965
+ Number.prototype.format = function() {
1966
+ return this.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1967
+ };
1968
+ String.prototype.escapeHtml = function() {
1969
+ return this.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1970
+ };
1971
+ String.prototype.nl2br = function() {
1972
+ return this.replace(/\n/g, "<br>");
1973
+ };
1974
+ String.prototype.kebab = function() {
1975
+ return this.replace(/ /g, "-");
1976
+ };
1977
+ String.prototype.lcfirst = function() {
1978
+ return this.substr(0, 1).toLowerCase() + this.substr(1);
1979
+ };
1980
+ String.prototype.snake = function() {
1981
+ return this.replace(/ /g, "_");
1982
+ };
1983
+ String.prototype.ucfirst = function() {
1984
+ return this.substr(0, 1).toUpperCase() + this.substr(1);
1985
+ };
1986
+ String.prototype.ucwords = function() {
1987
+ return this.replace(/^[a-z]| [a-z]/gi, function(e) {
1988
+ return e.toUpperCase();
1989
+ });
1990
+ };
1991
+ String.prototype.unsnake = function() {
1992
+ return this.replace(/_/g, " ");
1993
+ };
1994
+ f.config.globalProperties.$isPropTruthy = function(e) {
1995
+ return e !== void 0 && (e === "" || e);
1996
+ };
1997
+ class _h {
1998
+ static install(t) {
1999
+ const r = ["auto", "scroll"], n = function(o) {
2000
+ if (o = o.parentElement, !o)
2001
+ return null;
2002
+ const l = window.getComputedStyle(o);
2003
+ return r.includes(l.overflow) || r.includes(l.overflowX) || r.includes(l.overflowY) ? o : n(o);
2004
+ }, i = function() {
2005
+ if (this.$options.windowScrolledToBottom && (this._windowScrollHook = new te(
2006
+ window,
2007
+ this.$options.windowScrolledToBottom.bind(this)
2008
+ ), this._windowScrollHook.install()), this.$options.elScrolledToBottom && (this._elScrollHook = new te(this.$el, this.$options.elScrolledToBottom.bind(this)), this._elScrollHook.install()), this.$options.ancestorScrolledToBottom) {
2009
+ const o = n(this.$el);
2010
+ o ? (this._ancestorScrollHook = new te(
2011
+ o,
2012
+ this.$options.ancestorScrolledToBottom.bind(this)
2013
+ ), this._ancestorScrollHook.install()) : console.warn("no scollable ancestor found for component:", this);
2014
+ }
2015
+ }, a = function() {
2016
+ this._windowScrollHandler && this._windowScrollHandler.install(), this._elScrollHandler && this._elScrollHandler.install(), this._ancestorScrollHook && this._ancestorScrollHook.install();
2017
+ }, s = function() {
2018
+ this._windowScrollHandler && this._windowScrollHandler.uninstall(), this._elScrollHandler && this._elScrollHandler.uninstall(), this._ancestorScrollHook && this._ancestorScrollHook.uninstall();
2019
+ };
2020
+ t.mixin({
2021
+ mounted() {
2022
+ i.call(this);
2023
+ },
2024
+ activated() {
2025
+ a.call(this);
2026
+ },
2027
+ deactivated() {
2028
+ s.call(this);
2029
+ },
2030
+ beforeUnmount() {
2031
+ s.call(this);
2032
+ }
2033
+ });
2034
+ }
2035
+ }
2036
+ class Th {
2037
+ static install(t) {
2038
+ t.mixin({
2039
+ mounted() {
2040
+ this.$options.windowResized && (this._resizeWatcherHandler = this.$options.windowResized.bind(this), window.addEventListener("resize", this._resizeWatcherHandler));
2041
+ },
2042
+ activated() {
2043
+ this._resizeWatcherHandler && window.addEventListener("resize", this._resizeWatcherHandler);
2044
+ },
2045
+ deactivated() {
2046
+ this._resizeWatcherHandler && window.removeEventListener("resize", this._resizeWatcherHandler);
2047
+ },
2048
+ beforeUnmount() {
2049
+ this._resizeWatcherHandler && window.removeEventListener("resize", this._resizeWatcherHandler);
2050
+ }
2051
+ });
2052
+ }
2053
+ }
2054
+ f.use(wr);
2055
+ f.use(_h);
2056
+ f.use(Th);
2057
+ const pr = {
2058
+ bytes(e) {
2059
+ var t = Math.floor(Math.log(e) / Math.log(1024));
2060
+ return (e / Math.pow(1024, t)).toFixed(2) * 1 + " " + ["B", "KB", "MB", "GB", "TB"][t];
2061
+ },
2062
+ dash(e) {
2063
+ return e != null && String(e).length ? e : "-";
2064
+ },
2065
+ dashZeros(e) {
2066
+ return e || "-";
2067
+ },
2068
+ grammarcase(e) {
2069
+ return e ? e.grammarcase() : null;
2070
+ },
2071
+ lowercase(e) {
2072
+ return e ? e.toLowerCase() : null;
2073
+ },
2074
+ number(e) {
2075
+ return e === null || !/^[0-9]+$/.test(e) ? e : e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2076
+ },
2077
+ phone(e) {
2078
+ if (!e)
2079
+ return e;
2080
+ let t = e.replace(/[^0-9]/g, "").replace(/^1/, "");
2081
+ return t.length != 10 ? e : "(" + t.substr(0, 3) + ") " + t.substr(3, 3) + "-" + t.substr(6);
2082
+ },
2083
+ ucfirst(e) {
2084
+ return e ? e.ucfirst() : null;
2085
+ },
2086
+ ucwords(e) {
2087
+ return e ? e.ucwords() : null;
2088
+ },
2089
+ uppercase(e) {
2090
+ return e ? e.toUpperCase() : null;
2091
+ },
2092
+ unsnake(e) {
2093
+ return e ? e.unsnake() : null;
2094
+ },
2095
+ usCurrency(e) {
2096
+ return "$" + Number(e).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2097
+ }
2098
+ };
2099
+ function Oh(e) {
2100
+ for (let t of Object.keys(e))
2101
+ vr(t, e[t]);
2102
+ }
2103
+ function vr(e, t) {
2104
+ pr[e] = t;
2105
+ }
2106
+ f.config.globalProperties.$filter = (e, ...t) => {
2107
+ for (let r of t)
2108
+ e = pr[r](e);
2109
+ return e;
2110
+ };
2111
+ const Ph = {
2112
+ getApp: Ah,
2113
+ configure: Sh,
2114
+ mount: wh,
2115
+ registerFilter: vr,
2116
+ registerFilters: Oh
2117
+ };
2118
+ function Sh(e) {
2119
+ H.set(e);
2120
+ }
2121
+ function wh(e, t) {
2122
+ Ar(e), f.vm = f.mount(t);
2123
+ }
2124
+ function Ah() {
2125
+ return f;
2126
+ }
2127
+ export {
2128
+ Ph as default
2129
+ };