@oneclick.dev/cms-core-modules 0.0.83 → 0.0.84
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/{ContentEditor-CxKirDdL.mjs → ContentEditor-DPhhOkx3.mjs} +7068 -5926
- package/dist/{ContentEditor-CRFkD4tE.js → ContentEditor-DrxtH_Hq.js} +42 -42
- package/dist/{Create-CsqVYhPO.mjs → Create-6uT9HWar.mjs} +35 -35
- package/dist/{Create-ip0MnS0o.js → Create-DuZ5nZrX.js} +1 -1
- package/dist/{DateFormatter-CvOfaUnU.mjs → DateFormatter-2B0R-DY4.mjs} +204 -400
- package/dist/DateFormatter-DbtOLV0L.js +1 -0
- package/dist/{Detail-RMXFuSRQ.js → Detail-BZ-iE9vf.js} +1 -1
- package/dist/{Detail-B4b_FLDa.mjs → Detail-C1Blq61w.mjs} +90 -90
- package/dist/{Detail-BayNaAg9.js → Detail-C8wQiDcv.js} +1 -1
- package/dist/{Detail-CbLk1v37.mjs → Detail-CJVMJDP7.mjs} +17 -17
- package/dist/{Detail-CnK-qbhE.js → Detail-CPqug27l.js} +1 -1
- package/dist/Detail-CjuhjPby.js +1 -0
- package/dist/{Detail-U0mgLKt6.mjs → Detail-CtItxMX4.mjs} +62 -63
- package/dist/{Detail-CVgWHbMC.mjs → Detail-Dnpnmy4-.mjs} +158 -158
- package/dist/{Entries-D7MHylQE.mjs → Entries-BkOPae4R.mjs} +49 -49
- package/dist/Entries-CcEW98F5.js +1 -0
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CDc8MIq2.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-StaNp-3y.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js} +1 -1
- package/dist/{Overview-CwCAeBnX.js → Overview-CA8wh_BI.js} +1 -1
- package/dist/{Overview-CgViRnNc.mjs → Overview-D4MFwRI_.mjs} +67 -68
- package/dist/{Overview-B2bFNGhH.js → Overview-Da0XexiT.js} +1 -1
- package/dist/Overview-DeQQ0FY3.js +1 -0
- package/dist/{Overview--XpvBbqz.mjs → Overview-DoOASlNz.mjs} +1 -3
- package/dist/{Overview-Cczt_dcE.mjs → Overview-gJSvftdE.mjs} +34 -34
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs} +0 -1
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-VWVIxIr6.js} +1 -1
- package/dist/{SeoHealth-ZpvB7CS2.mjs → SeoHealth-Bc5chnaa.mjs} +14 -14
- package/dist/{SeoHealth-DFZ0LLBH.js → SeoHealth-BkpJ1F2Y.js} +1 -1
- package/dist/TableView-BPWAx--G.mjs +5743 -0
- package/dist/TableView-D63QrVlK.js +4 -0
- package/dist/View-BL70u98U.js +1 -0
- package/dist/{View-DDXN0tKD.mjs → View-BO5N911y.mjs} +5 -5
- package/dist/{agenda-Cl3s_FIE.mjs → agenda-C5grvzSa.mjs} +166 -169
- package/dist/agenda-DXMwVWpN.js +1 -0
- package/dist/{availability-B-tRp8hB.mjs → availability-C1NqOFsQ.mjs} +81 -81
- package/dist/{availability-BiBbzEIM.js → availability-D_wnfLsH.js} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-DQPSFSj7.mjs → exceptions-BIwMhYa4.mjs} +1 -1
- package/dist/{exceptions-BA3PsW4n.js → exceptions-Cn7zooEu.js} +1 -1
- package/dist/{index-CBC9dWZ9.js → index-C9pSS15N.js} +2 -2
- package/dist/{index-YOOlBEZB.mjs → index-MwjeLHPP.mjs} +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +22 -22
- package/dist/orders-CG1QUCN8.js +1 -0
- package/dist/{orders-DZzdsHOW.mjs → orders-CeixEBcU.mjs} +57 -58
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +142 -147
- package/package.json +2 -2
- package/dist/DateFormatter-ls6HfWpS.js +0 -1
- package/dist/Detail-BcboL7NF.js +0 -1
- package/dist/Entries-BPkZ7Jg5.js +0 -1
- package/dist/Overview-B-8TLLjh.js +0 -1
- package/dist/TableView-BUPPcHUW.mjs +0 -89505
- package/dist/TableView-CksiPsTL.js +0 -586
- package/dist/View-DfzaVOzS.js +0 -1
- package/dist/agenda-rlFma_wn.js +0 -1
- package/dist/floating-ui.dom-B9WYoHj2.js +0 -1
- package/dist/floating-ui.dom-fpIfhXTZ.mjs +0 -1291
- package/dist/index-DYpruS-A-Cw57iwdY.mjs +0 -4210
- package/dist/index-DYpruS-A-DwDXo9Tq.js +0 -88
- package/dist/index-YMaY4uuk-BgpTtr73.js +0 -1
- package/dist/index-YMaY4uuk-C_xV5K9Z.mjs +0 -1300
- package/dist/orders-tP4WdF5q.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as K, resolveComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as K, resolveComponent as P, openBlock as o, createElementBlock as u, createElementVNode as e, Fragment as X, renderList as Y, toDisplayString as v, normalizeStyle as q, normalizeClass as R, createVNode as d, withCtx as $, unref as b, createTextVNode as ne, createCommentVNode as M, ref as S, createBlock as Q, provide as Z, computed as U, onMounted as pe, onUnmounted as fe, inject as ie, nextTick as xe, onBeforeUnmount as ze, watch as le } from "vue";
|
|
2
|
+
import { c as ue, b as de } from "./DateFormatter-2B0R-DY4.mjs";
|
|
3
3
|
import { X as we, Search as Ee, Clock as ge, Users as he, ChevronLeft as ve, ChevronRight as ce, Asterisk as Ie, CalendarDays as Be } from "lucide-vue-next";
|
|
4
4
|
import { _ as Le } from "./EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs";
|
|
5
|
-
import { useModule as
|
|
6
|
-
import { _ as je, F as Pe } from "./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as be } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
const
|
|
5
|
+
import { useModule as Se, useModuleRoute as $e, useFirebaseIntegration as Te, useModulePermissions as Ue } from "@oneclick.dev/cms-kit";
|
|
6
|
+
import { _ as je, F as Pe } from "./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs";
|
|
7
|
+
import { _ as Re } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
8
|
+
import { _ as be } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs";
|
|
9
|
+
const Ne = { class: "mb-6" }, Oe = { class: "flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible" }, Fe = ["onClick"], Ae = { class: "absolute -top-8 left-1/2 -translate-x-1/2 bg-popover border shadow-md rounded px-2 py-1 text-xs whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10" }, Ve = { class: "font-medium" }, We = { class: "text-muted-foreground" }, He = { class: "w-full flex-1 flex items-end justify-center" }, Qe = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "text-[10px] mt-1"
|
|
12
12
|
}, Xe = {
|
|
@@ -27,11 +27,11 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
27
27
|
}, I = () => {
|
|
28
28
|
y("clear");
|
|
29
29
|
};
|
|
30
|
-
return (a,
|
|
31
|
-
const c =
|
|
32
|
-
return o(), u("div",
|
|
33
|
-
|
|
34
|
-
e("div",
|
|
30
|
+
return (a, l) => {
|
|
31
|
+
const c = P("Button");
|
|
32
|
+
return o(), u("div", Ne, [
|
|
33
|
+
l[2] || (l[2] = e("h3", { class: "font-semibold text-sm mb-2" }, "Timeline", -1)),
|
|
34
|
+
e("div", Oe, [
|
|
35
35
|
(o(!0), u(X, null, Y(f.timeSlots, (s) => (o(), u("div", {
|
|
36
36
|
key: s.startTime,
|
|
37
37
|
class: "flex-1 min-w-0 flex flex-col items-center cursor-pointer group h-full relative",
|
|
@@ -65,15 +65,15 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
65
65
|
class: "h-6 w-6 p-0",
|
|
66
66
|
onClick: I
|
|
67
67
|
}, {
|
|
68
|
-
default:
|
|
68
|
+
default: $(() => [
|
|
69
69
|
d(b(we), { size: 14 })
|
|
70
70
|
]),
|
|
71
71
|
_: 1
|
|
72
72
|
}),
|
|
73
73
|
e("span", null, [
|
|
74
|
-
|
|
74
|
+
l[0] || (l[0] = ne(" Showing ", -1)),
|
|
75
75
|
e("span", Ye, v(f.slotStats[f.selectedTimeSlot]?.bookings || 0), 1),
|
|
76
|
-
|
|
76
|
+
l[1] || (l[1] = ne(" bookings at ", -1)),
|
|
77
77
|
e("span", qe, v(f.selectedTimeSlot), 1)
|
|
78
78
|
])
|
|
79
79
|
])) : M("", !0)
|
|
@@ -92,7 +92,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
92
92
|
}, ot = {
|
|
93
93
|
key: 2,
|
|
94
94
|
class: "space-y-2 max-h-80 overflow-y-auto"
|
|
95
|
-
}, nt = ["onClick"], at = { class: "flex items-start justify-between" },
|
|
95
|
+
}, nt = ["onClick"], at = { class: "flex items-start justify-between" }, rt = { class: "flex-1" }, lt = { class: "font-medium" }, it = { class: "text-sm text-muted-foreground" }, ut = { class: "text-sm text-muted-foreground" }, dt = { class: "flex items-center gap-4" }, ct = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, mt = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, vt = { class: "text-right" }, pt = {
|
|
96
96
|
key: 0,
|
|
97
97
|
class: "inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"
|
|
98
98
|
}, ft = {
|
|
@@ -121,15 +121,15 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
121
121
|
},
|
|
122
122
|
emits: ["update:searchQuery", "refresh"],
|
|
123
123
|
setup(f, { emit: k }) {
|
|
124
|
-
const y = k, T =
|
|
124
|
+
const y = k, T = S(null), I = (c) => {
|
|
125
125
|
y("update:searchQuery", c);
|
|
126
126
|
}, a = () => {
|
|
127
127
|
y("update:searchQuery", "");
|
|
128
|
-
},
|
|
128
|
+
}, l = () => {
|
|
129
129
|
y("refresh");
|
|
130
130
|
};
|
|
131
131
|
return (c, s) => {
|
|
132
|
-
const w =
|
|
132
|
+
const w = P("Input"), _ = P("Button");
|
|
133
133
|
return o(), u("div", null, [
|
|
134
134
|
e("div", Ke, [
|
|
135
135
|
e("h3", Ge, [
|
|
@@ -155,7 +155,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
155
155
|
class: "absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",
|
|
156
156
|
onClick: a
|
|
157
157
|
}, {
|
|
158
|
-
default:
|
|
158
|
+
default: $(() => [
|
|
159
159
|
d(b(we), { size: 14 })
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
@@ -170,8 +170,8 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
170
170
|
onClick: (B) => b(T).openDialog(h)
|
|
171
171
|
}, [
|
|
172
172
|
e("div", at, [
|
|
173
|
-
e("div",
|
|
174
|
-
e("div",
|
|
173
|
+
e("div", rt, [
|
|
174
|
+
e("div", lt, v(h.customerInfo.firstName + " " + h.customerInfo.lastName || "Unknown Customer"), 1),
|
|
175
175
|
e("div", it, v(h.customerInfo.email), 1),
|
|
176
176
|
e("div", ut, v(h.customerInfo.phone), 1),
|
|
177
177
|
e("div", dt, [
|
|
@@ -195,9 +195,9 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
195
195
|
d(je, {
|
|
196
196
|
ref_key: "reservationDetailDialog",
|
|
197
197
|
ref: T,
|
|
198
|
-
onCancelled:
|
|
199
|
-
onConfirmed:
|
|
200
|
-
onRejected:
|
|
198
|
+
onCancelled: l,
|
|
199
|
+
onConfirmed: l,
|
|
200
|
+
onRejected: l
|
|
201
201
|
}, null, 512)
|
|
202
202
|
]);
|
|
203
203
|
};
|
|
@@ -205,19 +205,19 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
205
205
|
}), _t = { class: "flex items-center gap-4 mt-2 text-sm" }, kt = { class: "flex items-center gap-1" }, wt = {
|
|
206
206
|
key: 0,
|
|
207
207
|
class: "flex items-center gap-1"
|
|
208
|
-
},
|
|
208
|
+
}, St = { class: "flex items-center gap-1" }, $t = { class: "py-4" }, Tt = /* @__PURE__ */ K({
|
|
209
209
|
__name: "EventDialog",
|
|
210
210
|
props: {
|
|
211
211
|
resources: { default: () => [] }
|
|
212
212
|
},
|
|
213
213
|
setup(f, { expose: k }) {
|
|
214
|
-
const y = f, { config: T } =
|
|
214
|
+
const y = f, { config: T } = Se(), { params: I } = $e(), a = Te(T.project), l = S(!1), c = S(null), s = S([]), w = S(!1), _ = S(null), h = S("");
|
|
215
215
|
Z("event", c);
|
|
216
216
|
const B = U(() => {
|
|
217
217
|
if (!c.value) return [];
|
|
218
218
|
const p = c.value.resource?.interval || 60, n = [], [m, z] = c.value.startTime.split(":").map(Number), [A, C] = c.value.endTime.split(":").map(Number), O = m * 60 + z, t = A * 60 + C;
|
|
219
219
|
for (let i = O; i < t; i += p) {
|
|
220
|
-
const x = Math.floor(i / 60), g = i % 60, E = Math.min(i + p, t),
|
|
220
|
+
const x = Math.floor(i / 60), g = i % 60, E = Math.min(i + p, t), F = Math.floor(E / 60), r = E % 60, V = `${x.toString().padStart(2, "0")}:${g.toString().padStart(2, "0")}`, H = `${F.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
|
|
221
221
|
n.push({
|
|
222
222
|
startTime: V,
|
|
223
223
|
endTime: H,
|
|
@@ -249,7 +249,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
249
249
|
threshold: 0.3,
|
|
250
250
|
ignoreLocation: !0
|
|
251
251
|
}).search(h.value).map((m) => m.item)), p;
|
|
252
|
-
}),
|
|
252
|
+
}), N = U(() => ({
|
|
253
253
|
spots: s.value.reduce((p, n) => p + (n.spots || 0), 0),
|
|
254
254
|
bookings: s.value.length
|
|
255
255
|
})), ee = (p) => {
|
|
@@ -257,7 +257,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
257
257
|
}, J = () => {
|
|
258
258
|
_.value = null;
|
|
259
259
|
}, te = async (p) => {
|
|
260
|
-
|
|
260
|
+
l.value = !0, c.value = p, _.value = null, h.value = "", await G();
|
|
261
261
|
}, G = async () => {
|
|
262
262
|
if (c.value) {
|
|
263
263
|
w.value = !0, s.value = [];
|
|
@@ -276,8 +276,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
276
276
|
});
|
|
277
277
|
let A = [];
|
|
278
278
|
z.forEach((C) => {
|
|
279
|
-
|
|
280
|
-
console.log("dateReservations", O), O.forEach((t) => {
|
|
279
|
+
(C.reservations?.filter((t) => t.date === n) || []).forEach((t) => {
|
|
281
280
|
const i = y.resources.find((x) => x.id === t.resourceId);
|
|
282
281
|
(t.status === "approved" || t.status === "needs_approval") && A.push({
|
|
283
282
|
customerInfo: C.customerInfo,
|
|
@@ -315,24 +314,24 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
315
314
|
return k({
|
|
316
315
|
openDialog: te
|
|
317
316
|
}), (p, n) => {
|
|
318
|
-
const m =
|
|
317
|
+
const m = P("DialogTitle"), z = P("DialogDescription"), A = P("DialogHeader"), C = P("Button"), O = P("DialogFooter"), t = P("DialogScrollContent"), i = P("Dialog");
|
|
319
318
|
return o(), Q(i, {
|
|
320
|
-
open:
|
|
321
|
-
"onUpdate:open": n[2] || (n[2] = (x) =>
|
|
319
|
+
open: l.value,
|
|
320
|
+
"onUpdate:open": n[2] || (n[2] = (x) => l.value = x)
|
|
322
321
|
}, {
|
|
323
|
-
default:
|
|
322
|
+
default: $(() => [
|
|
324
323
|
d(t, { class: "sm:max-w-3xl" }, {
|
|
325
|
-
default:
|
|
324
|
+
default: $(() => [
|
|
326
325
|
d(A, null, {
|
|
327
|
-
default:
|
|
326
|
+
default: $(() => [
|
|
328
327
|
c.value?.date ? (o(), Q(m, { key: 0 }, {
|
|
329
|
-
default:
|
|
328
|
+
default: $(() => [
|
|
330
329
|
ne(v(ae[new Date(c.value.date).getUTCDay()]) + " " + v(se[new Date(c.value.date).getUTCMonth()]) + " " + v(new Date(c.value.date).getUTCDate()) + ", " + v(new Date(c.value.date).getUTCFullYear()), 1)
|
|
331
330
|
]),
|
|
332
331
|
_: 1
|
|
333
332
|
})) : M("", !0),
|
|
334
333
|
d(z, null, {
|
|
335
|
-
default:
|
|
334
|
+
default: $(() => [
|
|
336
335
|
e("div", _t, [
|
|
337
336
|
e("div", kt, [
|
|
338
337
|
d(b(ge), { size: 14 }),
|
|
@@ -345,9 +344,9 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
345
344
|
}, null, 4),
|
|
346
345
|
e("span", null, v(c.value.resource.name), 1)
|
|
347
346
|
])) : M("", !0),
|
|
348
|
-
e("div",
|
|
347
|
+
e("div", St, [
|
|
349
348
|
d(b(he), { size: 14 }),
|
|
350
|
-
e("span", null, v(
|
|
349
|
+
e("span", null, v(N.value.spots) + " spots in " + v(N.value.bookings) + " reservations", 1)
|
|
351
350
|
])
|
|
352
351
|
])
|
|
353
352
|
]),
|
|
@@ -356,7 +355,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
356
355
|
]),
|
|
357
356
|
_: 1
|
|
358
357
|
}),
|
|
359
|
-
e("div",
|
|
358
|
+
e("div", $t, [
|
|
360
359
|
B.value.length > 1 ? (o(), Q(Je, {
|
|
361
360
|
key: 0,
|
|
362
361
|
"time-slots": B.value,
|
|
@@ -377,12 +376,12 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
377
376
|
}, null, 8, ["orders", "filtered-orders", "is-loading", "selected-time-slot", "search-query"])
|
|
378
377
|
]),
|
|
379
378
|
d(O, null, {
|
|
380
|
-
default:
|
|
379
|
+
default: $(() => [
|
|
381
380
|
d(C, {
|
|
382
381
|
variant: "outline",
|
|
383
|
-
onClick: n[1] || (n[1] = (x) =>
|
|
382
|
+
onClick: n[1] || (n[1] = (x) => l.value = !1)
|
|
384
383
|
}, {
|
|
385
|
-
default:
|
|
384
|
+
default: $(() => [...n[3] || (n[3] = [
|
|
386
385
|
ne("Close", -1)
|
|
387
386
|
])]),
|
|
388
387
|
_: 1
|
|
@@ -401,7 +400,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
401
400
|
}), Dt = { class: "flex-1 border-r shadow-sm overflow-hidden min-h-[1536px]" }, Ct = { class: "relative h-full min-h-[1536px]" }, Mt = { class: "divide-y divide-input/80 h-full flex flex-col min-h-[1536px] border-y border-input/80" }, zt = { class: "absolute inset-0 pointer-events-none" }, Et = { class: "relative mr-3 h-full ml-2" }, It = ["onClick"], Bt = {
|
|
402
401
|
key: 0,
|
|
403
402
|
class: "absolute bottom-0 left-0 right-0 h-1 bg-black/20"
|
|
404
|
-
}, Lt = { class: "flex items-start justify-between gap-2 mb-1" }, Ut = { class: "font-semibold text-sm leading-tight line-clamp-1 flex-1" }, jt = { class: "flex items-center gap-1 shrink-0" }, Pt = ["title"],
|
|
403
|
+
}, Lt = { class: "flex items-start justify-between gap-2 mb-1" }, Ut = { class: "font-semibold text-sm leading-tight line-clamp-1 flex-1" }, jt = { class: "flex items-center gap-1 shrink-0" }, Pt = ["title"], Rt = { class: "font-medium" }, ye = /* @__PURE__ */ K({
|
|
405
404
|
__name: "EventTimeline",
|
|
406
405
|
props: {
|
|
407
406
|
date: {},
|
|
@@ -410,12 +409,12 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
410
409
|
resources: { default: () => [] }
|
|
411
410
|
},
|
|
412
411
|
setup(f) {
|
|
413
|
-
const k = f, y =
|
|
414
|
-
const [c, s] =
|
|
412
|
+
const k = f, y = S(null), T = (l) => {
|
|
413
|
+
const [c, s] = l.split(":").map(Number);
|
|
415
414
|
return c * 60 + s;
|
|
416
415
|
};
|
|
417
|
-
U(() => !k.events || !k.resources ? [] : k.resources.map((
|
|
418
|
-
const s = k.events.filter((w) => w.resourceId ===
|
|
416
|
+
U(() => !k.events || !k.resources ? [] : k.resources.map((l) => {
|
|
417
|
+
const s = k.events.filter((w) => w.resourceId === l.id).map((w) => {
|
|
419
418
|
const _ = T(w.startTime), B = T(w.endTime) - _, D = _ / 1440 * 100, W = B / 1440 * 100, L = (w.bookings ?? 0) > 0, j = w.maxBookings ? (w.bookings ?? 0) / w.maxBookings * 100 : 0;
|
|
420
419
|
return {
|
|
421
420
|
...w,
|
|
@@ -428,26 +427,26 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
428
427
|
};
|
|
429
428
|
});
|
|
430
429
|
return {
|
|
431
|
-
resource:
|
|
430
|
+
resource: l,
|
|
432
431
|
events: s
|
|
433
432
|
};
|
|
434
433
|
}));
|
|
435
|
-
const I = U(() => k.events ? k.events.map((
|
|
436
|
-
const c = T(
|
|
434
|
+
const I = U(() => k.events ? k.events.map((l) => {
|
|
435
|
+
const c = T(l.startTime), w = T(l.endTime) - c, _ = c / 1440 * 100, h = w / 1440 * 100, B = (l.bookings ?? 0) > 0, D = l.maxBookings ? (l.bookings ?? 0) / l.maxBookings * 100 : 0;
|
|
437
436
|
return {
|
|
438
|
-
...
|
|
437
|
+
...l,
|
|
439
438
|
top: `${_}%`,
|
|
440
439
|
height: `${h}%`,
|
|
441
|
-
color:
|
|
440
|
+
color: l.resource?.color || "#3b82f6",
|
|
442
441
|
hasBookings: B,
|
|
443
442
|
fillPercentage: D,
|
|
444
443
|
isSmall: w < 60
|
|
445
444
|
};
|
|
446
|
-
}) : []), a = Array.from({ length: 24 }, (
|
|
445
|
+
}) : []), a = Array.from({ length: 24 }, (l, c) => ({
|
|
447
446
|
hour: c,
|
|
448
447
|
label: `${c.toString().padStart(2, "0")}:00`
|
|
449
448
|
}));
|
|
450
|
-
return (
|
|
449
|
+
return (l, c) => (o(), u(X, null, [
|
|
451
450
|
e("div", Dt, [
|
|
452
451
|
e("div", Ct, [
|
|
453
452
|
e("div", Mt, [
|
|
@@ -512,7 +511,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
512
511
|
class: R(["flex items-center gap-1 px-2 py-0.5 rounded backdrop-blur-sm", { "bg-black/10": !s.isSmall }])
|
|
513
512
|
}, [
|
|
514
513
|
d(b(ge), { size: 10 }),
|
|
515
|
-
e("span",
|
|
514
|
+
e("span", Rt, v(s.startTime) + " – " + v(s.endTime), 1)
|
|
516
515
|
], 2)
|
|
517
516
|
], 2)
|
|
518
517
|
], 2),
|
|
@@ -529,19 +528,19 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
529
528
|
}, null, 8, ["resources"])
|
|
530
529
|
], 64));
|
|
531
530
|
}
|
|
532
|
-
}),
|
|
531
|
+
}), Nt = { class: "sticky left-0 mt-auto z-10 divide-y divide-border/50 h-full flex flex-col min-h-[1536px] bg-input" }, Ot = { class: "flex-shrink-0 text-xs font-medium text-muted-foreground px-3 pb-3 border-r border-border/50 w-14" }, Ft = { class: "flex items-center gap-1.5" }, _e = /* @__PURE__ */ K({
|
|
533
532
|
__name: "Event24hSidebar",
|
|
534
533
|
setup(f) {
|
|
535
534
|
const k = Array.from({ length: 24 }, (y, T) => ({
|
|
536
535
|
hour: T,
|
|
537
536
|
label: `${T.toString().padStart(2, "0")}:00`
|
|
538
537
|
}));
|
|
539
|
-
return (y, T) => (o(), u("div",
|
|
538
|
+
return (y, T) => (o(), u("div", Nt, [
|
|
540
539
|
(o(!0), u(X, null, Y(b(k), (I) => (o(), u("div", {
|
|
541
540
|
key: I.hour,
|
|
542
541
|
class: "flex-1 flex transition-all duration-200"
|
|
543
542
|
}, [
|
|
544
|
-
e("div",
|
|
543
|
+
e("div", Ot, [
|
|
545
544
|
e("div", Ft, [
|
|
546
545
|
e("span", {
|
|
547
546
|
class: R({ "-translate-y-1/2": I.hour !== 0 })
|
|
@@ -563,7 +562,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
563
562
|
}
|
|
564
563
|
},
|
|
565
564
|
setup(f) {
|
|
566
|
-
const k =
|
|
565
|
+
const k = S(Date.now());
|
|
567
566
|
let y;
|
|
568
567
|
pe(() => {
|
|
569
568
|
y = window.setInterval(() => {
|
|
@@ -576,12 +575,12 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
576
575
|
const a = new Date(k.value);
|
|
577
576
|
return `${(a.getHours() * 60 + a.getMinutes() + a.getSeconds() / 60) / 1440 * 100}%`;
|
|
578
577
|
}), I = U(() => new Date(k.value).getFullYear() + "-" + (new Date(k.value).getMonth() + 1).toString().padStart(2, "0") + "-" + new Date(k.value).getDate().toString().padStart(2, "0"));
|
|
579
|
-
return (a,
|
|
578
|
+
return (a, l) => (o(), u("div", At, [
|
|
580
579
|
e("div", {
|
|
581
580
|
class: "absolute left-0 right-0 h-0.5 bg-red-500 z-30 pointer-events-none transition-[top] duration-300 ease-linear",
|
|
582
581
|
style: q({ top: T.value })
|
|
583
582
|
}, [
|
|
584
|
-
|
|
583
|
+
l[0] || (l[0] = e("div", { class: "absolute -left-2 -top-1.5 w-3 h-3 bg-red-500 rounded-full shadow-lg shadow-red-500/50" }, null, -1)),
|
|
585
584
|
f.currentDate && f.currentDate == I.value ? (o(), u("div", Vt, " Now ")) : M("", !0)
|
|
586
585
|
], 4)
|
|
587
586
|
]));
|
|
@@ -604,7 +603,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
604
603
|
}, Gt = /* @__PURE__ */ K({
|
|
605
604
|
__name: "EventView",
|
|
606
605
|
setup(f) {
|
|
607
|
-
const k = ie("activeDate",
|
|
606
|
+
const k = ie("activeDate", S(ue(de()))), y = ie("viewMode", S(1)), T = ie("events", S([])), I = ie("resources", S([])), a = S(null), l = S(!1), c = S(!1);
|
|
608
607
|
U(() => I.value.length > 1);
|
|
609
608
|
const s = U(() => {
|
|
610
609
|
const n = [], m = k.value;
|
|
@@ -635,13 +634,13 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
635
634
|
}, 300));
|
|
636
635
|
}, j = () => {
|
|
637
636
|
D && (clearTimeout(D), D = null), B && (clearInterval(B), B = null);
|
|
638
|
-
},
|
|
637
|
+
}, N = () => {
|
|
639
638
|
if (!a.value) return;
|
|
640
639
|
const { scrollLeft: n, scrollWidth: m, clientWidth: z } = a.value;
|
|
641
|
-
|
|
640
|
+
l.value = n > 10, c.value = n < m - z - 10;
|
|
642
641
|
}, ee = (n) => {
|
|
643
642
|
a.value && Math.abs(n.deltaY) > Math.abs(n.deltaX) && (n.preventDefault(), a.value.scrollBy({ left: n.deltaY, behavior: "auto" }));
|
|
644
|
-
}, J =
|
|
643
|
+
}, J = S(!1), te = S(0), G = S(0), ae = (n) => {
|
|
645
644
|
!a.value || y.value === 1 || n.target.closest(".event-card") || (J.value = !0, te.value = n.pageX, G.value = a.value.scrollLeft, a.value.style.userSelect = "none", n.preventDefault());
|
|
646
645
|
}, se = (n) => {
|
|
647
646
|
if (!J.value || !a.value) return;
|
|
@@ -651,23 +650,23 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
651
650
|
a.value && (J.value = !1, a.value.style.userSelect = "");
|
|
652
651
|
};
|
|
653
652
|
return pe(() => {
|
|
654
|
-
a.value && (a.value.addEventListener("scroll",
|
|
655
|
-
|
|
653
|
+
a.value && (a.value.addEventListener("scroll", N), a.value.addEventListener("wheel", ee, { passive: !1 }), xe(() => {
|
|
654
|
+
N(), setTimeout(N, 50), setTimeout(N, 150), setTimeout(N, 300), setTimeout(N, 500);
|
|
656
655
|
})), document.addEventListener("mousemove", se), document.addEventListener("mouseup", p);
|
|
657
656
|
}), ze(() => {
|
|
658
657
|
document.removeEventListener("mousemove", se), document.removeEventListener("mouseup", p);
|
|
659
|
-
}),
|
|
658
|
+
}), le(y, () => {
|
|
660
659
|
y.value > 1 ? xe(() => {
|
|
661
660
|
setTimeout(() => {
|
|
662
661
|
if (!a.value) return;
|
|
663
662
|
const { scrollWidth: n, clientWidth: m } = a.value;
|
|
664
|
-
n > m && (c.value = !0,
|
|
663
|
+
n > m && (c.value = !0, l.value = !1);
|
|
665
664
|
}, 100);
|
|
666
665
|
}) : a.value && (a.value.style.cursor = "");
|
|
667
666
|
}), fe(() => {
|
|
668
|
-
j(), a.value && (a.value.removeEventListener("scroll",
|
|
667
|
+
j(), a.value && (a.value.removeEventListener("scroll", N), a.value.removeEventListener("wheel", ee));
|
|
669
668
|
}), (n, m) => {
|
|
670
|
-
const z =
|
|
669
|
+
const z = P("Button"), A = P("TooltipTrigger"), C = P("TooltipContent"), O = P("Tooltip");
|
|
671
670
|
return b(y) === 1 ? (o(), u("div", Wt, [
|
|
672
671
|
d(_e),
|
|
673
672
|
d(ke, {
|
|
@@ -685,7 +684,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
685
684
|
m[0] || (m[0] = e("span", null, "Scroll to view all days", -1)),
|
|
686
685
|
d(b(ce), { size: 12 })
|
|
687
686
|
])) : M("", !0),
|
|
688
|
-
|
|
687
|
+
l.value ? (o(), Q(z, {
|
|
689
688
|
key: 1,
|
|
690
689
|
variant: "outline",
|
|
691
690
|
size: "icon",
|
|
@@ -696,7 +695,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
696
695
|
onTouchend: j,
|
|
697
696
|
class: "sticky top-1/2 left-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2"
|
|
698
697
|
}, {
|
|
699
|
-
default:
|
|
698
|
+
default: $(() => [
|
|
700
699
|
d(b(ve), { size: 20 })
|
|
701
700
|
]),
|
|
702
701
|
_: 1
|
|
@@ -712,7 +711,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
712
711
|
onTouchend: j,
|
|
713
712
|
class: "sticky top-1/2 right-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2 float-right"
|
|
714
713
|
}, {
|
|
715
|
-
default:
|
|
714
|
+
default: $(() => [
|
|
716
715
|
d(b(ce), { size: 20 })
|
|
717
716
|
]),
|
|
718
717
|
_: 1
|
|
@@ -725,7 +724,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
725
724
|
ref_key: "scrollContainer",
|
|
726
725
|
ref: a,
|
|
727
726
|
class: "absolute inset-0 overflow-x-auto overflow-y-visible",
|
|
728
|
-
onScroll:
|
|
727
|
+
onScroll: N,
|
|
729
728
|
onMousedown: ae
|
|
730
729
|
}, [
|
|
731
730
|
e("div", Xt, [
|
|
@@ -763,9 +762,9 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
763
762
|
e("div", { class: "text-[10px] text-muted-foreground/0 group-hover:text-muted-foreground/100 uppercase tracking-wide transition-all" }, " Click to view ")
|
|
764
763
|
], -1)),
|
|
765
764
|
d(O, null, {
|
|
766
|
-
default:
|
|
765
|
+
default: $(() => [
|
|
767
766
|
d(A, { "as-child": "" }, {
|
|
768
|
-
default:
|
|
767
|
+
default: $(() => [
|
|
769
768
|
w(t).filter((x) => x.isException).length > 0 ? (o(), Q(b(Ie), {
|
|
770
769
|
key: 0,
|
|
771
770
|
class: "absolute top-3 right-3 size-4 text-orange-500"
|
|
@@ -774,7 +773,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
774
773
|
_: 2
|
|
775
774
|
}, 1024),
|
|
776
775
|
d(C, null, {
|
|
777
|
-
default:
|
|
776
|
+
default: $(() => [...m[2] || (m[2] = [
|
|
778
777
|
e("p", null, " This day has exceptions applied to it. ", -1)
|
|
779
778
|
])]),
|
|
780
779
|
_: 1
|
|
@@ -783,15 +782,15 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
783
782
|
_: 2
|
|
784
783
|
}, 1024),
|
|
785
784
|
d(O, null, {
|
|
786
|
-
default:
|
|
785
|
+
default: $(() => [
|
|
787
786
|
d(A, { "as-child": "" }, {
|
|
788
|
-
default:
|
|
787
|
+
default: $(() => [
|
|
789
788
|
w(t).filter((x) => x.isException).length > 0 ? (o(), u("div", Kt)) : M("", !0)
|
|
790
789
|
]),
|
|
791
790
|
_: 2
|
|
792
791
|
}, 1024),
|
|
793
792
|
d(C, null, {
|
|
794
|
-
default:
|
|
793
|
+
default: $(() => [...m[3] || (m[3] = [
|
|
795
794
|
e("p", null, " This day has exceptions applied to it. ", -1)
|
|
796
795
|
])]),
|
|
797
796
|
_: 1
|
|
@@ -811,7 +810,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
811
810
|
]));
|
|
812
811
|
};
|
|
813
812
|
}
|
|
814
|
-
}), Zt = /* @__PURE__ */
|
|
813
|
+
}), Zt = /* @__PURE__ */ Re(Gt, [["__scopeId", "data-v-99339cf2"]]), es = { class: "flex flex-col gap-2 md:gap-4 w-full h-full" }, ts = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 px-1" }, ss = { class: "flex items-center justify-between sm:justify-start gap-4" }, os = { class: "flex flex-col" }, ns = { class: "flex items-center gap-2" }, as = { class: "text-lg sm:text-2xl font-bold tracking-tight truncate" }, rs = { class: "text-xs sm:text-sm text-muted-foreground ml-7 truncate" }, ls = { class: "flex items-center justify-between sm:justify-end gap-2" }, is = { class: "flex items-center gap-1 sm:mr-2" }, us = {
|
|
815
814
|
key: 0,
|
|
816
815
|
class: "flex items-center gap-2 px-1 overflow-x-auto pb-2 -mx-1 scrollbar-hide"
|
|
817
816
|
}, ds = ["onClick"], cs = { class: "flex gap-4 flex-1 min-h-0 md:min-h-[1700px]" }, ms = { class: "hidden md:flex flex-shrink-0 flex-col gap-4" }, vs = {
|
|
@@ -826,21 +825,21 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
826
825
|
}, ys = { class: "min-w-0 flex-1" }, _s = { class: "text-sm font-medium truncate text-muted-foreground" }, zs = /* @__PURE__ */ K({
|
|
827
826
|
__name: "agenda",
|
|
828
827
|
setup(f) {
|
|
829
|
-
const { hasPermission: k } = Ue(), { params: y } =
|
|
828
|
+
const { hasPermission: k } = Ue(), { params: y } = $e(), { config: T } = Se(), I = Te(T.project), a = S(ue(de())), l = S(1), c = S(typeof window < "u" ? window.innerWidth : 1024), s = U(() => c.value < 768), w = () => {
|
|
830
829
|
c.value = window.innerWidth;
|
|
831
830
|
};
|
|
832
831
|
pe(() => {
|
|
833
832
|
window.addEventListener("resize", w);
|
|
834
833
|
}), fe(() => {
|
|
835
834
|
window.removeEventListener("resize", w);
|
|
836
|
-
}),
|
|
837
|
-
t &&
|
|
835
|
+
}), le(s, (t) => {
|
|
836
|
+
t && l.value !== 1 && (l.value = 1);
|
|
838
837
|
}, { immediate: !0 });
|
|
839
|
-
const _ =
|
|
840
|
-
|
|
838
|
+
const _ = S(null), h = S(/* @__PURE__ */ new Map()), B = U(() => _.value?.resources || []), D = U(() => B.value.filter((t) => t.isActive)), W = U(() => B.value.filter((t) => !t.isActive)), L = S(null), j = S(!1);
|
|
839
|
+
le(D, (t) => {
|
|
841
840
|
t.length > 0 && !L.value && (L.value = t[0].id);
|
|
842
841
|
}, { immediate: !0 });
|
|
843
|
-
const
|
|
842
|
+
const N = U(() => {
|
|
844
843
|
if (!L.value)
|
|
845
844
|
return D.value.length > 0 ? [D.value[0]] : [];
|
|
846
845
|
const t = D.value.find((i) => i.id === L.value);
|
|
@@ -848,7 +847,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
848
847
|
}), ee = U(() => _.value?.pricingOptions?.find((i) => i.isDefault)?.duration || 30), J = (t) => {
|
|
849
848
|
L.value = t;
|
|
850
849
|
};
|
|
851
|
-
|
|
850
|
+
le(a, () => {
|
|
852
851
|
O();
|
|
853
852
|
});
|
|
854
853
|
const te = U(() => {
|
|
@@ -860,9 +859,9 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
860
859
|
full: `${x} ${g} ${E}`
|
|
861
860
|
};
|
|
862
861
|
}), G = () => {
|
|
863
|
-
a.value = a.value.subtract({ days:
|
|
862
|
+
a.value = a.value.subtract({ days: l.value });
|
|
864
863
|
}, ae = () => {
|
|
865
|
-
a.value = a.value.add({ days:
|
|
864
|
+
a.value = a.value.add({ days: l.value });
|
|
866
865
|
}, se = () => {
|
|
867
866
|
a.value = ue(de());
|
|
868
867
|
}, p = (t) => {
|
|
@@ -871,56 +870,54 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
871
870
|
}, n = (t, i) => (_.value?.exceptions || []).find((g) => i >= g.startDate && i <= g.endDate ? g.resourceIds === null ? !0 : g.resourceIds?.includes(t) : !1) || null, m = (t, i, x) => {
|
|
872
871
|
const g = n(t.id, x);
|
|
873
872
|
if (g)
|
|
874
|
-
return g.isClosed ? [] : g.timeslots.map((
|
|
875
|
-
startTime:
|
|
876
|
-
endTime:
|
|
873
|
+
return g.isClosed ? [] : g.timeslots.map((r) => ({
|
|
874
|
+
startTime: r.startTime,
|
|
875
|
+
endTime: r.endTime,
|
|
877
876
|
isException: !0
|
|
878
877
|
}));
|
|
879
|
-
const E = i.getDay(),
|
|
880
|
-
return
|
|
881
|
-
startTime:
|
|
882
|
-
endTime:
|
|
878
|
+
const E = i.getDay(), F = t.openingHours?.[E] || [];
|
|
879
|
+
return F.length === 0 ? [] : F.map((r) => ({
|
|
880
|
+
startTime: r.start,
|
|
881
|
+
endTime: r.end,
|
|
883
882
|
isException: !1
|
|
884
883
|
}));
|
|
885
884
|
}, z = (t, i, x, g) => {
|
|
886
885
|
if (!_.value) return 0;
|
|
887
886
|
const E = h.value.get(i);
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
}, 0);
|
|
893
|
-
return P > 0 && console.log(`Found ${P} total bookings for ${t} on ${i} ${x}-${g}`), P;
|
|
887
|
+
return E ? E.filter((r) => r.resourceId === t).reduce((r, V) => {
|
|
888
|
+
const H = p(V.startTime), oe = p(V.endTime), re = p(x), me = p(g);
|
|
889
|
+
return H < me && oe > re ? r + (V.reserved || 0) : r;
|
|
890
|
+
}, 0) : 0;
|
|
894
891
|
}, A = U(() => {
|
|
895
892
|
if (!_.value) return [];
|
|
896
893
|
h.value.size;
|
|
897
894
|
let t = [], i = [];
|
|
898
|
-
for (let g = 0; g <
|
|
895
|
+
for (let g = 0; g < l.value; g++) {
|
|
899
896
|
const E = a.value.add({ days: g });
|
|
900
897
|
i.push(E);
|
|
901
898
|
}
|
|
902
|
-
const x =
|
|
899
|
+
const x = N.value.length > 0 ? N.value : [];
|
|
903
900
|
return x.length === 0 ? [] : (i.forEach((g) => {
|
|
904
901
|
let E = new Date(g.year, g.month - 1, g.day);
|
|
905
|
-
const
|
|
906
|
-
x.forEach((
|
|
907
|
-
const V = m(
|
|
902
|
+
const F = `${g.year}-${String(g.month).padStart(2, "0")}-${String(g.day).padStart(2, "0")}`;
|
|
903
|
+
x.forEach((r) => {
|
|
904
|
+
const V = m(r, E, F);
|
|
908
905
|
t = t.concat(V.map((H, oe) => {
|
|
909
|
-
const
|
|
906
|
+
const re = z(r.id, F, H.startTime, H.endTime);
|
|
910
907
|
return {
|
|
911
|
-
id: `block-${
|
|
908
|
+
id: `block-${F}-${r.id}-${oe}`,
|
|
912
909
|
title: _.value.serviceName,
|
|
913
|
-
date:
|
|
910
|
+
date: F,
|
|
914
911
|
startTime: H.startTime,
|
|
915
912
|
endTime: H.endTime,
|
|
916
|
-
theme:
|
|
917
|
-
bookings:
|
|
918
|
-
maxBookings:
|
|
913
|
+
theme: r.color || "#3b82f6",
|
|
914
|
+
bookings: re,
|
|
915
|
+
maxBookings: r.capacity,
|
|
919
916
|
isException: H.isException || !1,
|
|
920
|
-
resourceId:
|
|
921
|
-
resource:
|
|
917
|
+
resourceId: r.id,
|
|
918
|
+
resource: r,
|
|
922
919
|
// Store interval and duration for booking slot calculation
|
|
923
|
-
interval:
|
|
920
|
+
interval: r.interval || 30,
|
|
924
921
|
serviceDuration: ee.value
|
|
925
922
|
};
|
|
926
923
|
}));
|
|
@@ -932,15 +929,15 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
932
929
|
const t = y.value.id, i = a.value;
|
|
933
930
|
h.value.clear();
|
|
934
931
|
const x = [];
|
|
935
|
-
for (let g = 0; g <
|
|
936
|
-
const E = i.add({ days: g }),
|
|
932
|
+
for (let g = 0; g < l.value; g++) {
|
|
933
|
+
const E = i.add({ days: g }), F = `${E.year}-${String(E.month).padStart(2, "0")}-${String(E.day).padStart(2, "0")}`, r = `${t}_${F}`;
|
|
937
934
|
x.push(
|
|
938
|
-
I.get(T.reservedSpotsCollection,
|
|
935
|
+
I.get(T.reservedSpotsCollection, r).then((V) => {
|
|
939
936
|
if (V) {
|
|
940
937
|
let H = [];
|
|
941
938
|
for (const oe of D.value) {
|
|
942
|
-
const
|
|
943
|
-
Object.entries(
|
|
939
|
+
const re = V?.[oe.id] || {};
|
|
940
|
+
Object.entries(re).forEach(([me, De]) => {
|
|
944
941
|
const [Ce, Me] = me.split("-");
|
|
945
942
|
H.push({
|
|
946
943
|
resourceId: oe.id,
|
|
@@ -950,20 +947,20 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
950
947
|
});
|
|
951
948
|
});
|
|
952
949
|
}
|
|
953
|
-
h.value.set(
|
|
950
|
+
h.value.set(F, H);
|
|
954
951
|
}
|
|
955
952
|
}).catch(() => {
|
|
956
953
|
})
|
|
957
954
|
);
|
|
958
955
|
}
|
|
959
|
-
await Promise.all(x)
|
|
956
|
+
await Promise.all(x);
|
|
960
957
|
};
|
|
961
|
-
return C(), O(),
|
|
958
|
+
return C(), O(), le(l, () => {
|
|
962
959
|
O();
|
|
963
|
-
}), Z("agendaData", _), Z("activeDate", a), Z("viewMode",
|
|
964
|
-
const x =
|
|
960
|
+
}), Z("agendaData", _), Z("activeDate", a), Z("viewMode", l), Z("events", A), Z("resources", N), Z("allResources", D), (t, i) => {
|
|
961
|
+
const x = P("Button"), g = P("SegmentedControlButton"), E = P("SegmentedControl"), F = P("Calendar");
|
|
965
962
|
return o(), Q(Le, null, {
|
|
966
|
-
default:
|
|
963
|
+
default: $(() => [
|
|
967
964
|
e("div", es, [
|
|
968
965
|
e("div", ts, [
|
|
969
966
|
e("div", ss, [
|
|
@@ -975,11 +972,11 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
975
972
|
}),
|
|
976
973
|
e("h2", as, v(te.value.full), 1)
|
|
977
974
|
]),
|
|
978
|
-
e("p",
|
|
975
|
+
e("p", rs, v(_.value?.serviceName), 1)
|
|
979
976
|
]),
|
|
980
977
|
s.value && b(k)("manage-reservations") ? (o(), Q(be, { key: 0 })) : M("", !0)
|
|
981
978
|
]),
|
|
982
|
-
e("div",
|
|
979
|
+
e("div", ls, [
|
|
983
980
|
e("div", is, [
|
|
984
981
|
d(x, {
|
|
985
982
|
variant: "outline",
|
|
@@ -987,7 +984,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
987
984
|
class: "size-8 sm:size-9",
|
|
988
985
|
onClick: G
|
|
989
986
|
}, {
|
|
990
|
-
default:
|
|
987
|
+
default: $(() => [
|
|
991
988
|
d(b(ve), { size: 16 })
|
|
992
989
|
]),
|
|
993
990
|
_: 1
|
|
@@ -998,7 +995,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
998
995
|
class: "h-8 sm:h-9 px-2 sm:px-3 text-xs sm:text-sm",
|
|
999
996
|
onClick: se
|
|
1000
997
|
}, {
|
|
1001
|
-
default:
|
|
998
|
+
default: $(() => [...i[3] || (i[3] = [
|
|
1002
999
|
ne(" Today ", -1)
|
|
1003
1000
|
])]),
|
|
1004
1001
|
_: 1
|
|
@@ -1009,7 +1006,7 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
1009
1006
|
class: "size-8 sm:size-9",
|
|
1010
1007
|
onClick: ae
|
|
1011
1008
|
}, {
|
|
1012
|
-
default:
|
|
1009
|
+
default: $(() => [
|
|
1013
1010
|
d(b(ce), { size: 16 })
|
|
1014
1011
|
]),
|
|
1015
1012
|
_: 1
|
|
@@ -1017,24 +1014,24 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
1017
1014
|
]),
|
|
1018
1015
|
s.value ? M("", !0) : (o(), Q(E, {
|
|
1019
1016
|
key: 0,
|
|
1020
|
-
modelValue:
|
|
1021
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
1017
|
+
modelValue: l.value,
|
|
1018
|
+
"onUpdate:modelValue": i[0] || (i[0] = (r) => l.value = r)
|
|
1022
1019
|
}, {
|
|
1023
|
-
default:
|
|
1020
|
+
default: $(() => [
|
|
1024
1021
|
d(g, { value: 1 }, {
|
|
1025
|
-
default:
|
|
1022
|
+
default: $(() => [...i[4] || (i[4] = [
|
|
1026
1023
|
e("span", { class: "whitespace-nowrap" }, "1 Day", -1)
|
|
1027
1024
|
])]),
|
|
1028
1025
|
_: 1
|
|
1029
1026
|
}),
|
|
1030
1027
|
d(g, { value: 3 }, {
|
|
1031
|
-
default:
|
|
1028
|
+
default: $(() => [...i[5] || (i[5] = [
|
|
1032
1029
|
e("span", { class: "whitespace-nowrap" }, "3 Days", -1)
|
|
1033
1030
|
])]),
|
|
1034
1031
|
_: 1
|
|
1035
1032
|
}),
|
|
1036
1033
|
d(g, { value: 7 }, {
|
|
1037
|
-
default:
|
|
1034
|
+
default: $(() => [...i[6] || (i[6] = [
|
|
1038
1035
|
e("span", { class: "whitespace-nowrap" }, "7 Days", -1)
|
|
1039
1036
|
])]),
|
|
1040
1037
|
_: 1
|
|
@@ -1046,26 +1043,26 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
1046
1043
|
])
|
|
1047
1044
|
]),
|
|
1048
1045
|
s.value && D.value.length > 0 ? (o(), u("div", us, [
|
|
1049
|
-
(o(!0), u(X, null, Y(D.value, (
|
|
1050
|
-
key:
|
|
1046
|
+
(o(!0), u(X, null, Y(D.value, (r) => (o(), u("button", {
|
|
1047
|
+
key: r.id,
|
|
1051
1048
|
class: R(["flex items-center gap-2 px-3 py-1.5 rounded-full border text-sm whitespace-nowrap transition-colors flex-shrink-0", {
|
|
1052
|
-
"bg-primary text-primary-foreground border-primary": L.value ===
|
|
1053
|
-
"bg-background hover:bg-muted": L.value !==
|
|
1049
|
+
"bg-primary text-primary-foreground border-primary": L.value === r.id,
|
|
1050
|
+
"bg-background hover:bg-muted": L.value !== r.id
|
|
1054
1051
|
}]),
|
|
1055
|
-
onClick: (V) => J(
|
|
1052
|
+
onClick: (V) => J(r.id)
|
|
1056
1053
|
}, [
|
|
1057
1054
|
e("div", {
|
|
1058
1055
|
class: "size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",
|
|
1059
|
-
style: q({ backgroundColor: L.value ===
|
|
1060
|
-
}, v(
|
|
1061
|
-
e("span", null, v(
|
|
1056
|
+
style: q({ backgroundColor: L.value === r.id ? "rgba(255,255,255,0.3)" : r.color || "#6b7280" })
|
|
1057
|
+
}, v(r.avatarLabel || r.name.charAt(0).toUpperCase()), 5),
|
|
1058
|
+
e("span", null, v(r.name), 1)
|
|
1062
1059
|
], 10, ds))), 128))
|
|
1063
1060
|
])) : M("", !0),
|
|
1064
1061
|
e("div", cs, [
|
|
1065
1062
|
e("div", ms, [
|
|
1066
|
-
d(
|
|
1063
|
+
d(F, {
|
|
1067
1064
|
modelValue: a.value,
|
|
1068
|
-
"onUpdate:modelValue": i[1] || (i[1] = (
|
|
1065
|
+
"onUpdate:modelValue": i[1] || (i[1] = (r) => a.value = r),
|
|
1069
1066
|
"weekday-format": "short",
|
|
1070
1067
|
class: "rounded-md border"
|
|
1071
1068
|
}, null, 8, ["modelValue"]),
|
|
@@ -1074,29 +1071,29 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
1074
1071
|
e("span", { class: "text-sm font-medium" }, "Resources")
|
|
1075
1072
|
], -1)),
|
|
1076
1073
|
e("div", ps, [
|
|
1077
|
-
(o(!0), u(X, null, Y(D.value, (
|
|
1078
|
-
key:
|
|
1074
|
+
(o(!0), u(X, null, Y(D.value, (r) => (o(), u("div", {
|
|
1075
|
+
key: r.id,
|
|
1079
1076
|
class: R(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors", {
|
|
1080
|
-
"bg-muted ring-2 ring-primary/20": L.value ===
|
|
1081
|
-
"opacity-50": L.value && L.value !==
|
|
1077
|
+
"bg-muted ring-2 ring-primary/20": L.value === r.id,
|
|
1078
|
+
"opacity-50": L.value && L.value !== r.id
|
|
1082
1079
|
}]),
|
|
1083
|
-
onClick: (V) => J(
|
|
1080
|
+
onClick: (V) => J(r.id)
|
|
1084
1081
|
}, [
|
|
1085
1082
|
e("div", {
|
|
1086
1083
|
class: "size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",
|
|
1087
|
-
style: q({ backgroundColor:
|
|
1088
|
-
}, v(
|
|
1084
|
+
style: q({ backgroundColor: r.color || "#6b7280" })
|
|
1085
|
+
}, v(r.avatarLabel || r.name.charAt(0).toUpperCase()), 5),
|
|
1089
1086
|
e("div", gs, [
|
|
1090
|
-
e("div", hs, v(
|
|
1087
|
+
e("div", hs, v(r.name), 1)
|
|
1091
1088
|
]),
|
|
1092
1089
|
e("div", {
|
|
1093
|
-
class: R(["size-2 rounded-full flex-shrink-0", L.value ===
|
|
1090
|
+
class: R(["size-2 rounded-full flex-shrink-0", L.value === r.id ? "bg-primary" : "bg-muted-foreground/30"])
|
|
1094
1091
|
}, null, 2)
|
|
1095
1092
|
], 10, fs))), 128)),
|
|
1096
1093
|
W.value.length > 0 ? (o(), u("div", xs, [
|
|
1097
1094
|
e("button", {
|
|
1098
1095
|
class: "flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground w-full py-1 transition-colors",
|
|
1099
|
-
onClick: i[2] || (i[2] = (
|
|
1096
|
+
onClick: i[2] || (i[2] = (r) => j.value = !j.value)
|
|
1100
1097
|
}, [
|
|
1101
1098
|
d(b(ce), {
|
|
1102
1099
|
size: 14,
|
|
@@ -1105,16 +1102,16 @@ const Oe = { class: "mb-6" }, Re = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
1105
1102
|
e("span", null, "Inactive (" + v(W.value.length) + ")", 1)
|
|
1106
1103
|
]),
|
|
1107
1104
|
j.value ? (o(), u("div", bs, [
|
|
1108
|
-
(o(!0), u(X, null, Y(W.value, (
|
|
1109
|
-
key:
|
|
1105
|
+
(o(!0), u(X, null, Y(W.value, (r) => (o(), u("div", {
|
|
1106
|
+
key: r.id,
|
|
1110
1107
|
class: "flex items-center gap-2 p-2 rounded-md opacity-50"
|
|
1111
1108
|
}, [
|
|
1112
1109
|
e("div", {
|
|
1113
1110
|
class: "size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0 grayscale",
|
|
1114
|
-
style: q({ backgroundColor:
|
|
1115
|
-
}, v(
|
|
1111
|
+
style: q({ backgroundColor: r.color || "#6b7280" })
|
|
1112
|
+
}, v(r.avatarLabel || r.name.charAt(0).toUpperCase()), 5),
|
|
1116
1113
|
e("div", ys, [
|
|
1117
|
-
e("div", _s, v(
|
|
1114
|
+
e("div", _s, v(r.name), 1)
|
|
1118
1115
|
])
|
|
1119
1116
|
]))), 128))
|
|
1120
1117
|
])) : M("", !0)
|