@oneclick.dev/cms-core-modules 0.0.116 → 0.0.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{Acquisition-FV3QpaUX.mjs → Acquisition-X5-eksDw.mjs} +2 -2
  2. package/dist/{Audience-ka0b7YPE.mjs → Audience-CXryJ8tc.mjs} +2 -2
  3. package/dist/{ContentEditor-CsbOFg3a.js → ContentEditor-BnOVpmsQ.js} +39 -39
  4. package/dist/{ContentEditor-Df5uWpVC.mjs → ContentEditor-Cm28u_14.mjs} +7082 -5510
  5. package/dist/{Create-BXNLRQag.mjs → Create-BPA2ywrd.mjs} +1 -1
  6. package/dist/{DateFormatter-qbhRYxI_.mjs → DateFormatter-BkKoSf_l.mjs} +5 -5
  7. package/dist/{Detail-BCOcP2ql.mjs → Detail-C1Blq61w.mjs} +1 -1
  8. package/dist/{Detail-ChD5XurA.mjs → Detail-CfsPwl4s.mjs} +17 -17
  9. package/dist/{Detail-DnX7tsqN.mjs → Detail-CtItxMX4.mjs} +1 -1
  10. package/dist/{Detail-Btzwo0Y3.mjs → Detail-Dnpnmy4-.mjs} +1 -1
  11. package/dist/{Find-zN_dKz4p.mjs → Find-BAvaNf90.mjs} +1 -1
  12. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-BHeMJ6nr.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-BXTkYCm_.mjs} +1 -1
  13. package/dist/{Overview-BR_y8x3W.mjs → Overview-BWLxUksJ.mjs} +1 -1
  14. package/dist/{Overview-MpgkLB6m.mjs → Overview-Bjvu9Lfc.mjs} +3 -3
  15. package/dist/{SeoHealth-bVQj_Xgm.mjs → SeoHealth-I2mqiuLm.mjs} +3 -3
  16. package/dist/{TableView-Csv5Lycy.mjs → TableView-BQI3CWll.mjs} +2 -2
  17. package/dist/agenda-Dcsc3QHj.js +1 -0
  18. package/dist/agenda-DyTpFZfY.mjs +1258 -0
  19. package/dist/cms-core-modules.css +1 -1
  20. package/dist/{exceptions-CqityDo9.mjs → exceptions-Dgj54ULn.mjs} +1 -1
  21. package/dist/{index-DZV720u-.mjs → index-52nwosIs.mjs} +45 -45
  22. package/dist/{index-CkVwMqpn.mjs → index-Bnn9LahC.mjs} +52 -52
  23. package/dist/{index-B8GvmAwh.mjs → index-DiTIA8Sh.mjs} +27 -27
  24. package/dist/{index-L54VBzwJ.mjs → index-ar4tbR3i.mjs} +8 -8
  25. package/dist/{index-BIF2RB7k.mjs → index-cC_2cw31.mjs} +4 -4
  26. package/dist/index-g1jAGZGc.mjs +1261 -0
  27. package/dist/{index-CFzn2Lus.mjs → index-hMp4p5qA.mjs} +3 -3
  28. package/dist/index-yrUH3zmq.js +35 -0
  29. package/dist/index.cjs.js +1 -1
  30. package/dist/index.mjs +21 -21
  31. package/dist/{math-BJ-oX_IM.mjs → math-Bkw6u412.mjs} +11 -11
  32. package/dist/{orders-D41GbzIa.mjs → orders-C5NT99Fy.mjs} +82 -82
  33. package/dist/orders-lO3dZ5un.js +1 -0
  34. package/dist/{resources-B-D5MUhV.mjs → resources-CK0oWssj.mjs} +1 -1
  35. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +1 -0
  36. package/dist/{vee-validate-zod-DNjTLCgh.mjs → vee-validate-zod-CcOwoF6y.mjs} +6 -6
  37. package/package.json +2 -2
  38. package/dist/agenda-BSdlrfxv.mjs +0 -1253
  39. package/dist/agenda-Bev1mO7E.js +0 -1
  40. package/dist/index-CM4eaK5T.mjs +0 -1245
  41. package/dist/index-DliTZzwI.js +0 -35
  42. package/dist/orders-1swJVKw2.js +0 -1
@@ -2,7 +2,7 @@ import { defineComponent as z, inject as L, resolveComponent as o, openBlock as
2
2
  import { Import as re, DollarSign as oe, Percent as ne, Truck as se, Info as me, Loader2 as K, UserCog as pe, Plus as Z, Pencil as fe, Trash2 as ve, CalendarIcon as h, List as ce } from "lucide-vue-next";
3
3
  import { useModulePermissions as j, useModuleStorage as W, useConfirmation as _e, useModuleRoute as ge, useProjectSettings as xe, useLogs as ye, useModuleBreadcrumbs as be, useFirebaseIntegration as we } from "@oneclick.dev/cms-kit";
4
4
  import { c as ee } from "./utils-CanmrIWO.mjs";
5
- import { e as Ve, $ as te, a as Ue } from "./DateFormatter-qbhRYxI_.mjs";
5
+ import { $ as Ve, b as te, a as Ue } from "./DateFormatter-BkKoSf_l.mjs";
6
6
  import { t as I } from "./index-RLz1QPrf.mjs";
7
7
  const Ce = /* @__PURE__ */ z({
8
8
  __name: "SingleCode",
@@ -729,10 +729,10 @@ function je(e, t) {
729
729
  throw new Error("Unexpected hour cycle result");
730
730
  }
731
731
  export {
732
- X as $,
732
+ Ve as $,
733
733
  Je as a,
734
- x as b,
735
- Ne as c,
736
- _e as d,
737
- Ve as e
734
+ X as b,
735
+ x as c,
736
+ Ne as d,
737
+ _e as e
738
738
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as B, inject as G, resolveComponent as c, openBlock as r, createBlock as h, withCtx as l, createVNode as t, createElementVNode as s, createTextVNode as d, isRef as j, unref as e, createElementBlock as C, toDisplayString as y, createCommentVNode as g, withModifiers as Y, watch as Z, provide as R, computed as ee, ref as te, onMounted as le } from "vue";
2
- import { f as E, u as N, t as oe, o as q, s as M, e as se } from "./vee-validate-zod-DNjTLCgh.mjs";
2
+ import { u as E, a as N, t as oe, o as q, s as M, f as se } from "./vee-validate-zod-CcOwoF6y.mjs";
3
3
  import { X as ne, ImagePlus as ie, Tag as ae, ChevronRight as re, Trash as ce, Loader2 as W } from "lucide-vue-next";
4
4
  import { g as ue } from "./google-CvtuJwgk.mjs";
5
5
  import { useModulePermissions as de, useModuleRoute as pe, useConfirmation as me, useFirebaseIntegration as fe, useModuleBreadcrumbs as _e } from "@oneclick.dev/cms-kit";
@@ -1,9 +1,9 @@
1
- import { defineComponent as oe, ref as k, withAsyncContext as le, computed as L, resolveComponent as u, openBlock as n, createElementBlock as i, createElementVNode as d, createVNode as o, unref as r, withCtx as l, toDisplayString as m, createTextVNode as s, Fragment as se, renderList as ae, createBlock as _, createCommentVNode as c, normalizeClass as B } from "vue";
1
+ import { defineComponent as oe, ref as k, withAsyncContext as le, computed as L, resolveComponent as u, openBlock as n, createElementBlock as i, createElementVNode as d, createVNode as o, unref as r, withCtx as l, toDisplayString as m, createTextVNode as s, Fragment as se, renderList as ae, createBlock as _, createCommentVNode as f, normalizeClass as B } from "vue";
2
2
  import { Tag as ne, ChevronRight as de, CalendarIcon as j } from "lucide-vue-next";
3
3
  import { c as z } from "./utils-CanmrIWO.mjs";
4
4
  import { useLogs as ue, useModuleRoute as ie, useModuleStorage as re, useFirebaseIntegration as me, useModuleBreadcrumbs as pe } from "@oneclick.dev/cms-kit";
5
- import { e as ve, $ as E, a as ce, c as M } from "./DateFormatter-qbhRYxI_.mjs";
6
- const fe = { class: "relative @container" }, xe = {
5
+ import { $ as ve, b as E, a as fe, d as M } from "./DateFormatter-BkKoSf_l.mjs";
6
+ const ce = { class: "relative @container" }, xe = {
7
7
  key: 0,
8
8
  class: "max-w-5xl mx-auto mt-4"
9
9
  }, ge = { class: "flex flex-row gap-4 justify-between mb-6" }, _e = { class: "flex items-center" }, be = { class: "text-lg font-semibold mx-2 uppercase" }, ye = {
@@ -48,7 +48,7 @@ const fe = { class: "relative @container" }, xe = {
48
48
  let g, w;
49
49
  const b = F, { log: Re, logWarning: We, logError: Ze } = ue(), { params: A, navigateTo: S } = ie(), { getModuleData: G } = re(), { confirm: R } = useConfirmation(), y = k([]);
50
50
  y.value = ([g, w] = le(() => G("promo-types")), g = await g, w(), g || []);
51
- const U = me(b.config.project), t = k(null), C = k(!1), p = L(() => (t.value?.usageCount ?? 0) > 0), f = L(() => y.value.find((V) => V.key === t.value?.type) || null);
51
+ const U = me(b.config.project), t = k(null), C = k(!1), p = L(() => (t.value?.usageCount ?? 0) > 0), c = L(() => y.value.find((V) => V.key === t.value?.type) || null);
52
52
  pe(() => [
53
53
  { text: "Promo codes list", href: t.value?.code ? "/promo-codes" : "" },
54
54
  { text: t.value?.code || "" }
@@ -62,7 +62,7 @@ const fe = { class: "relative @container" }, xe = {
62
62
  };
63
63
  return W(), (V, e) => {
64
64
  const x = u("Button"), v = u("Label"), P = u("Input"), q = u("SelectValue"), O = u("SelectTrigger"), Y = u("SelectItem"), H = u("SelectGroup"), J = u("SelectContent"), K = u("Select"), Q = u("Switch"), I = u("PopoverTrigger"), T = u("Calendar"), N = u("PopoverContent"), D = u("Popover"), X = u("Textarea"), h = u("Loader2"), ee = u("CardContent"), te = u("Card");
65
- return n(), i("div", fe, [
65
+ return n(), i("div", ce, [
66
66
  t.value ? (n(), i("div", xe, [
67
67
  d("div", ge, [
68
68
  d("div", _e, [
@@ -155,28 +155,28 @@ const fe = { class: "relative @container" }, xe = {
155
155
  _: 1
156
156
  }, 8, ["modelValue"]),
157
157
  d("div", Ue, [
158
- f.value?.hasValueField ? (n(), i("div", $e, [
158
+ c.value?.hasValueField ? (n(), i("div", $e, [
159
159
  o(v, {
160
160
  for: "discountValue",
161
161
  class: "text-muted-foreground"
162
162
  }, {
163
163
  default: l(() => [
164
- s(m(f.value?.valueLabel || "Value"), 1)
164
+ s(m(c.value?.valueLabel || "Value"), 1)
165
165
  ]),
166
166
  _: 1
167
167
  }),
168
168
  d("div", Pe, [
169
- f.value?.valuePrefix ? (n(), i("span", Ie, m(f.value?.valuePrefix), 1)) : c("", !0),
169
+ c.value?.valuePrefix ? (n(), i("span", Ie, m(c.value?.valuePrefix), 1)) : f("", !0),
170
170
  o(P, {
171
171
  modelValue: t.value.value,
172
172
  "onUpdate:modelValue": e[3] || (e[3] = (a) => t.value.value = a),
173
173
  id: "discountValue",
174
174
  disabled: p.value
175
175
  }, null, 8, ["modelValue", "disabled"]),
176
- f.value?.valueSuffix ? (n(), i("span", Te, m(f.value?.valueSuffix), 1)) : c("", !0)
176
+ c.value?.valueSuffix ? (n(), i("span", Te, m(c.value?.valueSuffix), 1)) : f("", !0)
177
177
  ])
178
- ])) : c("", !0),
179
- f.value?.allowUnlimitedUses ? (n(), i("div", Ne, [
178
+ ])) : f("", !0),
179
+ c.value?.allowUnlimitedUses ? (n(), i("div", Ne, [
180
180
  o(v, {
181
181
  for: "unlimitedUses",
182
182
  class: "text-muted-foreground"
@@ -200,7 +200,7 @@ const fe = { class: "relative @container" }, xe = {
200
200
  _: 1
201
201
  })
202
202
  ])
203
- ])) : c("", !0)
203
+ ])) : f("", !0)
204
204
  ]),
205
205
  e[28] || (e[28] = d("h3", { class: "font-medium" }, "Availability", -1)),
206
206
  e[29] || (e[29] = d("p", { class: "text-sm text-muted-foreground mb-4" }, "When will this code be available?", -1)),
@@ -239,7 +239,7 @@ const fe = { class: "relative @container" }, xe = {
239
239
  modelValue: t.value.startsAt,
240
240
  "onUpdate:modelValue": e[5] || (e[5] = (a) => t.value.startsAt = a),
241
241
  "initial-focus": "",
242
- minValue: r(ce)()
242
+ minValue: r(fe)()
243
243
  }, null, 8, ["modelValue", "minValue"])
244
244
  ]),
245
245
  _: 1
@@ -248,7 +248,7 @@ const fe = { class: "relative @container" }, xe = {
248
248
  _: 1
249
249
  }),
250
250
  t.value.startsAt ? (n(), i("div", je, [
251
- p.value ? c("", !0) : (n(), _(x, {
251
+ p.value ? f("", !0) : (n(), _(x, {
252
252
  key: 0,
253
253
  onClick: e[6] || (e[6] = (a) => t.value.startsAt = void 0),
254
254
  variant: "link"
@@ -303,7 +303,7 @@ const fe = { class: "relative @container" }, xe = {
303
303
  _: 1
304
304
  }),
305
305
  t.value.expiresAt ? (n(), i("div", Me, [
306
- p.value ? c("", !0) : (n(), _(x, {
306
+ p.value ? f("", !0) : (n(), _(x, {
307
307
  key: 0,
308
308
  onClick: e[8] || (e[8] = (a) => t.value.expiresAt = void 0),
309
309
  variant: "link"
@@ -355,7 +355,7 @@ const fe = { class: "relative @container" }, xe = {
355
355
  C.value ? (n(), _(h, {
356
356
  key: 0,
357
357
  class: "size-4 animate-spin"
358
- })) : c("", !0),
358
+ })) : f("", !0),
359
359
  e[26] || (e[26] = s(" Update Code ", -1))
360
360
  ]),
361
361
  _: 1
@@ -369,7 +369,7 @@ const fe = { class: "relative @container" }, xe = {
369
369
  _: 1
370
370
  }),
371
371
  s(" " + m(t.value), 1)
372
- ])) : c("", !0)
372
+ ])) : f("", !0)
373
373
  ]);
374
374
  };
375
375
  }
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as B, inject as Q, ref as R, resolveComponent as i, openBlock as d, createBlock as O, withCtx as s, createVNode as n, createElementVNode as o, createTextVNode as v, isRef as N, unref as e, createElementBlock as b, toDisplayString as _, createCommentVNode as f, watch as ee, Fragment as X, renderList as H, normalizeClass as te, computed as oe, onMounted as ne, provide as se } from "vue";
2
- import { f as W, u as S, t as le, o as ie, p as J, c as q, s as F, a as ae, e as de } from "./vee-validate-zod-DNjTLCgh.mjs";
2
+ import { u as W, a as S, t as le, o as ie, p as J, c as q, s as F, b as ae, f as de } from "./vee-validate-zod-CcOwoF6y.mjs";
3
3
  import { r as j } from "./countries-BTPvmrsb.mjs";
4
4
  import { ChevronsUpDown as re, Search as ce, Check as ue, X as pe, Tag as me, ChevronRight as fe, Trash as _e, Loader2 as K } from "lucide-vue-next";
5
5
  import { useModulePermissions as xe, useModuleRoute as ve, useConfirmation as be, useFirebaseIntegration as ge, useModuleBreadcrumbs as he } from "@oneclick.dev/cms-kit";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ne, inject as tt, resolveComponent as v, openBlock as h, createBlock as L, withCtx as f, createVNode as s, createElementVNode as u, createTextVNode as V, isRef as Y, unref as m, createElementBlock as w, toDisplayString as F, createCommentVNode as O, computed as de, watch as re, useTemplateRef as Ee, ref as X, nextTick as Te, Fragment as J, renderList as ie, withModifiers as fe, onMounted as lt, normalizeClass as $e, withKeys as Yt, provide as dt, withAsyncContext as Kt } from "vue";
2
- import { f as xe, u as U, t as qt, o as Se, a as ve, s as H, p as Ne, c as be, b as Ie, d as ut, e as Jt } from "./vee-validate-zod-DNjTLCgh.mjs";
2
+ import { u as xe, a as U, t as qt, o as Se, b as ve, s as H, p as Ne, c as be, d as Ie, e as ut, f as Jt } from "./vee-validate-zod-CcOwoF6y.mjs";
3
3
  import { Info as Wt, GripVertical as Qe, CircleX as Gt, Trash2 as Zt, PlusCircle as ct, Search as ft, ListFilter as Qt, ChevronDown as pt, X as en, ImagePlus as gt, Plus as tn, Tag as nn, ChevronRight as on, Archive as ln, Trash as rn, Loader2 as mt } from "lucide-vue-next";
4
4
  import { animations as yt } from "@formkit/drag-and-drop";
5
5
  import { useConfirmation as Dt, useModuleRoute as St, useFirebaseIntegration as Ct, useModulePermissions as an, useModuleBreadcrumbs as sn } from "@oneclick.dev/cms-kit";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as Y, ref as _, withAsyncContext as M, watch as $, onMounted as Q, resolveComponent as s, openBlock as d, createElementBlock as j, createElementVNode as c, createVNode as t, unref as v, withCtx as l, createTextVNode as o, createBlock as g, createCommentVNode as T, toDisplayString as i, Fragment as h, renderList as G } from "vue";
2
2
  import { useModulePermissions as J, useModuleRoute as K, useModuleStorage as W, useModuleBreadcrumbs as X, useFirebaseIntegration as Z, useRoute as ee, useRouter as te, useOverlayParams as le } from "@oneclick.dev/cms-kit";
3
3
  import { Plus as ne, Search as oe, Loader2 as se, Pencil as ae } from "lucide-vue-next";
4
- import { u as ue } from "./index-L54VBzwJ.mjs";
4
+ import { u as ue } from "./index-ar4tbR3i.mjs";
5
5
  const re = { class: "relative" }, ie = {
6
6
  ref: "container",
7
7
  class: "w-full max-w-5xl mx-auto"
@@ -2,7 +2,7 @@ import { defineComponent as we, ref as j, reactive as Ue, computed as oe, watch
2
2
  import { CalendarIcon as je, ChevronLeft as He, Check as Qe, ChevronRight as Ye, X as We, Zap as Ge, Plus as Pe, Pencil as Xe, Users as Ze, Tag as Je, Trash2 as Me } from "lucide-vue-next";
3
3
  import { useModuleRoute as Ke, useModule as et, useFirebaseIntegration as tt } from "@oneclick.dev/cms-kit";
4
4
  import { c as Oe } from "./utils-CanmrIWO.mjs";
5
- import { e as nt, a as Ae, $ as Ve } from "./DateFormatter-qbhRYxI_.mjs";
5
+ import { $ as nt, a as Ae, b as Ve } from "./DateFormatter-BkKoSf_l.mjs";
6
6
  import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
7
7
  const at = { class: "space-y-3" }, ot = { class: "grid gap-4 @md/modal:grid-cols-2 @2xl/modal:grid-cols-3 @4xl/modal:grid-cols-4 overflow-hidden p-1" }, rt = {
8
8
  key: 0,
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as Q, inject as K, openBlock as r, createElementBlock as g, createElementVNode as i, Fragment as I, renderList as q, withModifiers as ue, normalizeClass as ee, unref as o, createCommentVNode as T, toDisplayString as P, createTextVNode as m, resolveComponent as s, createBlock as $, withCtx as l, createVNode as t, computed as X, renderSlot as _e, ref as j, useTemplateRef as be, withAsyncContext as xe, watch as Ce, onMounted as ye, onUnmounted as we, provide as O, withKeys as ke } from "vue";
2
2
  import { Filter as he, ChevronsUpDown as Pe, Check as se, RotateCcw as $e, ExternalLink as Se, Search as Me, Plus as Ve, LayoutGrid as Te, List as Ae } from "lucide-vue-next";
3
3
  import { useModuleRoute as J, useModulePermissions as Y, useFirebaseIntegration as te, useConfirmation as ze, useModuleBreadcrumbs as Ie } from "@oneclick.dev/cms-kit";
4
- import { u as Le } from "./index-CFzn2Lus.mjs";
4
+ import { a as Le } from "./index-hMp4p5qA.mjs";
5
5
  import { c as ae } from "./utils-CanmrIWO.mjs";
6
6
  import { t as D } from "./index-RLz1QPrf.mjs";
7
7
  const Ee = { class: "grid @md:grid-cols-2 @2xl:grid-cols-3 @3xl:grid-cols-4 @4xl:grid-cols-5 @5xl:grid-cols-6 gap-6" }, De = ["onClick", "onContextmenu"], Fe = ["src"], Be = { class: "font-semibold" }, Ue = { class: "text-sm text-muted-foreground flex items-center gap-2" }, Re = { class: "flex items-center gap-2" }, je = { key: 0 }, Ke = /* @__PURE__ */ Q({
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as _e, ref as f, computed as te, watch as he, onMounted as ye, resolveComponent as h, openBlock as n, createElementBlock as i, createElementVNode as s, toDisplayString as u, unref as r, Fragment as w, renderList as D, normalizeClass as L, createVNode as t, withCtx as l, createCommentVNode as P, createBlock as T, createTextVNode as y, resolveDynamicComponent as W, normalizeStyle as se } from "vue";
2
2
  import { useModule as be, useModuleRoute as we, useModuleBreadcrumbs as Ce } from "@oneclick.dev/cms-kit";
3
- import "./index-CkVwMqpn.mjs";
3
+ import "./index-Bnn9LahC.mjs";
4
4
  import { componentToString as oe, ChartTooltipContent as ae } from "@oneclick.dev/cms-kit/charts";
5
5
  import { MousePointerClick as ke, Users as $e, Eye as De, Clock as Pe, Zap as Te, TrendingDown as le, TrendingUp as ne, UserPlus as Se, Activity as Ue, RefreshCw as Ve, Loader2 as Re, ArrowUpRight as Me, Globe as Fe, Minus as Ae, Smartphone as ze, Tablet as Ne, Monitor as Be } from "lucide-vue-next";
6
- import { $ as re, O as j, A as ie, z as ue } from "./index-BIF2RB7k.mjs";
7
- import { P as ce, S as H } from "./index-B8GvmAwh.mjs";
6
+ import { $ as re, O as j, A as ie, z as ue } from "./index-cC_2cw31.mjs";
7
+ import { P as ce, S as H } from "./index-DiTIA8Sh.mjs";
8
8
  const Le = { class: "flex flex-col gap-4 w-full max-w-7xl mx-auto py-8" }, je = { class: "flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center" }, Ge = { class: "text-muted-foreground text-sm mt-1" }, Ie = {
9
9
  key: 0,
10
10
  class: "flex items-center gap-2"
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as w, resolveComponent as M, openBlock as a, createElementBlock as m, createVNode as n, withCtx as v, createElementVNode as e, unref as s, createTextVNode as x, toDisplayString as d, normalizeClass as b, computed as T, createBlock as k, normalizeStyle as z, createCommentVNode as $, Fragment as R, renderList as B, ref as _, watch as te, onMounted as se } from "vue";
2
2
  import { useModule as oe, useModuleRoute as ne, useModuleBreadcrumbs as re } from "@oneclick.dev/cms-kit";
3
3
  import { MousePointerClick as K, Eye as q, TrendingUp as le, Hash as ae, RefreshCw as ie, AlertTriangle as de, Loader2 as ue, Search as ce, FileText as me, ArrowUpRight as xe } from "lucide-vue-next";
4
- import "./index-CkVwMqpn.mjs";
4
+ import "./index-Bnn9LahC.mjs";
5
5
  import { componentToString as V, ChartTooltipContent as X } from "@oneclick.dev/cms-kit/charts";
6
- import { $ as j, O as U, A as G, z as J } from "./index-BIF2RB7k.mjs";
7
- import { P as Q, S as W } from "./index-B8GvmAwh.mjs";
6
+ import { $ as j, O as U, A as G, z as J } from "./index-cC_2cw31.mjs";
7
+ import { P as Q, S as W } from "./index-DiTIA8Sh.mjs";
8
8
  function S(t) {
9
9
  return t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}K` : Math.round(t).toString();
10
10
  }
@@ -6,8 +6,8 @@ import mn from "@oneclick.dev/cms-kit/components";
6
6
  import { i as vn } from "./interpolation-w7IRDJwK.mjs";
7
7
  import { nodeProps as wn, NodeToolbarWrapper as _n, Handle as Dt, Position as Vt, NodeContextMenu as yn } from "@oneclick.dev/cms-kit/flow-builder";
8
8
  import { animations as Cn } from "@formkit/drag-and-drop";
9
- import { a as Sn } from "./index-CFzn2Lus.mjs";
10
- import { e as xn, a as Ft, $ as Ce, b as Le } from "./DateFormatter-qbhRYxI_.mjs";
9
+ import { u as Sn } from "./index-hMp4p5qA.mjs";
10
+ import { $ as xn, a as Ft, b as Ce, c as Le } from "./DateFormatter-BkKoSf_l.mjs";
11
11
  import { _ as bn } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
12
12
  function Fe(e, o) {
13
13
  return typeof e == "function" ? e(o) : e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),H=require("./DateFormatter-CSAbE3BC.js"),z=require("lucide-vue-next"),oe=require("./EditLayout.vue_vue_type_script_setup_true_lang-gozJKXvM.js"),F=require("@oneclick.dev/cms-kit"),X=require("./OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ae=require("./NewReservationDialog.vue_vue_type_script_setup_true_lang-C2zwt5UF.js"),se=require("./index-CxETuRsG.js"),re={class:"mb-6"},le={class:"flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible"},ie=["onClick"],ce={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"},de={class:"font-medium"},ue={class:"text-muted-foreground"},me={class:"w-full flex-1 flex items-end justify-center"},pe={key:1,class:"text-[10px] mt-1"},fe={key:0,class:"mt-2 text-sm text-muted-foreground flex items-center gap-2"},ve={class:"font-medium text-foreground"},ge={class:"font-medium text-foreground"},he=e.defineComponent({__name:"TimelineChart",props:{timeSlots:{},slotStats:{},selectedTimeSlot:{},maxSpots:{}},emits:["select","clear"],setup(d,{emit:b}){const h=b,w=o=>{h("select",o)},B=()=>{h("clear")};return(o,i)=>{const c=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",re,[i[2]||(i[2]=e.createElementVNode("h3",{class:"font-semibold text-sm mb-2"},"Timeline",-1)),e.createElementVNode("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.timeSlots,n=>(e.openBlock(),e.createElementBlock("div",{key:n.startTime,class:"flex-1 min-w-0 flex flex-col items-center cursor-pointer group h-full relative",onClick:x=>w(n.startTime)},[e.createElementVNode("div",ce,[e.createElementVNode("div",de,e.toDisplayString(n.startTime),1),e.createElementVNode("div",ue,e.toDisplayString(d.slotStats[n.startTime]?.spots||0)+" spots",1)]),e.createElementVNode("div",me,[e.createElementVNode("div",{class:e.normalizeClass(["w-full transition-all duration-200",[d.selectedTimeSlot===n.startTime?"bg-primary":d.slotStats[n.startTime]?.spots>0?"bg-primary/60 group-hover:bg-primary/80":"bg-muted-foreground/20 group-hover:bg-muted-foreground/30"]]),style:e.normalizeStyle({height:d.slotStats[n.startTime]?.spots>0?`${d.slotStats[n.startTime].spots/d.maxSpots*100}%`:"2px",minHeight:d.slotStats[n.startTime]?.spots>0?"4px":"2px"})},null,6)]),n.startTime.endsWith(":00")?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-[10px] text-muted-foreground mt-1 transition-colors truncate",{"text-primary font-medium":d.selectedTimeSlot===n.startTime}])},e.toDisplayString(n.label),3)):(e.openBlock(),e.createElementBlock("span",pe," "))],8,ie))),128))]),d.selectedTimeSlot?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(c,{variant:"ghost",size:"icon",class:"h-6 w-6 p-0",onClick:B},{default:e.withCtx(()=>[e.createVNode(e.unref(z.X),{size:14})]),_:1}),e.createElementVNode("span",null,[i[0]||(i[0]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",ve,e.toDisplayString(d.slotStats[d.selectedTimeSlot]?.bookings||0),1),i[1]||(i[1]=e.createTextVNode(" bookings at ",-1)),e.createElementVNode("span",ge,e.toDisplayString(d.selectedTimeSlot),1)])])):e.createCommentVNode("",!0)])}}}),xe={class:"flex items-center justify-between mb-3"},ye={class:"font-semibold"},ke={key:0,class:"text-muted-foreground font-normal"},be={class:"relative mb-3"},_e={key:0,class:"flex items-center justify-center py-8"},Ne={key:1,class:"text-center py-8 text-muted-foreground"},we={key:2,class:"space-y-2 max-h-80 overflow-y-auto"},Ee=["onClick"],Se={class:"flex items-start justify-between"},Ve={class:"flex-1"},Ce={class:"font-medium"},De={class:"text-sm text-muted-foreground"},Be={class:"text-sm text-muted-foreground"},$e={class:"flex items-center gap-4"},Te={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},ze={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Ie={class:"text-right"},Me={key:0,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"},Ae={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},Le={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},je={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Re={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Pe={key:5,class:"text-sm font-medium mt-1"},Oe=e.defineComponent({__name:"BookingsList",props:{agendaData:{},resources:{},orders:{},filteredOrders:{},isLoading:{type:Boolean},selectedTimeSlot:{},searchQuery:{}},emits:["update:searchQuery","refresh"],setup(d,{emit:b}){const h=d,{params:w}=F.useModuleRoute(),B=e.computed(()=>w.value?.id??w.id??h.agendaData?.id??""),{metadataSchema:o}=X.useAgendaMetadataSchema(B),i=e.computed(()=>{const m=Array.isArray(h.resources)?h.resources:[],u=Array.isArray(h.agendaData?.resources)?h.agendaData.resources:[],S=[...m,...u],r=new Set;return S.filter(t=>{const a=t?.id;return!a||r.has(String(a))?!1:(r.add(String(a)),!0)})}),c=b,{config:n}=F.useModule(),x=F.useFirebaseIntegration(n.project),f=e.ref(null),T=e.ref(null),V=m=>{c("update:searchQuery",m)},_=()=>{c("update:searchQuery","")},I=()=>{c("refresh")},C=(m,u)=>{const S=m.id||m.orderId||u.orderId||"",r=i.value.find(t=>String(t.id)===String(u.resourceId));return{customerInfo:m.customerInfo,amountDue:m.amountDue,amountPaid:m.amountPaid,status:m.status,reservationStatus:u.status,subtotal:m.subtotal,total:m.total,discount:m.discount,id:S,res_id:u.id,resourceId:u.resourceId,spots:u.spots,date:u.date,createdAt:m.createdAt,startTime:u.timeslot?.startTime,endTime:u.timeslot?.endTime,reservationPrice:u.totalPrice,reservationBasePrice:u.basePrice,reservationAddOnsPrice:u.addOnsPrice,orderReservationCount:Array.isArray(m.reservations)?m.reservations.length:void 0,adjustments:m.adjustments||[],reservationAdjustments:u.adjustments||[],pricingOptionId:u.pricingOptionId,pricingOption:u.pricingOption,resourceName:r?.name,resourceColor:r?.color,metadata:m.metadata||{},reservationMetadata:u.metadata||{},refundStatus:u.refundStatus,refundedAt:u.refundedAt,refundedAmount:u.refundedAmount,refunds:Array.isArray(u.refunds)?u.refunds:[]}},D=async()=>{await e.nextTick(),await new Promise(m=>{if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>m());return}m()})},M=async m=>{if(!m)return;const u=await x.get(n.reservationsCollection,m);if(!u)return;const S={...u,id:u.id||m},r=(S.reservations||[]).map(t=>C(S,t));r.length&&(await D(),T.value?.openDialog({id:S.id,customerInfo:S.customerInfo,status:S.status,createdAt:S.createdAt,metadata:S.metadata||{},reservations:r,adjustments:S.adjustments||[],totalPrice:typeof S.total=="number"?S.total:r.reduce((t,a)=>t+(a.reservationPrice||0),0),totalSpots:r.reduce((t,a)=>t+(a.spots||0),0)}))},q=async m=>{await D(),f.value?.openDialog(m)},R=m=>m.orderReservationCount===1&&typeof m.total=="number"?m.total:typeof m.reservationPrice=="number"?m.reservationPrice:null,U=m=>{const u=R(m);return u===null?null:`€${u.toFixed(2)}`};return(m,u)=>{const S=e.resolveComponent("Input"),r=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",xe,[e.createElementVNode("h3",ye,[u[2]||(u[2]=e.createTextVNode(" Bookings ",-1)),d.selectedTimeSlot||d.searchQuery?(e.openBlock(),e.createElementBlock("span",ke," ("+e.toDisplayString(d.filteredOrders.length)+" of "+e.toDisplayString(d.orders.length)+") ",1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",be,[e.createVNode(e.unref(z.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(S,{"model-value":d.searchQuery,placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9","onUpdate:modelValue":V},null,8,["model-value"]),d.searchQuery?(e.openBlock(),e.createBlock(r,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:_},{default:e.withCtx(()=>[e.createVNode(e.unref(z.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),d.isLoading?(e.openBlock(),e.createElementBlock("div",_e,[...u[3]||(u[3]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):d.filteredOrders.length===0?(e.openBlock(),e.createElementBlock("div",Ne,e.toDisplayString(d.selectedTimeSlot?"No bookings for this time slot":"No bookings for this event"),1)):(e.openBlock(),e.createElementBlock("div",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.filteredOrders,t=>(e.openBlock(),e.createElementBlock("div",{key:t.res_id||t.id,class:"p-3 border rounded-lg hover:bg-muted/50 transition-colors",onClick:a=>f.value?.openDialog(t)},[e.createElementVNode("div",Se,[e.createElementVNode("div",Ve,[e.createElementVNode("div",Ce,e.toDisplayString(t.customerInfo.firstName+" "+t.customerInfo.lastName||"Unknown Customer"),1),e.createElementVNode("div",De,e.toDisplayString(t.customerInfo.email),1),e.createElementVNode("div",Be,e.toDisplayString(t.customerInfo.phone),1),e.createElementVNode("div",$e,[e.createElementVNode("div",Te,[e.createVNode(e.unref(z.Clock),{size:12}),e.createElementVNode("span",null,e.toDisplayString(t.startTime)+" - "+e.toDisplayString(t.endTime),1)]),e.createElementVNode("div",ze,[e.createVNode(e.unref(z.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(t.spots),1)])]),e.createVNode(X._sfc_main,{metadata:{...t.metadata,...t.reservationMetadata},schema:e.unref(o),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Ie,[t.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",Me,"Needs Approval")):t.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",Ae,"Approved")):t.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",Le,"Rejected")):t.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",je,"Cancelled")):(e.openBlock(),e.createElementBlock("span",Re,"Pending")),U(t)?(e.openBlock(),e.createElementBlock("div",Pe,e.toDisplayString(U(t)),1)):e.createCommentVNode("",!0)])])],8,Ee))),128))])),e.createVNode(X._sfc_main$1,{ref_key:"reservationDetailDialog",ref:f,"agenda-data":d.agendaData,resources:d.resources,"show-order-link":"",onCancelled:I,onConfirmed:I,onRejected:I,onTransferred:I,onOpenOrder:u[0]||(u[0]=t=>M(t))},null,8,["agenda-data","resources"]),e.createVNode(X._sfc_main$2,{ref_key:"orderDetailDialog",ref:T,"agenda-data":d.agendaData,resources:d.resources,onOpenReservation:u[1]||(u[1]=t=>q(t))},null,8,["agenda-data","resources"])])}}}),Fe={class:"flex items-center gap-4 mt-2 text-sm"},Ue={class:"flex items-center gap-1"},qe={key:0,class:"flex items-center gap-1"},He={class:"flex items-center gap-1"},Qe={class:"py-4"},We=e.defineComponent({__name:"EventDialog",props:{agendaData:{},resources:{default:()=>[]}},setup(d,{expose:b}){const h=d,{config:w}=F.useModule(),{params:B}=F.useModuleRoute(),o=F.useFirebaseIntegration(w.project),i=e.ref(!1),c=e.ref(null),n=e.ref([]),x=e.ref(!1),f=e.ref(null),T=e.ref("");e.provide("event",c);const V=e.computed(()=>{if(!c.value)return[];const r=c.value.resource?.interval||60,t=[],[a,N]=c.value.startTime.split(":").map(Number),[j,L]=c.value.endTime.split(":").map(Number),y=a*60+N,k=j*60+L;for(let v=y;v<k;v+=r){const l=Math.floor(v/60),p=v%60,E=Math.min(v+r,k),g=Math.floor(E/60),$=E%60,A=`${l.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}`,s=`${g.toString().padStart(2,"0")}:${$.toString().padStart(2,"0")}`;t.push({startTime:A,endTime:s,label:A})}return t}),_=r=>{const t=r.getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),N=String(r.getDate()).padStart(2,"0");return`${t}-${a}-${N}`},I=e.computed(()=>{const r={};return V.value.forEach(t=>{r[t.startTime]={bookings:0,spots:0,orders:[]}}),n.value.forEach(t=>{V.value.forEach(a=>{t.startTime<a.endTime&&t.endTime>a.startTime&&(r[a.startTime].bookings++,r[a.startTime].spots+=t.spots||0,r[a.startTime].orders.push(t))})}),r}),C=e.computed(()=>Math.max(1,...Object.values(I.value).map(r=>r.spots))),D=e.computed(()=>{let r=n.value;return f.value&&(r=I.value[f.value]?.orders||[]),T.value.trim()&&(r=new X.Fuse(r,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone"],threshold:.3,ignoreLocation:!0}).search(T.value).map(a=>a.item)),r}),M=e.computed(()=>({spots:n.value.reduce((r,t)=>r+(t.spots||0),0),bookings:n.value.length})),q=r=>{f.value===r?f.value=null:f.value=r},R=()=>{f.value=null},U=async r=>{i.value=!0,c.value=r,f.value=null,T.value="",await m()},m=async()=>{if(c.value){x.value=!0,n.value=[];try{const r=B.value.id,t=_(new Date(c.value.date)),a=c.value.resourceId||c.value.resource?.id,N=new Set;if(a?N.add(`${a}_${t}`):h.resources?.forEach(y=>{N.add(`${y.id}_${t}`)}),N.size===0){n.value=[];return}const j=await o.find(w.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:r},{field:"status",operator:"==",value:"confirmed"},{field:"flattenedReservationDates",operator:"array-contains-any",value:Array.from(N)}]});let L=[];j.forEach(y=>{(y.reservations?.filter(v=>v.date!==t?!1:a?v.resourceId===a:!0)||[]).forEach(v=>{const l=h.resources.find(E=>E.id===v.resourceId),p=y.id||y.orderId||v.orderId||"";(v.status==="approved"||v.status==="needs_approval")&&L.push({customerInfo:y.customerInfo,amountDue:y.amountDue,amountPaid:y.amountPaid,status:y.status,reservationStatus:v.status,subtotal:y.subtotal,total:y.total,discount:y.discount,id:p,res_id:v.id,resourceId:v.resourceId,spots:v.spots,date:t,createdAt:y.createdAt,startTime:v.timeslot?.startTime,endTime:v.timeslot?.endTime,reservationPrice:v.totalPrice,reservationBasePrice:v.basePrice,reservationAddOnsPrice:v.addOnsPrice,orderReservationCount:Array.isArray(y.reservations)?y.reservations.length:void 0,adjustments:y.adjustments||[],reservationAdjustments:v.adjustments||[],pricingOptionId:v.pricingOptionId,pricingOption:v.pricingOption,resourceName:l?.name,resourceColor:l?.color,metadata:y.metadata||{},reservationMetadata:v.metadata||{},refundStatus:v.refundStatus,refundedAt:v.refundedAt,refundedAmount:v.refundedAmount,refunds:Array.isArray(v.refunds)?v.refunds:[]})})}),n.value=L.sort((y,k)=>y.startTime?.localeCompare(k.startTime||"")||0)}catch(r){console.error("Error loading orders:",r),n.value=[]}finally{x.value=!1}}},u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],S=["January","February","March","April","May","June","July","August","September","October","November","December"];return b({openDialog:U}),(r,t)=>{const a=e.resolveComponent("DialogTitle"),N=e.resolveComponent("DialogDescription"),j=e.resolveComponent("DialogHeader"),L=e.resolveComponent("Button"),y=e.resolveComponent("DialogFooter"),k=e.resolveComponent("DialogScrollContent"),v=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(v,{open:i.value,"onUpdate:open":t[2]||(t[2]=l=>i.value=l)},{default:e.withCtx(()=>[e.createVNode(k,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(j,null,{default:e.withCtx(()=>[c.value?.date?(e.openBlock(),e.createBlock(a,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u[new Date(c.value.date).getUTCDay()])+" "+e.toDisplayString(S[new Date(c.value.date).getUTCMonth()])+" "+e.toDisplayString(new Date(c.value.date).getUTCDate())+", "+e.toDisplayString(new Date(c.value.date).getUTCFullYear()),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(N,null,{default:e.withCtx(()=>[e.createElementVNode("div",Fe,[e.createElementVNode("div",Ue,[e.createVNode(e.unref(z.Clock),{size:14}),e.createElementVNode("span",null,e.toDisplayString(c.value?.startTime)+" – "+e.toDisplayString(c.value?.endTime),1)]),c.value?.resource?(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",{class:"w-4 h-4 rounded-full",style:e.normalizeStyle({backgroundColor:c.value.resource.color||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(c.value.resource.name),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.createVNode(e.unref(z.Users),{size:14}),e.createElementVNode("span",null,e.toDisplayString(M.value.spots)+" spots in "+e.toDisplayString(M.value.bookings)+" reservations",1)])])]),_:1})]),_:1}),e.createElementVNode("div",Qe,[V.value.length>1?(e.openBlock(),e.createBlock(he,{key:0,"time-slots":V.value,"slot-stats":I.value,"selected-time-slot":f.value,"max-spots":C.value,onSelect:q,onClear:R,tabindex:"0"},null,8,["time-slots","slot-stats","selected-time-slot","max-spots"])):e.createCommentVNode("",!0),e.createVNode(Oe,{"agenda-data":d.agendaData,resources:d.resources,orders:n.value,"filtered-orders":D.value,"is-loading":x.value,"selected-time-slot":f.value,"search-query":T.value,"onUpdate:searchQuery":t[0]||(t[0]=l=>T.value=l),onRefresh:m},null,8,["agenda-data","resources","orders","filtered-orders","is-loading","selected-time-slot","search-query"])]),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(L,{variant:"outline",onClick:t[1]||(t[1]=l=>i.value=!1)},{default:e.withCtx(()=>[...t[3]||(t[3]=[e.createTextVNode("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),Xe={class:"flex-1 border-r shadow-sm overflow-hidden min-h-[1536px]"},Ye={class:"relative h-full min-h-[1536px]"},Je={class:"divide-y divide-input/80 h-full flex flex-col min-h-[1536px] border-y border-input/80"},Ke={class:"absolute inset-0 pointer-events-none"},Ge={class:"relative mr-1 @md:mr-3 h-full ml-0.5 @md:ml-2"},Ze=["onClick"],et={key:0,class:"absolute bottom-0 left-0 right-0 h-1 bg-black/20"},tt={class:"flex items-start justify-between gap-2 mb-1"},ot={class:"font-semibold text-xs @md:text-sm leading-tight line-clamp-1 flex-1"},nt={class:"flex items-center gap-1 shrink-0"},at=["title"],st={class:"font-medium"},J=e.defineComponent({__name:"EventTimeline",props:{agendaData:{},date:{},events:{},firstDay:{type:Boolean,default:!1},resources:{default:()=>[]}},setup(d){const b=d,h=e.ref(null),w=i=>{const[c,n]=i.split(":").map(Number);return c*60+n};e.computed(()=>!b.events||!b.resources?[]:b.resources.map(i=>{const n=b.events.filter(x=>x.resourceId===i.id).map(x=>{const f=w(x.startTime),V=w(x.endTime)-f,_=f/1440*100,I=V/1440*100,C=(x.bookings??0)>0,D=x.maxBookings?(x.bookings??0)/x.maxBookings*100:0;return{...x,top:`${_}%`,height:`${I}%`,color:x.resource?.color||"#3b82f6",hasBookings:C,fillPercentage:D,isSmall:V<60}});return{resource:i,events:n}}));const B=e.computed(()=>b.events?b.events.map(i=>{const c=w(i.startTime),x=w(i.endTime)-c,f=c/1440*100,T=x/1440*100,V=(i.bookings??0)>0,_=i.maxBookings?(i.bookings??0)/i.maxBookings*100:0;return{...i,top:`${f}%`,height:`${T}%`,color:i.resource?.color||"#3b82f6",hasBookings:V,fillPercentage:_,isSmall:x<60}}):[]),o=Array.from({length:24},(i,c)=>({hour:c,label:`${c.toString().padStart(2,"0")}:00`}));return(i,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),n=>(e.openBlock(),e.createElementBlock("div",{key:n.hour,class:"flex-1 flex transition-all duration-200"},[...c[0]||(c[0]=[e.createElementVNode("div",{class:"flex-1 relative"},[e.createElementVNode("div",{class:"absolute top-1/2 left-0 right-0 border-t border-dashed border-input/50"})],-1)])]))),128))]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,style:e.normalizeStyle({top:n.top,height:n.height,opacity:n.hasBookings?"1":"0.5"}),class:"event-card absolute left-0.5 right-0.5 @md:left-2 @md:right-2 rounded-lg pointer-events-auto cursor-pointer group/event transition-all duration-200 hover:shadow-xl overflow-hidden",onClick:x=>h.value?.openDialog(n)},[e.createElementVNode("div",{style:e.normalizeStyle({backgroundColor:n.color}),class:"absolute inset-0 shadow-lg"},[n.maxBookings?(e.openBlock(),e.createElementBlock("div",et,[e.createElementVNode("div",{class:"h-full bg-white/40 transition-all duration-300",style:e.normalizeStyle({width:`${n.fillPercentage}%`})},null,4)])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:e.normalizeClass(["relative h-full p-1.5 @md:p-3 flex flex-col",`${n.hasBookings?"text-white":"text-gray-600 dark:text-gray-100"}`])},[e.createElementVNode("div",tt,[e.createElementVNode("h3",ot,e.toDisplayString(n.title),1),e.createElementVNode("div",nt,[n.resource?(e.openBlock(),e.createElementBlock("div",{key:0,class:"w-5 h-5 @md:w-6 @md:h-6 rounded-full flex items-center justify-center text-[10px] @md:text-xs font-bold bg-white/30 backdrop-blur-sm text-white border border-white/40",title:n.resource.name},e.toDisplayString(n.resource.avatarLabel||n.resource.name.charAt(0).toUpperCase()),9,at)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-0.5 @md:gap-1 px-1.5 @md:px-2 py-0.5 rounded-full text-[10px] @md:text-xs font-medium",n.hasBookings?"bg-white text-black backdrop-blur-sm":"bg-black/10 backdrop-blur-sm"])},[e.createVNode(e.unref(z.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(n.bookings),1)],2)])]),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 @md:gap-2 text-[10px] @md:text-xs opacity-90 mt-auto",{"-translate-x-1 -translate-y-2 scale-80 origin-[0_0]":n.isSmall}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-1 @md:px-2 py-0.5 rounded backdrop-blur-sm",{"bg-black/10":!n.isSmall}])},[e.createVNode(e.unref(z.Clock),{size:10}),e.createElementVNode("span",st,e.toDisplayString(n.startTime)+" – "+e.toDisplayString(n.endTime),1)],2)],2)],2),c[1]||(c[1]=e.createElementVNode("div",{class:"absolute inset-0 border-2 border-white/0 group-hover/event:border-white/30 rounded-lg transition-colors duration-200 pointer-events-none"},null,-1))],12,Ze))),128))])])])]),e.createVNode(We,{"agenda-data":d.agendaData,resources:d.resources,ref_key:"eventDialog",ref:h},null,8,["agenda-data","resources"])],64))}}),rt={class:"sticky left-0 mt-auto z-10 divide-y divide-border/50 h-full flex flex-col min-h-[1536px] bg-input"},lt={class:"flex-shrink-0 text-[10px] @md:text-xs font-medium text-muted-foreground px-1.5 @md:px-3 pb-3 border-r border-border/50 w-10 @md:w-14"},it={class:"flex items-center gap-1.5"},K=e.defineComponent({__name:"Event24hSidebar",setup(d){const b=Array.from({length:24},(h,w)=>({hour:w,label:`${w.toString().padStart(2,"0")}:00`}));return(h,w)=>(e.openBlock(),e.createElementBlock("div",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),B=>(e.openBlock(),e.createElementBlock("div",{key:B.hour,class:"flex-1 flex transition-all duration-200"},[e.createElementVNode("div",lt,[e.createElementVNode("div",it,[e.createElementVNode("span",{class:e.normalizeClass({"-translate-y-1/2":B.hour!==0})},e.toDisplayString(B.label),3)])])]))),128))]))}}),ct={class:"absolute top-0 w-full pointer-events-none"},dt={key:0,class:"absolute -right-2 -top-0.5 px-2 py-0.5 bg-red-500 text-white text-xs font-medium rounded shadow-lg"},G=e.defineComponent({__name:"EventTimeIndicator",props:{currentDate:{type:Object,required:!1}},setup(d){const b=e.ref(Date.now());let h;e.onMounted(()=>{h=window.setInterval(()=>{b.value=Date.now()},1e3)}),e.onUnmounted(()=>{h&&clearInterval(h)});const w=e.computed(()=>{const o=new Date(b.value);return`${(o.getHours()*60+o.getMinutes()+o.getSeconds()/60)/1440*100}%`}),B=e.computed(()=>new Date(b.value).getFullYear()+"-"+(new Date(b.value).getMonth()+1).toString().padStart(2,"0")+"-"+new Date(b.value).getDate().toString().padStart(2,"0"));return(o,i)=>(e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",{class:"absolute left-0 right-0 h-0.5 bg-red-500 z-30 pointer-events-none transition-[top] duration-300 ease-linear",style:e.normalizeStyle({top:w.value})},[i[0]||(i[0]=e.createElementVNode("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)),d.currentDate&&d.currentDate==B.value?(e.openBlock(),e.createElementBlock("div",dt," Now ")):e.createCommentVNode("",!0)],4)]))}}),ut={key:0,class:"relative flex flex-1 min-w-0"},mt={key:1,class:"flex-1 min-w-0 relative min-h-[1616px] @md:min-h-[1658px]"},pt={key:0,class:"absolute top-0 right-0 z-10 px-3 py-1.5 bg-primary/90 text-primary-foreground text-xs font-medium rounded-bl-lg shadow-lg backdrop-blur-sm flex items-center gap-1.5 animate-pulse-subtle"},ft={class:"flex pb-4 min-w-[200px]"},vt=["onClick"],gt={key:0,class:"absolute top-2 right-2 flex items-center gap-1 px-2 py-0.5 bg-primary/20 backdrop-blur-sm rounded-full border border-primary/30"},ht={class:"text-xs text-muted-foreground font-medium group-hover:text-foreground/70 transition-colors"},xt={key:0,class:"absolute bottom-0 left-0 w-full h-1 bg-orange-500"},yt=e.defineComponent({__name:"EventView",props:{agendaData:{default:()=>({})}},setup(d){const b=e.inject("activeDate",e.ref(H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))),h=e.inject("viewMode",e.ref(1)),w=e.inject("events",e.ref([])),B=e.inject("resources",e.ref([])),o=e.ref(null),i=e.ref(!1),c=e.ref(!1);e.computed(()=>B.value.length>1);const n=e.computed(()=>{const t=[],a=b.value;for(let N=0;N<h.value;N++)t.push(a.add({days:N}));return t}),x=(t,a)=>{const N=`${t.year}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`;return w.value?.filter(j=>j.date===N)||[]},f=t=>{const a=H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2());return t.year===a.year&&t.month===a.month&&t.day===a.day},T=t=>{b.value=t,h.value=1};let V=null,_=null;const I=()=>{o.value&&(D(),o.value.scrollBy({left:-300,behavior:"smooth"}),_=window.setTimeout(()=>{V=window.setInterval(()=>{o.value&&o.value.scrollBy({left:-20,behavior:"auto"})},50)},300))},C=()=>{o.value&&(D(),o.value.scrollBy({left:300,behavior:"smooth"}),_=window.setTimeout(()=>{V=window.setInterval(()=>{o.value&&o.value.scrollBy({left:20,behavior:"auto"})},50)},300))},D=()=>{_&&(clearTimeout(_),_=null),V&&(clearInterval(V),V=null)},M=()=>{if(!o.value)return;const{scrollLeft:t,scrollWidth:a,clientWidth:N}=o.value;i.value=t>10,c.value=t<a-N-10},q=t=>{o.value&&Math.abs(t.deltaY)>Math.abs(t.deltaX)&&(t.preventDefault(),o.value.scrollBy({left:t.deltaY,behavior:"auto"}))},R=e.ref(!1),U=e.ref(0),m=e.ref(0),u=t=>{!o.value||h.value===1||t.target.closest(".event-card")||(R.value=!0,U.value=t.pageX,m.value=o.value.scrollLeft,o.value.style.userSelect="none",t.preventDefault())},S=t=>{if(!R.value||!o.value)return;const a=t.pageX,N=(U.value-a)*1.2;o.value.scrollLeft=m.value+N},r=()=>{o.value&&(R.value=!1,o.value.style.userSelect="")};return e.onMounted(()=>{o.value&&(o.value.addEventListener("scroll",M),o.value.addEventListener("wheel",q,{passive:!1}),e.nextTick(()=>{M(),setTimeout(M,50),setTimeout(M,150),setTimeout(M,300),setTimeout(M,500)})),document.addEventListener("mousemove",S),document.addEventListener("mouseup",r)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",r)}),e.watch(h,()=>{h.value>1?e.nextTick(()=>{setTimeout(()=>{if(!o.value)return;const{scrollWidth:t,clientWidth:a}=o.value;t>a&&(c.value=!0,i.value=!1)},100)}):o.value&&(o.value.style.cursor="")}),e.onUnmounted(()=>{D(),o.value&&(o.value.removeEventListener("scroll",M),o.value.removeEventListener("wheel",q))}),(t,a)=>{const N=e.resolveComponent("Button"),j=e.resolveComponent("TooltipTrigger"),L=e.resolveComponent("TooltipContent"),y=e.resolveComponent("Tooltip");return e.unref(h)===1?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(K),e.createVNode(G,{class:"h-full","current-date":e.unref(b)},null,8,["current-date"]),e.createVNode(J,{"agenda-data":d.agendaData,date:e.unref(b),events:x(e.unref(b)),resources:e.unref(B)},null,8,["agenda-data","date","events","resources"])])):(e.openBlock(),e.createElementBlock("div",mt,[e.unref(h)===7?(e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(e.unref(z.ChevronLeft),{size:12}),a[0]||(a[0]=e.createElementVNode("span",null,"Scroll to view all days",-1)),e.createVNode(e.unref(z.ChevronRight),{size:12})])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createBlock(N,{key:1,variant:"outline",size:"icon",onMousedown:I,onMouseup:D,onMouseleave:D,onTouchstart:I,onTouchend:D,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"},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ChevronLeft),{size:20})]),_:1})):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createBlock(N,{key:2,variant:"outline",size:"icon",onMousedown:C,onMouseup:D,onMouseleave:D,onTouchstart:C,onTouchend:D,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"},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ChevronRight),{size:20})]),_:1})):e.createCommentVNode("",!0),e.createVNode(G,{class:"h-[calc(100%-122px)] mt-[80px] @md:h-[calc(100%-164px)] @md:mt-[122px]"}),e.createElementVNode("div",{class:e.normalizeClass(["absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none transition-opacity duration-300",c.value?"opacity-100":"opacity-0"])},null,2),e.createElementVNode("div",{ref_key:"scrollContainer",ref:o,class:"absolute inset-0 overflow-x-auto overflow-y-hidden",onScroll:M,onMousedown:u},[e.createElementVNode("div",ft,[e.createVNode(K),a[5]||(a[5]=e.createElementVNode("div",{class:"absolute w-10 @md:w-14 h-[125px] bg-input"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(k,v)=>(e.openBlock(),e.createElementBlock("div",{key:k.toString(),class:e.normalizeClass(["flex-shrink-0",{"min-w-[200px] w-[33.33%]":e.unref(h)===3,"min-w-[280px]":e.unref(h)===7}])},[e.createElementVNode("div",{onClick:l=>T(k),class:e.normalizeClass(["relative p-3 border cursor-pointer transition-all duration-200 group relative",f(k)?"bg-gradient-to-br from-primary/10 to-primary/5 border-primary/30 hover:from-primary/20 hover:to-primary/10 hover:border-primary/50 hover:shadow-md":"bg-gradient-to-br from-muted/50 to-muted/30 border-border hover:from-accent/50 hover:to-accent/30 hover:border-accent-foreground/20 hover:shadow-md"])},[f(k)?(e.openBlock(),e.createElementBlock("div",gt,[...a[1]||(a[1]=[e.createElementVNode("div",{class:"w-1.5 h-1.5 bg-primary rounded-full animate-pulse"},null,-1),e.createElementVNode("span",{class:"text-[9px] font-bold text-primary uppercase tracking-wide"},"Today",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["text-xs font-semibold uppercase tracking-wider transition-colors",f(k)?"text-primary group-hover:text-primary/80":"text-muted-foreground group-hover:text-foreground"])},e.toDisplayString(new Date(k.year,k.month-1,k.day).toLocaleDateString("en-US",{weekday:"short"})),3),e.createElementVNode("div",{class:e.normalizeClass(["text-2xl font-bold transition-colors",f(k)?"text-foreground":"text-foreground group-hover:text-primary"])},e.toDisplayString(k.day),3),e.createElementVNode("div",ht,e.toDisplayString(new Date(k.year,k.month-1,k.day).toLocaleDateString("en-US",{month:"long",year:"numeric"})),1),a[4]||(a[4]=e.createElementVNode("div",{class:"mt-2 pt-2 border-t border-border/0 group-hover:border-border/50 transition-all"},[e.createElementVNode("div",{class:"text-[10px] text-muted-foreground/0 group-hover:text-muted-foreground/100 uppercase tracking-wide transition-all"}," Click to view ")],-1)),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(j,{"as-child":""},{default:e.withCtx(()=>[x(k).filter(l=>l.isException).length>0?(e.openBlock(),e.createBlock(e.unref(z.Asterisk),{key:0,class:"absolute top-3 right-3 size-4 text-orange-500"})):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(L,null,{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(j,{"as-child":""},{default:e.withCtx(()=>[x(k).filter(l=>l.isException).length>0?(e.openBlock(),e.createElementBlock("div",xt)):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(L,null,{default:e.withCtx(()=>[...a[3]||(a[3]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024)],10,vt),e.createVNode(J,{"agenda-data":d.agendaData,date:k,events:x(k),resources:e.unref(B)},null,8,["agenda-data","date","events","resources"])],2))),128))])],544)]))}}}),kt=ne._export_sfc(yt,[["__scopeId","data-v-f5d39ef7"]]),bt={class:"flex items-center justify-between @sm:justify-start gap-4"},_t={class:"flex flex-col"},Nt={class:"flex items-center gap-2"},wt={class:"text-lg @sm:text-2xl font-bold tracking-tight truncate"},Et={class:"text-xs @sm:text-sm text-muted-foreground ml-7 truncate"},St={class:"flex @sm:items-center justify-between flex-col @sm:flex-row @5xl:justify-end gap-2"},Vt={class:"flex items-center gap-1 @5xl:mr-2"},Ct={key:0,class:"flex items-center gap-2 px-1 overflow-x-auto pb-2 -mx-1 scrollbar-hide"},Dt=["onClick"],Bt={class:"flex gap-2 @md:gap-4"},$t={class:"hidden @md:flex flex-shrink-0 flex-col gap-4"},Tt={key:0,class:"rounded-md border p-3"},zt={class:"space-y-1"},It=["onClick"],Mt={class:"min-w-0 flex-1"},At={class:"text-sm font-medium truncate"},Lt={key:0,class:"pt-2 mt-2 border-t"},jt={key:0,class:"mt-1 space-y-1"},Rt={class:"min-w-0 flex-1"},Pt={class:"text-sm font-medium truncate text-muted-foreground"},Ot=e.defineComponent({__name:"agenda",setup(d){const{hasPermission:b}=F.useModulePermissions(),{params:h}=F.useModuleRoute(),{config:w}=F.useModule(),B=F.useFirebaseIntegration(w.project),o=e.ref(H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),i=e.ref(1),c=e.useTemplateRef("container"),{width:n}=se.useElementSize(c),x=e.computed(()=>n.value<640);e.watch(x,l=>{l&&i.value!==1&&(i.value=1)},{immediate:!0});const f=e.ref(null),T=e.ref(new Map),V=e.computed(()=>f.value?.resources||[]),_=e.computed(()=>V.value.filter(l=>l.isActive)),I=e.computed(()=>V.value.filter(l=>!l.isActive)),C=e.ref(null),D=e.ref(!1);e.watch(_,l=>{l.length>0&&!C.value&&(C.value=l[0].id)},{immediate:!0});const M=e.computed(()=>{if(!C.value)return _.value.length>0?[_.value[0]]:[];const l=_.value.find(p=>p.id===C.value);return l?[l]:_.value.length>0?[_.value[0]]:[]}),q=e.computed(()=>f.value?.pricingOptions?.find(p=>p.isDefault)?.duration||30),R=l=>{C.value=l};e.watch(o,()=>{k()});const U=e.computed(()=>{const l=o.value,p=new Date(l.year,l.month-1,l.day),E=p.toLocaleDateString("en-US",{weekday:"long"}).toUpperCase(),g=l.day,$=p.toLocaleDateString("en-US",{month:"short"}).toUpperCase();return{dayName:E,day:g,monthName:$,full:`${E} ${g} ${$}`}}),m=()=>{o.value=o.value.subtract({days:i.value})},u=()=>{o.value=o.value.add({days:i.value})},S=()=>{o.value=H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())},r=l=>{const[p,E]=l.split(":").map(Number);return p*60+E},t=(l,p)=>(f.value?.exceptions||[]).find(g=>p>=g.startDate&&p<=g.endDate?g.resourceIds===null?!0:g.resourceIds?.includes(l):!1)||null,a=(l,p,E)=>{const g=t(l.id,E);if(g)return g.isClosed?[]:g.timeslots.map(s=>({startTime:s.startTime,endTime:s.endTime,isException:!0}));const $=p.getDay(),A=l.openingHours?.[$]||[];return A.length===0?[]:A.map(s=>({startTime:s.start,endTime:s.end,isException:!1}))},N=(l,p,E,g)=>{if(!f.value)return 0;const $=T.value.get(p);return $?$.filter(s=>s.resourceId===l).reduce((s,P)=>{const O=r(P.startTime),Q=r(P.endTime),W=r(E),Y=r(g);return O<Y&&Q>W?s+(P.reserved||0):s},0):0},j=e.computed(()=>{if(!f.value)return[];T.value.size;let l=[],p=[];for(let g=0;g<i.value;g++){const $=o.value.add({days:g});p.push($)}const E=M.value.length>0?M.value:[];return E.length===0?[]:(p.forEach(g=>{let $=new Date(g.year,g.month-1,g.day);const A=`${g.year}-${String(g.month).padStart(2,"0")}-${String(g.day).padStart(2,"0")}`;E.forEach(s=>{const P=a(s,$,A);l=l.concat(P.map((O,Q)=>{const W=N(s.id,A,O.startTime,O.endTime);return{id:`block-${A}-${s.id}-${Q}`,title:f.value.serviceName,date:A,startTime:O.startTime,endTime:O.endTime,theme:s.color||"#3b82f6",bookings:W,maxBookings:s.capacity,isException:O.isException||!1,resourceId:s.id,resource:s,interval:s.interval||30,serviceDuration:q.value}}))})}),l)});let L=null;const y=async()=>{L||(L=B.get(w.agendaCollection,h.value.id).then(l=>{f.value=l}).finally(()=>{L=null})),await L},k=async()=>{if(f.value||await y(),!f.value)return;const l=h.value.id,p=o.value;T.value.clear();const E=[];for(let g=0;g<i.value;g++){const $=p.add({days:g}),A=`${$.year}-${String($.month).padStart(2,"0")}-${String($.day).padStart(2,"0")}`,s=`${l}_${A}`;E.push(B.get(w.reservedSpotsCollection,s).then(P=>{if(P){const O=[];for(const Q of _.value){const W=P?.[Q.id]||{};Object.entries(W).forEach(([Y,Z])=>{const[ee,te]=Y.split("-");O.push({resourceId:Q.id,startTime:ee,endTime:te,reserved:Z})})}T.value.set(A,O)}}).catch(()=>{}))}await Promise.all(E)};return(async()=>(await y(),await k()))(),e.watch(i,()=>{k()}),e.provide("agendaData",f),e.provide("activeDate",o),e.provide("viewMode",i),e.provide("events",j),e.provide("resources",M),e.provide("allResources",_),(l,p)=>{const E=e.resolveComponent("Button"),g=e.resolveComponent("SegmentedControlButton"),$=e.resolveComponent("SegmentedControl"),A=e.resolveComponent("Calendar");return e.openBlock(),e.createBlock(oe._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"container",ref:c,class:"flex flex-col gap-2 @md:gap-4 w-full"},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col @5xl:flex-row @5xl:items-center @5xl:justify-between gap-3 px-1",(x.value,"")])},[e.createElementVNode("div",bt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Nt,[e.createVNode(e.unref(z.CalendarDays),{size:20,class:"text-primary flex-shrink-0"}),e.createElementVNode("h2",wt,e.toDisplayString(U.value.full),1)]),e.createElementVNode("p",Et,e.toDisplayString(f.value?.serviceName),1)])]),e.createElementVNode("div",St,[e.createElementVNode("div",Vt,[e.createVNode(E,{variant:"outline",size:"icon",class:"size-8 @sm:size-9",onClick:m},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ChevronLeft),{size:16})]),_:1}),e.createVNode(E,{variant:"outline",size:"sm",class:"h-8 @sm:h-9 px-2 @sm:px-3 text-xs @sm:text-sm",onClick:S},{default:e.withCtx(()=>[...p[3]||(p[3]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(E,{variant:"outline",size:"icon",class:"size-8 @sm:size-9",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ChevronRight),{size:16})]),_:1})]),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($,{key:0,modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=s=>i.value=s)},{default:e.withCtx(()=>[e.createVNode(g,{value:1},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"1 Day",-1)])]),_:1}),e.createVNode(g,{value:3},{default:e.withCtx(()=>[...p[5]||(p[5]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"3 Days",-1)])]),_:1}),e.createVNode(g,{value:7},{default:e.withCtx(()=>[...p[6]||(p[6]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"7 Days",-1)])]),_:1})]),_:1},8,["modelValue"])),e.unref(b)("manage-reservations")?(e.openBlock(),e.createBlock(ae._sfc_main,{key:1,"agenda-data":f.value},null,8,["agenda-data"])):e.createCommentVNode("",!0)])],2),x.value&&_.value.length>0?(e.openBlock(),e.createElementBlock("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,s=>(e.openBlock(),e.createElementBlock("button",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 px-3 py-1.5 rounded-full border text-sm whitespace-nowrap transition-colors flex-shrink-0",{"bg-primary text-primary-foreground border-primary":C.value===s.id,"bg-background hover:bg-muted":C.value!==s.id}]),onClick:P=>R(s.id)},[e.createElementVNode("div",{class:"size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",style:e.normalizeStyle({backgroundColor:C.value===s.id?"rgba(255,255,255,0.3)":s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("span",null,e.toDisplayString(s.name),1)],10,Dt))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Bt,[e.createElementVNode("div",$t,[e.createVNode(A,{modelValue:o.value,"onUpdate:modelValue":p[1]||(p[1]=s=>o.value=s),"weekday-format":"short",class:"rounded-md border"},null,8,["modelValue"]),V.value.length>0?(e.openBlock(),e.createElementBlock("div",Tt,[p[7]||(p[7]=e.createElementVNode("div",{class:"flex items-center justify-between mb-3"},[e.createElementVNode("span",{class:"text-sm font-medium"},"Resources")],-1)),e.createElementVNode("div",zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors",{"bg-muted ring-2 ring-primary/20":C.value===s.id,"opacity-50":C.value&&C.value!==s.id}]),onClick:P=>R(s.id)},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Mt,[e.createElementVNode("div",At,e.toDisplayString(s.name),1)]),e.createElementVNode("div",{class:e.normalizeClass(["size-2 rounded-full flex-shrink-0",C.value===s.id?"bg-primary":"bg-muted-foreground/30"])},null,2)],10,It))),128)),I.value.length>0?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("button",{class:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground w-full py-1 transition-colors",onClick:p[2]||(p[2]=s=>D.value=!D.value)},[e.createVNode(e.unref(z.ChevronRight),{size:14,class:e.normalizeClass(["transition-transform",{"rotate-90":D.value}])},null,8,["class"]),e.createElementVNode("span",null,"Inactive ("+e.toDisplayString(I.value.length)+")",1)]),D.value?(e.openBlock(),e.createElementBlock("div",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"flex items-center gap-2 p-2 rounded-md opacity-50"},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0 grayscale",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Rt,[e.createElementVNode("div",Pt,e.toDisplayString(s.name),1)])]))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createVNode(kt,{"agenda-data":f.value},null,8,["agenda-data"])])],512)]),_:1})}}});exports.default=Ot;