@feedmepos/mf-settings 0.0.52 → 0.0.54
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.
- package/dist/App-1dab65c3.js +22098 -0
- package/dist/Business-efd67008.js +3899 -0
- package/dist/CreateBusiness-a7386de7.js +352 -0
- package/dist/FoodCourt-40732589.js +71535 -0
- package/dist/{Tagging-55538d2b.js → Tagging-f578f89a.js} +1 -1
- package/dist/_commonjs-dynamic-modules-bed80856.js +6 -0
- package/dist/{app-b66ea7e1.js → app-1f5f4a9b.js} +5 -5
- package/dist/app.js +1 -1
- package/dist/apps/mf-settings/src/helpers/phone.d.ts +4 -0
- package/dist/apps/mf-settings/tsconfig.app.tsbuildinfo +1 -1
- package/dist/packages/shared/src/components/info/TextChip.vue.d.ts +23 -2
- package/dist/packages/shared/src/components/layout/FormItem.vue.d.ts +2 -0
- package/package.json +4 -3
- package/dist/App-22950de9.js +0 -4352
- package/dist/Business-c9b59843.js +0 -3893
- package/dist/CreateBusiness-0850150d.js +0 -230
- package/dist/FoodCourt-ad9640e4.js +0 -47797
- package/dist/index-1eb3cc0a.js +0 -17754
|
@@ -0,0 +1,3899 @@
|
|
|
1
|
+
var Ar = Object.defineProperty;
|
|
2
|
+
var Or = (t, e, r) => e in t ? Ar(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var Be = (t, e, r) => (Or(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { defineComponent as ee, ref as ne, resolveComponent as z, openBlock as F, createBlock as Q, withCtx as q, withModifiers as rt, createCommentVNode as le, renderSlot as ue, createElementVNode as _, nextTick as Sr, createElementBlock as B, normalizeClass as Z, createTextVNode as Ce, toDisplayString as D, computed as X, normalizeStyle as xe, createVNode as T, reactive as lt, Fragment as se, unref as E, renderList as me, h as _t, Teleport as Pr, Transition as Tr, withKeys as Lr, watch as Et, onMounted as Nr, onUnmounted as Cr, toRaw as wt, normalizeProps as xr, guardReactiveProps as kr, getCurrentInstance as Vr, isRef as Rt } from "vue";
|
|
5
|
+
import { useCoreStore as fe, useI18n as pe, CustomAttributesForm as Fr } from "@feedmepos/mf-common";
|
|
6
|
+
import { useSnackbar as ut, components as jr, useDialog as or, useDialogChild as Mr, useBreakpoints as ir } from "@feedmepos/ui-library";
|
|
7
|
+
import { D as ct, u as lr, _ as Ur, a as Dr } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-e9712a4d.js";
|
|
8
|
+
import { c as $e, _ as Gr, a as Ke } from "./object-8ac0c0d8.js";
|
|
9
|
+
import { _ as we, c as Br } from "./FormSection.vue_vue_type_script_setup_true_lang-6aab82f2.js";
|
|
10
|
+
import { e as dt, g as ur, c as Kr } from "./index-f1e5e565.js";
|
|
11
|
+
import { u as cr, b as qe, a as He, g as ft } from "./index-72d7bc88.js";
|
|
12
|
+
import { b as qr } from "./business-906742ba.js";
|
|
13
|
+
import { t as ze, w as Xe, x as Hr, y as zr, z as Xr, A as Yr, B as ke, u as ge, D as Wr, G as Jr } from "./map-695afd6f.js";
|
|
14
|
+
import { _ as dr, r as ce } from "./rules-c9fa22f8.js";
|
|
15
|
+
import { u as Zr } from "./app-1f5f4a9b.js";
|
|
16
|
+
import "pinia";
|
|
17
|
+
import "@feedmepos/mf-mdm";
|
|
18
|
+
import "vue-router";
|
|
19
|
+
import "@feedmepos/mf-e-invoice";
|
|
20
|
+
var Qr = {};
|
|
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
|
+
})(Qr);
|
|
54
|
+
const en = /* @__PURE__ */ ee({
|
|
55
|
+
__name: "BottomSheetMenu",
|
|
56
|
+
setup(t) {
|
|
57
|
+
const e = ne(!1);
|
|
58
|
+
async function r() {
|
|
59
|
+
await Sr(), e.value = !e.value;
|
|
60
|
+
}
|
|
61
|
+
return (n, s) => {
|
|
62
|
+
const o = z("FmButton"), i = z("FmBottomSheet");
|
|
63
|
+
return F(), Q(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": q(() => [
|
|
71
|
+
n.$slots.button ? le("", !0) : (F(), Q(o, {
|
|
72
|
+
key: 0,
|
|
73
|
+
icon: "more_vert",
|
|
74
|
+
variant: "tertiary",
|
|
75
|
+
onClick: rt(r, ["stop"])
|
|
76
|
+
})),
|
|
77
|
+
ue(n.$slots, "button")
|
|
78
|
+
]),
|
|
79
|
+
default: q(() => [
|
|
80
|
+
_("div", {
|
|
81
|
+
onClick: s[0] || (s[0] = (f) => e.value = !1)
|
|
82
|
+
}, [
|
|
83
|
+
ue(n.$slots, "default")
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
_: 3
|
|
87
|
+
}, 8, ["modelValue"]);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}), tn = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, rn = /* @__PURE__ */ ee({
|
|
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 = z("FmIcon");
|
|
102
|
+
return F(), B("div", tn, [
|
|
103
|
+
r.$slots.content ? le("", !0) : (F(), B("div", {
|
|
104
|
+
key: 0,
|
|
105
|
+
class: Z(["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(), Q(s, {
|
|
113
|
+
key: 0,
|
|
114
|
+
name: r.icon
|
|
115
|
+
}, null, 8, ["name"])) : le("", !0),
|
|
116
|
+
Ce(" " + D(r.label), 1)
|
|
117
|
+
], 2)),
|
|
118
|
+
ue(r.$slots, "content")
|
|
119
|
+
]);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}), nn = {
|
|
123
|
+
key: 0,
|
|
124
|
+
class: "space-y-4"
|
|
125
|
+
}, sn = { class: "fm-typo-en-body-lg-600" }, an = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, on = {
|
|
126
|
+
class: /* @__PURE__ */ Z(["absolute inset-0", "h-full w-full", "rounded-md overflow-hidden"])
|
|
127
|
+
}, ln = {
|
|
128
|
+
class: /* @__PURE__ */ Z(["relative z-0", "w-full h-full", "overflow-hidden"])
|
|
129
|
+
}, un = ["src"], cn = { class: "fm-typo-en-body-lg-600" }, dn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ye = /* @__PURE__ */ ee({
|
|
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 = X(() => r.modelValue ? URL.createObjectURL(r.modelValue) : r.previousUrl);
|
|
143
|
+
return (o, i) => {
|
|
144
|
+
const f = z("fm-icon"), d = z("fm-drop-field");
|
|
145
|
+
return s.value ? (F(), B("div", nn, [
|
|
146
|
+
_("p", sn, [
|
|
147
|
+
Ce(D(r.label) + " ", 1),
|
|
148
|
+
_("span", an, D(o.subLabel), 1)
|
|
149
|
+
]),
|
|
150
|
+
_("div", {
|
|
151
|
+
class: Z(["relative", "border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md"]),
|
|
152
|
+
style: xe({ width: `${r.width}px`, height: `${r.height}px` })
|
|
153
|
+
}, [
|
|
154
|
+
_("div", on, [
|
|
155
|
+
_("div", ln, [
|
|
156
|
+
_("img", {
|
|
157
|
+
class: Z(["h-full w-full", "object-cover"]),
|
|
158
|
+
src: s.value,
|
|
159
|
+
alt: "product image"
|
|
160
|
+
}, null, 8, un)
|
|
161
|
+
])
|
|
162
|
+
]),
|
|
163
|
+
o.canDelete ? (F(), B("button", {
|
|
164
|
+
key: 0,
|
|
165
|
+
class: Z([
|
|
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
|
+
T(f, { name: "close" })
|
|
174
|
+
])) : le("", !0)
|
|
175
|
+
], 4)
|
|
176
|
+
])) : (F(), Q(d, {
|
|
177
|
+
key: 1,
|
|
178
|
+
accept: ".jpg, .jpeg, .png, .gif",
|
|
179
|
+
style: xe({ width: `${r.width}px`, height: `${r.height}px` }),
|
|
180
|
+
onFileUpload: i[1] || (i[1] = (u) => n("update:model-value", u))
|
|
181
|
+
}, {
|
|
182
|
+
label: q(() => [
|
|
183
|
+
_("p", cn, [
|
|
184
|
+
Ce(D(r.label) + " ", 1),
|
|
185
|
+
_("span", dn, D(r.subLabel), 1)
|
|
186
|
+
])
|
|
187
|
+
]),
|
|
188
|
+
"accept-text": q(() => 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
|
+
}), fr = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), mr = [
|
|
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
|
+
], Ye = {
|
|
693
|
+
async get(t, e) {
|
|
694
|
+
const r = ze(void 0, e), n = Xe(r, t);
|
|
695
|
+
return await (await Hr(n)).text();
|
|
696
|
+
},
|
|
697
|
+
async update(t, e, r) {
|
|
698
|
+
const n = ze(void 0, r), s = Xe(n, t);
|
|
699
|
+
return await zr(s, e), await Xr(s);
|
|
700
|
+
},
|
|
701
|
+
async delete(t, e) {
|
|
702
|
+
const r = ze(void 0, e), n = Xe(r, t);
|
|
703
|
+
await Yr(n);
|
|
704
|
+
}
|
|
705
|
+
}, de = {
|
|
706
|
+
async get(t) {
|
|
707
|
+
return await Ye.get(t);
|
|
708
|
+
},
|
|
709
|
+
async update(t, e, r) {
|
|
710
|
+
return await Ye.update(t, e);
|
|
711
|
+
},
|
|
712
|
+
async delete(t) {
|
|
713
|
+
await Ye.delete(t);
|
|
714
|
+
}
|
|
715
|
+
}, fn = { class: "fm-typo-en-title-md-600" }, mn = { class: "pt-8 space-y-24" }, pn = { class: "flex gap-8 items-center justify-start" }, hn = /* @__PURE__ */ ee({
|
|
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 = ut(), s = cr(n), o = "https://feedmedev.cc", i = lt(
|
|
729
|
+
r.initialValue ? $e(r.initialValue) : {
|
|
730
|
+
thumbnail: void 0,
|
|
731
|
+
name: "",
|
|
732
|
+
url: void 0,
|
|
733
|
+
newThumbnail: void 0
|
|
734
|
+
}
|
|
735
|
+
);
|
|
736
|
+
X(() => i.newThumbnail ? URL.createObjectURL(i.newThumbnail) : i.thumbnail);
|
|
737
|
+
const f = X(() => fe().currentCountry.value), d = ne(!1), u = ne(!1), b = (y) => {
|
|
738
|
+
u.value = !u.value;
|
|
739
|
+
};
|
|
740
|
+
function g() {
|
|
741
|
+
i.thumbnail = void 0, i.newThumbnail = void 0;
|
|
742
|
+
}
|
|
743
|
+
const L = async () => {
|
|
744
|
+
const y = i;
|
|
745
|
+
await s.minor(async () => {
|
|
746
|
+
var C, x, A;
|
|
747
|
+
if (y.newThumbnail) {
|
|
748
|
+
const j = await de.update(
|
|
749
|
+
`business/${r.businessId}/thumbnail/${ct().toISOString()}.png`,
|
|
750
|
+
y.newThumbnail
|
|
751
|
+
);
|
|
752
|
+
y.thumbnail = j, (C = r.initialValue) != null && C.thumbnail && await de.delete(r.initialValue.thumbnail);
|
|
753
|
+
} else
|
|
754
|
+
(x = r.initialValue) != null && x.thumbnail && !y.thumbnail && await de.delete((A = r.initialValue) == null ? void 0 : A.thumbnail);
|
|
755
|
+
const P = await qr.updateBusinessProfile(r.businessId, y), $ = fe().currentBusiness;
|
|
756
|
+
$.value = { ...$.value, ...P }, b();
|
|
757
|
+
});
|
|
758
|
+
};
|
|
759
|
+
e({
|
|
760
|
+
show: u,
|
|
761
|
+
trigger: b
|
|
762
|
+
});
|
|
763
|
+
const { t: c } = pe();
|
|
764
|
+
return (y, P) => {
|
|
765
|
+
const $ = z("FmTextField"), C = z("fm-button"), x = z("fm-side-sheet");
|
|
766
|
+
return F(), B(se, null, [
|
|
767
|
+
ue(y.$slots, "default", { trigger: b }),
|
|
768
|
+
T(x, {
|
|
769
|
+
id: "unit-form",
|
|
770
|
+
modelValue: u.value,
|
|
771
|
+
"onUpdate:modelValue": P[4] || (P[4] = (A) => u.value = A),
|
|
772
|
+
"is-container": E(jr).FmForm,
|
|
773
|
+
"is-container-props": {
|
|
774
|
+
onValidationSuccess: L,
|
|
775
|
+
blameFormChildOnValidationFailed: !0
|
|
776
|
+
},
|
|
777
|
+
"max-width": 560,
|
|
778
|
+
"z-index": 100
|
|
779
|
+
}, {
|
|
780
|
+
"side-sheet-header": q(() => [
|
|
781
|
+
_("p", fn, D(E(c)("settings.business.form.title")), 1)
|
|
782
|
+
]),
|
|
783
|
+
"side-sheet-footer": q(() => [
|
|
784
|
+
_("div", pn, [
|
|
785
|
+
T(C, {
|
|
786
|
+
label: E(c)("common.update"),
|
|
787
|
+
loading: d.value,
|
|
788
|
+
size: "lg",
|
|
789
|
+
type: "submit",
|
|
790
|
+
variant: "primary"
|
|
791
|
+
}, null, 8, ["label", "loading"]),
|
|
792
|
+
T(C, {
|
|
793
|
+
label: E(c)("common.cancel"),
|
|
794
|
+
size: "lg",
|
|
795
|
+
variant: "tertiary",
|
|
796
|
+
onClick: P[3] || (P[3] = () => u.value = !1)
|
|
797
|
+
}, null, 8, ["label"])
|
|
798
|
+
])
|
|
799
|
+
]),
|
|
800
|
+
default: q(() => [
|
|
801
|
+
_("div", mn, [
|
|
802
|
+
_("div", null, [
|
|
803
|
+
T(ye, {
|
|
804
|
+
label: E(c)("settings.business.form.cover_photo.label"),
|
|
805
|
+
"sub-label": E(c)("settings.business.form.cover_photo.optional"),
|
|
806
|
+
"previous-url": i.thumbnail,
|
|
807
|
+
modelValue: i.newThumbnail,
|
|
808
|
+
"onUpdate:modelValue": P[0] || (P[0] = (A) => i.newThumbnail = A),
|
|
809
|
+
"onReset:modelValue": g
|
|
810
|
+
}, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
|
|
811
|
+
]),
|
|
812
|
+
_("div", null, [
|
|
813
|
+
T($, {
|
|
814
|
+
label: E(c)("settings.business.form.name"),
|
|
815
|
+
modelValue: i.name,
|
|
816
|
+
"onUpdate:modelValue": P[1] || (P[1] = (A) => i.name = A)
|
|
817
|
+
}, null, 8, ["label", "modelValue"])
|
|
818
|
+
]),
|
|
819
|
+
_("div", null, [
|
|
820
|
+
T($, {
|
|
821
|
+
label: E(c)("settings.business.form.url.label"),
|
|
822
|
+
"model-value": i.url || "",
|
|
823
|
+
"onUpdate:modelValue": P[2] || (P[2] = (A) => i.url = A),
|
|
824
|
+
placeholder: t.businessId,
|
|
825
|
+
rules: [
|
|
826
|
+
(A) => {
|
|
827
|
+
var j;
|
|
828
|
+
return !A || ((j = t.initialValue) == null ? void 0 : j.url) == i.url || f.value == E(dt.F_COUNTRY).enum.MY || E(c)("settings.business.form.url.errors.disabled");
|
|
829
|
+
},
|
|
830
|
+
(A) => !A || E(fr).test(A) || E(c)("settings.business.form.url.errors.format"),
|
|
831
|
+
(A) => !A || !E(mr).includes(A) || E(c)("settings.business.form.url.errors.reserved")
|
|
832
|
+
]
|
|
833
|
+
}, {
|
|
834
|
+
prepend: q(() => [
|
|
835
|
+
_("span", null, D(E(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
|
+
}), vn = { class: "fm-typo-en-body-lg-600" }, bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, It = /* @__PURE__ */ ee({
|
|
848
|
+
__name: "FormLabel",
|
|
849
|
+
props: {
|
|
850
|
+
label: {},
|
|
851
|
+
optional: { type: Boolean, default: !1 },
|
|
852
|
+
subLabel: {}
|
|
853
|
+
},
|
|
854
|
+
setup(t) {
|
|
855
|
+
const e = t, r = X(() => e.optional && !e.subLabel ? "(optional)" : e.subLabel);
|
|
856
|
+
return (n, s) => (F(), B("p", vn, [
|
|
857
|
+
Ce(D(n.label) + " ", 1),
|
|
858
|
+
_("span", bn, D(r.value), 1)
|
|
859
|
+
]));
|
|
860
|
+
}
|
|
861
|
+
}), gn = { class: "space-y-4" }, yn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, $n = { class: "fm-typo-en-body-lg-600" }, At = /* @__PURE__ */ ee({
|
|
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", gn, [
|
|
875
|
+
_("div", yn, D(t.name), 1),
|
|
876
|
+
_("div", $n, D(t.value), 1)
|
|
877
|
+
]));
|
|
878
|
+
}
|
|
879
|
+
}), _n = {};
|
|
880
|
+
function En(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 wn = /* @__PURE__ */ dr(_n, [["render", En]]), Rn = {
|
|
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
|
+
}, In = { class: "fm-typo-en-title-sm-600" }, Ot = /* @__PURE__ */ ee({
|
|
889
|
+
__name: "Summary",
|
|
890
|
+
props: {
|
|
891
|
+
title: {},
|
|
892
|
+
variant: {},
|
|
893
|
+
items: {}
|
|
894
|
+
},
|
|
895
|
+
setup(t) {
|
|
896
|
+
const e = t, r = or();
|
|
897
|
+
function n() {
|
|
898
|
+
r.open({
|
|
899
|
+
title: e.title,
|
|
900
|
+
contentComponent: _t("div", { class: "space-y-4" }, [
|
|
901
|
+
...e.items.map(
|
|
902
|
+
(s) => _t(At, {
|
|
903
|
+
name: s.name,
|
|
904
|
+
value: s.value || "--"
|
|
905
|
+
})
|
|
906
|
+
)
|
|
907
|
+
])
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
return (s, o) => {
|
|
911
|
+
const i = z("FmButton");
|
|
912
|
+
return e.variant === "full" ? (F(), B("div", Rn, [
|
|
913
|
+
_("div", In, D(s.title), 1),
|
|
914
|
+
T(wn),
|
|
915
|
+
(F(!0), B(se, null, me(s.items, (f) => (F(), Q(At, {
|
|
916
|
+
key: f.name,
|
|
917
|
+
name: f.name,
|
|
918
|
+
value: f.value || "--"
|
|
919
|
+
}, null, 8, ["name", "value"]))), 128))
|
|
920
|
+
])) : (F(), Q(i, {
|
|
921
|
+
key: 1,
|
|
922
|
+
icon: "info",
|
|
923
|
+
variant: "tertiary",
|
|
924
|
+
onClick: n
|
|
925
|
+
}));
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
}), An = {
|
|
929
|
+
class: /* @__PURE__ */ Z([
|
|
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
|
+
}, On = { class: "fm-typo-en-title-sm-600 mr-auto" }, Sn = {
|
|
936
|
+
class: /* @__PURE__ */ Z(["flex flex-col", "flex-1 overflow-scroll", "w-full", "px-24"])
|
|
937
|
+
}, Pn = /* @__PURE__ */ ee({
|
|
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 = z("fm-button"), d = z("fm-form");
|
|
955
|
+
return F(), Q(Pr, { to: "body" }, [
|
|
956
|
+
T(Tr, { name: "fade" }, {
|
|
957
|
+
default: q(() => [
|
|
958
|
+
o.show ? (F(), Q(d, {
|
|
959
|
+
key: 0,
|
|
960
|
+
"blame-form-child-on-validation-failed": "",
|
|
961
|
+
class: Z(["fixed inset-0", "flex flex-col", "w-screen h-dvh", "bg-fm-color-neutral-white"]),
|
|
962
|
+
style: xe({ zIndex: o.zIndex }),
|
|
963
|
+
tabindex: "-1",
|
|
964
|
+
onValidationSuccess: n,
|
|
965
|
+
onKeyup: Lr(s, ["esc"])
|
|
966
|
+
}, {
|
|
967
|
+
default: q(() => [
|
|
968
|
+
_("div", An, [
|
|
969
|
+
_("p", On, D(o.title), 1),
|
|
970
|
+
ue(o.$slots, "append-title", {}, void 0, !0),
|
|
971
|
+
(F(!0), B(se, null, me(o.secondaryActions, (u) => (F(), Q(f, {
|
|
972
|
+
label: u.label,
|
|
973
|
+
variant: "tertiary",
|
|
974
|
+
onClick: u.click
|
|
975
|
+
}, null, 8, ["label", "onClick"]))), 256)),
|
|
976
|
+
T(f, {
|
|
977
|
+
label: o.primaryAction.label,
|
|
978
|
+
type: "submit",
|
|
979
|
+
variant: "primary"
|
|
980
|
+
}, null, 8, ["label"])
|
|
981
|
+
]),
|
|
982
|
+
_("div", Sn, [
|
|
983
|
+
ue(o.$slots, "default", {}, void 0, !0)
|
|
984
|
+
])
|
|
985
|
+
]),
|
|
986
|
+
_: 3
|
|
987
|
+
}, 8, ["style"])) : le("", !0)
|
|
988
|
+
]),
|
|
989
|
+
_: 3
|
|
990
|
+
})
|
|
991
|
+
]);
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
});
|
|
995
|
+
const Tn = /* @__PURE__ */ dr(Pn, [["__scopeId", "data-v-5b5c7179"]]);
|
|
996
|
+
var nt = { exports: {} };
|
|
997
|
+
const Ln = "2.0.0", pr = 256, Nn = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
998
|
+
9007199254740991, Cn = 16, xn = pr - 6, kn = [
|
|
999
|
+
"major",
|
|
1000
|
+
"premajor",
|
|
1001
|
+
"minor",
|
|
1002
|
+
"preminor",
|
|
1003
|
+
"patch",
|
|
1004
|
+
"prepatch",
|
|
1005
|
+
"prerelease"
|
|
1006
|
+
];
|
|
1007
|
+
var je = {
|
|
1008
|
+
MAX_LENGTH: pr,
|
|
1009
|
+
MAX_SAFE_COMPONENT_LENGTH: Cn,
|
|
1010
|
+
MAX_SAFE_BUILD_LENGTH: xn,
|
|
1011
|
+
MAX_SAFE_INTEGER: Nn,
|
|
1012
|
+
RELEASE_TYPES: kn,
|
|
1013
|
+
SEMVER_SPEC_VERSION: Ln,
|
|
1014
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
1015
|
+
FLAG_LOOSE: 2
|
|
1016
|
+
};
|
|
1017
|
+
const Vn = 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 Me = Vn;
|
|
1020
|
+
(function(t, e) {
|
|
1021
|
+
const {
|
|
1022
|
+
MAX_SAFE_COMPONENT_LENGTH: r,
|
|
1023
|
+
MAX_SAFE_BUILD_LENGTH: n,
|
|
1024
|
+
MAX_LENGTH: s
|
|
1025
|
+
} = je, o = Me;
|
|
1026
|
+
e = t.exports = {};
|
|
1027
|
+
const i = e.re = [], f = e.safeRe = [], d = e.src = [], u = e.t = {};
|
|
1028
|
+
let b = 0;
|
|
1029
|
+
const g = "[a-zA-Z0-9-]", L = [
|
|
1030
|
+
["\\s", 1],
|
|
1031
|
+
["\\d", s],
|
|
1032
|
+
[g, n]
|
|
1033
|
+
], c = (P) => {
|
|
1034
|
+
for (const [$, C] of L)
|
|
1035
|
+
P = P.split(`${$}*`).join(`${$}{0,${C}}`).split(`${$}+`).join(`${$}{1,${C}}`);
|
|
1036
|
+
return P;
|
|
1037
|
+
}, y = (P, $, C) => {
|
|
1038
|
+
const x = c($), A = b++;
|
|
1039
|
+
o(P, A, $), u[P] = A, d[A] = $, i[A] = new RegExp($, C ? "g" : void 0), f[A] = new RegExp(x, C ? "g" : void 0);
|
|
1040
|
+
};
|
|
1041
|
+
y("NUMERICIDENTIFIER", "0|[1-9]\\d*"), y("NUMERICIDENTIFIERLOOSE", "\\d+"), y("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${g}*`), y("MAINVERSION", `(${d[u.NUMERICIDENTIFIER]})\\.(${d[u.NUMERICIDENTIFIER]})\\.(${d[u.NUMERICIDENTIFIER]})`), y("MAINVERSIONLOOSE", `(${d[u.NUMERICIDENTIFIERLOOSE]})\\.(${d[u.NUMERICIDENTIFIERLOOSE]})\\.(${d[u.NUMERICIDENTIFIERLOOSE]})`), y("PRERELEASEIDENTIFIER", `(?:${d[u.NUMERICIDENTIFIER]}|${d[u.NONNUMERICIDENTIFIER]})`), y("PRERELEASEIDENTIFIERLOOSE", `(?:${d[u.NUMERICIDENTIFIERLOOSE]}|${d[u.NONNUMERICIDENTIFIER]})`), y("PRERELEASE", `(?:-(${d[u.PRERELEASEIDENTIFIER]}(?:\\.${d[u.PRERELEASEIDENTIFIER]})*))`), y("PRERELEASELOOSE", `(?:-?(${d[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[u.PRERELEASEIDENTIFIERLOOSE]})*))`), y("BUILDIDENTIFIER", `${g}+`), y("BUILD", `(?:\\+(${d[u.BUILDIDENTIFIER]}(?:\\.${d[u.BUILDIDENTIFIER]})*))`), y("FULLPLAIN", `v?${d[u.MAINVERSION]}${d[u.PRERELEASE]}?${d[u.BUILD]}?`), y("FULL", `^${d[u.FULLPLAIN]}$`), y("LOOSEPLAIN", `[v=\\s]*${d[u.MAINVERSIONLOOSE]}${d[u.PRERELEASELOOSE]}?${d[u.BUILD]}?`), y("LOOSE", `^${d[u.LOOSEPLAIN]}$`), y("GTLT", "((?:<|>)?=?)"), y("XRANGEIDENTIFIERLOOSE", `${d[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), y("XRANGEIDENTIFIER", `${d[u.NUMERICIDENTIFIER]}|x|X|\\*`), y("XRANGEPLAIN", `[v=\\s]*(${d[u.XRANGEIDENTIFIER]})(?:\\.(${d[u.XRANGEIDENTIFIER]})(?:\\.(${d[u.XRANGEIDENTIFIER]})(?:${d[u.PRERELEASE]})?${d[u.BUILD]}?)?)?`), y("XRANGEPLAINLOOSE", `[v=\\s]*(${d[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[u.XRANGEIDENTIFIERLOOSE]})(?:${d[u.PRERELEASELOOSE]})?${d[u.BUILD]}?)?)?`), y("XRANGE", `^${d[u.GTLT]}\\s*${d[u.XRANGEPLAIN]}$`), y("XRANGELOOSE", `^${d[u.GTLT]}\\s*${d[u.XRANGEPLAINLOOSE]}$`), y("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), y("COERCE", `${d[u.COERCEPLAIN]}(?:$|[^\\d])`), y("COERCEFULL", d[u.COERCEPLAIN] + `(?:${d[u.PRERELEASE]})?(?:${d[u.BUILD]})?(?:$|[^\\d])`), y("COERCERTL", d[u.COERCE], !0), y("COERCERTLFULL", d[u.COERCEFULL], !0), y("LONETILDE", "(?:~>?)"), y("TILDETRIM", `(\\s*)${d[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", y("TILDE", `^${d[u.LONETILDE]}${d[u.XRANGEPLAIN]}$`), y("TILDELOOSE", `^${d[u.LONETILDE]}${d[u.XRANGEPLAINLOOSE]}$`), y("LONECARET", "(?:\\^)"), y("CARETTRIM", `(\\s*)${d[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", y("CARET", `^${d[u.LONECARET]}${d[u.XRANGEPLAIN]}$`), y("CARETLOOSE", `^${d[u.LONECARET]}${d[u.XRANGEPLAINLOOSE]}$`), y("COMPARATORLOOSE", `^${d[u.GTLT]}\\s*(${d[u.LOOSEPLAIN]})$|^$`), y("COMPARATOR", `^${d[u.GTLT]}\\s*(${d[u.FULLPLAIN]})$|^$`), y("COMPARATORTRIM", `(\\s*)${d[u.GTLT]}\\s*(${d[u.LOOSEPLAIN]}|${d[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", y("HYPHENRANGE", `^\\s*(${d[u.XRANGEPLAIN]})\\s+-\\s+(${d[u.XRANGEPLAIN]})\\s*$`), y("HYPHENRANGELOOSE", `^\\s*(${d[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[u.XRANGEPLAINLOOSE]})\\s*$`), y("STAR", "(<|>)?=?\\s*\\*"), y("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), y("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
1042
|
+
})(nt, nt.exports);
|
|
1043
|
+
var Ae = nt.exports;
|
|
1044
|
+
const Fn = Object.freeze({ loose: !0 }), jn = Object.freeze({}), Mn = (t) => t ? typeof t != "object" ? Fn : t : jn;
|
|
1045
|
+
var mt = Mn;
|
|
1046
|
+
const St = /^[0-9]+$/, hr = (t, e) => {
|
|
1047
|
+
const r = St.test(t), n = St.test(e);
|
|
1048
|
+
return r && n && (t = +t, e = +e), t === e ? 0 : r && !n ? -1 : n && !r ? 1 : t < e ? -1 : 1;
|
|
1049
|
+
}, Un = (t, e) => hr(e, t);
|
|
1050
|
+
var vr = {
|
|
1051
|
+
compareIdentifiers: hr,
|
|
1052
|
+
rcompareIdentifiers: Un
|
|
1053
|
+
};
|
|
1054
|
+
const Oe = Me, { MAX_LENGTH: Pt, MAX_SAFE_INTEGER: Se } = je, { safeRe: Tt, t: Lt } = Ae, Dn = mt, { compareIdentifiers: be } = vr;
|
|
1055
|
+
let Gn = class ie {
|
|
1056
|
+
constructor(e, r) {
|
|
1057
|
+
if (r = Dn(r), e instanceof ie) {
|
|
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 > Pt)
|
|
1064
|
+
throw new TypeError(
|
|
1065
|
+
`version is longer than ${Pt} characters`
|
|
1066
|
+
);
|
|
1067
|
+
Oe("SemVer", e, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
|
|
1068
|
+
const n = e.trim().match(r.loose ? Tt[Lt.LOOSE] : Tt[Lt.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 > Se || this.major < 0)
|
|
1072
|
+
throw new TypeError("Invalid major version");
|
|
1073
|
+
if (this.minor > Se || this.minor < 0)
|
|
1074
|
+
throw new TypeError("Invalid minor version");
|
|
1075
|
+
if (this.patch > Se || 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 < Se)
|
|
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 (Oe("SemVer.compare", this.version, this.options, e), !(e instanceof ie)) {
|
|
1094
|
+
if (typeof e == "string" && e === this.version)
|
|
1095
|
+
return 0;
|
|
1096
|
+
e = new ie(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 ie || (e = new ie(e, this.options)), be(this.major, e.major) || be(this.minor, e.minor) || be(this.patch, e.patch);
|
|
1102
|
+
}
|
|
1103
|
+
comparePre(e) {
|
|
1104
|
+
if (e instanceof ie || (e = new ie(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 (Oe("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 be(n, s);
|
|
1122
|
+
} while (++r);
|
|
1123
|
+
}
|
|
1124
|
+
compareBuild(e) {
|
|
1125
|
+
e instanceof ie || (e = new ie(e, this.options));
|
|
1126
|
+
let r = 0;
|
|
1127
|
+
do {
|
|
1128
|
+
const n = this.build[r], s = e.build[r];
|
|
1129
|
+
if (Oe("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 be(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]), be(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 te = Gn;
|
|
1194
|
+
const Nt = te, Bn = (t, e, r = !1) => {
|
|
1195
|
+
if (t instanceof Nt)
|
|
1196
|
+
return t;
|
|
1197
|
+
try {
|
|
1198
|
+
return new Nt(t, e);
|
|
1199
|
+
} catch (n) {
|
|
1200
|
+
if (!r)
|
|
1201
|
+
return null;
|
|
1202
|
+
throw n;
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1205
|
+
var Ee = Bn;
|
|
1206
|
+
const Kn = Ee, qn = (t, e) => {
|
|
1207
|
+
const r = Kn(t, e);
|
|
1208
|
+
return r ? r.version : null;
|
|
1209
|
+
};
|
|
1210
|
+
var Hn = qn;
|
|
1211
|
+
const zn = Ee, Xn = (t, e) => {
|
|
1212
|
+
const r = zn(t.trim().replace(/^[=v]+/, ""), e);
|
|
1213
|
+
return r ? r.version : null;
|
|
1214
|
+
};
|
|
1215
|
+
var Yn = Xn;
|
|
1216
|
+
const Ct = te, Wn = (t, e, r, n, s) => {
|
|
1217
|
+
typeof r == "string" && (s = n, n = r, r = void 0);
|
|
1218
|
+
try {
|
|
1219
|
+
return new Ct(
|
|
1220
|
+
t instanceof Ct ? t.version : t,
|
|
1221
|
+
r
|
|
1222
|
+
).inc(e, n, s).version;
|
|
1223
|
+
} catch {
|
|
1224
|
+
return null;
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
var Jn = Wn;
|
|
1228
|
+
const xt = Ee, Zn = (t, e) => {
|
|
1229
|
+
const r = xt(t, null, !0), n = xt(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 b = d ? "pre" : "";
|
|
1236
|
+
return r.major !== n.major ? b + "major" : r.minor !== n.minor ? b + "minor" : r.patch !== n.patch ? b + "patch" : "prerelease";
|
|
1237
|
+
};
|
|
1238
|
+
var Qn = Zn;
|
|
1239
|
+
const es = te, ts = (t, e) => new es(t, e).major;
|
|
1240
|
+
var rs = ts;
|
|
1241
|
+
const ns = te, ss = (t, e) => new ns(t, e).minor;
|
|
1242
|
+
var as = ss;
|
|
1243
|
+
const os = te, is = (t, e) => new os(t, e).patch;
|
|
1244
|
+
var ls = is;
|
|
1245
|
+
const us = Ee, cs = (t, e) => {
|
|
1246
|
+
const r = us(t, e);
|
|
1247
|
+
return r && r.prerelease.length ? r.prerelease : null;
|
|
1248
|
+
};
|
|
1249
|
+
var ds = cs;
|
|
1250
|
+
const kt = te, fs = (t, e, r) => new kt(t, r).compare(new kt(e, r));
|
|
1251
|
+
var ae = fs;
|
|
1252
|
+
const ms = ae, ps = (t, e, r) => ms(e, t, r);
|
|
1253
|
+
var hs = ps;
|
|
1254
|
+
const vs = ae, bs = (t, e) => vs(t, e, !0);
|
|
1255
|
+
var gs = bs;
|
|
1256
|
+
const Vt = te, ys = (t, e, r) => {
|
|
1257
|
+
const n = new Vt(t, r), s = new Vt(e, r);
|
|
1258
|
+
return n.compare(s) || n.compareBuild(s);
|
|
1259
|
+
};
|
|
1260
|
+
var pt = ys;
|
|
1261
|
+
const $s = pt, _s = (t, e) => t.sort((r, n) => $s(r, n, e));
|
|
1262
|
+
var Es = _s;
|
|
1263
|
+
const ws = pt, Rs = (t, e) => t.sort((r, n) => ws(n, r, e));
|
|
1264
|
+
var Is = Rs;
|
|
1265
|
+
const As = ae, Os = (t, e, r) => As(t, e, r) > 0;
|
|
1266
|
+
var Ue = Os;
|
|
1267
|
+
const Ss = ae, Ps = (t, e, r) => Ss(t, e, r) < 0;
|
|
1268
|
+
var ht = Ps;
|
|
1269
|
+
const Ts = ae, Ls = (t, e, r) => Ts(t, e, r) === 0;
|
|
1270
|
+
var br = Ls;
|
|
1271
|
+
const Ns = ae, Cs = (t, e, r) => Ns(t, e, r) !== 0;
|
|
1272
|
+
var gr = Cs;
|
|
1273
|
+
const xs = ae, ks = (t, e, r) => xs(t, e, r) >= 0;
|
|
1274
|
+
var vt = ks;
|
|
1275
|
+
const Vs = ae, Fs = (t, e, r) => Vs(t, e, r) <= 0;
|
|
1276
|
+
var bt = Fs;
|
|
1277
|
+
const js = br, Ms = gr, Us = Ue, Ds = vt, Gs = ht, Bs = bt, Ks = (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 js(t, r, n);
|
|
1287
|
+
case "!=":
|
|
1288
|
+
return Ms(t, r, n);
|
|
1289
|
+
case ">":
|
|
1290
|
+
return Us(t, r, n);
|
|
1291
|
+
case ">=":
|
|
1292
|
+
return Ds(t, r, n);
|
|
1293
|
+
case "<":
|
|
1294
|
+
return Gs(t, r, n);
|
|
1295
|
+
case "<=":
|
|
1296
|
+
return Bs(t, r, n);
|
|
1297
|
+
default:
|
|
1298
|
+
throw new TypeError(`Invalid operator: ${e}`);
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
var yr = Ks;
|
|
1302
|
+
const qs = te, Hs = Ee, { safeRe: Pe, t: Te } = Ae, zs = (t, e) => {
|
|
1303
|
+
if (t instanceof qs)
|
|
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 ? Pe[Te.COERCEFULL] : Pe[Te.COERCE]);
|
|
1311
|
+
else {
|
|
1312
|
+
const d = e.includePrerelease ? Pe[Te.COERCERTLFULL] : Pe[Te.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 Hs(`${n}.${s}.${o}${i}${f}`, e);
|
|
1322
|
+
};
|
|
1323
|
+
var Xs = zs;
|
|
1324
|
+
class Ys {
|
|
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 Ws = Ys, We, Ft;
|
|
1348
|
+
function oe() {
|
|
1349
|
+
if (Ft)
|
|
1350
|
+
return We;
|
|
1351
|
+
Ft = 1;
|
|
1352
|
+
const t = /\s+/g;
|
|
1353
|
+
class e {
|
|
1354
|
+
constructor(p, w) {
|
|
1355
|
+
if (w = s(w), p instanceof e)
|
|
1356
|
+
return p.loose === !!w.loose && p.includePrerelease === !!w.includePrerelease ? p : new e(p.raw, w);
|
|
1357
|
+
if (p instanceof o)
|
|
1358
|
+
return this.raw = p.value, this.set = [[p]], this.formatted = void 0, this;
|
|
1359
|
+
if (this.options = w, this.loose = !!w.loose, this.includePrerelease = !!w.includePrerelease, this.raw = p.trim().replace(t, " "), this.set = this.raw.split("||").map((O) => this.parseRange(O.trim())).filter((O) => O.length), !this.set.length)
|
|
1360
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
1361
|
+
if (this.set.length > 1) {
|
|
1362
|
+
const O = this.set[0];
|
|
1363
|
+
if (this.set = this.set.filter((I) => !P(I[0])), this.set.length === 0)
|
|
1364
|
+
this.set = [O];
|
|
1365
|
+
else if (this.set.length > 1) {
|
|
1366
|
+
for (const I of this.set)
|
|
1367
|
+
if (I.length === 1 && $(I[0])) {
|
|
1368
|
+
this.set = [I];
|
|
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 w = this.set[p];
|
|
1381
|
+
for (let O = 0; O < w.length; O++)
|
|
1382
|
+
O > 0 && (this.formatted += " "), this.formatted += w[O].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 O = ((this.options.includePrerelease && c) | (this.options.loose && y)) + ":" + p, I = n.get(O);
|
|
1395
|
+
if (I)
|
|
1396
|
+
return I;
|
|
1397
|
+
const h = this.options.loose, N = h ? d[u.HYPHENRANGELOOSE] : d[u.HYPHENRANGE];
|
|
1398
|
+
p = p.replace(N, R(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(d[u.COMPARATORTRIM], b), i("comparator trim", p), p = p.replace(d[u.TILDETRIM], g), i("tilde trim", p), p = p.replace(d[u.CARETTRIM], L), i("caret trim", p);
|
|
1399
|
+
let M = p.split(" ").map((G) => x(G, this.options)).join(" ").split(/\s+/).map((G) => v(G, this.options));
|
|
1400
|
+
h && (M = M.filter((G) => (i("loose invalid filter", G, this.options), !!G.match(d[u.COMPARATORLOOSE])))), i("range list", M);
|
|
1401
|
+
const V = /* @__PURE__ */ new Map(), K = M.map((G) => new o(G, this.options));
|
|
1402
|
+
for (const G of K) {
|
|
1403
|
+
if (P(G))
|
|
1404
|
+
return [G];
|
|
1405
|
+
V.set(G.value, G);
|
|
1406
|
+
}
|
|
1407
|
+
V.size > 1 && V.has("") && V.delete("");
|
|
1408
|
+
const k = [...V.values()];
|
|
1409
|
+
return n.set(O, k), k;
|
|
1410
|
+
}
|
|
1411
|
+
intersects(p, w) {
|
|
1412
|
+
if (!(p instanceof e))
|
|
1413
|
+
throw new TypeError("a Range is required");
|
|
1414
|
+
return this.set.some((O) => C(O, w) && p.set.some((I) => C(I, w) && O.every((h) => I.every((N) => h.intersects(N, w)))));
|
|
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 w = 0; w < this.set.length; w++)
|
|
1427
|
+
if (S(this.set[w], p, this.options))
|
|
1428
|
+
return !0;
|
|
1429
|
+
return !1;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
We = e;
|
|
1433
|
+
const r = Ws, n = new r(), s = mt, o = De(), i = Me, f = te, {
|
|
1434
|
+
safeRe: d,
|
|
1435
|
+
t: u,
|
|
1436
|
+
comparatorTrimReplace: b,
|
|
1437
|
+
tildeTrimReplace: g,
|
|
1438
|
+
caretTrimReplace: L
|
|
1439
|
+
} = Ae, { FLAG_INCLUDE_PRERELEASE: c, FLAG_LOOSE: y } = je, P = (m) => m.value === "<0.0.0-0", $ = (m) => m.value === "", C = (m, p) => {
|
|
1440
|
+
let w = !0;
|
|
1441
|
+
const O = m.slice();
|
|
1442
|
+
let I = O.pop();
|
|
1443
|
+
for (; w && O.length; )
|
|
1444
|
+
w = O.every((h) => I.intersects(h, p)), I = O.pop();
|
|
1445
|
+
return w;
|
|
1446
|
+
}, x = (m, p) => (i("comp", m, p), m = J(m, p), i("caret", m), m = j(m, p), i("tildes", m), m = Y(m, p), i("xrange", m), m = l(m, p), i("stars", m), m), A = (m) => !m || m.toLowerCase() === "x" || m === "*", j = (m, p) => m.trim().split(/\s+/).map((w) => W(w, p)).join(" "), W = (m, p) => {
|
|
1447
|
+
const w = p.loose ? d[u.TILDELOOSE] : d[u.TILDE];
|
|
1448
|
+
return m.replace(w, (O, I, h, N, M) => {
|
|
1449
|
+
i("tilde", m, O, I, h, N, M);
|
|
1450
|
+
let V;
|
|
1451
|
+
return A(I) ? V = "" : A(h) ? V = `>=${I}.0.0 <${+I + 1}.0.0-0` : A(N) ? V = `>=${I}.${h}.0 <${I}.${+h + 1}.0-0` : M ? (i("replaceTilde pr", M), V = `>=${I}.${h}.${N}-${M} <${I}.${+h + 1}.0-0`) : V = `>=${I}.${h}.${N} <${I}.${+h + 1}.0-0`, i("tilde return", V), V;
|
|
1452
|
+
});
|
|
1453
|
+
}, J = (m, p) => m.trim().split(/\s+/).map((w) => U(w, p)).join(" "), U = (m, p) => {
|
|
1454
|
+
i("caret", m, p);
|
|
1455
|
+
const w = p.loose ? d[u.CARETLOOSE] : d[u.CARET], O = p.includePrerelease ? "-0" : "";
|
|
1456
|
+
return m.replace(w, (I, h, N, M, V) => {
|
|
1457
|
+
i("caret", m, I, h, N, M, V);
|
|
1458
|
+
let K;
|
|
1459
|
+
return A(h) ? K = "" : A(N) ? K = `>=${h}.0.0${O} <${+h + 1}.0.0-0` : A(M) ? h === "0" ? K = `>=${h}.${N}.0${O} <${h}.${+N + 1}.0-0` : K = `>=${h}.${N}.0${O} <${+h + 1}.0.0-0` : V ? (i("replaceCaret pr", V), h === "0" ? N === "0" ? K = `>=${h}.${N}.${M}-${V} <${h}.${N}.${+M + 1}-0` : K = `>=${h}.${N}.${M}-${V} <${h}.${+N + 1}.0-0` : K = `>=${h}.${N}.${M}-${V} <${+h + 1}.0.0-0`) : (i("no pr"), h === "0" ? N === "0" ? K = `>=${h}.${N}.${M}${O} <${h}.${N}.${+M + 1}-0` : K = `>=${h}.${N}.${M}${O} <${h}.${+N + 1}.0-0` : K = `>=${h}.${N}.${M} <${+h + 1}.0.0-0`), i("caret return", K), K;
|
|
1460
|
+
});
|
|
1461
|
+
}, Y = (m, p) => (i("replaceXRanges", m, p), m.split(/\s+/).map((w) => a(w, p)).join(" ")), a = (m, p) => {
|
|
1462
|
+
m = m.trim();
|
|
1463
|
+
const w = p.loose ? d[u.XRANGELOOSE] : d[u.XRANGE];
|
|
1464
|
+
return m.replace(w, (O, I, h, N, M, V) => {
|
|
1465
|
+
i("xRange", m, O, I, h, N, M, V);
|
|
1466
|
+
const K = A(h), k = K || A(N), G = k || A(M), H = G;
|
|
1467
|
+
return I === "=" && H && (I = ""), V = p.includePrerelease ? "-0" : "", K ? I === ">" || I === "<" ? O = "<0.0.0-0" : O = "*" : I && H ? (k && (N = 0), M = 0, I === ">" ? (I = ">=", k ? (h = +h + 1, N = 0, M = 0) : (N = +N + 1, M = 0)) : I === "<=" && (I = "<", k ? h = +h + 1 : N = +N + 1), I === "<" && (V = "-0"), O = `${I + h}.${N}.${M}${V}`) : k ? O = `>=${h}.0.0${V} <${+h + 1}.0.0-0` : G && (O = `>=${h}.${N}.0${V} <${h}.${+N + 1}.0-0`), i("xRange return", O), O;
|
|
1468
|
+
});
|
|
1469
|
+
}, l = (m, p) => (i("replaceStars", m, p), m.trim().replace(d[u.STAR], "")), v = (m, p) => (i("replaceGTE0", m, p), m.trim().replace(d[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), R = (m) => (p, w, O, I, h, N, M, V, K, k, G, H) => (A(O) ? w = "" : A(I) ? w = `>=${O}.0.0${m ? "-0" : ""}` : A(h) ? w = `>=${O}.${I}.0${m ? "-0" : ""}` : N ? w = `>=${w}` : w = `>=${w}${m ? "-0" : ""}`, A(K) ? V = "" : A(k) ? V = `<${+K + 1}.0.0-0` : A(G) ? V = `<${K}.${+k + 1}.0-0` : H ? V = `<=${K}.${k}.${G}-${H}` : m ? V = `<${K}.${k}.${+G + 1}-0` : V = `<=${V}`, `${w} ${V}`.trim()), S = (m, p, w) => {
|
|
1470
|
+
for (let O = 0; O < m.length; O++)
|
|
1471
|
+
if (!m[O].test(p))
|
|
1472
|
+
return !1;
|
|
1473
|
+
if (p.prerelease.length && !w.includePrerelease) {
|
|
1474
|
+
for (let O = 0; O < m.length; O++)
|
|
1475
|
+
if (i(m[O].semver), m[O].semver !== o.ANY && m[O].semver.prerelease.length > 0) {
|
|
1476
|
+
const I = m[O].semver;
|
|
1477
|
+
if (I.major === p.major && I.minor === p.minor && I.patch === p.patch)
|
|
1478
|
+
return !0;
|
|
1479
|
+
}
|
|
1480
|
+
return !1;
|
|
1481
|
+
}
|
|
1482
|
+
return !0;
|
|
1483
|
+
};
|
|
1484
|
+
return We;
|
|
1485
|
+
}
|
|
1486
|
+
var Je, jt;
|
|
1487
|
+
function De() {
|
|
1488
|
+
if (jt)
|
|
1489
|
+
return Je;
|
|
1490
|
+
jt = 1;
|
|
1491
|
+
const t = Symbol("SemVer ANY");
|
|
1492
|
+
class e {
|
|
1493
|
+
static get ANY() {
|
|
1494
|
+
return t;
|
|
1495
|
+
}
|
|
1496
|
+
constructor(b, g) {
|
|
1497
|
+
if (g = r(g), b instanceof e) {
|
|
1498
|
+
if (b.loose === !!g.loose)
|
|
1499
|
+
return b;
|
|
1500
|
+
b = b.value;
|
|
1501
|
+
}
|
|
1502
|
+
b = b.trim().split(/\s+/).join(" "), i("comparator", b, g), this.options = g, this.loose = !!g.loose, this.parse(b), this.semver === t ? this.value = "" : this.value = this.operator + this.semver.version, i("comp", this);
|
|
1503
|
+
}
|
|
1504
|
+
parse(b) {
|
|
1505
|
+
const g = this.options.loose ? n[s.COMPARATORLOOSE] : n[s.COMPARATOR], L = b.match(g);
|
|
1506
|
+
if (!L)
|
|
1507
|
+
throw new TypeError(`Invalid comparator: ${b}`);
|
|
1508
|
+
this.operator = L[1] !== void 0 ? L[1] : "", this.operator === "=" && (this.operator = ""), L[2] ? this.semver = new f(L[2], this.options.loose) : this.semver = t;
|
|
1509
|
+
}
|
|
1510
|
+
toString() {
|
|
1511
|
+
return this.value;
|
|
1512
|
+
}
|
|
1513
|
+
test(b) {
|
|
1514
|
+
if (i("Comparator.test", b, this.options.loose), this.semver === t || b === t)
|
|
1515
|
+
return !0;
|
|
1516
|
+
if (typeof b == "string")
|
|
1517
|
+
try {
|
|
1518
|
+
b = new f(b, this.options);
|
|
1519
|
+
} catch {
|
|
1520
|
+
return !1;
|
|
1521
|
+
}
|
|
1522
|
+
return o(b, this.operator, this.semver, this.options);
|
|
1523
|
+
}
|
|
1524
|
+
intersects(b, g) {
|
|
1525
|
+
if (!(b instanceof e))
|
|
1526
|
+
throw new TypeError("a Comparator is required");
|
|
1527
|
+
return this.operator === "" ? this.value === "" ? !0 : new d(b.value, g).test(this.value) : b.operator === "" ? b.value === "" ? !0 : new d(this.value, g).test(b.semver) : (g = r(g), g.includePrerelease && (this.value === "<0.0.0-0" || b.value === "<0.0.0-0") || !g.includePrerelease && (this.value.startsWith("<0.0.0") || b.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && b.operator.startsWith(">") || this.operator.startsWith("<") && b.operator.startsWith("<") || this.semver.version === b.semver.version && this.operator.includes("=") && b.operator.includes("=") || o(this.semver, "<", b.semver, g) && this.operator.startsWith(">") && b.operator.startsWith("<") || o(this.semver, ">", b.semver, g) && this.operator.startsWith("<") && b.operator.startsWith(">")));
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
Je = e;
|
|
1531
|
+
const r = mt, { safeRe: n, t: s } = Ae, o = yr, i = Me, f = te, d = oe();
|
|
1532
|
+
return Je;
|
|
1533
|
+
}
|
|
1534
|
+
const Js = oe(), Zs = (t, e, r) => {
|
|
1535
|
+
try {
|
|
1536
|
+
e = new Js(e, r);
|
|
1537
|
+
} catch {
|
|
1538
|
+
return !1;
|
|
1539
|
+
}
|
|
1540
|
+
return e.test(t);
|
|
1541
|
+
};
|
|
1542
|
+
var Ge = Zs;
|
|
1543
|
+
const Qs = oe(), ea = (t, e) => new Qs(t, e).set.map((r) => r.map((n) => n.value).join(" ").trim().split(" "));
|
|
1544
|
+
var ta = ea;
|
|
1545
|
+
const ra = te, na = oe(), sa = (t, e, r) => {
|
|
1546
|
+
let n = null, s = null, o = null;
|
|
1547
|
+
try {
|
|
1548
|
+
o = new na(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 ra(n, r));
|
|
1554
|
+
}), n;
|
|
1555
|
+
};
|
|
1556
|
+
var aa = sa;
|
|
1557
|
+
const oa = te, ia = oe(), la = (t, e, r) => {
|
|
1558
|
+
let n = null, s = null, o = null;
|
|
1559
|
+
try {
|
|
1560
|
+
o = new ia(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 oa(n, r));
|
|
1566
|
+
}), n;
|
|
1567
|
+
};
|
|
1568
|
+
var ua = la;
|
|
1569
|
+
const Ze = te, ca = oe(), Mt = Ue, da = (t, e) => {
|
|
1570
|
+
t = new ca(t, e);
|
|
1571
|
+
let r = new Ze("0.0.0");
|
|
1572
|
+
if (t.test(r) || (r = new Ze("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 Ze(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 || Mt(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 || Mt(r, o)) && (r = o);
|
|
1594
|
+
}
|
|
1595
|
+
return r && t.test(r) ? r : null;
|
|
1596
|
+
};
|
|
1597
|
+
var fa = da;
|
|
1598
|
+
const ma = oe(), pa = (t, e) => {
|
|
1599
|
+
try {
|
|
1600
|
+
return new ma(t, e).range || "*";
|
|
1601
|
+
} catch {
|
|
1602
|
+
return null;
|
|
1603
|
+
}
|
|
1604
|
+
};
|
|
1605
|
+
var ha = pa;
|
|
1606
|
+
const va = te, $r = De(), { ANY: ba } = $r, ga = oe(), ya = Ge, Ut = Ue, Dt = ht, $a = bt, _a = vt, Ea = (t, e, r, n) => {
|
|
1607
|
+
t = new va(t, n), e = new ga(e, n);
|
|
1608
|
+
let s, o, i, f, d;
|
|
1609
|
+
switch (r) {
|
|
1610
|
+
case ">":
|
|
1611
|
+
s = Ut, o = $a, i = Dt, f = ">", d = ">=";
|
|
1612
|
+
break;
|
|
1613
|
+
case "<":
|
|
1614
|
+
s = Dt, o = _a, i = Ut, f = "<", d = "<=";
|
|
1615
|
+
break;
|
|
1616
|
+
default:
|
|
1617
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1618
|
+
}
|
|
1619
|
+
if (ya(t, e, n))
|
|
1620
|
+
return !1;
|
|
1621
|
+
for (let u = 0; u < e.set.length; ++u) {
|
|
1622
|
+
const b = e.set[u];
|
|
1623
|
+
let g = null, L = null;
|
|
1624
|
+
if (b.forEach((c) => {
|
|
1625
|
+
c.semver === ba && (c = new $r(">=0.0.0")), g = g || c, L = L || c, s(c.semver, g.semver, n) ? g = c : i(c.semver, L.semver, n) && (L = c);
|
|
1626
|
+
}), g.operator === f || g.operator === d || (!L.operator || L.operator === f) && o(t, L.semver))
|
|
1627
|
+
return !1;
|
|
1628
|
+
if (L.operator === d && i(t, L.semver))
|
|
1629
|
+
return !1;
|
|
1630
|
+
}
|
|
1631
|
+
return !0;
|
|
1632
|
+
};
|
|
1633
|
+
var gt = Ea;
|
|
1634
|
+
const wa = gt, Ra = (t, e, r) => wa(t, e, ">", r);
|
|
1635
|
+
var Ia = Ra;
|
|
1636
|
+
const Aa = gt, Oa = (t, e, r) => Aa(t, e, "<", r);
|
|
1637
|
+
var Sa = Oa;
|
|
1638
|
+
const Gt = oe(), Pa = (t, e, r) => (t = new Gt(t, r), e = new Gt(e, r), t.intersects(e, r));
|
|
1639
|
+
var Ta = Pa;
|
|
1640
|
+
const La = Ge, Na = ae;
|
|
1641
|
+
var Ca = (t, e, r) => {
|
|
1642
|
+
const n = [];
|
|
1643
|
+
let s = null, o = null;
|
|
1644
|
+
const i = t.sort((b, g) => Na(b, g, r));
|
|
1645
|
+
for (const b of i)
|
|
1646
|
+
La(b, e, r) ? (o = b, s || (s = b)) : (o && n.push([s, o]), o = null, s = null);
|
|
1647
|
+
s && n.push([s, null]);
|
|
1648
|
+
const f = [];
|
|
1649
|
+
for (const [b, g] of n)
|
|
1650
|
+
b === g ? f.push(b) : !g && b === i[0] ? f.push("*") : g ? b === i[0] ? f.push(`<=${g}`) : f.push(`${b} - ${g}`) : f.push(`>=${b}`);
|
|
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 Bt = oe(), yt = De(), { ANY: Qe } = yt, Re = Ge, $t = ae, xa = (t, e, r = {}) => {
|
|
1655
|
+
if (t === e)
|
|
1656
|
+
return !0;
|
|
1657
|
+
t = new Bt(t, r), e = new Bt(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 = Va(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
|
+
}, ka = [new yt(">=0.0.0-0")], Kt = [new yt(">=0.0.0")], Va = (t, e, r) => {
|
|
1671
|
+
if (t === e)
|
|
1672
|
+
return !0;
|
|
1673
|
+
if (t.length === 1 && t[0].semver === Qe) {
|
|
1674
|
+
if (e.length === 1 && e[0].semver === Qe)
|
|
1675
|
+
return !0;
|
|
1676
|
+
r.includePrerelease ? t = ka : t = Kt;
|
|
1677
|
+
}
|
|
1678
|
+
if (e.length === 1 && e[0].semver === Qe) {
|
|
1679
|
+
if (r.includePrerelease)
|
|
1680
|
+
return !0;
|
|
1681
|
+
e = Kt;
|
|
1682
|
+
}
|
|
1683
|
+
const n = /* @__PURE__ */ new Set();
|
|
1684
|
+
let s, o;
|
|
1685
|
+
for (const c of t)
|
|
1686
|
+
c.operator === ">" || c.operator === ">=" ? s = qt(s, c, r) : c.operator === "<" || c.operator === "<=" ? o = Ht(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 = $t(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 && !Re(c, String(s), r) || o && !Re(c, String(o), r))
|
|
1698
|
+
return null;
|
|
1699
|
+
for (const y of e)
|
|
1700
|
+
if (!Re(c, String(y), r))
|
|
1701
|
+
return !1;
|
|
1702
|
+
return !0;
|
|
1703
|
+
}
|
|
1704
|
+
let f, d, u, b, g = o && !r.includePrerelease && o.semver.prerelease.length ? o.semver : !1, L = 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 (b = b || c.operator === ">" || c.operator === ">=", u = u || c.operator === "<" || c.operator === "<=", s) {
|
|
1708
|
+
if (L && c.semver.prerelease && c.semver.prerelease.length && c.semver.major === L.major && c.semver.minor === L.minor && c.semver.patch === L.patch && (L = !1), c.operator === ">" || c.operator === ">=") {
|
|
1709
|
+
if (f = qt(s, c, r), f === c && f !== s)
|
|
1710
|
+
return !1;
|
|
1711
|
+
} else if (s.operator === ">=" && !Re(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 = Ht(o, c, r), d === c && d !== o)
|
|
1717
|
+
return !1;
|
|
1718
|
+
} else if (o.operator === "<=" && !Re(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 && b && !s && i !== 0 || L || g);
|
|
1725
|
+
}, qt = (t, e, r) => {
|
|
1726
|
+
if (!t)
|
|
1727
|
+
return e;
|
|
1728
|
+
const n = $t(t.semver, e.semver, r);
|
|
1729
|
+
return n > 0 ? t : n < 0 || e.operator === ">" && t.operator === ">=" ? e : t;
|
|
1730
|
+
}, Ht = (t, e, r) => {
|
|
1731
|
+
if (!t)
|
|
1732
|
+
return e;
|
|
1733
|
+
const n = $t(t.semver, e.semver, r);
|
|
1734
|
+
return n < 0 ? t : n > 0 || e.operator === "<" && t.operator === "<=" ? e : t;
|
|
1735
|
+
};
|
|
1736
|
+
var Fa = xa;
|
|
1737
|
+
const et = Ae, zt = je, ja = te, Xt = vr, Ma = Ee, Ua = Hn, Da = Yn, Ga = Jn, Ba = Qn, Ka = rs, qa = as, Ha = ls, za = ds, Xa = ae, Ya = hs, Wa = gs, Ja = pt, Za = Es, Qa = Is, eo = Ue, to = ht, ro = br, no = gr, so = vt, ao = bt, oo = yr, io = Xs, lo = De(), uo = oe(), co = Ge, fo = ta, mo = aa, po = ua, ho = fa, vo = ha, bo = gt, go = Ia, yo = Sa, $o = Ta, _o = Ca, Eo = Fa;
|
|
1738
|
+
var wo = {
|
|
1739
|
+
parse: Ma,
|
|
1740
|
+
valid: Ua,
|
|
1741
|
+
clean: Da,
|
|
1742
|
+
inc: Ga,
|
|
1743
|
+
diff: Ba,
|
|
1744
|
+
major: Ka,
|
|
1745
|
+
minor: qa,
|
|
1746
|
+
patch: Ha,
|
|
1747
|
+
prerelease: za,
|
|
1748
|
+
compare: Xa,
|
|
1749
|
+
rcompare: Ya,
|
|
1750
|
+
compareLoose: Wa,
|
|
1751
|
+
compareBuild: Ja,
|
|
1752
|
+
sort: Za,
|
|
1753
|
+
rsort: Qa,
|
|
1754
|
+
gt: eo,
|
|
1755
|
+
lt: to,
|
|
1756
|
+
eq: ro,
|
|
1757
|
+
neq: no,
|
|
1758
|
+
gte: so,
|
|
1759
|
+
lte: ao,
|
|
1760
|
+
cmp: oo,
|
|
1761
|
+
coerce: io,
|
|
1762
|
+
Comparator: lo,
|
|
1763
|
+
Range: uo,
|
|
1764
|
+
satisfies: co,
|
|
1765
|
+
toComparators: fo,
|
|
1766
|
+
maxSatisfying: mo,
|
|
1767
|
+
minSatisfying: po,
|
|
1768
|
+
minVersion: ho,
|
|
1769
|
+
validRange: vo,
|
|
1770
|
+
outside: bo,
|
|
1771
|
+
gtr: go,
|
|
1772
|
+
ltr: yo,
|
|
1773
|
+
intersects: $o,
|
|
1774
|
+
simplifyRange: _o,
|
|
1775
|
+
subset: Eo,
|
|
1776
|
+
SemVer: ja,
|
|
1777
|
+
re: et.re,
|
|
1778
|
+
src: et.src,
|
|
1779
|
+
tokens: et.t,
|
|
1780
|
+
SEMVER_SPEC_VERSION: zt.SEMVER_SPEC_VERSION,
|
|
1781
|
+
RELEASE_TYPES: zt.RELEASE_TYPES,
|
|
1782
|
+
compareIdentifiers: Xt.compareIdentifiers,
|
|
1783
|
+
rcompareIdentifiers: Xt.rcompareIdentifiers
|
|
1784
|
+
};
|
|
1785
|
+
const Yt = /* @__PURE__ */ ur(wo);
|
|
1786
|
+
var st = /* @__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))(st || {});
|
|
1787
|
+
const _r = {
|
|
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 Ro(t, e) {
|
|
1804
|
+
return Yt.valid(e) && Yt.gte(e, _r[t]);
|
|
1805
|
+
}
|
|
1806
|
+
function Io(t) {
|
|
1807
|
+
return _r[t].replace("-alpha", "");
|
|
1808
|
+
}
|
|
1809
|
+
function Wt(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 Jt() {
|
|
1827
|
+
return Ie({
|
|
1828
|
+
line1: "",
|
|
1829
|
+
line2: "",
|
|
1830
|
+
city: "",
|
|
1831
|
+
postcode: "",
|
|
1832
|
+
state: "",
|
|
1833
|
+
country: "",
|
|
1834
|
+
coordinates: []
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1837
|
+
function Ie(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 Ao({ posVersion: t, payoutAccount: e }) {
|
|
1858
|
+
return !!t && Ro(st.qrEPayment, t) ? !e || !e.enable ? "Payout account is required" : e.status !== dt.F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED ? "Payout account under review" : !0 : `For POS ${Io(st.qrEPayment)} or above`;
|
|
1859
|
+
}
|
|
1860
|
+
function Er(t) {
|
|
1861
|
+
return {
|
|
1862
|
+
id: t._id,
|
|
1863
|
+
...t,
|
|
1864
|
+
profile: {
|
|
1865
|
+
...t.profile,
|
|
1866
|
+
address: Ie(t.profile.address)
|
|
1867
|
+
},
|
|
1868
|
+
allowEPayment: Ao(t)
|
|
1869
|
+
};
|
|
1870
|
+
}
|
|
1871
|
+
function tt(t) {
|
|
1872
|
+
return Er(ft(t));
|
|
1873
|
+
}
|
|
1874
|
+
async function Zt(t) {
|
|
1875
|
+
const e = ft(t), r = [];
|
|
1876
|
+
for (const n of e)
|
|
1877
|
+
r.push(await Er(n));
|
|
1878
|
+
return r;
|
|
1879
|
+
}
|
|
1880
|
+
const Ve = {
|
|
1881
|
+
async readRestaurant(t) {
|
|
1882
|
+
return await tt(await qe().get(`/restaurants/${t}`));
|
|
1883
|
+
},
|
|
1884
|
+
async readRestaurants() {
|
|
1885
|
+
return await Zt(await He().get("/restaurants"));
|
|
1886
|
+
},
|
|
1887
|
+
async readRestaurantsByBusiness() {
|
|
1888
|
+
return await Zt(await He().get("/restaurant-list"));
|
|
1889
|
+
},
|
|
1890
|
+
async createRestaurant(t) {
|
|
1891
|
+
return await tt(await He().post("/restaurants", t));
|
|
1892
|
+
},
|
|
1893
|
+
async updateRestaurantProfile(t, e) {
|
|
1894
|
+
return await tt(
|
|
1895
|
+
await qe().put(`/restaurants/${t}/profile`, e)
|
|
1896
|
+
);
|
|
1897
|
+
},
|
|
1898
|
+
async updateRestaurantAttributes(t, e) {
|
|
1899
|
+
return ft(await qe().put(`/restaurants/${t}/attributes`, {
|
|
1900
|
+
attributes: e
|
|
1901
|
+
}));
|
|
1902
|
+
}
|
|
1903
|
+
}, Oo = /* @__PURE__ */ ee({
|
|
1904
|
+
__name: "GoogleMap",
|
|
1905
|
+
props: {
|
|
1906
|
+
markers: {
|
|
1907
|
+
type: Array,
|
|
1908
|
+
default: () => []
|
|
1909
|
+
},
|
|
1910
|
+
polygons: {
|
|
1911
|
+
type: Array,
|
|
1912
|
+
default: () => []
|
|
1913
|
+
},
|
|
1914
|
+
zoom: {
|
|
1915
|
+
type: Number,
|
|
1916
|
+
default: 14
|
|
1917
|
+
},
|
|
1918
|
+
editable: {
|
|
1919
|
+
type: Boolean,
|
|
1920
|
+
default: !1
|
|
1921
|
+
},
|
|
1922
|
+
center: {
|
|
1923
|
+
type: Object,
|
|
1924
|
+
default: ke.jb
|
|
1925
|
+
}
|
|
1926
|
+
},
|
|
1927
|
+
emits: ["map-click", "marker-change", "polygon-change", "polygon-right-click"],
|
|
1928
|
+
setup(t, { expose: e, emit: r }) {
|
|
1929
|
+
const n = t, s = r;
|
|
1930
|
+
e({
|
|
1931
|
+
setCenter: (a) => {
|
|
1932
|
+
var l;
|
|
1933
|
+
(l = i.value) == null || l.setCenter(a);
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
const o = ne(), i = ne(null), f = [];
|
|
1937
|
+
function d(a) {
|
|
1938
|
+
return {
|
|
1939
|
+
lat: a.latLng.lat(),
|
|
1940
|
+
lng: a.latLng.lng()
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
function u(a, l, v) {
|
|
1944
|
+
const R = ge().maps.event.addListener(a, l, v);
|
|
1945
|
+
f.push(R);
|
|
1946
|
+
}
|
|
1947
|
+
const b = ne([]);
|
|
1948
|
+
function g(a, l, v) {
|
|
1949
|
+
u(a, l, v);
|
|
1950
|
+
}
|
|
1951
|
+
function L(a) {
|
|
1952
|
+
c(null), b.value = a.map((l, v) => {
|
|
1953
|
+
const R = ge(), S = new R.maps.Marker({
|
|
1954
|
+
position: l,
|
|
1955
|
+
draggable: !0
|
|
1956
|
+
});
|
|
1957
|
+
return g(S, "dragend", (m) => {
|
|
1958
|
+
s("marker-change", { index: v, position: d(m) });
|
|
1959
|
+
}), S;
|
|
1960
|
+
}), c(i.value);
|
|
1961
|
+
}
|
|
1962
|
+
function c(a) {
|
|
1963
|
+
b.value.map((l) => wt(l).setMap(a));
|
|
1964
|
+
}
|
|
1965
|
+
const y = ne([]);
|
|
1966
|
+
function P(a, l, v) {
|
|
1967
|
+
u(a, l, v);
|
|
1968
|
+
}
|
|
1969
|
+
function $(a, l, v) {
|
|
1970
|
+
u(a, l, v);
|
|
1971
|
+
}
|
|
1972
|
+
function C(a) {
|
|
1973
|
+
return y.value[a].getPath().getArray().map(({ lat: v, lng: R }) => ({
|
|
1974
|
+
lat: v(),
|
|
1975
|
+
lng: R()
|
|
1976
|
+
}));
|
|
1977
|
+
}
|
|
1978
|
+
function x(a) {
|
|
1979
|
+
const l = C(a);
|
|
1980
|
+
s("polygon-change", { index: a, path: l });
|
|
1981
|
+
}
|
|
1982
|
+
function A(a, l) {
|
|
1983
|
+
const R = C(a).filter((S, m) => m !== l);
|
|
1984
|
+
s("polygon-change", { index: a, path: R });
|
|
1985
|
+
}
|
|
1986
|
+
function j(a, l) {
|
|
1987
|
+
l.vertex !== void 0 ? A(a, l.vertex) : s("polygon-right-click", a);
|
|
1988
|
+
}
|
|
1989
|
+
function W(a) {
|
|
1990
|
+
J(null), y.value = a.map((l, v) => {
|
|
1991
|
+
const R = ge(), S = new R.maps.Polygon({
|
|
1992
|
+
paths: l.paths,
|
|
1993
|
+
strokeColor: l.strokeColor,
|
|
1994
|
+
fillColor: l.fillColor,
|
|
1995
|
+
fillOpacity: 0.5,
|
|
1996
|
+
editable: n.editable
|
|
1997
|
+
});
|
|
1998
|
+
return P(S, "contextmenu", (m) => j(v, m)), S.getPaths().forEach((m) => {
|
|
1999
|
+
$(m, "insert_at", () => x(v)), $(m, "set_at", () => x(v));
|
|
2000
|
+
}), S;
|
|
2001
|
+
}), J(i.value);
|
|
2002
|
+
}
|
|
2003
|
+
function J(a) {
|
|
2004
|
+
y.value.map((l) => wt(l).setMap(a));
|
|
2005
|
+
}
|
|
2006
|
+
function U(a, l, v) {
|
|
2007
|
+
u(a, l, v);
|
|
2008
|
+
}
|
|
2009
|
+
function Y() {
|
|
2010
|
+
const a = ge().maps.Map;
|
|
2011
|
+
i.value = new a(o.value, {
|
|
2012
|
+
center: n.center,
|
|
2013
|
+
zoom: n.zoom,
|
|
2014
|
+
mapTypeControl: !1,
|
|
2015
|
+
streetViewControl: !1,
|
|
2016
|
+
draggable: !0,
|
|
2017
|
+
scrollwheel: !0
|
|
2018
|
+
}), U(i.value, "click", (l) => s("map-click", d(l)));
|
|
2019
|
+
}
|
|
2020
|
+
return Et(() => n.markers, L, { deep: !0 }), Et(() => n.polygons, W, { deep: !0 }), Nr(() => {
|
|
2021
|
+
!o.value || !ge() || (Y(), L(n.markers), W(n.polygons));
|
|
2022
|
+
}), Cr(() => {
|
|
2023
|
+
f.forEach((a) => a.remove());
|
|
2024
|
+
}), (a, l) => (F(), B("div", {
|
|
2025
|
+
ref_key: "mapRef",
|
|
2026
|
+
ref: o,
|
|
2027
|
+
class: "map app-map"
|
|
2028
|
+
}, null, 512));
|
|
2029
|
+
}
|
|
2030
|
+
}), So = { class: "space-y-24" }, Po = { class: "flex flex-row gap-8" }, To = { class: "flex gap-8" }, Lo = { class: "flex gap-8" }, No = /* @__PURE__ */ ee({
|
|
2031
|
+
__name: "CoordinateDialog",
|
|
2032
|
+
props: {
|
|
2033
|
+
address: {
|
|
2034
|
+
type: String,
|
|
2035
|
+
required: !0
|
|
2036
|
+
},
|
|
2037
|
+
coordinate: {
|
|
2038
|
+
type: Object,
|
|
2039
|
+
default: void 0
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
setup(t) {
|
|
2043
|
+
const { t: e } = pe(), r = t, { emitData: n } = Mr(), s = lt(
|
|
2044
|
+
$e(r.coordinate ? r.coordinate : ke.jb)
|
|
2045
|
+
);
|
|
2046
|
+
function o({ position: i }) {
|
|
2047
|
+
s.lat = i.lat, s.lng = i.lng, n(s);
|
|
2048
|
+
}
|
|
2049
|
+
return n(s), (i, f) => (F(), B("div", So, [
|
|
2050
|
+
_("div", null, [
|
|
2051
|
+
_("div", Po, [
|
|
2052
|
+
_("div", null, D(E(e)("settings.coordinate_dialog.address")) + ":", 1),
|
|
2053
|
+
_("div", null, D(t.address || "--"), 1)
|
|
2054
|
+
]),
|
|
2055
|
+
_("div", To, [
|
|
2056
|
+
_("div", null, D(E(e)("settings.coordinate_dialog.latitude")) + ":", 1),
|
|
2057
|
+
_("div", null, D(s.lat), 1)
|
|
2058
|
+
]),
|
|
2059
|
+
_("div", Lo, [
|
|
2060
|
+
_("div", null, D(E(e)("settings.coordinate_dialog.longitude")) + ":", 1),
|
|
2061
|
+
_("div", null, D(s.lng), 1)
|
|
2062
|
+
])
|
|
2063
|
+
]),
|
|
2064
|
+
T(Oo, {
|
|
2065
|
+
class: "w-full",
|
|
2066
|
+
style: { height: "300px" },
|
|
2067
|
+
editable: "",
|
|
2068
|
+
center: s,
|
|
2069
|
+
markers: [s],
|
|
2070
|
+
onMarkerChange: o,
|
|
2071
|
+
onMapClick: f[0] || (f[0] = (d) => o({ position: d }))
|
|
2072
|
+
}, null, 8, ["center", "markers"])
|
|
2073
|
+
]));
|
|
2074
|
+
}
|
|
2075
|
+
}), Co = /* @__PURE__ */ ee({
|
|
2076
|
+
__name: "CoordinateInput",
|
|
2077
|
+
props: {
|
|
2078
|
+
modelValue: {
|
|
2079
|
+
type: Array,
|
|
2080
|
+
default: void 0
|
|
2081
|
+
},
|
|
2082
|
+
address: {
|
|
2083
|
+
type: Object,
|
|
2084
|
+
required: !0
|
|
2085
|
+
},
|
|
2086
|
+
required: {
|
|
2087
|
+
type: Boolean,
|
|
2088
|
+
default: !1
|
|
2089
|
+
}
|
|
2090
|
+
},
|
|
2091
|
+
emits: ["update:model-value"],
|
|
2092
|
+
setup(t, { emit: e }) {
|
|
2093
|
+
const { t: r } = pe(), n = t, s = e, o = or(), i = X(() => {
|
|
2094
|
+
const g = n.modelValue || [];
|
|
2095
|
+
return g.length < 2 ? null : Wr(g);
|
|
2096
|
+
}), f = X(() => i.value ? `${i.value.lat}, ${i.value.lng}` : "");
|
|
2097
|
+
async function d() {
|
|
2098
|
+
const g = ge().maps.Geocoder, L = new g();
|
|
2099
|
+
let c = i.value;
|
|
2100
|
+
c || await new Promise((y) => {
|
|
2101
|
+
n.address.formatted ? L.geocode({ address: n.address.formatted }, (P) => {
|
|
2102
|
+
var C;
|
|
2103
|
+
const $ = (C = P == null ? void 0 : P[0]) == null ? void 0 : C.geometry;
|
|
2104
|
+
c = $ ? { lng: $.location.lng(), lat: $.location.lat() } : ke.jb, y(!0);
|
|
2105
|
+
}) : (c = ke.jb, y(!0));
|
|
2106
|
+
}), o.open({
|
|
2107
|
+
contentComponent: No,
|
|
2108
|
+
contentComponentProps: {
|
|
2109
|
+
address: n.address.formatted,
|
|
2110
|
+
coordinate: c
|
|
2111
|
+
},
|
|
2112
|
+
title: r("settings.coordinate_input.dialog.title"),
|
|
2113
|
+
primaryActions: {
|
|
2114
|
+
text: r("settings.coordinate_input.dialog.confirm"),
|
|
2115
|
+
variant: "primary",
|
|
2116
|
+
close: !0
|
|
2117
|
+
},
|
|
2118
|
+
secondaryActions: {
|
|
2119
|
+
text: r("settings.coordinate_input.dialog.delete"),
|
|
2120
|
+
variant: "destructive",
|
|
2121
|
+
close: !0
|
|
2122
|
+
}
|
|
2123
|
+
}).onPrimary(async (y) => {
|
|
2124
|
+
const P = y ? Jr(y) : [];
|
|
2125
|
+
b(), s("update:model-value", P);
|
|
2126
|
+
}).onSecondary(() => {
|
|
2127
|
+
b(), s("update:model-value", []);
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
const u = ne(!1);
|
|
2131
|
+
function b() {
|
|
2132
|
+
u.value = !1;
|
|
2133
|
+
}
|
|
2134
|
+
return (g, L) => {
|
|
2135
|
+
const c = z("FmIcon"), y = z("FmField"), P = z("FmFormGroup");
|
|
2136
|
+
return F(), Q(P, {
|
|
2137
|
+
modelValue: i.value,
|
|
2138
|
+
"onUpdate:modelValue": L[0] || (L[0] = ($) => i.value = $),
|
|
2139
|
+
label: E(r)("settings.coordinate_input.title")
|
|
2140
|
+
}, {
|
|
2141
|
+
default: q(() => [
|
|
2142
|
+
T(y, {
|
|
2143
|
+
class: "cursor-pointer",
|
|
2144
|
+
onClick: d
|
|
2145
|
+
}, {
|
|
2146
|
+
prepend: q(() => [
|
|
2147
|
+
ue(g.$slots, "prepend")
|
|
2148
|
+
]),
|
|
2149
|
+
append: q(() => [
|
|
2150
|
+
T(c, {
|
|
2151
|
+
class: "text-fm-color-neutral-gray-400",
|
|
2152
|
+
name: "location_on",
|
|
2153
|
+
outline: "",
|
|
2154
|
+
size: "md"
|
|
2155
|
+
})
|
|
2156
|
+
]),
|
|
2157
|
+
default: q(() => [
|
|
2158
|
+
ue(g.$slots, "default", {}, () => [
|
|
2159
|
+
_("div", {
|
|
2160
|
+
class: Z([[i.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
|
|
2161
|
+
}, D(i.value ? f.value : E(r)("settings.coordinate_input.not_set")), 3)
|
|
2162
|
+
])
|
|
2163
|
+
]),
|
|
2164
|
+
_: 3
|
|
2165
|
+
})
|
|
2166
|
+
]),
|
|
2167
|
+
_: 3
|
|
2168
|
+
}, 8, ["modelValue", "label"]);
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
}), xo = { class: "w-[140px] pt-16" }, ko = { class: "pl-32" }, Vo = {
|
|
2172
|
+
key: 1,
|
|
2173
|
+
class: "flex gap-8 items-center my-8"
|
|
2174
|
+
}, Fo = /* @__PURE__ */ ee({
|
|
2175
|
+
__name: "OperationHoursInput",
|
|
2176
|
+
props: {
|
|
2177
|
+
modelValue: {
|
|
2178
|
+
type: Object,
|
|
2179
|
+
default: void 0
|
|
2180
|
+
},
|
|
2181
|
+
title: {
|
|
2182
|
+
type: String,
|
|
2183
|
+
required: !1
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
emits: ["update:model-value"],
|
|
2187
|
+
setup(t, { emit: e }) {
|
|
2188
|
+
const r = t, n = e, s = ut(), { t: o } = pe();
|
|
2189
|
+
ct().startOf("week");
|
|
2190
|
+
const i = X(
|
|
2191
|
+
() => [
|
|
2192
|
+
o("settings.operation_hours.mon"),
|
|
2193
|
+
o("settings.operation_hours.tue"),
|
|
2194
|
+
o("settings.operation_hours.wed"),
|
|
2195
|
+
o("settings.operation_hours.thu"),
|
|
2196
|
+
o("settings.operation_hours.fri"),
|
|
2197
|
+
o("settings.operation_hours.sat"),
|
|
2198
|
+
o("settings.operation_hours.sun")
|
|
2199
|
+
].map((C, x) => ({
|
|
2200
|
+
key: x.toString(),
|
|
2201
|
+
label: C,
|
|
2202
|
+
value: x < 6 ? x + 1 : 0,
|
|
2203
|
+
// key of OperatingHours, since data start from sunday, UI start from monday
|
|
2204
|
+
slot: `checkbox-${x}-end`
|
|
2205
|
+
}))
|
|
2206
|
+
), f = X(
|
|
2207
|
+
() => r.modelValue ? Object.values(r.modelValue) : Array.from(Array(7)).map(() => ({
|
|
2208
|
+
enable: !1,
|
|
2209
|
+
hours: []
|
|
2210
|
+
}))
|
|
2211
|
+
), d = X(() => Object.values(f.value).map((C) => C.hours)), u = X(() => f.value.reduce((C, x, A) => (x.hours.length > 0 && C.push(A), C), []));
|
|
2212
|
+
function b() {
|
|
2213
|
+
return { start: "00:00", end: "23:59" };
|
|
2214
|
+
}
|
|
2215
|
+
function g(C) {
|
|
2216
|
+
const x = u.value.find((j) => !C.includes(j));
|
|
2217
|
+
if (x !== void 0) {
|
|
2218
|
+
$((j) => (j[x].enable = !1, j[x].hours = [], j));
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
const A = C.find((j) => !u.value.includes(j));
|
|
2222
|
+
A !== void 0 && f.value[A].hours.length === 0 && $((j) => (j[A].enable = !0, j[A].hours = [b()], j));
|
|
2223
|
+
}
|
|
2224
|
+
function L(C) {
|
|
2225
|
+
$((x) => (x[C].hours.push(b()), x));
|
|
2226
|
+
}
|
|
2227
|
+
function c(C, x) {
|
|
2228
|
+
d.value[C].length > 1 ? $((A) => (A[C].hours.splice(x, 1), A)) : s.open({ title: o("settings.operation_hours.cannot_remove_last"), type: "error" });
|
|
2229
|
+
}
|
|
2230
|
+
function y(C, x, A) {
|
|
2231
|
+
A && $((j) => (j[C].hours[x].start = A, j));
|
|
2232
|
+
}
|
|
2233
|
+
function P(C, x, A) {
|
|
2234
|
+
A && $((j) => (j[C].hours[x].end = A, j));
|
|
2235
|
+
}
|
|
2236
|
+
function $(C) {
|
|
2237
|
+
const x = C($e(f.value)), A = {
|
|
2238
|
+
0: x[0],
|
|
2239
|
+
1: x[1],
|
|
2240
|
+
2: x[2],
|
|
2241
|
+
3: x[3],
|
|
2242
|
+
4: x[4],
|
|
2243
|
+
5: x[5],
|
|
2244
|
+
6: x[6]
|
|
2245
|
+
};
|
|
2246
|
+
n("update:model-value", A);
|
|
2247
|
+
}
|
|
2248
|
+
return (C, x) => {
|
|
2249
|
+
const A = z("FmCheckbox"), j = z("FmTimePicker"), W = z("FmButton"), J = z("FmField");
|
|
2250
|
+
return F(), B("div", null, [
|
|
2251
|
+
(F(!0), B(se, null, me(i.value, (U) => (F(), B("div", {
|
|
2252
|
+
key: U.value,
|
|
2253
|
+
class: "flex flex-col items-start"
|
|
2254
|
+
}, [
|
|
2255
|
+
_("div", xo, [
|
|
2256
|
+
T(A, {
|
|
2257
|
+
"model-value": u.value,
|
|
2258
|
+
label: U.label,
|
|
2259
|
+
value: U.value,
|
|
2260
|
+
"onUpdate:modelValue": g
|
|
2261
|
+
}, null, 8, ["model-value", "label", "value"])
|
|
2262
|
+
]),
|
|
2263
|
+
_("div", ko, [
|
|
2264
|
+
_("div", null, [
|
|
2265
|
+
u.value.includes(U.value) ? (F(!0), B(se, { key: 0 }, me(d.value[U.value], (Y, a) => (F(), B("div", {
|
|
2266
|
+
key: a,
|
|
2267
|
+
class: "flex items-center gap-8"
|
|
2268
|
+
}, [
|
|
2269
|
+
T(j, {
|
|
2270
|
+
"model-value": Y.start,
|
|
2271
|
+
"onUpdate:modelValue": (l) => y(U.value, a, l)
|
|
2272
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2273
|
+
_("span", {
|
|
2274
|
+
class: Z([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
|
|
2275
|
+
}, D(E(o)("settings.operation_hours.to")), 1),
|
|
2276
|
+
T(j, {
|
|
2277
|
+
"model-value": Y.end,
|
|
2278
|
+
"onUpdate:modelValue": (l) => P(U.value, a, l)
|
|
2279
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2280
|
+
T(W, {
|
|
2281
|
+
icon: "close",
|
|
2282
|
+
variant: "tertiary",
|
|
2283
|
+
onClick: (l) => c(U.value, a)
|
|
2284
|
+
}, null, 8, ["onClick"]),
|
|
2285
|
+
T(W, {
|
|
2286
|
+
class: Z(a === 0 ? "" : "invisible"),
|
|
2287
|
+
icon: "add",
|
|
2288
|
+
color: "primary",
|
|
2289
|
+
variant: "secondary",
|
|
2290
|
+
onClick: (l) => L(U.value)
|
|
2291
|
+
}, null, 8, ["class", "onClick"])
|
|
2292
|
+
]))), 128)) : (F(), B("div", Vo, [
|
|
2293
|
+
T(J, null, {
|
|
2294
|
+
default: q(() => [
|
|
2295
|
+
_("div", {
|
|
2296
|
+
class: Z([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
|
|
2297
|
+
}, D(E(o)("settings.operation_hours.close")), 1)
|
|
2298
|
+
]),
|
|
2299
|
+
_: 1
|
|
2300
|
+
}),
|
|
2301
|
+
_("span", {
|
|
2302
|
+
class: Z([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
|
|
2303
|
+
}, D(E(o)("settings.operation_hours.to")), 1),
|
|
2304
|
+
T(J, null, {
|
|
2305
|
+
default: q(() => [
|
|
2306
|
+
_("div", {
|
|
2307
|
+
class: Z([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
|
|
2308
|
+
}, D(E(o)("settings.operation_hours.close")), 1)
|
|
2309
|
+
]),
|
|
2310
|
+
_: 1
|
|
2311
|
+
})
|
|
2312
|
+
]))
|
|
2313
|
+
])
|
|
2314
|
+
])
|
|
2315
|
+
]))), 128))
|
|
2316
|
+
]);
|
|
2317
|
+
};
|
|
2318
|
+
}
|
|
2319
|
+
}), jo = { class: "space-y-24" }, Mo = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Uo = { class: "flex-1" }, Do = { class: "flex-1" }, Go = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Bo = { class: "flex-1" }, Ko = { class: "flex-1" }, qo = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Ho = { class: "flex-1" }, zo = { class: "flex-1" }, Xo = /* @__PURE__ */ ee({
|
|
2320
|
+
__name: "RestaurantAddress",
|
|
2321
|
+
props: {
|
|
2322
|
+
modelValue: {
|
|
2323
|
+
type: Object,
|
|
2324
|
+
required: !0
|
|
2325
|
+
}
|
|
2326
|
+
},
|
|
2327
|
+
emits: ["update:model-value"],
|
|
2328
|
+
setup(t, { emit: e }) {
|
|
2329
|
+
const { t: r } = pe();
|
|
2330
|
+
Jt();
|
|
2331
|
+
const n = t, s = e, o = X(() => $e(n.modelValue || Jt()));
|
|
2332
|
+
function i(d) {
|
|
2333
|
+
return (d || "").toString();
|
|
2334
|
+
}
|
|
2335
|
+
function f(d) {
|
|
2336
|
+
s("update:model-value", d(o.value));
|
|
2337
|
+
}
|
|
2338
|
+
return (d, u) => {
|
|
2339
|
+
const b = z("FmTextField");
|
|
2340
|
+
return F(), B("div", jo, [
|
|
2341
|
+
_("div", Mo, [
|
|
2342
|
+
_("div", Uo, [
|
|
2343
|
+
T(b, {
|
|
2344
|
+
"model-value": o.value.line1,
|
|
2345
|
+
label: E(r)("settings.address.line1"),
|
|
2346
|
+
"label-mark": "required",
|
|
2347
|
+
rules: [E(ce)],
|
|
2348
|
+
"onUpdate:modelValue": u[0] || (u[0] = (g) => f((L) => ({ ...L, line1: i(g) })))
|
|
2349
|
+
}, null, 8, ["model-value", "label", "rules"])
|
|
2350
|
+
]),
|
|
2351
|
+
_("div", Do, [
|
|
2352
|
+
T(b, {
|
|
2353
|
+
"model-value": o.value.line2,
|
|
2354
|
+
label: E(r)("settings.address.line2"),
|
|
2355
|
+
"onUpdate:modelValue": u[1] || (u[1] = (g) => f((L) => ({ ...L, line2: i(g) })))
|
|
2356
|
+
}, null, 8, ["model-value", "label"])
|
|
2357
|
+
])
|
|
2358
|
+
]),
|
|
2359
|
+
_("div", Go, [
|
|
2360
|
+
_("div", Bo, [
|
|
2361
|
+
T(b, {
|
|
2362
|
+
"model-value": o.value.city,
|
|
2363
|
+
rules: [E(ce)],
|
|
2364
|
+
label: E(r)("settings.address.city"),
|
|
2365
|
+
"label-mark": "required",
|
|
2366
|
+
"onUpdate:modelValue": u[2] || (u[2] = (g) => f((L) => ({ ...L, city: i(g) })))
|
|
2367
|
+
}, null, 8, ["model-value", "rules", "label"])
|
|
2368
|
+
]),
|
|
2369
|
+
_("div", Ko, [
|
|
2370
|
+
T(b, {
|
|
2371
|
+
"model-value": o.value.postcode,
|
|
2372
|
+
label: E(r)("settings.address.postal_code"),
|
|
2373
|
+
"label-mark": "required",
|
|
2374
|
+
rules: [E(ce)],
|
|
2375
|
+
"onUpdate:modelValue": u[3] || (u[3] = (g) => f((L) => ({ ...L, postcode: i(g) })))
|
|
2376
|
+
}, null, 8, ["model-value", "label", "rules"])
|
|
2377
|
+
])
|
|
2378
|
+
]),
|
|
2379
|
+
_("div", qo, [
|
|
2380
|
+
_("div", Ho, [
|
|
2381
|
+
T(b, {
|
|
2382
|
+
"model-value": o.value.state,
|
|
2383
|
+
label: E(r)("settings.address.state"),
|
|
2384
|
+
"label-mark": "required",
|
|
2385
|
+
rules: [E(ce)],
|
|
2386
|
+
"onUpdate:modelValue": u[4] || (u[4] = (g) => f((L) => ({ ...L, state: i(g) })))
|
|
2387
|
+
}, null, 8, ["model-value", "label", "rules"])
|
|
2388
|
+
]),
|
|
2389
|
+
_("div", zo, [
|
|
2390
|
+
T(b, {
|
|
2391
|
+
"model-value": o.value.country,
|
|
2392
|
+
label: E(r)("settings.address.country"),
|
|
2393
|
+
"label-mark": "required",
|
|
2394
|
+
rules: [E(ce)],
|
|
2395
|
+
"onUpdate:modelValue": u[5] || (u[5] = (g) => f((L) => ({ ...L, country: i(g) })))
|
|
2396
|
+
}, null, 8, ["model-value", "label", "rules"])
|
|
2397
|
+
])
|
|
2398
|
+
])
|
|
2399
|
+
]);
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2402
|
+
});
|
|
2403
|
+
function Qt(t) {
|
|
2404
|
+
return t.replace(/\s+/g, "").replace(/-/g, "");
|
|
2405
|
+
}
|
|
2406
|
+
class Yo {
|
|
2407
|
+
constructor(e, r) {
|
|
2408
|
+
Be(this, "restaurant");
|
|
2409
|
+
Be(this, "data");
|
|
2410
|
+
this.restaurant = e, this.data = r;
|
|
2411
|
+
}
|
|
2412
|
+
generateUrl(e) {
|
|
2413
|
+
const r = e === "normal" ? ct().toISOString() : "photo";
|
|
2414
|
+
return `restaurant/${this.restaurant.id}/${e}/${r}`;
|
|
2415
|
+
}
|
|
2416
|
+
async manageThumbnail() {
|
|
2417
|
+
const { newThumbnailPhoto: e, thumbnailPhoto: r } = this.data;
|
|
2418
|
+
if (e) {
|
|
2419
|
+
const s = await de.update(this.generateUrl("thumbnail"), e, {
|
|
2420
|
+
includedTime: !0
|
|
2421
|
+
});
|
|
2422
|
+
this.data.thumbnailPhoto = s;
|
|
2423
|
+
return;
|
|
2424
|
+
}
|
|
2425
|
+
const n = this.restaurant.profile.thumbnailPhoto;
|
|
2426
|
+
n && !r && (await de.delete(n), this.data.thumbnailPhoto = void 0);
|
|
2427
|
+
}
|
|
2428
|
+
async manageCover() {
|
|
2429
|
+
const { newCoverPhoto: e, coverPhoto: r } = this.data;
|
|
2430
|
+
if (e) {
|
|
2431
|
+
const s = await de.update(this.generateUrl("cover"), e, {
|
|
2432
|
+
includedTime: !0
|
|
2433
|
+
});
|
|
2434
|
+
this.data.coverPhoto = s;
|
|
2435
|
+
return;
|
|
2436
|
+
}
|
|
2437
|
+
const n = this.restaurant.profile.coverPhoto;
|
|
2438
|
+
n && !r && (await de.delete(n), this.data.coverPhoto = void 0);
|
|
2439
|
+
}
|
|
2440
|
+
async manageCarousels() {
|
|
2441
|
+
const e = this.data.newPhotos || [];
|
|
2442
|
+
for (const r of e) {
|
|
2443
|
+
const n = await de.update(this.generateUrl("normal"), r);
|
|
2444
|
+
this.data.photos = [...this.data.photos || [], n];
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
async run() {
|
|
2448
|
+
return await this.manageThumbnail(), await this.manageCover(), await this.manageCarousels(), this.data;
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
async function er(t, e) {
|
|
2452
|
+
const r = new Yo(t, e);
|
|
2453
|
+
await r.run(), await Ve.updateRestaurantProfile(t.id, r.data), await fe().readRestaurants();
|
|
2454
|
+
}
|
|
2455
|
+
const Wo = () => {
|
|
2456
|
+
const t = fe();
|
|
2457
|
+
return {
|
|
2458
|
+
async createRestaurant(e, r, n) {
|
|
2459
|
+
const s = await Ve.createRestaurant({
|
|
2460
|
+
businessId: e,
|
|
2461
|
+
features: [],
|
|
2462
|
+
profile: r
|
|
2463
|
+
});
|
|
2464
|
+
n && await Ve.updateRestaurantAttributes(s.id, n), await er(s, r), await t.readRestaurants();
|
|
2465
|
+
},
|
|
2466
|
+
async updateRestaurantProfile(e, r) {
|
|
2467
|
+
await er(e, r);
|
|
2468
|
+
}
|
|
2469
|
+
};
|
|
2470
|
+
}, Jo = { class: "flex justify-center" }, Zo = { class: "space-y-24" }, Qo = { class: "space-y-24" }, ei = { class: "flex gap-16 xs:flex-col xs:gap-24" }, ti = { class: "flex-1" }, ri = { class: "flex-1" }, ni = { class: "space-y-24" }, si = { class: "space-y-24" }, ai = { class: "space-y-8" }, oi = { class: "space-y-24" }, tr = /* @__PURE__ */ ee({
|
|
2471
|
+
__name: "RestaurantForm",
|
|
2472
|
+
props: {
|
|
2473
|
+
restaurantId: {
|
|
2474
|
+
type: String,
|
|
2475
|
+
default: void 0
|
|
2476
|
+
},
|
|
2477
|
+
restaurant: {
|
|
2478
|
+
type: Object
|
|
2479
|
+
},
|
|
2480
|
+
initialValue: {
|
|
2481
|
+
type: Object,
|
|
2482
|
+
default: void 0
|
|
2483
|
+
},
|
|
2484
|
+
enableFeedmeExpress: {
|
|
2485
|
+
type: Boolean,
|
|
2486
|
+
required: !0
|
|
2487
|
+
}
|
|
2488
|
+
},
|
|
2489
|
+
setup(t, { expose: e }) {
|
|
2490
|
+
var O;
|
|
2491
|
+
const r = t, { restaurants: n, currentBusiness: s, restaurantAttributeSettings: o, enabledCountries: i } = fe(), f = ut(), d = cr(f), { copyTextToClipboard: u } = lr(), b = ne(!1), g = (I, h) => {
|
|
2492
|
+
b.value = !b.value;
|
|
2493
|
+
}, L = X(() => {
|
|
2494
|
+
var I;
|
|
2495
|
+
return (I = r.restaurant) == null ? void 0 : I.profile;
|
|
2496
|
+
}), c = lt(
|
|
2497
|
+
L.value ? $e(L.value) : {
|
|
2498
|
+
...Wt(),
|
|
2499
|
+
address: Ie(Wt().address),
|
|
2500
|
+
legalName: "",
|
|
2501
|
+
sstRegNo: "",
|
|
2502
|
+
description: "",
|
|
2503
|
+
url: "",
|
|
2504
|
+
thumbnailPhoto: void 0,
|
|
2505
|
+
coverPhoto: void 0,
|
|
2506
|
+
newThumbnailPhoto: void 0,
|
|
2507
|
+
newCoverPhoto: void 0,
|
|
2508
|
+
newPhotos: [],
|
|
2509
|
+
operatingHours: {
|
|
2510
|
+
0: {
|
|
2511
|
+
enable: !1,
|
|
2512
|
+
hours: []
|
|
2513
|
+
},
|
|
2514
|
+
1: {
|
|
2515
|
+
enable: !1,
|
|
2516
|
+
hours: []
|
|
2517
|
+
},
|
|
2518
|
+
2: {
|
|
2519
|
+
enable: !1,
|
|
2520
|
+
hours: []
|
|
2521
|
+
},
|
|
2522
|
+
3: {
|
|
2523
|
+
enable: !1,
|
|
2524
|
+
hours: []
|
|
2525
|
+
},
|
|
2526
|
+
4: {
|
|
2527
|
+
enable: !1,
|
|
2528
|
+
hours: []
|
|
2529
|
+
},
|
|
2530
|
+
5: {
|
|
2531
|
+
enable: !1,
|
|
2532
|
+
hours: []
|
|
2533
|
+
},
|
|
2534
|
+
6: {
|
|
2535
|
+
enable: !1,
|
|
2536
|
+
hours: []
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
), y = "https://feedmedev.cc/", P = X(() => fe().currentCountry.value), { t: $ } = pe(), C = ne(
|
|
2541
|
+
r.restaurantId ? $("settings.business.restaurant.form.title.update") : $("settings.business.restaurant.form.title.add")
|
|
2542
|
+
), x = ne(((O = r.restaurant) == null ? void 0 : O.customAttributes) || {});
|
|
2543
|
+
async function A(I) {
|
|
2544
|
+
Object.values(x.value).length !== 0 && await Ve.updateRestaurantAttributes(I, x.value);
|
|
2545
|
+
}
|
|
2546
|
+
const j = X(() => Ie(c.address)), W = X(() => j.value.formatted);
|
|
2547
|
+
function J(I) {
|
|
2548
|
+
var h;
|
|
2549
|
+
if (typeof I == "string") {
|
|
2550
|
+
const N = (h = n.value.find((M) => M._id === I)) == null ? void 0 : h.profile.operatingHours;
|
|
2551
|
+
N ? c.operatingHours = $e(N) : f.open({
|
|
2552
|
+
title: $("settings.business.restaurant.form.sections.operation_hours.invalid"),
|
|
2553
|
+
type: "error"
|
|
2554
|
+
});
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
function U() {
|
|
2558
|
+
const I = y + (c.url || r.restaurantId);
|
|
2559
|
+
u(I);
|
|
2560
|
+
}
|
|
2561
|
+
function Y() {
|
|
2562
|
+
c.thumbnailPhoto = void 0, c.newThumbnailPhoto = void 0;
|
|
2563
|
+
}
|
|
2564
|
+
function a() {
|
|
2565
|
+
c.coverPhoto = void 0, c.newCoverPhoto = void 0;
|
|
2566
|
+
}
|
|
2567
|
+
function l(I) {
|
|
2568
|
+
c.newPhotos = c.newPhotos || [], c.newPhotos.push(I);
|
|
2569
|
+
}
|
|
2570
|
+
const v = Wo();
|
|
2571
|
+
function R() {
|
|
2572
|
+
var I, h;
|
|
2573
|
+
if (g(), r.restaurantId) {
|
|
2574
|
+
if (!((I = s.value) != null && I.id))
|
|
2575
|
+
return;
|
|
2576
|
+
d.minor(async () => {
|
|
2577
|
+
var N, M;
|
|
2578
|
+
r.restaurant && (await A(r.restaurantId), await v.updateRestaurantProfile(r.restaurant, {
|
|
2579
|
+
...c,
|
|
2580
|
+
url: ((N = c.url) == null ? void 0 : N.trim()) || null,
|
|
2581
|
+
code: ((M = c.code) == null ? void 0 : M.trim()) || null,
|
|
2582
|
+
phoneNo: Qt(c.phoneNo)
|
|
2583
|
+
}), $("settings.business.restaurant.form.message.updated"));
|
|
2584
|
+
});
|
|
2585
|
+
} else {
|
|
2586
|
+
if (!((h = s.value) != null && h.id))
|
|
2587
|
+
return;
|
|
2588
|
+
d.minor(async () => {
|
|
2589
|
+
var N, M;
|
|
2590
|
+
await v.createRestaurant(
|
|
2591
|
+
s.value.id,
|
|
2592
|
+
{
|
|
2593
|
+
...c,
|
|
2594
|
+
url: ((N = c.url) == null ? void 0 : N.trim()) || null,
|
|
2595
|
+
code: ((M = c.code) == null ? void 0 : M.trim()) || null,
|
|
2596
|
+
phoneNo: Qt(c.phoneNo)
|
|
2597
|
+
},
|
|
2598
|
+
x.value
|
|
2599
|
+
), $("settings.business.restaurant.form.message.created");
|
|
2600
|
+
});
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
const S = X(() => ({
|
|
2604
|
+
title: $("settings.business.restaurant.form.summary.title"),
|
|
2605
|
+
items: [
|
|
2606
|
+
{
|
|
2607
|
+
name: $("settings.business.restaurant.form.summary.name"),
|
|
2608
|
+
value: c.name
|
|
2609
|
+
},
|
|
2610
|
+
{
|
|
2611
|
+
name: $("settings.business.restaurant.form.summary.legal_name"),
|
|
2612
|
+
value: c.legalName
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
name: $("settings.business.restaurant.form.summary.contact"),
|
|
2616
|
+
value: c.phoneNo
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
name: $("settings.business.restaurant.form.summary.address"),
|
|
2620
|
+
value: W.value
|
|
2621
|
+
}
|
|
2622
|
+
]
|
|
2623
|
+
})), { isAtMost: m } = ir();
|
|
2624
|
+
X(() => m("sm"));
|
|
2625
|
+
const p = ne(null), w = Zr(p);
|
|
2626
|
+
return e({ trigger: g }), (I, h) => {
|
|
2627
|
+
const N = z("FmTextField"), M = z("FmPhoneNumber"), V = z("FmTextarea"), K = z("FmButton");
|
|
2628
|
+
return F(), B(se, null, [
|
|
2629
|
+
ue(I.$slots, "trigger", xr(kr({
|
|
2630
|
+
trigger: g
|
|
2631
|
+
}))),
|
|
2632
|
+
T(Tn, {
|
|
2633
|
+
title: C.value,
|
|
2634
|
+
show: b.value,
|
|
2635
|
+
"primary-action": { label: E($)("common.save") },
|
|
2636
|
+
"secondary-actions": [
|
|
2637
|
+
{ label: E($)("settings.business.restaurant.actions.discard"), click: () => b.value = !1 }
|
|
2638
|
+
],
|
|
2639
|
+
onOnPrimary: R,
|
|
2640
|
+
onOnCancel: h[17] || (h[17] = (k) => b.value = !1)
|
|
2641
|
+
}, {
|
|
2642
|
+
"append-title": q(() => [
|
|
2643
|
+
E(m)("sm") ? (F(), Q(Ot, {
|
|
2644
|
+
key: 0,
|
|
2645
|
+
variant: "dialog",
|
|
2646
|
+
title: S.value.title,
|
|
2647
|
+
items: S.value.items
|
|
2648
|
+
}, null, 8, ["title", "items"])) : le("", !0)
|
|
2649
|
+
]),
|
|
2650
|
+
default: q(() => [
|
|
2651
|
+
_("div", Jo, [
|
|
2652
|
+
_("div", {
|
|
2653
|
+
ref_key: "formWrapper",
|
|
2654
|
+
ref: p,
|
|
2655
|
+
class: "py-24 pr-[400px] w-[1150px] xs:pr-0 sm:pr-0 xs:w-full"
|
|
2656
|
+
}, [
|
|
2657
|
+
E(m)("sm") ? le("", !0) : (F(), Q(Ot, {
|
|
2658
|
+
key: 0,
|
|
2659
|
+
class: "fixed",
|
|
2660
|
+
style: xe({
|
|
2661
|
+
top: "85px",
|
|
2662
|
+
left: E(w).right - 400 + "px"
|
|
2663
|
+
}),
|
|
2664
|
+
variant: "full",
|
|
2665
|
+
title: S.value.title,
|
|
2666
|
+
items: S.value.items
|
|
2667
|
+
}, null, 8, ["style", "title", "items"])),
|
|
2668
|
+
_("div", Zo, [
|
|
2669
|
+
T(we, {
|
|
2670
|
+
title: E($)("settings.business.restaurant.form.sections.basic_info.title")
|
|
2671
|
+
}, {
|
|
2672
|
+
default: q(() => {
|
|
2673
|
+
var k, G;
|
|
2674
|
+
return [
|
|
2675
|
+
_("div", Qo, [
|
|
2676
|
+
_("div", null, [
|
|
2677
|
+
T(N, {
|
|
2678
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.code.label"),
|
|
2679
|
+
modelValue: c.code,
|
|
2680
|
+
"onUpdate:modelValue": h[0] || (h[0] = (H) => c.code = H),
|
|
2681
|
+
"label-mark": "optional",
|
|
2682
|
+
"helper-text": E($)("settings.business.restaurant.form.sections.basic_info.code.helper"),
|
|
2683
|
+
disabled: ((k = L.value) == null ? void 0 : k.code) !== void 0 && ((G = L.value) == null ? void 0 : G.code) !== null
|
|
2684
|
+
}, null, 8, ["label", "modelValue", "helper-text", "disabled"])
|
|
2685
|
+
]),
|
|
2686
|
+
_("div", null, [
|
|
2687
|
+
T(N, {
|
|
2688
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.name.label"),
|
|
2689
|
+
modelValue: c.name,
|
|
2690
|
+
"onUpdate:modelValue": h[1] || (h[1] = (H) => c.name = H),
|
|
2691
|
+
"label-mark": "required",
|
|
2692
|
+
rules: [E(ce)]
|
|
2693
|
+
}, null, 8, ["label", "modelValue", "rules"])
|
|
2694
|
+
]),
|
|
2695
|
+
_("div", null, [
|
|
2696
|
+
T(N, {
|
|
2697
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.legal_name.label"),
|
|
2698
|
+
modelValue: c.legalName,
|
|
2699
|
+
"onUpdate:modelValue": h[2] || (h[2] = (H) => c.legalName = H),
|
|
2700
|
+
"label-mark": "required",
|
|
2701
|
+
rules: [E(ce)]
|
|
2702
|
+
}, null, 8, ["label", "modelValue", "rules"])
|
|
2703
|
+
]),
|
|
2704
|
+
_("div", null, [
|
|
2705
|
+
T(N, {
|
|
2706
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.reg_no.label"),
|
|
2707
|
+
modelValue: c.regNo,
|
|
2708
|
+
"onUpdate:modelValue": h[3] || (h[3] = (H) => c.regNo = H),
|
|
2709
|
+
"label-mark": "required",
|
|
2710
|
+
rules: [E(ce)]
|
|
2711
|
+
}, null, 8, ["label", "modelValue", "rules"])
|
|
2712
|
+
]),
|
|
2713
|
+
_("div", null, [
|
|
2714
|
+
T(N, {
|
|
2715
|
+
modelValue: c.sstRegNo,
|
|
2716
|
+
"onUpdate:modelValue": h[4] || (h[4] = (H) => c.sstRegNo = H),
|
|
2717
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.tax_no.label"),
|
|
2718
|
+
"label-mark": "optional"
|
|
2719
|
+
}, null, 8, ["modelValue", "label"])
|
|
2720
|
+
]),
|
|
2721
|
+
_("div", ei, [
|
|
2722
|
+
_("div", ti, [
|
|
2723
|
+
T(M, {
|
|
2724
|
+
class: "w-full",
|
|
2725
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.contact.label"),
|
|
2726
|
+
modelValue: c.phoneNo,
|
|
2727
|
+
"onUpdate:modelValue": h[5] || (h[5] = (H) => c.phoneNo = H),
|
|
2728
|
+
"label-mark": "optional",
|
|
2729
|
+
"extra-country-codes": E(i)
|
|
2730
|
+
}, null, 8, ["label", "modelValue", "extra-country-codes"])
|
|
2731
|
+
]),
|
|
2732
|
+
_("div", ri, [
|
|
2733
|
+
T(N, {
|
|
2734
|
+
class: "w-full",
|
|
2735
|
+
modelValue: c.email,
|
|
2736
|
+
"onUpdate:modelValue": h[6] || (h[6] = (H) => c.email = H),
|
|
2737
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.email.label"),
|
|
2738
|
+
"label-mark": "optional"
|
|
2739
|
+
}, null, 8, ["modelValue", "label"])
|
|
2740
|
+
])
|
|
2741
|
+
]),
|
|
2742
|
+
_("div", null, [
|
|
2743
|
+
T(ye, {
|
|
2744
|
+
label: E($)("settings.business.restaurant.form.sections.basic_info.image.label"),
|
|
2745
|
+
"sub-label": E($)("settings.business.restaurant.form.sections.basic_info.image.optional"),
|
|
2746
|
+
"previous-url": c.thumbnailPhoto,
|
|
2747
|
+
modelValue: c.newThumbnailPhoto,
|
|
2748
|
+
"onUpdate:modelValue": h[7] || (h[7] = (H) => c.newThumbnailPhoto = H),
|
|
2749
|
+
"onReset:modelValue": Y
|
|
2750
|
+
}, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
|
|
2751
|
+
])
|
|
2752
|
+
])
|
|
2753
|
+
];
|
|
2754
|
+
}),
|
|
2755
|
+
_: 1
|
|
2756
|
+
}, 8, ["title"]),
|
|
2757
|
+
E(o).length > 0 ? (F(), B(se, { key: 0 }, [
|
|
2758
|
+
h[18] || (h[18] = _("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
|
|
2759
|
+
T(we, {
|
|
2760
|
+
title: E($)("settings.restaurantTagging.title"),
|
|
2761
|
+
"sub-title": E($)("settings.restaurantTagging.subtitle")
|
|
2762
|
+
}, {
|
|
2763
|
+
default: q(() => [
|
|
2764
|
+
T(E(Fr), {
|
|
2765
|
+
entity: "restaurant",
|
|
2766
|
+
modelValue: x.value,
|
|
2767
|
+
"onUpdate:modelValue": h[8] || (h[8] = (k) => x.value = k)
|
|
2768
|
+
}, null, 8, ["modelValue"])
|
|
2769
|
+
]),
|
|
2770
|
+
_: 1
|
|
2771
|
+
}, 8, ["title", "sub-title"])
|
|
2772
|
+
], 64)) : le("", !0),
|
|
2773
|
+
h[19] || (h[19] = _("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
|
|
2774
|
+
T(we, {
|
|
2775
|
+
title: E($)("settings.business.restaurant.form.sections.address.title")
|
|
2776
|
+
}, {
|
|
2777
|
+
default: q(() => [
|
|
2778
|
+
_("div", ni, [
|
|
2779
|
+
T(Xo, {
|
|
2780
|
+
modelValue: c.address,
|
|
2781
|
+
"onUpdate:modelValue": h[9] || (h[9] = (k) => c.address = k)
|
|
2782
|
+
}, null, 8, ["modelValue"]),
|
|
2783
|
+
T(Co, {
|
|
2784
|
+
address: j.value,
|
|
2785
|
+
modelValue: c.address.coordinates,
|
|
2786
|
+
"onUpdate:modelValue": h[10] || (h[10] = (k) => c.address.coordinates = k)
|
|
2787
|
+
}, null, 8, ["address", "modelValue"])
|
|
2788
|
+
])
|
|
2789
|
+
]),
|
|
2790
|
+
_: 1
|
|
2791
|
+
}, 8, ["title"]),
|
|
2792
|
+
h[20] || (h[20] = _("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
|
|
2793
|
+
T(we, {
|
|
2794
|
+
title: E($)("settings.business.restaurant.form.sections.operation_hours.title")
|
|
2795
|
+
}, {
|
|
2796
|
+
default: q(() => [
|
|
2797
|
+
_("div", si, [
|
|
2798
|
+
_("div", ai, [
|
|
2799
|
+
T(It, {
|
|
2800
|
+
label: E($)("settings.business.restaurant.form.sections.operation_hours.copy_with"),
|
|
2801
|
+
optional: !1
|
|
2802
|
+
}, null, 8, ["label"]),
|
|
2803
|
+
T(Ur, {
|
|
2804
|
+
class: "w-[320px]",
|
|
2805
|
+
"exclude-restaurants": [t.restaurantId ?? ""],
|
|
2806
|
+
"model-value": "",
|
|
2807
|
+
"onUpdate:modelValue": h[11] || (h[11] = (k) => J(k))
|
|
2808
|
+
}, null, 8, ["exclude-restaurants"]),
|
|
2809
|
+
T(Fo, {
|
|
2810
|
+
modelValue: c.operatingHours,
|
|
2811
|
+
"onUpdate:modelValue": h[12] || (h[12] = (k) => c.operatingHours = k)
|
|
2812
|
+
}, null, 8, ["modelValue"])
|
|
2813
|
+
])
|
|
2814
|
+
])
|
|
2815
|
+
]),
|
|
2816
|
+
_: 1
|
|
2817
|
+
}, 8, ["title"]),
|
|
2818
|
+
h[21] || (h[21] = _("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
|
|
2819
|
+
T(we, {
|
|
2820
|
+
title: E($)("settings.business.restaurant.form.sections.branding.title")
|
|
2821
|
+
}, {
|
|
2822
|
+
default: q(() => [
|
|
2823
|
+
_("div", oi, [
|
|
2824
|
+
T(V, {
|
|
2825
|
+
label: E($)("settings.business.restaurant.form.sections.branding.description"),
|
|
2826
|
+
"model-value": c.description ?? "",
|
|
2827
|
+
"onUpdate:modelValue": h[13] || (h[13] = (k) => c.description = k)
|
|
2828
|
+
}, null, 8, ["label", "model-value"]),
|
|
2829
|
+
T(N, {
|
|
2830
|
+
label: E($)("settings.business.restaurant.form.sections.branding.url.label"),
|
|
2831
|
+
placeholder: t.restaurantId,
|
|
2832
|
+
"model-value": c.url,
|
|
2833
|
+
"onUpdate:modelValue": h[14] || (h[14] = (k) => c.url = k),
|
|
2834
|
+
rules: [
|
|
2835
|
+
(k) => {
|
|
2836
|
+
var G;
|
|
2837
|
+
return !k || ((G = L.value) == null ? void 0 : G.url) == c.url || P.value == E(dt.F_COUNTRY).enum.MY || E($)("settings.business.restaurant.form.sections.branding.url.errors.disabled");
|
|
2838
|
+
},
|
|
2839
|
+
(k) => !k || E(fr).test(k) || E($)("settings.business.restaurant.form.sections.branding.url.errors.invalid"),
|
|
2840
|
+
(k) => !k || !E(mr).includes(k) || E($)("settings.business.restaurant.form.sections.branding.url.errors.reserved")
|
|
2841
|
+
]
|
|
2842
|
+
}, {
|
|
2843
|
+
prepend: q(() => [
|
|
2844
|
+
_("span", null, D(y))
|
|
2845
|
+
]),
|
|
2846
|
+
append: q(() => [
|
|
2847
|
+
T(K, {
|
|
2848
|
+
variant: "tertiary",
|
|
2849
|
+
icon: "file_copy",
|
|
2850
|
+
"text-color": "neutral-gray-400",
|
|
2851
|
+
onClick: U
|
|
2852
|
+
})
|
|
2853
|
+
]),
|
|
2854
|
+
_: 1
|
|
2855
|
+
}, 8, ["label", "placeholder", "model-value", "rules"]),
|
|
2856
|
+
_("div", null, [
|
|
2857
|
+
T(ye, {
|
|
2858
|
+
label: E($)("settings.business.form.cover_photo.label"),
|
|
2859
|
+
"previous-url": c.coverPhoto,
|
|
2860
|
+
modelValue: c.newCoverPhoto,
|
|
2861
|
+
"onUpdate:modelValue": h[15] || (h[15] = (k) => c.newCoverPhoto = k),
|
|
2862
|
+
"onReset:modelValue": a
|
|
2863
|
+
}, null, 8, ["label", "previous-url", "modelValue"])
|
|
2864
|
+
]),
|
|
2865
|
+
_("div", null, [
|
|
2866
|
+
T(It, {
|
|
2867
|
+
label: E($)("settings.business.restaurant.form.sections.branding.carousel_photos.label")
|
|
2868
|
+
}, null, 8, ["label"]),
|
|
2869
|
+
(F(!0), B(se, null, me(c.photos || [], (k, G) => (F(), Q(ye, {
|
|
2870
|
+
key: G,
|
|
2871
|
+
"previous-url": k,
|
|
2872
|
+
"model-value": void 0,
|
|
2873
|
+
"onReset:modelValue": (H) => {
|
|
2874
|
+
var he;
|
|
2875
|
+
return (he = c.photos) == null ? void 0 : he.splice(G, 1);
|
|
2876
|
+
}
|
|
2877
|
+
}, null, 8, ["previous-url", "onReset:modelValue"]))), 128)),
|
|
2878
|
+
(F(!0), B(se, null, me(c.newPhotos || [], (k, G) => {
|
|
2879
|
+
var H;
|
|
2880
|
+
return F(), Q(ye, {
|
|
2881
|
+
key: G,
|
|
2882
|
+
"model-value": ((H = c.newPhotos) == null ? void 0 : H[G]) || void 0,
|
|
2883
|
+
"previous-url": void 0,
|
|
2884
|
+
"onReset:modelValue": (he) => {
|
|
2885
|
+
var ve;
|
|
2886
|
+
return (ve = c.photos) == null ? void 0 : ve.splice(G, 1);
|
|
2887
|
+
}
|
|
2888
|
+
}, null, 8, ["model-value", "onReset:modelValue"]);
|
|
2889
|
+
}), 128)),
|
|
2890
|
+
T(ye, {
|
|
2891
|
+
"model-value": void 0,
|
|
2892
|
+
"previous-url": void 0,
|
|
2893
|
+
"onUpdate:modelValue": h[16] || (h[16] = (k) => l(k))
|
|
2894
|
+
})
|
|
2895
|
+
])
|
|
2896
|
+
])
|
|
2897
|
+
]),
|
|
2898
|
+
_: 1
|
|
2899
|
+
}, 8, ["title"])
|
|
2900
|
+
])
|
|
2901
|
+
], 512)
|
|
2902
|
+
])
|
|
2903
|
+
]),
|
|
2904
|
+
_: 1
|
|
2905
|
+
}, 8, ["title", "show", "primary-action", "secondary-actions"])
|
|
2906
|
+
], 64);
|
|
2907
|
+
};
|
|
2908
|
+
}
|
|
2909
|
+
}), ii = (t) => {
|
|
2910
|
+
const e = ne(t || "");
|
|
2911
|
+
function r(o) {
|
|
2912
|
+
return `${o}`.trim().toLowerCase();
|
|
2913
|
+
}
|
|
2914
|
+
const n = X(() => r(e.value));
|
|
2915
|
+
function s(o) {
|
|
2916
|
+
return n.value ? o.some((i) => r(i).includes(n.value)) : !0;
|
|
2917
|
+
}
|
|
2918
|
+
return { searchKey: e, filter: s };
|
|
2919
|
+
};
|
|
2920
|
+
var wr = { exports: {} };
|
|
2921
|
+
(function(t, e) {
|
|
2922
|
+
(function(r, n) {
|
|
2923
|
+
t.exports = n();
|
|
2924
|
+
})(Kr, function() {
|
|
2925
|
+
return function(r) {
|
|
2926
|
+
var n = {};
|
|
2927
|
+
function s(o) {
|
|
2928
|
+
if (n[o])
|
|
2929
|
+
return n[o].exports;
|
|
2930
|
+
var i = n[o] = { i: o, l: !1, exports: {} };
|
|
2931
|
+
return r[o].call(i.exports, i, i.exports, s), i.l = !0, i.exports;
|
|
2932
|
+
}
|
|
2933
|
+
return s.m = r, s.c = n, s.d = function(o, i, f) {
|
|
2934
|
+
s.o(o, i) || Object.defineProperty(o, i, { enumerable: !0, get: f });
|
|
2935
|
+
}, s.r = function(o) {
|
|
2936
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 });
|
|
2937
|
+
}, s.t = function(o, i) {
|
|
2938
|
+
if (1 & i && (o = s(o)), 8 & i || 4 & i && typeof o == "object" && o && o.__esModule)
|
|
2939
|
+
return o;
|
|
2940
|
+
var f = /* @__PURE__ */ Object.create(null);
|
|
2941
|
+
if (s.r(f), Object.defineProperty(f, "default", { enumerable: !0, value: o }), 2 & i && typeof o != "string")
|
|
2942
|
+
for (var d in o)
|
|
2943
|
+
s.d(
|
|
2944
|
+
f,
|
|
2945
|
+
d,
|
|
2946
|
+
(function(u) {
|
|
2947
|
+
return o[u];
|
|
2948
|
+
}).bind(null, d)
|
|
2949
|
+
);
|
|
2950
|
+
return f;
|
|
2951
|
+
}, s.n = function(o) {
|
|
2952
|
+
var i = o && o.__esModule ? function() {
|
|
2953
|
+
return o.default;
|
|
2954
|
+
} : function() {
|
|
2955
|
+
return o;
|
|
2956
|
+
};
|
|
2957
|
+
return s.d(i, "a", i), i;
|
|
2958
|
+
}, s.o = function(o, i) {
|
|
2959
|
+
return Object.prototype.hasOwnProperty.call(o, i);
|
|
2960
|
+
}, s.p = "", s(s.s = 0);
|
|
2961
|
+
}([
|
|
2962
|
+
function(r, n, s) {
|
|
2963
|
+
r.exports = s(1);
|
|
2964
|
+
},
|
|
2965
|
+
function(r, n, s) {
|
|
2966
|
+
function o(a) {
|
|
2967
|
+
return (o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
|
|
2968
|
+
return typeof l;
|
|
2969
|
+
} : function(l) {
|
|
2970
|
+
return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
|
|
2971
|
+
})(a);
|
|
2972
|
+
}
|
|
2973
|
+
function i(a) {
|
|
2974
|
+
var l = "[object " + a + "]";
|
|
2975
|
+
return function(v) {
|
|
2976
|
+
return Object.prototype.toString.call(v) === l;
|
|
2977
|
+
};
|
|
2978
|
+
}
|
|
2979
|
+
s.r(n), s.d(n, "default", function() {
|
|
2980
|
+
return J;
|
|
2981
|
+
}), s.d(n, "compare", function() {
|
|
2982
|
+
return U;
|
|
2983
|
+
}), s.d(n, "comparable", function() {
|
|
2984
|
+
return Y;
|
|
2985
|
+
});
|
|
2986
|
+
var f = i("Array"), d = i("Object"), u = i("Function");
|
|
2987
|
+
function b(a, l) {
|
|
2988
|
+
return u(a.get) ? a.get(l) : a[l];
|
|
2989
|
+
}
|
|
2990
|
+
function g(a) {
|
|
2991
|
+
return function(l, v) {
|
|
2992
|
+
if (!f(v) || !v.length)
|
|
2993
|
+
return a(l, v);
|
|
2994
|
+
for (var R = 0, S = v.length; R < S; R++)
|
|
2995
|
+
if (a(l, b(v, R)))
|
|
2996
|
+
return !0;
|
|
2997
|
+
return !1;
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
function L(a) {
|
|
3001
|
+
return function(l, v) {
|
|
3002
|
+
if (!f(v) || !v.length)
|
|
3003
|
+
return a(l, v);
|
|
3004
|
+
for (var R = 0, S = v.length; R < S; R++)
|
|
3005
|
+
if (!a(l, b(v, R)))
|
|
3006
|
+
return !1;
|
|
3007
|
+
return !0;
|
|
3008
|
+
};
|
|
3009
|
+
}
|
|
3010
|
+
function c(a, l, v, R) {
|
|
3011
|
+
return a.validate(a.options, l, v, R);
|
|
3012
|
+
}
|
|
3013
|
+
var y = {
|
|
3014
|
+
$eq: g(function(a, l) {
|
|
3015
|
+
return a(l);
|
|
3016
|
+
}),
|
|
3017
|
+
$ne: L(function(a, l) {
|
|
3018
|
+
return a(l);
|
|
3019
|
+
}),
|
|
3020
|
+
$gt: g(function(a, l) {
|
|
3021
|
+
return a(l);
|
|
3022
|
+
}),
|
|
3023
|
+
$gte: g(function(a, l) {
|
|
3024
|
+
return a(l);
|
|
3025
|
+
}),
|
|
3026
|
+
$lt: g(function(a, l) {
|
|
3027
|
+
return a(l);
|
|
3028
|
+
}),
|
|
3029
|
+
$lte: g(function(a, l) {
|
|
3030
|
+
return a(l);
|
|
3031
|
+
}),
|
|
3032
|
+
$mod: g(function(a, l) {
|
|
3033
|
+
return a(l);
|
|
3034
|
+
}),
|
|
3035
|
+
$in: function(a, l) {
|
|
3036
|
+
return a(l);
|
|
3037
|
+
},
|
|
3038
|
+
$nin: function(a, l) {
|
|
3039
|
+
return a(l);
|
|
3040
|
+
},
|
|
3041
|
+
$not: function(a, l, v, R) {
|
|
3042
|
+
return a(l, v, R);
|
|
3043
|
+
},
|
|
3044
|
+
$type: function(a, l) {
|
|
3045
|
+
return a(l);
|
|
3046
|
+
},
|
|
3047
|
+
$all: function(a, l, v, R) {
|
|
3048
|
+
return y.$and(a, l, v, R);
|
|
3049
|
+
},
|
|
3050
|
+
$size: function(a, l) {
|
|
3051
|
+
return !!l && a === l.length;
|
|
3052
|
+
},
|
|
3053
|
+
$or: function(a, l, v, R) {
|
|
3054
|
+
for (var S = 0, m = a.length; S < m; S++)
|
|
3055
|
+
if (c(b(a, S), l, v, R))
|
|
3056
|
+
return !0;
|
|
3057
|
+
return !1;
|
|
3058
|
+
},
|
|
3059
|
+
$nor: function(a, l, v, R) {
|
|
3060
|
+
return !y.$or(a, l, v, R);
|
|
3061
|
+
},
|
|
3062
|
+
$and: function(a, l, v, R) {
|
|
3063
|
+
for (var S = 0, m = a.length; S < m; S++)
|
|
3064
|
+
if (!c(b(a, S), l, v, R))
|
|
3065
|
+
return !1;
|
|
3066
|
+
return !0;
|
|
3067
|
+
},
|
|
3068
|
+
$regex: g(function(a, l) {
|
|
3069
|
+
return typeof l == "string" && a.test(l);
|
|
3070
|
+
}),
|
|
3071
|
+
$where: function(a, l, v, R) {
|
|
3072
|
+
return a.call(l, l, v, R);
|
|
3073
|
+
},
|
|
3074
|
+
$elemMatch: function(a, l, v, R) {
|
|
3075
|
+
return f(l) ? !!~function(S, m) {
|
|
3076
|
+
for (var p = 0; p < S.length; p++)
|
|
3077
|
+
if (b(S, p), c(m, b(S, p)))
|
|
3078
|
+
return p;
|
|
3079
|
+
return -1;
|
|
3080
|
+
}(l, a) : c(a, l, v, R);
|
|
3081
|
+
},
|
|
3082
|
+
$exists: function(a, l, v, R) {
|
|
3083
|
+
return R.hasOwnProperty(v) === a;
|
|
3084
|
+
}
|
|
3085
|
+
}, P = {
|
|
3086
|
+
$eq: function(a, l, v) {
|
|
3087
|
+
var R = v.comparable, S = v.compare;
|
|
3088
|
+
return a instanceof RegExp ? g(function(m) {
|
|
3089
|
+
return typeof m == "string" && a.test(m);
|
|
3090
|
+
}) : a instanceof Function ? g(a) : f(a) && !a.length ? g(function(m) {
|
|
3091
|
+
return f(m) && !m.length;
|
|
3092
|
+
}) : g(
|
|
3093
|
+
a === null ? function(m) {
|
|
3094
|
+
return m == null;
|
|
3095
|
+
} : function(m) {
|
|
3096
|
+
return S(R(m), R(a)) === 0;
|
|
3097
|
+
}
|
|
3098
|
+
);
|
|
3099
|
+
},
|
|
3100
|
+
$gt: function(a, l, v) {
|
|
3101
|
+
var R = v.comparable, S = v.compare;
|
|
3102
|
+
return function(m) {
|
|
3103
|
+
return S(R(m), R(a)) > 0;
|
|
3104
|
+
};
|
|
3105
|
+
},
|
|
3106
|
+
$gte: function(a, l, v) {
|
|
3107
|
+
var R = v.comparable, S = v.compare;
|
|
3108
|
+
return function(m) {
|
|
3109
|
+
return S(R(m), R(a)) >= 0;
|
|
3110
|
+
};
|
|
3111
|
+
},
|
|
3112
|
+
$lt: function(a, l, v) {
|
|
3113
|
+
var R = v.comparable, S = v.compare;
|
|
3114
|
+
return function(m) {
|
|
3115
|
+
return S(R(m), R(a)) < 0;
|
|
3116
|
+
};
|
|
3117
|
+
},
|
|
3118
|
+
$lte: function(a, l, v) {
|
|
3119
|
+
var R = v.comparable, S = v.compare;
|
|
3120
|
+
return function(m) {
|
|
3121
|
+
return S(R(m), R(a)) <= 0;
|
|
3122
|
+
};
|
|
3123
|
+
},
|
|
3124
|
+
$in: function(a, l, v) {
|
|
3125
|
+
var R = v.comparable;
|
|
3126
|
+
return function(S) {
|
|
3127
|
+
if (!(S instanceof Array)) {
|
|
3128
|
+
var m = R(S);
|
|
3129
|
+
if (m === S && o(S) === "object") {
|
|
3130
|
+
for (w = a.length; w--; )
|
|
3131
|
+
if (String(a[w]) === String(S) && String(S) !== "[object Object]")
|
|
3132
|
+
return !0;
|
|
3133
|
+
}
|
|
3134
|
+
if (m === void 0) {
|
|
3135
|
+
for (w = a.length; w--; )
|
|
3136
|
+
if (a[w] == null)
|
|
3137
|
+
return !0;
|
|
3138
|
+
}
|
|
3139
|
+
for (w = a.length; w--; ) {
|
|
3140
|
+
var p = c(W(b(a, w), v), m, w, a);
|
|
3141
|
+
if (p && String(p) !== "[object Object]" && String(m) !== "[object Object]")
|
|
3142
|
+
return !0;
|
|
3143
|
+
}
|
|
3144
|
+
return !!~a.indexOf(m);
|
|
3145
|
+
}
|
|
3146
|
+
for (var w = S.length; w--; )
|
|
3147
|
+
if (~a.indexOf(R(b(S, w))))
|
|
3148
|
+
return !0;
|
|
3149
|
+
return !1;
|
|
3150
|
+
};
|
|
3151
|
+
},
|
|
3152
|
+
$nin: function(a, l, v) {
|
|
3153
|
+
var R = P.$in(a, l, v);
|
|
3154
|
+
return function(S, m, p, w) {
|
|
3155
|
+
return !R(S, m, p, w);
|
|
3156
|
+
};
|
|
3157
|
+
},
|
|
3158
|
+
$mod: function(a) {
|
|
3159
|
+
return function(l) {
|
|
3160
|
+
return l % a[0] == a[1];
|
|
3161
|
+
};
|
|
3162
|
+
},
|
|
3163
|
+
$ne: function(a, l, v) {
|
|
3164
|
+
var R = P.$eq(a, l, v);
|
|
3165
|
+
return L(function(S, m, p, w) {
|
|
3166
|
+
return !R(S, m, p, w);
|
|
3167
|
+
});
|
|
3168
|
+
},
|
|
3169
|
+
$and: function(a, l, v) {
|
|
3170
|
+
return a.map(A(v));
|
|
3171
|
+
},
|
|
3172
|
+
$all: function(a, l, v) {
|
|
3173
|
+
return P.$and(a, l, v);
|
|
3174
|
+
},
|
|
3175
|
+
$or: function(a, l, v) {
|
|
3176
|
+
return a.map(A(v));
|
|
3177
|
+
},
|
|
3178
|
+
$nor: function(a, l, v) {
|
|
3179
|
+
return a.map(A(v));
|
|
3180
|
+
},
|
|
3181
|
+
$not: function(a, l, v) {
|
|
3182
|
+
var R = A(v)(a);
|
|
3183
|
+
return function(S, m, p) {
|
|
3184
|
+
return !c(R, S, m, p);
|
|
3185
|
+
};
|
|
3186
|
+
},
|
|
3187
|
+
$type: function(a) {
|
|
3188
|
+
return function(l, v, R) {
|
|
3189
|
+
return l != null && (l instanceof a || l.constructor == a);
|
|
3190
|
+
};
|
|
3191
|
+
},
|
|
3192
|
+
$regex: function(a, l) {
|
|
3193
|
+
return new RegExp(a, l.$options);
|
|
3194
|
+
},
|
|
3195
|
+
$where: function(a) {
|
|
3196
|
+
if (typeof a == "function")
|
|
3197
|
+
return a;
|
|
3198
|
+
throw new Error(
|
|
3199
|
+
'In CSP mode, sift does not support strings in "$where" condition'
|
|
3200
|
+
);
|
|
3201
|
+
},
|
|
3202
|
+
$elemMatch: function(a, l, v) {
|
|
3203
|
+
return A(v)(a);
|
|
3204
|
+
},
|
|
3205
|
+
$exists: function(a) {
|
|
3206
|
+
return !!a;
|
|
3207
|
+
}
|
|
3208
|
+
};
|
|
3209
|
+
function $(a, l) {
|
|
3210
|
+
return { options: a, validate: l };
|
|
3211
|
+
}
|
|
3212
|
+
function C(a, l) {
|
|
3213
|
+
var v = a.keyPath, R = a.child, S = a.query, m = [];
|
|
3214
|
+
if (function M(V, K, k, G, H) {
|
|
3215
|
+
if (k === K.length || V == null)
|
|
3216
|
+
return void H.push([V, K[k - 1], G]);
|
|
3217
|
+
var he = b(K, k);
|
|
3218
|
+
if (f(V) && isNaN(Number(he)))
|
|
3219
|
+
for (var ve = 0, Ir = V.length; ve < Ir; ve++)
|
|
3220
|
+
M(b(V, ve), K, k, V, H);
|
|
3221
|
+
else
|
|
3222
|
+
M(b(V, he), K, k + 1, V, H);
|
|
3223
|
+
}(l, v, 0, l, m), m.length === 1) {
|
|
3224
|
+
var p = m[0];
|
|
3225
|
+
return c(R, p[0], p[1], p[2]);
|
|
3226
|
+
}
|
|
3227
|
+
for (var w = S && S.$ne !== void 0, O = w, I = 0; I < m.length; I++) {
|
|
3228
|
+
var h = m[I], N = c(R, h[0], h[1], h[2]);
|
|
3229
|
+
w ? O &= N : O |= N;
|
|
3230
|
+
}
|
|
3231
|
+
return O;
|
|
3232
|
+
}
|
|
3233
|
+
function x(a, l, v) {
|
|
3234
|
+
return $({ keyPath: a, child: l, query: v }, C);
|
|
3235
|
+
}
|
|
3236
|
+
function A(a) {
|
|
3237
|
+
var l = a.comparable, v = a.expressions, R = function(p) {
|
|
3238
|
+
var w;
|
|
3239
|
+
return (!p || !(w = p) || w.constructor !== Object && w.constructor !== Array && w.constructor.toString() !== "function Object() { [native code] }" && w.constructor.toString() !== "function Array() { [native code] }" || w.toJSON) && (p = { $eq: p }), p;
|
|
3240
|
+
}, S = function(p) {
|
|
3241
|
+
p = l(p);
|
|
3242
|
+
var w = [];
|
|
3243
|
+
for (var O in p) {
|
|
3244
|
+
var I = p[O];
|
|
3245
|
+
if (O !== "$options") {
|
|
3246
|
+
var h = y[O] || a && v && v[O];
|
|
3247
|
+
if (h)
|
|
3248
|
+
P[O] && (I = P[O](I, p, a)), w.push($(l(I), h));
|
|
3249
|
+
else {
|
|
3250
|
+
if (O.charCodeAt(0) === 36)
|
|
3251
|
+
throw new Error("Unknown operation " + O);
|
|
3252
|
+
var N = O.split(".");
|
|
3253
|
+
w.push(x(N, m(I), I));
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
return w.length === 1 ? w[0] : $(w, y.$and);
|
|
3258
|
+
}, m = function(p) {
|
|
3259
|
+
return p = R(p), function w(O, I) {
|
|
3260
|
+
if (!d(O))
|
|
3261
|
+
return I;
|
|
3262
|
+
for (var h in O)
|
|
3263
|
+
I.push(h), w(O[h], I);
|
|
3264
|
+
return I;
|
|
3265
|
+
}(p, []).join(",").search(/[$.]/) === -1 ? $(p, j) : S(p);
|
|
3266
|
+
};
|
|
3267
|
+
return function(p) {
|
|
3268
|
+
return S(R(p));
|
|
3269
|
+
};
|
|
3270
|
+
}
|
|
3271
|
+
function j(a, l) {
|
|
3272
|
+
if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(l))
|
|
3273
|
+
return !1;
|
|
3274
|
+
if (d(a)) {
|
|
3275
|
+
if (Object.keys(a).length !== Object.keys(l).length)
|
|
3276
|
+
return !1;
|
|
3277
|
+
for (var v in a)
|
|
3278
|
+
if (!j(a[v], l[v]))
|
|
3279
|
+
return !1;
|
|
3280
|
+
return !0;
|
|
3281
|
+
}
|
|
3282
|
+
if (f(a)) {
|
|
3283
|
+
if (a.length !== l.length)
|
|
3284
|
+
return !1;
|
|
3285
|
+
for (var R = 0, S = a.length; R < S; R++)
|
|
3286
|
+
if (!j(a[R], l[R]))
|
|
3287
|
+
return !1;
|
|
3288
|
+
return !0;
|
|
3289
|
+
}
|
|
3290
|
+
return a === l;
|
|
3291
|
+
}
|
|
3292
|
+
function W(a, l) {
|
|
3293
|
+
var v = A(l)(a);
|
|
3294
|
+
return l && l.select && (v = {
|
|
3295
|
+
options: v,
|
|
3296
|
+
validate: function(R, S, m, p) {
|
|
3297
|
+
return c(R, S && l.select(S), m, p);
|
|
3298
|
+
}
|
|
3299
|
+
}), v;
|
|
3300
|
+
}
|
|
3301
|
+
function J(a, l) {
|
|
3302
|
+
var v = W(a, l = Object.assign({ compare: U, comparable: Y }, l));
|
|
3303
|
+
return function(R, S, m) {
|
|
3304
|
+
return c(v, R, S, m);
|
|
3305
|
+
};
|
|
3306
|
+
}
|
|
3307
|
+
function U(a, l) {
|
|
3308
|
+
if (j(a, l))
|
|
3309
|
+
return 0;
|
|
3310
|
+
if (o(a) === o(l)) {
|
|
3311
|
+
if (a > l)
|
|
3312
|
+
return 1;
|
|
3313
|
+
if (a < l)
|
|
3314
|
+
return -1;
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
function Y(a) {
|
|
3318
|
+
return a instanceof Date ? a.getTime() : f(a) ? a.map(Y) : a && typeof a.toJSON == "function" ? a.toJSON() : a;
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
]);
|
|
3322
|
+
});
|
|
3323
|
+
})(wr);
|
|
3324
|
+
var li = wr.exports;
|
|
3325
|
+
const ui = /* @__PURE__ */ ur(li);
|
|
3326
|
+
function rr(t, e) {
|
|
3327
|
+
for (var r = 0; r < e.length; r++) {
|
|
3328
|
+
var n = e[r];
|
|
3329
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
function ci(t, e, r) {
|
|
3333
|
+
return e && rr(t.prototype, e), r && rr(t, r), t;
|
|
3334
|
+
}
|
|
3335
|
+
function di(t, e) {
|
|
3336
|
+
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e;
|
|
3337
|
+
}
|
|
3338
|
+
function at(t) {
|
|
3339
|
+
return at = Object.setPrototypeOf ? Object.getPrototypeOf : function(r) {
|
|
3340
|
+
return r.__proto__ || Object.getPrototypeOf(r);
|
|
3341
|
+
}, at(t);
|
|
3342
|
+
}
|
|
3343
|
+
function Fe(t, e) {
|
|
3344
|
+
return Fe = Object.setPrototypeOf || function(n, s) {
|
|
3345
|
+
return n.__proto__ = s, n;
|
|
3346
|
+
}, Fe(t, e);
|
|
3347
|
+
}
|
|
3348
|
+
function fi() {
|
|
3349
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
3350
|
+
return !1;
|
|
3351
|
+
if (typeof Proxy == "function")
|
|
3352
|
+
return !0;
|
|
3353
|
+
try {
|
|
3354
|
+
return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
|
|
3355
|
+
})), !0;
|
|
3356
|
+
} catch {
|
|
3357
|
+
return !1;
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
function Ne(t, e, r) {
|
|
3361
|
+
return fi() ? Ne = Reflect.construct : Ne = function(s, o, i) {
|
|
3362
|
+
var f = [null];
|
|
3363
|
+
f.push.apply(f, o);
|
|
3364
|
+
var d = Function.bind.apply(s, f), u = new d();
|
|
3365
|
+
return i && Fe(u, i.prototype), u;
|
|
3366
|
+
}, Ne.apply(null, arguments);
|
|
3367
|
+
}
|
|
3368
|
+
function mi(t) {
|
|
3369
|
+
return Function.toString.call(t).indexOf("[native code]") !== -1;
|
|
3370
|
+
}
|
|
3371
|
+
function ot(t) {
|
|
3372
|
+
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
3373
|
+
return ot = function(n) {
|
|
3374
|
+
if (n === null || !mi(n))
|
|
3375
|
+
return n;
|
|
3376
|
+
if (typeof n != "function")
|
|
3377
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
3378
|
+
if (typeof e < "u") {
|
|
3379
|
+
if (e.has(n))
|
|
3380
|
+
return e.get(n);
|
|
3381
|
+
e.set(n, s);
|
|
3382
|
+
}
|
|
3383
|
+
function s() {
|
|
3384
|
+
return Ne(n, arguments, at(this).constructor);
|
|
3385
|
+
}
|
|
3386
|
+
return s.prototype = Object.create(n.prototype, {
|
|
3387
|
+
constructor: {
|
|
3388
|
+
value: s,
|
|
3389
|
+
enumerable: !1,
|
|
3390
|
+
writable: !0,
|
|
3391
|
+
configurable: !0
|
|
3392
|
+
}
|
|
3393
|
+
}), Fe(s, n);
|
|
3394
|
+
}, ot(t);
|
|
3395
|
+
}
|
|
3396
|
+
function nr(t) {
|
|
3397
|
+
if (t === void 0)
|
|
3398
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3399
|
+
return t;
|
|
3400
|
+
}
|
|
3401
|
+
var Rr = function(e) {
|
|
3402
|
+
return 'Cannot execute "' + e.action + '" on "' + e.subjectName + '"';
|
|
3403
|
+
}, Le = Rr, pi = /* @__PURE__ */ function(t) {
|
|
3404
|
+
di(e, t), e.setDefaultMessage = function(s) {
|
|
3405
|
+
s === null ? Le = Rr : Le = typeof s == "string" ? function() {
|
|
3406
|
+
return s;
|
|
3407
|
+
} : s;
|
|
3408
|
+
}, e.from = function(s) {
|
|
3409
|
+
var o = new this("");
|
|
3410
|
+
return Object.defineProperty(o, "ability", {
|
|
3411
|
+
value: s
|
|
3412
|
+
}), o;
|
|
3413
|
+
};
|
|
3414
|
+
function e(n, s) {
|
|
3415
|
+
var o;
|
|
3416
|
+
return s === void 0 && (s = {}), o = t.call(this, n) || this, o._setMetadata(s), o.message = n || Le(nr(o)), o._customMessage = null, typeof Error.captureStackTrace == "function" && (o.name = o.constructor.name, Error.captureStackTrace(nr(o), o.constructor)), o;
|
|
3417
|
+
}
|
|
3418
|
+
var r = e.prototype;
|
|
3419
|
+
return r.setMessage = function(s) {
|
|
3420
|
+
return this._customMessage = s, this;
|
|
3421
|
+
}, r.throwUnlessCan = function(s, o, i) {
|
|
3422
|
+
if (!this.ability)
|
|
3423
|
+
throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
|
|
3424
|
+
var f = this.ability.relevantRuleFor(s, o, i);
|
|
3425
|
+
if (!(f && !f.inverted)) {
|
|
3426
|
+
this._setMetadata({
|
|
3427
|
+
action: s,
|
|
3428
|
+
subject: o,
|
|
3429
|
+
field: i,
|
|
3430
|
+
subjectName: this.ability.subjectName(o)
|
|
3431
|
+
});
|
|
3432
|
+
var d = f ? f.reason : "";
|
|
3433
|
+
throw this.message = this._customMessage || d || Le(this), this;
|
|
3434
|
+
}
|
|
3435
|
+
}, r._setMetadata = function(s) {
|
|
3436
|
+
this.subject = s.subject, this.subjectName = s.subjectName, this.action = s.action, this.field = s.field;
|
|
3437
|
+
}, e;
|
|
3438
|
+
}(ot(Error));
|
|
3439
|
+
function it(t) {
|
|
3440
|
+
return Array.isArray(t) ? t : [t];
|
|
3441
|
+
}
|
|
3442
|
+
function hi(t) {
|
|
3443
|
+
if (!t || typeof t == "string")
|
|
3444
|
+
return t;
|
|
3445
|
+
var e = typeof t == "object" ? t.constructor : t;
|
|
3446
|
+
return e.modelName || e.name;
|
|
3447
|
+
}
|
|
3448
|
+
function vi(t) {
|
|
3449
|
+
return JSON.parse(JSON.stringify(t));
|
|
3450
|
+
}
|
|
3451
|
+
var bi = /[-/\\^$+?.()|[\]{}]/g, gi = /\.?\*+\.?/g, yi = /\*+/, $i = /\./g;
|
|
3452
|
+
function _i(t, e, r) {
|
|
3453
|
+
var n = r[0] === "*" || t[0] === "." && t[t.length - 1] === "." ? "+" : "*", s = t.indexOf("**") === -1 ? "[^.]" : ".", o = t.replace($i, "\\$&").replace(yi, s + n);
|
|
3454
|
+
return e + t.length === r.length ? "(?:" + o + ")?" : o;
|
|
3455
|
+
}
|
|
3456
|
+
function Ei(t, e, r) {
|
|
3457
|
+
return t === "." && (r[e - 1] === "*" || r[e + 1] === "*") ? t : "\\" + t;
|
|
3458
|
+
}
|
|
3459
|
+
function wi(t) {
|
|
3460
|
+
var e = t.map(function(n) {
|
|
3461
|
+
return n.replace(bi, Ei).replace(gi, _i);
|
|
3462
|
+
}), r = e.length > 1 ? "(?:" + e.join("|") + ")" : e[0];
|
|
3463
|
+
return new RegExp("^" + r + "$");
|
|
3464
|
+
}
|
|
3465
|
+
var Ri = /* @__PURE__ */ function() {
|
|
3466
|
+
function t(r) {
|
|
3467
|
+
this.actions = r.actions || r.action, this.subject = r.subject, this.fields = !r.fields || r.fields.length === 0 ? void 0 : it(r.fields), Object.defineProperty(this, "_fieldsPattern", {
|
|
3468
|
+
writable: !0
|
|
3469
|
+
}), this.inverted = !!r.inverted, this.conditions = r.conditions, Object.defineProperty(this, "_matches", {
|
|
3470
|
+
writable: !0,
|
|
3471
|
+
value: this.conditions ? ui(this.conditions) : void 0
|
|
3472
|
+
}), this.reason = r.reason;
|
|
3473
|
+
}
|
|
3474
|
+
var e = t.prototype;
|
|
3475
|
+
return e.matches = function(n) {
|
|
3476
|
+
return this._matches ? typeof n == "string" ? !this.inverted : this._matches(n) : !0;
|
|
3477
|
+
}, e.isRelevantFor = function(n, s) {
|
|
3478
|
+
return this.fields ? s ? this.matchesField(s) : !this.inverted : !0;
|
|
3479
|
+
}, e.matchesField = function(n) {
|
|
3480
|
+
return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : wi(this.fields)), this._fieldsPattern === null || n.indexOf("*") !== -1 ? this.fields.indexOf(n) !== -1 : this._fieldsPattern.test(n);
|
|
3481
|
+
}, t;
|
|
3482
|
+
}(), re = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), sr = {
|
|
3483
|
+
crud: ["create", "read", "update", "delete"]
|
|
3484
|
+
};
|
|
3485
|
+
function ar(t, e) {
|
|
3486
|
+
return t === e || Array.isArray(e) && e.indexOf(t) !== -1;
|
|
3487
|
+
}
|
|
3488
|
+
var Ii = /* @__PURE__ */ function() {
|
|
3489
|
+
t.addAlias = function(n, s) {
|
|
3490
|
+
if (n === "manage" || ar("manage", s))
|
|
3491
|
+
throw new Error('Cannot add alias for "manage" action because it represents any action');
|
|
3492
|
+
if (ar(n, s))
|
|
3493
|
+
throw new Error("Attempt to alias action to itself: " + n + " -> " + s.toString());
|
|
3494
|
+
return sr[n] = s, this;
|
|
3495
|
+
};
|
|
3496
|
+
function t(r, n) {
|
|
3497
|
+
n === void 0 && (n = {}), Object.defineProperty(this, "subjectName", {
|
|
3498
|
+
value: n.subjectName || hi
|
|
3499
|
+
}), this[re] = {
|
|
3500
|
+
RuleType: n.RuleType || Ri,
|
|
3501
|
+
originalRules: r || [],
|
|
3502
|
+
hasPerFieldRules: !1,
|
|
3503
|
+
indexedRules: /* @__PURE__ */ Object.create(null),
|
|
3504
|
+
mergedRules: /* @__PURE__ */ Object.create(null),
|
|
3505
|
+
events: {},
|
|
3506
|
+
aliases: vi(sr)
|
|
3507
|
+
}, this.update(r);
|
|
3508
|
+
}
|
|
3509
|
+
var e = t.prototype;
|
|
3510
|
+
return e.update = function(n) {
|
|
3511
|
+
if (!Array.isArray(n))
|
|
3512
|
+
return this;
|
|
3513
|
+
var s = {
|
|
3514
|
+
rules: n,
|
|
3515
|
+
ability: this
|
|
3516
|
+
};
|
|
3517
|
+
this.emit("update", s), this[re].originalRules = n.slice(0), this[re].mergedRules = /* @__PURE__ */ Object.create(null);
|
|
3518
|
+
var o = this.buildIndexFor(n);
|
|
3519
|
+
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[re].indexedRules = o.rules, this[re].hasPerFieldRules = o.hasPerFieldRules, this.emit("updated", s), this;
|
|
3520
|
+
}, e.buildIndexFor = function(n) {
|
|
3521
|
+
for (var s = /* @__PURE__ */ Object.create(null), o = this[re].RuleType, i = !0, f = !1, d = 0; d < n.length; d++) {
|
|
3522
|
+
var u = new o(n[d]), b = this.expandActions(u.actions), g = it(u.subject), L = n.length - d - 1;
|
|
3523
|
+
i = !!(i && u.inverted), !f && u.fields && (f = !0);
|
|
3524
|
+
for (var c = 0; c < g.length; c++) {
|
|
3525
|
+
var y = g[c];
|
|
3526
|
+
s[y] = s[y] || /* @__PURE__ */ Object.create(null);
|
|
3527
|
+
for (var P = 0; P < b.length; P++) {
|
|
3528
|
+
var $ = b[P];
|
|
3529
|
+
s[y][$] = s[y][$] || /* @__PURE__ */ Object.create(null), s[y][$][L] = u;
|
|
3530
|
+
}
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
return {
|
|
3534
|
+
isAllInverted: i,
|
|
3535
|
+
hasPerFieldRules: f,
|
|
3536
|
+
rules: s
|
|
3537
|
+
};
|
|
3538
|
+
}, e.expandActions = function(n) {
|
|
3539
|
+
for (var s = this[re].aliases, o = it(n), i = 0; i < o.length; ) {
|
|
3540
|
+
var f = o[i++];
|
|
3541
|
+
s.hasOwnProperty(f) && (o = o.concat(s[f]));
|
|
3542
|
+
}
|
|
3543
|
+
return o;
|
|
3544
|
+
}, e.can = function(n, s, o) {
|
|
3545
|
+
if (o && typeof o != "string")
|
|
3546
|
+
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");
|
|
3547
|
+
var i = this.relevantRuleFor(n, s, o);
|
|
3548
|
+
return !!i && !i.inverted;
|
|
3549
|
+
}, e.relevantRuleFor = function(n, s, o) {
|
|
3550
|
+
for (var i = this.rulesFor(n, s, o), f = 0; f < i.length; f++)
|
|
3551
|
+
if (i[f].matches(s))
|
|
3552
|
+
return i[f];
|
|
3553
|
+
return null;
|
|
3554
|
+
}, e.possibleRulesFor = function(n, s) {
|
|
3555
|
+
var o = this.subjectName(s), i = this[re].mergedRules, f = o + "_" + n;
|
|
3556
|
+
return i[f] || (i[f] = this.mergeRulesFor(n, o)), i[f];
|
|
3557
|
+
}, e.mergeRulesFor = function(n, s) {
|
|
3558
|
+
var o = this[re].indexedRules, i = [s, "all"].reduce(function(f, d) {
|
|
3559
|
+
var u = o[d];
|
|
3560
|
+
return u ? Object.assign(f, u[n], u.manage) : f;
|
|
3561
|
+
}, []);
|
|
3562
|
+
return i.filter(Boolean);
|
|
3563
|
+
}, e.rulesFor = function(n, s, o) {
|
|
3564
|
+
var i = this.possibleRulesFor(n, s);
|
|
3565
|
+
return this[re].hasPerFieldRules ? i.filter(function(f) {
|
|
3566
|
+
return f.isRelevantFor(s, o);
|
|
3567
|
+
}) : i;
|
|
3568
|
+
}, e.cannot = function() {
|
|
3569
|
+
return !this.can.apply(this, arguments);
|
|
3570
|
+
}, e.throwUnlessCan = function() {
|
|
3571
|
+
var n;
|
|
3572
|
+
console.warn(`
|
|
3573
|
+
Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
|
|
3574
|
+
Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
|
|
3575
|
+
`.trim()), (n = pi.from(this)).throwUnlessCan.apply(n, arguments);
|
|
3576
|
+
}, e.on = function(n, s) {
|
|
3577
|
+
var o = this[re].events, i = !0;
|
|
3578
|
+
return o[n] || (o[n] = []), o[n].push(s), function() {
|
|
3579
|
+
if (i) {
|
|
3580
|
+
var f = o[n].indexOf(s);
|
|
3581
|
+
o[n].splice(f, 1), i = !1;
|
|
3582
|
+
}
|
|
3583
|
+
};
|
|
3584
|
+
}, e.emit = function(n, s) {
|
|
3585
|
+
var o = this[re].events[n];
|
|
3586
|
+
o && o.slice(0).forEach(function(i) {
|
|
3587
|
+
return i(s);
|
|
3588
|
+
});
|
|
3589
|
+
}, ci(t, [{
|
|
3590
|
+
key: "rules",
|
|
3591
|
+
get: function() {
|
|
3592
|
+
return this[re].originalRules;
|
|
3593
|
+
}
|
|
3594
|
+
}]), t;
|
|
3595
|
+
}(), _e;
|
|
3596
|
+
((t) => {
|
|
3597
|
+
((e) => {
|
|
3598
|
+
e[e.feedMe = 0] = "feedMe", e[e.business = 1] = "business", e[e.restaurant = 2] = "restaurant";
|
|
3599
|
+
})(t.Level || (t.Level = {})), ((e) => {
|
|
3600
|
+
e.manage = "manage", e.create = "create", e.read = "read", e.update = "update", e.delete = "delete";
|
|
3601
|
+
})(t.Action || (t.Action = {}));
|
|
3602
|
+
})(_e || (_e = {}));
|
|
3603
|
+
((t) => {
|
|
3604
|
+
((e) => {
|
|
3605
|
+
((r) => {
|
|
3606
|
+
r.all = "all", r.restaurant = "restaurant", r.business = "business", r.delivery = "delivery", r.agent = "agent";
|
|
3607
|
+
})(e.Feedme || (e.Feedme = {})), ((r) => {
|
|
3608
|
+
r.quota = "quota", r.owner = "owner";
|
|
3609
|
+
})(e.FeedmeBusinessField || (e.FeedmeBusinessField = {})), ((r) => {
|
|
3610
|
+
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";
|
|
3611
|
+
})(e.Business || (e.Business = {})), ((r) => {
|
|
3612
|
+
r.restaurant = "restaurant";
|
|
3613
|
+
})(e.Restaurant || (e.Restaurant = {}));
|
|
3614
|
+
})(t.Subject || (t.Subject = {}));
|
|
3615
|
+
})(_e || (_e = {}));
|
|
3616
|
+
function Ai(t, e) {
|
|
3617
|
+
const n = fe().sessionUser.value;
|
|
3618
|
+
if (!n)
|
|
3619
|
+
return;
|
|
3620
|
+
const { isAdmin: s } = n.role, o = n.permissions, i = e.filter((f) => f.businessId === t._id).length;
|
|
3621
|
+
return t.restaurantQuota > i && ((n == null ? void 0 : n.id) === t.ownerId || s) && new Ii(o).can(
|
|
3622
|
+
_e.Action.manage,
|
|
3623
|
+
_e.Subject.Feedme.all
|
|
3624
|
+
);
|
|
3625
|
+
}
|
|
3626
|
+
const Oi = { class: "fm-typo-cn-body-md-400 text-fm-color-typo-secondary xs:flex xs:flex-col" }, Si = { class: "flex flex-1" }, Pi = {
|
|
3627
|
+
key: 0,
|
|
3628
|
+
class: "flex gap-8"
|
|
3629
|
+
}, Ti = {
|
|
3630
|
+
key: 0,
|
|
3631
|
+
class: "space-y-4"
|
|
3632
|
+
}, Li = { class: "fm-typo-en-body-md-600" }, Ni = {
|
|
3633
|
+
key: 0,
|
|
3634
|
+
class: "space-y-8"
|
|
3635
|
+
}, Ci = { class: "flex justify-end" }, xi = { class: "flex-1 pb-64 overflow-auto divide-y divide-fm-color-neutral-gray-100" }, ki = { key: 0 }, Vi = ["onClick"], Fi = { class: "flex justify-between items-center" }, ji = { class: "fm-typo-en-body-lg-600" }, Mi = { class: "flex gap-8" }, Ui = { class: "text-fm-color-typo-secondary" }, Di = { class: "text-fm-color-typo-secondary" }, Gi = { class: "text-fm-color-typo-secondary" }, ol = /* @__PURE__ */ ee({
|
|
3636
|
+
__name: "Business",
|
|
3637
|
+
setup(t) {
|
|
3638
|
+
const { searchKey: e, filter: r } = ii(), { copyTextToClipboard: n } = lr(), s = ir(), o = X(() => s.breakpoints.value.xs), { t: i } = pe(), f = X(() => {
|
|
3639
|
+
const { currentBusiness: y, restaurants: P } = fe(), $ = y.value;
|
|
3640
|
+
if (!$)
|
|
3641
|
+
return null;
|
|
3642
|
+
const { id: C, name: x, thumbnail: A, url: j } = $, W = P.value.filter((U) => U.managable).map((U) => {
|
|
3643
|
+
var p;
|
|
3644
|
+
const { _id: Y, profile: a } = U, { name: l, email: v, phoneNo: R, address: S, sstRegNo: m } = {
|
|
3645
|
+
...a,
|
|
3646
|
+
address: Ie(a.address)
|
|
3647
|
+
};
|
|
3648
|
+
return {
|
|
3649
|
+
id: Y,
|
|
3650
|
+
code: ((p = U.profile) == null ? void 0 : p.code) || "--",
|
|
3651
|
+
name: l,
|
|
3652
|
+
email: v,
|
|
3653
|
+
phone: R,
|
|
3654
|
+
address: S.formatted,
|
|
3655
|
+
withSST: !!m,
|
|
3656
|
+
doc: U
|
|
3657
|
+
};
|
|
3658
|
+
});
|
|
3659
|
+
return {
|
|
3660
|
+
id: C,
|
|
3661
|
+
name: x,
|
|
3662
|
+
thumbnail: A,
|
|
3663
|
+
url: `https://feedmedev.cc/${j || C}`,
|
|
3664
|
+
doc: $,
|
|
3665
|
+
canCreateRestaurant: Ai($, P.value),
|
|
3666
|
+
restaurants: W.filter(
|
|
3667
|
+
({ code: U, name: Y, address: a, phone: l, email: v }) => r([U, Y, a, l, v])
|
|
3668
|
+
)
|
|
3669
|
+
};
|
|
3670
|
+
}), d = X(() => [
|
|
3671
|
+
{
|
|
3672
|
+
header: i("settings.business.restaurant.code"),
|
|
3673
|
+
accessorKey: "code",
|
|
3674
|
+
enableSorting: !1
|
|
3675
|
+
},
|
|
3676
|
+
{
|
|
3677
|
+
header: i("settings.business.restaurant.title"),
|
|
3678
|
+
accessorKey: "name",
|
|
3679
|
+
enableSorting: !1
|
|
3680
|
+
},
|
|
3681
|
+
{
|
|
3682
|
+
header: i("settings.business.restaurant.address"),
|
|
3683
|
+
accessorKey: "address",
|
|
3684
|
+
size: 200,
|
|
3685
|
+
enableSorting: !1
|
|
3686
|
+
},
|
|
3687
|
+
{
|
|
3688
|
+
header: i("settings.business.restaurant.contact"),
|
|
3689
|
+
accessorKey: "phone",
|
|
3690
|
+
enableSorting: !1
|
|
3691
|
+
},
|
|
3692
|
+
{
|
|
3693
|
+
header: i("settings.business.restaurant.email"),
|
|
3694
|
+
accessorKey: "email",
|
|
3695
|
+
enableSorting: !1
|
|
3696
|
+
},
|
|
3697
|
+
{
|
|
3698
|
+
header: i("settings.business.restaurant.tax.title"),
|
|
3699
|
+
enableSorting: !1,
|
|
3700
|
+
cell: (y) => {
|
|
3701
|
+
var $;
|
|
3702
|
+
const P = y.row.original;
|
|
3703
|
+
return ($ = P.doc.profile.sstRegNo) != null && $.length ? P.doc.profile.sstRegNo : i("settings.business.restaurant.tax.not_set");
|
|
3704
|
+
}
|
|
3705
|
+
},
|
|
3706
|
+
{
|
|
3707
|
+
id: "action",
|
|
3708
|
+
header: "",
|
|
3709
|
+
size: 80,
|
|
3710
|
+
cell: (y) => {
|
|
3711
|
+
const P = y.row.original;
|
|
3712
|
+
return Br([
|
|
3713
|
+
{
|
|
3714
|
+
name: "edit",
|
|
3715
|
+
onClick: () => c(P)
|
|
3716
|
+
},
|
|
3717
|
+
{
|
|
3718
|
+
name: "file_copy",
|
|
3719
|
+
onClick: () => {
|
|
3720
|
+
n(P.id);
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
]);
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3726
|
+
]);
|
|
3727
|
+
function u() {
|
|
3728
|
+
var y;
|
|
3729
|
+
n(((y = f.value) == null ? void 0 : y.url) || "");
|
|
3730
|
+
}
|
|
3731
|
+
function b() {
|
|
3732
|
+
if (!f.value)
|
|
3733
|
+
return;
|
|
3734
|
+
const { name: y, url: P, thumbnail: $ } = f.value.doc;
|
|
3735
|
+
Ke(g, hn, {
|
|
3736
|
+
businessId: f.value.id,
|
|
3737
|
+
initialValue: {
|
|
3738
|
+
name: y,
|
|
3739
|
+
url: P,
|
|
3740
|
+
thumbnail: $
|
|
3741
|
+
}
|
|
3742
|
+
});
|
|
3743
|
+
}
|
|
3744
|
+
const g = Vr();
|
|
3745
|
+
function L() {
|
|
3746
|
+
Ke(g, tr, {
|
|
3747
|
+
enableFeedmeExpress: !1
|
|
3748
|
+
});
|
|
3749
|
+
}
|
|
3750
|
+
function c(y) {
|
|
3751
|
+
var P;
|
|
3752
|
+
Ke(g, tr, {
|
|
3753
|
+
restaurantId: y.id,
|
|
3754
|
+
restaurant: y.doc,
|
|
3755
|
+
enableFeedmeExpress: ((P = y.doc.feedmeDelivery) == null ? void 0 : P.enable) || !1
|
|
3756
|
+
});
|
|
3757
|
+
}
|
|
3758
|
+
return (y, P) => {
|
|
3759
|
+
var J;
|
|
3760
|
+
const $ = z("FmSpacer"), C = z("FmButton"), x = z("FmTooltip"), A = z("FmSearch"), j = z("FmTable"), W = z("FmCircularProgress");
|
|
3761
|
+
return F(), Q(Gr, {
|
|
3762
|
+
heading: ((J = f.value) == null ? void 0 : J.name) || "--"
|
|
3763
|
+
}, {
|
|
3764
|
+
"sub-heading": q(() => {
|
|
3765
|
+
var U;
|
|
3766
|
+
return [
|
|
3767
|
+
_("div", Oi, [
|
|
3768
|
+
_("span", null, D(E(i)("settings.business.url")) + ": ", 1),
|
|
3769
|
+
_("span", {
|
|
3770
|
+
class: "cursor-pointer xs:w-max-[200px] truncate",
|
|
3771
|
+
onClick: u
|
|
3772
|
+
}, D((U = f.value) == null ? void 0 : U.url), 1)
|
|
3773
|
+
])
|
|
3774
|
+
];
|
|
3775
|
+
}),
|
|
3776
|
+
"append-heading": q(() => [
|
|
3777
|
+
_("div", Si, [
|
|
3778
|
+
T($),
|
|
3779
|
+
o.value ? (F(), B(se, { key: 1 }, [
|
|
3780
|
+
T(Dr, {
|
|
3781
|
+
onClick: L,
|
|
3782
|
+
label: E(i)("settings.business.add_restaurant"),
|
|
3783
|
+
"prepend-icon": "add"
|
|
3784
|
+
}, null, 8, ["label"]),
|
|
3785
|
+
T(en, null, {
|
|
3786
|
+
default: q(() => [
|
|
3787
|
+
T(rn, {
|
|
3788
|
+
label: E(i)("common.edit"),
|
|
3789
|
+
onClick: b
|
|
3790
|
+
}, null, 8, ["label"])
|
|
3791
|
+
]),
|
|
3792
|
+
_: 1
|
|
3793
|
+
})
|
|
3794
|
+
], 64)) : (F(), B("div", Pi, [
|
|
3795
|
+
T(C, {
|
|
3796
|
+
onClick: b,
|
|
3797
|
+
variant: "secondary",
|
|
3798
|
+
label: E(i)("common.edit")
|
|
3799
|
+
}, null, 8, ["label"]),
|
|
3800
|
+
T(x, {
|
|
3801
|
+
variant: "rich",
|
|
3802
|
+
placement: "left",
|
|
3803
|
+
"z-index": 100
|
|
3804
|
+
}, {
|
|
3805
|
+
content: q(() => {
|
|
3806
|
+
var U;
|
|
3807
|
+
return [
|
|
3808
|
+
(U = f.value) != null && U.canCreateRestaurant ? le("", !0) : (F(), B("div", Ti, [
|
|
3809
|
+
_("p", Li, D(E(i)("settings.business.quota.limit_title")), 1),
|
|
3810
|
+
_("p", null, D(E(i)("settings.business.quota.limit_message")), 1)
|
|
3811
|
+
]))
|
|
3812
|
+
];
|
|
3813
|
+
}),
|
|
3814
|
+
default: q(() => {
|
|
3815
|
+
var U;
|
|
3816
|
+
return [
|
|
3817
|
+
T(C, {
|
|
3818
|
+
onClick: L,
|
|
3819
|
+
label: E(i)("settings.business.add_restaurant"),
|
|
3820
|
+
disabled: !((U = f.value) != null && U.canCreateRestaurant),
|
|
3821
|
+
"prepend-icon": "add"
|
|
3822
|
+
}, null, 8, ["label", "disabled"])
|
|
3823
|
+
];
|
|
3824
|
+
}),
|
|
3825
|
+
_: 1
|
|
3826
|
+
})
|
|
3827
|
+
]))
|
|
3828
|
+
])
|
|
3829
|
+
]),
|
|
3830
|
+
default: q(() => {
|
|
3831
|
+
var U, Y;
|
|
3832
|
+
return [
|
|
3833
|
+
o.value ? (F(), B(se, { key: 1 }, [
|
|
3834
|
+
T(A, {
|
|
3835
|
+
class: "my-8 mx-16",
|
|
3836
|
+
modelValue: E(e),
|
|
3837
|
+
"onUpdate:modelValue": P[2] || (P[2] = (a) => Rt(e) ? e.value = a : null),
|
|
3838
|
+
placeholder: E(i)("settings.business.search_restaurants")
|
|
3839
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
3840
|
+
_("div", xi, [
|
|
3841
|
+
f.value ? (F(!0), B(se, { key: 1 }, me((Y = f.value) == null ? void 0 : Y.restaurants, (a) => {
|
|
3842
|
+
var l;
|
|
3843
|
+
return F(), B("div", {
|
|
3844
|
+
key: a.id,
|
|
3845
|
+
class: "py-12 px-16 space-y-4",
|
|
3846
|
+
onClick: (v) => c(a)
|
|
3847
|
+
}, [
|
|
3848
|
+
_("div", Fi, [
|
|
3849
|
+
_("div", ji, D(a.name), 1),
|
|
3850
|
+
_("div", Mi, [
|
|
3851
|
+
T(C, {
|
|
3852
|
+
icon: "edit",
|
|
3853
|
+
"text-color": "neutral-gray-400",
|
|
3854
|
+
variant: "tertiary",
|
|
3855
|
+
onClick: rt((v) => c(a), ["stop"])
|
|
3856
|
+
}, null, 8, ["onClick"]),
|
|
3857
|
+
T(C, {
|
|
3858
|
+
icon: "file_copy",
|
|
3859
|
+
"text-color": "neutral-gray-400",
|
|
3860
|
+
variant: "tertiary",
|
|
3861
|
+
onClick: rt((v) => E(n)(a.id), ["stop"])
|
|
3862
|
+
}, null, 8, ["onClick"])
|
|
3863
|
+
])
|
|
3864
|
+
]),
|
|
3865
|
+
_("div", Ui, D(E(i)("settings.business.restaurant.contact")) + ": " + D(a.phone), 1),
|
|
3866
|
+
_("div", Di, D(E(i)("settings.business.restaurant.email")) + ": " + D(a.email), 1),
|
|
3867
|
+
_("div", Gi, D(E(i)("settings.business.restaurant.tax.title")) + ": " + D((l = a.doc.profile.sstRegNo) != null && l.length ? a.doc.profile.sstRegNo : E(i)("settings.business.restaurant.tax.not_set")), 1)
|
|
3868
|
+
], 8, Vi);
|
|
3869
|
+
}), 128)) : (F(), B("div", ki, [
|
|
3870
|
+
T(W, { size: "lg" })
|
|
3871
|
+
]))
|
|
3872
|
+
])
|
|
3873
|
+
], 64)) : (F(), B("div", Ni, [
|
|
3874
|
+
_("div", Ci, [
|
|
3875
|
+
T(A, {
|
|
3876
|
+
class: "w-[320px]",
|
|
3877
|
+
modelValue: E(e),
|
|
3878
|
+
"onUpdate:modelValue": P[0] || (P[0] = (a) => Rt(e) ? e.value = a : null),
|
|
3879
|
+
placeholder: E(i)("settings.business.search_restaurants")
|
|
3880
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
3881
|
+
]),
|
|
3882
|
+
T(j, {
|
|
3883
|
+
"column-defs": d.value,
|
|
3884
|
+
"row-data": ((U = f.value) == null ? void 0 : U.restaurants) || [],
|
|
3885
|
+
"shrink-at": !1,
|
|
3886
|
+
loading: !f.value,
|
|
3887
|
+
onRowClick: P[1] || (P[1] = (a) => c(a.original))
|
|
3888
|
+
}, null, 8, ["column-defs", "row-data", "loading"])
|
|
3889
|
+
]))
|
|
3890
|
+
];
|
|
3891
|
+
}),
|
|
3892
|
+
_: 1
|
|
3893
|
+
}, 8, ["heading"]);
|
|
3894
|
+
};
|
|
3895
|
+
}
|
|
3896
|
+
});
|
|
3897
|
+
export {
|
|
3898
|
+
ol as default
|
|
3899
|
+
};
|