@oneclick.dev/cms-core-modules 0.0.97 → 0.0.99

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,53 +1,53 @@
1
- import { defineComponent as Z, ref as $, resolveComponent as h, openBlock as R, createBlock as J, withCtx as g, createVNode as u, createTextVNode as A, createElementVNode as m, unref as I, normalizeClass as ie, toDisplayString as F, inject as Ye, useTemplateRef as ne, computed as de, createElementBlock as z, Fragment as pe, createCommentVNode as P } from "vue";
2
- import { User as Qe, Mail as Je, Phone as Xe, Clock as Ze, Users as qe, Tag as et, CreditCard as tt, Receipt as nt, Ban as st, ClockCheck as ot, MoreHorizontal as at, Download as it, MailCheck as rt, XCircle as lt, Gift as ut } from "lucide-vue-next";
3
- import { useModule as q, useMailer as De, useModulePermissions as ct, useFirebaseIntegration as dt } from "@oneclick.dev/cms-kit";
4
- import { t as X } from "./index-RLz1QPrf.mjs";
5
- function W(t) {
1
+ import { defineComponent as te, ref as $, resolveComponent as _, openBlock as R, createBlock as J, withCtx as g, createVNode as c, createTextVNode as A, createElementVNode as m, unref as S, normalizeClass as le, toDisplayString as F, inject as Je, useTemplateRef as oe, computed as pe, createElementBlock as U, Fragment as fe, createCommentVNode as L } from "vue";
2
+ import { User as Xe, Mail as Ze, Phone as qe, Clock as et, Users as tt, Tag as st, CreditCard as nt, Receipt as ot, Ban as at, ClockCheck as it, MoreHorizontal as rt, Download as lt, MailCheck as ut, XCircle as ct, Gift as dt } from "lucide-vue-next";
3
+ import { useModule as se, useMailer as be, useModulePermissions as pt, useFirebaseIntegration as ft } from "@oneclick.dev/cms-kit";
4
+ import { t as Z } from "./index-RLz1QPrf.mjs";
5
+ function K(t) {
6
6
  return Array.isArray ? Array.isArray(t) : Re(t) === "[object Array]";
7
7
  }
8
- function pt(t) {
8
+ function mt(t) {
9
9
  if (typeof t == "string")
10
10
  return t;
11
11
  let e = t + "";
12
12
  return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
13
13
  }
14
- function ft(t) {
15
- return t == null ? "" : pt(t);
14
+ function we(t) {
15
+ return t == null ? "" : mt(t);
16
16
  }
17
- function H(t) {
17
+ function z(t) {
18
18
  return typeof t == "string";
19
19
  }
20
- function Fe(t) {
20
+ function me(t) {
21
21
  return typeof t == "number";
22
22
  }
23
- function mt(t) {
24
- return t === !0 || t === !1 || gt(t) && Re(t) == "[object Boolean]";
23
+ function gt(t) {
24
+ return t === !0 || t === !1 || vt(t) && Re(t) == "[object Boolean]";
25
25
  }
26
- function Ie(t) {
26
+ function Se(t) {
27
27
  return typeof t == "object";
28
28
  }
29
- function gt(t) {
30
- return Ie(t) && t !== null;
29
+ function vt(t) {
30
+ return Se(t) && t !== null;
31
31
  }
32
- function V(t) {
32
+ function P(t) {
33
33
  return t != null;
34
34
  }
35
- function fe(t) {
35
+ function ae(t) {
36
36
  return !t.trim().length;
37
37
  }
38
38
  function Re(t) {
39
39
  return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
40
40
  }
41
- const vt = "Incorrect 'index' type", ht = (t) => `Invalid value for key ${t}`, _t = (t) => `Pattern length exceeds max of ${t}.`, xt = (t) => `Missing ${t} property in key`, Dt = (t) => `Property 'weight' in key '${t}' must be a positive integer`, we = Object.prototype.hasOwnProperty;
41
+ const ht = "Incorrect 'index' type", _t = (t) => `Invalid value for key ${t}`, xt = (t) => `Pattern length exceeds max of ${t}.`, Dt = (t) => `Missing ${t} property in key`, bt = (t) => `Property 'weight' in key '${t}' must be a positive integer`, ke = Object.prototype.hasOwnProperty;
42
42
  class yt {
43
43
  constructor(e) {
44
44
  this._keys = [], this._keyMap = {};
45
- let n = 0;
46
- e.forEach((o) => {
47
- let i = Se(o);
48
- this._keys.push(i), this._keyMap[i.id] = i, n += i.weight;
49
- }), this._keys.forEach((o) => {
50
- o.weight /= n;
45
+ let s = 0;
46
+ e.forEach((n) => {
47
+ let a = Ie(n);
48
+ this._keys.push(a), this._keyMap[a.id] = a, s += a.weight;
49
+ }), this._keys.forEach((n) => {
50
+ n.weight /= s;
51
51
  });
52
52
  }
53
53
  get(e) {
@@ -60,49 +60,51 @@ class yt {
60
60
  return JSON.stringify(this._keys);
61
61
  }
62
62
  }
63
- function Se(t) {
64
- let e = null, n = null, o = null, i = 1, r = null;
65
- if (H(t) || W(t))
66
- o = t, e = ke(t), n = me(t);
63
+ function Ie(t) {
64
+ let e = null, s = null, n = null, a = 1, r = null;
65
+ if (z(t) || K(t))
66
+ n = t, e = Ee(t), s = ge(t);
67
67
  else {
68
- if (!we.call(t, "name"))
69
- throw new Error(xt("name"));
70
- const a = t.name;
71
- if (o = a, we.call(t, "weight") && (i = t.weight, i <= 0))
72
- throw new Error(Dt(a));
73
- e = ke(a), n = me(a), r = t.getFn;
74
- }
75
- return { path: e, id: n, weight: i, src: o, getFn: r };
68
+ if (!ke.call(t, "name"))
69
+ throw new Error(Dt("name"));
70
+ const i = t.name;
71
+ if (n = i, ke.call(t, "weight") && (a = t.weight, a <= 0))
72
+ throw new Error(bt(i));
73
+ e = Ee(i), s = ge(i), r = t.getFn;
74
+ }
75
+ return { path: e, id: s, weight: a, src: n, getFn: r };
76
76
  }
77
- function ke(t) {
78
- return W(t) ? t : t.split(".");
77
+ function Ee(t) {
78
+ return K(t) ? t : t.split(".");
79
79
  }
80
- function me(t) {
81
- return W(t) ? t.join(".") : t;
80
+ function ge(t) {
81
+ return K(t) ? t.join(".") : t;
82
82
  }
83
- function bt(t, e) {
84
- let n = [], o = !1;
85
- const i = (r, a, l) => {
86
- if (V(r))
87
- if (!a[l])
88
- n.push(r);
83
+ function At(t, e) {
84
+ let s = [], n = !1;
85
+ const a = (r, i, l, p) => {
86
+ if (P(r))
87
+ if (!i[l])
88
+ s.push(p !== void 0 ? { v: r, i: p } : r);
89
89
  else {
90
- let d = a[l];
91
- const s = r[d];
92
- if (!V(s))
90
+ let o = i[l];
91
+ const u = r[o];
92
+ if (!P(u))
93
93
  return;
94
- if (l === a.length - 1 && (H(s) || Fe(s) || mt(s)))
95
- n.push(ft(s));
96
- else if (W(s)) {
97
- o = !0;
98
- for (let p = 0, _ = s.length; p < _; p += 1)
99
- i(s[p], a, l + 1);
100
- } else a.length && i(s, a, l + 1);
94
+ if (l === i.length - 1 && (z(u) || me(u) || gt(u)))
95
+ s.push(
96
+ p !== void 0 ? { v: we(u), i: p } : we(u)
97
+ );
98
+ else if (K(u)) {
99
+ n = !0;
100
+ for (let v = 0, b = u.length; v < b; v += 1)
101
+ a(u[v], i, l + 1, v);
102
+ } else i.length && a(u, i, l + 1, p);
101
103
  }
102
104
  };
103
- return i(t, H(e) ? e.split(".") : e, 0), o ? n : n[0];
105
+ return a(t, z(e) ? e.split(".") : e, 0), n ? s : s[0];
104
106
  }
105
- const At = {
107
+ const Ct = {
106
108
  // Whether the matches should be included in the result set. When `true`, each record in the result
107
109
  // set will include the indices of the matched characters.
108
110
  // These can consequently be used for highlighting purposes.
@@ -112,7 +114,7 @@ const At = {
112
114
  findAllMatches: !1,
113
115
  // Minimum number of characters that must be matched before a result is considered a match
114
116
  minMatchCharLength: 1
115
- }, Ct = {
117
+ }, wt = {
116
118
  // When `true`, the algorithm continues searching to the end of the input even if a perfect
117
119
  // match is found before the end of the same input.
118
120
  isCaseSensitive: !1,
@@ -126,7 +128,7 @@ const At = {
126
128
  shouldSort: !0,
127
129
  // Default sort function: sort by ascending score, ascending index
128
130
  sortFn: (t, e) => t.score === e.score ? t.idx < e.idx ? -1 : 1 : t.score < e.score ? -1 : 1
129
- }, wt = {
131
+ }, kt = {
130
132
  // Approximately where in the text is the pattern expected to be found?
131
133
  location: 0,
132
134
  // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
@@ -138,12 +140,12 @@ const At = {
138
140
  // the exact location specified, a threshold of '1000' would require a perfect match
139
141
  // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
140
142
  distance: 100
141
- }, kt = {
143
+ }, Et = {
142
144
  // When `true`, it enables the use of unix-like search commands
143
145
  useExtendedSearch: !1,
144
146
  // The get function to use when fetching an object's properties.
145
147
  // The default will search nested paths *ie foo.bar.baz*
146
- getFn: bt,
148
+ getFn: At,
147
149
  // When `true`, search will ignore `location` and `distance`, so it won't matter
148
150
  // where in the string the pattern appears.
149
151
  // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
@@ -156,33 +158,33 @@ const At = {
156
158
  fieldNormWeight: 1
157
159
  };
158
160
  var D = {
159
- ...Ct,
160
- ...At,
161
161
  ...wt,
162
- ...kt
162
+ ...Ct,
163
+ ...kt,
164
+ ...Et
163
165
  };
164
- const Et = /[^ ]+/g;
165
- function $t(t = 1, e = 3) {
166
- const n = /* @__PURE__ */ new Map(), o = Math.pow(10, e);
166
+ const $t = /[^ ]+/g;
167
+ function Mt(t = 1, e = 3) {
168
+ const s = /* @__PURE__ */ new Map(), n = Math.pow(10, e);
167
169
  return {
168
- get(i) {
169
- const r = i.match(Et).length;
170
- if (n.has(r))
171
- return n.get(r);
172
- const a = 1 / Math.pow(r, 0.5 * t), l = parseFloat(Math.round(a * o) / o);
173
- return n.set(r, l), l;
170
+ get(a) {
171
+ const r = a.match($t).length;
172
+ if (s.has(r))
173
+ return s.get(r);
174
+ const i = 1 / Math.pow(r, 0.5 * t), l = parseFloat(Math.round(i * n) / n);
175
+ return s.set(r, l), l;
174
176
  },
175
177
  clear() {
176
- n.clear();
178
+ s.clear();
177
179
  }
178
180
  };
179
181
  }
180
182
  class ye {
181
183
  constructor({
182
184
  getFn: e = D.getFn,
183
- fieldNormWeight: n = D.fieldNormWeight
185
+ fieldNormWeight: s = D.fieldNormWeight
184
186
  } = {}) {
185
- this.norm = $t(n, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
187
+ this.norm = Mt(s, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
186
188
  }
187
189
  setSources(e = []) {
188
190
  this.docs = e;
@@ -191,79 +193,90 @@ class ye {
191
193
  this.records = e;
192
194
  }
193
195
  setKeys(e = []) {
194
- this.keys = e, this._keysMap = {}, e.forEach((n, o) => {
195
- this._keysMap[n.id] = o;
196
+ this.keys = e, this._keysMap = {}, e.forEach((s, n) => {
197
+ this._keysMap[s.id] = n;
196
198
  });
197
199
  }
198
200
  create() {
199
- this.isCreated || !this.docs.length || (this.isCreated = !0, H(this.docs[0]) ? this.docs.forEach((e, n) => {
200
- this._addString(e, n);
201
- }) : this.docs.forEach((e, n) => {
202
- this._addObject(e, n);
201
+ this.isCreated || !this.docs.length || (this.isCreated = !0, z(this.docs[0]) ? this.docs.forEach((e, s) => {
202
+ this._addString(e, s);
203
+ }) : this.docs.forEach((e, s) => {
204
+ this._addObject(e, s);
203
205
  }), this.norm.clear());
204
206
  }
205
207
  // Adds a doc to the end of the index
206
208
  add(e) {
207
- const n = this.size();
208
- H(e) ? this._addString(e, n) : this._addObject(e, n);
209
+ const s = this.size();
210
+ z(e) ? this._addString(e, s) : this._addObject(e, s);
209
211
  }
210
212
  // Removes the doc at the specified index of the index
211
213
  removeAt(e) {
212
214
  this.records.splice(e, 1);
213
- for (let n = e, o = this.size(); n < o; n += 1)
214
- this.records[n].i -= 1;
215
+ for (let s = e, n = this.size(); s < n; s += 1)
216
+ this.records[s].i -= 1;
215
217
  }
216
- getValueForItemAtKeyId(e, n) {
217
- return e[this._keysMap[n]];
218
+ // Removes docs at the specified indices (must be sorted ascending)
219
+ removeAll(e) {
220
+ for (let s = e.length - 1; s >= 0; s -= 1)
221
+ this.records.splice(e[s], 1);
222
+ for (let s = 0, n = this.records.length; s < n; s += 1)
223
+ this.records[s].i = s;
224
+ }
225
+ getValueForItemAtKeyId(e, s) {
226
+ return e[this._keysMap[s]];
218
227
  }
219
228
  size() {
220
229
  return this.records.length;
221
230
  }
222
- _addString(e, n) {
223
- if (!V(e) || fe(e))
231
+ _addString(e, s) {
232
+ if (!P(e) || ae(e))
224
233
  return;
225
- let o = {
234
+ let n = {
226
235
  v: e,
227
- i: n,
236
+ i: s,
228
237
  n: this.norm.get(e)
229
238
  };
230
- this.records.push(o);
231
- }
232
- _addObject(e, n) {
233
- let o = { i: n, $: {} };
234
- this.keys.forEach((i, r) => {
235
- let a = i.getFn ? i.getFn(e) : this.getFn(e, i.path);
236
- if (V(a)) {
237
- if (W(a)) {
239
+ this.records.push(n);
240
+ }
241
+ _addObject(e, s) {
242
+ let n = { i: s, $: {} };
243
+ this.keys.forEach((a, r) => {
244
+ let i = a.getFn ? a.getFn(e) : this.getFn(e, a.path);
245
+ if (P(i)) {
246
+ if (K(i)) {
238
247
  let l = [];
239
- const d = [{ nestedArrIndex: -1, value: a }];
240
- for (; d.length; ) {
241
- const { nestedArrIndex: s, value: p } = d.pop();
242
- if (V(p))
243
- if (H(p) && !fe(p)) {
244
- let _ = {
245
- v: p,
246
- i: s,
247
- n: this.norm.get(p)
248
+ for (let p = 0, o = i.length; p < o; p += 1) {
249
+ const u = i[p];
250
+ if (P(u)) {
251
+ if (z(u)) {
252
+ if (!ae(u)) {
253
+ let v = {
254
+ v: u,
255
+ i: p,
256
+ n: this.norm.get(u)
257
+ };
258
+ l.push(v);
259
+ }
260
+ } else if (z(u.v) && !ae(u.v)) {
261
+ let v = {
262
+ v: u.v,
263
+ i: u.i,
264
+ n: this.norm.get(u.v)
248
265
  };
249
- l.push(_);
250
- } else W(p) && p.forEach((_, y) => {
251
- d.push({
252
- nestedArrIndex: y,
253
- value: _
254
- });
255
- });
266
+ l.push(v);
267
+ }
268
+ }
256
269
  }
257
- o.$[r] = l;
258
- } else if (H(a) && !fe(a)) {
270
+ n.$[r] = l;
271
+ } else if (z(i) && !ae(i)) {
259
272
  let l = {
260
- v: a,
261
- n: this.norm.get(a)
273
+ v: i,
274
+ n: this.norm.get(i)
262
275
  };
263
- o.$[r] = l;
276
+ n.$[r] = l;
264
277
  }
265
278
  }
266
- }), this.records.push(o);
279
+ }), this.records.push(n);
267
280
  }
268
281
  toJSON() {
269
282
  return {
@@ -272,202 +285,181 @@ class ye {
272
285
  };
273
286
  }
274
287
  }
275
- function je(t, e, { getFn: n = D.getFn, fieldNormWeight: o = D.fieldNormWeight } = {}) {
276
- const i = new ye({ getFn: n, fieldNormWeight: o });
277
- return i.setKeys(t.map(Se)), i.setSources(e), i.create(), i;
288
+ function je(t, e, { getFn: s = D.getFn, fieldNormWeight: n = D.fieldNormWeight } = {}) {
289
+ const a = new ye({ getFn: s, fieldNormWeight: n });
290
+ return a.setKeys(t.map(Ie)), a.setSources(e), a.create(), a;
278
291
  }
279
- function Mt(t, { getFn: e = D.getFn, fieldNormWeight: n = D.fieldNormWeight } = {}) {
280
- const { keys: o, records: i } = t, r = new ye({ getFn: e, fieldNormWeight: n });
281
- return r.setKeys(o), r.setIndexRecords(i), r;
292
+ function Bt(t, { getFn: e = D.getFn, fieldNormWeight: s = D.fieldNormWeight } = {}) {
293
+ const { keys: n, records: a } = t, r = new ye({ getFn: e, fieldNormWeight: s });
294
+ return r.setKeys(n), r.setIndexRecords(a), r;
282
295
  }
283
- function se(t, {
284
- errors: e = 0,
285
- currentLocation: n = 0,
286
- expectedLocation: o = 0,
287
- distance: i = D.distance,
288
- ignoreLocation: r = D.ignoreLocation
289
- } = {}) {
290
- const a = e / t.length;
291
- if (r)
292
- return a;
293
- const l = Math.abs(o - n);
294
- return i ? a + l / i : l ? 1 : a;
295
- }
296
- function Bt(t = [], e = D.minMatchCharLength) {
297
- let n = [], o = -1, i = -1, r = 0;
298
- for (let a = t.length; r < a; r += 1) {
296
+ function Ft(t = [], e = D.minMatchCharLength) {
297
+ let s = [], n = -1, a = -1, r = 0;
298
+ for (let i = t.length; r < i; r += 1) {
299
299
  let l = t[r];
300
- l && o === -1 ? o = r : !l && o !== -1 && (i = r - 1, i - o + 1 >= e && n.push([o, i]), o = -1);
300
+ l && n === -1 ? n = r : !l && n !== -1 && (a = r - 1, a - n + 1 >= e && s.push([n, a]), n = -1);
301
301
  }
302
- return t[r - 1] && r - o >= e && n.push([o, r - 1]), n;
302
+ return t[r - 1] && r - n >= e && s.push([n, r - 1]), s;
303
303
  }
304
304
  const Q = 32;
305
- function Ft(t, e, n, {
306
- location: o = D.location,
307
- distance: i = D.distance,
305
+ function St(t, e, s, {
306
+ location: n = D.location,
307
+ distance: a = D.distance,
308
308
  threshold: r = D.threshold,
309
- findAllMatches: a = D.findAllMatches,
309
+ findAllMatches: i = D.findAllMatches,
310
310
  minMatchCharLength: l = D.minMatchCharLength,
311
- includeMatches: d = D.includeMatches,
312
- ignoreLocation: s = D.ignoreLocation
311
+ includeMatches: p = D.includeMatches,
312
+ ignoreLocation: o = D.ignoreLocation
313
313
  } = {}) {
314
314
  if (e.length > Q)
315
- throw new Error(_t(Q));
316
- const p = e.length, _ = t.length, y = Math.max(0, Math.min(o, _));
317
- let v = r, c = y;
318
- const x = l > 1 || d, B = x ? Array(_) : [];
319
- let j;
320
- for (; (j = t.indexOf(e, c)) > -1; ) {
321
- let k = se(e, {
322
- currentLocation: j,
323
- expectedLocation: y,
324
- distance: i,
325
- ignoreLocation: s
326
- });
327
- if (v = Math.min(k, v), c = j + p, x) {
328
- let T = 0;
329
- for (; T < p; )
330
- B[j + T] = 1, T += 1;
315
+ throw new Error(xt(Q));
316
+ const u = e.length, v = t.length, b = Math.max(0, Math.min(n, v));
317
+ let h = r, d = b;
318
+ const x = (E, j) => {
319
+ const y = E / u;
320
+ if (o) return y;
321
+ const T = Math.abs(b - j);
322
+ return a ? y + T / a : T ? 1 : y;
323
+ }, M = l > 1 || p, O = M ? Array(v) : [];
324
+ let I;
325
+ for (; (I = t.indexOf(e, d)) > -1; ) {
326
+ let E = x(0, I);
327
+ if (h = Math.min(E, h), d = I + u, M) {
328
+ let j = 0;
329
+ for (; j < u; )
330
+ O[I + j] = 1, j += 1;
331
331
  }
332
332
  }
333
- c = -1;
334
- let S = [], w = 1, M = p + _;
335
- const U = 1 << p - 1;
336
- for (let k = 0; k < p; k += 1) {
337
- let T = 0, O = M;
338
- for (; T < O; )
339
- se(e, {
340
- errors: k,
341
- currentLocation: y + O,
342
- expectedLocation: y,
343
- distance: i,
344
- ignoreLocation: s
345
- }) <= v ? T = O : M = O, O = Math.floor((M - T) / 2 + T);
346
- M = O;
347
- let C = Math.max(1, y - O + 1), N = a ? _ : Math.min(y + O, _) + p, K = Array(N + 2);
348
- K[N + 1] = (1 << k) - 1;
349
- for (let b = N; b >= C; b -= 1) {
350
- let f = b - 1, E = n[t.charAt(f)];
351
- if (x && (B[f] = +!!E), K[b] = (K[b + 1] << 1 | 1) & E, k && (K[b] |= (S[b + 1] | S[b]) << 1 | 1 | S[b + 1]), K[b] & U && (w = se(e, {
352
- errors: k,
353
- currentLocation: f,
354
- expectedLocation: y,
355
- distance: i,
356
- ignoreLocation: s
357
- }), w <= v)) {
358
- if (v = w, c = f, c <= y)
333
+ d = -1;
334
+ let w = [], B = 1, N = u + v;
335
+ const H = 1 << u - 1;
336
+ for (let E = 0; E < u; E += 1) {
337
+ let j = 0, y = N;
338
+ for (; j < y; )
339
+ x(E, b + y) <= h ? j = y : N = y, y = Math.floor((N - j) / 2 + j);
340
+ N = y;
341
+ let T = Math.max(1, b - y + 1), ee = i ? v : Math.min(b + y, v) + u, W = Array(ee + 2);
342
+ W[ee + 1] = (1 << E) - 1;
343
+ for (let f = ee; f >= T; f -= 1) {
344
+ let k = f - 1, X = s[t[k]];
345
+ if (M && (O[k] = +!!X), W[f] = (W[f + 1] << 1 | 1) & X, E && (W[f] |= (w[f + 1] | w[f]) << 1 | 1 | w[f + 1]), W[f] & H && (B = x(E, k), B <= h)) {
346
+ if (h = B, d = k, d <= b)
359
347
  break;
360
- C = Math.max(1, 2 * y - c);
348
+ T = Math.max(1, 2 * b - d);
361
349
  }
362
350
  }
363
- if (se(e, {
364
- errors: k + 1,
365
- currentLocation: y,
366
- expectedLocation: y,
367
- distance: i,
368
- ignoreLocation: s
369
- }) > v)
351
+ if (x(E + 1, b) > h)
370
352
  break;
371
- S = K;
353
+ w = W;
372
354
  }
373
- const L = {
374
- isMatch: c >= 0,
355
+ const V = {
356
+ isMatch: d >= 0,
375
357
  // Count exact matches (those with a score of 0) to be "almost" exact
376
- score: Math.max(1e-3, w)
358
+ score: Math.max(1e-3, B)
377
359
  };
378
- if (x) {
379
- const k = Bt(B, l);
380
- k.length ? d && (L.indices = k) : L.isMatch = !1;
360
+ if (M) {
361
+ const E = Ft(O, l);
362
+ E.length ? p && (V.indices = E) : V.isMatch = !1;
381
363
  }
382
- return L;
364
+ return V;
383
365
  }
384
- function It(t) {
366
+ function Rt(t) {
385
367
  let e = {};
386
- for (let n = 0, o = t.length; n < o; n += 1) {
387
- const i = t.charAt(n);
388
- e[i] = (e[i] || 0) | 1 << o - n - 1;
368
+ for (let s = 0, n = t.length; s < n; s += 1) {
369
+ const a = t.charAt(s);
370
+ e[a] = (e[a] || 0) | 1 << n - s - 1;
371
+ }
372
+ return e;
373
+ }
374
+ const ie = String.prototype.normalize ? ((t) => t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "")) : ((t) => t);
375
+ function It(t) {
376
+ if (t.length <= 1) return t;
377
+ t.sort((s, n) => s[0] - n[0] || s[1] - n[1]);
378
+ const e = [t[0]];
379
+ for (let s = 1, n = t.length; s < n; s += 1) {
380
+ const a = e[e.length - 1], r = t[s];
381
+ r[0] <= a[1] + 1 ? a[1] = Math.max(a[1], r[1]) : e.push(r);
389
382
  }
390
383
  return e;
391
384
  }
392
- const oe = String.prototype.normalize ? ((t) => t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "")) : ((t) => t);
393
385
  class Te {
394
386
  constructor(e, {
395
- location: n = D.location,
396
- threshold: o = D.threshold,
397
- distance: i = D.distance,
387
+ location: s = D.location,
388
+ threshold: n = D.threshold,
389
+ distance: a = D.distance,
398
390
  includeMatches: r = D.includeMatches,
399
- findAllMatches: a = D.findAllMatches,
391
+ findAllMatches: i = D.findAllMatches,
400
392
  minMatchCharLength: l = D.minMatchCharLength,
401
- isCaseSensitive: d = D.isCaseSensitive,
402
- ignoreDiacritics: s = D.ignoreDiacritics,
403
- ignoreLocation: p = D.ignoreLocation
393
+ isCaseSensitive: p = D.isCaseSensitive,
394
+ ignoreDiacritics: o = D.ignoreDiacritics,
395
+ ignoreLocation: u = D.ignoreLocation
404
396
  } = {}) {
405
397
  if (this.options = {
406
- location: n,
407
- threshold: o,
408
- distance: i,
398
+ location: s,
399
+ threshold: n,
400
+ distance: a,
409
401
  includeMatches: r,
410
- findAllMatches: a,
402
+ findAllMatches: i,
411
403
  minMatchCharLength: l,
412
- isCaseSensitive: d,
413
- ignoreDiacritics: s,
414
- ignoreLocation: p
415
- }, e = d ? e : e.toLowerCase(), e = s ? oe(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length)
404
+ isCaseSensitive: p,
405
+ ignoreDiacritics: o,
406
+ ignoreLocation: u
407
+ }, e = p ? e : e.toLowerCase(), e = o ? ie(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length)
416
408
  return;
417
- const _ = (v, c) => {
409
+ const v = (h, d) => {
418
410
  this.chunks.push({
419
- pattern: v,
420
- alphabet: It(v),
421
- startIndex: c
411
+ pattern: h,
412
+ alphabet: Rt(h),
413
+ startIndex: d
422
414
  });
423
- }, y = this.pattern.length;
424
- if (y > Q) {
425
- let v = 0;
426
- const c = y % Q, x = y - c;
427
- for (; v < x; )
428
- _(this.pattern.substr(v, Q), v), v += Q;
429
- if (c) {
430
- const B = y - Q;
431
- _(this.pattern.substr(B), B);
415
+ }, b = this.pattern.length;
416
+ if (b > Q) {
417
+ let h = 0;
418
+ const d = b % Q, x = b - d;
419
+ for (; h < x; )
420
+ v(this.pattern.substr(h, Q), h), h += Q;
421
+ if (d) {
422
+ const M = b - Q;
423
+ v(this.pattern.substr(M), M);
432
424
  }
433
425
  } else
434
- _(this.pattern, 0);
426
+ v(this.pattern, 0);
435
427
  }
436
428
  searchIn(e) {
437
- const { isCaseSensitive: n, ignoreDiacritics: o, includeMatches: i } = this.options;
438
- if (e = n ? e : e.toLowerCase(), e = o ? oe(e) : e, this.pattern === e) {
429
+ const { isCaseSensitive: s, ignoreDiacritics: n, includeMatches: a } = this.options;
430
+ if (e = s ? e : e.toLowerCase(), e = n ? ie(e) : e, this.pattern === e) {
439
431
  let x = {
440
432
  isMatch: !0,
441
433
  score: 0
442
434
  };
443
- return i && (x.indices = [[0, e.length - 1]]), x;
435
+ return a && (x.indices = [[0, e.length - 1]]), x;
444
436
  }
445
437
  const {
446
438
  location: r,
447
- distance: a,
439
+ distance: i,
448
440
  threshold: l,
449
- findAllMatches: d,
450
- minMatchCharLength: s,
451
- ignoreLocation: p
441
+ findAllMatches: p,
442
+ minMatchCharLength: o,
443
+ ignoreLocation: u
452
444
  } = this.options;
453
- let _ = [], y = 0, v = !1;
454
- this.chunks.forEach(({ pattern: x, alphabet: B, startIndex: j }) => {
455
- const { isMatch: S, score: w, indices: M } = Ft(e, x, B, {
456
- location: r + j,
457
- distance: a,
445
+ let v = [], b = 0, h = !1;
446
+ this.chunks.forEach(({ pattern: x, alphabet: M, startIndex: O }) => {
447
+ const { isMatch: I, score: w, indices: B } = St(e, x, M, {
448
+ location: r + O,
449
+ distance: i,
458
450
  threshold: l,
459
- findAllMatches: d,
460
- minMatchCharLength: s,
461
- includeMatches: i,
462
- ignoreLocation: p
451
+ findAllMatches: p,
452
+ minMatchCharLength: o,
453
+ includeMatches: a,
454
+ ignoreLocation: u
463
455
  });
464
- S && (v = !0), y += w, S && M && (_ = [..._, ...M]);
456
+ I && (h = !0), b += w, I && B && v.push(...B);
465
457
  });
466
- let c = {
467
- isMatch: v,
468
- score: v ? y / this.chunks.length : 1
458
+ let d = {
459
+ isMatch: h,
460
+ score: h ? b / this.chunks.length : 1
469
461
  };
470
- return v && i && (c.indices = _), c;
462
+ return h && a && (d.indices = It(v)), d;
471
463
  }
472
464
  }
473
465
  class G {
@@ -475,19 +467,19 @@ class G {
475
467
  this.pattern = e;
476
468
  }
477
469
  static isMultiMatch(e) {
478
- return Ee(e, this.multiRegex);
470
+ return $e(e, this.multiRegex);
479
471
  }
480
472
  static isSingleMatch(e) {
481
- return Ee(e, this.singleRegex);
473
+ return $e(e, this.singleRegex);
482
474
  }
483
475
  search() {
484
476
  }
485
477
  }
486
- function Ee(t, e) {
487
- const n = t.match(e);
488
- return n ? n[1] : null;
478
+ function $e(t, e) {
479
+ const s = t.match(e);
480
+ return s ? s[1] : null;
489
481
  }
490
- class Rt extends G {
482
+ class jt extends G {
491
483
  constructor(e) {
492
484
  super(e);
493
485
  }
@@ -501,15 +493,15 @@ class Rt extends G {
501
493
  return /^=(.*)$/;
502
494
  }
503
495
  search(e) {
504
- const n = e === this.pattern;
496
+ const s = e === this.pattern;
505
497
  return {
506
- isMatch: n,
507
- score: n ? 0 : 1,
498
+ isMatch: s,
499
+ score: s ? 0 : 1,
508
500
  indices: [0, this.pattern.length - 1]
509
501
  };
510
502
  }
511
503
  }
512
- class St extends G {
504
+ class Tt extends G {
513
505
  constructor(e) {
514
506
  super(e);
515
507
  }
@@ -523,15 +515,15 @@ class St extends G {
523
515
  return /^!(.*)$/;
524
516
  }
525
517
  search(e) {
526
- const o = e.indexOf(this.pattern) === -1;
518
+ const n = e.indexOf(this.pattern) === -1;
527
519
  return {
528
- isMatch: o,
529
- score: o ? 0 : 1,
520
+ isMatch: n,
521
+ score: n ? 0 : 1,
530
522
  indices: [0, e.length - 1]
531
523
  };
532
524
  }
533
525
  }
534
- class jt extends G {
526
+ class Ot extends G {
535
527
  constructor(e) {
536
528
  super(e);
537
529
  }
@@ -545,15 +537,15 @@ class jt extends G {
545
537
  return /^\^(.*)$/;
546
538
  }
547
539
  search(e) {
548
- const n = e.startsWith(this.pattern);
540
+ const s = e.startsWith(this.pattern);
549
541
  return {
550
- isMatch: n,
551
- score: n ? 0 : 1,
542
+ isMatch: s,
543
+ score: s ? 0 : 1,
552
544
  indices: [0, this.pattern.length - 1]
553
545
  };
554
546
  }
555
547
  }
556
- class Tt extends G {
548
+ class Nt extends G {
557
549
  constructor(e) {
558
550
  super(e);
559
551
  }
@@ -567,15 +559,15 @@ class Tt extends G {
567
559
  return /^!\^(.*)$/;
568
560
  }
569
561
  search(e) {
570
- const n = !e.startsWith(this.pattern);
562
+ const s = !e.startsWith(this.pattern);
571
563
  return {
572
- isMatch: n,
573
- score: n ? 0 : 1,
564
+ isMatch: s,
565
+ score: s ? 0 : 1,
574
566
  indices: [0, e.length - 1]
575
567
  };
576
568
  }
577
569
  }
578
- class Ot extends G {
570
+ class Lt extends G {
579
571
  constructor(e) {
580
572
  super(e);
581
573
  }
@@ -589,15 +581,15 @@ class Ot extends G {
589
581
  return /^(.*)\$$/;
590
582
  }
591
583
  search(e) {
592
- const n = e.endsWith(this.pattern);
584
+ const s = e.endsWith(this.pattern);
593
585
  return {
594
- isMatch: n,
595
- score: n ? 0 : 1,
586
+ isMatch: s,
587
+ score: s ? 0 : 1,
596
588
  indices: [e.length - this.pattern.length, e.length - 1]
597
589
  };
598
590
  }
599
591
  }
600
- class Nt extends G {
592
+ class Pt extends G {
601
593
  constructor(e) {
602
594
  super(e);
603
595
  }
@@ -611,36 +603,36 @@ class Nt extends G {
611
603
  return /^!(.*)\$$/;
612
604
  }
613
605
  search(e) {
614
- const n = !e.endsWith(this.pattern);
606
+ const s = !e.endsWith(this.pattern);
615
607
  return {
616
- isMatch: n,
617
- score: n ? 0 : 1,
608
+ isMatch: s,
609
+ score: s ? 0 : 1,
618
610
  indices: [0, e.length - 1]
619
611
  };
620
612
  }
621
613
  }
622
614
  class Oe extends G {
623
615
  constructor(e, {
624
- location: n = D.location,
625
- threshold: o = D.threshold,
626
- distance: i = D.distance,
616
+ location: s = D.location,
617
+ threshold: n = D.threshold,
618
+ distance: a = D.distance,
627
619
  includeMatches: r = D.includeMatches,
628
- findAllMatches: a = D.findAllMatches,
620
+ findAllMatches: i = D.findAllMatches,
629
621
  minMatchCharLength: l = D.minMatchCharLength,
630
- isCaseSensitive: d = D.isCaseSensitive,
631
- ignoreDiacritics: s = D.ignoreDiacritics,
632
- ignoreLocation: p = D.ignoreLocation
622
+ isCaseSensitive: p = D.isCaseSensitive,
623
+ ignoreDiacritics: o = D.ignoreDiacritics,
624
+ ignoreLocation: u = D.ignoreLocation
633
625
  } = {}) {
634
626
  super(e), this._bitapSearch = new Te(e, {
635
- location: n,
636
- threshold: o,
637
- distance: i,
627
+ location: s,
628
+ threshold: n,
629
+ distance: a,
638
630
  includeMatches: r,
639
- findAllMatches: a,
631
+ findAllMatches: i,
640
632
  minMatchCharLength: l,
641
- isCaseSensitive: d,
642
- ignoreDiacritics: s,
643
- ignoreLocation: p
633
+ isCaseSensitive: p,
634
+ ignoreDiacritics: o,
635
+ ignoreLocation: u
644
636
  });
645
637
  }
646
638
  static get type() {
@@ -670,111 +662,111 @@ class Ne extends G {
670
662
  return /^'(.*)$/;
671
663
  }
672
664
  search(e) {
673
- let n = 0, o;
674
- const i = [], r = this.pattern.length;
675
- for (; (o = e.indexOf(this.pattern, n)) > -1; )
676
- n = o + r, i.push([o, n - 1]);
677
- const a = !!i.length;
665
+ let s = 0, n;
666
+ const a = [], r = this.pattern.length;
667
+ for (; (n = e.indexOf(this.pattern, s)) > -1; )
668
+ s = n + r, a.push([n, s - 1]);
669
+ const i = !!a.length;
678
670
  return {
679
- isMatch: a,
680
- score: a ? 0 : 1,
681
- indices: i
671
+ isMatch: i,
672
+ score: i ? 0 : 1,
673
+ indices: a
682
674
  };
683
675
  }
684
676
  }
685
- const ge = [
686
- Rt,
687
- Ne,
677
+ const ve = [
688
678
  jt,
689
- Tt,
690
- Nt,
679
+ Ne,
691
680
  Ot,
692
- St,
681
+ Nt,
682
+ Pt,
683
+ Lt,
684
+ Tt,
693
685
  Oe
694
- ], $e = ge.length, Lt = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, Pt = "|";
695
- function Vt(t, e = {}) {
696
- return t.split(Pt).map((n) => {
697
- let o = n.trim().split(Lt).filter((r) => r && !!r.trim()), i = [];
698
- for (let r = 0, a = o.length; r < a; r += 1) {
699
- const l = o[r];
700
- let d = !1, s = -1;
701
- for (; !d && ++s < $e; ) {
702
- const p = ge[s];
703
- let _ = p.isMultiMatch(l);
704
- _ && (i.push(new p(_, e)), d = !0);
686
+ ], Me = ve.length, zt = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, Vt = "|";
687
+ function Ut(t, e = {}) {
688
+ return t.split(Vt).map((s) => {
689
+ let n = s.trim().split(zt).filter((r) => r && !!r.trim()), a = [];
690
+ for (let r = 0, i = n.length; r < i; r += 1) {
691
+ const l = n[r];
692
+ let p = !1, o = -1;
693
+ for (; !p && ++o < Me; ) {
694
+ const u = ve[o];
695
+ let v = u.isMultiMatch(l);
696
+ v && (a.push(new u(v, e)), p = !0);
705
697
  }
706
- if (!d)
707
- for (s = -1; ++s < $e; ) {
708
- const p = ge[s];
709
- let _ = p.isSingleMatch(l);
710
- if (_) {
711
- i.push(new p(_, e));
698
+ if (!p)
699
+ for (o = -1; ++o < Me; ) {
700
+ const u = ve[o];
701
+ let v = u.isSingleMatch(l);
702
+ if (v) {
703
+ a.push(new u(v, e));
712
704
  break;
713
705
  }
714
706
  }
715
707
  }
716
- return i;
708
+ return a;
717
709
  });
718
710
  }
719
- const zt = /* @__PURE__ */ new Set([Oe.type, Ne.type]);
720
- class Ut {
711
+ const Ht = /* @__PURE__ */ new Set([Oe.type, Ne.type]);
712
+ class Wt {
721
713
  constructor(e, {
722
- isCaseSensitive: n = D.isCaseSensitive,
723
- ignoreDiacritics: o = D.ignoreDiacritics,
724
- includeMatches: i = D.includeMatches,
714
+ isCaseSensitive: s = D.isCaseSensitive,
715
+ ignoreDiacritics: n = D.ignoreDiacritics,
716
+ includeMatches: a = D.includeMatches,
725
717
  minMatchCharLength: r = D.minMatchCharLength,
726
- ignoreLocation: a = D.ignoreLocation,
718
+ ignoreLocation: i = D.ignoreLocation,
727
719
  findAllMatches: l = D.findAllMatches,
728
- location: d = D.location,
729
- threshold: s = D.threshold,
730
- distance: p = D.distance
720
+ location: p = D.location,
721
+ threshold: o = D.threshold,
722
+ distance: u = D.distance
731
723
  } = {}) {
732
724
  this.query = null, this.options = {
733
- isCaseSensitive: n,
734
- ignoreDiacritics: o,
735
- includeMatches: i,
725
+ isCaseSensitive: s,
726
+ ignoreDiacritics: n,
727
+ includeMatches: a,
736
728
  minMatchCharLength: r,
737
729
  findAllMatches: l,
738
- ignoreLocation: a,
739
- location: d,
740
- threshold: s,
741
- distance: p
742
- }, e = n ? e : e.toLowerCase(), e = o ? oe(e) : e, this.pattern = e, this.query = Vt(this.pattern, this.options);
730
+ ignoreLocation: i,
731
+ location: p,
732
+ threshold: o,
733
+ distance: u
734
+ }, e = s ? e : e.toLowerCase(), e = n ? ie(e) : e, this.pattern = e, this.query = Ut(this.pattern, this.options);
743
735
  }
744
- static condition(e, n) {
745
- return n.useExtendedSearch;
736
+ static condition(e, s) {
737
+ return s.useExtendedSearch;
746
738
  }
747
739
  searchIn(e) {
748
- const n = this.query;
749
- if (!n)
740
+ const s = this.query;
741
+ if (!s)
750
742
  return {
751
743
  isMatch: !1,
752
744
  score: 1
753
745
  };
754
- const { includeMatches: o, isCaseSensitive: i, ignoreDiacritics: r } = this.options;
755
- e = i ? e : e.toLowerCase(), e = r ? oe(e) : e;
756
- let a = 0, l = [], d = 0;
757
- for (let s = 0, p = n.length; s < p; s += 1) {
758
- const _ = n[s];
759
- l.length = 0, a = 0;
760
- for (let y = 0, v = _.length; y < v; y += 1) {
761
- const c = _[y], { isMatch: x, indices: B, score: j } = c.search(e);
746
+ const { includeMatches: n, isCaseSensitive: a, ignoreDiacritics: r } = this.options;
747
+ e = a ? e : e.toLowerCase(), e = r ? ie(e) : e;
748
+ let i = 0, l = [], p = 0;
749
+ for (let o = 0, u = s.length; o < u; o += 1) {
750
+ const v = s[o];
751
+ l.length = 0, i = 0;
752
+ for (let b = 0, h = v.length; b < h; b += 1) {
753
+ const d = v[b], { isMatch: x, indices: M, score: O } = d.search(e);
762
754
  if (x) {
763
- if (a += 1, d += j, o) {
764
- const S = c.constructor.type;
765
- zt.has(S) ? l = [...l, ...B] : l.push(B);
755
+ if (i += 1, p += O, n) {
756
+ const I = d.constructor.type;
757
+ Ht.has(I) ? l.push(...M) : l.push(M);
766
758
  }
767
759
  } else {
768
- d = 0, a = 0, l.length = 0;
760
+ p = 0, i = 0, l.length = 0;
769
761
  break;
770
762
  }
771
763
  }
772
- if (a) {
773
- let y = {
764
+ if (i) {
765
+ let b = {
774
766
  isMatch: !0,
775
- score: d / a
767
+ score: p / i
776
768
  };
777
- return o && (y.indices = l), y;
769
+ return n && (b.indices = l), b;
778
770
  }
779
771
  }
780
772
  return {
@@ -783,123 +775,173 @@ class Ut {
783
775
  };
784
776
  }
785
777
  }
786
- const ve = [];
787
- function Ht(...t) {
788
- ve.push(...t);
778
+ const he = [];
779
+ function Le(...t) {
780
+ he.push(...t);
789
781
  }
790
- function he(t, e) {
791
- for (let n = 0, o = ve.length; n < o; n += 1) {
792
- let i = ve[n];
793
- if (i.condition(t, e))
794
- return new i(t, e);
782
+ function Pe(t, e) {
783
+ for (let s = 0, n = he.length; s < n; s += 1) {
784
+ let a = he[s];
785
+ if (a.condition(t, e))
786
+ return new a(t, e);
795
787
  }
796
788
  return new Te(t, e);
797
789
  }
798
- const ae = {
790
+ const re = {
799
791
  AND: "$and",
800
792
  OR: "$or"
801
793
  }, _e = {
802
794
  PATH: "$path",
803
795
  PATTERN: "$val"
804
- }, xe = (t) => !!(t[ae.AND] || t[ae.OR]), Wt = (t) => !!t[_e.PATH], Kt = (t) => !W(t) && Ie(t) && !xe(t), Me = (t) => ({
805
- [ae.AND]: Object.keys(t).map((e) => ({
796
+ }, xe = (t) => !!(t[re.AND] || t[re.OR]), Kt = (t) => !!t[_e.PATH], Gt = (t) => !K(t) && Se(t) && !xe(t), Be = (t) => ({
797
+ [re.AND]: Object.keys(t).map((e) => ({
806
798
  [e]: t[e]
807
799
  }))
808
800
  });
809
- function Le(t, e, { auto: n = !0 } = {}) {
810
- const o = (i) => {
811
- let r = Object.keys(i);
812
- const a = Wt(i);
813
- if (!a && r.length > 1 && !xe(i))
814
- return o(Me(i));
815
- if (Kt(i)) {
816
- const d = a ? i[_e.PATH] : r[0], s = a ? i[_e.PATTERN] : i[d];
817
- if (!H(s))
818
- throw new Error(ht(d));
819
- const p = {
820
- keyId: me(d),
821
- pattern: s
801
+ function ze(t, e, { auto: s = !0 } = {}) {
802
+ const n = (a) => {
803
+ let r = Object.keys(a);
804
+ const i = Kt(a);
805
+ if (!i && r.length > 1 && !xe(a))
806
+ return n(Be(a));
807
+ if (Gt(a)) {
808
+ const p = i ? a[_e.PATH] : r[0], o = i ? a[_e.PATTERN] : a[p];
809
+ if (!z(o))
810
+ throw new Error(_t(p));
811
+ const u = {
812
+ keyId: ge(p),
813
+ pattern: o
822
814
  };
823
- return n && (p.searcher = he(s, e)), p;
815
+ return s && (u.searcher = Pe(o, e)), u;
824
816
  }
825
817
  let l = {
826
818
  children: [],
827
819
  operator: r[0]
828
820
  };
829
- return r.forEach((d) => {
830
- const s = i[d];
831
- W(s) && s.forEach((p) => {
832
- l.children.push(o(p));
821
+ return r.forEach((p) => {
822
+ const o = a[p];
823
+ K(o) && o.forEach((u) => {
824
+ l.children.push(n(u));
833
825
  });
834
826
  }), l;
835
827
  };
836
- return xe(t) || (t = Me(t)), o(t);
828
+ return xe(t) || (t = Be(t)), n(t);
829
+ }
830
+ function De(t, { ignoreFieldNorm: e = D.ignoreFieldNorm }) {
831
+ let s = 1;
832
+ t.matches.forEach(({ key: n, norm: a, score: r }) => {
833
+ const i = n ? n.weight : null;
834
+ s *= Math.pow(
835
+ r === 0 && i ? Number.EPSILON : r,
836
+ (i || 1) * (e ? 1 : a)
837
+ );
838
+ }), t.score = s;
837
839
  }
838
- function Gt(t, { ignoreFieldNorm: e = D.ignoreFieldNorm }) {
839
- t.forEach((n) => {
840
- let o = 1;
841
- n.matches.forEach(({ key: i, norm: r, score: a }) => {
842
- const l = i ? i.weight : null;
843
- o *= Math.pow(
844
- a === 0 && l ? Number.EPSILON : a,
845
- (l || 1) * (e ? 1 : r)
846
- );
847
- }), n.score = o;
840
+ function Yt(t, { ignoreFieldNorm: e = D.ignoreFieldNorm }) {
841
+ t.forEach((s) => {
842
+ De(s, { ignoreFieldNorm: e });
848
843
  });
849
844
  }
850
- function Yt(t, e) {
851
- const n = t.matches;
852
- e.matches = [], V(n) && n.forEach((o) => {
853
- if (!V(o.indices) || !o.indices.length)
845
+ class Qt {
846
+ constructor(e) {
847
+ this.limit = e, this.heap = [];
848
+ }
849
+ get size() {
850
+ return this.heap.length;
851
+ }
852
+ shouldInsert(e) {
853
+ return this.size < this.limit || e < this.heap[0].score;
854
+ }
855
+ insert(e) {
856
+ this.size < this.limit ? (this.heap.push(e), this._bubbleUp(this.size - 1)) : e.score < this.heap[0].score && (this.heap[0] = e, this._sinkDown(0));
857
+ }
858
+ extractSorted(e) {
859
+ return this.heap.sort(e);
860
+ }
861
+ _bubbleUp(e) {
862
+ const s = this.heap;
863
+ for (; e > 0; ) {
864
+ const n = e - 1 >> 1;
865
+ if (s[e].score <= s[n].score) break;
866
+ const a = s[e];
867
+ s[e] = s[n], s[n] = a, e = n;
868
+ }
869
+ }
870
+ _sinkDown(e) {
871
+ const s = this.heap, n = s.length;
872
+ let a = e;
873
+ do {
874
+ e = a;
875
+ const r = 2 * e + 1, i = 2 * e + 2;
876
+ if (r < n && s[r].score > s[a].score && (a = r), i < n && s[i].score > s[a].score && (a = i), a !== e) {
877
+ const l = s[e];
878
+ s[e] = s[a], s[a] = l;
879
+ }
880
+ } while (a !== e);
881
+ }
882
+ }
883
+ function Jt(t, e) {
884
+ const s = t.matches;
885
+ e.matches = [], P(s) && s.forEach((n) => {
886
+ if (!P(n.indices) || !n.indices.length)
854
887
  return;
855
- const { indices: i, value: r } = o;
856
- let a = {
857
- indices: i,
888
+ const { indices: a, value: r } = n;
889
+ let i = {
890
+ indices: a,
858
891
  value: r
859
892
  };
860
- o.key && (a.key = o.key.src), o.idx > -1 && (a.refIndex = o.idx), e.matches.push(a);
893
+ n.key && (i.key = n.key.src), n.idx > -1 && (i.refIndex = n.idx), e.matches.push(i);
861
894
  });
862
895
  }
863
- function Qt(t, e) {
896
+ function Xt(t, e) {
864
897
  e.score = t.score;
865
898
  }
866
- function Jt(t, e, {
867
- includeMatches: n = D.includeMatches,
868
- includeScore: o = D.includeScore
899
+ function Zt(t, e, {
900
+ includeMatches: s = D.includeMatches,
901
+ includeScore: n = D.includeScore
869
902
  } = {}) {
870
- const i = [];
871
- return n && i.push(Yt), o && i.push(Qt), t.map((r) => {
872
- const { idx: a } = r, l = {
873
- item: e[a],
874
- refIndex: a
903
+ const a = [];
904
+ return s && a.push(Jt), n && a.push(Xt), t.map((r) => {
905
+ const { idx: i } = r, l = {
906
+ item: e[i],
907
+ refIndex: i
875
908
  };
876
- return i.length && i.forEach((d) => {
877
- d(r, l);
909
+ return a.length && a.forEach((p) => {
910
+ p(r, l);
878
911
  }), l;
879
912
  });
880
913
  }
881
- class ee {
882
- constructor(e, n = {}, o) {
883
- this.options = { ...D, ...n }, this.options.useExtendedSearch, this._keyStore = new yt(this.options.keys), this.setCollection(e, o);
884
- }
885
- setCollection(e, n) {
886
- if (this._docs = e, n && !(n instanceof ye))
887
- throw new Error(vt);
888
- this._myIndex = n || je(this.options.keys, this._docs, {
914
+ class q {
915
+ constructor(e, s = {}, n) {
916
+ this.options = { ...D, ...s }, this.options.useExtendedSearch, this._keyStore = new yt(this.options.keys), this.setCollection(e, n), this._lastQuery = null, this._lastSearcher = null;
917
+ }
918
+ _getSearcher(e) {
919
+ if (this._lastQuery === e)
920
+ return this._lastSearcher;
921
+ const s = Pe(e, this.options);
922
+ return this._lastQuery = e, this._lastSearcher = s, s;
923
+ }
924
+ setCollection(e, s) {
925
+ if (this._docs = e, s && !(s instanceof ye))
926
+ throw new Error(ht);
927
+ this._myIndex = s || je(this.options.keys, this._docs, {
889
928
  getFn: this.options.getFn,
890
929
  fieldNormWeight: this.options.fieldNormWeight
891
930
  });
892
931
  }
893
932
  add(e) {
894
- V(e) && (this._docs.push(e), this._myIndex.add(e));
933
+ P(e) && (this._docs.push(e), this._myIndex.add(e));
895
934
  }
896
935
  remove(e = () => !1) {
897
- const n = [];
898
- for (let o = 0, i = this._docs.length; o < i; o += 1) {
899
- const r = this._docs[o];
900
- e(r, o) && (this.removeAt(o), o -= 1, i -= 1, n.push(r));
936
+ const s = [], n = [];
937
+ for (let a = 0, r = this._docs.length; a < r; a += 1)
938
+ e(this._docs[a], a) && (s.push(this._docs[a]), n.push(a));
939
+ if (n.length) {
940
+ for (let a = n.length - 1; a >= 0; a -= 1)
941
+ this._docs.splice(n[a], 1);
942
+ this._myIndex.removeAll(n);
901
943
  }
902
- return n;
944
+ return s;
903
945
  }
904
946
  removeAt(e) {
905
947
  this._docs.splice(e, 1), this._myIndex.removeAt(e);
@@ -907,126 +949,136 @@ class ee {
907
949
  getIndex() {
908
950
  return this._myIndex;
909
951
  }
910
- search(e, { limit: n = -1 } = {}) {
952
+ search(e, { limit: s = -1 } = {}) {
911
953
  const {
912
- includeMatches: o,
913
- includeScore: i,
954
+ includeMatches: n,
955
+ includeScore: a,
914
956
  shouldSort: r,
915
- sortFn: a,
957
+ sortFn: i,
916
958
  ignoreFieldNorm: l
917
- } = this.options;
918
- let d = H(e) ? H(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
919
- return Gt(d, { ignoreFieldNorm: l }), r && d.sort(a), Fe(n) && n > -1 && (d = d.slice(0, n)), Jt(d, this._docs, {
920
- includeMatches: o,
921
- includeScore: i
959
+ } = this.options, p = me(s) && s > 0 && z(e);
960
+ let o;
961
+ if (p) {
962
+ const u = new Qt(s);
963
+ z(this._docs[0]) ? this._searchStringList(e, { heap: u, ignoreFieldNorm: l }) : this._searchObjectList(e, { heap: u, ignoreFieldNorm: l }), o = u.extractSorted(i);
964
+ } else
965
+ o = z(e) ? z(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e), Yt(o, { ignoreFieldNorm: l }), r && o.sort(i), me(s) && s > -1 && (o = o.slice(0, s));
966
+ return Zt(o, this._docs, {
967
+ includeMatches: n,
968
+ includeScore: a
922
969
  });
923
970
  }
924
- _searchStringList(e) {
925
- const n = he(e, this.options), { records: o } = this._myIndex, i = [];
926
- return o.forEach(({ v: r, i: a, n: l }) => {
927
- if (!V(r))
971
+ _searchStringList(e, { heap: s, ignoreFieldNorm: n } = {}) {
972
+ const a = this._getSearcher(e), { records: r } = this._myIndex, i = s ? null : [];
973
+ return r.forEach(({ v: l, i: p, n: o }) => {
974
+ if (!P(l))
928
975
  return;
929
- const { isMatch: d, score: s, indices: p } = n.searchIn(r);
930
- d && i.push({
931
- item: r,
932
- idx: a,
933
- matches: [{ score: s, value: r, norm: l, indices: p }]
934
- });
976
+ const { isMatch: u, score: v, indices: b } = a.searchIn(l);
977
+ if (u) {
978
+ const h = {
979
+ item: l,
980
+ idx: p,
981
+ matches: [{ score: v, value: l, norm: o, indices: b }]
982
+ };
983
+ s ? (De(h, { ignoreFieldNorm: n }), s.shouldInsert(h.score) && s.insert(h)) : i.push(h);
984
+ }
935
985
  }), i;
936
986
  }
937
987
  _searchLogical(e) {
938
- const n = Le(e, this.options), o = (l, d, s) => {
988
+ const s = ze(e, this.options), n = (l, p, o) => {
939
989
  if (!l.children) {
940
- const { keyId: _, searcher: y } = l, v = this._findMatches({
941
- key: this._keyStore.get(_),
942
- value: this._myIndex.getValueForItemAtKeyId(d, _),
943
- searcher: y
990
+ const { keyId: v, searcher: b } = l, h = this._findMatches({
991
+ key: this._keyStore.get(v),
992
+ value: this._myIndex.getValueForItemAtKeyId(p, v),
993
+ searcher: b
944
994
  });
945
- return v && v.length ? [
995
+ return h && h.length ? [
946
996
  {
947
- idx: s,
948
- item: d,
949
- matches: v
997
+ idx: o,
998
+ item: p,
999
+ matches: h
950
1000
  }
951
1001
  ] : [];
952
1002
  }
953
- const p = [];
954
- for (let _ = 0, y = l.children.length; _ < y; _ += 1) {
955
- const v = l.children[_], c = o(v, d, s);
956
- if (c.length)
957
- p.push(...c);
958
- else if (l.operator === ae.AND)
1003
+ const u = [];
1004
+ for (let v = 0, b = l.children.length; v < b; v += 1) {
1005
+ const h = l.children[v], d = n(h, p, o);
1006
+ if (d.length)
1007
+ u.push(...d);
1008
+ else if (l.operator === re.AND)
959
1009
  return [];
960
1010
  }
961
- return p;
962
- }, i = this._myIndex.records, r = {}, a = [];
963
- return i.forEach(({ $: l, i: d }) => {
964
- if (V(l)) {
965
- let s = o(n, l, d);
966
- s.length && (r[d] || (r[d] = { idx: d, item: l, matches: [] }, a.push(r[d])), s.forEach(({ matches: p }) => {
967
- r[d].matches.push(...p);
1011
+ return u;
1012
+ }, a = this._myIndex.records, r = /* @__PURE__ */ new Map(), i = [];
1013
+ return a.forEach(({ $: l, i: p }) => {
1014
+ if (P(l)) {
1015
+ let o = n(s, l, p);
1016
+ o.length && (r.has(p) || (r.set(p, { idx: p, item: l, matches: [] }), i.push(r.get(p))), o.forEach(({ matches: u }) => {
1017
+ r.get(p).matches.push(...u);
968
1018
  }));
969
1019
  }
970
- }), a;
1020
+ }), i;
971
1021
  }
972
- _searchObjectList(e) {
973
- const n = he(e, this.options), { keys: o, records: i } = this._myIndex, r = [];
974
- return i.forEach(({ $: a, i: l }) => {
975
- if (!V(a))
1022
+ _searchObjectList(e, { heap: s, ignoreFieldNorm: n } = {}) {
1023
+ const a = this._getSearcher(e), { keys: r, records: i } = this._myIndex, l = s ? null : [];
1024
+ return i.forEach(({ $: p, i: o }) => {
1025
+ if (!P(p))
976
1026
  return;
977
- let d = [];
978
- o.forEach((s, p) => {
979
- d.push(
1027
+ let u = [];
1028
+ if (r.forEach((v, b) => {
1029
+ u.push(
980
1030
  ...this._findMatches({
981
- key: s,
982
- value: a[p],
983
- searcher: n
1031
+ key: v,
1032
+ value: p[b],
1033
+ searcher: a
984
1034
  })
985
1035
  );
986
- }), d.length && r.push({
987
- idx: l,
988
- item: a,
989
- matches: d
990
- });
991
- }), r;
1036
+ }), u.length) {
1037
+ const v = { idx: o, item: p, matches: u };
1038
+ s ? (De(v, { ignoreFieldNorm: n }), s.shouldInsert(v.score) && s.insert(v)) : l.push(v);
1039
+ }
1040
+ }), l;
992
1041
  }
993
- _findMatches({ key: e, value: n, searcher: o }) {
994
- if (!V(n))
1042
+ _findMatches({ key: e, value: s, searcher: n }) {
1043
+ if (!P(s))
995
1044
  return [];
996
- let i = [];
997
- if (W(n))
998
- n.forEach(({ v: r, i: a, n: l }) => {
999
- if (!V(r))
1045
+ let a = [];
1046
+ if (K(s))
1047
+ s.forEach(({ v: r, i, n: l }) => {
1048
+ if (!P(r))
1000
1049
  return;
1001
- const { isMatch: d, score: s, indices: p } = o.searchIn(r);
1002
- d && i.push({
1003
- score: s,
1050
+ const { isMatch: p, score: o, indices: u } = n.searchIn(r);
1051
+ p && a.push({
1052
+ score: o,
1004
1053
  key: e,
1005
1054
  value: r,
1006
- idx: a,
1055
+ idx: i,
1007
1056
  norm: l,
1008
- indices: p
1057
+ indices: u
1009
1058
  });
1010
1059
  });
1011
1060
  else {
1012
- const { v: r, n: a } = n, { isMatch: l, score: d, indices: s } = o.searchIn(r);
1013
- l && i.push({ score: d, key: e, value: r, norm: a, indices: s });
1061
+ const { v: r, n: i } = s, { isMatch: l, score: p, indices: o } = n.searchIn(r);
1062
+ l && a.push({ score: p, key: e, value: r, norm: i, indices: o });
1014
1063
  }
1015
- return i;
1064
+ return a;
1016
1065
  }
1017
1066
  }
1018
- ee.version = "7.1.0";
1019
- ee.createIndex = je;
1020
- ee.parseIndex = Mt;
1021
- ee.config = D;
1022
- ee.parseQuery = Le;
1023
- Ht(Ut);
1024
- const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1067
+ q.version = "7.2.0";
1068
+ q.createIndex = je;
1069
+ q.parseIndex = Bt;
1070
+ q.config = D;
1071
+ q.parseQuery = ze;
1072
+ Le(Wt);
1073
+ q.use = function(...t) {
1074
+ t.forEach((e) => Le(e));
1075
+ };
1076
+ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, qt = (t) => {
1025
1077
  if (!t) return "—";
1026
1078
  if (t < 60) return `${t} min`;
1027
- const e = Math.floor(t / 60), n = t % 60;
1028
- return n > 0 ? `${e}h ${n}min` : `${e}h`;
1029
- }, Zt = (t) => {
1079
+ const e = Math.floor(t / 60), s = t % 60;
1080
+ return s > 0 ? `${e}h ${s}min` : `${e}h`;
1081
+ }, es = (t) => {
1030
1082
  switch (t) {
1031
1083
  case "confirmed":
1032
1084
  return "Confirmed";
@@ -1039,7 +1091,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1039
1091
  default:
1040
1092
  return t || "Unknown";
1041
1093
  }
1042
- }, Be = (t) => {
1094
+ }, Fe = (t) => {
1043
1095
  switch (t) {
1044
1096
  case "confirmed":
1045
1097
  case "completed":
@@ -1054,8 +1106,8 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1054
1106
  default:
1055
1107
  return "#6b7280";
1056
1108
  }
1057
- }, qt = (t, e = {}) => {
1058
- const n = `${t.customerInfo?.firstName || ""} ${t.customerInfo?.lastName || ""}`.trim() || "Unknown Customer", o = t.id?.slice(0, 8) || "—", i = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
1109
+ }, ts = (t, e = {}) => {
1110
+ const s = `${t.customerInfo?.firstName || ""} ${t.customerInfo?.lastName || ""}`.trim() || "Unknown Customer", n = t.id?.slice(0, 8) || "—", a = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
1059
1111
  year: "numeric",
1060
1112
  month: "long",
1061
1113
  day: "numeric"
@@ -1065,7 +1117,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1065
1117
  <head>
1066
1118
  <meta charset="UTF-8">
1067
1119
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1068
- <title>Reservation ${o}</title>
1120
+ <title>Reservation ${n}</title>
1069
1121
  <style>
1070
1122
  * {
1071
1123
  margin: 0;
@@ -1276,12 +1328,12 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1276
1328
  </div>
1277
1329
  <div class="document-info">
1278
1330
  <div class="document-title">Reservation</div>
1279
- <div class="booking-id">Booking #${o}</div>
1331
+ <div class="booking-id">Booking #${n}</div>
1280
1332
  <div
1281
1333
  class="status-badge"
1282
- style="background-color: ${Be(t.status)}20; color: ${Be(t.status)};"
1334
+ style="background-color: ${Fe(t.status)}20; color: ${Fe(t.status)};"
1283
1335
  >
1284
- ${Zt(t.status)}
1336
+ ${es(t.status)}
1285
1337
  </div>
1286
1338
  </div>
1287
1339
  </div>
@@ -1289,7 +1341,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1289
1341
  <div class="section">
1290
1342
  <div class="section-title">Customer</div>
1291
1343
  <div class="section-content">
1292
- <div class="customer-name">${n}</div>
1344
+ <div class="customer-name">${s}</div>
1293
1345
  <div class="contact-info">
1294
1346
  ${t.customerInfo?.email ? `<div>Email: <a href="mailto:${t.customerInfo.email}">${t.customerInfo.email}</a></div>` : ""}
1295
1347
  ${t.customerInfo?.phone ? `<div>Phone: <a href="tel:${t.customerInfo.phone}">${t.customerInfo.phone}</a></div>` : ""}
@@ -1334,7 +1386,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1334
1386
  <div class="package-row">
1335
1387
  <div>
1336
1388
  <div class="package-name">${t.pricingOption.name}</div>
1337
- <div class="package-duration">${Xt(t.pricingOption.duration)}</div>
1389
+ <div class="package-duration">${qt(t.pricingOption.duration)}</div>
1338
1390
  </div>
1339
1391
  <div class="package-price">${Y(t.pricingOption.price)}</div>
1340
1392
  </div>
@@ -1390,141 +1442,141 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
1390
1442
  </div>
1391
1443
 
1392
1444
  <div class="footer">
1393
- <p>Generated on ${i}</p>
1445
+ <p>Generated on ${a}</p>
1394
1446
  ${e.companyName ? `<p>${e.companyName}</p>` : ""}
1395
1447
  </div>
1396
1448
  </body>
1397
1449
  </html>
1398
- `, a = window.open("", "_blank");
1399
- a && (a.document.write(r), a.document.close(), a.onload = () => {
1400
- a.print();
1450
+ `, i = window.open("", "_blank");
1451
+ i && (i.document.write(r), i.document.close(), i.onload = () => {
1452
+ i.print();
1401
1453
  });
1402
- }, en = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, tn = { class: "grid gap-2" }, nn = { class: "grid gap-2" }, sn = { class: "grid gap-2" }, on = /* @__PURE__ */ Z({
1454
+ }, ss = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, ns = { class: "grid gap-2" }, os = { class: "grid gap-2" }, as = { class: "grid gap-2" }, is = /* @__PURE__ */ te({
1403
1455
  __name: "CancelReservationDialog",
1404
1456
  emits: ["confirm"],
1405
- setup(t, { expose: e, emit: n }) {
1406
- const { config: o } = q(), { sendMail: i } = De(o.mailAccount), r = n, a = $(!1), l = $(!1), d = $(""), s = $(""), p = $(""), _ = (v) => {
1407
- l.value = !o.mailAccount, a.value = !0, v && (d.value = v.customerInfo?.email, s.value = "Cancellation of your reservation - " + new Date(v.date)?.toDateString(), p.value = `Dear ${v.customerInfo?.firstName ?? ""} ${v.customerInfo?.lastName ?? ""},
1457
+ setup(t, { expose: e, emit: s }) {
1458
+ const { config: n } = se(), { sendMail: a } = be(n.mailAccount), r = s, i = $(!1), l = $(!1), p = $(""), o = $(""), u = $(""), v = (h) => {
1459
+ l.value = !n.mailAccount, i.value = !0, h && (p.value = h.customerInfo?.email, o.value = "Cancellation of your reservation - " + new Date(h.date)?.toDateString(), u.value = `Dear ${h.customerInfo?.firstName ?? ""} ${h.customerInfo?.lastName ?? ""},
1408
1460
 
1409
- We are writing to inform you that your reservation scheduled for ${new Date(v.date)?.toDateString()} at ${v.startTime} has been cancelled.
1461
+ We are writing to inform you that your reservation scheduled for ${new Date(h.date)?.toDateString()} at ${h.startTime} has been cancelled.
1410
1462
 
1411
1463
  Please accept our sincere apologies for any inconvenience this may cause. We would be happy to help you find an alternative time that works for you.`);
1412
- }, y = () => {
1464
+ }, b = () => {
1413
1465
  if (!l.value) {
1414
- if (!d.value || !s.value || !p.value) return alert("Please fill in all the fields.");
1415
- i({
1416
- to: d.value,
1417
- subject: s.value,
1418
- body: p.value
1466
+ if (!p.value || !o.value || !u.value) return alert("Please fill in all the fields.");
1467
+ a({
1468
+ to: p.value,
1469
+ subject: o.value,
1470
+ body: u.value
1419
1471
  });
1420
1472
  }
1421
- a.value = !1;
1422
- const { $confetti: v } = useNuxtApp();
1423
- v(), r("confirm");
1473
+ i.value = !1;
1474
+ const { $confetti: h } = useNuxtApp();
1475
+ h(), r("confirm");
1424
1476
  };
1425
1477
  return e({
1426
- openDialog: _
1427
- }), (v, c) => {
1428
- const x = h("DialogTitle"), B = h("DialogDescription"), j = h("DialogHeader"), S = h("Checkbox"), w = h("Label"), M = h("Input"), U = h("Textarea"), L = h("Button"), k = h("DialogFooter"), T = h("DialogScrollContent"), O = h("Dialog");
1429
- return R(), J(O, {
1430
- open: a.value,
1431
- "onUpdate:open": c[5] || (c[5] = (C) => a.value = C)
1478
+ openDialog: v
1479
+ }), (h, d) => {
1480
+ const x = _("DialogTitle"), M = _("DialogDescription"), O = _("DialogHeader"), I = _("Checkbox"), w = _("Label"), B = _("Input"), N = _("Textarea"), H = _("Button"), V = _("DialogFooter"), E = _("DialogScrollContent"), j = _("Dialog");
1481
+ return R(), J(j, {
1482
+ open: i.value,
1483
+ "onUpdate:open": d[5] || (d[5] = (y) => i.value = y)
1432
1484
  }, {
1433
1485
  default: g(() => [
1434
- u(T, { class: "sm:max-w-3xl" }, {
1486
+ c(E, { class: "sm:max-w-3xl" }, {
1435
1487
  default: g(() => [
1436
- u(j, null, {
1488
+ c(O, null, {
1437
1489
  default: g(() => [
1438
- u(x, null, {
1439
- default: g(() => [...c[6] || (c[6] = [
1490
+ c(x, null, {
1491
+ default: g(() => [...d[6] || (d[6] = [
1440
1492
  A(" Cancel Reservation ", -1)
1441
1493
  ])]),
1442
1494
  _: 1
1443
1495
  }),
1444
- u(B)
1496
+ c(M)
1445
1497
  ]),
1446
1498
  _: 1
1447
1499
  }),
1448
- m("div", en, [
1449
- u(S, {
1500
+ m("div", ss, [
1501
+ c(I, {
1450
1502
  modelValue: l.value,
1451
- "onUpdate:modelValue": c[0] || (c[0] = (C) => l.value = C),
1503
+ "onUpdate:modelValue": d[0] || (d[0] = (y) => l.value = y),
1452
1504
  id: "cancel-dialog-skip-mail",
1453
1505
  class: "border-black/80 dark:border-gray-200",
1454
- disabled: !I(o).mailAccount
1506
+ disabled: !S(n).mailAccount
1455
1507
  }, null, 8, ["modelValue", "disabled"]),
1456
- u(w, {
1508
+ c(w, {
1457
1509
  for: "cancel-dialog-skip-mail",
1458
1510
  class: "py-4 pl-2 pr-4"
1459
1511
  }, {
1460
- default: g(() => [...c[7] || (c[7] = [
1512
+ default: g(() => [...d[7] || (d[7] = [
1461
1513
  A("Do not send email to customer", -1)
1462
1514
  ])]),
1463
1515
  _: 1
1464
1516
  })
1465
1517
  ]),
1466
1518
  m("div", {
1467
- class: ie(["grid gap-4 py-4", { "opacity-50": l.value }])
1519
+ class: le(["grid gap-4 py-4", { "opacity-50": l.value }])
1468
1520
  }, [
1469
- m("div", tn, [
1470
- u(w, { for: "cancel-dialog-email" }, {
1471
- default: g(() => [...c[8] || (c[8] = [
1521
+ m("div", ns, [
1522
+ c(w, { for: "cancel-dialog-email" }, {
1523
+ default: g(() => [...d[8] || (d[8] = [
1472
1524
  A("To:", -1)
1473
1525
  ])]),
1474
1526
  _: 1
1475
1527
  }),
1476
- u(M, {
1477
- modelValue: d.value,
1478
- "onUpdate:modelValue": c[1] || (c[1] = (C) => d.value = C),
1528
+ c(B, {
1529
+ modelValue: p.value,
1530
+ "onUpdate:modelValue": d[1] || (d[1] = (y) => p.value = y),
1479
1531
  disabled: l.value,
1480
1532
  id: "cancel-dialog-email"
1481
1533
  }, null, 8, ["modelValue", "disabled"])
1482
1534
  ]),
1483
- m("div", nn, [
1484
- u(w, { for: "cancel-dialog-subject" }, {
1485
- default: g(() => [...c[9] || (c[9] = [
1535
+ m("div", os, [
1536
+ c(w, { for: "cancel-dialog-subject" }, {
1537
+ default: g(() => [...d[9] || (d[9] = [
1486
1538
  A("Subject:", -1)
1487
1539
  ])]),
1488
1540
  _: 1
1489
1541
  }),
1490
- u(M, {
1491
- modelValue: s.value,
1492
- "onUpdate:modelValue": c[2] || (c[2] = (C) => s.value = C),
1542
+ c(B, {
1543
+ modelValue: o.value,
1544
+ "onUpdate:modelValue": d[2] || (d[2] = (y) => o.value = y),
1493
1545
  disabled: l.value,
1494
1546
  id: "cancel-dialog-subject"
1495
1547
  }, null, 8, ["modelValue", "disabled"])
1496
1548
  ]),
1497
- m("div", sn, [
1498
- u(w, { for: "cancel-dialog-body" }, {
1499
- default: g(() => [...c[10] || (c[10] = [
1549
+ m("div", as, [
1550
+ c(w, { for: "cancel-dialog-body" }, {
1551
+ default: g(() => [...d[10] || (d[10] = [
1500
1552
  A("Body:", -1)
1501
1553
  ])]),
1502
1554
  _: 1
1503
1555
  }),
1504
- u(U, {
1505
- modelValue: p.value,
1506
- "onUpdate:modelValue": c[3] || (c[3] = (C) => p.value = C),
1556
+ c(N, {
1557
+ modelValue: u.value,
1558
+ "onUpdate:modelValue": d[3] || (d[3] = (y) => u.value = y),
1507
1559
  disabled: l.value,
1508
1560
  id: "cancel-dialog-body"
1509
1561
  }, null, 8, ["modelValue", "disabled"])
1510
1562
  ])
1511
1563
  ], 2),
1512
- u(k, null, {
1564
+ c(V, null, {
1513
1565
  default: g(() => [
1514
- u(L, {
1566
+ c(H, {
1515
1567
  variant: "outline",
1516
- onClick: c[4] || (c[4] = (C) => a.value = !1)
1568
+ onClick: d[4] || (d[4] = (y) => i.value = !1)
1517
1569
  }, {
1518
- default: g(() => [...c[11] || (c[11] = [
1570
+ default: g(() => [...d[11] || (d[11] = [
1519
1571
  A("Close", -1)
1520
1572
  ])]),
1521
1573
  _: 1
1522
1574
  }),
1523
- u(L, {
1575
+ c(H, {
1524
1576
  variant: "destructive",
1525
- onClick: y
1577
+ onClick: b
1526
1578
  }, {
1527
- default: g(() => [...c[12] || (c[12] = [
1579
+ default: g(() => [...d[12] || (d[12] = [
1528
1580
  A("Cancel reservation", -1)
1529
1581
  ])]),
1530
1582
  _: 1
@@ -1540,51 +1592,51 @@ Please accept our sincere apologies for any inconvenience this may cause. We wou
1540
1592
  }, 8, ["open"]);
1541
1593
  };
1542
1594
  }
1543
- }), an = /* @__PURE__ */ Z({
1595
+ }), rs = /* @__PURE__ */ te({
1544
1596
  __name: "TransferReservationDialog",
1545
1597
  setup(t, { expose: e }) {
1546
- const { config: n } = q(), o = $(!1);
1598
+ const { config: s } = se(), n = $(!1);
1547
1599
  return e({
1548
1600
  openDialog: () => {
1549
- o.value = !0;
1601
+ n.value = !0;
1550
1602
  }
1551
- }), (r, a) => {
1552
- const l = h("DialogTitle"), d = h("DialogDescription"), s = h("DialogHeader"), p = h("Button"), _ = h("DialogFooter"), y = h("DialogScrollContent"), v = h("Dialog");
1553
- return R(), J(v, {
1554
- open: o.value,
1555
- "onUpdate:open": a[2] || (a[2] = (c) => o.value = c)
1603
+ }), (r, i) => {
1604
+ const l = _("DialogTitle"), p = _("DialogDescription"), o = _("DialogHeader"), u = _("Button"), v = _("DialogFooter"), b = _("DialogScrollContent"), h = _("Dialog");
1605
+ return R(), J(h, {
1606
+ open: n.value,
1607
+ "onUpdate:open": i[2] || (i[2] = (d) => n.value = d)
1556
1608
  }, {
1557
1609
  default: g(() => [
1558
- u(y, { class: "sm:max-w-3xl" }, {
1610
+ c(b, { class: "sm:max-w-3xl" }, {
1559
1611
  default: g(() => [
1560
- u(s, null, {
1612
+ c(o, null, {
1561
1613
  default: g(() => [
1562
- u(l, null, {
1563
- default: g(() => [...a[3] || (a[3] = [
1614
+ c(l, null, {
1615
+ default: g(() => [...i[3] || (i[3] = [
1564
1616
  A(" Transfer Reservation ", -1)
1565
1617
  ])]),
1566
1618
  _: 1
1567
1619
  }),
1568
- u(d)
1620
+ c(p)
1569
1621
  ]),
1570
1622
  _: 1
1571
1623
  }),
1572
- a[6] || (a[6] = m("div", { class: "py-4" }, null, -1)),
1573
- u(_, null, {
1624
+ i[6] || (i[6] = m("div", { class: "py-4" }, null, -1)),
1625
+ c(v, null, {
1574
1626
  default: g(() => [
1575
- u(p, {
1627
+ c(u, {
1576
1628
  variant: "outline",
1577
- onClick: a[0] || (a[0] = (c) => o.value = !1)
1629
+ onClick: i[0] || (i[0] = (d) => n.value = !1)
1578
1630
  }, {
1579
- default: g(() => [...a[4] || (a[4] = [
1631
+ default: g(() => [...i[4] || (i[4] = [
1580
1632
  A("Close", -1)
1581
1633
  ])]),
1582
1634
  _: 1
1583
1635
  }),
1584
- u(p, {
1585
- onClick: a[1] || (a[1] = (c) => o.value = !1)
1636
+ c(u, {
1637
+ onClick: i[1] || (i[1] = (d) => n.value = !1)
1586
1638
  }, {
1587
- default: g(() => [...a[5] || (a[5] = [
1639
+ default: g(() => [...i[5] || (i[5] = [
1588
1640
  A("Transfer reservation", -1)
1589
1641
  ])]),
1590
1642
  _: 1
@@ -1600,61 +1652,61 @@ Please accept our sincere apologies for any inconvenience this may cause. We wou
1600
1652
  }, 8, ["open"]);
1601
1653
  };
1602
1654
  }
1603
- }), rn = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, ln = { class: "grid gap-2" }, un = { class: "grid gap-2" }, cn = { class: "grid gap-2" }, dn = /* @__PURE__ */ Z({
1655
+ }), ls = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, us = { class: "grid gap-2" }, cs = { class: "grid gap-2" }, ds = { class: "grid gap-2" }, ps = /* @__PURE__ */ te({
1604
1656
  __name: "ApproveReservationDialog",
1605
1657
  emits: ["confirm"],
1606
- setup(t, { expose: e, emit: n }) {
1607
- const { config: o } = q(), { sendMail: i } = De(o.mailAccount), r = n, a = $(!1), l = $("approve"), d = $(!1), s = $(""), p = $(""), _ = $(""), y = (c, x) => {
1608
- d.value = !o.mailAccount, a.value = !0, c && (x || (x = "approve"), l.value = x, s.value = c.customerInfo?.email, p.value = "Confirmation: Your reservation for " + new Date(c.date)?.toDateString(), _.value = `Dear ${c.customerInfo?.firstName ?? ""} ${c.customerInfo?.lastName ?? ""},
1658
+ setup(t, { expose: e, emit: s }) {
1659
+ const { config: n } = se(), { sendMail: a } = be(n.mailAccount), r = s, i = $(!1), l = $("approve"), p = $(!1), o = $(""), u = $(""), v = $(""), b = (d, x) => {
1660
+ p.value = !n.mailAccount, i.value = !0, d && (x || (x = "approve"), l.value = x, o.value = d.customerInfo?.email, u.value = "Confirmation: Your reservation for " + new Date(d.date)?.toDateString(), v.value = `Dear ${d.customerInfo?.firstName ?? ""} ${d.customerInfo?.lastName ?? ""},
1609
1661
 
1610
- This email confirms your reservation for ${new Date(c.date)?.toDateString()} at ${c.startTime}.
1662
+ This email confirms your reservation for ${new Date(d.date)?.toDateString()} at ${d.startTime}.
1611
1663
 
1612
1664
  We've got everything ready for you and look forward to your visit! If you need to make any changes or have special requests, please let us know.`);
1613
- }, v = () => {
1614
- if (!d.value) {
1615
- if (!s.value || !p.value || !_.value) return alert("Please fill in all the fields.");
1616
- i({
1617
- to: s.value,
1618
- subject: p.value,
1619
- body: _.value
1665
+ }, h = () => {
1666
+ if (!p.value) {
1667
+ if (!o.value || !u.value || !v.value) return alert("Please fill in all the fields.");
1668
+ a({
1669
+ to: o.value,
1670
+ subject: u.value,
1671
+ body: v.value
1620
1672
  });
1621
1673
  }
1622
- a.value = !1;
1623
- const { $confetti: c } = useNuxtApp();
1624
- c(), r("confirm");
1674
+ i.value = !1;
1675
+ const { $confetti: d } = useNuxtApp();
1676
+ d(), r("confirm");
1625
1677
  };
1626
1678
  return e({
1627
- openDialog: y
1628
- }), (c, x) => {
1629
- const B = h("DialogTitle"), j = h("DialogDescription"), S = h("DialogHeader"), w = h("Checkbox"), M = h("Label"), U = h("Input"), L = h("Textarea"), k = h("Button"), T = h("DialogFooter"), O = h("DialogScrollContent"), C = h("Dialog");
1630
- return R(), J(C, {
1631
- open: a.value,
1632
- "onUpdate:open": x[5] || (x[5] = (N) => a.value = N)
1679
+ openDialog: b
1680
+ }), (d, x) => {
1681
+ const M = _("DialogTitle"), O = _("DialogDescription"), I = _("DialogHeader"), w = _("Checkbox"), B = _("Label"), N = _("Input"), H = _("Textarea"), V = _("Button"), E = _("DialogFooter"), j = _("DialogScrollContent"), y = _("Dialog");
1682
+ return R(), J(y, {
1683
+ open: i.value,
1684
+ "onUpdate:open": x[5] || (x[5] = (T) => i.value = T)
1633
1685
  }, {
1634
1686
  default: g(() => [
1635
- u(O, { class: "sm:max-w-3xl" }, {
1687
+ c(j, { class: "sm:max-w-3xl" }, {
1636
1688
  default: g(() => [
1637
- u(S, null, {
1689
+ c(I, null, {
1638
1690
  default: g(() => [
1639
- u(B, null, {
1691
+ c(M, null, {
1640
1692
  default: g(() => [
1641
1693
  A(F(l.value === "approve" ? "Approve Reservation" : "Resend Confirmation Email"), 1)
1642
1694
  ]),
1643
1695
  _: 1
1644
1696
  }),
1645
- u(j)
1697
+ c(O)
1646
1698
  ]),
1647
1699
  _: 1
1648
1700
  }),
1649
- m("div", rn, [
1650
- u(w, {
1651
- modelValue: d.value,
1652
- "onUpdate:modelValue": x[0] || (x[0] = (N) => d.value = N),
1701
+ m("div", ls, [
1702
+ c(w, {
1703
+ modelValue: p.value,
1704
+ "onUpdate:modelValue": x[0] || (x[0] = (T) => p.value = T),
1653
1705
  id: "reject-dialog-skip-mail",
1654
1706
  class: "border-black/80 dark:border-gray-200",
1655
- disabled: !I(o).mailAccount
1707
+ disabled: !S(n).mailAccount
1656
1708
  }, null, 8, ["modelValue", "disabled"]),
1657
- u(M, {
1709
+ c(B, {
1658
1710
  for: "reject-dialog-skip-mail",
1659
1711
  class: "py-4 pl-2 pr-4"
1660
1712
  }, {
@@ -1665,63 +1717,63 @@ We've got everything ready for you and look forward to your visit! If you need t
1665
1717
  })
1666
1718
  ]),
1667
1719
  m("div", {
1668
- class: ie(["grid gap-4 py-4", { "opacity-50": d.value }])
1720
+ class: le(["grid gap-4 py-4", { "opacity-50": p.value }])
1669
1721
  }, [
1670
- m("div", ln, [
1671
- u(M, { for: "approve-dialog-email" }, {
1722
+ m("div", us, [
1723
+ c(B, { for: "approve-dialog-email" }, {
1672
1724
  default: g(() => [...x[7] || (x[7] = [
1673
1725
  A("To:", -1)
1674
1726
  ])]),
1675
1727
  _: 1
1676
1728
  }),
1677
- u(U, {
1678
- modelValue: s.value,
1679
- "onUpdate:modelValue": x[1] || (x[1] = (N) => s.value = N),
1680
- disabled: d.value,
1729
+ c(N, {
1730
+ modelValue: o.value,
1731
+ "onUpdate:modelValue": x[1] || (x[1] = (T) => o.value = T),
1732
+ disabled: p.value,
1681
1733
  id: "approve-dialog-email"
1682
1734
  }, null, 8, ["modelValue", "disabled"])
1683
1735
  ]),
1684
- m("div", un, [
1685
- u(M, { for: "approve-dialog-subject" }, {
1736
+ m("div", cs, [
1737
+ c(B, { for: "approve-dialog-subject" }, {
1686
1738
  default: g(() => [...x[8] || (x[8] = [
1687
1739
  A("Subject:", -1)
1688
1740
  ])]),
1689
1741
  _: 1
1690
1742
  }),
1691
- u(U, {
1692
- modelValue: p.value,
1693
- "onUpdate:modelValue": x[2] || (x[2] = (N) => p.value = N),
1694
- disabled: d.value,
1743
+ c(N, {
1744
+ modelValue: u.value,
1745
+ "onUpdate:modelValue": x[2] || (x[2] = (T) => u.value = T),
1746
+ disabled: p.value,
1695
1747
  id: "approve-dialog-subject"
1696
1748
  }, null, 8, ["modelValue", "disabled"])
1697
1749
  ]),
1698
- m("div", cn, [
1699
- u(M, { for: "approve-dialog-body" }, {
1750
+ m("div", ds, [
1751
+ c(B, { for: "approve-dialog-body" }, {
1700
1752
  default: g(() => [...x[9] || (x[9] = [
1701
1753
  A("Body:", -1)
1702
1754
  ])]),
1703
1755
  _: 1
1704
1756
  }),
1705
- u(L, {
1706
- modelValue: _.value,
1707
- "onUpdate:modelValue": x[3] || (x[3] = (N) => _.value = N),
1708
- disabled: d.value,
1757
+ c(H, {
1758
+ modelValue: v.value,
1759
+ "onUpdate:modelValue": x[3] || (x[3] = (T) => v.value = T),
1760
+ disabled: p.value,
1709
1761
  id: "approve-dialog-body"
1710
1762
  }, null, 8, ["modelValue", "disabled"])
1711
1763
  ])
1712
1764
  ], 2),
1713
- u(T, null, {
1765
+ c(E, null, {
1714
1766
  default: g(() => [
1715
- u(k, {
1767
+ c(V, {
1716
1768
  variant: "outline",
1717
- onClick: x[4] || (x[4] = (N) => a.value = !1)
1769
+ onClick: x[4] || (x[4] = (T) => i.value = !1)
1718
1770
  }, {
1719
1771
  default: g(() => [...x[10] || (x[10] = [
1720
1772
  A("Close", -1)
1721
1773
  ])]),
1722
1774
  _: 1
1723
1775
  }),
1724
- u(k, { onClick: v }, {
1776
+ c(V, { onClick: h }, {
1725
1777
  default: g(() => [...x[11] || (x[11] = [
1726
1778
  A("Approve reservation", -1)
1727
1779
  ])]),
@@ -1738,132 +1790,132 @@ We've got everything ready for you and look forward to your visit! If you need t
1738
1790
  }, 8, ["open"]);
1739
1791
  };
1740
1792
  }
1741
- }), pn = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, fn = { class: "grid gap-2" }, mn = { class: "grid gap-2" }, gn = { class: "grid gap-2" }, vn = /* @__PURE__ */ Z({
1793
+ }), fs = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, ms = { class: "grid gap-2" }, gs = { class: "grid gap-2" }, vs = { class: "grid gap-2" }, hs = /* @__PURE__ */ te({
1742
1794
  __name: "RejectReservationDialog",
1743
1795
  emits: ["confirm"],
1744
- setup(t, { expose: e, emit: n }) {
1745
- const { config: o } = q(), { sendMail: i } = De(o.mailAccount), r = n, a = $(!1), l = $(!1), d = $(""), s = $(""), p = $(""), _ = (v) => {
1746
- l.value = !o.mailAccount, a.value = !0, v && (d.value = v.customerInfo?.email, s.value = "Regarding your reservation request for " + new Date(v.date)?.toDateString(), p.value = `Dear ${v.customerInfo?.firstName ?? ""} ${v.customerInfo?.lastName ?? ""},
1796
+ setup(t, { expose: e, emit: s }) {
1797
+ const { config: n } = se(), { sendMail: a } = be(n.mailAccount), r = s, i = $(!1), l = $(!1), p = $(""), o = $(""), u = $(""), v = (h) => {
1798
+ l.value = !n.mailAccount, i.value = !0, h && (p.value = h.customerInfo?.email, o.value = "Regarding your reservation request for " + new Date(h.date)?.toDateString(), u.value = `Dear ${h.customerInfo?.firstName ?? ""} ${h.customerInfo?.lastName ?? ""},
1747
1799
 
1748
- Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(v.date)?.toDateString()} at ${v.startTime}.
1800
+ Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(h.date)?.toDateString()} at ${h.startTime}.
1749
1801
 
1750
1802
  We would love to see you another time!`);
1751
- }, y = () => {
1803
+ }, b = () => {
1752
1804
  if (!l.value) {
1753
- if (!d.value || !s.value || !p.value) return alert("Please fill in all the fields.");
1754
- i({
1755
- to: d.value,
1756
- subject: s.value,
1757
- body: p.value
1805
+ if (!p.value || !o.value || !u.value) return alert("Please fill in all the fields.");
1806
+ a({
1807
+ to: p.value,
1808
+ subject: o.value,
1809
+ body: u.value
1758
1810
  });
1759
1811
  }
1760
- a.value = !1;
1761
- const { $confetti: v } = useNuxtApp();
1762
- v(), r("confirm");
1812
+ i.value = !1;
1813
+ const { $confetti: h } = useNuxtApp();
1814
+ h(), r("confirm");
1763
1815
  };
1764
1816
  return e({
1765
- openDialog: _
1766
- }), (v, c) => {
1767
- const x = h("DialogTitle"), B = h("DialogDescription"), j = h("DialogHeader"), S = h("Checkbox"), w = h("Label"), M = h("Input"), U = h("Textarea"), L = h("Button"), k = h("DialogFooter"), T = h("DialogScrollContent"), O = h("Dialog");
1768
- return R(), J(O, {
1769
- open: a.value,
1770
- "onUpdate:open": c[5] || (c[5] = (C) => a.value = C)
1817
+ openDialog: v
1818
+ }), (h, d) => {
1819
+ const x = _("DialogTitle"), M = _("DialogDescription"), O = _("DialogHeader"), I = _("Checkbox"), w = _("Label"), B = _("Input"), N = _("Textarea"), H = _("Button"), V = _("DialogFooter"), E = _("DialogScrollContent"), j = _("Dialog");
1820
+ return R(), J(j, {
1821
+ open: i.value,
1822
+ "onUpdate:open": d[5] || (d[5] = (y) => i.value = y)
1771
1823
  }, {
1772
1824
  default: g(() => [
1773
- u(T, { class: "sm:max-w-3xl" }, {
1825
+ c(E, { class: "sm:max-w-3xl" }, {
1774
1826
  default: g(() => [
1775
- u(j, null, {
1827
+ c(O, null, {
1776
1828
  default: g(() => [
1777
- u(x, null, {
1778
- default: g(() => [...c[6] || (c[6] = [
1829
+ c(x, null, {
1830
+ default: g(() => [...d[6] || (d[6] = [
1779
1831
  A(" Reject Reservation Request ", -1)
1780
1832
  ])]),
1781
1833
  _: 1
1782
1834
  }),
1783
- u(B)
1835
+ c(M)
1784
1836
  ]),
1785
1837
  _: 1
1786
1838
  }),
1787
- m("div", pn, [
1788
- u(S, {
1839
+ m("div", fs, [
1840
+ c(I, {
1789
1841
  modelValue: l.value,
1790
- "onUpdate:modelValue": c[0] || (c[0] = (C) => l.value = C),
1842
+ "onUpdate:modelValue": d[0] || (d[0] = (y) => l.value = y),
1791
1843
  id: "reject-dialog-skip-mail",
1792
1844
  class: "border-black/80 dark:border-gray-200",
1793
- disabled: !I(o).mailAccount
1845
+ disabled: !S(n).mailAccount
1794
1846
  }, null, 8, ["modelValue", "disabled"]),
1795
- u(w, {
1847
+ c(w, {
1796
1848
  for: "reject-dialog-skip-mail",
1797
1849
  class: "py-4 pl-2 pr-4"
1798
1850
  }, {
1799
- default: g(() => [...c[7] || (c[7] = [
1851
+ default: g(() => [...d[7] || (d[7] = [
1800
1852
  A("Do not send email to customer", -1)
1801
1853
  ])]),
1802
1854
  _: 1
1803
1855
  })
1804
1856
  ]),
1805
1857
  m("div", {
1806
- class: ie(["grid gap-4 py-4", { "opacity-50": l.value }])
1858
+ class: le(["grid gap-4 py-4", { "opacity-50": l.value }])
1807
1859
  }, [
1808
- m("div", fn, [
1809
- u(w, { for: "reject-dialog-email" }, {
1810
- default: g(() => [...c[8] || (c[8] = [
1860
+ m("div", ms, [
1861
+ c(w, { for: "reject-dialog-email" }, {
1862
+ default: g(() => [...d[8] || (d[8] = [
1811
1863
  A("To:", -1)
1812
1864
  ])]),
1813
1865
  _: 1
1814
1866
  }),
1815
- u(M, {
1816
- modelValue: d.value,
1817
- "onUpdate:modelValue": c[1] || (c[1] = (C) => d.value = C),
1867
+ c(B, {
1868
+ modelValue: p.value,
1869
+ "onUpdate:modelValue": d[1] || (d[1] = (y) => p.value = y),
1818
1870
  disabled: l.value,
1819
1871
  id: "reject-dialog-email"
1820
1872
  }, null, 8, ["modelValue", "disabled"])
1821
1873
  ]),
1822
- m("div", mn, [
1823
- u(w, { for: "reject-dialog-subject" }, {
1824
- default: g(() => [...c[9] || (c[9] = [
1874
+ m("div", gs, [
1875
+ c(w, { for: "reject-dialog-subject" }, {
1876
+ default: g(() => [...d[9] || (d[9] = [
1825
1877
  A("Subject:", -1)
1826
1878
  ])]),
1827
1879
  _: 1
1828
1880
  }),
1829
- u(M, {
1830
- modelValue: s.value,
1831
- "onUpdate:modelValue": c[2] || (c[2] = (C) => s.value = C),
1881
+ c(B, {
1882
+ modelValue: o.value,
1883
+ "onUpdate:modelValue": d[2] || (d[2] = (y) => o.value = y),
1832
1884
  disabled: l.value,
1833
1885
  id: "reject-dialog-subject"
1834
1886
  }, null, 8, ["modelValue", "disabled"])
1835
1887
  ]),
1836
- m("div", gn, [
1837
- u(w, { for: "reject-dialog-body" }, {
1838
- default: g(() => [...c[10] || (c[10] = [
1888
+ m("div", vs, [
1889
+ c(w, { for: "reject-dialog-body" }, {
1890
+ default: g(() => [...d[10] || (d[10] = [
1839
1891
  A("Body:", -1)
1840
1892
  ])]),
1841
1893
  _: 1
1842
1894
  }),
1843
- u(U, {
1844
- modelValue: p.value,
1845
- "onUpdate:modelValue": c[3] || (c[3] = (C) => p.value = C),
1895
+ c(N, {
1896
+ modelValue: u.value,
1897
+ "onUpdate:modelValue": d[3] || (d[3] = (y) => u.value = y),
1846
1898
  disabled: l.value,
1847
1899
  id: "reject-dialog-body"
1848
1900
  }, null, 8, ["modelValue", "disabled"])
1849
1901
  ])
1850
1902
  ], 2),
1851
- u(k, null, {
1903
+ c(V, null, {
1852
1904
  default: g(() => [
1853
- u(L, {
1905
+ c(H, {
1854
1906
  variant: "outline",
1855
- onClick: c[4] || (c[4] = (C) => a.value = !1)
1907
+ onClick: d[4] || (d[4] = (y) => i.value = !1)
1856
1908
  }, {
1857
- default: g(() => [...c[11] || (c[11] = [
1909
+ default: g(() => [...d[11] || (d[11] = [
1858
1910
  A("Close", -1)
1859
1911
  ])]),
1860
1912
  _: 1
1861
1913
  }),
1862
- u(L, {
1914
+ c(H, {
1863
1915
  variant: "destructive",
1864
- onClick: y
1916
+ onClick: b
1865
1917
  }, {
1866
- default: g(() => [...c[12] || (c[12] = [
1918
+ default: g(() => [...d[12] || (d[12] = [
1867
1919
  A("Reject reservation", -1)
1868
1920
  ])]),
1869
1921
  _: 1
@@ -1879,43 +1931,43 @@ We would love to see you another time!`);
1879
1931
  }, 8, ["open"]);
1880
1932
  };
1881
1933
  }
1882
- }), hn = {
1934
+ }), _s = {
1883
1935
  key: 0,
1884
1936
  class: "space-y-6 py-4"
1885
- }, _n = { class: "space-y-3" }, xn = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, Dn = { class: "flex items-center gap-3" }, yn = { class: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center" }, bn = { class: "font-medium" }, An = { class: "grid gap-2 text-sm" }, Cn = {
1937
+ }, xs = { class: "space-y-3" }, Ds = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, bs = { class: "flex items-center gap-3" }, ys = { class: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center" }, As = { class: "font-medium" }, Cs = { class: "grid gap-2 text-sm" }, ws = {
1886
1938
  key: 0,
1887
1939
  class: "flex items-center gap-2 text-muted-foreground"
1888
- }, wn = ["href"], kn = {
1940
+ }, ks = ["href"], Es = {
1889
1941
  key: 1,
1890
1942
  class: "flex items-center gap-2 text-muted-foreground"
1891
- }, En = ["href"], $n = { class: "space-y-3" }, Mn = { class: "grid grid-cols-2 gap-3" }, Bn = { class: "bg-muted/30 rounded-lg p-3" }, Fn = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, In = { class: "font-medium" }, Rn = { class: "bg-muted/30 rounded-lg p-3" }, Sn = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, jn = { class: "font-medium" }, Tn = {
1943
+ }, $s = ["href"], Ms = { class: "space-y-3" }, Bs = { class: "grid grid-cols-2 gap-3" }, Fs = { class: "bg-muted/30 rounded-lg p-3" }, Ss = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, Rs = { class: "font-medium" }, Is = { class: "bg-muted/30 rounded-lg p-3" }, js = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, Ts = { class: "font-medium" }, Os = {
1892
1944
  key: 0,
1893
1945
  class: "space-y-3"
1894
- }, On = { class: "bg-muted/30 rounded-lg p-4" }, Nn = { class: "flex items-start justify-between" }, Ln = { class: "flex items-start gap-3" }, Pn = { class: "h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5" }, Vn = { class: "font-medium" }, zn = { class: "text-sm text-muted-foreground" }, Un = { class: "font-semibold" }, Hn = { class: "space-y-3" }, Wn = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, Kn = { class: "space-y-2 text-sm" }, Gn = { class: "flex justify-between" }, Yn = {
1946
+ }, Ns = { class: "bg-muted/30 rounded-lg p-4" }, Ls = { class: "flex items-start justify-between" }, Ps = { class: "flex items-start gap-3" }, zs = { class: "h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5" }, Vs = { class: "font-medium" }, Us = { class: "text-sm text-muted-foreground" }, Hs = { class: "font-semibold" }, Ws = { class: "space-y-3" }, Ks = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, Gs = { class: "space-y-2 text-sm" }, Ys = { class: "flex justify-between" }, Qs = {
1895
1947
  key: 0,
1896
1948
  class: "flex justify-between"
1897
- }, Qn = {
1949
+ }, Js = {
1898
1950
  key: 1,
1899
1951
  class: "flex justify-between text-green-600 dark:text-green-400"
1900
- }, Jn = { class: "flex justify-between font-semibold" }, Xn = {
1952
+ }, Xs = { class: "flex justify-between font-semibold" }, Zs = {
1901
1953
  key: 1,
1902
1954
  class: "space-y-2 text-sm"
1903
- }, Zn = {
1955
+ }, qs = {
1904
1956
  key: 0,
1905
1957
  class: "flex justify-between"
1906
- }, qn = { class: "text-muted-foreground flex items-center gap-1.5" }, es = { class: "text-green-600 dark:text-green-400" }, ts = {
1958
+ }, en = { class: "text-muted-foreground flex items-center gap-1.5" }, tn = { class: "text-green-600 dark:text-green-400" }, sn = {
1907
1959
  key: 1,
1908
1960
  class: "flex justify-between"
1909
- }, ns = { class: "text-muted-foreground flex items-center gap-1.5" }, ss = { class: "text-orange-600 dark:text-orange-400 font-medium" }, ls = /* @__PURE__ */ Z({
1961
+ }, nn = { class: "text-muted-foreground flex items-center gap-1.5" }, on = { class: "text-orange-600 dark:text-orange-400 font-medium" }, cn = /* @__PURE__ */ te({
1910
1962
  __name: "ReservationDetailDialog",
1911
1963
  emits: ["cancelled", "confirmed", "rejected"],
1912
- setup(t, { expose: e, emit: n }) {
1913
- const { hasPermission: o } = ct(), { config: i } = q(), r = dt(i.project), a = Ye("event", $(null)), l = n, d = $(!1), s = $(null), p = $(!1), _ = ne("cancelReservationDialog"), y = ne("approveReservationDialog"), v = ne("rejectReservationDialog"), c = ne("transferReservationDialog"), x = (b) => {
1914
- s.value = b, d.value = !0;
1915
- }, B = de(() => s.value?.customerInfo && `${s.value.customerInfo.firstName} ${s.value.customerInfo.lastName}`.trim() || "Unknown Customer"), j = de(() => {
1916
- let b = s.value?.status;
1917
- const f = s.value?.reservationStatus;
1918
- switch (["needs_approval", "rejected", "approved", "cancelled"].includes(f) && (b = f), b) {
1964
+ setup(t, { expose: e, emit: s }) {
1965
+ const { hasPermission: n } = pt(), { config: a } = se(), r = ft(a.project), i = Je("event", $(null)), l = s, p = $(!1), o = $(null), u = $(!1), v = oe("cancelReservationDialog"), b = oe("approveReservationDialog"), h = oe("rejectReservationDialog"), d = oe("transferReservationDialog"), x = (C) => {
1966
+ o.value = C, p.value = !0;
1967
+ }, M = pe(() => o.value?.customerInfo && `${o.value.customerInfo.firstName} ${o.value.customerInfo.lastName}`.trim() || "Unknown Customer"), O = pe(() => {
1968
+ let C = o.value?.status;
1969
+ const f = o.value?.reservationStatus;
1970
+ switch (["needs_approval", "rejected", "approved", "cancelled"].includes(f) && (C = f), C) {
1919
1971
  case "needs_approval":
1920
1972
  return { label: "Needs Approval", class: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400" };
1921
1973
  case "rejected":
@@ -1927,264 +1979,264 @@ We would love to see you another time!`);
1927
1979
  case "cancelled":
1928
1980
  return { label: "Cancelled", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
1929
1981
  default:
1930
- return { label: b || "Unknown", class: "bg-muted text-muted-foreground" };
1982
+ return { label: C || "Unknown", class: "bg-muted text-muted-foreground" };
1931
1983
  }
1932
- }), S = de(() => s.value?.status === "cancelled"), w = (b) => b == null || typeof b != "number" ? "—" : `€${b?.toFixed(2)}`, M = (b) => {
1933
- if (!b) return "—";
1934
- if (b < 60) return `${b} min`;
1935
- const f = Math.floor(b / 60), E = b % 60;
1936
- return E > 0 ? `${f}h ${E}min` : `${f}h`;
1937
- }, U = () => {
1938
- if (!s.value) return;
1939
- let b = "";
1940
- const f = a?.value?.date;
1984
+ }), I = pe(() => o.value?.status === "cancelled"), w = (C) => C == null || typeof C != "number" ? "—" : `€${C?.toFixed(2)}`, B = (C) => {
1985
+ if (!C) return "—";
1986
+ if (C < 60) return `${C} min`;
1987
+ const f = Math.floor(C / 60), k = C % 60;
1988
+ return k > 0 ? `${f}h ${k}min` : `${f}h`;
1989
+ }, N = () => {
1990
+ if (!o.value) return;
1991
+ let C = "";
1992
+ const f = i?.value?.date;
1941
1993
  if (f)
1942
1994
  try {
1943
- b = new Date(f).toLocaleDateString("en-US", {
1995
+ C = new Date(f).toLocaleDateString("en-US", {
1944
1996
  weekday: "long",
1945
1997
  year: "numeric",
1946
1998
  month: "long",
1947
1999
  day: "numeric"
1948
2000
  });
1949
2001
  } catch {
1950
- b = f;
2002
+ C = f;
1951
2003
  }
1952
- const E = {
1953
- date: b,
1954
- resourceName: a?.value?.resource?.name
2004
+ const k = {
2005
+ date: C,
2006
+ resourceName: i?.value?.resource?.name
1955
2007
  };
1956
- qt(s.value, E);
1957
- }, L = () => {
1958
- y.value?.openDialog(s.value);
1959
- }, k = () => {
1960
- v.value?.openDialog(s.value);
1961
- }, T = () => {
1962
- y.value?.openDialog(s.value);
1963
- }, O = () => {
1964
- _.value?.openDialog(s.value);
1965
- }, C = async () => {
2008
+ ts(o.value, k);
2009
+ }, H = () => {
2010
+ b.value?.openDialog(o.value);
2011
+ }, V = () => {
2012
+ h.value?.openDialog(o.value);
2013
+ }, E = () => {
2014
+ b.value?.openDialog(o.value);
2015
+ }, j = () => {
2016
+ v.value?.openDialog(o.value);
2017
+ }, y = async () => {
1966
2018
  try {
1967
- if (p.value || !s.value?.id) throw new Error("Invalid state");
1968
- p.value = !0;
1969
- let f = (await r.get(i.reservationsCollection, s.value.id))?.reservations || [];
1970
- if (!f.find((E) => E.id === s.value.res_id))
2019
+ if (u.value || !o.value?.id) throw new Error("Invalid state");
2020
+ u.value = !0;
2021
+ let f = (await r.get(a.reservationsCollection, o.value.id))?.reservations || [];
2022
+ if (!f.find((k) => k.id === o.value.res_id))
1971
2023
  throw new Error("Reservation not found");
1972
- f.find((E) => E.id === s.value.res_id).status = "cancelled", await r.update(i.reservationsCollection, s.value.id, {
2024
+ f.find((k) => k.id === o.value.res_id).status = "cancelled", await r.update(a.reservationsCollection, o.value.id, {
1973
2025
  reservations: f
1974
- }), s.value.status = "cancelled", X.success("Reservation cancelled successfully"), l("cancelled"), d.value = !1;
1975
- } catch (b) {
1976
- console.error("Error cancelling reservation:", b), X.error("Failed to cancel reservation");
2026
+ }), o.value.status = "cancelled", Z.success("Reservation cancelled successfully"), l("cancelled"), p.value = !1;
2027
+ } catch (C) {
2028
+ console.error("Error cancelling reservation:", C), Z.error("Failed to cancel reservation");
1977
2029
  } finally {
1978
- p.value = !1;
2030
+ u.value = !1;
1979
2031
  }
1980
- }, N = async () => {
2032
+ }, T = async () => {
1981
2033
  try {
1982
- if (p.value || !s.value?.id) throw new Error("Invalid state");
1983
- p.value = !0;
1984
- let f = (await r.get(i.reservationsCollection, s.value.id))?.reservations || [];
1985
- if (!f.find((E) => E.id === s.value.res_id))
2034
+ if (u.value || !o.value?.id) throw new Error("Invalid state");
2035
+ u.value = !0;
2036
+ let f = (await r.get(a.reservationsCollection, o.value.id))?.reservations || [];
2037
+ if (!f.find((k) => k.id === o.value.res_id))
1986
2038
  throw new Error("Reservation not found");
1987
- f.find((E) => E.id === s.value.res_id).status = "approved", await r.update(i.reservationsCollection, s.value.id, {
2039
+ f.find((k) => k.id === o.value.res_id).status = "approved", await r.update(a.reservationsCollection, o.value.id, {
1988
2040
  reservations: f
1989
- }), s.value.status = "approved", X.success("Reservation approved successfully"), l("confirmed"), d.value = !1;
1990
- } catch (b) {
1991
- console.error("Error approving reservation:", b), X.error("Failed to approve reservation");
2041
+ }), o.value.status = "approved", Z.success("Reservation approved successfully"), l("confirmed"), p.value = !1;
2042
+ } catch (C) {
2043
+ console.error("Error approving reservation:", C), Z.error("Failed to approve reservation");
1992
2044
  } finally {
1993
- p.value = !1;
2045
+ u.value = !1;
1994
2046
  }
1995
- }, K = async () => {
2047
+ }, ee = async () => {
1996
2048
  try {
1997
- if (p.value || !s.value?.id) throw new Error("Invalid state");
1998
- p.value = !0;
1999
- let f = (await r.get(i.reservationsCollection, s.value.id))?.reservations || [];
2000
- if (!f.find((E) => E.id === s.value.res_id))
2049
+ if (u.value || !o.value?.id) throw new Error("Invalid state");
2050
+ u.value = !0;
2051
+ let f = (await r.get(a.reservationsCollection, o.value.id))?.reservations || [];
2052
+ if (!f.find((k) => k.id === o.value.res_id))
2001
2053
  throw new Error("Reservation not found");
2002
- f.find((E) => E.id === s.value.res_id).status = "rejected", await r.update(i.reservationsCollection, s.value.id, {
2054
+ f.find((k) => k.id === o.value.res_id).status = "rejected", await r.update(a.reservationsCollection, o.value.id, {
2003
2055
  reservations: f
2004
- }), s.value.status = "rejected", X.success("Reservation rejected successfully"), l("rejected"), d.value = !1;
2005
- } catch (b) {
2006
- console.error("Error rejecting reservation:", b), X.error("Failed to reject reservation");
2056
+ }), o.value.status = "rejected", Z.success("Reservation rejected successfully"), l("rejected"), p.value = !1;
2057
+ } catch (C) {
2058
+ console.error("Error rejecting reservation:", C), Z.error("Failed to reject reservation");
2007
2059
  } finally {
2008
- p.value = !1;
2060
+ u.value = !1;
2009
2061
  }
2010
- }, be = () => {
2062
+ }, W = () => {
2011
2063
  };
2012
2064
  return e({
2013
2065
  openDialog: x
2014
- }), (b, f) => {
2015
- const E = h("DialogTitle"), re = h("DialogDescription"), Pe = h("DialogHeader"), Ae = h("Separator"), le = h("Button"), Ve = h("DropdownMenuTrigger"), ue = h("DropdownMenuLabel"), te = h("DropdownMenuItem"), ce = h("DropdownMenuGroup"), Ce = h("DropdownMenuSeparator"), ze = h("DropdownMenuContent"), Ue = h("DropdownMenu"), He = h("DialogFooter"), We = h("DialogScrollContent"), Ke = h("Dialog");
2016
- return R(), z(pe, null, [
2017
- u(Ke, {
2018
- open: d.value,
2019
- "onUpdate:open": f[0] || (f[0] = (Ge) => d.value = Ge)
2066
+ }), (C, f) => {
2067
+ const k = _("DialogTitle"), X = _("DialogDescription"), Ve = _("DialogHeader"), Ae = _("Separator"), ue = _("Button"), Ue = _("DropdownMenuTrigger"), ce = _("DropdownMenuLabel"), ne = _("DropdownMenuItem"), de = _("DropdownMenuGroup"), Ce = _("DropdownMenuSeparator"), He = _("DropdownMenuContent"), We = _("DropdownMenu"), Ke = _("DialogFooter"), Ge = _("DialogScrollContent"), Ye = _("Dialog");
2068
+ return R(), U(fe, null, [
2069
+ c(Ye, {
2070
+ open: p.value,
2071
+ "onUpdate:open": f[0] || (f[0] = (Qe) => p.value = Qe)
2020
2072
  }, {
2021
2073
  default: g(() => [
2022
- u(We, { class: "sm:max-w-xl" }, {
2074
+ c(Ge, { class: "sm:max-w-xl" }, {
2023
2075
  default: g(() => [
2024
- u(Pe, null, {
2076
+ c(Ve, null, {
2025
2077
  default: g(() => [
2026
- u(E, { class: "flex items-center gap-3" }, {
2078
+ c(k, { class: "flex items-center gap-3" }, {
2027
2079
  default: g(() => [
2028
2080
  f[1] || (f[1] = m("span", null, "Reservation Details", -1)),
2029
2081
  m("span", {
2030
- class: ie(["px-2.5 py-1 text-xs font-medium rounded-full", j.value.class])
2031
- }, F(j.value.label), 3)
2082
+ class: le(["px-2.5 py-1 text-xs font-medium rounded-full", O.value.class])
2083
+ }, F(O.value.label), 3)
2032
2084
  ]),
2033
2085
  _: 1
2034
2086
  }),
2035
- u(re, null, {
2087
+ c(X, null, {
2036
2088
  default: g(() => [
2037
- A(" Booking #" + F(s.value?.id?.slice(0, 8) || "—"), 1)
2089
+ A(" Booking #" + F(o.value?.id?.slice(0, 8) || "—"), 1)
2038
2090
  ]),
2039
2091
  _: 1
2040
2092
  })
2041
2093
  ]),
2042
2094
  _: 1
2043
2095
  }),
2044
- s.value ? (R(), z("div", hn, [
2045
- m("div", _n, [
2096
+ o.value ? (R(), U("div", _s, [
2097
+ m("div", xs, [
2046
2098
  f[2] || (f[2] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Customer", -1)),
2047
- m("div", xn, [
2048
- m("div", Dn, [
2049
- m("div", yn, [
2050
- u(I(Qe), {
2099
+ m("div", Ds, [
2100
+ m("div", bs, [
2101
+ m("div", ys, [
2102
+ c(S(Xe), {
2051
2103
  size: 20,
2052
2104
  class: "text-primary"
2053
2105
  })
2054
2106
  ]),
2055
2107
  m("div", null, [
2056
- m("p", bn, F(B.value), 1)
2108
+ m("p", As, F(M.value), 1)
2057
2109
  ])
2058
2110
  ]),
2059
- m("div", An, [
2060
- s.value.customerInfo?.email ? (R(), z("div", Cn, [
2061
- u(I(Je), { size: 14 }),
2111
+ m("div", Cs, [
2112
+ o.value.customerInfo?.email ? (R(), U("div", ws, [
2113
+ c(S(Ze), { size: 14 }),
2062
2114
  m("a", {
2063
- href: `mailto:${s.value.customerInfo.email}`,
2115
+ href: `mailto:${o.value.customerInfo.email}`,
2064
2116
  class: "hover:text-foreground transition-colors"
2065
- }, F(s.value.customerInfo.email), 9, wn)
2066
- ])) : P("", !0),
2067
- s.value.customerInfo?.phone ? (R(), z("div", kn, [
2068
- u(I(Xe), { size: 14 }),
2117
+ }, F(o.value.customerInfo.email), 9, ks)
2118
+ ])) : L("", !0),
2119
+ o.value.customerInfo?.phone ? (R(), U("div", Es, [
2120
+ c(S(qe), { size: 14 }),
2069
2121
  m("a", {
2070
- href: `tel:${s.value.customerInfo.phone}`,
2122
+ href: `tel:${o.value.customerInfo.phone}`,
2071
2123
  class: "hover:text-foreground transition-colors"
2072
- }, F(s.value.customerInfo.phone), 9, En)
2073
- ])) : P("", !0)
2124
+ }, F(o.value.customerInfo.phone), 9, $s)
2125
+ ])) : L("", !0)
2074
2126
  ])
2075
2127
  ])
2076
2128
  ]),
2077
- m("div", $n, [
2129
+ m("div", Ms, [
2078
2130
  f[5] || (f[5] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Reservation", -1)),
2079
- m("div", Mn, [
2080
- m("div", Bn, [
2081
- m("div", Fn, [
2082
- u(I(Ze), { size: 14 }),
2131
+ m("div", Bs, [
2132
+ m("div", Fs, [
2133
+ m("div", Ss, [
2134
+ c(S(et), { size: 14 }),
2083
2135
  f[3] || (f[3] = m("span", { class: "text-xs" }, "Time", -1))
2084
2136
  ]),
2085
- m("p", In, F(s.value.startTime) + " - " + F(s.value.endTime), 1)
2137
+ m("p", Rs, F(o.value.startTime) + " - " + F(o.value.endTime), 1)
2086
2138
  ]),
2087
- m("div", Rn, [
2088
- m("div", Sn, [
2089
- u(I(qe), { size: 14 }),
2139
+ m("div", Is, [
2140
+ m("div", js, [
2141
+ c(S(tt), { size: 14 }),
2090
2142
  f[4] || (f[4] = m("span", { class: "text-xs" }, "Spots", -1))
2091
2143
  ]),
2092
- m("p", jn, F(s.value.spots || 1) + " " + F(s.value.spots === 1 ? "person" : "people"), 1)
2144
+ m("p", Ts, F(o.value.spots || 1) + " " + F(o.value.spots === 1 ? "person" : "people"), 1)
2093
2145
  ])
2094
2146
  ])
2095
2147
  ]),
2096
- s.value.pricingOption ? (R(), z("div", Tn, [
2148
+ o.value.pricingOption ? (R(), U("div", Os, [
2097
2149
  f[6] || (f[6] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Package", -1)),
2098
- m("div", On, [
2099
- m("div", Nn, [
2100
- m("div", Ln, [
2101
- m("div", Pn, [
2102
- u(I(et), {
2150
+ m("div", Ns, [
2151
+ m("div", Ls, [
2152
+ m("div", Ps, [
2153
+ m("div", zs, [
2154
+ c(S(st), {
2103
2155
  size: 18,
2104
2156
  class: "text-primary"
2105
2157
  })
2106
2158
  ]),
2107
2159
  m("div", null, [
2108
- m("p", Vn, F(s.value.pricingOption.name), 1),
2109
- m("p", zn, F(M(s.value.pricingOption.duration)), 1)
2160
+ m("p", Vs, F(o.value.pricingOption.name), 1),
2161
+ m("p", Us, F(B(o.value.pricingOption.duration)), 1)
2110
2162
  ])
2111
2163
  ]),
2112
- m("p", Un, F(w(s.value.pricingOption.price)), 1)
2164
+ m("p", Hs, F(w(o.value.pricingOption.price)), 1)
2113
2165
  ])
2114
2166
  ])
2115
- ])) : P("", !0),
2116
- m("div", Hn, [
2167
+ ])) : L("", !0),
2168
+ m("div", Ws, [
2117
2169
  f[13] || (f[13] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Payment", -1)),
2118
- m("div", Wn, [
2119
- m("div", Kn, [
2120
- m("div", Gn, [
2170
+ m("div", Ks, [
2171
+ m("div", Gs, [
2172
+ m("div", Ys, [
2121
2173
  f[7] || (f[7] = m("span", { class: "text-muted-foreground" }, "Base price", -1)),
2122
- m("span", null, F(w(s.value.reservationBasePrice)), 1)
2174
+ m("span", null, F(w(o.value.reservationBasePrice)), 1)
2123
2175
  ]),
2124
- s.value.reservationAddOnsPrice ? (R(), z("div", Yn, [
2176
+ o.value.reservationAddOnsPrice ? (R(), U("div", Qs, [
2125
2177
  f[8] || (f[8] = m("span", { class: "text-muted-foreground" }, "Add-ons", -1)),
2126
- m("span", null, F(w(s.value.reservationAddOnsPrice)), 1)
2127
- ])) : P("", !0),
2128
- s.value.discount ? (R(), z("div", Qn, [
2178
+ m("span", null, F(w(o.value.reservationAddOnsPrice)), 1)
2179
+ ])) : L("", !0),
2180
+ o.value.discount ? (R(), U("div", Js, [
2129
2181
  f[9] || (f[9] = m("span", null, "Discount", -1)),
2130
- m("span", null, "-" + F(w(s.value.discount)), 1)
2131
- ])) : P("", !0)
2182
+ m("span", null, "-" + F(w(o.value.discount)), 1)
2183
+ ])) : L("", !0)
2132
2184
  ]),
2133
- u(Ae),
2134
- m("div", Jn, [
2185
+ c(Ae),
2186
+ m("div", Xs, [
2135
2187
  f[10] || (f[10] = m("span", null, "Reservation Total", -1)),
2136
- m("span", null, F(w(s.value.reservationPrice)), 1)
2188
+ m("span", null, F(w(o.value.reservationPrice)), 1)
2137
2189
  ]),
2138
- s.value.amountPaid !== void 0 || s.value.amountDue !== void 0 ? (R(), J(Ae, { key: 0 })) : P("", !0),
2139
- s.value.amountPaid !== void 0 || s.value.amountDue !== void 0 ? (R(), z("div", Xn, [
2140
- s.value.amountPaid !== void 0 ? (R(), z("div", Zn, [
2141
- m("span", qn, [
2142
- u(I(tt), { size: 14 }),
2190
+ o.value.amountPaid !== void 0 || o.value.amountDue !== void 0 ? (R(), J(Ae, { key: 0 })) : L("", !0),
2191
+ o.value.amountPaid !== void 0 || o.value.amountDue !== void 0 ? (R(), U("div", Zs, [
2192
+ o.value.amountPaid !== void 0 ? (R(), U("div", qs, [
2193
+ m("span", en, [
2194
+ c(S(nt), { size: 14 }),
2143
2195
  f[11] || (f[11] = A(" Amount paid ", -1))
2144
2196
  ]),
2145
- m("span", es, F(w(s.value.amountPaid)), 1)
2146
- ])) : P("", !0),
2147
- s.value.amountDue !== void 0 && s.value.amountDue > 0 ? (R(), z("div", ts, [
2148
- m("span", ns, [
2149
- u(I(nt), { size: 14 }),
2197
+ m("span", tn, F(w(o.value.amountPaid)), 1)
2198
+ ])) : L("", !0),
2199
+ o.value.amountDue !== void 0 && o.value.amountDue > 0 ? (R(), U("div", sn, [
2200
+ m("span", nn, [
2201
+ c(S(ot), { size: 14 }),
2150
2202
  f[12] || (f[12] = A(" Amount due ", -1))
2151
2203
  ]),
2152
- m("span", ss, F(w(s.value.amountDue)), 1)
2153
- ])) : P("", !0)
2154
- ])) : P("", !0)
2204
+ m("span", on, F(w(o.value.amountDue)), 1)
2205
+ ])) : L("", !0)
2206
+ ])) : L("", !0)
2155
2207
  ])
2156
2208
  ])
2157
- ])) : P("", !0),
2158
- u(He, { class: "gap-2 sm:justify-between" }, {
2209
+ ])) : L("", !0),
2210
+ c(Ke, { class: "gap-2 sm:justify-between" }, {
2159
2211
  default: g(() => [
2160
- s.value.reservationStatus === "needs_approval" ? (R(), z(pe, { key: 0 }, [
2161
- u(le, {
2212
+ o.value.reservationStatus === "needs_approval" ? (R(), U(fe, { key: 0 }, [
2213
+ c(ue, {
2162
2214
  variant: "destructive",
2163
- onClick: k
2215
+ onClick: V
2164
2216
  }, {
2165
2217
  default: g(() => [
2166
- u(I(st), { size: 16 }),
2218
+ c(S(at), { size: 16 }),
2167
2219
  f[14] || (f[14] = A(" Reject Reservation ", -1))
2168
2220
  ]),
2169
2221
  _: 1
2170
2222
  }),
2171
- u(le, { onClick: L }, {
2223
+ c(ue, { onClick: H }, {
2172
2224
  default: g(() => [
2173
- u(I(ot), { size: 16 }),
2225
+ c(S(it), { size: 16 }),
2174
2226
  f[15] || (f[15] = A(" Approve Reservation ", -1))
2175
2227
  ]),
2176
2228
  _: 1
2177
2229
  })
2178
- ], 64)) : s.value.reservationStatus === "approved" ? (R(), J(Ue, { key: 1 }, {
2230
+ ], 64)) : o.value.reservationStatus === "approved" ? (R(), J(We, { key: 1 }, {
2179
2231
  default: g(() => [
2180
- u(Ve, { "as-child": "" }, {
2232
+ c(Ue, { "as-child": "" }, {
2181
2233
  default: g(() => [
2182
- u(le, {
2234
+ c(ue, {
2183
2235
  variant: "outline",
2184
2236
  class: "gap-2"
2185
2237
  }, {
2186
2238
  default: g(() => [
2187
- u(I(at), { size: 16 }),
2239
+ c(S(rt), { size: 16 }),
2188
2240
  f[16] || (f[16] = A(" Actions ", -1))
2189
2241
  ]),
2190
2242
  _: 1
@@ -2192,25 +2244,25 @@ We would love to see you another time!`);
2192
2244
  ]),
2193
2245
  _: 1
2194
2246
  }),
2195
- u(ze, {
2247
+ c(He, {
2196
2248
  class: "w-60",
2197
2249
  align: "start"
2198
2250
  }, {
2199
2251
  default: g(() => [
2200
- u(ue, { class: "text-xs text-muted-foreground font-normal" }, {
2252
+ c(ce, { class: "text-xs text-muted-foreground font-normal" }, {
2201
2253
  default: g(() => [...f[17] || (f[17] = [
2202
2254
  A(" Reservation Actions ", -1)
2203
2255
  ])]),
2204
2256
  _: 1
2205
2257
  }),
2206
- u(ce, null, {
2258
+ c(de, null, {
2207
2259
  default: g(() => [
2208
- u(te, {
2209
- onClick: U,
2260
+ c(ne, {
2261
+ onClick: N,
2210
2262
  class: "gap-2 cursor-pointer"
2211
2263
  }, {
2212
2264
  default: g(() => [
2213
- u(I(it), {
2265
+ c(S(lt), {
2214
2266
  size: 16,
2215
2267
  class: "text-muted-foreground"
2216
2268
  }),
@@ -2221,21 +2273,21 @@ We would love to see you another time!`);
2221
2273
  ]),
2222
2274
  _: 1
2223
2275
  }),
2224
- u(Ce),
2225
- u(ce, null, {
2276
+ c(Ce),
2277
+ c(de, null, {
2226
2278
  default: g(() => [
2227
- u(ue, { class: "text-xs text-muted-foreground font-normal" }, {
2279
+ c(ce, { class: "text-xs text-muted-foreground font-normal" }, {
2228
2280
  default: g(() => [...f[19] || (f[19] = [
2229
2281
  A(" Communication ", -1)
2230
2282
  ])]),
2231
2283
  _: 1
2232
2284
  }),
2233
- u(te, {
2234
- onClick: T,
2285
+ c(ne, {
2286
+ onClick: E,
2235
2287
  class: "gap-2 cursor-pointer"
2236
2288
  }, {
2237
2289
  default: g(() => [
2238
- u(I(rt), {
2290
+ c(S(ut), {
2239
2291
  size: 16,
2240
2292
  class: "text-muted-foreground"
2241
2293
  }),
@@ -2246,53 +2298,53 @@ We would love to see you another time!`);
2246
2298
  ]),
2247
2299
  _: 1
2248
2300
  }),
2249
- I(o)("manage-reservations") ? (R(), z(pe, { key: 0 }, [
2250
- u(Ce),
2251
- u(ce, null, {
2301
+ S(n)("manage-reservations") ? (R(), U(fe, { key: 0 }, [
2302
+ c(Ce),
2303
+ c(de, null, {
2252
2304
  default: g(() => [
2253
- u(ue, { class: "text-xs text-muted-foreground font-normal" }, {
2305
+ c(ce, { class: "text-xs text-muted-foreground font-normal" }, {
2254
2306
  default: g(() => [...f[21] || (f[21] = [
2255
2307
  A(" Cancellation ", -1)
2256
2308
  ])]),
2257
2309
  _: 1
2258
2310
  }),
2259
- u(te, {
2260
- onClick: O,
2311
+ c(ne, {
2312
+ onClick: j,
2261
2313
  class: "gap-2 cursor-pointer",
2262
2314
  variant: "destructive",
2263
- disabled: S.value
2315
+ disabled: I.value
2264
2316
  }, {
2265
2317
  default: g(() => [
2266
- u(I(lt), { size: 16 }),
2318
+ c(S(ct), { size: 16 }),
2267
2319
  f[22] || (f[22] = m("span", null, "Cancel Reservation", -1))
2268
2320
  ]),
2269
2321
  _: 1
2270
2322
  }, 8, ["disabled"]),
2271
- s.value?.reservationPrice && s.value.reservationPrice > 0 ? (R(), J(te, {
2323
+ o.value?.reservationPrice && o.value.reservationPrice > 0 ? (R(), J(ne, {
2272
2324
  key: 0,
2273
- onClick: be,
2325
+ onClick: W,
2274
2326
  class: "gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",
2275
- disabled: S.value
2327
+ disabled: I.value
2276
2328
  }, {
2277
2329
  default: g(() => [
2278
- u(I(ut), {
2330
+ c(S(dt), {
2279
2331
  class: "text-inherit",
2280
2332
  size: 16
2281
2333
  }),
2282
2334
  f[23] || (f[23] = m("span", null, "Cancel & Send Coupon", -1))
2283
2335
  ]),
2284
2336
  _: 1
2285
- }, 8, ["disabled"])) : P("", !0)
2337
+ }, 8, ["disabled"])) : L("", !0)
2286
2338
  ]),
2287
2339
  _: 1
2288
2340
  })
2289
- ], 64)) : P("", !0)
2341
+ ], 64)) : L("", !0)
2290
2342
  ]),
2291
2343
  _: 1
2292
2344
  })
2293
2345
  ]),
2294
2346
  _: 1
2295
- })) : P("", !0)
2347
+ })) : L("", !0)
2296
2348
  ]),
2297
2349
  _: 1
2298
2350
  })
@@ -2302,30 +2354,30 @@ We would love to see you another time!`);
2302
2354
  ]),
2303
2355
  _: 1
2304
2356
  }, 8, ["open"]),
2305
- u(on, {
2357
+ c(is, {
2306
2358
  ref_key: "cancelReservationDialog",
2307
- ref: _,
2308
- onConfirm: C
2359
+ ref: v,
2360
+ onConfirm: y
2309
2361
  }, null, 512),
2310
- u(dn, {
2362
+ c(ps, {
2311
2363
  ref_key: "approveReservationDialog",
2312
- ref: y,
2313
- onConfirm: N
2364
+ ref: b,
2365
+ onConfirm: T
2314
2366
  }, null, 512),
2315
- u(vn, {
2367
+ c(hs, {
2316
2368
  ref_key: "rejectReservationDialog",
2317
- ref: v,
2318
- onConfirm: K
2369
+ ref: h,
2370
+ onConfirm: ee
2319
2371
  }, null, 512),
2320
- u(an, {
2372
+ c(rs, {
2321
2373
  ref_key: "transferReservationDialog",
2322
- ref: c
2374
+ ref: d
2323
2375
  }, null, 512)
2324
2376
  ], 64);
2325
2377
  };
2326
2378
  }
2327
2379
  });
2328
2380
  export {
2329
- ee as F,
2330
- ls as _
2381
+ q as F,
2382
+ cn as _
2331
2383
  };