@feedmepos/mf-settings 0.0.48-beta.1-ex → 0.0.48-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4181 +0,0 @@
1
- var Lr = Object.defineProperty;
2
- var Nr = (r, e, t) => e in r ? Lr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var Ye = (r, e, t) => (Nr(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { ref as ae, computed as W, defineComponent as ee, resolveComponent as q, openBlock as D, createBlock as Q, Teleport as Cr, createVNode as C, Transition as xr, withCtx as H, normalizeClass as Z, normalizeStyle as Fe, withKeys as kr, createElementVNode as O, toDisplayString as B, renderSlot as me, createElementBlock as K, Fragment as oe, renderList as be, createCommentVNode as fe, createTextVNode as je, h as Ot, unref as S, watch as At, onMounted as Mr, onUnmounted as Vr, toRaw as St, reactive as mt, normalizeProps as Fr, guardReactiveProps as jr, withModifiers as it, nextTick as Dr, getCurrentInstance as Ur, isRef as Tt } from "vue";
5
- import { c as cr, g as pt, a as we, _ as Gr, b as Xe } from "./createForm-ad247a74.js";
6
- import { F_PAYOUT_ACCOUNT_STATUS as Br, F_COUNTRY as dr } from "@feedmepos/core/entity";
7
- import { useCoreStore as ge, useI18n as ye, CustomAttributesForm as Kr } from "@feedmepos/mf-common";
8
- import { useDialog as fr, useDialogChild as Hr, useSnackbar as ht, useBreakpoints as mr, components as qr } from "@feedmepos/ui-library";
9
- import { _ as pr, r as he } from "./rules-c9fa22f8.js";
10
- import { w as De, u as _e, x as zr, y as Yr, t as We, z as Je, A as Xr, B as Wr, D as Jr, G as Zr } from "./index.esm2017-c60b1ce5.js";
11
- import { u as hr, _ as Qr, a as en } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-65f62fbb.js";
12
- import { b as Ze, a as Qe, g as vt, u as vr } from "./loading-eb019aa4.js";
13
- import { u as tn, _ as Ae, c as rn } from "./actionButton-6b6e9e60.js";
14
- import { b as nn } from "./business-8b22c801.js";
15
- import "pinia";
16
- var sn = {};
17
- (function(r) {
18
- Object.defineProperty(r, "__esModule", { value: !0 }), function(e) {
19
- e.SLOT_SALE = "SLOT_SALE";
20
- }(r.ReportWidgetType || (r.ReportWidgetType = {})), function(e) {
21
- e.v2 = "v2", e.v3 = "v3", e.v4 = "v4";
22
- }(r.MENU_VERSION || (r.MENU_VERSION = {})), function(e) {
23
- e.Polygon = "Polygon";
24
- }(r.GeometryType || (r.GeometryType = {})), function(e) {
25
- e.stock = "stock", e.discovery = "discovery", e.pickup = "pickup", e.delivery = "delivery", e.foodpanda = "foodpanda", e.deliveryIntegration = "deliveryIntegration", e.kds = "kds", e.ods = "ods";
26
- }(r.RestaurantFeature || (r.RestaurantFeature = {})), function(e) {
27
- e.alpha = "alpha", e.beta = "beta", e.latest = "latest";
28
- }(r.RestaurantChannel || (r.RestaurantChannel = {})), function(e) {
29
- e.pickup = "pickup", e.delivery = "delivery";
30
- }(r.DiscoveryType || (r.DiscoveryType = {})), function(e) {
31
- e.new = "NEW", e.pending = "PENDING", e.approved = "APPROVED";
32
- }(r.PAYOUT_ACCOUNT_STATUS || (r.PAYOUT_ACCOUNT_STATUS = {})), function(e) {
33
- e.maybank = "MAYBANK", e.cimbBank = "CIMB_BANK", e.rhbBank = "RHB_BANK", e.bankIslam = "BANK_ISLAM", e.bankMuamalat = "BANK_MUAMALAT", e.bankRakyat = "BANK_RAKYAT", e.bankSimpananNasional = "BANK_SIMPANAN_NASIONAL", e.citiBank = "CITIBANK", e.hongLeongBank = "HONG_LEONG_BANK", e.hsbcBank = "HSBC_BANK", e.ocbcBank = "OCBC_BANK", e.publicBank = "PUBLIC_BANK", e.affinBank = "AFFIN_BANK", e.amBank = "AMBANK", e.agroBank = "AGRO_BANK", e.allianceBank = "ALLIANCE_BANK", e.alRajhiBank = "AL_RAJHI_BANK", e.bankOfChina = "BANK_OF_CHINA", e.bankOfAmerica = "BANK_OF_AMERICA", e.bankOfTokyoMitsubishiUFJ = "BANK_OF_TOKYO_MITSUBISHI_UFJ", e.bnpParibas = "BNP_PARIBAS", e.deutscheBank = "DEUTSCHE_BANK", e.industrialCommercialBankOfChina = "INDUSTRIAL_COMMERCIAL_BANK_OF_CHINA", e.jpMorganChaseBank = "JP_MORGAN_CHASE_BANK", e.kuwaitFinanceHouse = "KUWAIT_FINANCE_HOUSE", e.mizuhoBank = "MIZUHO_BANK", e.standardCharteredBank = "STANDARD_CHARTERED_BANK", e.sumitomoMitsuiBankingCorporation = "SUMITOMO_MITSUI_BANKING_CORPORATION", e.theRoyalBankOfScotland = "THE_ROYAL_BANK_OF_SCOTLAND", e.unitedOverseasBank = "UNITED_OVERSEAS_BANK";
34
- }(r.BankName || (r.BankName = {})), function(e) {
35
- e.current = "CURRENT_ACCOUNT", e.saving = "SAVING_ACCOUNT";
36
- }(r.BankType || (r.BankType = {})), function(e) {
37
- e[e.maybank = 100002270] = "maybank", e[e.cimbBank = 100002050] = "cimbBank", e[e.rhbBank = 100002186] = "rhbBank", e[e.bankIslam = 100002458] = "bankIslam", e[e.bankMuamalat = 100002458] = "bankMuamalat", e[e.bankRakyat = 100016020] = "bankRakyat", e[e.bankSimpananNasional = 100016017] = "bankSimpananNasional", e[e.citiBank = 100002173] = "citiBank", e[e.hongLeongBank = 100002241] = "hongLeongBank", e[e.hsbcBank = 100002225] = "hsbcBank", e[e.ocbcBank = 100002296] = "ocbcBank", e[e.publicBank = 100002335] = "publicBank", e[e.affinBank = 100002322] = "affinBank", e[e.amBank = 100002089] = "amBank", e[e.agroBank = 100033061] = "agroBank", e[e.allianceBank = 100002128] = "allianceBank", e[e.alRajhiBank = 100003509] = "alRajhiBank", e[e.bankOfChina = 100002429] = "bankOfChina", e[e.bankOfAmerica = 100002076] = "bankOfAmerica", e[e.bankOfTokyoMitsubishiUFJ = 100002102] = "bankOfTokyoMitsubishiUFJ", e[e.bnpParibas = 100002636] = "bnpParibas", e[e.deutscheBank = 100002199] = "deutscheBank", e[e.industrialCommercialBankOfChina = 100002597] = "industrialCommercialBankOfChina", e[e.jpMorganChaseBank = 100002157] = "jpMorganChaseBank", e[e.kuwaitFinanceHouse = 100003460] = "kuwaitFinanceHouse", e[e.mizuhoBank = 100002610] = "mizuhoBank", e[e.standardCharteredBank = 100002144] = "standardCharteredBank", e[e.sumitomoMitsuiBankingCorporation = 100002623] = "sumitomoMitsuiBankingCorporation", e[e.unitedOverseasBank = 100002267] = "unitedOverseasBank";
38
- }(r.BankRouting || (r.BankRouting = {})), function(e) {
39
- e.maybank = "MBBEMYKL", e.cimbBank = "CIBBMYKL", e.rhbBank = "RHBBMYKL", e.bankIslam = "BIMBMYKL", e.bankMuamalat = "BMMBMYKL", e.bankRakyat = "BKRMMYKL", e.bankSimpananNasional = "BSNAMYK1", e.citiBank = "CITIMYKL", e.hongLeongBank = "HLBBMYKL", e.hsbcBank = "HBMBMYKL", e.ocbcBank = "OCBCMYKL", e.publicBank = "PBBEMYKL", e.affinBank = "PHBMMYKL", e.amBank = "ARBKMYKL", e.agroBank = "AGOBMYKL", e.allianceBank = "MFBBMYKL", e.alRajhiBank = "RJHIMYKL", e.bankOfChina = "BKCHMYKL", e.bankOfAmerica = "BOFAMY2X", e.bankOfTokyoMitsubishiUFJ = "BOTKMYKX", e.bnpParibas = "BNPAMYKL", e.deutscheBank = "DEUTMYKL", e.industrialCommercialBankOfChina = "ICBKMYKL", e.jpMorganChaseBank = "CHASMYKX", e.kuwaitFinanceHouse = "KFHOMYKL", e.mizuhoBank = "MHCBMYKA", e.standardCharteredBank = "SCBLMYKX", e.sumitomoMitsuiBankingCorporation = "SMBCMYKL", e.unitedOverseasBank = "UOVBMYKL";
40
- }(r.BankSwiftCode || (r.BankSwiftCode = {})), function(e) {
41
- e.grab = "Grab", e.merchant = "Merchant", e.partner = "Partner";
42
- }(r.GF_CAMPAIGN_CREATED_BY || (r.GF_CAMPAIGN_CREATED_BY = {})), function(e) {
43
- e.all = "all", e.new = "new";
44
- }(r.GF_CAMPAIGN_EATER_TYPE || (r.GF_CAMPAIGN_EATER_TYPE = {})), function(e) {
45
- e.net = "net", e.percentage = "percentage", e.delivery = "delivery", e.freeItem = "freeItem";
46
- }(r.GF_CAMPAIGN_DISCOUNT_TYPE || (r.GF_CAMPAIGN_DISCOUNT_TYPE = {})), function(e) {
47
- e.order = "order", e.items = "items";
48
- }(r.GF_CAMPAIGN_SCOPE_TYPE || (r.GF_CAMPAIGN_SCOPE_TYPE = {}));
49
- })(sn);
50
- var gr = { exports: {} };
51
- (function(r, e) {
52
- (function(t, n) {
53
- r.exports = n();
54
- })(cr, function() {
55
- return function(t) {
56
- var n = {};
57
- function s(o) {
58
- if (n[o])
59
- return n[o].exports;
60
- var i = n[o] = { i: o, l: !1, exports: {} };
61
- return t[o].call(i.exports, i, i.exports, s), i.l = !0, i.exports;
62
- }
63
- return s.m = t, s.c = n, s.d = function(o, i, h) {
64
- s.o(o, i) || Object.defineProperty(o, i, { enumerable: !0, get: h });
65
- }, s.r = function(o) {
66
- typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 });
67
- }, s.t = function(o, i) {
68
- if (1 & i && (o = s(o)), 8 & i || 4 & i && typeof o == "object" && o && o.__esModule)
69
- return o;
70
- var h = /* @__PURE__ */ Object.create(null);
71
- if (s.r(h), Object.defineProperty(h, "default", { enumerable: !0, value: o }), 2 & i && typeof o != "string")
72
- for (var p in o)
73
- s.d(
74
- h,
75
- p,
76
- (function(d) {
77
- return o[d];
78
- }).bind(null, p)
79
- );
80
- return h;
81
- }, s.n = function(o) {
82
- var i = o && o.__esModule ? function() {
83
- return o.default;
84
- } : function() {
85
- return o;
86
- };
87
- return s.d(i, "a", i), i;
88
- }, s.o = function(o, i) {
89
- return Object.prototype.hasOwnProperty.call(o, i);
90
- }, s.p = "", s(s.s = 0);
91
- }([
92
- function(t, n, s) {
93
- t.exports = s(1);
94
- },
95
- function(t, n, s) {
96
- function o(a) {
97
- return (o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
98
- return typeof l;
99
- } : function(l) {
100
- return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
101
- })(a);
102
- }
103
- function i(a) {
104
- var l = "[object " + a + "]";
105
- return function(g) {
106
- return Object.prototype.toString.call(g) === l;
107
- };
108
- }
109
- s.r(n), s.d(n, "default", function() {
110
- return z;
111
- }), s.d(n, "compare", function() {
112
- return G;
113
- }), s.d(n, "comparable", function() {
114
- return Y;
115
- });
116
- var h = i("Array"), p = i("Object"), d = i("Function");
117
- function _(a, l) {
118
- return d(a.get) ? a.get(l) : a[l];
119
- }
120
- function $(a) {
121
- return function(l, g) {
122
- if (!h(g) || !g.length)
123
- return a(l, g);
124
- for (var A = 0, L = g.length; A < L; A++)
125
- if (a(l, _(g, A)))
126
- return !0;
127
- return !1;
128
- };
129
- }
130
- function y(a) {
131
- return function(l, g) {
132
- if (!h(g) || !g.length)
133
- return a(l, g);
134
- for (var A = 0, L = g.length; A < L; A++)
135
- if (!a(l, _(g, A)))
136
- return !1;
137
- return !0;
138
- };
139
- }
140
- function w(a, l, g, A) {
141
- return a.validate(a.options, l, g, A);
142
- }
143
- var E = {
144
- $eq: $(function(a, l) {
145
- return a(l);
146
- }),
147
- $ne: y(function(a, l) {
148
- return a(l);
149
- }),
150
- $gt: $(function(a, l) {
151
- return a(l);
152
- }),
153
- $gte: $(function(a, l) {
154
- return a(l);
155
- }),
156
- $lt: $(function(a, l) {
157
- return a(l);
158
- }),
159
- $lte: $(function(a, l) {
160
- return a(l);
161
- }),
162
- $mod: $(function(a, l) {
163
- return a(l);
164
- }),
165
- $in: function(a, l) {
166
- return a(l);
167
- },
168
- $nin: function(a, l) {
169
- return a(l);
170
- },
171
- $not: function(a, l, g, A) {
172
- return a(l, g, A);
173
- },
174
- $type: function(a, l) {
175
- return a(l);
176
- },
177
- $all: function(a, l, g, A) {
178
- return E.$and(a, l, g, A);
179
- },
180
- $size: function(a, l) {
181
- return !!l && a === l.length;
182
- },
183
- $or: function(a, l, g, A) {
184
- for (var L = 0, f = a.length; L < f; L++)
185
- if (w(_(a, L), l, g, A))
186
- return !0;
187
- return !1;
188
- },
189
- $nor: function(a, l, g, A) {
190
- return !E.$or(a, l, g, A);
191
- },
192
- $and: function(a, l, g, A) {
193
- for (var L = 0, f = a.length; L < f; L++)
194
- if (!w(_(a, L), l, g, A))
195
- return !1;
196
- return !0;
197
- },
198
- $regex: $(function(a, l) {
199
- return typeof l == "string" && a.test(l);
200
- }),
201
- $where: function(a, l, g, A) {
202
- return a.call(l, l, g, A);
203
- },
204
- $elemMatch: function(a, l, g, A) {
205
- return h(l) ? !!~function(L, f) {
206
- for (var u = 0; u < L.length; u++)
207
- if (_(L, u), w(f, _(L, u)))
208
- return u;
209
- return -1;
210
- }(l, a) : w(a, l, g, A);
211
- },
212
- $exists: function(a, l, g, A) {
213
- return A.hasOwnProperty(g) === a;
214
- }
215
- }, R = {
216
- $eq: function(a, l, g) {
217
- var A = g.comparable, L = g.compare;
218
- return a instanceof RegExp ? $(function(f) {
219
- return typeof f == "string" && a.test(f);
220
- }) : a instanceof Function ? $(a) : h(a) && !a.length ? $(function(f) {
221
- return h(f) && !f.length;
222
- }) : $(
223
- a === null ? function(f) {
224
- return f == null;
225
- } : function(f) {
226
- return L(A(f), A(a)) === 0;
227
- }
228
- );
229
- },
230
- $gt: function(a, l, g) {
231
- var A = g.comparable, L = g.compare;
232
- return function(f) {
233
- return L(A(f), A(a)) > 0;
234
- };
235
- },
236
- $gte: function(a, l, g) {
237
- var A = g.comparable, L = g.compare;
238
- return function(f) {
239
- return L(A(f), A(a)) >= 0;
240
- };
241
- },
242
- $lt: function(a, l, g) {
243
- var A = g.comparable, L = g.compare;
244
- return function(f) {
245
- return L(A(f), A(a)) < 0;
246
- };
247
- },
248
- $lte: function(a, l, g) {
249
- var A = g.comparable, L = g.compare;
250
- return function(f) {
251
- return L(A(f), A(a)) <= 0;
252
- };
253
- },
254
- $in: function(a, l, g) {
255
- var A = g.comparable;
256
- return function(L) {
257
- if (!(L instanceof Array)) {
258
- var f = A(L);
259
- if (f === L && o(L) === "object") {
260
- for (m = a.length; m--; )
261
- if (String(a[m]) === String(L) && String(L) !== "[object Object]")
262
- return !0;
263
- }
264
- if (f === void 0) {
265
- for (m = a.length; m--; )
266
- if (a[m] == null)
267
- return !0;
268
- }
269
- for (m = a.length; m--; ) {
270
- var u = w(X(_(a, m), g), f, m, a);
271
- if (u && String(u) !== "[object Object]" && String(f) !== "[object Object]")
272
- return !0;
273
- }
274
- return !!~a.indexOf(f);
275
- }
276
- for (var m = L.length; m--; )
277
- if (~a.indexOf(A(_(L, m))))
278
- return !0;
279
- return !1;
280
- };
281
- },
282
- $nin: function(a, l, g) {
283
- var A = R.$in(a, l, g);
284
- return function(L, f, u, m) {
285
- return !A(L, f, u, m);
286
- };
287
- },
288
- $mod: function(a) {
289
- return function(l) {
290
- return l % a[0] == a[1];
291
- };
292
- },
293
- $ne: function(a, l, g) {
294
- var A = R.$eq(a, l, g);
295
- return y(function(L, f, u, m) {
296
- return !A(L, f, u, m);
297
- });
298
- },
299
- $and: function(a, l, g) {
300
- return a.map(T(g));
301
- },
302
- $all: function(a, l, g) {
303
- return R.$and(a, l, g);
304
- },
305
- $or: function(a, l, g) {
306
- return a.map(T(g));
307
- },
308
- $nor: function(a, l, g) {
309
- return a.map(T(g));
310
- },
311
- $not: function(a, l, g) {
312
- var A = T(g)(a);
313
- return function(L, f, u) {
314
- return !w(A, L, f, u);
315
- };
316
- },
317
- $type: function(a) {
318
- return function(l, g, A) {
319
- return l != null && (l instanceof a || l.constructor == a);
320
- };
321
- },
322
- $regex: function(a, l) {
323
- return new RegExp(a, l.$options);
324
- },
325
- $where: function(a) {
326
- if (typeof a == "function")
327
- return a;
328
- throw new Error(
329
- 'In CSP mode, sift does not support strings in "$where" condition'
330
- );
331
- },
332
- $elemMatch: function(a, l, g) {
333
- return T(g)(a);
334
- },
335
- $exists: function(a) {
336
- return !!a;
337
- }
338
- };
339
- function M(a, l) {
340
- return { options: a, validate: l };
341
- }
342
- function x(a, l) {
343
- var g = a.keyPath, A = a.child, L = a.query, f = [];
344
- if (function k(N, P, j, V, J) {
345
- if (j === P.length || N == null)
346
- return void J.push([N, P[j - 1], V]);
347
- var ne = _(P, j);
348
- if (h(N) && isNaN(Number(ne)))
349
- for (var ce = 0, de = N.length; ce < de; ce++)
350
- k(_(N, ce), P, j, N, J);
351
- else
352
- k(_(N, ne), P, j + 1, N, J);
353
- }(l, g, 0, l, f), f.length === 1) {
354
- var u = f[0];
355
- return w(A, u[0], u[1], u[2]);
356
- }
357
- for (var m = L && L.$ne !== void 0, v = m, c = 0; c < f.length; c++) {
358
- var b = f[c], I = w(A, b[0], b[1], b[2]);
359
- m ? v &= I : v |= I;
360
- }
361
- return v;
362
- }
363
- function F(a, l, g) {
364
- return M({ keyPath: a, child: l, query: g }, x);
365
- }
366
- function T(a) {
367
- var l = a.comparable, g = a.expressions, A = function(u) {
368
- var m;
369
- return (!u || !(m = u) || m.constructor !== Object && m.constructor !== Array && m.constructor.toString() !== "function Object() { [native code] }" && m.constructor.toString() !== "function Array() { [native code] }" || m.toJSON) && (u = { $eq: u }), u;
370
- }, L = function(u) {
371
- u = l(u);
372
- var m = [];
373
- for (var v in u) {
374
- var c = u[v];
375
- if (v !== "$options") {
376
- var b = E[v] || a && g && g[v];
377
- if (b)
378
- R[v] && (c = R[v](c, u, a)), m.push(M(l(c), b));
379
- else {
380
- if (v.charCodeAt(0) === 36)
381
- throw new Error("Unknown operation " + v);
382
- var I = v.split(".");
383
- m.push(F(I, f(c), c));
384
- }
385
- }
386
- }
387
- return m.length === 1 ? m[0] : M(m, E.$and);
388
- }, f = function(u) {
389
- return u = A(u), function m(v, c) {
390
- if (!p(v))
391
- return c;
392
- for (var b in v)
393
- c.push(b), m(v[b], c);
394
- return c;
395
- }(u, []).join(",").search(/[$.]/) === -1 ? M(u, U) : L(u);
396
- };
397
- return function(u) {
398
- return L(A(u));
399
- };
400
- }
401
- function U(a, l) {
402
- if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(l))
403
- return !1;
404
- if (p(a)) {
405
- if (Object.keys(a).length !== Object.keys(l).length)
406
- return !1;
407
- for (var g in a)
408
- if (!U(a[g], l[g]))
409
- return !1;
410
- return !0;
411
- }
412
- if (h(a)) {
413
- if (a.length !== l.length)
414
- return !1;
415
- for (var A = 0, L = a.length; A < L; A++)
416
- if (!U(a[A], l[A]))
417
- return !1;
418
- return !0;
419
- }
420
- return a === l;
421
- }
422
- function X(a, l) {
423
- var g = T(l)(a);
424
- return l && l.select && (g = {
425
- options: g,
426
- validate: function(A, L, f, u) {
427
- return w(A, L && l.select(L), f, u);
428
- }
429
- }), g;
430
- }
431
- function z(a, l) {
432
- var g = X(a, l = Object.assign({ compare: G, comparable: Y }, l));
433
- return function(A, L, f) {
434
- return w(g, A, L, f);
435
- };
436
- }
437
- function G(a, l) {
438
- if (U(a, l))
439
- return 0;
440
- if (o(a) === o(l)) {
441
- if (a > l)
442
- return 1;
443
- if (a < l)
444
- return -1;
445
- }
446
- }
447
- function Y(a) {
448
- return a instanceof Date ? a.getTime() : h(a) ? a.map(Y) : a && typeof a.toJSON == "function" ? a.toJSON() : a;
449
- }
450
- }
451
- ]);
452
- });
453
- })(gr);
454
- var an = gr.exports;
455
- const on = /* @__PURE__ */ pt(an);
456
- function Pt(r, e) {
457
- for (var t = 0; t < e.length; t++) {
458
- var n = e[t];
459
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, n.key, n);
460
- }
461
- }
462
- function ln(r, e, t) {
463
- return e && Pt(r.prototype, e), t && Pt(r, t), r;
464
- }
465
- function un(r, e) {
466
- r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.__proto__ = e;
467
- }
468
- function lt(r) {
469
- return lt = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
470
- return t.__proto__ || Object.getPrototypeOf(t);
471
- }, lt(r);
472
- }
473
- function Ue(r, e) {
474
- return Ue = Object.setPrototypeOf || function(n, s) {
475
- return n.__proto__ = s, n;
476
- }, Ue(r, e);
477
- }
478
- function cn() {
479
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
480
- return !1;
481
- if (typeof Proxy == "function")
482
- return !0;
483
- try {
484
- return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
485
- })), !0;
486
- } catch {
487
- return !1;
488
- }
489
- }
490
- function Ve(r, e, t) {
491
- return cn() ? Ve = Reflect.construct : Ve = function(s, o, i) {
492
- var h = [null];
493
- h.push.apply(h, o);
494
- var p = Function.bind.apply(s, h), d = new p();
495
- return i && Ue(d, i.prototype), d;
496
- }, Ve.apply(null, arguments);
497
- }
498
- function dn(r) {
499
- return Function.toString.call(r).indexOf("[native code]") !== -1;
500
- }
501
- function ut(r) {
502
- var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
503
- return ut = function(n) {
504
- if (n === null || !dn(n))
505
- return n;
506
- if (typeof n != "function")
507
- throw new TypeError("Super expression must either be null or a function");
508
- if (typeof e < "u") {
509
- if (e.has(n))
510
- return e.get(n);
511
- e.set(n, s);
512
- }
513
- function s() {
514
- return Ve(n, arguments, lt(this).constructor);
515
- }
516
- return s.prototype = Object.create(n.prototype, {
517
- constructor: {
518
- value: s,
519
- enumerable: !1,
520
- writable: !0,
521
- configurable: !0
522
- }
523
- }), Ue(s, n);
524
- }, ut(r);
525
- }
526
- function Lt(r) {
527
- if (r === void 0)
528
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
529
- return r;
530
- }
531
- var br = function(e) {
532
- return 'Cannot execute "' + e.action + '" on "' + e.subjectName + '"';
533
- }, Ne = br, fn = /* @__PURE__ */ function(r) {
534
- un(e, r), e.setDefaultMessage = function(s) {
535
- s === null ? Ne = br : Ne = typeof s == "string" ? function() {
536
- return s;
537
- } : s;
538
- }, e.from = function(s) {
539
- var o = new this("");
540
- return Object.defineProperty(o, "ability", {
541
- value: s
542
- }), o;
543
- };
544
- function e(n, s) {
545
- var o;
546
- return s === void 0 && (s = {}), o = r.call(this, n) || this, o._setMetadata(s), o.message = n || Ne(Lt(o)), o._customMessage = null, typeof Error.captureStackTrace == "function" && (o.name = o.constructor.name, Error.captureStackTrace(Lt(o), o.constructor)), o;
547
- }
548
- var t = e.prototype;
549
- return t.setMessage = function(s) {
550
- return this._customMessage = s, this;
551
- }, t.throwUnlessCan = function(s, o, i) {
552
- if (!this.ability)
553
- throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
554
- var h = this.ability.relevantRuleFor(s, o, i);
555
- if (!(h && !h.inverted)) {
556
- this._setMetadata({
557
- action: s,
558
- subject: o,
559
- field: i,
560
- subjectName: this.ability.subjectName(o)
561
- });
562
- var p = h ? h.reason : "";
563
- throw this.message = this._customMessage || p || Ne(this), this;
564
- }
565
- }, t._setMetadata = function(s) {
566
- this.subject = s.subject, this.subjectName = s.subjectName, this.action = s.action, this.field = s.field;
567
- }, e;
568
- }(ut(Error));
569
- function ct(r) {
570
- return Array.isArray(r) ? r : [r];
571
- }
572
- function mn(r) {
573
- if (!r || typeof r == "string")
574
- return r;
575
- var e = typeof r == "object" ? r.constructor : r;
576
- return e.modelName || e.name;
577
- }
578
- function pn(r) {
579
- return JSON.parse(JSON.stringify(r));
580
- }
581
- var hn = /[-/\\^$+?.()|[\]{}]/g, vn = /\.?\*+\.?/g, gn = /\*+/, bn = /\./g;
582
- function yn(r, e, t) {
583
- var n = t[0] === "*" || r[0] === "." && r[r.length - 1] === "." ? "+" : "*", s = r.indexOf("**") === -1 ? "[^.]" : ".", o = r.replace(bn, "\\$&").replace(gn, s + n);
584
- return e + r.length === t.length ? "(?:" + o + ")?" : o;
585
- }
586
- function $n(r, e, t) {
587
- return r === "." && (t[e - 1] === "*" || t[e + 1] === "*") ? r : "\\" + r;
588
- }
589
- function _n(r) {
590
- var e = r.map(function(n) {
591
- return n.replace(hn, $n).replace(vn, yn);
592
- }), t = e.length > 1 ? "(?:" + e.join("|") + ")" : e[0];
593
- return new RegExp("^" + t + "$");
594
- }
595
- var En = /* @__PURE__ */ function() {
596
- function r(t) {
597
- this.actions = t.actions || t.action, this.subject = t.subject, this.fields = !t.fields || t.fields.length === 0 ? void 0 : ct(t.fields), Object.defineProperty(this, "_fieldsPattern", {
598
- writable: !0
599
- }), this.inverted = !!t.inverted, this.conditions = t.conditions, Object.defineProperty(this, "_matches", {
600
- writable: !0,
601
- value: this.conditions ? on(this.conditions) : void 0
602
- }), this.reason = t.reason;
603
- }
604
- var e = r.prototype;
605
- return e.matches = function(n) {
606
- return this._matches ? typeof n == "string" ? !this.inverted : this._matches(n) : !0;
607
- }, e.isRelevantFor = function(n, s) {
608
- return this.fields ? s ? this.matchesField(s) : !this.inverted : !0;
609
- }, e.matchesField = function(n) {
610
- return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : _n(this.fields)), this._fieldsPattern === null || n.indexOf("*") !== -1 ? this.fields.indexOf(n) !== -1 : this._fieldsPattern.test(n);
611
- }, r;
612
- }(), se = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), Nt = {
613
- crud: ["create", "read", "update", "delete"]
614
- };
615
- function Ct(r, e) {
616
- return r === e || Array.isArray(e) && e.indexOf(r) !== -1;
617
- }
618
- var wn = /* @__PURE__ */ function() {
619
- r.addAlias = function(n, s) {
620
- if (n === "manage" || Ct("manage", s))
621
- throw new Error('Cannot add alias for "manage" action because it represents any action');
622
- if (Ct(n, s))
623
- throw new Error("Attempt to alias action to itself: " + n + " -> " + s.toString());
624
- return Nt[n] = s, this;
625
- };
626
- function r(t, n) {
627
- n === void 0 && (n = {}), Object.defineProperty(this, "subjectName", {
628
- value: n.subjectName || mn
629
- }), this[se] = {
630
- RuleType: n.RuleType || En,
631
- originalRules: t || [],
632
- hasPerFieldRules: !1,
633
- indexedRules: /* @__PURE__ */ Object.create(null),
634
- mergedRules: /* @__PURE__ */ Object.create(null),
635
- events: {},
636
- aliases: pn(Nt)
637
- }, this.update(t);
638
- }
639
- var e = r.prototype;
640
- return e.update = function(n) {
641
- if (!Array.isArray(n))
642
- return this;
643
- var s = {
644
- rules: n,
645
- ability: this
646
- };
647
- this.emit("update", s), this[se].originalRules = n.slice(0), this[se].mergedRules = /* @__PURE__ */ Object.create(null);
648
- var o = this.buildIndexFor(n);
649
- return process.env.NODE_ENV !== "production" && o.isAllInverted && n.length && console.warn("[casl]: Ability contains only inverted rules. That means user will not be able to do any actions. This will be changed to Error throw in the next major version"), this[se].indexedRules = o.rules, this[se].hasPerFieldRules = o.hasPerFieldRules, this.emit("updated", s), this;
650
- }, e.buildIndexFor = function(n) {
651
- for (var s = /* @__PURE__ */ Object.create(null), o = this[se].RuleType, i = !0, h = !1, p = 0; p < n.length; p++) {
652
- var d = new o(n[p]), _ = this.expandActions(d.actions), $ = ct(d.subject), y = n.length - p - 1;
653
- i = !!(i && d.inverted), !h && d.fields && (h = !0);
654
- for (var w = 0; w < $.length; w++) {
655
- var E = $[w];
656
- s[E] = s[E] || /* @__PURE__ */ Object.create(null);
657
- for (var R = 0; R < _.length; R++) {
658
- var M = _[R];
659
- s[E][M] = s[E][M] || /* @__PURE__ */ Object.create(null), s[E][M][y] = d;
660
- }
661
- }
662
- }
663
- return {
664
- isAllInverted: i,
665
- hasPerFieldRules: h,
666
- rules: s
667
- };
668
- }, e.expandActions = function(n) {
669
- for (var s = this[se].aliases, o = ct(n), i = 0; i < o.length; ) {
670
- var h = o[i++];
671
- s.hasOwnProperty(h) && (o = o.concat(s[h]));
672
- }
673
- return o;
674
- }, e.can = function(n, s, o) {
675
- if (o && typeof o != "string")
676
- throw new Error("Ability.can expects 3rd parameter to be a string. See https://stalniy.github.io/casl/abilities/2017/07/21/check-abilities.html#checking-fields for details");
677
- var i = this.relevantRuleFor(n, s, o);
678
- return !!i && !i.inverted;
679
- }, e.relevantRuleFor = function(n, s, o) {
680
- for (var i = this.rulesFor(n, s, o), h = 0; h < i.length; h++)
681
- if (i[h].matches(s))
682
- return i[h];
683
- return null;
684
- }, e.possibleRulesFor = function(n, s) {
685
- var o = this.subjectName(s), i = this[se].mergedRules, h = o + "_" + n;
686
- return i[h] || (i[h] = this.mergeRulesFor(n, o)), i[h];
687
- }, e.mergeRulesFor = function(n, s) {
688
- var o = this[se].indexedRules, i = [s, "all"].reduce(function(h, p) {
689
- var d = o[p];
690
- return d ? Object.assign(h, d[n], d.manage) : h;
691
- }, []);
692
- return i.filter(Boolean);
693
- }, e.rulesFor = function(n, s, o) {
694
- var i = this.possibleRulesFor(n, s);
695
- return this[se].hasPerFieldRules ? i.filter(function(h) {
696
- return h.isRelevantFor(s, o);
697
- }) : i;
698
- }, e.cannot = function() {
699
- return !this.can.apply(this, arguments);
700
- }, e.throwUnlessCan = function() {
701
- var n;
702
- console.warn(`
703
- Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
704
- Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
705
- `.trim()), (n = fn.from(this)).throwUnlessCan.apply(n, arguments);
706
- }, e.on = function(n, s) {
707
- var o = this[se].events, i = !0;
708
- return o[n] || (o[n] = []), o[n].push(s), function() {
709
- if (i) {
710
- var h = o[n].indexOf(s);
711
- o[n].splice(h, 1), i = !1;
712
- }
713
- };
714
- }, e.emit = function(n, s) {
715
- var o = this[se].events[n];
716
- o && o.slice(0).forEach(function(i) {
717
- return i(s);
718
- });
719
- }, ln(r, [{
720
- key: "rules",
721
- get: function() {
722
- return this[se].originalRules;
723
- }
724
- }]), r;
725
- }(), Re;
726
- ((r) => {
727
- ((e) => {
728
- e[e.feedMe = 0] = "feedMe", e[e.business = 1] = "business", e[e.restaurant = 2] = "restaurant";
729
- })(r.Level || (r.Level = {})), ((e) => {
730
- e.manage = "manage", e.create = "create", e.read = "read", e.update = "update", e.delete = "delete";
731
- })(r.Action || (r.Action = {}));
732
- })(Re || (Re = {}));
733
- ((r) => {
734
- ((e) => {
735
- ((t) => {
736
- t.all = "all", t.restaurant = "restaurant", t.business = "business", t.delivery = "delivery", t.agent = "agent";
737
- })(e.Feedme || (e.Feedme = {})), ((t) => {
738
- t.quota = "quota", t.owner = "owner";
739
- })(e.FeedmeBusinessField || (e.FeedmeBusinessField = {})), ((t) => {
740
- t.profile = "business::profile", t.restaurant = "business::restaurant", t.menu = "business::menu", t.promotion = "business::promotion", t.voucher = "business::voucher", t.membership = "business::membership", t.stock = "business::stock", t.permission = "business::permission", t.role = "business::role";
741
- })(e.Business || (e.Business = {})), ((t) => {
742
- t.restaurant = "restaurant";
743
- })(e.Restaurant || (e.Restaurant = {}));
744
- })(r.Subject || (r.Subject = {}));
745
- })(Re || (Re = {}));
746
- function Rn(r, e) {
747
- const n = ge().sessionUser.value;
748
- if (!n)
749
- return;
750
- const { isAdmin: s } = n.role, o = n.permissions, i = e.filter((h) => h.businessId === r._id).length;
751
- return r.restaurantQuota > i && ((n == null ? void 0 : n.id) === r.ownerId || s) && new wn(o).can(
752
- Re.Action.manage,
753
- Re.Subject.Feedme.all
754
- );
755
- }
756
- const In = (r) => {
757
- const e = ae(r || "");
758
- function t(o) {
759
- return `${o}`.trim().toLowerCase();
760
- }
761
- const n = W(() => t(e.value));
762
- function s(o) {
763
- return n.value ? o.some((i) => t(i).includes(n.value)) : !0;
764
- }
765
- return { searchKey: e, filter: s };
766
- };
767
- function xt(r = "no name") {
768
- return {
769
- name: r,
770
- address: {
771
- line1: "",
772
- line2: "",
773
- state: "",
774
- city: "",
775
- postcode: "",
776
- country: "",
777
- coordinates: []
778
- },
779
- phoneNo: "",
780
- regNo: "",
781
- email: ""
782
- };
783
- }
784
- function kt() {
785
- return Te({
786
- line1: "",
787
- line2: "",
788
- city: "",
789
- postcode: "",
790
- state: "",
791
- country: "",
792
- coordinates: []
793
- });
794
- }
795
- function Te(r) {
796
- return {
797
- ...r,
798
- get formatted() {
799
- const { line1: e, line2: t, postcode: n, city: s, state: o, country: i } = r;
800
- return [e, t || "", n, s, o, i].map((h) => h.replace(/,\s*$/, "")).filter((h) => !!h.trim()).join(", ");
801
- },
802
- get isValidPostcode() {
803
- const e = Number.parseInt(r.postcode);
804
- return !isNaN(e);
805
- },
806
- get isValid() {
807
- const e = ["line2"];
808
- return Object.keys(r).filter((t) => !e.includes(t)).every((t) => !!r[t]);
809
- },
810
- get isValidCoordinate() {
811
- return (r.coordinates || []).length === 2;
812
- }
813
- };
814
- }
815
- const On = {
816
- class: /* @__PURE__ */ Z([
817
- "flex items-center",
818
- "px-24 pt-16 pb-8",
819
- "border-b border-fm-color-neutral-gray-100",
820
- "space-x-4"
821
- ])
822
- }, An = { class: "fm-typo-en-title-sm-600 mr-auto" }, Sn = {
823
- class: /* @__PURE__ */ Z(["flex flex-col", "flex-1 overflow-scroll", "w-full", "px-24"])
824
- }, Tn = /* @__PURE__ */ ee({
825
- __name: "FullScreenForm",
826
- props: {
827
- show: { type: Boolean },
828
- title: {},
829
- primaryAction: {},
830
- secondaryActions: {},
831
- zIndex: { default: 50 }
832
- },
833
- emits: ["onPrimary", "onCancel"],
834
- setup(r, { emit: e }) {
835
- const t = e, n = () => {
836
- t("onPrimary");
837
- }, s = () => {
838
- t("onCancel");
839
- };
840
- return (o, i) => {
841
- const h = q("fm-button"), p = q("fm-form");
842
- return D(), Q(Cr, { to: "body" }, [
843
- C(xr, { name: "fade" }, {
844
- default: H(() => [
845
- o.show ? (D(), Q(p, {
846
- key: 0,
847
- "blame-form-child-on-validation-failed": "",
848
- class: Z(["fixed inset-0", "flex flex-col", "w-screen h-dvh", "bg-fm-color-neutral-white"]),
849
- style: Fe({ zIndex: o.zIndex }),
850
- tabindex: "-1",
851
- onValidationSuccess: n,
852
- onKeyup: kr(s, ["esc"])
853
- }, {
854
- default: H(() => [
855
- O("div", On, [
856
- O("p", An, B(o.title), 1),
857
- me(o.$slots, "append-title", {}, void 0, !0),
858
- (D(!0), K(oe, null, be(o.secondaryActions, (d) => (D(), Q(h, {
859
- label: d.label,
860
- variant: "tertiary",
861
- onClick: d.click
862
- }, null, 8, ["label", "onClick"]))), 256)),
863
- C(h, {
864
- label: o.primaryAction.label,
865
- type: "submit",
866
- variant: "primary"
867
- }, null, 8, ["label"])
868
- ]),
869
- O("div", Sn, [
870
- me(o.$slots, "default", {}, void 0, !0)
871
- ])
872
- ]),
873
- _: 3
874
- }, 8, ["style"])) : fe("", !0)
875
- ]),
876
- _: 3
877
- })
878
- ]);
879
- };
880
- }
881
- });
882
- const Pn = /* @__PURE__ */ pr(Tn, [["__scopeId", "data-v-5b5c7179"]]), Ln = { class: "fm-typo-en-body-lg-600" }, Nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Mt = /* @__PURE__ */ ee({
883
- __name: "FormLabel",
884
- props: {
885
- label: {},
886
- optional: { type: Boolean, default: !1 },
887
- subLabel: {}
888
- },
889
- setup(r) {
890
- const e = r, t = W(() => e.optional && !e.subLabel ? "(optional)" : e.subLabel);
891
- return (n, s) => (D(), K("p", Ln, [
892
- je(B(n.label) + " ", 1),
893
- O("span", Nn, B(t.value), 1)
894
- ]));
895
- }
896
- }), Cn = { class: "space-y-4" }, xn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, kn = { class: "fm-typo-en-body-lg-600" }, Vt = /* @__PURE__ */ ee({
897
- __name: "InfoBasic",
898
- props: {
899
- name: {
900
- type: String,
901
- required: !0
902
- },
903
- value: {
904
- type: String,
905
- required: !0
906
- }
907
- },
908
- setup(r) {
909
- return (e, t) => (D(), K("div", Cn, [
910
- O("div", xn, B(r.name), 1),
911
- O("div", kn, B(r.value), 1)
912
- ]));
913
- }
914
- }), Mn = {};
915
- function Vn(r, e) {
916
- return D(), K("div", null, e[0] || (e[0] = [
917
- O("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
918
- ]));
919
- }
920
- const Fn = /* @__PURE__ */ pr(Mn, [["render", Vn]]), jn = {
921
- key: 0,
922
- class: "ml-40 w-[320px] fm-corner-radius-lg p-16 border border-fm-color-neutral-gray-200 space-y-4"
923
- }, Dn = { class: "fm-typo-en-title-sm-600" }, Ft = /* @__PURE__ */ ee({
924
- __name: "Summary",
925
- props: {
926
- title: {},
927
- variant: {},
928
- items: {}
929
- },
930
- setup(r) {
931
- const e = r, t = fr();
932
- function n() {
933
- t.open({
934
- title: e.title,
935
- contentComponent: Ot("div", { class: "space-y-4" }, [
936
- ...e.items.map(
937
- (s) => Ot(Vt, {
938
- name: s.name,
939
- value: s.value || "--"
940
- })
941
- )
942
- ])
943
- });
944
- }
945
- return (s, o) => {
946
- const i = q("FmButton");
947
- return e.variant === "full" ? (D(), K("div", jn, [
948
- O("div", Dn, B(s.title), 1),
949
- C(Fn),
950
- (D(!0), K(oe, null, be(s.items, (h) => (D(), Q(Vt, {
951
- key: h.name,
952
- name: h.name,
953
- value: h.value || "--"
954
- }, null, 8, ["name", "value"]))), 128))
955
- ])) : (D(), Q(i, {
956
- key: 1,
957
- icon: "info",
958
- variant: "tertiary",
959
- onClick: n
960
- }));
961
- };
962
- }
963
- }), Un = {
964
- key: 0,
965
- class: "space-y-4"
966
- }, Gn = { class: "fm-typo-en-body-lg-600" }, Bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Kn = {
967
- class: /* @__PURE__ */ Z(["absolute inset-0", "h-full w-full", "rounded-md overflow-hidden"])
968
- }, Hn = {
969
- class: /* @__PURE__ */ Z(["relative z-0", "w-full h-full", "overflow-hidden"])
970
- }, qn = ["src"], zn = { class: "fm-typo-en-body-lg-600" }, Yn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Ee = /* @__PURE__ */ ee({
971
- __name: "ImageDropField",
972
- props: {
973
- label: {},
974
- subLabel: {},
975
- modelValue: {},
976
- previousUrl: {},
977
- width: { default: 323 },
978
- height: { default: 216 },
979
- canDelete: { type: Boolean, default: !0 }
980
- },
981
- emits: ["update:model-value", "reset:model-value"],
982
- setup(r, { emit: e }) {
983
- const t = r, n = e, s = W(() => t.modelValue ? URL.createObjectURL(t.modelValue) : t.previousUrl);
984
- return (o, i) => {
985
- const h = q("fm-icon"), p = q("fm-drop-field");
986
- return s.value ? (D(), K("div", Un, [
987
- O("p", Gn, [
988
- je(B(t.label) + " ", 1),
989
- O("span", Bn, B(o.subLabel), 1)
990
- ]),
991
- O("div", {
992
- class: Z(["relative", "border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md"]),
993
- style: Fe({ width: `${t.width}px`, height: `${t.height}px` })
994
- }, [
995
- O("div", Kn, [
996
- O("div", Hn, [
997
- O("img", {
998
- class: Z(["h-full w-full", "object-cover"]),
999
- src: s.value,
1000
- alt: "product image"
1001
- }, null, 8, qn)
1002
- ])
1003
- ]),
1004
- o.canDelete ? (D(), K("button", {
1005
- key: 0,
1006
- class: Z([
1007
- "absolute top-12 right-12 z-10",
1008
- "w-24 h-24 rounded-[50%]",
1009
- "bg-fm-color-neutral-white"
1010
- ]),
1011
- type: "button",
1012
- onClick: i[0] || (i[0] = (d) => n("reset:model-value"))
1013
- }, [
1014
- C(h, { name: "close" })
1015
- ])) : fe("", !0)
1016
- ], 4)
1017
- ])) : (D(), Q(p, {
1018
- key: 1,
1019
- accept: ".jpg, .jpeg, .png, .gif",
1020
- style: Fe({ width: `${t.width}px`, height: `${t.height}px` }),
1021
- onFileUpload: i[1] || (i[1] = (d) => n("update:model-value", d))
1022
- }, {
1023
- label: H(() => [
1024
- O("p", zn, [
1025
- je(B(t.label) + " ", 1),
1026
- O("span", Yn, B(t.subLabel), 1)
1027
- ])
1028
- ]),
1029
- "accept-text": H(() => i[2] || (i[2] = [
1030
- O("p", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Accepts .jpg, .jpeg, .png, .gif ", -1)
1031
- ])),
1032
- _: 1
1033
- }, 8, ["style"]));
1034
- };
1035
- }
1036
- }), Xn = { class: "space-y-24" }, Wn = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Jn = { class: "flex-1" }, Zn = { class: "flex-1" }, Qn = { class: "flex gap-16 xs:flex-col xs:gap-24" }, es = { class: "flex-1" }, ts = { class: "flex-1" }, rs = { class: "flex gap-16 xs:flex-col xs:gap-24" }, ns = { class: "flex-1" }, ss = { class: "flex-1" }, as = /* @__PURE__ */ ee({
1037
- __name: "RestaurantAddress",
1038
- props: {
1039
- modelValue: {
1040
- type: Object,
1041
- required: !0
1042
- }
1043
- },
1044
- emits: ["update:model-value"],
1045
- setup(r, { emit: e }) {
1046
- const { t } = ye();
1047
- kt();
1048
- const n = r, s = e, o = W(() => we(n.modelValue || kt()));
1049
- function i(p) {
1050
- return (p || "").toString();
1051
- }
1052
- function h(p) {
1053
- s("update:model-value", p(o.value));
1054
- }
1055
- return (p, d) => {
1056
- const _ = q("FmTextField");
1057
- return D(), K("div", Xn, [
1058
- O("div", Wn, [
1059
- O("div", Jn, [
1060
- C(_, {
1061
- "model-value": o.value.line1,
1062
- label: S(t)("settings.address.line1"),
1063
- "label-mark": "required",
1064
- rules: [S(he)],
1065
- "onUpdate:modelValue": d[0] || (d[0] = ($) => h((y) => ({ ...y, line1: i($) })))
1066
- }, null, 8, ["model-value", "label", "rules"])
1067
- ]),
1068
- O("div", Zn, [
1069
- C(_, {
1070
- "model-value": o.value.line2,
1071
- label: S(t)("settings.address.line2"),
1072
- "onUpdate:modelValue": d[1] || (d[1] = ($) => h((y) => ({ ...y, line2: i($) })))
1073
- }, null, 8, ["model-value", "label"])
1074
- ])
1075
- ]),
1076
- O("div", Qn, [
1077
- O("div", es, [
1078
- C(_, {
1079
- "model-value": o.value.city,
1080
- rules: [S(he)],
1081
- label: S(t)("settings.address.city"),
1082
- "label-mark": "required",
1083
- "onUpdate:modelValue": d[2] || (d[2] = ($) => h((y) => ({ ...y, city: i($) })))
1084
- }, null, 8, ["model-value", "rules", "label"])
1085
- ]),
1086
- O("div", ts, [
1087
- C(_, {
1088
- "model-value": o.value.postcode,
1089
- label: S(t)("settings.address.postal_code"),
1090
- "label-mark": "required",
1091
- rules: [S(he)],
1092
- "onUpdate:modelValue": d[3] || (d[3] = ($) => h((y) => ({ ...y, postcode: i($) })))
1093
- }, null, 8, ["model-value", "label", "rules"])
1094
- ])
1095
- ]),
1096
- O("div", rs, [
1097
- O("div", ns, [
1098
- C(_, {
1099
- "model-value": o.value.state,
1100
- label: S(t)("settings.address.state"),
1101
- "label-mark": "required",
1102
- rules: [S(he)],
1103
- "onUpdate:modelValue": d[4] || (d[4] = ($) => h((y) => ({ ...y, state: i($) })))
1104
- }, null, 8, ["model-value", "label", "rules"])
1105
- ]),
1106
- O("div", ss, [
1107
- C(_, {
1108
- "model-value": o.value.country,
1109
- label: S(t)("settings.address.country"),
1110
- "label-mark": "required",
1111
- rules: [S(he)],
1112
- "onUpdate:modelValue": d[5] || (d[5] = ($) => h((y) => ({ ...y, country: i($) })))
1113
- }, null, 8, ["model-value", "label", "rules"])
1114
- ])
1115
- ])
1116
- ]);
1117
- };
1118
- }
1119
- }), os = /* @__PURE__ */ ee({
1120
- __name: "GoogleMap",
1121
- props: {
1122
- markers: {
1123
- type: Array,
1124
- default: () => []
1125
- },
1126
- polygons: {
1127
- type: Array,
1128
- default: () => []
1129
- },
1130
- zoom: {
1131
- type: Number,
1132
- default: 14
1133
- },
1134
- editable: {
1135
- type: Boolean,
1136
- default: !1
1137
- },
1138
- center: {
1139
- type: Object,
1140
- default: De.jb
1141
- }
1142
- },
1143
- emits: ["map-click", "marker-change", "polygon-change", "polygon-right-click"],
1144
- setup(r, { expose: e, emit: t }) {
1145
- const n = r, s = t;
1146
- e({
1147
- setCenter: (a) => {
1148
- var l;
1149
- (l = i.value) == null || l.setCenter(a);
1150
- }
1151
- });
1152
- const o = ae(), i = ae(null), h = [];
1153
- function p(a) {
1154
- return {
1155
- lat: a.latLng.lat(),
1156
- lng: a.latLng.lng()
1157
- };
1158
- }
1159
- function d(a, l, g) {
1160
- const A = _e().maps.event.addListener(a, l, g);
1161
- h.push(A);
1162
- }
1163
- const _ = ae([]);
1164
- function $(a, l, g) {
1165
- d(a, l, g);
1166
- }
1167
- function y(a) {
1168
- w(null), _.value = a.map((l, g) => {
1169
- const A = _e(), L = new A.maps.Marker({
1170
- position: l,
1171
- draggable: !0
1172
- });
1173
- return $(L, "dragend", (f) => {
1174
- s("marker-change", { index: g, position: p(f) });
1175
- }), L;
1176
- }), w(i.value);
1177
- }
1178
- function w(a) {
1179
- _.value.map((l) => St(l).setMap(a));
1180
- }
1181
- const E = ae([]);
1182
- function R(a, l, g) {
1183
- d(a, l, g);
1184
- }
1185
- function M(a, l, g) {
1186
- d(a, l, g);
1187
- }
1188
- function x(a) {
1189
- return E.value[a].getPath().getArray().map(({ lat: g, lng: A }) => ({
1190
- lat: g(),
1191
- lng: A()
1192
- }));
1193
- }
1194
- function F(a) {
1195
- const l = x(a);
1196
- s("polygon-change", { index: a, path: l });
1197
- }
1198
- function T(a, l) {
1199
- const A = x(a).filter((L, f) => f !== l);
1200
- s("polygon-change", { index: a, path: A });
1201
- }
1202
- function U(a, l) {
1203
- l.vertex !== void 0 ? T(a, l.vertex) : s("polygon-right-click", a);
1204
- }
1205
- function X(a) {
1206
- z(null), E.value = a.map((l, g) => {
1207
- const A = _e(), L = new A.maps.Polygon({
1208
- paths: l.paths,
1209
- strokeColor: l.strokeColor,
1210
- fillColor: l.fillColor,
1211
- fillOpacity: 0.5,
1212
- editable: n.editable
1213
- });
1214
- return R(L, "contextmenu", (f) => U(g, f)), L.getPaths().forEach((f) => {
1215
- M(f, "insert_at", () => F(g)), M(f, "set_at", () => F(g));
1216
- }), L;
1217
- }), z(i.value);
1218
- }
1219
- function z(a) {
1220
- E.value.map((l) => St(l).setMap(a));
1221
- }
1222
- function G(a, l, g) {
1223
- d(a, l, g);
1224
- }
1225
- function Y() {
1226
- const a = _e().maps.Map;
1227
- i.value = new a(o.value, {
1228
- center: n.center,
1229
- zoom: n.zoom,
1230
- mapTypeControl: !1,
1231
- streetViewControl: !1,
1232
- draggable: !0,
1233
- scrollwheel: !0
1234
- }), G(i.value, "click", (l) => s("map-click", p(l)));
1235
- }
1236
- return At(() => n.markers, y, { deep: !0 }), At(() => n.polygons, X, { deep: !0 }), Mr(() => {
1237
- !o.value || !_e() || (Y(), y(n.markers), X(n.polygons));
1238
- }), Vr(() => {
1239
- h.forEach((a) => a.remove());
1240
- }), (a, l) => (D(), K("div", {
1241
- ref_key: "mapRef",
1242
- ref: o,
1243
- class: "map app-map"
1244
- }, null, 512));
1245
- }
1246
- }), is = { class: "space-y-24" }, ls = { class: "flex flex-row gap-8" }, us = { class: "flex gap-8" }, cs = { class: "flex gap-8" }, ds = /* @__PURE__ */ ee({
1247
- __name: "CoordinateDialog",
1248
- props: {
1249
- address: {
1250
- type: String,
1251
- required: !0
1252
- },
1253
- coordinate: {
1254
- type: Object,
1255
- default: void 0
1256
- }
1257
- },
1258
- setup(r) {
1259
- const { t: e } = ye(), t = r, { emitData: n } = Hr(), s = mt(
1260
- we(t.coordinate ? t.coordinate : De.jb)
1261
- );
1262
- function o({ position: i }) {
1263
- s.lat = i.lat, s.lng = i.lng, n(s);
1264
- }
1265
- return n(s), (i, h) => (D(), K("div", is, [
1266
- O("div", null, [
1267
- O("div", ls, [
1268
- O("div", null, B(S(e)("settings.coordinate_dialog.address")) + ":", 1),
1269
- O("div", null, B(r.address || "--"), 1)
1270
- ]),
1271
- O("div", us, [
1272
- O("div", null, B(S(e)("settings.coordinate_dialog.latitude")) + ":", 1),
1273
- O("div", null, B(s.lat), 1)
1274
- ]),
1275
- O("div", cs, [
1276
- O("div", null, B(S(e)("settings.coordinate_dialog.longitude")) + ":", 1),
1277
- O("div", null, B(s.lng), 1)
1278
- ])
1279
- ]),
1280
- C(os, {
1281
- class: "w-full",
1282
- style: { height: "300px" },
1283
- editable: "",
1284
- center: s,
1285
- markers: [s],
1286
- onMarkerChange: o,
1287
- onMapClick: h[0] || (h[0] = (p) => o({ position: p }))
1288
- }, null, 8, ["center", "markers"])
1289
- ]));
1290
- }
1291
- }), fs = /* @__PURE__ */ ee({
1292
- __name: "CoordinateInput",
1293
- props: {
1294
- modelValue: {
1295
- type: Array,
1296
- default: void 0
1297
- },
1298
- address: {
1299
- type: Object,
1300
- required: !0
1301
- },
1302
- required: {
1303
- type: Boolean,
1304
- default: !1
1305
- }
1306
- },
1307
- emits: ["update:model-value"],
1308
- setup(r, { emit: e }) {
1309
- const { t } = ye(), n = r, s = e, o = fr(), i = W(() => {
1310
- const $ = n.modelValue || [];
1311
- return $.length < 2 ? null : zr($);
1312
- }), h = W(() => i.value ? `${i.value.lat}, ${i.value.lng}` : "");
1313
- async function p() {
1314
- const $ = _e().maps.Geocoder, y = new $();
1315
- let w = i.value;
1316
- w || await new Promise((E) => {
1317
- n.address.formatted ? y.geocode({ address: n.address.formatted }, (R) => {
1318
- var x;
1319
- const M = (x = R == null ? void 0 : R[0]) == null ? void 0 : x.geometry;
1320
- w = M ? { lng: M.location.lng(), lat: M.location.lat() } : De.jb, E(!0);
1321
- }) : (w = De.jb, E(!0));
1322
- }), o.open({
1323
- contentComponent: ds,
1324
- contentComponentProps: {
1325
- address: n.address.formatted,
1326
- coordinate: w
1327
- },
1328
- title: t("settings.coordinate_input.dialog.title"),
1329
- primaryActions: {
1330
- text: t("settings.coordinate_input.dialog.confirm"),
1331
- variant: "primary",
1332
- close: !0
1333
- },
1334
- secondaryActions: {
1335
- text: t("settings.coordinate_input.dialog.delete"),
1336
- variant: "destructive",
1337
- close: !0
1338
- }
1339
- }).onPrimary(async (E) => {
1340
- const R = E ? Yr(E) : [];
1341
- _(), s("update:model-value", R);
1342
- }).onSecondary(() => {
1343
- _(), s("update:model-value", []);
1344
- });
1345
- }
1346
- const d = ae(!1);
1347
- function _() {
1348
- d.value = !1;
1349
- }
1350
- return ($, y) => {
1351
- const w = q("FmIcon"), E = q("FmField"), R = q("FmFormGroup");
1352
- return D(), Q(R, {
1353
- modelValue: i.value,
1354
- "onUpdate:modelValue": y[0] || (y[0] = (M) => i.value = M),
1355
- label: S(t)("settings.coordinate_input.title")
1356
- }, {
1357
- default: H(() => [
1358
- C(E, {
1359
- class: "cursor-pointer",
1360
- onClick: p
1361
- }, {
1362
- prepend: H(() => [
1363
- me($.$slots, "prepend")
1364
- ]),
1365
- append: H(() => [
1366
- C(w, {
1367
- class: "text-fm-color-neutral-gray-400",
1368
- name: "location_on",
1369
- outline: "",
1370
- size: "md"
1371
- })
1372
- ]),
1373
- default: H(() => [
1374
- me($.$slots, "default", {}, () => [
1375
- O("div", {
1376
- class: Z([[i.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1377
- }, B(i.value ? h.value : S(t)("settings.coordinate_input.not_set")), 3)
1378
- ])
1379
- ]),
1380
- _: 3
1381
- })
1382
- ]),
1383
- _: 3
1384
- }, 8, ["modelValue", "label"]);
1385
- };
1386
- }
1387
- });
1388
- var yr = { exports: {} };
1389
- (function(r, e) {
1390
- (function(t, n) {
1391
- r.exports = n();
1392
- })(cr, function() {
1393
- var t = 1e3, n = 6e4, s = 36e5, o = "millisecond", i = "second", h = "minute", p = "hour", d = "day", _ = "week", $ = "month", y = "quarter", w = "year", E = "date", R = "Invalid Date", M = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, x = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, F = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(f) {
1394
- var u = ["th", "st", "nd", "rd"], m = f % 100;
1395
- return "[" + f + (u[(m - 20) % 10] || u[m] || u[0]) + "]";
1396
- } }, T = function(f, u, m) {
1397
- var v = String(f);
1398
- return !v || v.length >= u ? f : "" + Array(u + 1 - v.length).join(m) + f;
1399
- }, U = { s: T, z: function(f) {
1400
- var u = -f.utcOffset(), m = Math.abs(u), v = Math.floor(m / 60), c = m % 60;
1401
- return (u <= 0 ? "+" : "-") + T(v, 2, "0") + ":" + T(c, 2, "0");
1402
- }, m: function f(u, m) {
1403
- if (u.date() < m.date())
1404
- return -f(m, u);
1405
- var v = 12 * (m.year() - u.year()) + (m.month() - u.month()), c = u.clone().add(v, $), b = m - c < 0, I = u.clone().add(v + (b ? -1 : 1), $);
1406
- return +(-(v + (m - c) / (b ? c - I : I - c)) || 0);
1407
- }, a: function(f) {
1408
- return f < 0 ? Math.ceil(f) || 0 : Math.floor(f);
1409
- }, p: function(f) {
1410
- return { M: $, y: w, w: _, d, D: E, h: p, m: h, s: i, ms: o, Q: y }[f] || String(f || "").toLowerCase().replace(/s$/, "");
1411
- }, u: function(f) {
1412
- return f === void 0;
1413
- } }, X = "en", z = {};
1414
- z[X] = F;
1415
- var G = "$isDayjsObject", Y = function(f) {
1416
- return f instanceof A || !(!f || !f[G]);
1417
- }, a = function f(u, m, v) {
1418
- var c;
1419
- if (!u)
1420
- return X;
1421
- if (typeof u == "string") {
1422
- var b = u.toLowerCase();
1423
- z[b] && (c = b), m && (z[b] = m, c = b);
1424
- var I = u.split("-");
1425
- if (!c && I.length > 1)
1426
- return f(I[0]);
1427
- } else {
1428
- var k = u.name;
1429
- z[k] = u, c = k;
1430
- }
1431
- return !v && c && (X = c), c || !v && X;
1432
- }, l = function(f, u) {
1433
- if (Y(f))
1434
- return f.clone();
1435
- var m = typeof u == "object" ? u : {};
1436
- return m.date = f, m.args = arguments, new A(m);
1437
- }, g = U;
1438
- g.l = a, g.i = Y, g.w = function(f, u) {
1439
- return l(f, { locale: u.$L, utc: u.$u, x: u.$x, $offset: u.$offset });
1440
- };
1441
- var A = function() {
1442
- function f(m) {
1443
- this.$L = a(m.locale, null, !0), this.parse(m), this.$x = this.$x || m.x || {}, this[G] = !0;
1444
- }
1445
- var u = f.prototype;
1446
- return u.parse = function(m) {
1447
- this.$d = function(v) {
1448
- var c = v.date, b = v.utc;
1449
- if (c === null)
1450
- return /* @__PURE__ */ new Date(NaN);
1451
- if (g.u(c))
1452
- return /* @__PURE__ */ new Date();
1453
- if (c instanceof Date)
1454
- return new Date(c);
1455
- if (typeof c == "string" && !/Z$/i.test(c)) {
1456
- var I = c.match(M);
1457
- if (I) {
1458
- var k = I[2] - 1 || 0, N = (I[7] || "0").substring(0, 3);
1459
- return b ? new Date(Date.UTC(I[1], k, I[3] || 1, I[4] || 0, I[5] || 0, I[6] || 0, N)) : new Date(I[1], k, I[3] || 1, I[4] || 0, I[5] || 0, I[6] || 0, N);
1460
- }
1461
- }
1462
- return new Date(c);
1463
- }(m), this.init();
1464
- }, u.init = function() {
1465
- var m = this.$d;
1466
- this.$y = m.getFullYear(), this.$M = m.getMonth(), this.$D = m.getDate(), this.$W = m.getDay(), this.$H = m.getHours(), this.$m = m.getMinutes(), this.$s = m.getSeconds(), this.$ms = m.getMilliseconds();
1467
- }, u.$utils = function() {
1468
- return g;
1469
- }, u.isValid = function() {
1470
- return this.$d.toString() !== R;
1471
- }, u.isSame = function(m, v) {
1472
- var c = l(m);
1473
- return this.startOf(v) <= c && c <= this.endOf(v);
1474
- }, u.isAfter = function(m, v) {
1475
- return l(m) < this.startOf(v);
1476
- }, u.isBefore = function(m, v) {
1477
- return this.endOf(v) < l(m);
1478
- }, u.$g = function(m, v, c) {
1479
- return g.u(m) ? this[v] : this.set(c, m);
1480
- }, u.unix = function() {
1481
- return Math.floor(this.valueOf() / 1e3);
1482
- }, u.valueOf = function() {
1483
- return this.$d.getTime();
1484
- }, u.startOf = function(m, v) {
1485
- var c = this, b = !!g.u(v) || v, I = g.p(m), k = function(de, re) {
1486
- var pe = g.w(c.$u ? Date.UTC(c.$y, re, de) : new Date(c.$y, re, de), c);
1487
- return b ? pe : pe.endOf(d);
1488
- }, N = function(de, re) {
1489
- return g.w(c.toDate()[de].apply(c.toDate("s"), (b ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(re)), c);
1490
- }, P = this.$W, j = this.$M, V = this.$D, J = "set" + (this.$u ? "UTC" : "");
1491
- switch (I) {
1492
- case w:
1493
- return b ? k(1, 0) : k(31, 11);
1494
- case $:
1495
- return b ? k(1, j) : k(0, j + 1);
1496
- case _:
1497
- var ne = this.$locale().weekStart || 0, ce = (P < ne ? P + 7 : P) - ne;
1498
- return k(b ? V - ce : V + (6 - ce), j);
1499
- case d:
1500
- case E:
1501
- return N(J + "Hours", 0);
1502
- case p:
1503
- return N(J + "Minutes", 1);
1504
- case h:
1505
- return N(J + "Seconds", 2);
1506
- case i:
1507
- return N(J + "Milliseconds", 3);
1508
- default:
1509
- return this.clone();
1510
- }
1511
- }, u.endOf = function(m) {
1512
- return this.startOf(m, !1);
1513
- }, u.$set = function(m, v) {
1514
- var c, b = g.p(m), I = "set" + (this.$u ? "UTC" : ""), k = (c = {}, c[d] = I + "Date", c[E] = I + "Date", c[$] = I + "Month", c[w] = I + "FullYear", c[p] = I + "Hours", c[h] = I + "Minutes", c[i] = I + "Seconds", c[o] = I + "Milliseconds", c)[b], N = b === d ? this.$D + (v - this.$W) : v;
1515
- if (b === $ || b === w) {
1516
- var P = this.clone().set(E, 1);
1517
- P.$d[k](N), P.init(), this.$d = P.set(E, Math.min(this.$D, P.daysInMonth())).$d;
1518
- } else
1519
- k && this.$d[k](N);
1520
- return this.init(), this;
1521
- }, u.set = function(m, v) {
1522
- return this.clone().$set(m, v);
1523
- }, u.get = function(m) {
1524
- return this[g.p(m)]();
1525
- }, u.add = function(m, v) {
1526
- var c, b = this;
1527
- m = Number(m);
1528
- var I = g.p(v), k = function(j) {
1529
- var V = l(b);
1530
- return g.w(V.date(V.date() + Math.round(j * m)), b);
1531
- };
1532
- if (I === $)
1533
- return this.set($, this.$M + m);
1534
- if (I === w)
1535
- return this.set(w, this.$y + m);
1536
- if (I === d)
1537
- return k(1);
1538
- if (I === _)
1539
- return k(7);
1540
- var N = (c = {}, c[h] = n, c[p] = s, c[i] = t, c)[I] || 1, P = this.$d.getTime() + m * N;
1541
- return g.w(P, this);
1542
- }, u.subtract = function(m, v) {
1543
- return this.add(-1 * m, v);
1544
- }, u.format = function(m) {
1545
- var v = this, c = this.$locale();
1546
- if (!this.isValid())
1547
- return c.invalidDate || R;
1548
- var b = m || "YYYY-MM-DDTHH:mm:ssZ", I = g.z(this), k = this.$H, N = this.$m, P = this.$M, j = c.weekdays, V = c.months, J = c.meridiem, ne = function(re, pe, Oe, Le) {
1549
- return re && (re[pe] || re(v, b)) || Oe[pe].slice(0, Le);
1550
- }, ce = function(re) {
1551
- return g.s(k % 12 || 12, re, "0");
1552
- }, de = J || function(re, pe, Oe) {
1553
- var Le = re < 12 ? "AM" : "PM";
1554
- return Oe ? Le.toLowerCase() : Le;
1555
- };
1556
- return b.replace(x, function(re, pe) {
1557
- return pe || function(Oe) {
1558
- switch (Oe) {
1559
- case "YY":
1560
- return String(v.$y).slice(-2);
1561
- case "YYYY":
1562
- return g.s(v.$y, 4, "0");
1563
- case "M":
1564
- return P + 1;
1565
- case "MM":
1566
- return g.s(P + 1, 2, "0");
1567
- case "MMM":
1568
- return ne(c.monthsShort, P, V, 3);
1569
- case "MMMM":
1570
- return ne(V, P);
1571
- case "D":
1572
- return v.$D;
1573
- case "DD":
1574
- return g.s(v.$D, 2, "0");
1575
- case "d":
1576
- return String(v.$W);
1577
- case "dd":
1578
- return ne(c.weekdaysMin, v.$W, j, 2);
1579
- case "ddd":
1580
- return ne(c.weekdaysShort, v.$W, j, 3);
1581
- case "dddd":
1582
- return j[v.$W];
1583
- case "H":
1584
- return String(k);
1585
- case "HH":
1586
- return g.s(k, 2, "0");
1587
- case "h":
1588
- return ce(1);
1589
- case "hh":
1590
- return ce(2);
1591
- case "a":
1592
- return de(k, N, !0);
1593
- case "A":
1594
- return de(k, N, !1);
1595
- case "m":
1596
- return String(N);
1597
- case "mm":
1598
- return g.s(N, 2, "0");
1599
- case "s":
1600
- return String(v.$s);
1601
- case "ss":
1602
- return g.s(v.$s, 2, "0");
1603
- case "SSS":
1604
- return g.s(v.$ms, 3, "0");
1605
- case "Z":
1606
- return I;
1607
- }
1608
- return null;
1609
- }(re) || I.replace(":", "");
1610
- });
1611
- }, u.utcOffset = function() {
1612
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1613
- }, u.diff = function(m, v, c) {
1614
- var b, I = this, k = g.p(v), N = l(m), P = (N.utcOffset() - this.utcOffset()) * n, j = this - N, V = function() {
1615
- return g.m(I, N);
1616
- };
1617
- switch (k) {
1618
- case w:
1619
- b = V() / 12;
1620
- break;
1621
- case $:
1622
- b = V();
1623
- break;
1624
- case y:
1625
- b = V() / 3;
1626
- break;
1627
- case _:
1628
- b = (j - P) / 6048e5;
1629
- break;
1630
- case d:
1631
- b = (j - P) / 864e5;
1632
- break;
1633
- case p:
1634
- b = j / s;
1635
- break;
1636
- case h:
1637
- b = j / n;
1638
- break;
1639
- case i:
1640
- b = j / t;
1641
- break;
1642
- default:
1643
- b = j;
1644
- }
1645
- return c ? b : g.a(b);
1646
- }, u.daysInMonth = function() {
1647
- return this.endOf($).$D;
1648
- }, u.$locale = function() {
1649
- return z[this.$L];
1650
- }, u.locale = function(m, v) {
1651
- if (!m)
1652
- return this.$L;
1653
- var c = this.clone(), b = a(m, v, !0);
1654
- return b && (c.$L = b), c;
1655
- }, u.clone = function() {
1656
- return g.w(this.$d, this);
1657
- }, u.toDate = function() {
1658
- return new Date(this.valueOf());
1659
- }, u.toJSON = function() {
1660
- return this.isValid() ? this.toISOString() : null;
1661
- }, u.toISOString = function() {
1662
- return this.$d.toISOString();
1663
- }, u.toString = function() {
1664
- return this.$d.toUTCString();
1665
- }, f;
1666
- }(), L = A.prototype;
1667
- return l.prototype = L, [["$ms", o], ["$s", i], ["$m", h], ["$H", p], ["$W", d], ["$M", $], ["$y", w], ["$D", E]].forEach(function(f) {
1668
- L[f[1]] = function(u) {
1669
- return this.$g(u, f[0], f[1]);
1670
- };
1671
- }), l.extend = function(f, u) {
1672
- return f.$i || (f(u, A, l), f.$i = !0), l;
1673
- }, l.locale = a, l.isDayjs = Y, l.unix = function(f) {
1674
- return l(1e3 * f);
1675
- }, l.en = z[X], l.Ls = z, l.p = {}, l;
1676
- });
1677
- })(yr);
1678
- var ms = yr.exports;
1679
- const gt = /* @__PURE__ */ pt(ms), ps = { class: "w-[140px] pt-16" }, hs = { class: "pl-32" }, vs = {
1680
- key: 1,
1681
- class: "flex gap-8 items-center my-8"
1682
- }, gs = /* @__PURE__ */ ee({
1683
- __name: "OperationHoursInput",
1684
- props: {
1685
- modelValue: {
1686
- type: Object,
1687
- default: void 0
1688
- },
1689
- title: {
1690
- type: String,
1691
- required: !1
1692
- }
1693
- },
1694
- emits: ["update:model-value"],
1695
- setup(r, { emit: e }) {
1696
- const t = r, n = e, s = ht(), { t: o } = ye();
1697
- gt().startOf("week");
1698
- const i = W(
1699
- () => [
1700
- o("settings.operation_hours.mon"),
1701
- o("settings.operation_hours.tue"),
1702
- o("settings.operation_hours.wed"),
1703
- o("settings.operation_hours.thu"),
1704
- o("settings.operation_hours.fri"),
1705
- o("settings.operation_hours.sat"),
1706
- o("settings.operation_hours.sun")
1707
- ].map((x, F) => ({
1708
- key: F.toString(),
1709
- label: x,
1710
- value: F < 6 ? F + 1 : 0,
1711
- // key of OperatingHours, since data start from sunday, UI start from monday
1712
- slot: `checkbox-${F}-end`
1713
- }))
1714
- ), h = W(
1715
- () => t.modelValue ? Object.values(t.modelValue) : Array.from(Array(7)).map(() => ({
1716
- enable: !1,
1717
- hours: []
1718
- }))
1719
- ), p = W(() => Object.values(h.value).map((x) => x.hours)), d = W(() => h.value.reduce((x, F, T) => (F.hours.length > 0 && x.push(T), x), []));
1720
- function _() {
1721
- return { start: "00:00", end: "23:59" };
1722
- }
1723
- function $(x) {
1724
- const F = d.value.find((U) => !x.includes(U));
1725
- if (F !== void 0) {
1726
- M((U) => (U[F].enable = !1, U[F].hours = [], U));
1727
- return;
1728
- }
1729
- const T = x.find((U) => !d.value.includes(U));
1730
- T !== void 0 && h.value[T].hours.length === 0 && M((U) => (U[T].enable = !0, U[T].hours = [_()], U));
1731
- }
1732
- function y(x) {
1733
- M((F) => (F[x].hours.push(_()), F));
1734
- }
1735
- function w(x, F) {
1736
- p.value[x].length > 1 ? M((T) => (T[x].hours.splice(F, 1), T)) : s.open({ title: o("settings.operation_hours.cannot_remove_last"), type: "error" });
1737
- }
1738
- function E(x, F, T) {
1739
- T && M((U) => (U[x].hours[F].start = T, U));
1740
- }
1741
- function R(x, F, T) {
1742
- T && M((U) => (U[x].hours[F].end = T, U));
1743
- }
1744
- function M(x) {
1745
- const F = x(we(h.value)), T = {
1746
- 0: F[0],
1747
- 1: F[1],
1748
- 2: F[2],
1749
- 3: F[3],
1750
- 4: F[4],
1751
- 5: F[5],
1752
- 6: F[6]
1753
- };
1754
- n("update:model-value", T);
1755
- }
1756
- return (x, F) => {
1757
- const T = q("FmCheckbox"), U = q("FmTimePicker"), X = q("FmButton"), z = q("FmField");
1758
- return D(), K("div", null, [
1759
- (D(!0), K(oe, null, be(i.value, (G) => (D(), K("div", {
1760
- key: G.value,
1761
- class: "flex flex-col items-start"
1762
- }, [
1763
- O("div", ps, [
1764
- C(T, {
1765
- "model-value": d.value,
1766
- label: G.label,
1767
- value: G.value,
1768
- "onUpdate:modelValue": $
1769
- }, null, 8, ["model-value", "label", "value"])
1770
- ]),
1771
- O("div", hs, [
1772
- O("div", null, [
1773
- d.value.includes(G.value) ? (D(!0), K(oe, { key: 0 }, be(p.value[G.value], (Y, a) => (D(), K("div", {
1774
- key: a,
1775
- class: "flex items-center gap-8"
1776
- }, [
1777
- C(U, {
1778
- "model-value": Y.start,
1779
- "onUpdate:modelValue": (l) => E(G.value, a, l)
1780
- }, null, 8, ["model-value", "onUpdate:modelValue"]),
1781
- O("span", {
1782
- class: Z([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
1783
- }, B(S(o)("settings.operation_hours.to")), 1),
1784
- C(U, {
1785
- "model-value": Y.end,
1786
- "onUpdate:modelValue": (l) => R(G.value, a, l)
1787
- }, null, 8, ["model-value", "onUpdate:modelValue"]),
1788
- C(X, {
1789
- icon: "close",
1790
- variant: "tertiary",
1791
- onClick: (l) => w(G.value, a)
1792
- }, null, 8, ["onClick"]),
1793
- C(X, {
1794
- class: Z(a === 0 ? "" : "invisible"),
1795
- icon: "add",
1796
- color: "primary",
1797
- variant: "secondary",
1798
- onClick: (l) => y(G.value)
1799
- }, null, 8, ["class", "onClick"])
1800
- ]))), 128)) : (D(), K("div", vs, [
1801
- C(z, null, {
1802
- default: H(() => [
1803
- O("div", {
1804
- class: Z([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1805
- }, B(S(o)("settings.operation_hours.close")), 1)
1806
- ]),
1807
- _: 1
1808
- }),
1809
- O("span", {
1810
- class: Z([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
1811
- }, B(S(o)("settings.operation_hours.to")), 1),
1812
- C(z, null, {
1813
- default: H(() => [
1814
- O("div", {
1815
- class: Z([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1816
- }, B(S(o)("settings.operation_hours.close")), 1)
1817
- ]),
1818
- _: 1
1819
- })
1820
- ]))
1821
- ])
1822
- ])
1823
- ]))), 128))
1824
- ]);
1825
- };
1826
- }
1827
- }), $r = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), _r = [
1828
- "home",
1829
- "app",
1830
- "about",
1831
- "tnc",
1832
- "terms-and-conditions",
1833
- "redirection",
1834
- "redirect",
1835
- "auth",
1836
- "login",
1837
- "logout",
1838
- "register",
1839
- "user",
1840
- "discovery",
1841
- "discover",
1842
- "order",
1843
- "orders",
1844
- "membership",
1845
- "memberships",
1846
- "member",
1847
- "members",
1848
- "benefit",
1849
- "benefits",
1850
- "reward",
1851
- "rewards",
1852
- "voucher",
1853
- "vouchers",
1854
- "search",
1855
- "restaurant",
1856
- "restaurants",
1857
- "business",
1858
- "businesses",
1859
- "dine",
1860
- "profile",
1861
- "scan",
1862
- "scanner",
1863
- "menu",
1864
- "cart",
1865
- "me",
1866
- "v",
1867
- "active-orders",
1868
- "qr",
1869
- "setting",
1870
- "settings",
1871
- "error",
1872
- "supportdetails",
1873
- "support-details",
1874
- "stacks",
1875
- "imulus",
1876
- "github",
1877
- "twitter",
1878
- "facebook",
1879
- "google",
1880
- "apple",
1881
- "about",
1882
- "account",
1883
- "activate",
1884
- "add",
1885
- "admin",
1886
- "administrator",
1887
- "api",
1888
- "app",
1889
- "apps",
1890
- "archive",
1891
- "archives",
1892
- "auth",
1893
- "blog",
1894
- "cache",
1895
- "cancel",
1896
- "careers",
1897
- "cart",
1898
- "changelog",
1899
- "checkout",
1900
- "codereview",
1901
- "compare",
1902
- "config",
1903
- "configuration",
1904
- "connect",
1905
- "contact",
1906
- "create",
1907
- "delete",
1908
- "direct_messages",
1909
- "documentation",
1910
- "download",
1911
- "downloads",
1912
- "edit",
1913
- "email",
1914
- "employment",
1915
- "enterprise",
1916
- "faq",
1917
- "favorites",
1918
- "feed",
1919
- "feedback",
1920
- "feeds",
1921
- "fleet",
1922
- "fleets",
1923
- "follow",
1924
- "followers",
1925
- "following",
1926
- "friend",
1927
- "friends",
1928
- "gist",
1929
- "group",
1930
- "groups",
1931
- "help",
1932
- "home",
1933
- "hosting",
1934
- "hostmaster",
1935
- "idea",
1936
- "ideas",
1937
- "index",
1938
- "info",
1939
- "invitations",
1940
- "invite",
1941
- "is",
1942
- "it",
1943
- "job",
1944
- "jobs",
1945
- "json",
1946
- "language",
1947
- "languages",
1948
- "lists",
1949
- "login",
1950
- "logout",
1951
- "logs",
1952
- "mail",
1953
- "map",
1954
- "maps",
1955
- "mine",
1956
- "mis",
1957
- "news",
1958
- "oauth",
1959
- "oauth_clients",
1960
- "offers",
1961
- "openid",
1962
- "order",
1963
- "orders",
1964
- "organizations",
1965
- "plans",
1966
- "popular",
1967
- "post",
1968
- "postmaster",
1969
- "privacy",
1970
- "projects",
1971
- "put",
1972
- "recruitment",
1973
- "register",
1974
- "remove",
1975
- "replies",
1976
- "root",
1977
- "rss",
1978
- "sales",
1979
- "save",
1980
- "search",
1981
- "security",
1982
- "sessions",
1983
- "settings",
1984
- "shop",
1985
- "signup",
1986
- "sitemap",
1987
- "ssl",
1988
- "ssladmin",
1989
- "ssladministrator",
1990
- "sslwebmaster",
1991
- "status",
1992
- "stories",
1993
- "styleguide",
1994
- "subscribe",
1995
- "subscriptions",
1996
- "support",
1997
- "sysadmin",
1998
- "sysadministrator",
1999
- "terms",
2000
- "tour",
2001
- "translations",
2002
- "trends",
2003
- "unfollow",
2004
- "unsubscribe",
2005
- "update",
2006
- "url",
2007
- "user",
2008
- "weather",
2009
- "webmaster",
2010
- "widget",
2011
- "widgets",
2012
- "wiki",
2013
- "ww",
2014
- "www",
2015
- "wwww",
2016
- "xfn",
2017
- "xml",
2018
- "xmpp",
2019
- "yaml",
2020
- "yml",
2021
- "chinese",
2022
- "mandarin",
2023
- "spanish",
2024
- "english",
2025
- "bengali",
2026
- "hindi",
2027
- "portuguese",
2028
- "russian",
2029
- "japanese",
2030
- "german",
2031
- "wu",
2032
- "javanese",
2033
- "korean",
2034
- "french",
2035
- "vietnamese",
2036
- "telugu",
2037
- "chinese",
2038
- "marathi",
2039
- "tamil",
2040
- "turkish",
2041
- "urdu",
2042
- "min-nan",
2043
- "jinyu",
2044
- "gujarati",
2045
- "polish",
2046
- "arabic",
2047
- "ukrainian",
2048
- "italian",
2049
- "xiang",
2050
- "malayalam",
2051
- "hakka",
2052
- "kannada",
2053
- "oriya",
2054
- "panjabi",
2055
- "sunda",
2056
- "panjabi",
2057
- "romanian",
2058
- "bhojpuri",
2059
- "azerbaijani",
2060
- "farsi",
2061
- "maithili",
2062
- "hausa",
2063
- "arabic",
2064
- "burmese",
2065
- "serbo-croatian",
2066
- "gan",
2067
- "awadhi",
2068
- "thai",
2069
- "dutch",
2070
- "yoruba",
2071
- "sindhi",
2072
- "ac",
2073
- "ad",
2074
- "ae",
2075
- "af",
2076
- "ag",
2077
- "ai",
2078
- "al",
2079
- "am",
2080
- "an",
2081
- "ao",
2082
- "aq",
2083
- "ar",
2084
- "as",
2085
- "at",
2086
- "au",
2087
- "aw",
2088
- "ax",
2089
- "az",
2090
- "ba",
2091
- "bb",
2092
- "bd",
2093
- "be",
2094
- "bf",
2095
- "bg",
2096
- "bh",
2097
- "bi",
2098
- "bj",
2099
- "bm",
2100
- "bn",
2101
- "bo",
2102
- "br",
2103
- "bs",
2104
- "bt",
2105
- "bv",
2106
- "bw",
2107
- "by",
2108
- "bz",
2109
- "ca",
2110
- "cc",
2111
- "cd",
2112
- "cf",
2113
- "cg",
2114
- "ch",
2115
- "ci",
2116
- "ck",
2117
- "cl",
2118
- "cm",
2119
- "cn",
2120
- "co",
2121
- "cr",
2122
- "cs",
2123
- "cu",
2124
- "cv",
2125
- "cx",
2126
- "cy",
2127
- "cz",
2128
- "dd",
2129
- "de",
2130
- "dj",
2131
- "dk",
2132
- "dm",
2133
- "do",
2134
- "dz",
2135
- "ec",
2136
- "ee",
2137
- "eg",
2138
- "eh",
2139
- "er",
2140
- "es",
2141
- "et",
2142
- "eu",
2143
- "fi",
2144
- "fj",
2145
- "fk",
2146
- "fm",
2147
- "fo",
2148
- "fr",
2149
- "ga",
2150
- "gb",
2151
- "gd",
2152
- "ge",
2153
- "gf",
2154
- "gg",
2155
- "gh",
2156
- "gi",
2157
- "gl",
2158
- "gm",
2159
- "gn",
2160
- "gp",
2161
- "gq",
2162
- "gr",
2163
- "gs",
2164
- "gt",
2165
- "gu",
2166
- "gw",
2167
- "gy",
2168
- "hk",
2169
- "hm",
2170
- "hn",
2171
- "hr",
2172
- "ht",
2173
- "hu",
2174
- "id",
2175
- "ie",
2176
- "il",
2177
- "im",
2178
- "in",
2179
- "io",
2180
- "iq",
2181
- "ir",
2182
- "is",
2183
- "it",
2184
- "je",
2185
- "jm",
2186
- "jo",
2187
- "jp",
2188
- "ke",
2189
- "kg",
2190
- "kh",
2191
- "ki",
2192
- "km",
2193
- "kn",
2194
- "kp",
2195
- "kr",
2196
- "kw",
2197
- "ky",
2198
- "kz",
2199
- "la",
2200
- "lb",
2201
- "lc",
2202
- "li",
2203
- "lk",
2204
- "lr",
2205
- "ls",
2206
- "lt",
2207
- "lu",
2208
- "lv",
2209
- "ly",
2210
- "ma",
2211
- "mc",
2212
- "md",
2213
- "me",
2214
- "mg",
2215
- "mh",
2216
- "mk",
2217
- "ml",
2218
- "mm",
2219
- "mn",
2220
- "mo",
2221
- "mp",
2222
- "mq",
2223
- "mr",
2224
- "ms",
2225
- "mt",
2226
- "mu",
2227
- "mv",
2228
- "mw",
2229
- "mx",
2230
- "my",
2231
- "mz",
2232
- "na",
2233
- "nc",
2234
- "ne",
2235
- "nf",
2236
- "ng",
2237
- "ni",
2238
- "nl",
2239
- "no",
2240
- "np",
2241
- "nr",
2242
- "nu",
2243
- "nz",
2244
- "om",
2245
- "pa",
2246
- "pe",
2247
- "pf",
2248
- "pg",
2249
- "ph",
2250
- "pk",
2251
- "pl",
2252
- "pm",
2253
- "pn",
2254
- "pr",
2255
- "ps",
2256
- "pt",
2257
- "pw",
2258
- "py",
2259
- "qa",
2260
- "re",
2261
- "ro",
2262
- "rs",
2263
- "ru",
2264
- "rw",
2265
- "sa",
2266
- "sb",
2267
- "sc",
2268
- "sd",
2269
- "se",
2270
- "sg",
2271
- "sh",
2272
- "si",
2273
- "sj",
2274
- "sk",
2275
- "sl",
2276
- "sm",
2277
- "sn",
2278
- "so",
2279
- "sr",
2280
- "ss",
2281
- "st",
2282
- "su",
2283
- "sv",
2284
- "sy",
2285
- "sz",
2286
- "tc",
2287
- "td",
2288
- "tf",
2289
- "tg",
2290
- "th",
2291
- "tj",
2292
- "tk",
2293
- "tl",
2294
- "tm",
2295
- "tn",
2296
- "to",
2297
- "tp",
2298
- "tr",
2299
- "tt",
2300
- "tv",
2301
- "tw",
2302
- "tz",
2303
- "ua",
2304
- "ug",
2305
- "uk",
2306
- "us",
2307
- "uy",
2308
- "uz",
2309
- "va",
2310
- "vc",
2311
- "ve",
2312
- "vg",
2313
- "vi",
2314
- "vn",
2315
- "vu",
2316
- "wf",
2317
- "ws",
2318
- "ye",
2319
- "yt",
2320
- "yu",
2321
- "za",
2322
- "zm",
2323
- "zw"
2324
- ];
2325
- var dt = { exports: {} };
2326
- const bs = "2.0.0", Er = 256, ys = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
2327
- 9007199254740991, $s = 16, _s = Er - 6, Es = [
2328
- "major",
2329
- "premajor",
2330
- "minor",
2331
- "preminor",
2332
- "patch",
2333
- "prepatch",
2334
- "prerelease"
2335
- ];
2336
- var Be = {
2337
- MAX_LENGTH: Er,
2338
- MAX_SAFE_COMPONENT_LENGTH: $s,
2339
- MAX_SAFE_BUILD_LENGTH: _s,
2340
- MAX_SAFE_INTEGER: ys,
2341
- RELEASE_TYPES: Es,
2342
- SEMVER_SPEC_VERSION: bs,
2343
- FLAG_INCLUDE_PRERELEASE: 1,
2344
- FLAG_LOOSE: 2
2345
- };
2346
- const ws = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...r) => console.error("SEMVER", ...r) : () => {
2347
- };
2348
- var Ke = ws;
2349
- (function(r, e) {
2350
- const {
2351
- MAX_SAFE_COMPONENT_LENGTH: t,
2352
- MAX_SAFE_BUILD_LENGTH: n,
2353
- MAX_LENGTH: s
2354
- } = Be, o = Ke;
2355
- e = r.exports = {};
2356
- const i = e.re = [], h = e.safeRe = [], p = e.src = [], d = e.t = {};
2357
- let _ = 0;
2358
- const $ = "[a-zA-Z0-9-]", y = [
2359
- ["\\s", 1],
2360
- ["\\d", s],
2361
- [$, n]
2362
- ], w = (R) => {
2363
- for (const [M, x] of y)
2364
- R = R.split(`${M}*`).join(`${M}{0,${x}}`).split(`${M}+`).join(`${M}{1,${x}}`);
2365
- return R;
2366
- }, E = (R, M, x) => {
2367
- const F = w(M), T = _++;
2368
- o(R, T, M), d[R] = T, p[T] = M, i[T] = new RegExp(M, x ? "g" : void 0), h[T] = new RegExp(F, x ? "g" : void 0);
2369
- };
2370
- E("NUMERICIDENTIFIER", "0|[1-9]\\d*"), E("NUMERICIDENTIFIERLOOSE", "\\d+"), E("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${$}*`), E("MAINVERSION", `(${p[d.NUMERICIDENTIFIER]})\\.(${p[d.NUMERICIDENTIFIER]})\\.(${p[d.NUMERICIDENTIFIER]})`), E("MAINVERSIONLOOSE", `(${p[d.NUMERICIDENTIFIERLOOSE]})\\.(${p[d.NUMERICIDENTIFIERLOOSE]})\\.(${p[d.NUMERICIDENTIFIERLOOSE]})`), E("PRERELEASEIDENTIFIER", `(?:${p[d.NUMERICIDENTIFIER]}|${p[d.NONNUMERICIDENTIFIER]})`), E("PRERELEASEIDENTIFIERLOOSE", `(?:${p[d.NUMERICIDENTIFIERLOOSE]}|${p[d.NONNUMERICIDENTIFIER]})`), E("PRERELEASE", `(?:-(${p[d.PRERELEASEIDENTIFIER]}(?:\\.${p[d.PRERELEASEIDENTIFIER]})*))`), E("PRERELEASELOOSE", `(?:-?(${p[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[d.PRERELEASEIDENTIFIERLOOSE]})*))`), E("BUILDIDENTIFIER", `${$}+`), E("BUILD", `(?:\\+(${p[d.BUILDIDENTIFIER]}(?:\\.${p[d.BUILDIDENTIFIER]})*))`), E("FULLPLAIN", `v?${p[d.MAINVERSION]}${p[d.PRERELEASE]}?${p[d.BUILD]}?`), E("FULL", `^${p[d.FULLPLAIN]}$`), E("LOOSEPLAIN", `[v=\\s]*${p[d.MAINVERSIONLOOSE]}${p[d.PRERELEASELOOSE]}?${p[d.BUILD]}?`), E("LOOSE", `^${p[d.LOOSEPLAIN]}$`), E("GTLT", "((?:<|>)?=?)"), E("XRANGEIDENTIFIERLOOSE", `${p[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), E("XRANGEIDENTIFIER", `${p[d.NUMERICIDENTIFIER]}|x|X|\\*`), E("XRANGEPLAIN", `[v=\\s]*(${p[d.XRANGEIDENTIFIER]})(?:\\.(${p[d.XRANGEIDENTIFIER]})(?:\\.(${p[d.XRANGEIDENTIFIER]})(?:${p[d.PRERELEASE]})?${p[d.BUILD]}?)?)?`), E("XRANGEPLAINLOOSE", `[v=\\s]*(${p[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[d.XRANGEIDENTIFIERLOOSE]})(?:${p[d.PRERELEASELOOSE]})?${p[d.BUILD]}?)?)?`), E("XRANGE", `^${p[d.GTLT]}\\s*${p[d.XRANGEPLAIN]}$`), E("XRANGELOOSE", `^${p[d.GTLT]}\\s*${p[d.XRANGEPLAINLOOSE]}$`), E("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), E("COERCE", `${p[d.COERCEPLAIN]}(?:$|[^\\d])`), E("COERCEFULL", p[d.COERCEPLAIN] + `(?:${p[d.PRERELEASE]})?(?:${p[d.BUILD]})?(?:$|[^\\d])`), E("COERCERTL", p[d.COERCE], !0), E("COERCERTLFULL", p[d.COERCEFULL], !0), E("LONETILDE", "(?:~>?)"), E("TILDETRIM", `(\\s*)${p[d.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", E("TILDE", `^${p[d.LONETILDE]}${p[d.XRANGEPLAIN]}$`), E("TILDELOOSE", `^${p[d.LONETILDE]}${p[d.XRANGEPLAINLOOSE]}$`), E("LONECARET", "(?:\\^)"), E("CARETTRIM", `(\\s*)${p[d.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", E("CARET", `^${p[d.LONECARET]}${p[d.XRANGEPLAIN]}$`), E("CARETLOOSE", `^${p[d.LONECARET]}${p[d.XRANGEPLAINLOOSE]}$`), E("COMPARATORLOOSE", `^${p[d.GTLT]}\\s*(${p[d.LOOSEPLAIN]})$|^$`), E("COMPARATOR", `^${p[d.GTLT]}\\s*(${p[d.FULLPLAIN]})$|^$`), E("COMPARATORTRIM", `(\\s*)${p[d.GTLT]}\\s*(${p[d.LOOSEPLAIN]}|${p[d.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", E("HYPHENRANGE", `^\\s*(${p[d.XRANGEPLAIN]})\\s+-\\s+(${p[d.XRANGEPLAIN]})\\s*$`), E("HYPHENRANGELOOSE", `^\\s*(${p[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[d.XRANGEPLAINLOOSE]})\\s*$`), E("STAR", "(<|>)?=?\\s*\\*"), E("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), E("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
2371
- })(dt, dt.exports);
2372
- var Pe = dt.exports;
2373
- const Rs = Object.freeze({ loose: !0 }), Is = Object.freeze({}), Os = (r) => r ? typeof r != "object" ? Rs : r : Is;
2374
- var bt = Os;
2375
- const jt = /^[0-9]+$/, wr = (r, e) => {
2376
- const t = jt.test(r), n = jt.test(e);
2377
- return t && n && (r = +r, e = +e), r === e ? 0 : t && !n ? -1 : n && !t ? 1 : r < e ? -1 : 1;
2378
- }, As = (r, e) => wr(e, r);
2379
- var Rr = {
2380
- compareIdentifiers: wr,
2381
- rcompareIdentifiers: As
2382
- };
2383
- const Ce = Ke, { MAX_LENGTH: Dt, MAX_SAFE_INTEGER: xe } = Be, { safeRe: Ut, t: Gt } = Pe, Ss = bt, { compareIdentifiers: $e } = Rr;
2384
- let Ts = class ue {
2385
- constructor(e, t) {
2386
- if (t = Ss(t), e instanceof ue) {
2387
- if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
2388
- return e;
2389
- e = e.version;
2390
- } else if (typeof e != "string")
2391
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
2392
- if (e.length > Dt)
2393
- throw new TypeError(
2394
- `version is longer than ${Dt} characters`
2395
- );
2396
- Ce("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
2397
- const n = e.trim().match(t.loose ? Ut[Gt.LOOSE] : Ut[Gt.FULL]);
2398
- if (!n)
2399
- throw new TypeError(`Invalid Version: ${e}`);
2400
- if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > xe || this.major < 0)
2401
- throw new TypeError("Invalid major version");
2402
- if (this.minor > xe || this.minor < 0)
2403
- throw new TypeError("Invalid minor version");
2404
- if (this.patch > xe || this.patch < 0)
2405
- throw new TypeError("Invalid patch version");
2406
- n[4] ? this.prerelease = n[4].split(".").map((s) => {
2407
- if (/^[0-9]+$/.test(s)) {
2408
- const o = +s;
2409
- if (o >= 0 && o < xe)
2410
- return o;
2411
- }
2412
- return s;
2413
- }) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format();
2414
- }
2415
- format() {
2416
- return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
2417
- }
2418
- toString() {
2419
- return this.version;
2420
- }
2421
- compare(e) {
2422
- if (Ce("SemVer.compare", this.version, this.options, e), !(e instanceof ue)) {
2423
- if (typeof e == "string" && e === this.version)
2424
- return 0;
2425
- e = new ue(e, this.options);
2426
- }
2427
- return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
2428
- }
2429
- compareMain(e) {
2430
- return e instanceof ue || (e = new ue(e, this.options)), $e(this.major, e.major) || $e(this.minor, e.minor) || $e(this.patch, e.patch);
2431
- }
2432
- comparePre(e) {
2433
- if (e instanceof ue || (e = new ue(e, this.options)), this.prerelease.length && !e.prerelease.length)
2434
- return -1;
2435
- if (!this.prerelease.length && e.prerelease.length)
2436
- return 1;
2437
- if (!this.prerelease.length && !e.prerelease.length)
2438
- return 0;
2439
- let t = 0;
2440
- do {
2441
- const n = this.prerelease[t], s = e.prerelease[t];
2442
- if (Ce("prerelease compare", t, n, s), n === void 0 && s === void 0)
2443
- return 0;
2444
- if (s === void 0)
2445
- return 1;
2446
- if (n === void 0)
2447
- return -1;
2448
- if (n === s)
2449
- continue;
2450
- return $e(n, s);
2451
- } while (++t);
2452
- }
2453
- compareBuild(e) {
2454
- e instanceof ue || (e = new ue(e, this.options));
2455
- let t = 0;
2456
- do {
2457
- const n = this.build[t], s = e.build[t];
2458
- if (Ce("build compare", t, n, s), n === void 0 && s === void 0)
2459
- return 0;
2460
- if (s === void 0)
2461
- return 1;
2462
- if (n === void 0)
2463
- return -1;
2464
- if (n === s)
2465
- continue;
2466
- return $e(n, s);
2467
- } while (++t);
2468
- }
2469
- // preminor will bump the version up to the next minor release, and immediately
2470
- // down to pre-release. premajor and prepatch work the same way.
2471
- inc(e, t, n) {
2472
- switch (e) {
2473
- case "premajor":
2474
- this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, n);
2475
- break;
2476
- case "preminor":
2477
- this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, n);
2478
- break;
2479
- case "prepatch":
2480
- this.prerelease.length = 0, this.inc("patch", t, n), this.inc("pre", t, n);
2481
- break;
2482
- case "prerelease":
2483
- this.prerelease.length === 0 && this.inc("patch", t, n), this.inc("pre", t, n);
2484
- break;
2485
- case "major":
2486
- (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
2487
- break;
2488
- case "minor":
2489
- (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
2490
- break;
2491
- case "patch":
2492
- this.prerelease.length === 0 && this.patch++, this.prerelease = [];
2493
- break;
2494
- case "pre": {
2495
- const s = Number(n) ? 1 : 0;
2496
- if (!t && n === !1)
2497
- throw new Error("invalid increment argument: identifier is empty");
2498
- if (this.prerelease.length === 0)
2499
- this.prerelease = [s];
2500
- else {
2501
- let o = this.prerelease.length;
2502
- for (; --o >= 0; )
2503
- typeof this.prerelease[o] == "number" && (this.prerelease[o]++, o = -2);
2504
- if (o === -1) {
2505
- if (t === this.prerelease.join(".") && n === !1)
2506
- throw new Error("invalid increment argument: identifier already exists");
2507
- this.prerelease.push(s);
2508
- }
2509
- }
2510
- if (t) {
2511
- let o = [t, s];
2512
- n === !1 && (o = [t]), $e(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = o) : this.prerelease = o;
2513
- }
2514
- break;
2515
- }
2516
- default:
2517
- throw new Error(`invalid increment argument: ${e}`);
2518
- }
2519
- return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
2520
- }
2521
- };
2522
- var te = Ts;
2523
- const Bt = te, Ps = (r, e, t = !1) => {
2524
- if (r instanceof Bt)
2525
- return r;
2526
- try {
2527
- return new Bt(r, e);
2528
- } catch (n) {
2529
- if (!t)
2530
- return null;
2531
- throw n;
2532
- }
2533
- };
2534
- var Ie = Ps;
2535
- const Ls = Ie, Ns = (r, e) => {
2536
- const t = Ls(r, e);
2537
- return t ? t.version : null;
2538
- };
2539
- var Cs = Ns;
2540
- const xs = Ie, ks = (r, e) => {
2541
- const t = xs(r.trim().replace(/^[=v]+/, ""), e);
2542
- return t ? t.version : null;
2543
- };
2544
- var Ms = ks;
2545
- const Kt = te, Vs = (r, e, t, n, s) => {
2546
- typeof t == "string" && (s = n, n = t, t = void 0);
2547
- try {
2548
- return new Kt(
2549
- r instanceof Kt ? r.version : r,
2550
- t
2551
- ).inc(e, n, s).version;
2552
- } catch {
2553
- return null;
2554
- }
2555
- };
2556
- var Fs = Vs;
2557
- const Ht = Ie, js = (r, e) => {
2558
- const t = Ht(r, null, !0), n = Ht(e, null, !0), s = t.compare(n);
2559
- if (s === 0)
2560
- return null;
2561
- const o = s > 0, i = o ? t : n, h = o ? n : t, p = !!i.prerelease.length;
2562
- if (!!h.prerelease.length && !p)
2563
- return !h.patch && !h.minor ? "major" : i.patch ? "patch" : i.minor ? "minor" : "major";
2564
- const _ = p ? "pre" : "";
2565
- return t.major !== n.major ? _ + "major" : t.minor !== n.minor ? _ + "minor" : t.patch !== n.patch ? _ + "patch" : "prerelease";
2566
- };
2567
- var Ds = js;
2568
- const Us = te, Gs = (r, e) => new Us(r, e).major;
2569
- var Bs = Gs;
2570
- const Ks = te, Hs = (r, e) => new Ks(r, e).minor;
2571
- var qs = Hs;
2572
- const zs = te, Ys = (r, e) => new zs(r, e).patch;
2573
- var Xs = Ys;
2574
- const Ws = Ie, Js = (r, e) => {
2575
- const t = Ws(r, e);
2576
- return t && t.prerelease.length ? t.prerelease : null;
2577
- };
2578
- var Zs = Js;
2579
- const qt = te, Qs = (r, e, t) => new qt(r, t).compare(new qt(e, t));
2580
- var ie = Qs;
2581
- const ea = ie, ta = (r, e, t) => ea(e, r, t);
2582
- var ra = ta;
2583
- const na = ie, sa = (r, e) => na(r, e, !0);
2584
- var aa = sa;
2585
- const zt = te, oa = (r, e, t) => {
2586
- const n = new zt(r, t), s = new zt(e, t);
2587
- return n.compare(s) || n.compareBuild(s);
2588
- };
2589
- var yt = oa;
2590
- const ia = yt, la = (r, e) => r.sort((t, n) => ia(t, n, e));
2591
- var ua = la;
2592
- const ca = yt, da = (r, e) => r.sort((t, n) => ca(n, t, e));
2593
- var fa = da;
2594
- const ma = ie, pa = (r, e, t) => ma(r, e, t) > 0;
2595
- var He = pa;
2596
- const ha = ie, va = (r, e, t) => ha(r, e, t) < 0;
2597
- var $t = va;
2598
- const ga = ie, ba = (r, e, t) => ga(r, e, t) === 0;
2599
- var Ir = ba;
2600
- const ya = ie, $a = (r, e, t) => ya(r, e, t) !== 0;
2601
- var Or = $a;
2602
- const _a = ie, Ea = (r, e, t) => _a(r, e, t) >= 0;
2603
- var _t = Ea;
2604
- const wa = ie, Ra = (r, e, t) => wa(r, e, t) <= 0;
2605
- var Et = Ra;
2606
- const Ia = Ir, Oa = Or, Aa = He, Sa = _t, Ta = $t, Pa = Et, La = (r, e, t, n) => {
2607
- switch (e) {
2608
- case "===":
2609
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r === t;
2610
- case "!==":
2611
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r !== t;
2612
- case "":
2613
- case "=":
2614
- case "==":
2615
- return Ia(r, t, n);
2616
- case "!=":
2617
- return Oa(r, t, n);
2618
- case ">":
2619
- return Aa(r, t, n);
2620
- case ">=":
2621
- return Sa(r, t, n);
2622
- case "<":
2623
- return Ta(r, t, n);
2624
- case "<=":
2625
- return Pa(r, t, n);
2626
- default:
2627
- throw new TypeError(`Invalid operator: ${e}`);
2628
- }
2629
- };
2630
- var Ar = La;
2631
- const Na = te, Ca = Ie, { safeRe: ke, t: Me } = Pe, xa = (r, e) => {
2632
- if (r instanceof Na)
2633
- return r;
2634
- if (typeof r == "number" && (r = String(r)), typeof r != "string")
2635
- return null;
2636
- e = e || {};
2637
- let t = null;
2638
- if (!e.rtl)
2639
- t = r.match(e.includePrerelease ? ke[Me.COERCEFULL] : ke[Me.COERCE]);
2640
- else {
2641
- const p = e.includePrerelease ? ke[Me.COERCERTLFULL] : ke[Me.COERCERTL];
2642
- let d;
2643
- for (; (d = p.exec(r)) && (!t || t.index + t[0].length !== r.length); )
2644
- (!t || d.index + d[0].length !== t.index + t[0].length) && (t = d), p.lastIndex = d.index + d[1].length + d[2].length;
2645
- p.lastIndex = -1;
2646
- }
2647
- if (t === null)
2648
- return null;
2649
- const n = t[2], s = t[3] || "0", o = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", h = e.includePrerelease && t[6] ? `+${t[6]}` : "";
2650
- return Ca(`${n}.${s}.${o}${i}${h}`, e);
2651
- };
2652
- var ka = xa;
2653
- class Ma {
2654
- constructor() {
2655
- this.max = 1e3, this.map = /* @__PURE__ */ new Map();
2656
- }
2657
- get(e) {
2658
- const t = this.map.get(e);
2659
- if (t !== void 0)
2660
- return this.map.delete(e), this.map.set(e, t), t;
2661
- }
2662
- delete(e) {
2663
- return this.map.delete(e);
2664
- }
2665
- set(e, t) {
2666
- if (!this.delete(e) && t !== void 0) {
2667
- if (this.map.size >= this.max) {
2668
- const s = this.map.keys().next().value;
2669
- this.delete(s);
2670
- }
2671
- this.map.set(e, t);
2672
- }
2673
- return this;
2674
- }
2675
- }
2676
- var Va = Ma, et, Yt;
2677
- function le() {
2678
- if (Yt)
2679
- return et;
2680
- Yt = 1;
2681
- const r = /\s+/g;
2682
- class e {
2683
- constructor(u, m) {
2684
- if (m = s(m), u instanceof e)
2685
- return u.loose === !!m.loose && u.includePrerelease === !!m.includePrerelease ? u : new e(u.raw, m);
2686
- if (u instanceof o)
2687
- return this.raw = u.value, this.set = [[u]], this.formatted = void 0, this;
2688
- if (this.options = m, this.loose = !!m.loose, this.includePrerelease = !!m.includePrerelease, this.raw = u.trim().replace(r, " "), this.set = this.raw.split("||").map((v) => this.parseRange(v.trim())).filter((v) => v.length), !this.set.length)
2689
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
2690
- if (this.set.length > 1) {
2691
- const v = this.set[0];
2692
- if (this.set = this.set.filter((c) => !R(c[0])), this.set.length === 0)
2693
- this.set = [v];
2694
- else if (this.set.length > 1) {
2695
- for (const c of this.set)
2696
- if (c.length === 1 && M(c[0])) {
2697
- this.set = [c];
2698
- break;
2699
- }
2700
- }
2701
- }
2702
- this.formatted = void 0;
2703
- }
2704
- get range() {
2705
- if (this.formatted === void 0) {
2706
- this.formatted = "";
2707
- for (let u = 0; u < this.set.length; u++) {
2708
- u > 0 && (this.formatted += "||");
2709
- const m = this.set[u];
2710
- for (let v = 0; v < m.length; v++)
2711
- v > 0 && (this.formatted += " "), this.formatted += m[v].toString().trim();
2712
- }
2713
- }
2714
- return this.formatted;
2715
- }
2716
- format() {
2717
- return this.range;
2718
- }
2719
- toString() {
2720
- return this.range;
2721
- }
2722
- parseRange(u) {
2723
- const v = ((this.options.includePrerelease && w) | (this.options.loose && E)) + ":" + u, c = n.get(v);
2724
- if (c)
2725
- return c;
2726
- const b = this.options.loose, I = b ? p[d.HYPHENRANGELOOSE] : p[d.HYPHENRANGE];
2727
- u = u.replace(I, A(this.options.includePrerelease)), i("hyphen replace", u), u = u.replace(p[d.COMPARATORTRIM], _), i("comparator trim", u), u = u.replace(p[d.TILDETRIM], $), i("tilde trim", u), u = u.replace(p[d.CARETTRIM], y), i("caret trim", u);
2728
- let k = u.split(" ").map((V) => F(V, this.options)).join(" ").split(/\s+/).map((V) => g(V, this.options));
2729
- b && (k = k.filter((V) => (i("loose invalid filter", V, this.options), !!V.match(p[d.COMPARATORLOOSE])))), i("range list", k);
2730
- const N = /* @__PURE__ */ new Map(), P = k.map((V) => new o(V, this.options));
2731
- for (const V of P) {
2732
- if (R(V))
2733
- return [V];
2734
- N.set(V.value, V);
2735
- }
2736
- N.size > 1 && N.has("") && N.delete("");
2737
- const j = [...N.values()];
2738
- return n.set(v, j), j;
2739
- }
2740
- intersects(u, m) {
2741
- if (!(u instanceof e))
2742
- throw new TypeError("a Range is required");
2743
- return this.set.some((v) => x(v, m) && u.set.some((c) => x(c, m) && v.every((b) => c.every((I) => b.intersects(I, m)))));
2744
- }
2745
- // if ANY of the sets match ALL of its comparators, then pass
2746
- test(u) {
2747
- if (!u)
2748
- return !1;
2749
- if (typeof u == "string")
2750
- try {
2751
- u = new h(u, this.options);
2752
- } catch {
2753
- return !1;
2754
- }
2755
- for (let m = 0; m < this.set.length; m++)
2756
- if (L(this.set[m], u, this.options))
2757
- return !0;
2758
- return !1;
2759
- }
2760
- }
2761
- et = e;
2762
- const t = Va, n = new t(), s = bt, o = qe(), i = Ke, h = te, {
2763
- safeRe: p,
2764
- t: d,
2765
- comparatorTrimReplace: _,
2766
- tildeTrimReplace: $,
2767
- caretTrimReplace: y
2768
- } = Pe, { FLAG_INCLUDE_PRERELEASE: w, FLAG_LOOSE: E } = Be, R = (f) => f.value === "<0.0.0-0", M = (f) => f.value === "", x = (f, u) => {
2769
- let m = !0;
2770
- const v = f.slice();
2771
- let c = v.pop();
2772
- for (; m && v.length; )
2773
- m = v.every((b) => c.intersects(b, u)), c = v.pop();
2774
- return m;
2775
- }, F = (f, u) => (i("comp", f, u), f = z(f, u), i("caret", f), f = U(f, u), i("tildes", f), f = Y(f, u), i("xrange", f), f = l(f, u), i("stars", f), f), T = (f) => !f || f.toLowerCase() === "x" || f === "*", U = (f, u) => f.trim().split(/\s+/).map((m) => X(m, u)).join(" "), X = (f, u) => {
2776
- const m = u.loose ? p[d.TILDELOOSE] : p[d.TILDE];
2777
- return f.replace(m, (v, c, b, I, k) => {
2778
- i("tilde", f, v, c, b, I, k);
2779
- let N;
2780
- return T(c) ? N = "" : T(b) ? N = `>=${c}.0.0 <${+c + 1}.0.0-0` : T(I) ? N = `>=${c}.${b}.0 <${c}.${+b + 1}.0-0` : k ? (i("replaceTilde pr", k), N = `>=${c}.${b}.${I}-${k} <${c}.${+b + 1}.0-0`) : N = `>=${c}.${b}.${I} <${c}.${+b + 1}.0-0`, i("tilde return", N), N;
2781
- });
2782
- }, z = (f, u) => f.trim().split(/\s+/).map((m) => G(m, u)).join(" "), G = (f, u) => {
2783
- i("caret", f, u);
2784
- const m = u.loose ? p[d.CARETLOOSE] : p[d.CARET], v = u.includePrerelease ? "-0" : "";
2785
- return f.replace(m, (c, b, I, k, N) => {
2786
- i("caret", f, c, b, I, k, N);
2787
- let P;
2788
- return T(b) ? P = "" : T(I) ? P = `>=${b}.0.0${v} <${+b + 1}.0.0-0` : T(k) ? b === "0" ? P = `>=${b}.${I}.0${v} <${b}.${+I + 1}.0-0` : P = `>=${b}.${I}.0${v} <${+b + 1}.0.0-0` : N ? (i("replaceCaret pr", N), b === "0" ? I === "0" ? P = `>=${b}.${I}.${k}-${N} <${b}.${I}.${+k + 1}-0` : P = `>=${b}.${I}.${k}-${N} <${b}.${+I + 1}.0-0` : P = `>=${b}.${I}.${k}-${N} <${+b + 1}.0.0-0`) : (i("no pr"), b === "0" ? I === "0" ? P = `>=${b}.${I}.${k}${v} <${b}.${I}.${+k + 1}-0` : P = `>=${b}.${I}.${k}${v} <${b}.${+I + 1}.0-0` : P = `>=${b}.${I}.${k} <${+b + 1}.0.0-0`), i("caret return", P), P;
2789
- });
2790
- }, Y = (f, u) => (i("replaceXRanges", f, u), f.split(/\s+/).map((m) => a(m, u)).join(" ")), a = (f, u) => {
2791
- f = f.trim();
2792
- const m = u.loose ? p[d.XRANGELOOSE] : p[d.XRANGE];
2793
- return f.replace(m, (v, c, b, I, k, N) => {
2794
- i("xRange", f, v, c, b, I, k, N);
2795
- const P = T(b), j = P || T(I), V = j || T(k), J = V;
2796
- return c === "=" && J && (c = ""), N = u.includePrerelease ? "-0" : "", P ? c === ">" || c === "<" ? v = "<0.0.0-0" : v = "*" : c && J ? (j && (I = 0), k = 0, c === ">" ? (c = ">=", j ? (b = +b + 1, I = 0, k = 0) : (I = +I + 1, k = 0)) : c === "<=" && (c = "<", j ? b = +b + 1 : I = +I + 1), c === "<" && (N = "-0"), v = `${c + b}.${I}.${k}${N}`) : j ? v = `>=${b}.0.0${N} <${+b + 1}.0.0-0` : V && (v = `>=${b}.${I}.0${N} <${b}.${+I + 1}.0-0`), i("xRange return", v), v;
2797
- });
2798
- }, l = (f, u) => (i("replaceStars", f, u), f.trim().replace(p[d.STAR], "")), g = (f, u) => (i("replaceGTE0", f, u), f.trim().replace(p[u.includePrerelease ? d.GTE0PRE : d.GTE0], "")), A = (f) => (u, m, v, c, b, I, k, N, P, j, V, J) => (T(v) ? m = "" : T(c) ? m = `>=${v}.0.0${f ? "-0" : ""}` : T(b) ? m = `>=${v}.${c}.0${f ? "-0" : ""}` : I ? m = `>=${m}` : m = `>=${m}${f ? "-0" : ""}`, T(P) ? N = "" : T(j) ? N = `<${+P + 1}.0.0-0` : T(V) ? N = `<${P}.${+j + 1}.0-0` : J ? N = `<=${P}.${j}.${V}-${J}` : f ? N = `<${P}.${j}.${+V + 1}-0` : N = `<=${N}`, `${m} ${N}`.trim()), L = (f, u, m) => {
2799
- for (let v = 0; v < f.length; v++)
2800
- if (!f[v].test(u))
2801
- return !1;
2802
- if (u.prerelease.length && !m.includePrerelease) {
2803
- for (let v = 0; v < f.length; v++)
2804
- if (i(f[v].semver), f[v].semver !== o.ANY && f[v].semver.prerelease.length > 0) {
2805
- const c = f[v].semver;
2806
- if (c.major === u.major && c.minor === u.minor && c.patch === u.patch)
2807
- return !0;
2808
- }
2809
- return !1;
2810
- }
2811
- return !0;
2812
- };
2813
- return et;
2814
- }
2815
- var tt, Xt;
2816
- function qe() {
2817
- if (Xt)
2818
- return tt;
2819
- Xt = 1;
2820
- const r = Symbol("SemVer ANY");
2821
- class e {
2822
- static get ANY() {
2823
- return r;
2824
- }
2825
- constructor(_, $) {
2826
- if ($ = t($), _ instanceof e) {
2827
- if (_.loose === !!$.loose)
2828
- return _;
2829
- _ = _.value;
2830
- }
2831
- _ = _.trim().split(/\s+/).join(" "), i("comparator", _, $), this.options = $, this.loose = !!$.loose, this.parse(_), this.semver === r ? this.value = "" : this.value = this.operator + this.semver.version, i("comp", this);
2832
- }
2833
- parse(_) {
2834
- const $ = this.options.loose ? n[s.COMPARATORLOOSE] : n[s.COMPARATOR], y = _.match($);
2835
- if (!y)
2836
- throw new TypeError(`Invalid comparator: ${_}`);
2837
- this.operator = y[1] !== void 0 ? y[1] : "", this.operator === "=" && (this.operator = ""), y[2] ? this.semver = new h(y[2], this.options.loose) : this.semver = r;
2838
- }
2839
- toString() {
2840
- return this.value;
2841
- }
2842
- test(_) {
2843
- if (i("Comparator.test", _, this.options.loose), this.semver === r || _ === r)
2844
- return !0;
2845
- if (typeof _ == "string")
2846
- try {
2847
- _ = new h(_, this.options);
2848
- } catch {
2849
- return !1;
2850
- }
2851
- return o(_, this.operator, this.semver, this.options);
2852
- }
2853
- intersects(_, $) {
2854
- if (!(_ instanceof e))
2855
- throw new TypeError("a Comparator is required");
2856
- return this.operator === "" ? this.value === "" ? !0 : new p(_.value, $).test(this.value) : _.operator === "" ? _.value === "" ? !0 : new p(this.value, $).test(_.semver) : ($ = t($), $.includePrerelease && (this.value === "<0.0.0-0" || _.value === "<0.0.0-0") || !$.includePrerelease && (this.value.startsWith("<0.0.0") || _.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && _.operator.startsWith(">") || this.operator.startsWith("<") && _.operator.startsWith("<") || this.semver.version === _.semver.version && this.operator.includes("=") && _.operator.includes("=") || o(this.semver, "<", _.semver, $) && this.operator.startsWith(">") && _.operator.startsWith("<") || o(this.semver, ">", _.semver, $) && this.operator.startsWith("<") && _.operator.startsWith(">")));
2857
- }
2858
- }
2859
- tt = e;
2860
- const t = bt, { safeRe: n, t: s } = Pe, o = Ar, i = Ke, h = te, p = le();
2861
- return tt;
2862
- }
2863
- const Fa = le(), ja = (r, e, t) => {
2864
- try {
2865
- e = new Fa(e, t);
2866
- } catch {
2867
- return !1;
2868
- }
2869
- return e.test(r);
2870
- };
2871
- var ze = ja;
2872
- const Da = le(), Ua = (r, e) => new Da(r, e).set.map((t) => t.map((n) => n.value).join(" ").trim().split(" "));
2873
- var Ga = Ua;
2874
- const Ba = te, Ka = le(), Ha = (r, e, t) => {
2875
- let n = null, s = null, o = null;
2876
- try {
2877
- o = new Ka(e, t);
2878
- } catch {
2879
- return null;
2880
- }
2881
- return r.forEach((i) => {
2882
- o.test(i) && (!n || s.compare(i) === -1) && (n = i, s = new Ba(n, t));
2883
- }), n;
2884
- };
2885
- var qa = Ha;
2886
- const za = te, Ya = le(), Xa = (r, e, t) => {
2887
- let n = null, s = null, o = null;
2888
- try {
2889
- o = new Ya(e, t);
2890
- } catch {
2891
- return null;
2892
- }
2893
- return r.forEach((i) => {
2894
- o.test(i) && (!n || s.compare(i) === 1) && (n = i, s = new za(n, t));
2895
- }), n;
2896
- };
2897
- var Wa = Xa;
2898
- const rt = te, Ja = le(), Wt = He, Za = (r, e) => {
2899
- r = new Ja(r, e);
2900
- let t = new rt("0.0.0");
2901
- if (r.test(t) || (t = new rt("0.0.0-0"), r.test(t)))
2902
- return t;
2903
- t = null;
2904
- for (let n = 0; n < r.set.length; ++n) {
2905
- const s = r.set[n];
2906
- let o = null;
2907
- s.forEach((i) => {
2908
- const h = new rt(i.semver.version);
2909
- switch (i.operator) {
2910
- case ">":
2911
- h.prerelease.length === 0 ? h.patch++ : h.prerelease.push(0), h.raw = h.format();
2912
- case "":
2913
- case ">=":
2914
- (!o || Wt(h, o)) && (o = h);
2915
- break;
2916
- case "<":
2917
- case "<=":
2918
- break;
2919
- default:
2920
- throw new Error(`Unexpected operation: ${i.operator}`);
2921
- }
2922
- }), o && (!t || Wt(t, o)) && (t = o);
2923
- }
2924
- return t && r.test(t) ? t : null;
2925
- };
2926
- var Qa = Za;
2927
- const eo = le(), to = (r, e) => {
2928
- try {
2929
- return new eo(r, e).range || "*";
2930
- } catch {
2931
- return null;
2932
- }
2933
- };
2934
- var ro = to;
2935
- const no = te, Sr = qe(), { ANY: so } = Sr, ao = le(), oo = ze, Jt = He, Zt = $t, io = Et, lo = _t, uo = (r, e, t, n) => {
2936
- r = new no(r, n), e = new ao(e, n);
2937
- let s, o, i, h, p;
2938
- switch (t) {
2939
- case ">":
2940
- s = Jt, o = io, i = Zt, h = ">", p = ">=";
2941
- break;
2942
- case "<":
2943
- s = Zt, o = lo, i = Jt, h = "<", p = "<=";
2944
- break;
2945
- default:
2946
- throw new TypeError('Must provide a hilo val of "<" or ">"');
2947
- }
2948
- if (oo(r, e, n))
2949
- return !1;
2950
- for (let d = 0; d < e.set.length; ++d) {
2951
- const _ = e.set[d];
2952
- let $ = null, y = null;
2953
- if (_.forEach((w) => {
2954
- w.semver === so && (w = new Sr(">=0.0.0")), $ = $ || w, y = y || w, s(w.semver, $.semver, n) ? $ = w : i(w.semver, y.semver, n) && (y = w);
2955
- }), $.operator === h || $.operator === p || (!y.operator || y.operator === h) && o(r, y.semver))
2956
- return !1;
2957
- if (y.operator === p && i(r, y.semver))
2958
- return !1;
2959
- }
2960
- return !0;
2961
- };
2962
- var wt = uo;
2963
- const co = wt, fo = (r, e, t) => co(r, e, ">", t);
2964
- var mo = fo;
2965
- const po = wt, ho = (r, e, t) => po(r, e, "<", t);
2966
- var vo = ho;
2967
- const Qt = le(), go = (r, e, t) => (r = new Qt(r, t), e = new Qt(e, t), r.intersects(e, t));
2968
- var bo = go;
2969
- const yo = ze, $o = ie;
2970
- var _o = (r, e, t) => {
2971
- const n = [];
2972
- let s = null, o = null;
2973
- const i = r.sort((_, $) => $o(_, $, t));
2974
- for (const _ of i)
2975
- yo(_, e, t) ? (o = _, s || (s = _)) : (o && n.push([s, o]), o = null, s = null);
2976
- s && n.push([s, null]);
2977
- const h = [];
2978
- for (const [_, $] of n)
2979
- _ === $ ? h.push(_) : !$ && _ === i[0] ? h.push("*") : $ ? _ === i[0] ? h.push(`<=${$}`) : h.push(`${_} - ${$}`) : h.push(`>=${_}`);
2980
- const p = h.join(" || "), d = typeof e.raw == "string" ? e.raw : String(e);
2981
- return p.length < d.length ? p : e;
2982
- };
2983
- const er = le(), Rt = qe(), { ANY: nt } = Rt, Se = ze, It = ie, Eo = (r, e, t = {}) => {
2984
- if (r === e)
2985
- return !0;
2986
- r = new er(r, t), e = new er(e, t);
2987
- let n = !1;
2988
- e:
2989
- for (const s of r.set) {
2990
- for (const o of e.set) {
2991
- const i = Ro(s, o, t);
2992
- if (n = n || i !== null, i)
2993
- continue e;
2994
- }
2995
- if (n)
2996
- return !1;
2997
- }
2998
- return !0;
2999
- }, wo = [new Rt(">=0.0.0-0")], tr = [new Rt(">=0.0.0")], Ro = (r, e, t) => {
3000
- if (r === e)
3001
- return !0;
3002
- if (r.length === 1 && r[0].semver === nt) {
3003
- if (e.length === 1 && e[0].semver === nt)
3004
- return !0;
3005
- t.includePrerelease ? r = wo : r = tr;
3006
- }
3007
- if (e.length === 1 && e[0].semver === nt) {
3008
- if (t.includePrerelease)
3009
- return !0;
3010
- e = tr;
3011
- }
3012
- const n = /* @__PURE__ */ new Set();
3013
- let s, o;
3014
- for (const w of r)
3015
- w.operator === ">" || w.operator === ">=" ? s = rr(s, w, t) : w.operator === "<" || w.operator === "<=" ? o = nr(o, w, t) : n.add(w.semver);
3016
- if (n.size > 1)
3017
- return null;
3018
- let i;
3019
- if (s && o) {
3020
- if (i = It(s.semver, o.semver, t), i > 0)
3021
- return null;
3022
- if (i === 0 && (s.operator !== ">=" || o.operator !== "<="))
3023
- return null;
3024
- }
3025
- for (const w of n) {
3026
- if (s && !Se(w, String(s), t) || o && !Se(w, String(o), t))
3027
- return null;
3028
- for (const E of e)
3029
- if (!Se(w, String(E), t))
3030
- return !1;
3031
- return !0;
3032
- }
3033
- let h, p, d, _, $ = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1, y = s && !t.includePrerelease && s.semver.prerelease.length ? s.semver : !1;
3034
- $ && $.prerelease.length === 1 && o.operator === "<" && $.prerelease[0] === 0 && ($ = !1);
3035
- for (const w of e) {
3036
- if (_ = _ || w.operator === ">" || w.operator === ">=", d = d || w.operator === "<" || w.operator === "<=", s) {
3037
- if (y && w.semver.prerelease && w.semver.prerelease.length && w.semver.major === y.major && w.semver.minor === y.minor && w.semver.patch === y.patch && (y = !1), w.operator === ">" || w.operator === ">=") {
3038
- if (h = rr(s, w, t), h === w && h !== s)
3039
- return !1;
3040
- } else if (s.operator === ">=" && !Se(s.semver, String(w), t))
3041
- return !1;
3042
- }
3043
- if (o) {
3044
- if ($ && w.semver.prerelease && w.semver.prerelease.length && w.semver.major === $.major && w.semver.minor === $.minor && w.semver.patch === $.patch && ($ = !1), w.operator === "<" || w.operator === "<=") {
3045
- if (p = nr(o, w, t), p === w && p !== o)
3046
- return !1;
3047
- } else if (o.operator === "<=" && !Se(o.semver, String(w), t))
3048
- return !1;
3049
- }
3050
- if (!w.operator && (o || s) && i !== 0)
3051
- return !1;
3052
- }
3053
- return !(s && d && !o && i !== 0 || o && _ && !s && i !== 0 || y || $);
3054
- }, rr = (r, e, t) => {
3055
- if (!r)
3056
- return e;
3057
- const n = It(r.semver, e.semver, t);
3058
- return n > 0 ? r : n < 0 || e.operator === ">" && r.operator === ">=" ? e : r;
3059
- }, nr = (r, e, t) => {
3060
- if (!r)
3061
- return e;
3062
- const n = It(r.semver, e.semver, t);
3063
- return n < 0 ? r : n > 0 || e.operator === "<" && r.operator === "<=" ? e : r;
3064
- };
3065
- var Io = Eo;
3066
- const st = Pe, sr = Be, Oo = te, ar = Rr, Ao = Ie, So = Cs, To = Ms, Po = Fs, Lo = Ds, No = Bs, Co = qs, xo = Xs, ko = Zs, Mo = ie, Vo = ra, Fo = aa, jo = yt, Do = ua, Uo = fa, Go = He, Bo = $t, Ko = Ir, Ho = Or, qo = _t, zo = Et, Yo = Ar, Xo = ka, Wo = qe(), Jo = le(), Zo = ze, Qo = Ga, ei = qa, ti = Wa, ri = Qa, ni = ro, si = wt, ai = mo, oi = vo, ii = bo, li = _o, ui = Io;
3067
- var ci = {
3068
- parse: Ao,
3069
- valid: So,
3070
- clean: To,
3071
- inc: Po,
3072
- diff: Lo,
3073
- major: No,
3074
- minor: Co,
3075
- patch: xo,
3076
- prerelease: ko,
3077
- compare: Mo,
3078
- rcompare: Vo,
3079
- compareLoose: Fo,
3080
- compareBuild: jo,
3081
- sort: Do,
3082
- rsort: Uo,
3083
- gt: Go,
3084
- lt: Bo,
3085
- eq: Ko,
3086
- neq: Ho,
3087
- gte: qo,
3088
- lte: zo,
3089
- cmp: Yo,
3090
- coerce: Xo,
3091
- Comparator: Wo,
3092
- Range: Jo,
3093
- satisfies: Zo,
3094
- toComparators: Qo,
3095
- maxSatisfying: ei,
3096
- minSatisfying: ti,
3097
- minVersion: ri,
3098
- validRange: ni,
3099
- outside: si,
3100
- gtr: ai,
3101
- ltr: oi,
3102
- intersects: ii,
3103
- simplifyRange: li,
3104
- subset: ui,
3105
- SemVer: Oo,
3106
- re: st.re,
3107
- src: st.src,
3108
- tokens: st.t,
3109
- SEMVER_SPEC_VERSION: sr.SEMVER_SPEC_VERSION,
3110
- RELEASE_TYPES: sr.RELEASE_TYPES,
3111
- compareIdentifiers: ar.compareIdentifiers,
3112
- rcompareIdentifiers: ar.rcompareIdentifiers
3113
- };
3114
- const or = /* @__PURE__ */ pt(ci);
3115
- var ft = /* @__PURE__ */ ((r) => (r[r.menuV3 = 0] = "menuV3", r[r.applyEffectOnOrder = 1] = "applyEffectOnOrder", r[r.nestedAddon = 2] = "nestedAddon", r[r.feedmeDelivery = 3] = "feedmeDelivery", r[r.taxAndServiceChargeV4 = 4] = "taxAndServiceChargeV4", r[r.itemCombo = 5] = "itemCombo", r[r.itemTakeaway = 6] = "itemTakeaway", r[r.transferInventory = 7] = "transferInventory", r[r.qrEPayment = 8] = "qrEPayment", r[r.deliveryIntegration = 9] = "deliveryIntegration", r[r.rmsPayment = 10] = "rmsPayment", r[r.queue = 11] = "queue", r[r.paymentVoucher = 12] = "paymentVoucher", r))(ft || {});
3116
- const Tr = {
3117
- 0: "3.0.0-alpha",
3118
- 1: "3.5.0-alpha",
3119
- 2: "4.0.0-alpha",
3120
- 4: "4.0.0-alpha",
3121
- 5: "4.1.0-alpha",
3122
- // TODO: #475 make sure current pos version
3123
- 6: "4.3.10-alpha",
3124
- 7: "4.5.0-alpha",
3125
- 8: "6.9.0-alpha",
3126
- 9: "6.11.0-alpha",
3127
- 3: "6.12.0-alpha",
3128
- 10: "6.21.0-alpha",
3129
- 11: "6.21.0-alpha",
3130
- 12: "6.31.0-alpha"
3131
- };
3132
- function di(r, e) {
3133
- return or.valid(e) && or.gte(e, Tr[r]);
3134
- }
3135
- function fi(r) {
3136
- return Tr[r].replace("-alpha", "");
3137
- }
3138
- function mi({ posVersion: r, payoutAccount: e }) {
3139
- return !!r && di(ft.qrEPayment, r) ? !e || !e.enable ? "Payout account is required" : e.status !== Br.enum.APPROVED ? "Payout account under review" : !0 : `For POS ${fi(ft.qrEPayment)} or above`;
3140
- }
3141
- function Pr(r) {
3142
- return {
3143
- id: r._id,
3144
- ...r,
3145
- profile: {
3146
- ...r.profile,
3147
- address: Te(r.profile.address)
3148
- },
3149
- allowEPayment: mi(r)
3150
- };
3151
- }
3152
- function at(r) {
3153
- return Pr(vt(r));
3154
- }
3155
- async function ir(r) {
3156
- const e = vt(r), t = [];
3157
- for (const n of e)
3158
- t.push(await Pr(n));
3159
- return t;
3160
- }
3161
- const Ge = {
3162
- async readRestaurant(r) {
3163
- return await at(await Ze().get(`/restaurants/${r}`));
3164
- },
3165
- async readRestaurants() {
3166
- return await ir(await Qe().get("/restaurants"));
3167
- },
3168
- async readRestaurantsByBusiness() {
3169
- return await ir(await Qe().get("/restaurant-list"));
3170
- },
3171
- async createRestaurant(r) {
3172
- return await at(await Qe().post("/restaurants", r));
3173
- },
3174
- async updateRestaurantProfile(r, e) {
3175
- return await at(
3176
- await Ze().put(`/restaurants/${r}/profile`, e)
3177
- );
3178
- },
3179
- async updateRestaurantAttributes(r, e) {
3180
- return vt(await Ze().put(`/restaurants/${r}/attributes`, {
3181
- attributes: e
3182
- }));
3183
- }
3184
- }, ot = {
3185
- async get(r, e) {
3186
- const t = We(void 0, e), n = Je(t, r);
3187
- return await (await Xr(n)).text();
3188
- },
3189
- async update(r, e, t) {
3190
- const n = We(void 0, t), s = Je(n, r);
3191
- return await Wr(s, e), await Jr(s);
3192
- },
3193
- async delete(r, e) {
3194
- const t = We(void 0, e), n = Je(t, r);
3195
- await Zr(n);
3196
- }
3197
- }, ve = {
3198
- async get(r) {
3199
- return await ot.get(r);
3200
- },
3201
- async update(r, e, t) {
3202
- return await ot.update(r, e);
3203
- },
3204
- async delete(r) {
3205
- await ot.delete(r);
3206
- }
3207
- };
3208
- class pi {
3209
- constructor(e, t) {
3210
- Ye(this, "restaurant");
3211
- Ye(this, "data");
3212
- this.restaurant = e, this.data = t;
3213
- }
3214
- generateUrl(e) {
3215
- const t = e === "normal" ? gt().toISOString() : "photo";
3216
- return `restaurant/${this.restaurant.id}/${e}/${t}`;
3217
- }
3218
- async manageThumbnail() {
3219
- const { newThumbnailPhoto: e, thumbnailPhoto: t } = this.data;
3220
- if (e) {
3221
- const s = await ve.update(this.generateUrl("thumbnail"), e, {
3222
- includedTime: !0
3223
- });
3224
- this.data.thumbnailPhoto = s;
3225
- return;
3226
- }
3227
- const n = this.restaurant.profile.thumbnailPhoto;
3228
- n && !t && (await ve.delete(n), this.data.thumbnailPhoto = void 0);
3229
- }
3230
- async manageCover() {
3231
- const { newCoverPhoto: e, coverPhoto: t } = this.data;
3232
- if (e) {
3233
- const s = await ve.update(this.generateUrl("cover"), e, {
3234
- includedTime: !0
3235
- });
3236
- this.data.coverPhoto = s;
3237
- return;
3238
- }
3239
- const n = this.restaurant.profile.coverPhoto;
3240
- n && !t && (await ve.delete(n), this.data.coverPhoto = void 0);
3241
- }
3242
- async manageCarousels() {
3243
- const e = this.data.newPhotos || [];
3244
- for (const t of e) {
3245
- const n = await ve.update(this.generateUrl("normal"), t);
3246
- this.data.photos = [...this.data.photos || [], n];
3247
- }
3248
- }
3249
- async run() {
3250
- return await this.manageThumbnail(), await this.manageCover(), await this.manageCarousels(), this.data;
3251
- }
3252
- }
3253
- async function lr(r, e) {
3254
- const t = new pi(r, e);
3255
- await t.run(), await Ge.updateRestaurantProfile(r.id, t.data), await ge().readRestaurants();
3256
- }
3257
- const hi = () => {
3258
- const r = ge();
3259
- return {
3260
- async createRestaurant(e, t, n) {
3261
- const s = await Ge.createRestaurant({
3262
- businessId: e,
3263
- features: [],
3264
- profile: t
3265
- });
3266
- n && await Ge.updateRestaurantAttributes(s.id, n), await lr(s, t), await r.readRestaurants();
3267
- },
3268
- async updateRestaurantProfile(e, t) {
3269
- await lr(e, t);
3270
- }
3271
- };
3272
- }, vi = { class: "flex justify-center" }, gi = { class: "space-y-24" }, bi = { class: "space-y-24" }, yi = { class: "flex gap-16 xs:flex-col xs:gap-24" }, $i = { class: "flex-1" }, _i = { class: "flex-1" }, Ei = { class: "space-y-24" }, wi = { class: "space-y-24" }, Ri = { class: "space-y-8" }, Ii = { class: "space-y-24" }, ur = /* @__PURE__ */ ee({
3273
- __name: "RestaurantForm",
3274
- props: {
3275
- restaurantId: {
3276
- type: String,
3277
- default: void 0
3278
- },
3279
- restaurant: {
3280
- type: Object
3281
- },
3282
- initialValue: {
3283
- type: Object,
3284
- default: void 0
3285
- },
3286
- enableFeedmeExpress: {
3287
- type: Boolean,
3288
- required: !0
3289
- }
3290
- },
3291
- setup(r, { expose: e }) {
3292
- var m;
3293
- const t = r, { restaurants: n, currentBusiness: s, restaurantAttributeSettings: o } = ge(), i = ht(), h = vr(i), { copyTextToClipboard: p } = hr(), d = ae(!1), _ = (v, c) => {
3294
- d.value = !d.value;
3295
- }, $ = W(() => {
3296
- var v;
3297
- return (v = t.restaurant) == null ? void 0 : v.profile;
3298
- }), y = mt(
3299
- $.value ? we($.value) : {
3300
- ...xt(),
3301
- address: Te(xt().address),
3302
- legalName: "",
3303
- sstRegNo: "",
3304
- description: "",
3305
- url: "",
3306
- thumbnailPhoto: void 0,
3307
- coverPhoto: void 0,
3308
- newThumbnailPhoto: void 0,
3309
- newCoverPhoto: void 0,
3310
- newPhotos: [],
3311
- operatingHours: {
3312
- 0: {
3313
- enable: !1,
3314
- hours: []
3315
- },
3316
- 1: {
3317
- enable: !1,
3318
- hours: []
3319
- },
3320
- 2: {
3321
- enable: !1,
3322
- hours: []
3323
- },
3324
- 3: {
3325
- enable: !1,
3326
- hours: []
3327
- },
3328
- 4: {
3329
- enable: !1,
3330
- hours: []
3331
- },
3332
- 5: {
3333
- enable: !1,
3334
- hours: []
3335
- },
3336
- 6: {
3337
- enable: !1,
3338
- hours: []
3339
- }
3340
- }
3341
- }
3342
- ), w = "https://feedmedev.cc/", E = W(() => ge().currentCountry.value), { t: R } = ye(), M = ae(
3343
- t.restaurantId ? R("settings.business.restaurant.form.title.update") : R("settings.business.restaurant.form.title.add")
3344
- ), x = ae(((m = t.restaurant) == null ? void 0 : m.customAttributes) || {});
3345
- async function F(v) {
3346
- Object.values(x.value).length !== 0 && await Ge.updateRestaurantAttributes(v, x.value);
3347
- }
3348
- const T = W(() => Te(y.address)), U = W(() => T.value.formatted);
3349
- function X(v) {
3350
- var c;
3351
- if (typeof v == "string") {
3352
- const b = (c = n.value.find((I) => I._id === v)) == null ? void 0 : c.profile.operatingHours;
3353
- b ? y.operatingHours = we(b) : i.open({
3354
- title: R("settings.business.restaurant.form.sections.operation_hours.invalid"),
3355
- type: "error"
3356
- });
3357
- }
3358
- }
3359
- function z() {
3360
- const v = w + (y.url || t.restaurantId);
3361
- p(v);
3362
- }
3363
- function G() {
3364
- y.thumbnailPhoto = void 0, y.newThumbnailPhoto = void 0;
3365
- }
3366
- function Y() {
3367
- y.coverPhoto = void 0, y.newCoverPhoto = void 0;
3368
- }
3369
- function a(v) {
3370
- y.newPhotos = y.newPhotos || [], y.newPhotos.push(v);
3371
- }
3372
- const l = hi();
3373
- function g() {
3374
- var v, c;
3375
- if (_(), t.restaurantId) {
3376
- if (!((v = s.value) != null && v.id))
3377
- return;
3378
- h.minor(async () => {
3379
- var b, I;
3380
- t.restaurant && (await F(t.restaurantId), await l.updateRestaurantProfile(t.restaurant, {
3381
- ...y,
3382
- url: ((b = y.url) == null ? void 0 : b.trim()) || null,
3383
- code: ((I = y.code) == null ? void 0 : I.trim()) || null
3384
- }), R("settings.business.restaurant.form.message.updated"));
3385
- });
3386
- } else {
3387
- if (!((c = s.value) != null && c.id))
3388
- return;
3389
- h.minor(async () => {
3390
- var b, I;
3391
- await l.createRestaurant(
3392
- s.value.id,
3393
- {
3394
- ...y,
3395
- url: ((b = y.url) == null ? void 0 : b.trim()) || null,
3396
- code: ((I = y.code) == null ? void 0 : I.trim()) || null
3397
- },
3398
- x.value
3399
- ), R("settings.business.restaurant.form.message.created");
3400
- });
3401
- }
3402
- }
3403
- const A = W(() => ({
3404
- title: R("settings.business.restaurant.form.summary.title"),
3405
- items: [
3406
- {
3407
- name: R("settings.business.restaurant.form.summary.name"),
3408
- value: y.name
3409
- },
3410
- {
3411
- name: R("settings.business.restaurant.form.summary.legal_name"),
3412
- value: y.legalName
3413
- },
3414
- {
3415
- name: R("settings.business.restaurant.form.summary.contact"),
3416
- value: y.phoneNo
3417
- },
3418
- {
3419
- name: R("settings.business.restaurant.form.summary.address"),
3420
- value: U.value
3421
- }
3422
- ]
3423
- })), { isAtMost: L } = mr();
3424
- W(() => L("sm"));
3425
- const f = ae(null), u = tn(f);
3426
- return e({ trigger: _ }), (v, c) => {
3427
- const b = q("FmTextField"), I = q("FmPhoneNumber"), k = q("FmTextarea"), N = q("FmButton");
3428
- return D(), K(oe, null, [
3429
- me(v.$slots, "trigger", Fr(jr({
3430
- trigger: _
3431
- }))),
3432
- C(Pn, {
3433
- title: M.value,
3434
- show: d.value,
3435
- "primary-action": { label: S(R)("common.save") },
3436
- "secondary-actions": [
3437
- { label: S(R)("settings.business.restaurant.actions.discard"), click: () => d.value = !1 }
3438
- ],
3439
- onOnPrimary: g,
3440
- onOnCancel: c[17] || (c[17] = (P) => d.value = !1)
3441
- }, {
3442
- "append-title": H(() => [
3443
- S(L)("sm") ? (D(), Q(Ft, {
3444
- key: 0,
3445
- variant: "dialog",
3446
- title: A.value.title,
3447
- items: A.value.items
3448
- }, null, 8, ["title", "items"])) : fe("", !0)
3449
- ]),
3450
- default: H(() => [
3451
- O("div", vi, [
3452
- O("div", {
3453
- ref_key: "formWrapper",
3454
- ref: f,
3455
- class: "py-24 pr-[400px] w-[1150px] xs:pr-0 sm:pr-0 xs:w-full"
3456
- }, [
3457
- S(L)("sm") ? fe("", !0) : (D(), Q(Ft, {
3458
- key: 0,
3459
- class: "fixed",
3460
- style: Fe({
3461
- top: "85px",
3462
- left: S(u).right - 400 + "px"
3463
- }),
3464
- variant: "full",
3465
- title: A.value.title,
3466
- items: A.value.items
3467
- }, null, 8, ["style", "title", "items"])),
3468
- O("div", gi, [
3469
- C(Ae, {
3470
- title: S(R)("settings.business.restaurant.form.sections.basic_info.title")
3471
- }, {
3472
- default: H(() => {
3473
- var P, j;
3474
- return [
3475
- O("div", bi, [
3476
- O("div", null, [
3477
- C(b, {
3478
- label: S(R)("settings.business.restaurant.form.sections.basic_info.code.label"),
3479
- modelValue: y.code,
3480
- "onUpdate:modelValue": c[0] || (c[0] = (V) => y.code = V),
3481
- "label-mark": "optional",
3482
- "helper-text": S(R)("settings.business.restaurant.form.sections.basic_info.code.helper"),
3483
- disabled: ((P = $.value) == null ? void 0 : P.code) !== void 0 && ((j = $.value) == null ? void 0 : j.code) !== null
3484
- }, null, 8, ["label", "modelValue", "helper-text", "disabled"])
3485
- ]),
3486
- O("div", null, [
3487
- C(b, {
3488
- label: S(R)("settings.business.restaurant.form.sections.basic_info.name.label"),
3489
- modelValue: y.name,
3490
- "onUpdate:modelValue": c[1] || (c[1] = (V) => y.name = V),
3491
- "label-mark": "required",
3492
- rules: [S(he)]
3493
- }, null, 8, ["label", "modelValue", "rules"])
3494
- ]),
3495
- O("div", null, [
3496
- C(b, {
3497
- label: S(R)("settings.business.restaurant.form.sections.basic_info.legal_name.label"),
3498
- modelValue: y.legalName,
3499
- "onUpdate:modelValue": c[2] || (c[2] = (V) => y.legalName = V),
3500
- "label-mark": "required",
3501
- rules: [S(he)]
3502
- }, null, 8, ["label", "modelValue", "rules"])
3503
- ]),
3504
- O("div", null, [
3505
- C(b, {
3506
- label: S(R)("settings.business.restaurant.form.sections.basic_info.reg_no.label"),
3507
- modelValue: y.regNo,
3508
- "onUpdate:modelValue": c[3] || (c[3] = (V) => y.regNo = V),
3509
- "label-mark": "required",
3510
- rules: [S(he)]
3511
- }, null, 8, ["label", "modelValue", "rules"])
3512
- ]),
3513
- O("div", null, [
3514
- C(b, {
3515
- modelValue: y.sstRegNo,
3516
- "onUpdate:modelValue": c[4] || (c[4] = (V) => y.sstRegNo = V),
3517
- label: S(R)("settings.business.restaurant.form.sections.basic_info.tax_no.label"),
3518
- "label-mark": "optional"
3519
- }, null, 8, ["modelValue", "label"])
3520
- ]),
3521
- O("div", yi, [
3522
- O("div", $i, [
3523
- C(I, {
3524
- class: "w-full",
3525
- label: S(R)("settings.business.restaurant.form.sections.basic_info.contact.label"),
3526
- modelValue: y.phoneNo,
3527
- "onUpdate:modelValue": c[5] || (c[5] = (V) => y.phoneNo = V),
3528
- "label-mark": "optional"
3529
- }, null, 8, ["label", "modelValue"])
3530
- ]),
3531
- O("div", _i, [
3532
- C(b, {
3533
- class: "w-full",
3534
- modelValue: y.email,
3535
- "onUpdate:modelValue": c[6] || (c[6] = (V) => y.email = V),
3536
- label: S(R)("settings.business.restaurant.form.sections.basic_info.email.label"),
3537
- "label-mark": "optional"
3538
- }, null, 8, ["modelValue", "label"])
3539
- ])
3540
- ]),
3541
- O("div", null, [
3542
- C(Ee, {
3543
- label: S(R)("settings.business.restaurant.form.sections.basic_info.image.label"),
3544
- "sub-label": S(R)("settings.business.restaurant.form.sections.basic_info.image.optional"),
3545
- "previous-url": y.thumbnailPhoto,
3546
- modelValue: y.newThumbnailPhoto,
3547
- "onUpdate:modelValue": c[7] || (c[7] = (V) => y.newThumbnailPhoto = V),
3548
- "onReset:modelValue": G
3549
- }, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
3550
- ])
3551
- ])
3552
- ];
3553
- }),
3554
- _: 1
3555
- }, 8, ["title"]),
3556
- S(o).length > 0 ? (D(), K(oe, { key: 0 }, [
3557
- c[18] || (c[18] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3558
- C(Ae, {
3559
- title: S(R)("settings.restaurantTagging.title"),
3560
- "sub-title": S(R)("settings.restaurantTagging.subtitle")
3561
- }, {
3562
- default: H(() => [
3563
- C(S(Kr), {
3564
- entity: "restaurant",
3565
- modelValue: x.value,
3566
- "onUpdate:modelValue": c[8] || (c[8] = (P) => x.value = P)
3567
- }, null, 8, ["modelValue"])
3568
- ]),
3569
- _: 1
3570
- }, 8, ["title", "sub-title"])
3571
- ], 64)) : fe("", !0),
3572
- c[19] || (c[19] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3573
- C(Ae, {
3574
- title: S(R)("settings.business.restaurant.form.sections.address.title")
3575
- }, {
3576
- default: H(() => [
3577
- O("div", Ei, [
3578
- C(as, {
3579
- modelValue: y.address,
3580
- "onUpdate:modelValue": c[9] || (c[9] = (P) => y.address = P)
3581
- }, null, 8, ["modelValue"]),
3582
- C(fs, {
3583
- address: T.value,
3584
- modelValue: y.address.coordinates,
3585
- "onUpdate:modelValue": c[10] || (c[10] = (P) => y.address.coordinates = P)
3586
- }, null, 8, ["address", "modelValue"])
3587
- ])
3588
- ]),
3589
- _: 1
3590
- }, 8, ["title"]),
3591
- c[20] || (c[20] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3592
- C(Ae, {
3593
- title: S(R)("settings.business.restaurant.form.sections.operation_hours.title")
3594
- }, {
3595
- default: H(() => [
3596
- O("div", wi, [
3597
- O("div", Ri, [
3598
- C(Mt, {
3599
- label: S(R)("settings.business.restaurant.form.sections.operation_hours.copy_with"),
3600
- optional: !1
3601
- }, null, 8, ["label"]),
3602
- C(Qr, {
3603
- class: "w-[320px]",
3604
- "exclude-restaurants": [r.restaurantId ?? ""],
3605
- "model-value": "",
3606
- "onUpdate:modelValue": c[11] || (c[11] = (P) => X(P))
3607
- }, null, 8, ["exclude-restaurants"]),
3608
- C(gs, {
3609
- modelValue: y.operatingHours,
3610
- "onUpdate:modelValue": c[12] || (c[12] = (P) => y.operatingHours = P)
3611
- }, null, 8, ["modelValue"])
3612
- ])
3613
- ])
3614
- ]),
3615
- _: 1
3616
- }, 8, ["title"]),
3617
- c[21] || (c[21] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3618
- C(Ae, {
3619
- title: S(R)("settings.business.restaurant.form.sections.branding.title")
3620
- }, {
3621
- default: H(() => [
3622
- O("div", Ii, [
3623
- C(k, {
3624
- label: S(R)("settings.business.restaurant.form.sections.branding.description"),
3625
- "model-value": y.description ?? "",
3626
- "onUpdate:modelValue": c[13] || (c[13] = (P) => y.description = P)
3627
- }, null, 8, ["label", "model-value"]),
3628
- C(b, {
3629
- label: S(R)("settings.business.restaurant.form.sections.branding.url.label"),
3630
- placeholder: r.restaurantId,
3631
- "model-value": y.url,
3632
- "onUpdate:modelValue": c[14] || (c[14] = (P) => y.url = P),
3633
- rules: [
3634
- (P) => {
3635
- var j;
3636
- return !P || ((j = $.value) == null ? void 0 : j.url) == y.url || E.value == S(dr).enum.MY || S(R)("settings.business.restaurant.form.sections.branding.url.errors.disabled");
3637
- },
3638
- (P) => !P || S($r).test(P) || S(R)("settings.business.restaurant.form.sections.branding.url.errors.invalid"),
3639
- (P) => !P || !S(_r).includes(P) || S(R)("settings.business.restaurant.form.sections.branding.url.errors.reserved")
3640
- ]
3641
- }, {
3642
- prepend: H(() => [
3643
- O("span", null, B(w))
3644
- ]),
3645
- append: H(() => [
3646
- C(N, {
3647
- variant: "tertiary",
3648
- icon: "file_copy",
3649
- "text-color": "neutral-gray-400",
3650
- onClick: z
3651
- })
3652
- ]),
3653
- _: 1
3654
- }, 8, ["label", "placeholder", "model-value", "rules"]),
3655
- O("div", null, [
3656
- C(Ee, {
3657
- label: S(R)("settings.business.form.cover_photo.label"),
3658
- "previous-url": y.coverPhoto,
3659
- modelValue: y.newCoverPhoto,
3660
- "onUpdate:modelValue": c[15] || (c[15] = (P) => y.newCoverPhoto = P),
3661
- "onReset:modelValue": Y
3662
- }, null, 8, ["label", "previous-url", "modelValue"])
3663
- ]),
3664
- O("div", null, [
3665
- C(Mt, {
3666
- label: S(R)("settings.business.restaurant.form.sections.branding.carousel_photos.label")
3667
- }, null, 8, ["label"]),
3668
- (D(!0), K(oe, null, be(y.photos || [], (P, j) => (D(), Q(Ee, {
3669
- key: j,
3670
- "previous-url": P,
3671
- "model-value": void 0,
3672
- "onReset:modelValue": (V) => {
3673
- var J;
3674
- return (J = y.photos) == null ? void 0 : J.splice(j, 1);
3675
- }
3676
- }, null, 8, ["previous-url", "onReset:modelValue"]))), 128)),
3677
- (D(!0), K(oe, null, be(y.newPhotos || [], (P, j) => {
3678
- var V;
3679
- return D(), Q(Ee, {
3680
- key: j,
3681
- "model-value": ((V = y.newPhotos) == null ? void 0 : V[j]) || void 0,
3682
- "previous-url": void 0,
3683
- "onReset:modelValue": (J) => {
3684
- var ne;
3685
- return (ne = y.photos) == null ? void 0 : ne.splice(j, 1);
3686
- }
3687
- }, null, 8, ["model-value", "onReset:modelValue"]);
3688
- }), 128)),
3689
- C(Ee, {
3690
- "model-value": void 0,
3691
- "previous-url": void 0,
3692
- "onUpdate:modelValue": c[16] || (c[16] = (P) => a(P))
3693
- })
3694
- ])
3695
- ])
3696
- ]),
3697
- _: 1
3698
- }, 8, ["title"])
3699
- ])
3700
- ], 512)
3701
- ])
3702
- ]),
3703
- _: 1
3704
- }, 8, ["title", "show", "primary-action", "secondary-actions"])
3705
- ], 64);
3706
- };
3707
- }
3708
- }), Oi = { class: "fm-typo-en-title-md-600" }, Ai = { class: "pt-8 space-y-24" }, Si = { class: "flex gap-8 items-center justify-start" }, Ti = /* @__PURE__ */ ee({
3709
- __name: "BusinessForm",
3710
- props: {
3711
- businessId: {
3712
- type: String,
3713
- required: !0
3714
- },
3715
- initialValue: {
3716
- type: Object,
3717
- default: void 0
3718
- }
3719
- },
3720
- setup(r, { expose: e }) {
3721
- const t = r, n = ht(), s = vr(n), o = "https://feedmedev.cc", i = mt(
3722
- t.initialValue ? we(t.initialValue) : {
3723
- thumbnail: void 0,
3724
- name: "",
3725
- url: void 0,
3726
- newThumbnail: void 0
3727
- }
3728
- );
3729
- W(() => i.newThumbnail ? URL.createObjectURL(i.newThumbnail) : i.thumbnail);
3730
- const h = W(() => ge().currentCountry.value), p = ae(!1), d = ae(!1), _ = (E) => {
3731
- d.value = !d.value;
3732
- };
3733
- function $() {
3734
- i.thumbnail = void 0, i.newThumbnail = void 0;
3735
- }
3736
- const y = async () => {
3737
- const E = i;
3738
- await s.minor(async () => {
3739
- var x, F, T;
3740
- if (E.newThumbnail) {
3741
- const U = await ve.update(
3742
- `business/${t.businessId}/thumbnail/${gt().toISOString()}.png`,
3743
- E.newThumbnail
3744
- );
3745
- E.thumbnail = U, (x = t.initialValue) != null && x.thumbnail && await ve.delete(t.initialValue.thumbnail);
3746
- } else
3747
- (F = t.initialValue) != null && F.thumbnail && !E.thumbnail && await ve.delete((T = t.initialValue) == null ? void 0 : T.thumbnail);
3748
- const R = await nn.updateBusinessProfile(t.businessId, E), M = ge().currentBusiness;
3749
- M.value = { ...M.value, ...R }, _();
3750
- });
3751
- };
3752
- e({
3753
- show: d,
3754
- trigger: _
3755
- });
3756
- const { t: w } = ye();
3757
- return (E, R) => {
3758
- const M = q("FmTextField"), x = q("fm-button"), F = q("fm-side-sheet");
3759
- return D(), K(oe, null, [
3760
- me(E.$slots, "default", { trigger: _ }),
3761
- C(F, {
3762
- id: "unit-form",
3763
- modelValue: d.value,
3764
- "onUpdate:modelValue": R[4] || (R[4] = (T) => d.value = T),
3765
- "is-container": S(qr).FmForm,
3766
- "is-container-props": {
3767
- onValidationSuccess: y,
3768
- blameFormChildOnValidationFailed: !0
3769
- },
3770
- "max-width": 560,
3771
- "z-index": 100
3772
- }, {
3773
- "side-sheet-header": H(() => [
3774
- O("p", Oi, B(S(w)("settings.business.form.title")), 1)
3775
- ]),
3776
- "side-sheet-footer": H(() => [
3777
- O("div", Si, [
3778
- C(x, {
3779
- label: S(w)("common.update"),
3780
- loading: p.value,
3781
- size: "lg",
3782
- type: "submit",
3783
- variant: "primary"
3784
- }, null, 8, ["label", "loading"]),
3785
- C(x, {
3786
- label: S(w)("common.cancel"),
3787
- size: "lg",
3788
- variant: "tertiary",
3789
- onClick: R[3] || (R[3] = () => d.value = !1)
3790
- }, null, 8, ["label"])
3791
- ])
3792
- ]),
3793
- default: H(() => [
3794
- O("div", Ai, [
3795
- O("div", null, [
3796
- C(Ee, {
3797
- label: S(w)("settings.business.form.cover_photo.label"),
3798
- "sub-label": S(w)("settings.business.form.cover_photo.optional"),
3799
- "previous-url": i.thumbnail,
3800
- modelValue: i.newThumbnail,
3801
- "onUpdate:modelValue": R[0] || (R[0] = (T) => i.newThumbnail = T),
3802
- "onReset:modelValue": $
3803
- }, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
3804
- ]),
3805
- O("div", null, [
3806
- C(M, {
3807
- label: S(w)("settings.business.form.name"),
3808
- modelValue: i.name,
3809
- "onUpdate:modelValue": R[1] || (R[1] = (T) => i.name = T)
3810
- }, null, 8, ["label", "modelValue"])
3811
- ]),
3812
- O("div", null, [
3813
- C(M, {
3814
- label: S(w)("settings.business.form.url.label"),
3815
- "model-value": i.url || "",
3816
- "onUpdate:modelValue": R[2] || (R[2] = (T) => i.url = T),
3817
- placeholder: r.businessId,
3818
- rules: [
3819
- (T) => {
3820
- var U;
3821
- return !T || ((U = r.initialValue) == null ? void 0 : U.url) == i.url || h.value == S(dr).enum.MY || S(w)("settings.business.form.url.errors.disabled");
3822
- },
3823
- (T) => !T || S($r).test(T) || S(w)("settings.business.form.url.errors.format"),
3824
- (T) => !T || !S(_r).includes(T) || S(w)("settings.business.form.url.errors.reserved")
3825
- ]
3826
- }, {
3827
- prepend: H(() => [
3828
- O("span", null, B(S(o) + "/"), 1)
3829
- ]),
3830
- _: 1
3831
- }, 8, ["label", "model-value", "placeholder", "rules"])
3832
- ])
3833
- ])
3834
- ]),
3835
- _: 1
3836
- }, 8, ["modelValue", "is-container", "is-container-props"])
3837
- ], 64);
3838
- };
3839
- }
3840
- }), Pi = /* @__PURE__ */ ee({
3841
- __name: "BottomSheetMenu",
3842
- setup(r) {
3843
- const e = ae(!1);
3844
- async function t() {
3845
- await Dr(), e.value = !e.value;
3846
- }
3847
- return (n, s) => {
3848
- const o = q("FmButton"), i = q("FmBottomSheet");
3849
- return D(), Q(i, {
3850
- modelValue: e.value,
3851
- "onUpdate:modelValue": s[1] || (s[1] = (h) => e.value = h),
3852
- "dismiss-away": "",
3853
- "no-header": "",
3854
- "z-index": 110
3855
- }, {
3856
- "bottom-sheet-button": H(() => [
3857
- n.$slots.button ? fe("", !0) : (D(), Q(o, {
3858
- key: 0,
3859
- icon: "more_vert",
3860
- variant: "tertiary",
3861
- onClick: it(t, ["stop"])
3862
- })),
3863
- me(n.$slots, "button")
3864
- ]),
3865
- default: H(() => [
3866
- O("div", {
3867
- onClick: s[0] || (s[0] = (h) => e.value = !1)
3868
- }, [
3869
- me(n.$slots, "default")
3870
- ])
3871
- ]),
3872
- _: 3
3873
- }, 8, ["modelValue"]);
3874
- };
3875
- }
3876
- }), Li = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, Ni = /* @__PURE__ */ ee({
3877
- __name: "BottomSheetMenuItem",
3878
- props: {
3879
- label: {},
3880
- icon: {},
3881
- disabled: { type: Boolean },
3882
- itemClass: {}
3883
- },
3884
- setup(r) {
3885
- const e = r;
3886
- return (t, n) => {
3887
- const s = q("FmIcon");
3888
- return D(), K("div", Li, [
3889
- t.$slots.content ? fe("", !0) : (D(), K("div", {
3890
- key: 0,
3891
- class: Z(["flex items-center", {
3892
- "text-fm-color-typo-disabled": e.disabled,
3893
- "cursor-pointer": !e.disabled,
3894
- "cursor-not-allowed": e.disabled,
3895
- [e.itemClass || ""]: e.itemClass && !e.disabled
3896
- }])
3897
- }, [
3898
- t.icon ? (D(), Q(s, {
3899
- key: 0,
3900
- name: t.icon
3901
- }, null, 8, ["name"])) : fe("", !0),
3902
- je(" " + B(t.label), 1)
3903
- ], 2)),
3904
- me(t.$slots, "content")
3905
- ]);
3906
- };
3907
- }
3908
- }), Ci = { class: "fm-typo-cn-body-md-400 text-fm-color-typo-secondary xs:flex xs:flex-col" }, xi = { class: "flex flex-1" }, ki = {
3909
- key: 0,
3910
- class: "flex gap-8"
3911
- }, Mi = {
3912
- key: 0,
3913
- class: "space-y-4"
3914
- }, Vi = { class: "fm-typo-en-body-md-600" }, Fi = {
3915
- key: 0,
3916
- class: "space-y-8"
3917
- }, ji = { class: "flex justify-end" }, Di = { class: "flex-1 pb-64 overflow-auto divide-y divide-fm-color-neutral-gray-100" }, Ui = { key: 0 }, Gi = ["onClick"], Bi = { class: "flex justify-between items-center" }, Ki = { class: "fm-typo-en-body-lg-600" }, Hi = { class: "flex gap-8" }, qi = { class: "text-fm-color-typo-secondary" }, zi = { class: "text-fm-color-typo-secondary" }, Yi = { class: "text-fm-color-typo-secondary" }, ll = /* @__PURE__ */ ee({
3918
- __name: "Business",
3919
- setup(r) {
3920
- const { searchKey: e, filter: t } = In(), { copyTextToClipboard: n } = hr(), s = mr(), o = W(() => s.breakpoints.value.xs), { t: i } = ye(), h = W(() => {
3921
- const { currentBusiness: E, restaurants: R } = ge(), M = E.value;
3922
- if (!M)
3923
- return null;
3924
- const { id: x, name: F, thumbnail: T, url: U } = M, X = R.value.filter((G) => G.managable).map((G) => {
3925
- var u;
3926
- const { _id: Y, profile: a } = G, { name: l, email: g, phoneNo: A, address: L, sstRegNo: f } = {
3927
- ...a,
3928
- address: Te(a.address)
3929
- };
3930
- return {
3931
- id: Y,
3932
- code: ((u = G.profile) == null ? void 0 : u.code) || "--",
3933
- name: l,
3934
- email: g,
3935
- phone: A,
3936
- address: L.formatted,
3937
- withSST: !!f,
3938
- doc: G
3939
- };
3940
- });
3941
- return {
3942
- id: x,
3943
- name: F,
3944
- thumbnail: T,
3945
- url: `https://feedmedev.cc/${U || x}`,
3946
- doc: M,
3947
- canCreateRestaurant: Rn(M, R.value),
3948
- restaurants: X.filter(
3949
- ({ code: G, name: Y, address: a, phone: l, email: g }) => t([G, Y, a, l, g])
3950
- )
3951
- };
3952
- }), p = W(() => [
3953
- {
3954
- header: i("settings.business.restaurant.code"),
3955
- accessorKey: "code",
3956
- enableSorting: !1
3957
- },
3958
- {
3959
- header: i("settings.business.restaurant.title"),
3960
- accessorKey: "name",
3961
- enableSorting: !1
3962
- },
3963
- {
3964
- header: i("settings.business.restaurant.address"),
3965
- accessorKey: "address",
3966
- size: 200,
3967
- enableSorting: !1
3968
- },
3969
- {
3970
- header: i("settings.business.restaurant.contact"),
3971
- accessorKey: "phone",
3972
- enableSorting: !1
3973
- },
3974
- {
3975
- header: i("settings.business.restaurant.email"),
3976
- accessorKey: "email",
3977
- enableSorting: !1
3978
- },
3979
- {
3980
- header: i("settings.business.restaurant.tax.title"),
3981
- enableSorting: !1,
3982
- cell: (E) => {
3983
- var M;
3984
- const R = E.row.original;
3985
- return (M = R.doc.profile.sstRegNo) != null && M.length ? R.doc.profile.sstRegNo : i("settings.business.restaurant.tax.not_set");
3986
- }
3987
- },
3988
- {
3989
- id: "action",
3990
- header: "",
3991
- size: 80,
3992
- cell: (E) => {
3993
- const R = E.row.original;
3994
- return rn([
3995
- {
3996
- name: "edit",
3997
- onClick: () => w(R)
3998
- },
3999
- {
4000
- name: "file_copy",
4001
- onClick: () => {
4002
- n(R.id);
4003
- }
4004
- }
4005
- ]);
4006
- }
4007
- }
4008
- ]);
4009
- function d() {
4010
- var E;
4011
- n(((E = h.value) == null ? void 0 : E.url) || "");
4012
- }
4013
- function _() {
4014
- if (!h.value)
4015
- return;
4016
- const { name: E, url: R, thumbnail: M } = h.value.doc;
4017
- Xe($, Ti, {
4018
- businessId: h.value.id,
4019
- initialValue: {
4020
- name: E,
4021
- url: R,
4022
- thumbnail: M
4023
- }
4024
- });
4025
- }
4026
- const $ = Ur();
4027
- function y() {
4028
- Xe($, ur, {
4029
- enableFeedmeExpress: !1
4030
- });
4031
- }
4032
- function w(E) {
4033
- var R;
4034
- Xe($, ur, {
4035
- restaurantId: E.id,
4036
- restaurant: E.doc,
4037
- enableFeedmeExpress: ((R = E.doc.feedmeDelivery) == null ? void 0 : R.enable) || !1
4038
- });
4039
- }
4040
- return (E, R) => {
4041
- var z;
4042
- const M = q("FmSpacer"), x = q("FmButton"), F = q("FmTooltip"), T = q("FmSearch"), U = q("FmTable"), X = q("FmCircularProgress");
4043
- return D(), Q(Gr, {
4044
- heading: ((z = h.value) == null ? void 0 : z.name) || "--"
4045
- }, {
4046
- "sub-heading": H(() => {
4047
- var G;
4048
- return [
4049
- O("div", Ci, [
4050
- O("span", null, B(S(i)("settings.business.url")) + ": ", 1),
4051
- O("span", {
4052
- class: "cursor-pointer xs:w-max-[200px] truncate",
4053
- onClick: d
4054
- }, B((G = h.value) == null ? void 0 : G.url), 1)
4055
- ])
4056
- ];
4057
- }),
4058
- "append-heading": H(() => [
4059
- O("div", xi, [
4060
- C(M),
4061
- o.value ? (D(), K(oe, { key: 1 }, [
4062
- C(en, {
4063
- onClick: y,
4064
- label: S(i)("settings.business.add_restaurant"),
4065
- "prepend-icon": "add"
4066
- }, null, 8, ["label"]),
4067
- C(Pi, null, {
4068
- default: H(() => [
4069
- C(Ni, {
4070
- label: S(i)("common.edit"),
4071
- onClick: _
4072
- }, null, 8, ["label"])
4073
- ]),
4074
- _: 1
4075
- })
4076
- ], 64)) : (D(), K("div", ki, [
4077
- C(x, {
4078
- onClick: _,
4079
- variant: "secondary",
4080
- label: S(i)("common.edit")
4081
- }, null, 8, ["label"]),
4082
- C(F, {
4083
- variant: "rich",
4084
- placement: "left",
4085
- "z-index": 100
4086
- }, {
4087
- content: H(() => {
4088
- var G;
4089
- return [
4090
- (G = h.value) != null && G.canCreateRestaurant ? fe("", !0) : (D(), K("div", Mi, [
4091
- O("p", Vi, B(S(i)("settings.business.quota.limit_title")), 1),
4092
- O("p", null, B(S(i)("settings.business.quota.limit_message")), 1)
4093
- ]))
4094
- ];
4095
- }),
4096
- default: H(() => {
4097
- var G;
4098
- return [
4099
- C(x, {
4100
- onClick: y,
4101
- label: S(i)("settings.business.add_restaurant"),
4102
- disabled: !((G = h.value) != null && G.canCreateRestaurant),
4103
- "prepend-icon": "add"
4104
- }, null, 8, ["label", "disabled"])
4105
- ];
4106
- }),
4107
- _: 1
4108
- })
4109
- ]))
4110
- ])
4111
- ]),
4112
- default: H(() => {
4113
- var G, Y;
4114
- return [
4115
- o.value ? (D(), K(oe, { key: 1 }, [
4116
- C(T, {
4117
- class: "my-8 mx-16",
4118
- modelValue: S(e),
4119
- "onUpdate:modelValue": R[2] || (R[2] = (a) => Tt(e) ? e.value = a : null),
4120
- placeholder: S(i)("settings.business.search_restaurants")
4121
- }, null, 8, ["modelValue", "placeholder"]),
4122
- O("div", Di, [
4123
- h.value ? (D(!0), K(oe, { key: 1 }, be((Y = h.value) == null ? void 0 : Y.restaurants, (a) => {
4124
- var l;
4125
- return D(), K("div", {
4126
- key: a.id,
4127
- class: "py-12 px-16 space-y-4",
4128
- onClick: (g) => w(a)
4129
- }, [
4130
- O("div", Bi, [
4131
- O("div", Ki, B(a.name), 1),
4132
- O("div", Hi, [
4133
- C(x, {
4134
- icon: "edit",
4135
- "text-color": "neutral-gray-400",
4136
- variant: "tertiary",
4137
- onClick: it((g) => w(a), ["stop"])
4138
- }, null, 8, ["onClick"]),
4139
- C(x, {
4140
- icon: "file_copy",
4141
- "text-color": "neutral-gray-400",
4142
- variant: "tertiary",
4143
- onClick: it((g) => S(n)(a.id), ["stop"])
4144
- }, null, 8, ["onClick"])
4145
- ])
4146
- ]),
4147
- O("div", qi, B(S(i)("settings.business.restaurant.contact")) + ": " + B(a.phone), 1),
4148
- O("div", zi, B(S(i)("settings.business.restaurant.email")) + ": " + B(a.email), 1),
4149
- O("div", Yi, B(S(i)("settings.business.restaurant.tax.title")) + ": " + B((l = a.doc.profile.sstRegNo) != null && l.length ? a.doc.profile.sstRegNo : S(i)("settings.business.restaurant.tax.not_set")), 1)
4150
- ], 8, Gi);
4151
- }), 128)) : (D(), K("div", Ui, [
4152
- C(X, { size: "lg" })
4153
- ]))
4154
- ])
4155
- ], 64)) : (D(), K("div", Fi, [
4156
- O("div", ji, [
4157
- C(T, {
4158
- class: "w-[320px]",
4159
- modelValue: S(e),
4160
- "onUpdate:modelValue": R[0] || (R[0] = (a) => Tt(e) ? e.value = a : null),
4161
- placeholder: S(i)("settings.business.search_restaurants")
4162
- }, null, 8, ["modelValue", "placeholder"])
4163
- ]),
4164
- C(U, {
4165
- "column-defs": p.value,
4166
- "row-data": ((G = h.value) == null ? void 0 : G.restaurants) || [],
4167
- "shrink-at": !1,
4168
- loading: !h.value,
4169
- onRowClick: R[1] || (R[1] = (a) => w(a.original))
4170
- }, null, 8, ["column-defs", "row-data", "loading"])
4171
- ]))
4172
- ];
4173
- }),
4174
- _: 1
4175
- }, 8, ["heading"]);
4176
- };
4177
- }
4178
- });
4179
- export {
4180
- ll as default
4181
- };