@feedmepos/mf-settings 0.0.55 → 0.0.56-prod

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