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