@oneclick.dev/cms-core-modules 0.0.53 → 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/CalendarDate-CRT2Viyt.mjs +830 -0
- package/dist/CalendarDate-CWtpXgpD.js +1 -0
- package/dist/Components-D9yIIosM.mjs +623 -0
- package/dist/Components-DXbx0RLV.js +1 -0
- package/dist/ContentEditor-DRJFQKCv.mjs +34915 -0
- package/dist/ContentEditor-DzTi8fSZ.js +290 -0
- package/dist/Create-BP8TX6rj.js +1 -0
- package/dist/Create-Bwf1RXdG.mjs +1248 -0
- package/dist/DateFormatter-BbcSwTs4.js +1 -0
- package/dist/DateFormatter-CbO0PVUK.mjs +99 -0
- package/dist/Detail-B-PnkcXD.mjs +3473 -0
- package/dist/Detail-BVlGSjOq.mjs +380 -0
- package/dist/Detail-C4E1T87K.mjs +26 -0
- package/dist/Detail-CNfTDUE5.js +1 -0
- package/dist/Detail-Cd5CBVN0.js +1 -0
- package/dist/Detail-CpfOQChd.mjs +585 -0
- package/dist/Detail-CwagT6gQ.mjs +650 -0
- package/dist/Detail-DUo6qKqO.js +1 -0
- package/dist/Detail-Dd_OkpcN.js +1 -0
- package/dist/Detail-mvSGbnFU.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +55 -0
- package/dist/Entries-DcpPvlYj.js +1 -0
- package/dist/Entries-QLMtTYLX.mjs +713 -0
- package/dist/Find-BPR0uU-Z.mjs +229 -0
- package/dist/Find-BidEQJxT.js +1 -0
- package/dist/GlobalStyling-CMzPRd18.js +17 -0
- package/dist/GlobalStyling-DoLHUJeV.mjs +988 -0
- package/dist/Overview-BDlBCUI_.js +1 -0
- package/dist/Overview-BH3NwvNX.mjs +26 -0
- package/dist/Overview-BLsZMHNW.mjs +178 -0
- package/dist/Overview-BNMZ9MUK.js +1 -0
- package/dist/Overview-BbvfH1u-.js +1 -0
- package/dist/Overview-CDN88OSM.mjs +190 -0
- package/dist/Overview-CEPodGCn.mjs +311 -0
- package/dist/Overview-CvquDPhB.js +1 -0
- package/dist/Overview-D54pjmI6.mjs +633 -0
- package/dist/Overview-D67UjG6n.mjs +947 -0
- package/dist/Overview-KT2Mgfh5.js +1 -0
- package/dist/Overview-T-lsy3UZ.js +1 -0
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +1 -0
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +392 -0
- package/dist/TableView-CpO53xcX.js +111 -0
- package/dist/TableView-D9J5rUls.mjs +72921 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs +40 -0
- package/dist/View-DlHBZbFu.js +1 -0
- package/dist/View-Dv5QMrSn.mjs +25 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/agenda-B49oKGeh.mjs +706 -0
- package/dist/agenda-DipQ5IWP.js +1 -0
- package/dist/availability-C7q9tq6l.js +1 -0
- package/dist/availability-DeCkqiu8.mjs +613 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/countries-BTPvmrsb.mjs +4 -0
- package/dist/countries-CgZ081No.js +1 -0
- package/dist/exceptions-D3b18TiY.mjs +647 -0
- package/dist/exceptions-DJ9zWX3k.js +1 -0
- package/dist/floating-ui.dom-C82nbomj.js +1 -0
- package/dist/floating-ui.dom-ouSgPqty.mjs +1133 -0
- package/dist/google-CvtuJwgk.mjs +4 -0
- package/dist/google-D4N3gb01.js +1 -0
- package/dist/index--jjEzba7.mjs +24 -0
- package/dist/index-9HVlmvK3.js +1 -0
- package/dist/index-BEGU8Kme.mjs +12 -0
- package/dist/index-Bwi1mtkq.mjs +24 -0
- package/dist/index-BzuHN-r8.mjs +24 -0
- package/dist/index-CImCyE3L.mjs +24 -0
- package/dist/index-CKPshlZ8-BQiiP6r_.mjs +1264 -0
- package/dist/index-CKPshlZ8-CIz1tDwX.js +1 -0
- package/dist/index-CQiY-oTN.mjs +24 -0
- package/dist/index-CSxYBeVA.js +1 -0
- package/dist/index-CkiNvRzs.js +1 -0
- package/dist/index-Co4ON2Di.js +1 -0
- package/dist/index-CwqrAU-H.js +1 -0
- package/dist/index-Cz-baGax.js +1 -0
- package/dist/index-D2a6wEPh.js +1 -0
- package/dist/index-DFQGVHTs.js +1 -0
- package/dist/index-DI6mydpm.mjs +138 -0
- package/dist/index-DMoyoaks.mjs +22 -0
- package/dist/index-DT1wWnUk.mjs +24 -0
- package/dist/index-DUeFrD-B.js +1 -0
- package/dist/index-DsnoK4ia.mjs +579 -0
- package/dist/index-R2oUDsjx.js +1 -0
- package/dist/index-RLz1QPrf.mjs +203 -0
- package/dist/index-UtjLbLw-.js +1 -0
- package/dist/index-_mG-aU3Z.mjs +87 -0
- package/dist/index-_sQDF1pH.js +1 -0
- package/dist/index-ijdf0d9-.js +1 -0
- package/dist/index-klI238nT.mjs +24 -0
- package/dist/index.cjs.js +1 -330
- package/dist/index.mjs +287 -69051
- package/dist/interpolation-BNUjI7LH.js +1 -0
- package/dist/interpolation-BpGXqOz8.mjs +59 -0
- package/dist/payment-kTjsV0Jj.js +1 -0
- package/dist/payment-zpCM0LD-.mjs +981 -0
- package/dist/regular-C4_3YXqx.mjs +602 -0
- package/dist/regular-DFwPEbZO.js +1 -0
- package/dist/regular-slots-4ooEpICB.mjs +67 -0
- package/dist/regular-slots-BAVGbomI.js +1 -0
- package/dist/resources-MpQkSstv.mjs +563 -0
- package/dist/resources-iM28T3dD.js +1 -0
- package/dist/src/appointments/index.d.ts +4 -28
- package/dist/src/appointments/routes.d.ts +3 -9
- package/dist/src/content-manager/index.d.ts +5 -147
- package/dist/src/content-manager/routes.d.ts +4 -128
- package/dist/src/custom/index.d.ts +2 -2
- package/dist/src/custom/routes.d.ts +1 -1
- package/dist/src/mail-templates/index.d.ts +2 -30
- package/dist/src/mail-templates/routes.d.ts +1 -11
- package/dist/src/product-collections/index.d.ts +2 -30
- package/dist/src/product-collections/routes.d.ts +1 -11
- package/dist/src/products/index.d.ts +2 -30
- package/dist/src/products/routes.d.ts +1 -11
- package/dist/src/promo-codes/index.d.ts +2 -30
- package/dist/src/promo-codes/routes.d.ts +1 -11
- package/dist/src/shipping-options/index.d.ts +2 -30
- package/dist/src/shipping-options/routes.d.ts +1 -11
- package/dist/src/table/index.d.ts +2 -70
- package/dist/src/table/routes.d.ts +1 -51
- package/dist/utils-BVKy9S2J.mjs +29 -0
- package/dist/utils-D6CaKJbp.js +2 -0
- package/dist/vee-validate-zod-BPQyEfpF.js +1 -0
- package/dist/vee-validate-zod-IXkfh-6Q.mjs +4402 -0
- package/package.json +3 -3
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import { defineComponent as D, inject as H, resolveComponent as m, createElementBlock as r, openBlock as a, createElementVNode as o, createVNode as e, withCtx as s, createTextVNode as d, createCommentVNode as w, ref as T, Fragment as A, renderList as R, unref as y, toDisplayString as k, withModifiers as Z, normalizeClass as $, useTemplateRef as ee, nextTick as te, reactive as ne, provide as oe, createBlock as Y, normalizeStyle as se } from "vue";
|
|
2
|
+
import { _ as le } from "./EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs";
|
|
3
|
+
import { DollarSign as de, Pencil as ie, Trash2 as F, PlusCircle as G, Users as K, ChevronDown as ae } from "lucide-vue-next";
|
|
4
|
+
import { useConfirmation as re, useModuleRoute as ue, useModule as me, useFirebaseIntegration as ce } from "@oneclick.dev/cms-kit";
|
|
5
|
+
import { t as pe } from "./index-RLz1QPrf.mjs";
|
|
6
|
+
const fe = { class: "flex gap-3 items-start p-4 border rounded-lg" }, ge = { class: "flex-1 space-y-3" }, ve = { class: "grid grid-cols-2 gap-3" }, xe = { class: "flex items-center space-x-2 my-4" }, ye = { class: "grid grid-cols-2 gap-2" }, be = { key: 0 }, _e = { key: 1 }, ke = { key: 2 }, Ve = { key: 3 }, Oe = { key: 4 }, Ce = { key: 0 }, Se = /* @__PURE__ */ D({
|
|
7
|
+
__name: "Addon",
|
|
8
|
+
props: {
|
|
9
|
+
addOn: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: !0
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(c) {
|
|
15
|
+
const V = H("form"), O = (b) => {
|
|
16
|
+
V.addOns = V.addOns.filter((n) => n.id !== b);
|
|
17
|
+
};
|
|
18
|
+
return (b, n) => {
|
|
19
|
+
const p = m("Label"), x = m("Input"), C = m("Checkbox"), S = m("SelectTrigger"), g = m("SelectItem"), h = m("SelectGroup"), M = m("SelectContent"), L = m("Select"), B = m("Trash2"), z = m("Button");
|
|
20
|
+
return a(), r("div", fe, [
|
|
21
|
+
o("div", ge, [
|
|
22
|
+
o("div", ve, [
|
|
23
|
+
o("div", null, [
|
|
24
|
+
e(p, { class: "text-xs mb-1 block" }, {
|
|
25
|
+
default: s(() => [...n[7] || (n[7] = [
|
|
26
|
+
d("Add-on Name", -1)
|
|
27
|
+
])]),
|
|
28
|
+
_: 1
|
|
29
|
+
}),
|
|
30
|
+
e(x, {
|
|
31
|
+
modelValue: c.addOn.name,
|
|
32
|
+
"onUpdate:modelValue": n[0] || (n[0] = (v) => c.addOn.name = v),
|
|
33
|
+
placeholder: "e.g., Swimsuit Rental, Towel Service"
|
|
34
|
+
}, null, 8, ["modelValue"])
|
|
35
|
+
]),
|
|
36
|
+
o("div", null, [
|
|
37
|
+
e(p, { class: "text-xs mb-1 block" }, {
|
|
38
|
+
default: s(() => [...n[8] || (n[8] = [
|
|
39
|
+
d("Price", -1)
|
|
40
|
+
])]),
|
|
41
|
+
_: 1
|
|
42
|
+
}),
|
|
43
|
+
e(x, {
|
|
44
|
+
modelValue: c.addOn.price,
|
|
45
|
+
"onUpdate:modelValue": n[1] || (n[1] = (v) => c.addOn.price = v),
|
|
46
|
+
modelModifiers: { number: !0 },
|
|
47
|
+
type: "number",
|
|
48
|
+
min: "0",
|
|
49
|
+
step: "0.01",
|
|
50
|
+
placeholder: "0.00",
|
|
51
|
+
class: "no-spinner"
|
|
52
|
+
}, null, 8, ["modelValue"])
|
|
53
|
+
])
|
|
54
|
+
]),
|
|
55
|
+
o("div", null, [
|
|
56
|
+
e(p, { class: "text-xs mb-1 block" }, {
|
|
57
|
+
default: s(() => [...n[9] || (n[9] = [
|
|
58
|
+
d("Description (Optional)", -1)
|
|
59
|
+
])]),
|
|
60
|
+
_: 1
|
|
61
|
+
}),
|
|
62
|
+
e(x, {
|
|
63
|
+
modelValue: c.addOn.description,
|
|
64
|
+
"onUpdate:modelValue": n[2] || (n[2] = (v) => c.addOn.description = v),
|
|
65
|
+
placeholder: "Brief description of this add-on"
|
|
66
|
+
}, null, 8, ["modelValue"])
|
|
67
|
+
]),
|
|
68
|
+
o("div", xe, [
|
|
69
|
+
e(C, {
|
|
70
|
+
id: `required-${c.addOn.id}`,
|
|
71
|
+
modelValue: c.addOn.required,
|
|
72
|
+
"onUpdate:modelValue": n[3] || (n[3] = (v) => c.addOn.required = v)
|
|
73
|
+
}, null, 8, ["id", "modelValue"]),
|
|
74
|
+
e(p, {
|
|
75
|
+
for: `required-${c.addOn.id}`,
|
|
76
|
+
class: "text-xs font-normal cursor-pointer"
|
|
77
|
+
}, {
|
|
78
|
+
default: s(() => [...n[10] || (n[10] = [
|
|
79
|
+
d(" Required (customer must select this add-on) ", -1)
|
|
80
|
+
])]),
|
|
81
|
+
_: 1
|
|
82
|
+
}, 8, ["for"])
|
|
83
|
+
]),
|
|
84
|
+
o("div", ye, [
|
|
85
|
+
o("div", null, [
|
|
86
|
+
e(p, { class: "text-xs mb-1 block" }, {
|
|
87
|
+
default: s(() => [...n[11] || (n[11] = [
|
|
88
|
+
d("Quantity limit", -1)
|
|
89
|
+
])]),
|
|
90
|
+
_: 1
|
|
91
|
+
}),
|
|
92
|
+
e(L, {
|
|
93
|
+
modelValue: c.addOn.scope,
|
|
94
|
+
"onUpdate:modelValue": n[4] || (n[4] = (v) => c.addOn.scope = v)
|
|
95
|
+
}, {
|
|
96
|
+
default: s(() => [
|
|
97
|
+
e(S, { class: "w-full" }, {
|
|
98
|
+
default: s(() => [
|
|
99
|
+
c.addOn.scope === "RESERVATION" ? (a(), r("span", be, "Once per reservation")) : c.addOn.scope === "TICKET" ? (a(), r("span", _e, "Once per ticket / person")) : c.addOn.scope === "UNLIMITED" ? (a(), r("span", ke, "Unlimited")) : c.addOn.scope === "CUSTOM_LIMIT" ? (a(), r("span", Ve, "Custom limit...")) : (a(), r("span", Oe, "Select a limit…"))
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
}),
|
|
103
|
+
e(M, null, {
|
|
104
|
+
default: s(() => [
|
|
105
|
+
e(h, { class: "max-w-96" }, {
|
|
106
|
+
default: s(() => [
|
|
107
|
+
e(g, { value: "RESERVATION" }, {
|
|
108
|
+
default: s(() => [...n[12] || (n[12] = [
|
|
109
|
+
o("div", { class: "flex flex-col" }, [
|
|
110
|
+
o("p", { class: "text-sm font-bold mb-1" }, "Once per reservation"),
|
|
111
|
+
o("p", { class: "text-xs" }, "Max 1 per reservation line (charged per reservation).")
|
|
112
|
+
], -1)
|
|
113
|
+
])]),
|
|
114
|
+
_: 1
|
|
115
|
+
}),
|
|
116
|
+
e(g, { value: "TICKET" }, {
|
|
117
|
+
default: s(() => [...n[13] || (n[13] = [
|
|
118
|
+
o("div", { class: "flex flex-col" }, [
|
|
119
|
+
o("p", { class: "text-sm font-bold mb-1" }, "Once per ticket / person"),
|
|
120
|
+
o("p", { class: "text-xs" }, "Max 1 per ticket/person (charged per quantity).")
|
|
121
|
+
], -1)
|
|
122
|
+
])]),
|
|
123
|
+
_: 1
|
|
124
|
+
}),
|
|
125
|
+
e(g, { value: "UNLIMITED" }, {
|
|
126
|
+
default: s(() => [...n[14] || (n[14] = [
|
|
127
|
+
o("div", { class: "flex flex-col" }, [
|
|
128
|
+
o("p", { class: "text-sm font-bold mb-1" }, "Unlimited"),
|
|
129
|
+
o("p", { class: "text-xs" }, "No limit (can be added multiple times).")
|
|
130
|
+
], -1)
|
|
131
|
+
])]),
|
|
132
|
+
_: 1
|
|
133
|
+
}),
|
|
134
|
+
e(g, { value: "CUSTOM_LIMIT" }, {
|
|
135
|
+
default: s(() => [...n[15] || (n[15] = [
|
|
136
|
+
o("div", { class: "flex flex-col" }, [
|
|
137
|
+
o("p", { class: "text-sm font-bold mb-1" }, "Custom limit..."),
|
|
138
|
+
o("p", { class: "text-xs" }, "Set a fixed max amount (e.g. 2, 5, 10).")
|
|
139
|
+
], -1)
|
|
140
|
+
])]),
|
|
141
|
+
_: 1
|
|
142
|
+
})
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
})
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
})
|
|
149
|
+
]),
|
|
150
|
+
_: 1
|
|
151
|
+
}, 8, ["modelValue"])
|
|
152
|
+
]),
|
|
153
|
+
c.addOn.scope === "CUSTOM_LIMIT" ? (a(), r("div", Ce, [
|
|
154
|
+
e(p, { class: "text-xs mb-1 block" }, {
|
|
155
|
+
default: s(() => [...n[16] || (n[16] = [
|
|
156
|
+
d("Fixed limit", -1)
|
|
157
|
+
])]),
|
|
158
|
+
_: 1
|
|
159
|
+
}),
|
|
160
|
+
e(x, {
|
|
161
|
+
modelValue: c.addOn.limit,
|
|
162
|
+
"onUpdate:modelValue": n[5] || (n[5] = (v) => c.addOn.limit = v),
|
|
163
|
+
modelModifiers: { number: !0 },
|
|
164
|
+
type: "number",
|
|
165
|
+
min: "1",
|
|
166
|
+
step: "1",
|
|
167
|
+
placeholder: "1",
|
|
168
|
+
class: "no-spinner"
|
|
169
|
+
}, null, 8, ["modelValue"])
|
|
170
|
+
])) : w("", !0)
|
|
171
|
+
])
|
|
172
|
+
]),
|
|
173
|
+
e(z, {
|
|
174
|
+
onClick: n[6] || (n[6] = (v) => O(c.addOn.id)),
|
|
175
|
+
variant: "ghost",
|
|
176
|
+
size: "icon",
|
|
177
|
+
class: "mt-6"
|
|
178
|
+
}, {
|
|
179
|
+
default: s(() => [
|
|
180
|
+
e(B, { class: "w-4 h-4 text-destructive" })
|
|
181
|
+
]),
|
|
182
|
+
_: 1
|
|
183
|
+
})
|
|
184
|
+
]);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}), we = { class: "grid gap-2" }, Ie = ["id"], Pe = ["onClick"], Ae = { class: "flex items-center gap-2" }, he = { class: "flex items-center gap-1" }, Ue = { class: "overflow-hidden" }, Te = /* @__PURE__ */ D({
|
|
188
|
+
__name: "AddonList",
|
|
189
|
+
setup(c, { expose: V }) {
|
|
190
|
+
const { confirm: O } = re(), b = H("form"), n = T([]), p = async (x) => {
|
|
191
|
+
if (!await O("Are you sure you want to remove this add-on?")) return;
|
|
192
|
+
b.addOns = b.addOns.filter((g) => g.id !== x);
|
|
193
|
+
const S = n.value.indexOf(x);
|
|
194
|
+
S !== -1 && n.value.splice(S, 1), pe("Success!", {
|
|
195
|
+
description: "Add-on removed successfully."
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
return V({
|
|
199
|
+
openAddons: n
|
|
200
|
+
}), (x, C) => {
|
|
201
|
+
const S = m("Button");
|
|
202
|
+
return a(), r("div", we, [
|
|
203
|
+
(a(!0), r(A, null, R(y(b).addOns, (g) => (a(), r("div", {
|
|
204
|
+
key: g.id,
|
|
205
|
+
class: "border p-2 rounded",
|
|
206
|
+
id: `addon-${g.id}`
|
|
207
|
+
}, [
|
|
208
|
+
o("div", {
|
|
209
|
+
onClick: (h) => n.value.includes(g.id) ? n.value.splice(n.value.indexOf(g.id), 1) : n.value.push(g.id),
|
|
210
|
+
class: "cursor-pointer font-bold text-muted-foreground flex items-center justify-between gap-2 select-none"
|
|
211
|
+
}, [
|
|
212
|
+
o("span", Ae, [
|
|
213
|
+
e(y(de), { class: "size-4" }),
|
|
214
|
+
d(" " + k(g.name || "Untitled Add-on"), 1)
|
|
215
|
+
]),
|
|
216
|
+
o("div", he, [
|
|
217
|
+
e(S, {
|
|
218
|
+
variant: "ghost",
|
|
219
|
+
size: "icon"
|
|
220
|
+
}, {
|
|
221
|
+
default: s(() => [
|
|
222
|
+
e(y(ie), { class: "size-4" })
|
|
223
|
+
]),
|
|
224
|
+
_: 1
|
|
225
|
+
}),
|
|
226
|
+
e(S, {
|
|
227
|
+
variant: "ghost",
|
|
228
|
+
size: "icon",
|
|
229
|
+
onClick: Z((h) => p(g.id), ["stop"])
|
|
230
|
+
}, {
|
|
231
|
+
default: s(() => [
|
|
232
|
+
e(y(F), { class: "size-4 text-red-500" })
|
|
233
|
+
]),
|
|
234
|
+
_: 1
|
|
235
|
+
}, 8, ["onClick"])
|
|
236
|
+
])
|
|
237
|
+
], 8, Pe),
|
|
238
|
+
o("div", {
|
|
239
|
+
class: $(["grid", `${n.value.includes(g.id) ? "grid-rows-[1fr]" : "grid-rows-[0fr]"} transition-all duration-300 ease-in-out overflow-hidden`])
|
|
240
|
+
}, [
|
|
241
|
+
o("div", Ue, [
|
|
242
|
+
e(Se, { addOn: g }, null, 8, ["addOn"])
|
|
243
|
+
])
|
|
244
|
+
], 2)
|
|
245
|
+
], 8, Ie))), 128))
|
|
246
|
+
]);
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
}), Re = { class: "flex items-center justify-between mb-4" }, $e = { class: "space-y-3" }, De = {
|
|
250
|
+
key: 0,
|
|
251
|
+
class: "text-center py-8 text-muted-foreground text-sm border rounded-lg"
|
|
252
|
+
}, Me = /* @__PURE__ */ D({
|
|
253
|
+
__name: "index",
|
|
254
|
+
setup(c) {
|
|
255
|
+
const V = H("form"), O = ee("addonList"), b = async () => {
|
|
256
|
+
const n = Math.random().toString(36).substr(2, 9);
|
|
257
|
+
V.addOns.push({
|
|
258
|
+
id: n,
|
|
259
|
+
name: "",
|
|
260
|
+
description: "",
|
|
261
|
+
price: 0,
|
|
262
|
+
required: !1
|
|
263
|
+
}), O.value?.openAddons.push(n), await te(), document.getElementById(`addon-${n}`)?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
264
|
+
};
|
|
265
|
+
return (n, p) => {
|
|
266
|
+
const x = m("Label"), C = m("Button");
|
|
267
|
+
return a(), r("div", null, [
|
|
268
|
+
o("div", Re, [
|
|
269
|
+
o("div", null, [
|
|
270
|
+
e(x, { class: "text-base font-medium" }, {
|
|
271
|
+
default: s(() => [...p[0] || (p[0] = [
|
|
272
|
+
d(" Optional Add-ons & Upcharges ", -1)
|
|
273
|
+
])]),
|
|
274
|
+
_: 1
|
|
275
|
+
}),
|
|
276
|
+
p[1] || (p[1] = o("p", { class: "text-sm text-muted-foreground mt-1" }, " Offer optional extras that customers can add to their booking (e.g., swimsuit rental). ", -1))
|
|
277
|
+
]),
|
|
278
|
+
e(C, {
|
|
279
|
+
onClick: b,
|
|
280
|
+
variant: "outline",
|
|
281
|
+
size: "sm"
|
|
282
|
+
}, {
|
|
283
|
+
default: s(() => [
|
|
284
|
+
e(y(G), { class: "w-4 h-4 mr-2" }),
|
|
285
|
+
p[2] || (p[2] = d(" Add Add-on ", -1))
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
})
|
|
289
|
+
]),
|
|
290
|
+
o("div", $e, [
|
|
291
|
+
e(Te, {
|
|
292
|
+
ref_key: "addonList",
|
|
293
|
+
ref: O
|
|
294
|
+
}, null, 512),
|
|
295
|
+
y(V).addOns.length === 0 ? (a(), r("div", De, ' No add-ons configured. Click "Add Add-on" to create optional extras. ')) : w("", !0)
|
|
296
|
+
])
|
|
297
|
+
]);
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}), Le = {
|
|
301
|
+
key: 0,
|
|
302
|
+
class: "max-w-2xl space-y-12"
|
|
303
|
+
}, Be = { class: "flex gap-4 items-end" }, ze = { class: "w-32" }, Ee = { class: "flex items-center justify-between mb-4 gap-4" }, Ne = { class: "space-y-3" }, je = { class: "flex-1 space-y-3" }, qe = { class: "flex gap-3" }, Fe = { class: "flex-1" }, Ge = { class: "flex items-end" }, He = { class: "flex items-center justify-between mb-4" }, We = { class: "space-y-3" }, Ye = { class: "flex-1 space-y-3" }, Ke = { class: "grid grid-cols-2 gap-3" }, Qe = { class: "grid grid-cols-2 gap-3" }, Je = { key: 0 }, Xe = { class: "flex items-center gap-2" }, Ze = { key: 0 }, et = { key: 1 }, tt = { key: 2 }, nt = { class: "space-y-1" }, ot = ["onClick"], st = { class: "size-5 rounded-full bg-muted flex items-center justify-center" }, lt = {
|
|
304
|
+
key: 0,
|
|
305
|
+
class: "w-full h-full rounded-full bg-white scale-50"
|
|
306
|
+
}, dt = ["onClick"], it = { class: "text-sm flex-1 truncate" }, at = {
|
|
307
|
+
key: 0,
|
|
308
|
+
class: "w-3 h-3 text-white",
|
|
309
|
+
fill: "none",
|
|
310
|
+
viewBox: "0 0 24 24",
|
|
311
|
+
stroke: "currentColor"
|
|
312
|
+
}, rt = {
|
|
313
|
+
key: 0,
|
|
314
|
+
class: "text-center py-8 text-muted-foreground text-sm border rounded-lg"
|
|
315
|
+
}, ut = {
|
|
316
|
+
key: 0,
|
|
317
|
+
class: "mt-6 p-4 border rounded-lg bg-muted/30"
|
|
318
|
+
}, mt = { class: "space-y-4" }, ct = { class: "flex items-center gap-3" }, pt = { class: "flex-1" }, ft = { class: "text-sm text-muted-foreground" }, gt = { class: "text-xs text-muted-foreground" }, vt = { class: "flex justify-start pt-4 border-t" }, Ct = /* @__PURE__ */ D({
|
|
319
|
+
__name: "payment",
|
|
320
|
+
setup(c) {
|
|
321
|
+
const { params: V } = ue(), { config: O } = me(), b = ce(O.project), n = ne({
|
|
322
|
+
paymentType: "full",
|
|
323
|
+
currency: "USD",
|
|
324
|
+
partialPayment: {
|
|
325
|
+
type: "percentage",
|
|
326
|
+
amount: 50
|
|
327
|
+
},
|
|
328
|
+
pricingOptions: [
|
|
329
|
+
{
|
|
330
|
+
id: "1",
|
|
331
|
+
name: "Standard Service",
|
|
332
|
+
price: 0,
|
|
333
|
+
isDefault: !0
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
pricingRules: [],
|
|
337
|
+
addOns: []
|
|
338
|
+
}), p = T(!1), x = T(!0), C = T([]), S = (i, t) => {
|
|
339
|
+
if (!i.resourceIds)
|
|
340
|
+
i.resourceIds = [t];
|
|
341
|
+
else {
|
|
342
|
+
const f = i.resourceIds.indexOf(t);
|
|
343
|
+
f === -1 ? i.resourceIds.push(t) : i.resourceIds.splice(f, 1);
|
|
344
|
+
}
|
|
345
|
+
}, g = (i, t) => {
|
|
346
|
+
i.resourceIds = t ? null : [];
|
|
347
|
+
}, h = async () => {
|
|
348
|
+
p.value = !0;
|
|
349
|
+
try {
|
|
350
|
+
const i = V.value.id;
|
|
351
|
+
if (!i) throw new Error("Missing agenda ID");
|
|
352
|
+
await b.update(O.agendaCollection, i, {
|
|
353
|
+
paymentType: n.paymentType || "full",
|
|
354
|
+
currency: n.currency || "USD",
|
|
355
|
+
partialPayment: {
|
|
356
|
+
type: n.partialPayment.type || "percentage",
|
|
357
|
+
amount: Math.max(Number(n.partialPayment.amount) || 0, 0)
|
|
358
|
+
},
|
|
359
|
+
pricingOptions: n.pricingOptions ?? [],
|
|
360
|
+
pricingRules: n.pricingRules ?? [],
|
|
361
|
+
addOns: n.addOns ?? []
|
|
362
|
+
});
|
|
363
|
+
} catch (i) {
|
|
364
|
+
console.error("Error saving changes:", i);
|
|
365
|
+
} finally {
|
|
366
|
+
p.value = !1;
|
|
367
|
+
}
|
|
368
|
+
}, M = () => {
|
|
369
|
+
const i = Math.random().toString(36).substr(2, 9);
|
|
370
|
+
n.pricingOptions.push({
|
|
371
|
+
id: i,
|
|
372
|
+
name: "",
|
|
373
|
+
price: 0,
|
|
374
|
+
isDefault: !1
|
|
375
|
+
});
|
|
376
|
+
}, L = (i) => {
|
|
377
|
+
n.pricingOptions = n.pricingOptions.filter((t) => t.id !== i);
|
|
378
|
+
}, B = (i) => {
|
|
379
|
+
n.pricingOptions.forEach((t) => {
|
|
380
|
+
t.isDefault = t.id === i;
|
|
381
|
+
});
|
|
382
|
+
}, z = () => {
|
|
383
|
+
const i = Math.random().toString(36).substr(2, 9);
|
|
384
|
+
n.pricingRules.push({
|
|
385
|
+
id: i,
|
|
386
|
+
name: "",
|
|
387
|
+
condition: "time_after",
|
|
388
|
+
// time_after, time_before, day_of_week, etc.
|
|
389
|
+
conditionValue: "17:00",
|
|
390
|
+
modifier: "fixed",
|
|
391
|
+
// 'fixed' or 'percentage'
|
|
392
|
+
amount: 10,
|
|
393
|
+
resourceIds: null
|
|
394
|
+
// null = all resources
|
|
395
|
+
});
|
|
396
|
+
}, v = (i) => {
|
|
397
|
+
n.pricingRules = n.pricingRules.filter((t) => t.id !== i);
|
|
398
|
+
};
|
|
399
|
+
return (async () => {
|
|
400
|
+
try {
|
|
401
|
+
const i = await b.get(O.agendaCollection, V.value.id);
|
|
402
|
+
i && (n.paymentType = i.paymentType || "full", n.currency = i.currency || "USD", n.partialPayment = {
|
|
403
|
+
type: i.partialPayment?.type || "percentage",
|
|
404
|
+
amount: Number(i.partialPayment?.amount) && i.partialPayment.amount > 0 ? parseFloat(i.partialPayment.amount) : 50
|
|
405
|
+
}, n.pricingOptions = i.pricingOptions || [{
|
|
406
|
+
id: "1",
|
|
407
|
+
name: "Standard Service",
|
|
408
|
+
price: 0,
|
|
409
|
+
isDefault: !0
|
|
410
|
+
}], n.pricingRules = i.pricingRules || [], n.addOns = i.addOns || [], C.value = (i.resources || []).filter((t) => t.isActive));
|
|
411
|
+
} catch (i) {
|
|
412
|
+
console.error("Error loading agenda data:", i);
|
|
413
|
+
} finally {
|
|
414
|
+
x.value = !1;
|
|
415
|
+
}
|
|
416
|
+
})(), oe("form", n), (i, t) => {
|
|
417
|
+
const f = m("Label"), E = m("SelectValue"), N = m("SelectTrigger"), _ = m("SelectItem"), j = m("SelectContent"), q = m("Select"), I = m("Button"), P = m("Input"), Q = m("PopoverTrigger"), J = m("PopoverContent"), X = m("Popover"), U = m("RadioGroupItem"), W = m("RadioGroup");
|
|
418
|
+
return a(), Y(le, null, {
|
|
419
|
+
default: s(() => [
|
|
420
|
+
t[41] || (t[41] = o("h1", { class: "text-lg font-medium mb-8" }, "Payment Settings", -1)),
|
|
421
|
+
x.value ? w("", !0) : (a(), r("div", Le, [
|
|
422
|
+
o("div", null, [
|
|
423
|
+
o("div", Be, [
|
|
424
|
+
o("div", ze, [
|
|
425
|
+
e(f, { class: "text-base font-medium mb-2" }, {
|
|
426
|
+
default: s(() => [...t[4] || (t[4] = [
|
|
427
|
+
d(" Currency ", -1)
|
|
428
|
+
])]),
|
|
429
|
+
_: 1
|
|
430
|
+
}),
|
|
431
|
+
e(q, {
|
|
432
|
+
modelValue: n.currency,
|
|
433
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => n.currency = l)
|
|
434
|
+
}, {
|
|
435
|
+
default: s(() => [
|
|
436
|
+
e(N, { id: "currency" }, {
|
|
437
|
+
default: s(() => [
|
|
438
|
+
e(E, { placeholder: "Currency" })
|
|
439
|
+
]),
|
|
440
|
+
_: 1
|
|
441
|
+
}),
|
|
442
|
+
e(j, null, {
|
|
443
|
+
default: s(() => [
|
|
444
|
+
e(_, { value: "USD" }, {
|
|
445
|
+
default: s(() => [...t[5] || (t[5] = [
|
|
446
|
+
d("USD ($)", -1)
|
|
447
|
+
])]),
|
|
448
|
+
_: 1
|
|
449
|
+
}),
|
|
450
|
+
e(_, { value: "EUR" }, {
|
|
451
|
+
default: s(() => [...t[6] || (t[6] = [
|
|
452
|
+
d("EUR (€)", -1)
|
|
453
|
+
])]),
|
|
454
|
+
_: 1
|
|
455
|
+
}),
|
|
456
|
+
e(_, { value: "GBP" }, {
|
|
457
|
+
default: s(() => [...t[7] || (t[7] = [
|
|
458
|
+
d("GBP (£)", -1)
|
|
459
|
+
])]),
|
|
460
|
+
_: 1
|
|
461
|
+
}),
|
|
462
|
+
e(_, { value: "CAD" }, {
|
|
463
|
+
default: s(() => [...t[8] || (t[8] = [
|
|
464
|
+
d("CAD ($)", -1)
|
|
465
|
+
])]),
|
|
466
|
+
_: 1
|
|
467
|
+
})
|
|
468
|
+
]),
|
|
469
|
+
_: 1
|
|
470
|
+
})
|
|
471
|
+
]),
|
|
472
|
+
_: 1
|
|
473
|
+
}, 8, ["modelValue"])
|
|
474
|
+
])
|
|
475
|
+
])
|
|
476
|
+
]),
|
|
477
|
+
o("div", null, [
|
|
478
|
+
o("div", Ee, [
|
|
479
|
+
o("div", null, [
|
|
480
|
+
e(f, { class: "text-base font-medium" }, {
|
|
481
|
+
default: s(() => [...t[9] || (t[9] = [
|
|
482
|
+
d(" Service Pricing Options ", -1)
|
|
483
|
+
])]),
|
|
484
|
+
_: 1
|
|
485
|
+
}),
|
|
486
|
+
t[10] || (t[10] = o("p", { class: "text-sm text-muted-foreground mt-1" }, " Offer multiple service variations with different prices (e.g., haircut styles, massage types). ", -1))
|
|
487
|
+
]),
|
|
488
|
+
e(I, {
|
|
489
|
+
onClick: M,
|
|
490
|
+
variant: "outline",
|
|
491
|
+
size: "sm"
|
|
492
|
+
}, {
|
|
493
|
+
default: s(() => [
|
|
494
|
+
e(y(G), { class: "w-4 h-4 mr-2" }),
|
|
495
|
+
t[11] || (t[11] = d(" Add Option ", -1))
|
|
496
|
+
]),
|
|
497
|
+
_: 1
|
|
498
|
+
})
|
|
499
|
+
]),
|
|
500
|
+
o("div", Ne, [
|
|
501
|
+
(a(!0), r(A, null, R(n.pricingOptions, (l) => (a(), r("div", {
|
|
502
|
+
key: l.id,
|
|
503
|
+
class: "flex gap-3 items-start p-4 border rounded-lg"
|
|
504
|
+
}, [
|
|
505
|
+
o("div", je, [
|
|
506
|
+
o("div", null, [
|
|
507
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
508
|
+
default: s(() => [...t[12] || (t[12] = [
|
|
509
|
+
d("Service Name", -1)
|
|
510
|
+
])]),
|
|
511
|
+
_: 1
|
|
512
|
+
}),
|
|
513
|
+
e(P, {
|
|
514
|
+
modelValue: l.name,
|
|
515
|
+
"onUpdate:modelValue": (u) => l.name = u,
|
|
516
|
+
placeholder: "e.g., Men's Haircut, Women's Haircut"
|
|
517
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
518
|
+
]),
|
|
519
|
+
o("div", qe, [
|
|
520
|
+
o("div", Fe, [
|
|
521
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
522
|
+
default: s(() => [...t[13] || (t[13] = [
|
|
523
|
+
d("Price", -1)
|
|
524
|
+
])]),
|
|
525
|
+
_: 1
|
|
526
|
+
}),
|
|
527
|
+
e(P, {
|
|
528
|
+
modelValue: l.price,
|
|
529
|
+
"onUpdate:modelValue": (u) => l.price = u,
|
|
530
|
+
modelModifiers: { number: !0 },
|
|
531
|
+
type: "number",
|
|
532
|
+
min: "0",
|
|
533
|
+
step: "0.01",
|
|
534
|
+
placeholder: "0.00",
|
|
535
|
+
class: "no-spinner"
|
|
536
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
537
|
+
]),
|
|
538
|
+
o("div", Ge, [
|
|
539
|
+
e(I, {
|
|
540
|
+
onClick: (u) => B(l.id),
|
|
541
|
+
variant: l.isDefault ? "default" : "outline",
|
|
542
|
+
size: "sm"
|
|
543
|
+
}, {
|
|
544
|
+
default: s(() => [
|
|
545
|
+
d(k(l.isDefault ? "Default" : "Set Default"), 1)
|
|
546
|
+
]),
|
|
547
|
+
_: 2
|
|
548
|
+
}, 1032, ["onClick", "variant"])
|
|
549
|
+
])
|
|
550
|
+
])
|
|
551
|
+
]),
|
|
552
|
+
n.pricingOptions.length > 1 ? (a(), Y(I, {
|
|
553
|
+
key: 0,
|
|
554
|
+
onClick: (u) => L(l.id),
|
|
555
|
+
variant: "ghost",
|
|
556
|
+
size: "icon",
|
|
557
|
+
class: "mt-6"
|
|
558
|
+
}, {
|
|
559
|
+
default: s(() => [
|
|
560
|
+
e(y(F), { class: "w-4 h-4 text-destructive" })
|
|
561
|
+
]),
|
|
562
|
+
_: 1
|
|
563
|
+
}, 8, ["onClick"])) : w("", !0)
|
|
564
|
+
]))), 128))
|
|
565
|
+
])
|
|
566
|
+
]),
|
|
567
|
+
o("div", null, [
|
|
568
|
+
o("div", He, [
|
|
569
|
+
o("div", null, [
|
|
570
|
+
e(f, { class: "text-base font-medium" }, {
|
|
571
|
+
default: s(() => [...t[14] || (t[14] = [
|
|
572
|
+
d(" Conditional Pricing Rules ", -1)
|
|
573
|
+
])]),
|
|
574
|
+
_: 1
|
|
575
|
+
}),
|
|
576
|
+
t[15] || (t[15] = o("p", { class: "text-sm text-muted-foreground mt-1" }, " Add extra fees based on time, day, or other conditions (e.g., +€10 after 5pm). ", -1))
|
|
577
|
+
]),
|
|
578
|
+
e(I, {
|
|
579
|
+
onClick: z,
|
|
580
|
+
variant: "outline",
|
|
581
|
+
size: "sm"
|
|
582
|
+
}, {
|
|
583
|
+
default: s(() => [
|
|
584
|
+
e(y(G), { class: "w-4 h-4 mr-2" }),
|
|
585
|
+
t[16] || (t[16] = d(" Add Rule ", -1))
|
|
586
|
+
]),
|
|
587
|
+
_: 1
|
|
588
|
+
})
|
|
589
|
+
]),
|
|
590
|
+
o("div", We, [
|
|
591
|
+
(a(!0), r(A, null, R(n.pricingRules, (l) => (a(), r("div", {
|
|
592
|
+
key: l.id,
|
|
593
|
+
class: "flex gap-3 items-start p-4 border rounded-lg"
|
|
594
|
+
}, [
|
|
595
|
+
o("div", Ye, [
|
|
596
|
+
o("div", null, [
|
|
597
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
598
|
+
default: s(() => [...t[17] || (t[17] = [
|
|
599
|
+
d("Rule Name", -1)
|
|
600
|
+
])]),
|
|
601
|
+
_: 1
|
|
602
|
+
}),
|
|
603
|
+
e(P, {
|
|
604
|
+
modelValue: l.name,
|
|
605
|
+
"onUpdate:modelValue": (u) => l.name = u,
|
|
606
|
+
placeholder: "e.g., After Hours Fee, Weekend Surcharge"
|
|
607
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
608
|
+
]),
|
|
609
|
+
o("div", Ke, [
|
|
610
|
+
o("div", null, [
|
|
611
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
612
|
+
default: s(() => [...t[18] || (t[18] = [
|
|
613
|
+
d("Condition", -1)
|
|
614
|
+
])]),
|
|
615
|
+
_: 1
|
|
616
|
+
}),
|
|
617
|
+
e(q, {
|
|
618
|
+
modelValue: l.condition,
|
|
619
|
+
"onUpdate:modelValue": (u) => l.condition = u
|
|
620
|
+
}, {
|
|
621
|
+
default: s(() => [
|
|
622
|
+
e(N, null, {
|
|
623
|
+
default: s(() => [
|
|
624
|
+
e(E, { placeholder: "Select condition" })
|
|
625
|
+
]),
|
|
626
|
+
_: 1
|
|
627
|
+
}),
|
|
628
|
+
e(j, null, {
|
|
629
|
+
default: s(() => [
|
|
630
|
+
e(_, { value: "time_after" }, {
|
|
631
|
+
default: s(() => [...t[19] || (t[19] = [
|
|
632
|
+
d("Time After", -1)
|
|
633
|
+
])]),
|
|
634
|
+
_: 1
|
|
635
|
+
}),
|
|
636
|
+
e(_, { value: "time_before" }, {
|
|
637
|
+
default: s(() => [...t[20] || (t[20] = [
|
|
638
|
+
d("Time Before", -1)
|
|
639
|
+
])]),
|
|
640
|
+
_: 1
|
|
641
|
+
}),
|
|
642
|
+
e(_, { value: "time_between" }, {
|
|
643
|
+
default: s(() => [...t[21] || (t[21] = [
|
|
644
|
+
d("Time Between", -1)
|
|
645
|
+
])]),
|
|
646
|
+
_: 1
|
|
647
|
+
}),
|
|
648
|
+
e(_, { value: "day_of_week" }, {
|
|
649
|
+
default: s(() => [...t[22] || (t[22] = [
|
|
650
|
+
d("Day of Week", -1)
|
|
651
|
+
])]),
|
|
652
|
+
_: 1
|
|
653
|
+
}),
|
|
654
|
+
e(_, { value: "date_range" }, {
|
|
655
|
+
default: s(() => [...t[23] || (t[23] = [
|
|
656
|
+
d("Date Range", -1)
|
|
657
|
+
])]),
|
|
658
|
+
_: 1
|
|
659
|
+
})
|
|
660
|
+
]),
|
|
661
|
+
_: 1
|
|
662
|
+
})
|
|
663
|
+
]),
|
|
664
|
+
_: 1
|
|
665
|
+
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
666
|
+
]),
|
|
667
|
+
o("div", null, [
|
|
668
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
669
|
+
default: s(() => [...t[24] || (t[24] = [
|
|
670
|
+
d("Value", -1)
|
|
671
|
+
])]),
|
|
672
|
+
_: 1
|
|
673
|
+
}),
|
|
674
|
+
e(P, {
|
|
675
|
+
modelValue: l.conditionValue,
|
|
676
|
+
"onUpdate:modelValue": (u) => l.conditionValue = u,
|
|
677
|
+
type: l.condition.includes("time") ? "time" : "text",
|
|
678
|
+
placeholder: "e.g., 17:00"
|
|
679
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "type"])
|
|
680
|
+
])
|
|
681
|
+
]),
|
|
682
|
+
o("div", Qe, [
|
|
683
|
+
o("div", null, [
|
|
684
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
685
|
+
default: s(() => [...t[25] || (t[25] = [
|
|
686
|
+
d("Fee Type", -1)
|
|
687
|
+
])]),
|
|
688
|
+
_: 1
|
|
689
|
+
}),
|
|
690
|
+
e(q, {
|
|
691
|
+
modelValue: l.modifier,
|
|
692
|
+
"onUpdate:modelValue": (u) => l.modifier = u
|
|
693
|
+
}, {
|
|
694
|
+
default: s(() => [
|
|
695
|
+
e(N, null, {
|
|
696
|
+
default: s(() => [
|
|
697
|
+
e(E, { placeholder: "Select type" })
|
|
698
|
+
]),
|
|
699
|
+
_: 1
|
|
700
|
+
}),
|
|
701
|
+
e(j, null, {
|
|
702
|
+
default: s(() => [
|
|
703
|
+
e(_, { value: "fixed" }, {
|
|
704
|
+
default: s(() => [...t[26] || (t[26] = [
|
|
705
|
+
d("Fixed Amount", -1)
|
|
706
|
+
])]),
|
|
707
|
+
_: 1
|
|
708
|
+
}),
|
|
709
|
+
e(_, { value: "percentage" }, {
|
|
710
|
+
default: s(() => [...t[27] || (t[27] = [
|
|
711
|
+
d("Percentage", -1)
|
|
712
|
+
])]),
|
|
713
|
+
_: 1
|
|
714
|
+
})
|
|
715
|
+
]),
|
|
716
|
+
_: 1
|
|
717
|
+
})
|
|
718
|
+
]),
|
|
719
|
+
_: 1
|
|
720
|
+
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
721
|
+
]),
|
|
722
|
+
o("div", null, [
|
|
723
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
724
|
+
default: s(() => [...t[28] || (t[28] = [
|
|
725
|
+
d("Amount", -1)
|
|
726
|
+
])]),
|
|
727
|
+
_: 1
|
|
728
|
+
}),
|
|
729
|
+
e(P, {
|
|
730
|
+
modelValue: l.amount,
|
|
731
|
+
"onUpdate:modelValue": (u) => l.amount = u,
|
|
732
|
+
modelModifiers: { number: !0 },
|
|
733
|
+
type: "number",
|
|
734
|
+
min: "0",
|
|
735
|
+
step: "0.01",
|
|
736
|
+
class: "no-spinner",
|
|
737
|
+
placeholder: l.modifier === "percentage" ? "10 (%)" : "10.00"
|
|
738
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
739
|
+
])
|
|
740
|
+
]),
|
|
741
|
+
C.value.length > 0 ? (a(), r("div", Je, [
|
|
742
|
+
e(f, { class: "text-xs mb-1 block" }, {
|
|
743
|
+
default: s(() => [...t[29] || (t[29] = [
|
|
744
|
+
d("Apply To Resources", -1)
|
|
745
|
+
])]),
|
|
746
|
+
_: 1
|
|
747
|
+
}),
|
|
748
|
+
e(X, null, {
|
|
749
|
+
default: s(() => [
|
|
750
|
+
e(Q, { "as-child": "" }, {
|
|
751
|
+
default: s(() => [
|
|
752
|
+
e(I, {
|
|
753
|
+
variant: "outline",
|
|
754
|
+
class: "w-full justify-between font-normal"
|
|
755
|
+
}, {
|
|
756
|
+
default: s(() => [
|
|
757
|
+
o("div", Xe, [
|
|
758
|
+
e(y(K), { class: "w-4 h-4 text-muted-foreground" }),
|
|
759
|
+
!l.resourceIds || l.resourceIds.length === 0 ? (a(), r("span", Ze, "All Resources")) : l.resourceIds.length === 1 ? (a(), r("span", et, k(C.value.find((u) => u.id === l.resourceIds[0])?.name || "1 resource"), 1)) : (a(), r("span", tt, k(l.resourceIds.length) + " resources", 1))
|
|
760
|
+
]),
|
|
761
|
+
e(y(ae), { class: "w-4 h-4 opacity-50" })
|
|
762
|
+
]),
|
|
763
|
+
_: 2
|
|
764
|
+
}, 1024)
|
|
765
|
+
]),
|
|
766
|
+
_: 2
|
|
767
|
+
}, 1024),
|
|
768
|
+
e(J, {
|
|
769
|
+
class: "w-64 p-2",
|
|
770
|
+
align: "start"
|
|
771
|
+
}, {
|
|
772
|
+
default: s(() => [
|
|
773
|
+
o("div", nt, [
|
|
774
|
+
o("div", {
|
|
775
|
+
class: $(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors", { "bg-muted": !l.resourceIds || l.resourceIds.length === 0 }]),
|
|
776
|
+
onClick: (u) => g(l, !0)
|
|
777
|
+
}, [
|
|
778
|
+
o("div", st, [
|
|
779
|
+
e(y(K), { class: "w-3 h-3 text-muted-foreground" })
|
|
780
|
+
]),
|
|
781
|
+
t[30] || (t[30] = o("span", { class: "text-sm flex-1" }, "All Resources", -1)),
|
|
782
|
+
o("div", {
|
|
783
|
+
class: $(["size-4 rounded-full border-2", !l.resourceIds || l.resourceIds.length === 0 ? "border-primary bg-primary" : "border-muted-foreground"])
|
|
784
|
+
}, [
|
|
785
|
+
!l.resourceIds || l.resourceIds.length === 0 ? (a(), r("div", lt)) : w("", !0)
|
|
786
|
+
], 2)
|
|
787
|
+
], 10, ot),
|
|
788
|
+
t[32] || (t[32] = o("div", { class: "border-t my-2" }, null, -1)),
|
|
789
|
+
(a(!0), r(A, null, R(C.value, (u) => (a(), r("div", {
|
|
790
|
+
key: u.id,
|
|
791
|
+
class: "flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors",
|
|
792
|
+
onClick: (yt) => {
|
|
793
|
+
g(l, !1), S(l, u.id);
|
|
794
|
+
}
|
|
795
|
+
}, [
|
|
796
|
+
o("div", {
|
|
797
|
+
class: "size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",
|
|
798
|
+
style: se({ backgroundColor: u.color || "#6b7280" })
|
|
799
|
+
}, k(u.avatarLabel || u.name.charAt(0).toUpperCase()), 5),
|
|
800
|
+
o("span", it, k(u.name), 1),
|
|
801
|
+
o("div", {
|
|
802
|
+
class: $(["size-4 rounded border-2 flex items-center justify-center", l.resourceIds?.includes(u.id) ? "border-primary bg-primary" : "border-muted-foreground"])
|
|
803
|
+
}, [
|
|
804
|
+
l.resourceIds?.includes(u.id) ? (a(), r("svg", at, [...t[31] || (t[31] = [
|
|
805
|
+
o("path", {
|
|
806
|
+
"stroke-linecap": "round",
|
|
807
|
+
"stroke-linejoin": "round",
|
|
808
|
+
"stroke-width": "3",
|
|
809
|
+
d: "M5 13l4 4L19 7"
|
|
810
|
+
}, null, -1)
|
|
811
|
+
])])) : w("", !0)
|
|
812
|
+
], 2)
|
|
813
|
+
], 8, dt))), 128))
|
|
814
|
+
])
|
|
815
|
+
]),
|
|
816
|
+
_: 2
|
|
817
|
+
}, 1024)
|
|
818
|
+
]),
|
|
819
|
+
_: 2
|
|
820
|
+
}, 1024)
|
|
821
|
+
])) : w("", !0)
|
|
822
|
+
]),
|
|
823
|
+
e(I, {
|
|
824
|
+
onClick: (u) => v(l.id),
|
|
825
|
+
variant: "ghost",
|
|
826
|
+
size: "icon",
|
|
827
|
+
class: "mt-6"
|
|
828
|
+
}, {
|
|
829
|
+
default: s(() => [
|
|
830
|
+
e(y(F), { class: "w-4 h-4 text-destructive" })
|
|
831
|
+
]),
|
|
832
|
+
_: 1
|
|
833
|
+
}, 8, ["onClick"])
|
|
834
|
+
]))), 128)),
|
|
835
|
+
n.pricingRules.length === 0 ? (a(), r("div", rt, ' No pricing rules configured. Click "Add Rule" to create conditional fees. ')) : w("", !0)
|
|
836
|
+
])
|
|
837
|
+
]),
|
|
838
|
+
e(Me),
|
|
839
|
+
o("div", null, [
|
|
840
|
+
e(f, { class: "text-base font-medium" }, {
|
|
841
|
+
default: s(() => [...t[33] || (t[33] = [
|
|
842
|
+
d(" Payment Preferences ", -1)
|
|
843
|
+
])]),
|
|
844
|
+
_: 1
|
|
845
|
+
}),
|
|
846
|
+
t[40] || (t[40] = o("p", { class: "text-sm text-muted-foreground mb-6" }, " Let customers pay full or in part when booking a slot, or pay later. ", -1)),
|
|
847
|
+
e(W, {
|
|
848
|
+
modelValue: n.paymentType,
|
|
849
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => n.paymentType = l),
|
|
850
|
+
class: "flex flex-col gap-4"
|
|
851
|
+
}, {
|
|
852
|
+
default: s(() => [
|
|
853
|
+
e(f, {
|
|
854
|
+
for: "r1",
|
|
855
|
+
class: "flex items-start space-x-2 cursor-pointer"
|
|
856
|
+
}, {
|
|
857
|
+
default: s(() => [
|
|
858
|
+
e(U, {
|
|
859
|
+
id: "r1",
|
|
860
|
+
value: "full"
|
|
861
|
+
}),
|
|
862
|
+
t[34] || (t[34] = o("div", null, [
|
|
863
|
+
o("p", null, "Pay Full Amount when Booking"),
|
|
864
|
+
o("p", { class: "text-sm text-muted-foreground mt-1" }, " Your customers are required to complete the payment to confirm their booking. ")
|
|
865
|
+
], -1))
|
|
866
|
+
]),
|
|
867
|
+
_: 1
|
|
868
|
+
}),
|
|
869
|
+
e(f, {
|
|
870
|
+
for: "r2",
|
|
871
|
+
class: "flex items-start space-x-2 cursor-pointer"
|
|
872
|
+
}, {
|
|
873
|
+
default: s(() => [
|
|
874
|
+
e(U, {
|
|
875
|
+
id: "r2",
|
|
876
|
+
value: "partial"
|
|
877
|
+
}),
|
|
878
|
+
t[35] || (t[35] = o("div", null, [
|
|
879
|
+
o("p", null, "Pay Part Amount when Booking"),
|
|
880
|
+
o("p", { class: "text-sm text-muted-foreground mt-1" }, " Your customers are required to pay a deposit to confirm their booking. ")
|
|
881
|
+
], -1))
|
|
882
|
+
]),
|
|
883
|
+
_: 1
|
|
884
|
+
}),
|
|
885
|
+
e(f, {
|
|
886
|
+
for: "r3",
|
|
887
|
+
class: "flex items-start space-x-2 cursor-pointer"
|
|
888
|
+
}, {
|
|
889
|
+
default: s(() => [
|
|
890
|
+
e(U, {
|
|
891
|
+
id: "r3",
|
|
892
|
+
value: "later"
|
|
893
|
+
}),
|
|
894
|
+
t[36] || (t[36] = o("div", null, [
|
|
895
|
+
o("p", null, "Pay Later at Appointment"),
|
|
896
|
+
o("p", { class: "text-sm text-muted-foreground mt-1" }, " Your customers can book now and pay in person at the time of their appointment. ")
|
|
897
|
+
], -1))
|
|
898
|
+
]),
|
|
899
|
+
_: 1
|
|
900
|
+
})
|
|
901
|
+
]),
|
|
902
|
+
_: 1
|
|
903
|
+
}, 8, ["modelValue"]),
|
|
904
|
+
n.paymentType === "partial" ? (a(), r("div", ut, [
|
|
905
|
+
e(f, { class: "text-sm font-medium mb-4 block" }, {
|
|
906
|
+
default: s(() => [...t[37] || (t[37] = [
|
|
907
|
+
d(" Deposit Amount Configuration ", -1)
|
|
908
|
+
])]),
|
|
909
|
+
_: 1
|
|
910
|
+
}),
|
|
911
|
+
o("div", mt, [
|
|
912
|
+
e(W, {
|
|
913
|
+
modelValue: n.partialPayment.type,
|
|
914
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => n.partialPayment.type = l),
|
|
915
|
+
class: "flex gap-4"
|
|
916
|
+
}, {
|
|
917
|
+
default: s(() => [
|
|
918
|
+
e(f, { class: "flex items-center space-x-2 cursor-pointer" }, {
|
|
919
|
+
default: s(() => [
|
|
920
|
+
e(U, { value: "percentage" }),
|
|
921
|
+
t[38] || (t[38] = o("span", null, "Percentage", -1))
|
|
922
|
+
]),
|
|
923
|
+
_: 1
|
|
924
|
+
}),
|
|
925
|
+
e(f, { class: "flex items-center space-x-2 cursor-pointer" }, {
|
|
926
|
+
default: s(() => [
|
|
927
|
+
e(U, { value: "fixed" }),
|
|
928
|
+
t[39] || (t[39] = o("span", null, "Fixed Amount", -1))
|
|
929
|
+
]),
|
|
930
|
+
_: 1
|
|
931
|
+
})
|
|
932
|
+
]),
|
|
933
|
+
_: 1
|
|
934
|
+
}, 8, ["modelValue"]),
|
|
935
|
+
o("div", ct, [
|
|
936
|
+
o("div", pt, [
|
|
937
|
+
e(P, {
|
|
938
|
+
modelValue: n.partialPayment.amount,
|
|
939
|
+
"onUpdate:modelValue": t[3] || (t[3] = (l) => n.partialPayment.amount = l),
|
|
940
|
+
modelModifiers: { number: !0 },
|
|
941
|
+
type: "number",
|
|
942
|
+
min: "0",
|
|
943
|
+
max: n.partialPayment.type === "percentage" ? 100 : void 0,
|
|
944
|
+
step: "0.01",
|
|
945
|
+
placeholder: n.partialPayment.type === "percentage" ? "50" : "10.00",
|
|
946
|
+
class: "no-spinner"
|
|
947
|
+
}, null, 8, ["modelValue", "max", "placeholder"])
|
|
948
|
+
]),
|
|
949
|
+
o("span", ft, k(n.partialPayment.type === "percentage" ? "%" : n.currency), 1)
|
|
950
|
+
]),
|
|
951
|
+
o("p", gt, [
|
|
952
|
+
n.partialPayment.type === "percentage" ? (a(), r(A, { key: 0 }, [
|
|
953
|
+
d(" Customers will pay " + k(n.partialPayment.amount) + "% of the total price upfront. ", 1)
|
|
954
|
+
], 64)) : (a(), r(A, { key: 1 }, [
|
|
955
|
+
d(" Customers will pay " + k(n.currency) + " " + k(n.partialPayment.amount) + " upfront. ", 1)
|
|
956
|
+
], 64))
|
|
957
|
+
])
|
|
958
|
+
])
|
|
959
|
+
])) : w("", !0)
|
|
960
|
+
]),
|
|
961
|
+
o("div", vt, [
|
|
962
|
+
e(I, {
|
|
963
|
+
onClick: h,
|
|
964
|
+
disabled: p.value
|
|
965
|
+
}, {
|
|
966
|
+
default: s(() => [
|
|
967
|
+
d(k(p.value ? "Saving..." : "Save Changes"), 1)
|
|
968
|
+
]),
|
|
969
|
+
_: 1
|
|
970
|
+
}, 8, ["disabled"])
|
|
971
|
+
])
|
|
972
|
+
]))
|
|
973
|
+
]),
|
|
974
|
+
_: 1
|
|
975
|
+
});
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
export {
|
|
980
|
+
Ct as default
|
|
981
|
+
};
|