@oneclick.dev/cms-core-modules 0.0.104 → 0.0.106
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/{Acquisition-CPlZzUBo.mjs → Acquisition-B2pM5vSp.mjs} +2 -2
- package/dist/{Acquisition-Br1Pfny3.js → Acquisition-Dt2rREU8.js} +1 -1
- package/dist/{Audience-BfkrmBuQ.js → Audience-Bs7b0TNm.js} +1 -1
- package/dist/{Audience-DTblSAiL.mjs → Audience-VLnUsQvW.mjs} +2 -2
- package/dist/{ContentEditor-B1nfKG_5.mjs → ContentEditor-BNLEv-qJ.mjs} +3119 -3098
- package/dist/{ContentEditor-DdFU8piH.js → ContentEditor-BUvvqfG1.js} +36 -36
- package/dist/{Create-qPeQxkdl.js → Create-89z41K73.js} +1 -1
- package/dist/{Create-BRBh0xjM.mjs → Create-Cn_Eufga.mjs} +5 -1
- package/dist/{Entries-C8UJkrVC.mjs → Entries-BdhUyJR5.mjs} +1 -1
- package/dist/{Entries-BaS6H6ak.js → Entries-CEXM_SkO.js} +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DMGcRmm-.mjs +1255 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +1 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +330 -0
- package/dist/{Overview-CpHhuiaV.js → Overview-Bn1Xx3_j.js} +1 -1
- package/dist/{Overview-BrCwozey.js → Overview-DC9io1bk.js} +1 -1
- package/dist/Overview-Di84CsR5.mjs +476 -0
- package/dist/Overview-UoZHUMUz.js +1 -0
- package/dist/{Overview-kaMhsIUq.mjs → Overview-ejh4vUMT.mjs} +3 -3
- package/dist/{Overview-D_T3K6aq.mjs → Overview-lWAyyenp.mjs} +1 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +349 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +3077 -0
- package/dist/{SeoHealth-BzcWd_w7.mjs → SeoHealth-DsbVdd2l.mjs} +3 -3
- package/dist/SeoHealth-az1YuNF2.js +1 -0
- package/dist/{TableView-DXmEF6pY.mjs → TableView-Bm6HaRHm.mjs} +1 -1
- package/dist/{TableView-CPAw3h8g.js → TableView-DQW0A1oG.js} +1 -1
- package/dist/agenda-IOqtALWf.js +1 -0
- package/dist/agenda-neyeLWv-.mjs +1165 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/{index-C4YUVWzJ.js → index-A2kp8Isi.js} +6 -6
- package/dist/{index-BuzLn4Km.js → index-B5aBwdxY.js} +2 -2
- package/dist/{index-p5Uqu8c2.mjs → index-BRdCrvcz.mjs} +52 -47
- package/dist/{index-D3L8WAJI.js → index-BiT55eU0.js} +2 -2
- package/dist/{index-CMk3uhUt.mjs → index-Bvxc5xv_.mjs} +153 -147
- package/dist/{index-DQYBP8Js.js → index-G7cIlnGN.js} +4 -4
- package/dist/{index-DjDCYQ_6.mjs → index-X6LV64jK.mjs} +102 -101
- package/dist/{index-_2lRVt_k.mjs → index-uOkqO74I.mjs} +105 -107
- package/dist/index-unsDfNYv.mjs +1187 -0
- package/dist/index-vHmvbEwa.js +35 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +14 -14
- package/dist/interpolation-CHn59tIC.js +1 -0
- package/dist/interpolation-w7IRDJwK.mjs +180 -0
- package/dist/orders-C65SlpJy.mjs +618 -0
- package/dist/orders-XVzWAgG1.js +1 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +11 -2
- package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +55 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +6 -1
- package/dist/src/appointments/components/edit/NewReservationDialog/CustomerInformation.vue.d.ts +10 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +25 -1
- package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +26 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +31 -0
- package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +3 -1
- package/dist/src/appointments/composables/useHorizontalScroll.d.ts +20 -0
- package/dist/src/lib/interpolation.d.ts +6 -0
- package/package.json +2 -2
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-9Q7TMm4u.mjs +0 -401
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DiNzGl-q.js +0 -1
- package/dist/Overview-BYMrsZjM.mjs +0 -332
- package/dist/Overview-t0pG5xjA.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cz_22Oce.mjs +0 -2927
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DPPNc-Z5.js +0 -349
- package/dist/SeoHealth-09sEOu3G.js +0 -1
- package/dist/agenda-BNG05SAq.js +0 -1
- package/dist/agenda-D1RxMxBS.mjs +0 -1152
- package/dist/index-BtujSJeg.js +0 -35
- package/dist/index-dOdMm1pV.mjs +0 -1105
- package/dist/interpolation-DEDSLETn.mjs +0 -128
- package/dist/interpolation-DERg6Lwt.js +0 -1
- package/dist/orders-CzzcFQha.mjs +0 -559
- package/dist/orders-ETtbA4aQ.js +0 -1
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +0 -110
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +0 -98
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ie, ref as d, watch as de, inject as re, computed as pe, resolveComponent as n, openBlock as _, createBlock as U, withCtx as t, createVNode as l, unref as c, createTextVNode as u, createElementVNode as o, toDisplayString as D, createElementBlock as y, Fragment as k, renderList as M, normalizeClass as ce } from "vue";
|
|
2
|
-
import { Plus as ve, CalendarIcon as me } from "lucide-vue-next";
|
|
3
|
-
import { useModuleRoute as fe, useModule as ge, useFirebaseIntegration as _e } from "@oneclick.dev/cms-kit";
|
|
4
|
-
import { c as Ve } from "./utils-CanmrIWO.mjs";
|
|
5
|
-
import { c as q, b as R, $ as De } from "./DateFormatter-Bw-87W31.mjs";
|
|
6
|
-
const Se = { class: "@container/new-res-form space-y-5 py-4" }, be = { class: "grid gap-4" }, xe = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, ye = { class: "grid gap-2" }, Pe = { class: "flex gap-2 items-center" }, we = { class: "grid gap-2" }, $e = { class: "flex gap-2 items-center" }, Ce = { class: "grid gap-2" }, Te = { class: "grid gap-2" }, he = { class: "grid gap-4" }, Ne = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Oe = { class: "grid gap-2" }, Fe = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Ie = { class: "grid gap-2" }, Ue = { class: "grid gap-2" }, ke = { class: "flex items-center h-9 px-3 text-sm text-muted-foreground" }, Me = { class: "grid gap-4" }, Re = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Le = { class: "grid gap-2" }, Be = { class: "grid gap-2" }, Ee = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, je = { class: "grid gap-2" }, Ae = { class: "grid gap-2" }, He = { class: "mt-4 text-red-400" }, ze = { class: "list-disc pl-4" }, Ge = { key: 0 }, qe = { key: 1 }, Ze = /* @__PURE__ */ ie({
|
|
7
|
-
__name: "NewReservationDialog",
|
|
8
|
-
setup(Je) {
|
|
9
|
-
const { params: J } = fe(), { config: L } = ge(), K = _e(L.project), $ = d(!1);
|
|
10
|
-
de($, (s) => {
|
|
11
|
-
s && (T.value = [], V.value = 1, f.value = 0, r.value = i.value?.resources?.[0]?.id ?? "", v.value = i.value?.pricingOptions?.find((e) => e.isDefault === !0)?.id ?? "", p.value = "", P.value = "", w.value = "", S.value = "", h.value = "");
|
|
12
|
-
});
|
|
13
|
-
const C = d(!1), i = re("agendaData", d({})), T = d([]), V = d(1), f = d(0), r = d(""), v = d(""), p = d(""), P = d(""), w = d(""), S = d(""), h = d(""), Q = q(R()), g = d(), W = new De("en-US", {
|
|
14
|
-
dateStyle: "long"
|
|
15
|
-
}), B = pe(() => {
|
|
16
|
-
if (!p.value || !v.value) return "";
|
|
17
|
-
const s = i.value?.pricingOptions?.find((I) => I.id === v.value);
|
|
18
|
-
if (!s?.duration) return p.value;
|
|
19
|
-
const [e, b] = p.value.split(":").map(Number);
|
|
20
|
-
if (isNaN(e) || isNaN(b)) return "";
|
|
21
|
-
const N = e * 60 + b + s.duration, O = Math.floor(N / 60) % 24, F = N % 60;
|
|
22
|
-
return `${O.toString().padStart(2, "0")}:${F.toString().padStart(2, "0")}`;
|
|
23
|
-
}), X = () => {
|
|
24
|
-
const s = [];
|
|
25
|
-
return T.value = [], V.value < 1 && V.value > 9999 && s.push("Please fill in a correct number of spots."), f.value < 0 && (f.value = 0), r.value || s.push("Please select a resource."), v.value || s.push("Please select a type."), g.value || s.push("Please select the booking date."), (!p.value || p.value.length !== 5 || p.value?.indexOf(":") === -1 || !parseInt(p.value?.replace(":", ""))) && s.push("Please select a correct booking time."), P.value || s.push("Please fill in the first name of the customer."), w.value || s.push("Please fill in the last name of the customer."), (!S.value || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S.value) === !1) && s.push("Please fill in the correct email of the customer."), T.value = s, s.length === 0;
|
|
26
|
-
}, Y = async () => {
|
|
27
|
-
if (X())
|
|
28
|
-
try {
|
|
29
|
-
C.value = !0;
|
|
30
|
-
const s = {
|
|
31
|
-
agendaId: J.value.id,
|
|
32
|
-
customerInfo: {
|
|
33
|
-
firstName: P.value,
|
|
34
|
-
lastName: w.value,
|
|
35
|
-
email: S.value,
|
|
36
|
-
phone: h.value
|
|
37
|
-
},
|
|
38
|
-
amountPaid: parseFloat(f.value) ?? 0,
|
|
39
|
-
amountDue: 0,
|
|
40
|
-
subtotal: parseFloat(f.value) ?? 0,
|
|
41
|
-
total: parseFloat(f.value) ?? 0,
|
|
42
|
-
createdAt: /* @__PURE__ */ new Date(),
|
|
43
|
-
updatedAt: /* @__PURE__ */ new Date(),
|
|
44
|
-
discount: 0,
|
|
45
|
-
flattenedReservationDates: [`${r.value}_${g.value}`],
|
|
46
|
-
flattenedReservations: [`${r.value}_${g.value}_${p.value?.replace(":", "")}`],
|
|
47
|
-
paymentStatus: "paid",
|
|
48
|
-
paymentType: "full",
|
|
49
|
-
reservations: [{
|
|
50
|
-
status: "approved",
|
|
51
|
-
totalPrice: parseFloat(f.value?.toFixed(2)) ?? 0,
|
|
52
|
-
basePrice: parseFloat((f.value / V.value).toFixed(2)) ?? 0,
|
|
53
|
-
addOnsPrice: 0,
|
|
54
|
-
addOns: [],
|
|
55
|
-
date: `${g.value}`,
|
|
56
|
-
id: `res_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`,
|
|
57
|
-
pricingOption: {
|
|
58
|
-
duration: i.value?.pricingOptions?.find((e) => e.id === v.value)?.duration || "",
|
|
59
|
-
id: i.value?.pricingOptions?.find((e) => e.id === v.value)?.id || "",
|
|
60
|
-
name: i.value?.pricingOptions?.find((e) => e.id === v.value)?.name || "",
|
|
61
|
-
price: i.value?.pricingOptions?.find((e) => e.id === v.value)?.price || ""
|
|
62
|
-
},
|
|
63
|
-
pricingOptionId: v.value,
|
|
64
|
-
resource: {
|
|
65
|
-
avatarLabel: i.value?.resources?.find((e) => e.id === r.value)?.avatarLabel || "",
|
|
66
|
-
color: i.value?.resources?.find((e) => e.id === r.value)?.color || "",
|
|
67
|
-
description: i.value?.resources?.find((e) => e.id === r.value)?.description || "",
|
|
68
|
-
id: i.value?.resources?.find((e) => e.id === r.value)?.id || "",
|
|
69
|
-
name: i.value?.resources?.find((e) => e.id === r.value)?.name || ""
|
|
70
|
-
},
|
|
71
|
-
resourceId: r.value,
|
|
72
|
-
spots: V.value,
|
|
73
|
-
timeslot: {
|
|
74
|
-
startTime: p.value,
|
|
75
|
-
endTime: B.value
|
|
76
|
-
}
|
|
77
|
-
}],
|
|
78
|
-
status: "confirmed"
|
|
79
|
-
};
|
|
80
|
-
await K.add(L.reservationsCollection, s);
|
|
81
|
-
} catch {
|
|
82
|
-
} finally {
|
|
83
|
-
C.value = !1, $.value = !1;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return (s, e) => {
|
|
87
|
-
const b = n("Button"), N = n("DialogTrigger"), O = n("DialogTitle"), F = n("DialogDescription"), I = n("DialogHeader"), m = n("Label"), x = n("Input"), E = n("SelectValue"), j = n("SelectTrigger"), A = n("SelectItem"), H = n("SelectGroup"), z = n("SelectContent"), G = n("Select"), Z = n("PopoverTrigger"), ee = n("Calendar"), le = n("PopoverContent"), te = n("Popover"), ae = n("TimeInput"), oe = n("DialogFooter"), ne = n("DialogScrollContent"), se = n("Dialog");
|
|
88
|
-
return _(), U(se, {
|
|
89
|
-
open: $.value,
|
|
90
|
-
"onUpdate:open": e[10] || (e[10] = (a) => $.value = a)
|
|
91
|
-
}, {
|
|
92
|
-
default: t(() => [
|
|
93
|
-
l(N, { "as-child": "" }, {
|
|
94
|
-
default: t(() => [
|
|
95
|
-
l(b, null, {
|
|
96
|
-
default: t(() => [
|
|
97
|
-
l(c(ve), { class: "size-4" }),
|
|
98
|
-
e[11] || (e[11] = u(" Add Reservation ", -1))
|
|
99
|
-
]),
|
|
100
|
-
_: 1
|
|
101
|
-
})
|
|
102
|
-
]),
|
|
103
|
-
_: 1
|
|
104
|
-
}),
|
|
105
|
-
l(ne, { class: "sm:max-w-xl" }, {
|
|
106
|
-
default: t(() => [
|
|
107
|
-
l(I, null, {
|
|
108
|
-
default: t(() => [
|
|
109
|
-
l(O, null, {
|
|
110
|
-
default: t(() => [...e[12] || (e[12] = [
|
|
111
|
-
u("Create new reservation", -1)
|
|
112
|
-
])]),
|
|
113
|
-
_: 1
|
|
114
|
-
}),
|
|
115
|
-
l(F)
|
|
116
|
-
]),
|
|
117
|
-
_: 1
|
|
118
|
-
}),
|
|
119
|
-
o("div", Se, [
|
|
120
|
-
o("div", be, [
|
|
121
|
-
o("div", xe, [
|
|
122
|
-
o("div", ye, [
|
|
123
|
-
l(m, null, {
|
|
124
|
-
default: t(() => [...e[13] || (e[13] = [
|
|
125
|
-
u("Spots/tickets", -1)
|
|
126
|
-
])]),
|
|
127
|
-
_: 1
|
|
128
|
-
}),
|
|
129
|
-
o("div", Pe, [
|
|
130
|
-
l(x, {
|
|
131
|
-
modelValue: V.value,
|
|
132
|
-
"onUpdate:modelValue": e[0] || (e[0] = (a) => V.value = a),
|
|
133
|
-
modelModifiers: { number: !0 },
|
|
134
|
-
type: "number",
|
|
135
|
-
min: "1",
|
|
136
|
-
class: "no-spinner"
|
|
137
|
-
}, null, 8, ["modelValue"])
|
|
138
|
-
])
|
|
139
|
-
]),
|
|
140
|
-
o("div", we, [
|
|
141
|
-
l(m, null, {
|
|
142
|
-
default: t(() => [...e[14] || (e[14] = [
|
|
143
|
-
u("Total price paid", -1)
|
|
144
|
-
])]),
|
|
145
|
-
_: 1
|
|
146
|
-
}),
|
|
147
|
-
o("div", $e, [
|
|
148
|
-
l(x, {
|
|
149
|
-
modelValue: f.value,
|
|
150
|
-
"onUpdate:modelValue": e[1] || (e[1] = (a) => f.value = a),
|
|
151
|
-
modelModifiers: { number: !0 },
|
|
152
|
-
type: "number",
|
|
153
|
-
min: "0",
|
|
154
|
-
class: "no-spinner"
|
|
155
|
-
}, null, 8, ["modelValue"]),
|
|
156
|
-
u(" " + D(c(i).currency), 1)
|
|
157
|
-
])
|
|
158
|
-
]),
|
|
159
|
-
o("div", Ce, [
|
|
160
|
-
l(m, null, {
|
|
161
|
-
default: t(() => [...e[15] || (e[15] = [
|
|
162
|
-
u("Resource", -1)
|
|
163
|
-
])]),
|
|
164
|
-
_: 1
|
|
165
|
-
}),
|
|
166
|
-
l(G, {
|
|
167
|
-
modelValue: r.value,
|
|
168
|
-
"onUpdate:modelValue": e[2] || (e[2] = (a) => r.value = a)
|
|
169
|
-
}, {
|
|
170
|
-
default: t(() => [
|
|
171
|
-
l(j, { class: "w-full" }, {
|
|
172
|
-
default: t(() => [
|
|
173
|
-
l(E, { placeholder: "Select resource" })
|
|
174
|
-
]),
|
|
175
|
-
_: 1
|
|
176
|
-
}),
|
|
177
|
-
l(z, null, {
|
|
178
|
-
default: t(() => [
|
|
179
|
-
l(H, null, {
|
|
180
|
-
default: t(() => [
|
|
181
|
-
(_(!0), y(k, null, M(c(i).resources, (a) => (_(), U(A, {
|
|
182
|
-
value: a.id
|
|
183
|
-
}, {
|
|
184
|
-
default: t(() => [
|
|
185
|
-
u(D(a.name), 1)
|
|
186
|
-
]),
|
|
187
|
-
_: 2
|
|
188
|
-
}, 1032, ["value"]))), 256))
|
|
189
|
-
]),
|
|
190
|
-
_: 1
|
|
191
|
-
})
|
|
192
|
-
]),
|
|
193
|
-
_: 1
|
|
194
|
-
})
|
|
195
|
-
]),
|
|
196
|
-
_: 1
|
|
197
|
-
}, 8, ["modelValue"])
|
|
198
|
-
]),
|
|
199
|
-
o("div", Te, [
|
|
200
|
-
l(m, null, {
|
|
201
|
-
default: t(() => [...e[16] || (e[16] = [
|
|
202
|
-
u("Type", -1)
|
|
203
|
-
])]),
|
|
204
|
-
_: 1
|
|
205
|
-
}),
|
|
206
|
-
l(G, {
|
|
207
|
-
modelValue: v.value,
|
|
208
|
-
"onUpdate:modelValue": e[3] || (e[3] = (a) => v.value = a)
|
|
209
|
-
}, {
|
|
210
|
-
default: t(() => [
|
|
211
|
-
l(j, { class: "w-full" }, {
|
|
212
|
-
default: t(() => [
|
|
213
|
-
l(E, { placeholder: "Select type" })
|
|
214
|
-
]),
|
|
215
|
-
_: 1
|
|
216
|
-
}),
|
|
217
|
-
l(z, null, {
|
|
218
|
-
default: t(() => [
|
|
219
|
-
l(H, null, {
|
|
220
|
-
default: t(() => [
|
|
221
|
-
(_(!0), y(k, null, M(c(i).pricingOptions, (a) => (_(), U(A, {
|
|
222
|
-
value: a.id
|
|
223
|
-
}, {
|
|
224
|
-
default: t(() => [
|
|
225
|
-
u(D(a.name) + " (" + D(a.duration) + "min) ", 1)
|
|
226
|
-
]),
|
|
227
|
-
_: 2
|
|
228
|
-
}, 1032, ["value"]))), 256))
|
|
229
|
-
]),
|
|
230
|
-
_: 1
|
|
231
|
-
})
|
|
232
|
-
]),
|
|
233
|
-
_: 1
|
|
234
|
-
})
|
|
235
|
-
]),
|
|
236
|
-
_: 1
|
|
237
|
-
}, 8, ["modelValue"])
|
|
238
|
-
])
|
|
239
|
-
])
|
|
240
|
-
]),
|
|
241
|
-
o("div", he, [
|
|
242
|
-
o("div", Ne, [
|
|
243
|
-
o("div", Oe, [
|
|
244
|
-
l(m, null, {
|
|
245
|
-
default: t(() => [...e[17] || (e[17] = [
|
|
246
|
-
u("Date", -1)
|
|
247
|
-
])]),
|
|
248
|
-
_: 1
|
|
249
|
-
}),
|
|
250
|
-
l(te, null, {
|
|
251
|
-
default: t(({ close: a }) => [
|
|
252
|
-
l(Z, { "as-child": "" }, {
|
|
253
|
-
default: t(() => [
|
|
254
|
-
l(b, {
|
|
255
|
-
variant: "outline",
|
|
256
|
-
class: ce(c(Ve)("w-full justify-start text-left font-normal", !g.value && "text-muted-foreground"))
|
|
257
|
-
}, {
|
|
258
|
-
default: t(() => [
|
|
259
|
-
l(c(me)),
|
|
260
|
-
u(" " + D(g.value ? c(W).format(g.value.toDate(c(R)())) : "Pick a date"), 1)
|
|
261
|
-
]),
|
|
262
|
-
_: 1
|
|
263
|
-
}, 8, ["class"])
|
|
264
|
-
]),
|
|
265
|
-
_: 1
|
|
266
|
-
}),
|
|
267
|
-
l(le, {
|
|
268
|
-
class: "w-auto p-0",
|
|
269
|
-
align: "start"
|
|
270
|
-
}, {
|
|
271
|
-
default: t(() => [
|
|
272
|
-
l(ee, {
|
|
273
|
-
modelValue: g.value,
|
|
274
|
-
"onUpdate:modelValue": [
|
|
275
|
-
e[4] || (e[4] = (ue) => g.value = ue),
|
|
276
|
-
a
|
|
277
|
-
],
|
|
278
|
-
"default-placeholder": c(Q),
|
|
279
|
-
layout: "month-and-year",
|
|
280
|
-
"initial-focus": "",
|
|
281
|
-
minValue: c(q)(c(R)())
|
|
282
|
-
}, null, 8, ["modelValue", "default-placeholder", "onUpdate:modelValue", "minValue"])
|
|
283
|
-
]),
|
|
284
|
-
_: 2
|
|
285
|
-
}, 1024)
|
|
286
|
-
]),
|
|
287
|
-
_: 1
|
|
288
|
-
})
|
|
289
|
-
])
|
|
290
|
-
]),
|
|
291
|
-
o("div", Fe, [
|
|
292
|
-
o("div", Ie, [
|
|
293
|
-
l(m, null, {
|
|
294
|
-
default: t(() => [...e[18] || (e[18] = [
|
|
295
|
-
u("Start time", -1)
|
|
296
|
-
])]),
|
|
297
|
-
_: 1
|
|
298
|
-
}),
|
|
299
|
-
l(ae, {
|
|
300
|
-
modelValue: p.value,
|
|
301
|
-
"onUpdate:modelValue": e[5] || (e[5] = (a) => p.value = a)
|
|
302
|
-
}, null, 8, ["modelValue"])
|
|
303
|
-
]),
|
|
304
|
-
o("div", Ue, [
|
|
305
|
-
l(m, null, {
|
|
306
|
-
default: t(() => [...e[19] || (e[19] = [
|
|
307
|
-
u("End time", -1)
|
|
308
|
-
])]),
|
|
309
|
-
_: 1
|
|
310
|
-
}),
|
|
311
|
-
o("div", ke, D(c(B) || "--:--"), 1)
|
|
312
|
-
])
|
|
313
|
-
])
|
|
314
|
-
]),
|
|
315
|
-
o("div", Me, [
|
|
316
|
-
o("div", Re, [
|
|
317
|
-
o("div", Le, [
|
|
318
|
-
l(m, null, {
|
|
319
|
-
default: t(() => [...e[20] || (e[20] = [
|
|
320
|
-
u("Firstname", -1)
|
|
321
|
-
])]),
|
|
322
|
-
_: 1
|
|
323
|
-
}),
|
|
324
|
-
l(x, {
|
|
325
|
-
modelValue: P.value,
|
|
326
|
-
"onUpdate:modelValue": e[6] || (e[6] = (a) => P.value = a)
|
|
327
|
-
}, null, 8, ["modelValue"])
|
|
328
|
-
]),
|
|
329
|
-
o("div", Be, [
|
|
330
|
-
l(m, null, {
|
|
331
|
-
default: t(() => [...e[21] || (e[21] = [
|
|
332
|
-
u("Lastname", -1)
|
|
333
|
-
])]),
|
|
334
|
-
_: 1
|
|
335
|
-
}),
|
|
336
|
-
l(x, {
|
|
337
|
-
modelValue: w.value,
|
|
338
|
-
"onUpdate:modelValue": e[7] || (e[7] = (a) => w.value = a)
|
|
339
|
-
}, null, 8, ["modelValue"])
|
|
340
|
-
])
|
|
341
|
-
]),
|
|
342
|
-
o("div", Ee, [
|
|
343
|
-
o("div", je, [
|
|
344
|
-
l(m, null, {
|
|
345
|
-
default: t(() => [...e[22] || (e[22] = [
|
|
346
|
-
u("E-mail", -1)
|
|
347
|
-
])]),
|
|
348
|
-
_: 1
|
|
349
|
-
}),
|
|
350
|
-
l(x, {
|
|
351
|
-
modelValue: S.value,
|
|
352
|
-
"onUpdate:modelValue": e[8] || (e[8] = (a) => S.value = a)
|
|
353
|
-
}, null, 8, ["modelValue"])
|
|
354
|
-
]),
|
|
355
|
-
o("div", Ae, [
|
|
356
|
-
l(m, null, {
|
|
357
|
-
default: t(() => [...e[23] || (e[23] = [
|
|
358
|
-
u("Phone Nr ", -1),
|
|
359
|
-
o("span", { class: "italic text-xs opacity-50" }, "optional", -1)
|
|
360
|
-
])]),
|
|
361
|
-
_: 1
|
|
362
|
-
}),
|
|
363
|
-
l(x, {
|
|
364
|
-
modelValue: h.value,
|
|
365
|
-
"onUpdate:modelValue": e[9] || (e[9] = (a) => h.value = a)
|
|
366
|
-
}, null, 8, ["modelValue"])
|
|
367
|
-
])
|
|
368
|
-
])
|
|
369
|
-
]),
|
|
370
|
-
o("div", He, [
|
|
371
|
-
o("ul", ze, [
|
|
372
|
-
(_(!0), y(k, null, M(T.value, (a) => (_(), y("li", { key: a }, D(a), 1))), 128))
|
|
373
|
-
])
|
|
374
|
-
])
|
|
375
|
-
]),
|
|
376
|
-
l(oe, { class: "gap-2" }, {
|
|
377
|
-
default: t(() => [
|
|
378
|
-
l(b, {
|
|
379
|
-
onClick: Y,
|
|
380
|
-
disabled: C.value
|
|
381
|
-
}, {
|
|
382
|
-
default: t(() => [
|
|
383
|
-
C.value ? (_(), y("span", Ge, "Creating...")) : (_(), y("span", qe, "Create reservation"))
|
|
384
|
-
]),
|
|
385
|
-
_: 1
|
|
386
|
-
}, 8, ["disabled"])
|
|
387
|
-
]),
|
|
388
|
-
_: 1
|
|
389
|
-
})
|
|
390
|
-
]),
|
|
391
|
-
_: 1
|
|
392
|
-
})
|
|
393
|
-
]),
|
|
394
|
-
_: 1
|
|
395
|
-
}, 8, ["open"]);
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
export {
|
|
400
|
-
Ze as _
|
|
401
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),O=require("lucide-vue-next"),b=require("@oneclick.dev/cms-kit"),X=require("./utils-Yd6F5mea.js"),f=require("./DateFormatter-CYAD4GBN.js"),Y={class:"@container/new-res-form space-y-5 py-4"},Z={class:"grid gap-4"},ee={class:"grid gap-4 @md/new-res-form:grid-cols-2"},te={class:"grid gap-2"},oe={class:"flex gap-2 items-center"},ae={class:"grid gap-2"},le={class:"flex gap-2 items-center"},ne={class:"grid gap-2"},re={class:"grid gap-2"},se={class:"grid gap-4"},de={class:"grid gap-4 @md/new-res-form:grid-cols-2"},ie={class:"grid gap-2"},ue={class:"grid gap-4 @md/new-res-form:grid-cols-2"},ce={class:"grid gap-2"},pe={class:"grid gap-2"},me={class:"flex items-center h-9 px-3 text-sm text-muted-foreground"},ve={class:"grid gap-4"},fe={class:"grid gap-4 @md/new-res-form:grid-cols-2"},Ve={class:"grid gap-2"},ge={class:"grid gap-2"},Ne={class:"grid gap-4 @md/new-res-form:grid-cols-2"},_e={class:"grid gap-2"},xe={class:"grid gap-2"},Ce={class:"mt-4 text-red-400"},we={class:"list-disc pl-4"},he={key:0},De={key:1},Ee=e.defineComponent({__name:"NewReservationDialog",setup(be){const{params:I}=b.useModuleRoute(),{config:S}=b.useModule(),U=b.useFirebaseIntegration(S.project),N=e.ref(!1);e.watch(N,a=>{a&&(x.value=[],c.value=1,i.value=0,n.value=l.value?.resources?.[0]?.id??"",s.value=l.value?.pricingOptions?.find(t=>t.isDefault===!0)?.id??"",r.value="",V.value="",g.value="",p.value="",C.value="")});const _=e.ref(!1),l=e.inject("agendaData",e.ref({})),x=e.ref([]),c=e.ref(1),i=e.ref(0),n=e.ref(""),s=e.ref(""),r=e.ref(""),V=e.ref(""),g=e.ref(""),p=e.ref(""),C=e.ref(""),L=f.$ad063034c8620db8$export$d0bdf45af03a6ea3(f.$ad063034c8620db8$export$aa8b41735afcabd2()),u=e.ref(),M=new f.$12a3c853105e5a70$export$ad991b66133851cf("en-US",{dateStyle:"long"}),T=e.computed(()=>{if(!r.value||!s.value)return"";const a=l.value?.pricingOptions?.find(E=>E.id===s.value);if(!a?.duration)return r.value;const[t,m]=r.value.split(":").map(Number);if(isNaN(t)||isNaN(m))return"";const w=t*60+m+a.duration,h=Math.floor(w/60)%24,D=w%60;return`${h.toString().padStart(2,"0")}:${D.toString().padStart(2,"0")}`}),R=()=>{const a=[];return x.value=[],c.value<1&&c.value>9999&&a.push("Please fill in a correct number of spots."),i.value<0&&(i.value=0),n.value||a.push("Please select a resource."),s.value||a.push("Please select a type."),u.value||a.push("Please select the booking date."),(!r.value||r.value.length!==5||r.value?.indexOf(":")===-1||!parseInt(r.value?.replace(":","")))&&a.push("Please select a correct booking time."),V.value||a.push("Please fill in the first name of the customer."),g.value||a.push("Please fill in the last name of the customer."),(!p.value||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.value)===!1)&&a.push("Please fill in the correct email of the customer."),x.value=a,a.length===0},q=async()=>{if(R())try{_.value=!0;const a={agendaId:I.value.id,customerInfo:{firstName:V.value,lastName:g.value,email:p.value,phone:C.value},amountPaid:parseFloat(i.value)??0,amountDue:0,subtotal:parseFloat(i.value)??0,total:parseFloat(i.value)??0,createdAt:new Date,updatedAt:new Date,discount:0,flattenedReservationDates:[`${n.value}_${u.value}`],flattenedReservations:[`${n.value}_${u.value}_${r.value?.replace(":","")}`],paymentStatus:"paid",paymentType:"full",reservations:[{status:"approved",totalPrice:parseFloat(i.value?.toFixed(2))??0,basePrice:parseFloat((i.value/c.value).toFixed(2))??0,addOnsPrice:0,addOns:[],date:`${u.value}`,id:`res_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,pricingOption:{duration:l.value?.pricingOptions?.find(t=>t.id===s.value)?.duration||"",id:l.value?.pricingOptions?.find(t=>t.id===s.value)?.id||"",name:l.value?.pricingOptions?.find(t=>t.id===s.value)?.name||"",price:l.value?.pricingOptions?.find(t=>t.id===s.value)?.price||""},pricingOptionId:s.value,resource:{avatarLabel:l.value?.resources?.find(t=>t.id===n.value)?.avatarLabel||"",color:l.value?.resources?.find(t=>t.id===n.value)?.color||"",description:l.value?.resources?.find(t=>t.id===n.value)?.description||"",id:l.value?.resources?.find(t=>t.id===n.value)?.id||"",name:l.value?.resources?.find(t=>t.id===n.value)?.name||""},resourceId:n.value,spots:c.value,timeslot:{startTime:r.value,endTime:T.value}}],status:"confirmed"};await U.add(S.reservationsCollection,a)}catch{}finally{_.value=!1,N.value=!1}};return(a,t)=>{const m=e.resolveComponent("Button"),w=e.resolveComponent("DialogTrigger"),h=e.resolveComponent("DialogTitle"),D=e.resolveComponent("DialogDescription"),E=e.resolveComponent("DialogHeader"),d=e.resolveComponent("Label"),v=e.resolveComponent("Input"),y=e.resolveComponent("SelectValue"),$=e.resolveComponent("SelectTrigger"),k=e.resolveComponent("SelectItem"),P=e.resolveComponent("SelectGroup"),B=e.resolveComponent("SelectContent"),F=e.resolveComponent("Select"),j=e.resolveComponent("PopoverTrigger"),A=e.resolveComponent("Calendar"),H=e.resolveComponent("PopoverContent"),z=e.resolveComponent("Popover"),G=e.resolveComponent("TimeInput"),K=e.resolveComponent("DialogFooter"),J=e.resolveComponent("DialogScrollContent"),Q=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(Q,{open:N.value,"onUpdate:open":t[10]||(t[10]=o=>N.value=o)},{default:e.withCtx(()=>[e.createVNode(w,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[e.createVNode(e.unref(O.Plus),{class:"size-4"}),t[11]||(t[11]=e.createTextVNode(" Add Reservation ",-1))]),_:1})]),_:1}),e.createVNode(J,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(h,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("Create new reservation",-1)])]),_:1}),e.createVNode(D)]),_:1}),e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode("Spots/tickets",-1)])]),_:1}),e.createElementVNode("div",oe,[e.createVNode(v,{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=o=>c.value=o),modelModifiers:{number:!0},type:"number",min:"1",class:"no-spinner"},null,8,["modelValue"])])]),e.createElementVNode("div",ae,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode("Total price paid",-1)])]),_:1}),e.createElementVNode("div",le,[e.createVNode(v,{modelValue:i.value,"onUpdate:modelValue":t[1]||(t[1]=o=>i.value=o),modelModifiers:{number:!0},type:"number",min:"0",class:"no-spinner"},null,8,["modelValue"]),e.createTextVNode(" "+e.toDisplayString(e.unref(l).currency),1)])]),e.createElementVNode("div",ne,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[15]||(t[15]=[e.createTextVNode("Resource",-1)])]),_:1}),e.createVNode(F,{modelValue:n.value,"onUpdate:modelValue":t[2]||(t[2]=o=>n.value=o)},{default:e.withCtx(()=>[e.createVNode($,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(y,{placeholder:"Select resource"})]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(P,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).resources,o=>(e.openBlock(),e.createBlock(k,{value:o.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name),1)]),_:2},1032,["value"]))),256))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",re,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode("Type",-1)])]),_:1}),e.createVNode(F,{modelValue:s.value,"onUpdate:modelValue":t[3]||(t[3]=o=>s.value=o)},{default:e.withCtx(()=>[e.createVNode($,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(y,{placeholder:"Select type"})]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(P,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).pricingOptions,o=>(e.openBlock(),e.createBlock(k,{value:o.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name)+" ("+e.toDisplayString(o.duration)+"min) ",1)]),_:2},1032,["value"]))),256))]),_:1})]),_:1})]),_:1},8,["modelValue"])])])]),e.createElementVNode("div",se,[e.createElementVNode("div",de,[e.createElementVNode("div",ie,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode("Date",-1)])]),_:1}),e.createVNode(z,null,{default:e.withCtx(({close:o})=>[e.createVNode(j,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,{variant:"outline",class:e.normalizeClass(e.unref(X.classNames)("w-full justify-start text-left font-normal",!u.value&&"text-muted-foreground"))},{default:e.withCtx(()=>[e.createVNode(e.unref(O.CalendarIcon)),e.createTextVNode(" "+e.toDisplayString(u.value?e.unref(M).format(u.value.toDate(e.unref(f.$ad063034c8620db8$export$aa8b41735afcabd2)())):"Pick a date"),1)]),_:1},8,["class"])]),_:1}),e.createVNode(H,{class:"w-auto p-0",align:"start"},{default:e.withCtx(()=>[e.createVNode(A,{modelValue:u.value,"onUpdate:modelValue":[t[4]||(t[4]=W=>u.value=W),o],"default-placeholder":e.unref(L),layout:"month-and-year","initial-focus":"",minValue:e.unref(f.$ad063034c8620db8$export$d0bdf45af03a6ea3)(e.unref(f.$ad063034c8620db8$export$aa8b41735afcabd2)())},null,8,["modelValue","default-placeholder","onUpdate:modelValue","minValue"])]),_:2},1024)]),_:1})])]),e.createElementVNode("div",ue,[e.createElementVNode("div",ce,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createTextVNode("Start time",-1)])]),_:1}),e.createVNode(G,{modelValue:r.value,"onUpdate:modelValue":t[5]||(t[5]=o=>r.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",pe,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createTextVNode("End time",-1)])]),_:1}),e.createElementVNode("div",me,e.toDisplayString(e.unref(T)||"--:--"),1)])])]),e.createElementVNode("div",ve,[e.createElementVNode("div",fe,[e.createElementVNode("div",Ve,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createTextVNode("Firstname",-1)])]),_:1}),e.createVNode(v,{modelValue:V.value,"onUpdate:modelValue":t[6]||(t[6]=o=>V.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",ge,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[21]||(t[21]=[e.createTextVNode("Lastname",-1)])]),_:1}),e.createVNode(v,{modelValue:g.value,"onUpdate:modelValue":t[7]||(t[7]=o=>g.value=o)},null,8,["modelValue"])])]),e.createElementVNode("div",Ne,[e.createElementVNode("div",_e,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[22]||(t[22]=[e.createTextVNode("E-mail",-1)])]),_:1}),e.createVNode(v,{modelValue:p.value,"onUpdate:modelValue":t[8]||(t[8]=o=>p.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",xe,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[23]||(t[23]=[e.createTextVNode("Phone Nr ",-1),e.createElementVNode("span",{class:"italic text-xs opacity-50"},"optional",-1)])]),_:1}),e.createVNode(v,{modelValue:C.value,"onUpdate:modelValue":t[9]||(t[9]=o=>C.value=o)},null,8,["modelValue"])])])]),e.createElementVNode("div",Ce,[e.createElementVNode("ul",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,o=>(e.openBlock(),e.createElementBlock("li",{key:o},e.toDisplayString(o),1))),128))])])]),e.createVNode(K,{class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(m,{onClick:q,disabled:_.value},{default:e.withCtx(()=>[_.value?(e.openBlock(),e.createElementBlock("span",he,"Creating...")):(e.openBlock(),e.createElementBlock("span",De,"Create reservation"))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])}}});exports._sfc_main=Ee;
|