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