@innosolutions/inno-calendar 1.0.0

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 (191) hide show
  1. package/dist/agenda-dropdown-BtVd7oeX.cjs +2 -0
  2. package/dist/agenda-dropdown-BtVd7oeX.cjs.map +1 -0
  3. package/dist/agenda-dropdown-CU74g7uM.js +3393 -0
  4. package/dist/agenda-dropdown-CU74g7uM.js.map +1 -0
  5. package/dist/agenda-view-CgPn9KUd.js +2390 -0
  6. package/dist/agenda-view-CgPn9KUd.js.map +1 -0
  7. package/dist/agenda-view-WMI-YjDn.cjs +11 -0
  8. package/dist/agenda-view-WMI-YjDn.cjs.map +1 -0
  9. package/dist/components/calendar.d.ts +43 -0
  10. package/dist/components/calendar.d.ts.map +1 -0
  11. package/dist/components/event/event-card.d.ts +106 -0
  12. package/dist/components/event/event-card.d.ts.map +1 -0
  13. package/dist/components/event/event-popover.d.ts +138 -0
  14. package/dist/components/event/event-popover.d.ts.map +1 -0
  15. package/dist/components/event/index.d.ts +6 -0
  16. package/dist/components/event/index.d.ts.map +1 -0
  17. package/dist/components/filters/calendar-filter-sidebar.d.ts +54 -0
  18. package/dist/components/filters/calendar-filter-sidebar.d.ts.map +1 -0
  19. package/dist/components/filters/index.d.ts +9 -0
  20. package/dist/components/filters/index.d.ts.map +1 -0
  21. package/dist/components/filters/schedule-type-filter.d.ts +31 -0
  22. package/dist/components/filters/schedule-type-filter.d.ts.map +1 -0
  23. package/dist/components/filters/user-filter.d.ts +31 -0
  24. package/dist/components/filters/user-filter.d.ts.map +1 -0
  25. package/dist/components/header/calendar-header.d.ts +55 -0
  26. package/dist/components/header/calendar-header.d.ts.map +1 -0
  27. package/dist/components/header/components/date-navigator.d.ts +22 -0
  28. package/dist/components/header/components/date-navigator.d.ts.map +1 -0
  29. package/dist/components/header/components/index.d.ts +8 -0
  30. package/dist/components/header/components/index.d.ts.map +1 -0
  31. package/dist/components/header/components/today-button.d.ts +15 -0
  32. package/dist/components/header/components/today-button.d.ts.map +1 -0
  33. package/dist/components/header/index.d.ts +7 -0
  34. package/dist/components/header/index.d.ts.map +1 -0
  35. package/dist/components/index.cjs +2 -0
  36. package/dist/components/index.cjs.map +1 -0
  37. package/dist/components/index.d.ts +25 -0
  38. package/dist/components/index.d.ts.map +1 -0
  39. package/dist/components/index.mjs +45 -0
  40. package/dist/components/index.mjs.map +1 -0
  41. package/dist/components/inno-calendar.d.ts +37 -0
  42. package/dist/components/inno-calendar.d.ts.map +1 -0
  43. package/dist/components/integrated-calendar.d.ts +37 -0
  44. package/dist/components/integrated-calendar.d.ts.map +1 -0
  45. package/dist/components/primitives/calendar-timeline.d.ts +13 -0
  46. package/dist/components/primitives/calendar-timeline.d.ts.map +1 -0
  47. package/dist/components/primitives/index.d.ts +7 -0
  48. package/dist/components/primitives/index.d.ts.map +1 -0
  49. package/dist/components/primitives/multi-day-banner.d.ts +14 -0
  50. package/dist/components/primitives/multi-day-banner.d.ts.map +1 -0
  51. package/dist/components/primitives/selectable-slot.d.ts +62 -0
  52. package/dist/components/primitives/selectable-slot.d.ts.map +1 -0
  53. package/dist/components/settings/badge-variant-setting.d.ts +25 -0
  54. package/dist/components/settings/badge-variant-setting.d.ts.map +1 -0
  55. package/dist/components/settings/index.d.ts +10 -0
  56. package/dist/components/settings/index.d.ts.map +1 -0
  57. package/dist/components/settings/slot-duration-setting.d.ts +20 -0
  58. package/dist/components/settings/slot-duration-setting.d.ts.map +1 -0
  59. package/dist/components/settings/visible-hours-setting.d.ts +23 -0
  60. package/dist/components/settings/visible-hours-setting.d.ts.map +1 -0
  61. package/dist/components/settings/working-hours-setting.d.ts +41 -0
  62. package/dist/components/settings/working-hours-setting.d.ts.map +1 -0
  63. package/dist/components/ui/badge.d.ts +10 -0
  64. package/dist/components/ui/badge.d.ts.map +1 -0
  65. package/dist/components/ui/button.d.ts +13 -0
  66. package/dist/components/ui/button.d.ts.map +1 -0
  67. package/dist/components/ui/dropdown-menu.d.ts +34 -0
  68. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  69. package/dist/components/ui/index.d.ts +12 -0
  70. package/dist/components/ui/index.d.ts.map +1 -0
  71. package/dist/components/ui/popover.d.ts +8 -0
  72. package/dist/components/ui/popover.d.ts.map +1 -0
  73. package/dist/components/ui/select.d.ts +12 -0
  74. package/dist/components/ui/select.d.ts.map +1 -0
  75. package/dist/components/ui/tooltip.d.ts +8 -0
  76. package/dist/components/ui/tooltip.d.ts.map +1 -0
  77. package/dist/components/views/agenda-view.d.ts +28 -0
  78. package/dist/components/views/agenda-view.d.ts.map +1 -0
  79. package/dist/components/views/day-view.d.ts +40 -0
  80. package/dist/components/views/day-view.d.ts.map +1 -0
  81. package/dist/components/views/index.d.ts +10 -0
  82. package/dist/components/views/index.d.ts.map +1 -0
  83. package/dist/components/views/month-view.d.ts +32 -0
  84. package/dist/components/views/month-view.d.ts.map +1 -0
  85. package/dist/components/views/timeline-view.d.ts +33 -0
  86. package/dist/components/views/timeline-view.d.ts.map +1 -0
  87. package/dist/components/views/week-view.d.ts +44 -0
  88. package/dist/components/views/week-view.d.ts.map +1 -0
  89. package/dist/components/views/year-view.d.ts +16 -0
  90. package/dist/components/views/year-view.d.ts.map +1 -0
  91. package/dist/components/widget/agenda-dropdown.d.ts +20 -0
  92. package/dist/components/widget/agenda-dropdown.d.ts.map +1 -0
  93. package/dist/components/widget/agenda-widget.d.ts +27 -0
  94. package/dist/components/widget/agenda-widget.d.ts.map +1 -0
  95. package/dist/components/widget/index.d.ts +6 -0
  96. package/dist/components/widget/index.d.ts.map +1 -0
  97. package/dist/core/constants.d.ts +78 -0
  98. package/dist/core/constants.d.ts.map +1 -0
  99. package/dist/core/context/calendar-context.d.ts +65 -0
  100. package/dist/core/context/calendar-context.d.ts.map +1 -0
  101. package/dist/core/context/drag-drop-context.d.ts +58 -0
  102. package/dist/core/context/drag-drop-context.d.ts.map +1 -0
  103. package/dist/core/context/index.d.ts +5 -0
  104. package/dist/core/context/index.d.ts.map +1 -0
  105. package/dist/core/context/inno-calendar-provider.d.ts +121 -0
  106. package/dist/core/context/inno-calendar-provider.d.ts.map +1 -0
  107. package/dist/core/context/slot-selection-context.d.ts +42 -0
  108. package/dist/core/context/slot-selection-context.d.ts.map +1 -0
  109. package/dist/core/hooks/index.d.ts +5 -0
  110. package/dist/core/hooks/index.d.ts.map +1 -0
  111. package/dist/core/hooks/use-calendar-time-config.d.ts +31 -0
  112. package/dist/core/hooks/use-calendar-time-config.d.ts.map +1 -0
  113. package/dist/core/hooks/use-calendar.d.ts +63 -0
  114. package/dist/core/hooks/use-calendar.d.ts.map +1 -0
  115. package/dist/core/hooks/use-preferences.d.ts +21 -0
  116. package/dist/core/hooks/use-preferences.d.ts.map +1 -0
  117. package/dist/core/hooks/use-slot-selection.d.ts +39 -0
  118. package/dist/core/hooks/use-slot-selection.d.ts.map +1 -0
  119. package/dist/core/index.cjs +2 -0
  120. package/dist/core/index.cjs.map +1 -0
  121. package/dist/core/index.d.ts +13 -0
  122. package/dist/core/index.d.ts.map +1 -0
  123. package/dist/core/index.mjs +157 -0
  124. package/dist/core/index.mjs.map +1 -0
  125. package/dist/core/preferences/index.d.ts +9 -0
  126. package/dist/core/preferences/index.d.ts.map +1 -0
  127. package/dist/core/preferences/types.d.ts +153 -0
  128. package/dist/core/preferences/types.d.ts.map +1 -0
  129. package/dist/core/preferences/use-preferences.d.ts +54 -0
  130. package/dist/core/preferences/use-preferences.d.ts.map +1 -0
  131. package/dist/core/types.d.ts +466 -0
  132. package/dist/core/types.d.ts.map +1 -0
  133. package/dist/core/utils/date-utils.d.ts +254 -0
  134. package/dist/core/utils/date-utils.d.ts.map +1 -0
  135. package/dist/core/utils/event-utils.d.ts +91 -0
  136. package/dist/core/utils/event-utils.d.ts.map +1 -0
  137. package/dist/core/utils/grid-utils.d.ts +69 -0
  138. package/dist/core/utils/grid-utils.d.ts.map +1 -0
  139. package/dist/core/utils/index.d.ts +5 -0
  140. package/dist/core/utils/index.d.ts.map +1 -0
  141. package/dist/core/utils/position-utils.d.ts +33 -0
  142. package/dist/core/utils/position-utils.d.ts.map +1 -0
  143. package/dist/index-D2U2F80P.cjs +2 -0
  144. package/dist/index-D2U2F80P.cjs.map +1 -0
  145. package/dist/index-DtaLkIY8.js +2777 -0
  146. package/dist/index-DtaLkIY8.js.map +1 -0
  147. package/dist/index.cjs +2 -0
  148. package/dist/index.cjs.map +1 -0
  149. package/dist/index.d.ts +41 -0
  150. package/dist/index.d.ts.map +1 -0
  151. package/dist/index.mjs +204 -0
  152. package/dist/index.mjs.map +1 -0
  153. package/dist/inno-calendar-provider-B0e1XLeo.js +556 -0
  154. package/dist/inno-calendar-provider-B0e1XLeo.js.map +1 -0
  155. package/dist/inno-calendar-provider-BwP6uUAq.cjs +2 -0
  156. package/dist/inno-calendar-provider-BwP6uUAq.cjs.map +1 -0
  157. package/dist/lib/index.cjs +2 -0
  158. package/dist/lib/index.cjs.map +1 -0
  159. package/dist/lib/index.d.ts +2 -0
  160. package/dist/lib/index.d.ts.map +1 -0
  161. package/dist/lib/index.mjs +5 -0
  162. package/dist/lib/index.mjs.map +1 -0
  163. package/dist/lib/utils.d.ts +6 -0
  164. package/dist/lib/utils.d.ts.map +1 -0
  165. package/dist/presets/default/default-calendar.d.ts +44 -0
  166. package/dist/presets/default/default-calendar.d.ts.map +1 -0
  167. package/dist/presets/default/index.d.ts +2 -0
  168. package/dist/presets/default/index.d.ts.map +1 -0
  169. package/dist/presets/index.cjs +2 -0
  170. package/dist/presets/index.cjs.map +1 -0
  171. package/dist/presets/index.d.ts +3 -0
  172. package/dist/presets/index.d.ts.map +1 -0
  173. package/dist/presets/index.mjs +6 -0
  174. package/dist/presets/index.mjs.map +1 -0
  175. package/dist/presets/tailwind/index.d.ts +2 -0
  176. package/dist/presets/tailwind/index.d.ts.map +1 -0
  177. package/dist/presets/tailwind/tailwind-calendar.d.ts +122 -0
  178. package/dist/presets/tailwind/tailwind-calendar.d.ts.map +1 -0
  179. package/dist/slot-selection-context-BCNnYGHC.js +1069 -0
  180. package/dist/slot-selection-context-BCNnYGHC.js.map +1 -0
  181. package/dist/slot-selection-context-C52lU9W4.cjs +2 -0
  182. package/dist/slot-selection-context-C52lU9W4.cjs.map +1 -0
  183. package/dist/tailwind-calendar-CC9RHr10.cjs +2 -0
  184. package/dist/tailwind-calendar-CC9RHr10.cjs.map +1 -0
  185. package/dist/tailwind-calendar-D-D8H4FV.js +414 -0
  186. package/dist/tailwind-calendar-D-D8H4FV.js.map +1 -0
  187. package/dist/use-calendar-time-config-CtKkXw_L.js +191 -0
  188. package/dist/use-calendar-time-config-CtKkXw_L.js.map +1 -0
  189. package/dist/use-calendar-time-config-F-8WV_Sd.cjs +2 -0
  190. package/dist/use-calendar-time-config-F-8WV_Sd.cjs.map +1 -0
  191. package/package.json +128 -0
@@ -0,0 +1,3393 @@
1
+ import { jsx as e, jsxs as n, Fragment as Z } from "react/jsx-runtime";
2
+ import { o as Ae, c as Ue, C as Ye, I as Ge, j as Ke } from "./inno-calendar-provider-B0e1XLeo.js";
3
+ import { c as u } from "./index-DtaLkIY8.js";
4
+ import { useMemo as j, useRef as Je, useCallback as se, forwardRef as ye, useState as ae, useEffect as be } from "react";
5
+ import { an as Qe, Z as Xe, a8 as Ze, az as q, aO as fe, I as Be, h as qe, S as et, U as tt, o as Fe } from "./slot-selection-context-BCNnYGHC.js";
6
+ import { B as V, c as rt, C as nt, M as ke, A as st, W as at, b as it, P as Pe, h as Oe, g as _e, l as Y, p as ot, q as lt, r as ct, s as Ce, j as G, m as K, k as J, t as dt } from "./agenda-view-CgPn9KUd.js";
7
+ function ut({ view: t, className: r = "" }) {
8
+ return /* @__PURE__ */ e(
9
+ "div",
10
+ {
11
+ className: r,
12
+ style: {
13
+ display: "flex",
14
+ alignItems: "center",
15
+ justifyContent: "center",
16
+ minHeight: "400px",
17
+ backgroundColor: "#f9fafb",
18
+ borderRadius: "0.5rem",
19
+ border: "1px dashed #d1d5db"
20
+ },
21
+ children: /* @__PURE__ */ n("div", { style: { textAlign: "center", color: "#6b7280" }, children: [
22
+ /* @__PURE__ */ n("p", { style: { fontSize: "1.125rem", fontWeight: 500 }, children: [
23
+ t.charAt(0).toUpperCase() + t.slice(1),
24
+ " View"
25
+ ] }),
26
+ /* @__PURE__ */ e("p", { style: { fontSize: "0.875rem" }, children: "Implementation pending" })
27
+ ] })
28
+ }
29
+ );
30
+ }
31
+ function De({ view: t, className: r }) {
32
+ return /* @__PURE__ */ e(ut, { view: t, className: r });
33
+ }
34
+ function Or(t) {
35
+ const {
36
+ events: r,
37
+ resources: s,
38
+ scheduleTypes: a,
39
+ initialView: i = "week",
40
+ initialDate: o,
41
+ initialFilters: d,
42
+ preferences: h,
43
+ locale: c,
44
+ slots: g,
45
+ renderEvent: p,
46
+ onViewChange: N,
47
+ onDateChange: w,
48
+ onEventClick: b,
49
+ onSlotSelect: k,
50
+ onFiltersChange: D,
51
+ className: C,
52
+ children: v
53
+ } = t, M = Ae();
54
+ if (M)
55
+ return /* @__PURE__ */ e("div", { className: C, style: { position: "relative" }, children: v ?? /* @__PURE__ */ e(De, { view: M.view, className: C }) });
56
+ const z = Ue({
57
+ events: r,
58
+ resources: s,
59
+ scheduleTypes: a,
60
+ initialView: i,
61
+ initialDate: o,
62
+ initialFilters: d,
63
+ preferences: h,
64
+ locale: c,
65
+ onViewChange: N,
66
+ onDateChange: w,
67
+ onEventClick: b,
68
+ onSlotSelect: k,
69
+ onFiltersChange: D
70
+ });
71
+ return /* @__PURE__ */ e(Ye, { value: z, children: /* @__PURE__ */ e("div", { className: C, style: { position: "relative" }, children: v ?? /* @__PURE__ */ e(De, { view: z.view, className: C }) }) });
72
+ }
73
+ const ht = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], mt = [
74
+ "January",
75
+ "February",
76
+ "March",
77
+ "April",
78
+ "May",
79
+ "June",
80
+ "July",
81
+ "August",
82
+ "September",
83
+ "October",
84
+ "November",
85
+ "December"
86
+ ];
87
+ function Me(t) {
88
+ const r = t.hexColor;
89
+ return r ? { backgroundColor: r } : {};
90
+ }
91
+ function ft({
92
+ day: t,
93
+ date: r,
94
+ events: s,
95
+ isCurrentMonth: a,
96
+ onDayClick: i
97
+ }) {
98
+ const o = q(r), d = 3, h = s.length;
99
+ return /* @__PURE__ */ n(
100
+ "button",
101
+ {
102
+ type: "button",
103
+ onClick: () => i?.(r),
104
+ className: u(
105
+ "flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1",
106
+ "hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
107
+ "transition-colors",
108
+ !a && "opacity-40"
109
+ ),
110
+ children: [
111
+ /* @__PURE__ */ e(
112
+ "div",
113
+ {
114
+ className: u(
115
+ "flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
116
+ o && "bg-primary font-semibold text-primary-foreground"
117
+ ),
118
+ children: t
119
+ }
120
+ ),
121
+ h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <= d ? s.map((c) => /* @__PURE__ */ e(
122
+ "div",
123
+ {
124
+ className: "size-1 sm:size-1.5 rounded-full bg-primary",
125
+ style: Me(c)
126
+ },
127
+ c.id
128
+ )) : /* @__PURE__ */ n(Z, { children: [
129
+ s.slice(0, d).map((c) => /* @__PURE__ */ e(
130
+ "div",
131
+ {
132
+ className: "size-1 sm:size-1.5 rounded-full bg-primary",
133
+ style: Me(c)
134
+ },
135
+ c.id
136
+ )),
137
+ /* @__PURE__ */ n("span", { className: "text-[6px] sm:text-[7px] font-medium text-muted-foreground", children: [
138
+ "+",
139
+ h - d
140
+ ] })
141
+ ] }) })
142
+ ]
143
+ }
144
+ );
145
+ }
146
+ function gt({
147
+ date: t,
148
+ events: r,
149
+ onMonthClick: s,
150
+ onDayClick: a
151
+ }) {
152
+ const i = j(() => Xe(t, 0), [t]);
153
+ return /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
154
+ /* @__PURE__ */ e(
155
+ "button",
156
+ {
157
+ type: "button",
158
+ onClick: () => s?.(t),
159
+ className: u(
160
+ "w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
161
+ "hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
162
+ "transition-colors"
163
+ ),
164
+ children: mt[t.getMonth()]
165
+ }
166
+ ),
167
+ /* @__PURE__ */ n("div", { className: "flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3", children: [
168
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: ht.map((o, d) => /* @__PURE__ */ n(
169
+ "div",
170
+ {
171
+ className: "text-[9px] sm:text-xs font-medium text-muted-foreground",
172
+ children: [
173
+ /* @__PURE__ */ e("span", { className: "sm:hidden", children: o[0] }),
174
+ /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: o })
175
+ ]
176
+ },
177
+ d
178
+ )) }),
179
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((o, d) => {
180
+ const h = Ze(r, o.date);
181
+ return /* @__PURE__ */ e(
182
+ ft,
183
+ {
184
+ day: o.date.getDate(),
185
+ date: o.date,
186
+ events: h,
187
+ isCurrentMonth: o.isCurrentMonth,
188
+ onDayClick: a
189
+ },
190
+ `${d + 1}-${o.date.toISOString()}`
191
+ );
192
+ }) })
193
+ ] })
194
+ ] });
195
+ }
196
+ function xt({
197
+ events: t,
198
+ year: r,
199
+ onMonthClick: s,
200
+ onDayClick: a,
201
+ className: i
202
+ }) {
203
+ const o = j(() => Qe(r), [r]);
204
+ return /* @__PURE__ */ n("div", { className: u("flex flex-col h-full", i), children: [
205
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center border-b px-4 py-3", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: r }) }),
206
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: o.map((d) => /* @__PURE__ */ e(
207
+ gt,
208
+ {
209
+ date: d,
210
+ events: t,
211
+ onMonthClick: s,
212
+ onDayClick: a
213
+ },
214
+ d.getMonth()
215
+ )) }) })
216
+ ] });
217
+ }
218
+ function pt({ className: t }) {
219
+ return /* @__PURE__ */ e(
220
+ "svg",
221
+ {
222
+ xmlns: "http://www.w3.org/2000/svg",
223
+ viewBox: "0 0 24 24",
224
+ fill: "none",
225
+ stroke: "currentColor",
226
+ strokeWidth: "2",
227
+ strokeLinecap: "round",
228
+ strokeLinejoin: "round",
229
+ className: t,
230
+ children: /* @__PURE__ */ e("path", { d: "m15 18-6-6 6-6" })
231
+ }
232
+ );
233
+ }
234
+ function vt({ className: t }) {
235
+ return /* @__PURE__ */ e(
236
+ "svg",
237
+ {
238
+ xmlns: "http://www.w3.org/2000/svg",
239
+ viewBox: "0 0 24 24",
240
+ fill: "none",
241
+ stroke: "currentColor",
242
+ strokeWidth: "2",
243
+ strokeLinecap: "round",
244
+ strokeLinejoin: "round",
245
+ className: t,
246
+ children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" })
247
+ }
248
+ );
249
+ }
250
+ const ge = 44, ze = 4, wt = 56, Se = 8, he = 80, oe = 140, bt = 8, yt = 18;
251
+ function Nt(t) {
252
+ return t.split(" ").map((r) => r[0]).join("").toUpperCase().slice(0, 2);
253
+ }
254
+ function kt(t, r) {
255
+ const s = [];
256
+ for (let a = 0; a < r; a++) {
257
+ const i = new Date(t);
258
+ i.setDate(i.getDate() + a), s.push(i);
259
+ }
260
+ return s;
261
+ }
262
+ function Ct(t, r, s) {
263
+ const a = [];
264
+ return t.forEach((i, o) => {
265
+ for (let d = r; d < s; d++)
266
+ a.push({ hour: d, dayIndex: o, date: i });
267
+ }), a;
268
+ }
269
+ function Dt(t) {
270
+ return `${t.toString().padStart(2, "0")}:00`;
271
+ }
272
+ function Mt(t) {
273
+ return t.toLocaleDateString("en-US", {
274
+ weekday: "short",
275
+ month: "short",
276
+ day: "numeric"
277
+ });
278
+ }
279
+ function zt(t, r) {
280
+ const s = t.toLocaleDateString("en-US", { month: "short" }), a = r.toLocaleDateString("en-US", { month: "short" }), i = t.getDate(), o = r.getDate(), d = r.getFullYear();
281
+ return s === a ? `${s} ${i} - ${o}, ${d}` : `${s} ${i} - ${a} ${o}, ${d}`;
282
+ }
283
+ function Ee(t) {
284
+ const r = [...t].sort((i, o) => i.startCol !== o.startCol ? i.startCol - o.startCol : o.spanCols - i.spanCols), s = [], a = [];
285
+ for (const i of r) {
286
+ let o = 0;
287
+ for (; a[o] !== void 0 && a[o] > i.startCol; )
288
+ o++;
289
+ a[o] = i.startCol + i.spanCols, s.push({
290
+ ...i,
291
+ stackIndex: o
292
+ });
293
+ }
294
+ return s;
295
+ }
296
+ function St({ src: t, alt: r, fallback: s, className: a }) {
297
+ return /* @__PURE__ */ e(
298
+ "div",
299
+ {
300
+ className: u(
301
+ "relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
302
+ a
303
+ ),
304
+ children: t ? /* @__PURE__ */ e(
305
+ "img",
306
+ {
307
+ src: t,
308
+ alt: r,
309
+ className: "aspect-square h-full w-full object-cover"
310
+ }
311
+ ) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: s })
312
+ }
313
+ );
314
+ }
315
+ const Et = 7;
316
+ function xe({
317
+ daysToShow: t = Et,
318
+ events: r,
319
+ users: s = [],
320
+ selectedDate: a,
321
+ onDateChange: i,
322
+ onEventClick: o,
323
+ visibleHours: d,
324
+ className: h,
325
+ getEventUserId: c,
326
+ renderPopover: g
327
+ }) {
328
+ const p = Je(null), N = a ?? /* @__PURE__ */ new Date(), w = !0, b = d?.from ?? bt, k = d?.to ?? yt, D = k - b, C = j(() => {
329
+ const l = new Date(N);
330
+ if (t === 1 || t === 3)
331
+ return l.setHours(0, 0, 0, 0), l;
332
+ const x = l.getDay(), y = x === 0 ? -6 : 1 - x;
333
+ return l.setDate(l.getDate() + y), l.setHours(0, 0, 0, 0), l;
334
+ }, [N, t]), v = j(
335
+ () => kt(C, t),
336
+ [C, t]
337
+ ), M = j(
338
+ () => Ct(v, b, k),
339
+ [w, v, b, k]
340
+ ), L = c ?? ((l) => {
341
+ if (l.user?.id) return l.user.id;
342
+ const x = l.data;
343
+ if (x?.userId) return String(x.userId);
344
+ if (x?.user && typeof x.user == "object" && x.user.id)
345
+ return String(x.user.id);
346
+ if (l.participants?.[0]?.id) return l.participants[0].id;
347
+ }), H = j(() => {
348
+ const l = /* @__PURE__ */ new Map();
349
+ for (const x of s)
350
+ l.set(x.id, {
351
+ id: x.id,
352
+ name: x.name,
353
+ avatar: x.avatar ?? void 0,
354
+ email: x.email
355
+ });
356
+ for (const x of r) {
357
+ x.user?.id && !l.has(x.user.id) && l.set(x.user.id, {
358
+ id: x.user.id,
359
+ name: x.user.name,
360
+ avatar: x.user.avatar ?? void 0,
361
+ email: x.user.email
362
+ });
363
+ for (const y of x.participants || [])
364
+ y.id && !l.has(y.id) && l.set(y.id, {
365
+ id: y.id,
366
+ name: y.name,
367
+ avatar: y.avatar ?? void 0,
368
+ email: y.email
369
+ });
370
+ }
371
+ return Array.from(l.values());
372
+ }, [s, r]), A = j(() => {
373
+ const l = [], x = /* @__PURE__ */ new Map();
374
+ for (const T of H)
375
+ x.set(T.id, []);
376
+ x.set("unassigned", []);
377
+ for (const T of r) {
378
+ const B = L(T) ?? "unassigned";
379
+ (x.get(B) ?? x.get("unassigned")).push(T);
380
+ }
381
+ const y = (T) => {
382
+ const B = [];
383
+ for (const I of T) {
384
+ const F = I.startDate.getHours() + I.startDate.getMinutes() / 60, ee = I.endDate.getHours() + I.endDate.getMinutes() / 60;
385
+ for (let R = 0; R < v.length; R++) {
386
+ const te = v[R], de = fe(te), ue = Be(te);
387
+ if (I.startDate <= ue && I.endDate >= de) {
388
+ let re = b, X = k;
389
+ if (I.startDate >= de && (re = Math.max(b, F)), I.endDate <= ue && (X = Math.min(k, ee)), re = Math.max(b, Math.min(k, re)), X = Math.max(b, Math.min(k, X)), X > re) {
390
+ const $ = R * D + Math.floor(re - b), ne = R * D + Math.ceil(X - b);
391
+ B.push({
392
+ event: I,
393
+ startCol: $,
394
+ spanCols: Math.max(1, ne - $)
395
+ });
396
+ }
397
+ }
398
+ }
399
+ }
400
+ return B;
401
+ };
402
+ for (const T of H) {
403
+ const B = x.get(T.id) ?? [], I = y(B), F = Ee(I), ee = F.reduce(
404
+ (R, te) => Math.max(R, te.stackIndex + 1),
405
+ 0
406
+ );
407
+ l.push({
408
+ user: T,
409
+ events: F,
410
+ maxStack: Math.max(ee, 1)
411
+ });
412
+ }
413
+ const S = x.get("unassigned") ?? [];
414
+ if (S.length > 0) {
415
+ const T = y(S), B = Ee(T), I = B.reduce(
416
+ (F, ee) => Math.max(F, ee.stackIndex + 1),
417
+ 0
418
+ );
419
+ l.push({
420
+ user: {
421
+ id: "unassigned",
422
+ name: "Unassigned",
423
+ avatar: void 0,
424
+ email: void 0
425
+ },
426
+ events: B,
427
+ maxStack: Math.max(I, 1)
428
+ });
429
+ }
430
+ return l;
431
+ }, [H, r, v, w, D, b, k, L]), W = (l) => Math.max(
432
+ wt,
433
+ l * (ge + ze) + Se * 2
434
+ ), P = () => {
435
+ const l = new Date(C);
436
+ l.setDate(l.getDate() - t), i?.(l);
437
+ }, O = () => {
438
+ const l = new Date(C);
439
+ l.setDate(l.getDate() + t), i?.(l);
440
+ }, _ = M.length, f = he, E = oe + _ * f, m = j(() => {
441
+ const l = v[0], x = v[v.length - 1];
442
+ return !l || !x ? "" : t === 1 ? l.toLocaleDateString("en-US", {
443
+ weekday: "long",
444
+ month: "short",
445
+ day: "numeric",
446
+ year: "numeric"
447
+ }) : zt(l, x);
448
+ }, [v, t]);
449
+ return /* @__PURE__ */ n("div", { className: u("flex h-full flex-col", h), children: [
450
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b bg-white px-2 sm:px-4 py-2 sm:py-3 gap-2", children: [
451
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1 sm:gap-2 shrink-0", children: [
452
+ /* @__PURE__ */ e(
453
+ V,
454
+ {
455
+ variant: "outline",
456
+ size: "icon",
457
+ className: "size-7 sm:size-8",
458
+ onClick: P,
459
+ children: /* @__PURE__ */ e(pt, { className: "size-3.5 sm:size-4" })
460
+ }
461
+ ),
462
+ /* @__PURE__ */ e(
463
+ V,
464
+ {
465
+ variant: "outline",
466
+ size: "icon",
467
+ className: "size-7 sm:size-8",
468
+ onClick: O,
469
+ children: /* @__PURE__ */ e(vt, { className: "size-3.5 sm:size-4" })
470
+ }
471
+ )
472
+ ] }),
473
+ /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium truncate", children: m }),
474
+ /* @__PURE__ */ e("div", { className: "w-8 sm:w-16 shrink-0" }),
475
+ " "
476
+ ] }),
477
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", ref: p, children: /* @__PURE__ */ n("div", { className: "relative", style: { minWidth: E }, children: [
478
+ // Hour mode: Day headers + Hour sub-headers
479
+ /* @__PURE__ */ n("div", { className: "sticky top-0 z-20 flex flex-col border-b bg-white", children: [
480
+ t > 1 && /* @__PURE__ */ n("div", { className: "flex border-b", children: [
481
+ /* @__PURE__ */ e(
482
+ "div",
483
+ {
484
+ className: "flex shrink-0 items-center border-r bg-white px-2 py-1",
485
+ style: { width: oe },
486
+ children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
487
+ }
488
+ ),
489
+ v.map((l) => {
490
+ const x = q(l);
491
+ return /* @__PURE__ */ e(
492
+ "div",
493
+ {
494
+ className: u(
495
+ "flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
496
+ x ? "bg-primary/10 text-primary" : "bg-muted/30"
497
+ ),
498
+ style: { width: D * he },
499
+ children: /* @__PURE__ */ e("span", { className: "text-xs", children: Mt(l) })
500
+ },
501
+ `day-${l.toISOString()}`
502
+ );
503
+ })
504
+ ] }),
505
+ /* @__PURE__ */ n("div", { className: "flex", children: [
506
+ t === 1 && /* @__PURE__ */ e(
507
+ "div",
508
+ {
509
+ className: "flex shrink-0 items-center border-r bg-white px-2 py-2",
510
+ style: { width: oe },
511
+ children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
512
+ }
513
+ ),
514
+ t > 1 && /* @__PURE__ */ e(
515
+ "div",
516
+ {
517
+ className: "shrink-0 border-r bg-background",
518
+ style: { width: oe }
519
+ }
520
+ ),
521
+ M.map((l, x) => {
522
+ const y = l.hour === b, S = q(l.date);
523
+ return /* @__PURE__ */ e(
524
+ "div",
525
+ {
526
+ className: u(
527
+ "flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
528
+ y && x > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
529
+ S && "bg-primary/5"
530
+ ),
531
+ style: { width: he },
532
+ children: Dt(l.hour)
533
+ },
534
+ `hour-${l.dayIndex}-${l.hour}`
535
+ );
536
+ })
537
+ ] })
538
+ ] }),
539
+ A.map((l) => {
540
+ const x = W(l.maxStack);
541
+ return /* @__PURE__ */ n(
542
+ "div",
543
+ {
544
+ className: "relative flex border-b",
545
+ style: { height: x },
546
+ children: [
547
+ /* @__PURE__ */ n(
548
+ "div",
549
+ {
550
+ className: "sticky left-0 z-10 flex shrink-0 items-center gap-2 sm:gap-3 border-r bg-white px-2 sm:px-4",
551
+ style: { width: oe },
552
+ children: [
553
+ /* @__PURE__ */ e(
554
+ St,
555
+ {
556
+ className: "size-7",
557
+ src: l.user.avatar,
558
+ alt: l.user.name,
559
+ fallback: Nt(l.user.name)
560
+ }
561
+ ),
562
+ /* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: l.user.name })
563
+ ]
564
+ }
565
+ ),
566
+ /* @__PURE__ */ n("div", { className: "relative flex flex-1", children: [
567
+ // Hour mode cells
568
+ M.map((y, S) => {
569
+ const T = y.hour === b && S > 0;
570
+ return /* @__PURE__ */ e(
571
+ "div",
572
+ {
573
+ className: u(
574
+ "shrink-0",
575
+ T ? "border-l-2 border-l-border" : "border-r border-r-border/50",
576
+ q(y.date) && "bg-primary/5"
577
+ ),
578
+ style: { width: he }
579
+ },
580
+ `cell-${y.dayIndex}-${y.hour}`
581
+ );
582
+ }),
583
+ l.events.map((y) => {
584
+ const S = y.startCol * f + 2, T = y.spanCols * f - 4, B = Se + y.stackIndex * (ge + ze);
585
+ return /* @__PURE__ */ e(
586
+ "div",
587
+ {
588
+ className: "absolute",
589
+ style: {
590
+ left: S,
591
+ width: T,
592
+ top: B,
593
+ height: ge
594
+ },
595
+ children: /* @__PURE__ */ e(
596
+ rt,
597
+ {
598
+ event: y.event,
599
+ variant: "compact",
600
+ onClick: o,
601
+ renderPopover: g,
602
+ className: "h-full w-full"
603
+ }
604
+ )
605
+ },
606
+ y.event.id
607
+ );
608
+ })
609
+ ] })
610
+ ]
611
+ },
612
+ l.user.id
613
+ );
614
+ }),
615
+ A.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
616
+ ] }) })
617
+ ] });
618
+ }
619
+ function Lt(t) {
620
+ switch (t) {
621
+ case "day":
622
+ case "week":
623
+ return "time";
624
+ default:
625
+ return "day";
626
+ }
627
+ }
628
+ function Tt({
629
+ onEventClick: t,
630
+ onSlotClick: r,
631
+ onSlotSelect: s,
632
+ onAddEvent: a,
633
+ className: i,
634
+ showHeader: o = !0,
635
+ minSelectionMinutes: d = 30,
636
+ settingsContent: h,
637
+ filterContent: c,
638
+ renderPopover: g
639
+ }) {
640
+ const {
641
+ view: p,
642
+ setView: N,
643
+ selectedDate: w,
644
+ setSelectedDate: b,
645
+ slotDuration: k,
646
+ filteredEvents: D,
647
+ users: C,
648
+ visibleHours: v,
649
+ workingHours: M,
650
+ badgeVariant: z
651
+ } = Ke(), L = j(
652
+ () => ({
653
+ startHour: v.start,
654
+ endHour: v.end
655
+ }),
656
+ [v]
657
+ ), H = j(() => Lt(p), [p]), A = se(
658
+ (f) => {
659
+ if (s) {
660
+ s(f);
661
+ return;
662
+ }
663
+ if (r) {
664
+ const E = f.startDate.getHours();
665
+ r(f.startDate, E);
666
+ }
667
+ },
668
+ [s, r]
669
+ ), W = se(
670
+ (f) => {
671
+ N("day"), b(f, "day");
672
+ },
673
+ [b, N]
674
+ ), P = se(
675
+ (f) => {
676
+ N("month"), b(f, "month");
677
+ },
678
+ [b, N]
679
+ ), O = se(
680
+ (f) => {
681
+ t?.(f);
682
+ },
683
+ [t]
684
+ ), _ = () => {
685
+ const f = D, E = O, m = g;
686
+ switch (p) {
687
+ case "day":
688
+ return /* @__PURE__ */ e(
689
+ it,
690
+ {
691
+ events: f,
692
+ date: w,
693
+ visibleHours: L,
694
+ workingHours: M,
695
+ slotDuration: k,
696
+ badgeVariant: z,
697
+ onEventClick: E,
698
+ renderPopover: m
699
+ }
700
+ );
701
+ case "week":
702
+ return /* @__PURE__ */ e(
703
+ at,
704
+ {
705
+ events: f,
706
+ date: w,
707
+ visibleHours: L,
708
+ workingHours: M,
709
+ slotDuration: k,
710
+ badgeVariant: z,
711
+ onEventClick: E,
712
+ renderPopover: m
713
+ }
714
+ );
715
+ case "month":
716
+ return /* @__PURE__ */ e(
717
+ ke,
718
+ {
719
+ events: f,
720
+ date: w,
721
+ badgeVariant: z,
722
+ onEventClick: E,
723
+ onDayClick: W,
724
+ renderPopover: m
725
+ }
726
+ );
727
+ case "year":
728
+ return /* @__PURE__ */ e(
729
+ xt,
730
+ {
731
+ events: f,
732
+ year: w.getFullYear(),
733
+ onMonthClick: P,
734
+ onDayClick: W
735
+ }
736
+ );
737
+ case "agenda":
738
+ return /* @__PURE__ */ e(
739
+ st,
740
+ {
741
+ events: f,
742
+ date: w,
743
+ onEventClick: E,
744
+ renderPopover: m
745
+ }
746
+ );
747
+ // Timeline views
748
+ case "timeline-day":
749
+ return /* @__PURE__ */ e(
750
+ xe,
751
+ {
752
+ daysToShow: 1,
753
+ events: f,
754
+ users: C,
755
+ selectedDate: w,
756
+ visibleHours: {
757
+ from: v.start,
758
+ to: v.end
759
+ },
760
+ onEventClick: E,
761
+ renderPopover: m
762
+ }
763
+ );
764
+ case "timeline-3day":
765
+ return /* @__PURE__ */ e(
766
+ xe,
767
+ {
768
+ daysToShow: 3,
769
+ events: f,
770
+ users: C,
771
+ selectedDate: w,
772
+ visibleHours: {
773
+ from: v.start,
774
+ to: v.end
775
+ },
776
+ onEventClick: E,
777
+ renderPopover: m
778
+ }
779
+ );
780
+ case "timeline-week":
781
+ return /* @__PURE__ */ e(
782
+ xe,
783
+ {
784
+ daysToShow: 7,
785
+ events: f,
786
+ users: C,
787
+ selectedDate: w,
788
+ visibleHours: {
789
+ from: v.start,
790
+ to: v.end
791
+ },
792
+ onEventClick: E,
793
+ renderPopover: m
794
+ }
795
+ );
796
+ default:
797
+ return /* @__PURE__ */ e(
798
+ ke,
799
+ {
800
+ events: f,
801
+ date: w,
802
+ badgeVariant: z,
803
+ onEventClick: E,
804
+ onDayClick: W
805
+ }
806
+ );
807
+ }
808
+ };
809
+ return /* @__PURE__ */ e(
810
+ et,
811
+ {
812
+ mode: H,
813
+ onSelect: A,
814
+ minDurationMinutes: d,
815
+ slotDurationMinutes: k,
816
+ enabled: !!(s || r),
817
+ children: /* @__PURE__ */ n("div", { className: u("flex flex-col h-full p-4", i), children: [
818
+ o && /* @__PURE__ */ e(
819
+ nt,
820
+ {
821
+ currentDate: w,
822
+ view: p,
823
+ events: D,
824
+ onViewChange: N,
825
+ onNavigateToday: () => b(/* @__PURE__ */ new Date(), p),
826
+ onNavigatePrev: () => {
827
+ const f = new Date(w);
828
+ p === "day" || p === "timeline-day" ? f.setDate(f.getDate() - 1) : p === "timeline-3day" ? f.setDate(f.getDate() - 3) : p === "week" || p === "timeline-week" ? f.setDate(f.getDate() - 7) : p === "month" ? f.setMonth(f.getMonth() - 1) : p === "year" ? f.setFullYear(f.getFullYear() - 1) : f.setDate(f.getDate() - 7), b(f, p);
829
+ },
830
+ onNavigateNext: () => {
831
+ const f = new Date(w);
832
+ p === "day" || p === "timeline-day" ? f.setDate(f.getDate() + 1) : p === "timeline-3day" ? f.setDate(f.getDate() + 3) : p === "week" || p === "timeline-week" ? f.setDate(f.getDate() + 7) : p === "month" ? f.setMonth(f.getMonth() + 1) : p === "year" ? f.setFullYear(f.getFullYear() + 1) : f.setDate(f.getDate() + 7), b(f, p);
833
+ },
834
+ availableViews: ["day", "week", "month", "year", "agenda"],
835
+ showTimelineViews: !0,
836
+ showSettings: !!h,
837
+ ...a && { onAddEvent: a },
838
+ settingsContent: h,
839
+ filterContent: c
840
+ }
841
+ ),
842
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden border rounded-lg bg-white dark:bg-gray-900", children: _() })
843
+ ] })
844
+ }
845
+ );
846
+ }
847
+ function _r({
848
+ events: t,
849
+ users: r = [],
850
+ scheduleTypes: s = [],
851
+ initialView: a = "week",
852
+ initialDate: i,
853
+ initialSelectedUserId: o,
854
+ initialScheduleTypeIds: d,
855
+ initialParticipantIds: h,
856
+ initialWorkingHoursView: c,
857
+ initialSearchQuery: g,
858
+ preferencesConfig: p,
859
+ onEventClick: N,
860
+ onSlotClick: w,
861
+ onSlotSelect: b,
862
+ onAddEvent: k,
863
+ onEventDrop: D,
864
+ onDateChange: C,
865
+ onViewChange: v,
866
+ className: M,
867
+ showHeader: z = !0,
868
+ minSelectionMinutes: L = 30,
869
+ renderPopover: H,
870
+ settingsContent: A,
871
+ filterContent: W
872
+ }) {
873
+ return /* @__PURE__ */ e(qe, { ...D && { onEventDrop: D }, children: /* @__PURE__ */ e(
874
+ Ge,
875
+ {
876
+ initialEvents: t,
877
+ initialUsers: r,
878
+ initialScheduleTypes: s,
879
+ initialView: a,
880
+ ...i && { initialDate: i },
881
+ ...o && { initialSelectedUserId: o },
882
+ ...d && { initialScheduleTypeIds: d },
883
+ ...h && { initialParticipantIds: h },
884
+ ...c && { initialWorkingHoursView: c },
885
+ ...g && { initialSearchQuery: g },
886
+ ...p && { preferencesConfig: p },
887
+ ...C && { onDateChange: C },
888
+ ...v && { onViewChange: v },
889
+ children: /* @__PURE__ */ e(
890
+ Tt,
891
+ {
892
+ ...N && { onEventClick: N },
893
+ ...w && { onSlotClick: w },
894
+ ...b && { onSlotSelect: b },
895
+ ...k && { onAddEvent: k },
896
+ ...H && { renderPopover: H },
897
+ className: M,
898
+ showHeader: z,
899
+ minSelectionMinutes: L,
900
+ settingsContent: A,
901
+ filterContent: W
902
+ }
903
+ )
904
+ }
905
+ ) });
906
+ }
907
+ const Q = ye(
908
+ ({ className: t, children: r, ...s }, a) => /* @__PURE__ */ e(
909
+ "select",
910
+ {
911
+ ref: a,
912
+ className: u(
913
+ "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
914
+ "ring-offset-background",
915
+ "focus:outline-none focus:ring-1 focus:ring-ring",
916
+ "disabled:cursor-not-allowed disabled:opacity-50",
917
+ "[&>option]:bg-background",
918
+ t
919
+ ),
920
+ ...s,
921
+ children: r
922
+ }
923
+ )
924
+ );
925
+ Q.displayName = "Select";
926
+ const U = ye(
927
+ ({ className: t, ...r }, s) => /* @__PURE__ */ e(
928
+ "label",
929
+ {
930
+ ref: s,
931
+ className: u(
932
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
933
+ t
934
+ ),
935
+ ...r
936
+ }
937
+ )
938
+ );
939
+ U.displayName = "Label";
940
+ function jt({ className: t }) {
941
+ return /* @__PURE__ */ n(
942
+ "svg",
943
+ {
944
+ xmlns: "http://www.w3.org/2000/svg",
945
+ viewBox: "0 0 24 24",
946
+ fill: "none",
947
+ stroke: "currentColor",
948
+ strokeWidth: "2",
949
+ strokeLinecap: "round",
950
+ strokeLinejoin: "round",
951
+ className: t,
952
+ children: [
953
+ /* @__PURE__ */ e("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }),
954
+ /* @__PURE__ */ e("path", { d: "m15 5 4 4" })
955
+ ]
956
+ }
957
+ );
958
+ }
959
+ function Re({ className: t }) {
960
+ return /* @__PURE__ */ n(
961
+ "svg",
962
+ {
963
+ xmlns: "http://www.w3.org/2000/svg",
964
+ viewBox: "0 0 24 24",
965
+ fill: "none",
966
+ stroke: "currentColor",
967
+ strokeWidth: "2",
968
+ strokeLinecap: "round",
969
+ strokeLinejoin: "round",
970
+ className: t,
971
+ children: [
972
+ /* @__PURE__ */ e("path", { d: "M3 6h18" }),
973
+ /* @__PURE__ */ e("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
974
+ /* @__PURE__ */ e("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }),
975
+ /* @__PURE__ */ e("line", { x1: "10", x2: "10", y1: "11", y2: "17" }),
976
+ /* @__PURE__ */ e("line", { x1: "14", x2: "14", y1: "11", y2: "17" })
977
+ ]
978
+ }
979
+ );
980
+ }
981
+ function me({ className: t }) {
982
+ return /* @__PURE__ */ n(
983
+ "svg",
984
+ {
985
+ xmlns: "http://www.w3.org/2000/svg",
986
+ viewBox: "0 0 24 24",
987
+ fill: "none",
988
+ stroke: "currentColor",
989
+ strokeWidth: "2",
990
+ strokeLinecap: "round",
991
+ strokeLinejoin: "round",
992
+ className: t,
993
+ children: [
994
+ /* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
995
+ /* @__PURE__ */ e("path", { d: "m6 6 12 12" })
996
+ ]
997
+ }
998
+ );
999
+ }
1000
+ function It({ className: t }) {
1001
+ return /* @__PURE__ */ n(
1002
+ "svg",
1003
+ {
1004
+ xmlns: "http://www.w3.org/2000/svg",
1005
+ viewBox: "0 0 24 24",
1006
+ fill: "none",
1007
+ stroke: "currentColor",
1008
+ strokeWidth: "2",
1009
+ strokeLinecap: "round",
1010
+ strokeLinejoin: "round",
1011
+ className: t,
1012
+ children: [
1013
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1014
+ /* @__PURE__ */ e("path", { d: "m4.9 4.9 14.2 14.2" })
1015
+ ]
1016
+ }
1017
+ );
1018
+ }
1019
+ function le({ className: t }) {
1020
+ return /* @__PURE__ */ e(
1021
+ "svg",
1022
+ {
1023
+ xmlns: "http://www.w3.org/2000/svg",
1024
+ viewBox: "0 0 24 24",
1025
+ fill: "none",
1026
+ stroke: "currentColor",
1027
+ strokeWidth: "2",
1028
+ strokeLinecap: "round",
1029
+ strokeLinejoin: "round",
1030
+ className: t,
1031
+ children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" })
1032
+ }
1033
+ );
1034
+ }
1035
+ function Ht({ className: t }) {
1036
+ return /* @__PURE__ */ n(
1037
+ "svg",
1038
+ {
1039
+ xmlns: "http://www.w3.org/2000/svg",
1040
+ viewBox: "0 0 24 24",
1041
+ fill: "none",
1042
+ stroke: "currentColor",
1043
+ strokeWidth: "2",
1044
+ strokeLinecap: "round",
1045
+ strokeLinejoin: "round",
1046
+ className: t,
1047
+ children: [
1048
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1049
+ /* @__PURE__ */ e("path", { d: "m9 12 2 2 4-4" })
1050
+ ]
1051
+ }
1052
+ );
1053
+ }
1054
+ function $t({ className: t }) {
1055
+ return /* @__PURE__ */ e(
1056
+ "svg",
1057
+ {
1058
+ xmlns: "http://www.w3.org/2000/svg",
1059
+ viewBox: "0 0 24 24",
1060
+ fill: "none",
1061
+ stroke: "currentColor",
1062
+ strokeWidth: "2",
1063
+ strokeLinecap: "round",
1064
+ strokeLinejoin: "round",
1065
+ className: t,
1066
+ children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" })
1067
+ }
1068
+ );
1069
+ }
1070
+ function Wt({ className: t }) {
1071
+ return /* @__PURE__ */ n(
1072
+ "svg",
1073
+ {
1074
+ xmlns: "http://www.w3.org/2000/svg",
1075
+ viewBox: "0 0 24 24",
1076
+ fill: "none",
1077
+ stroke: "currentColor",
1078
+ strokeWidth: "2",
1079
+ strokeLinecap: "round",
1080
+ strokeLinejoin: "round",
1081
+ className: t,
1082
+ children: [
1083
+ /* @__PURE__ */ e("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
1084
+ /* @__PURE__ */ e("circle", { cx: "9", cy: "7", r: "4" }),
1085
+ /* @__PURE__ */ e("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
1086
+ /* @__PURE__ */ e("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
1087
+ ]
1088
+ }
1089
+ );
1090
+ }
1091
+ function At({ className: t }) {
1092
+ return /* @__PURE__ */ n(
1093
+ "svg",
1094
+ {
1095
+ xmlns: "http://www.w3.org/2000/svg",
1096
+ viewBox: "0 0 24 24",
1097
+ fill: "none",
1098
+ stroke: "currentColor",
1099
+ strokeWidth: "2",
1100
+ strokeLinecap: "round",
1101
+ strokeLinejoin: "round",
1102
+ className: t,
1103
+ children: [
1104
+ /* @__PURE__ */ e("path", { d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" }),
1105
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "10", r: "3" })
1106
+ ]
1107
+ }
1108
+ );
1109
+ }
1110
+ function Bt({ className: t }) {
1111
+ return /* @__PURE__ */ n(
1112
+ "svg",
1113
+ {
1114
+ xmlns: "http://www.w3.org/2000/svg",
1115
+ viewBox: "0 0 24 24",
1116
+ fill: "none",
1117
+ stroke: "currentColor",
1118
+ strokeWidth: "2",
1119
+ strokeLinecap: "round",
1120
+ strokeLinejoin: "round",
1121
+ className: t,
1122
+ children: [
1123
+ /* @__PURE__ */ e("path", { d: "M8 2v4" }),
1124
+ /* @__PURE__ */ e("path", { d: "M16 2v4" }),
1125
+ /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2" }),
1126
+ /* @__PURE__ */ e("path", { d: "M3 10h18" })
1127
+ ]
1128
+ }
1129
+ );
1130
+ }
1131
+ function Ft({ className: t }) {
1132
+ return /* @__PURE__ */ n(
1133
+ "svg",
1134
+ {
1135
+ xmlns: "http://www.w3.org/2000/svg",
1136
+ viewBox: "0 0 24 24",
1137
+ fill: "none",
1138
+ stroke: "currentColor",
1139
+ strokeWidth: "2",
1140
+ strokeLinecap: "round",
1141
+ strokeLinejoin: "round",
1142
+ className: t,
1143
+ children: [
1144
+ /* @__PURE__ */ e("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
1145
+ /* @__PURE__ */ e("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
1146
+ /* @__PURE__ */ e("path", { d: "M10 9H8" }),
1147
+ /* @__PURE__ */ e("path", { d: "M16 13H8" }),
1148
+ /* @__PURE__ */ e("path", { d: "M16 17H8" })
1149
+ ]
1150
+ }
1151
+ );
1152
+ }
1153
+ function ie({ className: t }) {
1154
+ return /* @__PURE__ */ e(
1155
+ "svg",
1156
+ {
1157
+ xmlns: "http://www.w3.org/2000/svg",
1158
+ viewBox: "0 0 24 24",
1159
+ fill: "none",
1160
+ stroke: "currentColor",
1161
+ strokeWidth: "2",
1162
+ strokeLinecap: "round",
1163
+ strokeLinejoin: "round",
1164
+ className: u("animate-spin", t),
1165
+ children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
1166
+ }
1167
+ );
1168
+ }
1169
+ const Pt = {
1170
+ edit: "Edit",
1171
+ delete: "Delete",
1172
+ cancel: "Cancel Event",
1173
+ close: "Close",
1174
+ going: "Going",
1175
+ notGoing: "Not Going",
1176
+ confirmMeeting: "Confirm meeting took place",
1177
+ completed: "Completed",
1178
+ canceled: "Canceled",
1179
+ participants: "Participants",
1180
+ guest: "guest",
1181
+ guests: "guests",
1182
+ confirmed: "confirmed",
1183
+ organizer: "Organizer",
1184
+ client: "Client",
1185
+ more: "more",
1186
+ noDateProvided: "No date provided",
1187
+ eventNotFound: "Event not found",
1188
+ cancellationNote: "Cancellation Note",
1189
+ canceledOn: "Canceled on",
1190
+ acceptThisEvent: "Accept this event only",
1191
+ acceptAllEvents: "Accept all events",
1192
+ deleteConfirmTitle: "Delete Event",
1193
+ deleteConfirmDescription: "Are you sure you want to delete this event? This action cannot be undone."
1194
+ }, ce = ye(
1195
+ ({ onClick: t, label: r, children: s, className: a, variant: i = "ghost", ...o }, d) => /* @__PURE__ */ n(G, { children: [
1196
+ /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(
1197
+ "button",
1198
+ {
1199
+ type: "button",
1200
+ ref: d,
1201
+ onClick: t,
1202
+ className: u(
1203
+ "h-8 w-8 rounded-full flex items-center justify-center transition-colors",
1204
+ i === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
1205
+ i === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
1206
+ a
1207
+ ),
1208
+ "aria-label": r,
1209
+ ...o,
1210
+ children: s
1211
+ }
1212
+ ) }),
1213
+ /* @__PURE__ */ e(J, { side: "bottom", className: "text-xs", children: r })
1214
+ ] })
1215
+ );
1216
+ ce.displayName = "IconButton";
1217
+ function Ot({ src: t, alt: r, initials: s, className: a, isClient: i }) {
1218
+ const [o, d] = ae(!1);
1219
+ return /* @__PURE__ */ e(
1220
+ "div",
1221
+ {
1222
+ className: u(
1223
+ "relative h-7 w-7 rounded-full overflow-hidden shrink-0",
1224
+ a
1225
+ ),
1226
+ children: t && !o ? /* @__PURE__ */ e(
1227
+ "img",
1228
+ {
1229
+ src: t,
1230
+ alt: r,
1231
+ className: "h-full w-full object-cover",
1232
+ onError: () => d(!0)
1233
+ }
1234
+ ) : /* @__PURE__ */ e(
1235
+ "div",
1236
+ {
1237
+ className: u(
1238
+ "h-full w-full flex items-center justify-center text-[10px] font-medium",
1239
+ i ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
1240
+ ),
1241
+ children: s
1242
+ }
1243
+ )
1244
+ }
1245
+ );
1246
+ }
1247
+ function Le({
1248
+ participant: t,
1249
+ isEventCanceled: r = !1,
1250
+ labels: s
1251
+ }) {
1252
+ const a = t.name || "Unknown", i = a.split(" ").map((w) => w[0]).join("").toUpperCase().slice(0, 2), o = t.isOrganizer ?? !1, d = t.isConfirmed, h = d === !0, c = d === !1, g = t.isClient ?? !1, p = t.profilePicture || t.avatar, N = r;
1253
+ return /* @__PURE__ */ n(
1254
+ "div",
1255
+ {
1256
+ className: u(
1257
+ "flex items-center gap-3 py-0",
1258
+ N && "opacity-60"
1259
+ ),
1260
+ children: [
1261
+ /* @__PURE__ */ n("div", { className: "relative", children: [
1262
+ /* @__PURE__ */ e(
1263
+ Ot,
1264
+ {
1265
+ src: p,
1266
+ alt: a,
1267
+ initials: i,
1268
+ isClient: g,
1269
+ className: u(N && "grayscale")
1270
+ }
1271
+ ),
1272
+ N || c ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(me, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : h ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(le, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
1273
+ ] }),
1274
+ /* @__PURE__ */ n("div", { className: "!h-fit min-w-0 gap-0", children: [
1275
+ /* @__PURE__ */ e("div", { className: "gap-0", children: /* @__PURE__ */ e(
1276
+ "span",
1277
+ {
1278
+ className: u(
1279
+ "text-sm text-zinc-900 dark:text-zinc-100 truncate",
1280
+ N && "line-through text-zinc-500 dark:text-zinc-500"
1281
+ ),
1282
+ children: a
1283
+ }
1284
+ ) }),
1285
+ g && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: s.client }),
1286
+ o && !N && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: s.organizer })
1287
+ ] })
1288
+ ]
1289
+ }
1290
+ );
1291
+ }
1292
+ function _t({ open: t, onOpenChange: r, title: s, children: a }) {
1293
+ return be(() => {
1294
+ if (!t) return;
1295
+ const i = (o) => {
1296
+ o.key === "Escape" && r(!1);
1297
+ };
1298
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
1299
+ }, [t, r]), be(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
1300
+ document.body.style.overflow = "";
1301
+ }), [t]), t ? /* @__PURE__ */ n("div", { className: "fixed inset-0 z-50", children: [
1302
+ /* @__PURE__ */ e(
1303
+ "div",
1304
+ {
1305
+ className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
1306
+ onClick: () => r(!1),
1307
+ onKeyDown: (i) => {
1308
+ (i.key === "Enter" || i.key === " ") && r(!1);
1309
+ }
1310
+ }
1311
+ ),
1312
+ /* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ n("div", { className: "bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden", children: [
1313
+ s && /* @__PURE__ */ e("div", { className: "sr-only", children: s }),
1314
+ a
1315
+ ] }) })
1316
+ ] }) : null;
1317
+ }
1318
+ function Rt({
1319
+ open: t,
1320
+ onOpenChange: r,
1321
+ title: s,
1322
+ description: a,
1323
+ cancelLabel: i,
1324
+ confirmLabel: o,
1325
+ onConfirm: d,
1326
+ isLoading: h
1327
+ }) {
1328
+ return t ? /* @__PURE__ */ n("div", { className: "fixed inset-0 z-[60]", children: [
1329
+ /* @__PURE__ */ e(
1330
+ "div",
1331
+ {
1332
+ className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
1333
+ onClick: () => r(!1),
1334
+ onKeyDown: (c) => {
1335
+ (c.key === "Enter" || c.key === " ") && r(!1);
1336
+ }
1337
+ }
1338
+ ),
1339
+ /* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ n("div", { className: "bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6", children: [
1340
+ /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: s }),
1341
+ /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: a }),
1342
+ /* @__PURE__ */ n("div", { className: "mt-4 flex justify-end gap-3", children: [
1343
+ /* @__PURE__ */ e(
1344
+ V,
1345
+ {
1346
+ variant: "outline",
1347
+ size: "sm",
1348
+ onClick: () => r(!1),
1349
+ children: i
1350
+ }
1351
+ ),
1352
+ /* @__PURE__ */ n(
1353
+ V,
1354
+ {
1355
+ variant: "destructive",
1356
+ size: "sm",
1357
+ onClick: d,
1358
+ disabled: h,
1359
+ children: [
1360
+ h && /* @__PURE__ */ e(ie, { className: "h-4 w-4 mr-2" }),
1361
+ /* @__PURE__ */ e(Re, { className: "h-4 w-4 mr-2" }),
1362
+ o
1363
+ ]
1364
+ }
1365
+ )
1366
+ ] })
1367
+ ] }) })
1368
+ ] }) : null;
1369
+ }
1370
+ function Vt(t, r) {
1371
+ return t.toLocaleDateString(void 0, {
1372
+ weekday: "long",
1373
+ month: "long",
1374
+ day: "numeric"
1375
+ });
1376
+ }
1377
+ function Ut(t, r) {
1378
+ const s = {
1379
+ hour: "2-digit",
1380
+ minute: "2-digit",
1381
+ hour12: !1
1382
+ };
1383
+ return `${t.toLocaleTimeString(void 0, s)} – ${r.toLocaleTimeString(void 0, s)}`;
1384
+ }
1385
+ function Yt(t) {
1386
+ return t.toLocaleDateString(void 0, {
1387
+ day: "2-digit",
1388
+ month: "short",
1389
+ year: "numeric",
1390
+ hour: "2-digit",
1391
+ minute: "2-digit"
1392
+ });
1393
+ }
1394
+ function Gt(t) {
1395
+ const [r, s] = ae(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
1396
+ return be(() => {
1397
+ if (typeof window > "u") return;
1398
+ const a = window.matchMedia(t), i = (o) => s(o.matches);
1399
+ return a.addEventListener("change", i), () => a.removeEventListener("change", i);
1400
+ }, [t]), r;
1401
+ }
1402
+ function Te({
1403
+ event: t,
1404
+ labels: r,
1405
+ isLoading: s,
1406
+ onClose: a,
1407
+ onEdit: i,
1408
+ onDelete: o,
1409
+ onCancel: d,
1410
+ onAccept: h,
1411
+ onDecline: c,
1412
+ onConfirmMeeting: g,
1413
+ canEdit: p = !0,
1414
+ canDelete: N = !1,
1415
+ canCancel: w = !0,
1416
+ isCurrentUserParticipant: b = !1,
1417
+ isCurrentUserClient: k = !1,
1418
+ currentUserAcceptStatus: D,
1419
+ isAcceptLoading: C = !1,
1420
+ isDeclineLoading: v = !1,
1421
+ isConfirmLoading: M = !1,
1422
+ isDeleteLoading: z = !1,
1423
+ renderParticipant: L,
1424
+ renderHeaderActions: H,
1425
+ renderCancelReason: A,
1426
+ renderDeleteConfirmation: W,
1427
+ formatDate: P = Vt,
1428
+ formatTimeRange: O = Ut
1429
+ }) {
1430
+ const [_, f] = ae(!1), E = !(t.isCanceled || t.meetingTookPlace), m = t.isRecurring ?? !1, l = t.participantDetails, x = t.participantsNames || [], y = l && l.length > 0, S = D === !0, T = D === !1, B = b && !k && E, I = y ? l.filter(($) => $.isConfirmed).length : t.isAccepted ? x.length : 0, F = y ? l.length : x.length, ee = t.scheduleTypeColor || t.hexColor || "#039BE5", R = se(() => t.startDate ? P(t.startDate) : r.noDateProvided, [t.startDate, P, r.noDateProvided]), te = se(() => t.startDate && t.endDate ? O(t.startDate, t.endDate) : null, [t.startDate, t.endDate, O]), de = () => {
1431
+ a(), i?.(t);
1432
+ }, ue = () => {
1433
+ a(), d?.(t);
1434
+ }, re = () => {
1435
+ f(!0);
1436
+ }, X = () => {
1437
+ o?.(t), f(!1);
1438
+ };
1439
+ return s ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(ie, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ n(Y, { delayDuration: 300, children: [
1440
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5 p-3", children: [
1441
+ /* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: H ? H({ onClose: a }) : /* @__PURE__ */ n(Z, { children: [
1442
+ E && p && i && /* @__PURE__ */ e(ce, { onClick: de, label: r.edit, children: /* @__PURE__ */ e(jt, { className: "h-[18px] w-[18px]" }) }),
1443
+ E && w && d && /* @__PURE__ */ e(ce, { onClick: ue, label: r.cancel, children: /* @__PURE__ */ e(It, { className: "h-[18px] w-[18px]" }) }),
1444
+ N && o && /* @__PURE__ */ e(
1445
+ ce,
1446
+ {
1447
+ onClick: re,
1448
+ label: r.delete,
1449
+ variant: "destructive",
1450
+ children: /* @__PURE__ */ e(Re, { className: "h-[18px] w-[18px]" })
1451
+ }
1452
+ ),
1453
+ /* @__PURE__ */ e(ce, { onClick: a, label: r.close, children: /* @__PURE__ */ e(me, { className: "h-[18px] w-[18px]" }) })
1454
+ ] }) }),
1455
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
1456
+ /* @__PURE__ */ e(
1457
+ "div",
1458
+ {
1459
+ className: "w-4 h-4 rounded mt-1 shrink-0",
1460
+ style: { backgroundColor: ee }
1461
+ }
1462
+ ),
1463
+ /* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
1464
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2 flex-wrap", children: [
1465
+ /* @__PURE__ */ e(
1466
+ "h2",
1467
+ {
1468
+ className: u(
1469
+ "text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",
1470
+ t.isCanceled && "line-through opacity-60"
1471
+ ),
1472
+ children: t.title
1473
+ }
1474
+ ),
1475
+ t.meetingTookPlace && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 text-xs font-medium", children: [
1476
+ /* @__PURE__ */ e(Ht, { className: "h-3 w-3" }),
1477
+ r.completed
1478
+ ] }),
1479
+ t.isCanceled && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 text-xs font-medium", children: [
1480
+ /* @__PURE__ */ e(me, { className: "h-3 w-3" }),
1481
+ r.canceled
1482
+ ] })
1483
+ ] }),
1484
+ /* @__PURE__ */ n("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
1485
+ /* @__PURE__ */ e("span", { children: R() }),
1486
+ te() && /* @__PURE__ */ n(Z, { children: [
1487
+ /* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
1488
+ /* @__PURE__ */ e("span", { children: te() })
1489
+ ] })
1490
+ ] }),
1491
+ m && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
1492
+ ] })
1493
+ ] }) }),
1494
+ t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: A ? A(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
1495
+ /* @__PURE__ */ e("div", { className: "text-sm font-medium text-red-700 dark:text-red-400", children: r.cancellationNote }),
1496
+ t.cancelReason && /* @__PURE__ */ n("div", { className: "mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic", children: [
1497
+ '"',
1498
+ t.cancelReason,
1499
+ '"'
1500
+ ] }),
1501
+ t.canceledDate && /* @__PURE__ */ n("div", { className: "mt-1.5 text-xs text-red-500/70 dark:text-red-400/60", children: [
1502
+ r.canceledOn,
1503
+ " ",
1504
+ Yt(t.canceledDate)
1505
+ ] })
1506
+ ] }) }) }),
1507
+ /* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
1508
+ t.address && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
1509
+ /* @__PURE__ */ e(At, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
1510
+ /* @__PURE__ */ e("span", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: t.address })
1511
+ ] }),
1512
+ (y || x.length > 0) && /* @__PURE__ */ n("div", { className: "flex items-start gap-2 py-0", children: [
1513
+ /* @__PURE__ */ e(Wt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
1514
+ /* @__PURE__ */ n("div", { className: "flex-1", children: [
1515
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-0", children: [
1516
+ /* @__PURE__ */ n("span", { className: "text-sm text-zinc-900 dark:text-zinc-100 font-medium", children: [
1517
+ F,
1518
+ " ",
1519
+ F !== 1 ? r.guests : r.guest
1520
+ ] }),
1521
+ F > 0 && /* @__PURE__ */ n("span", { className: "text-xs text-zinc-500", children: [
1522
+ "(",
1523
+ I,
1524
+ " ",
1525
+ r.confirmed,
1526
+ ")"
1527
+ ] })
1528
+ ] }),
1529
+ /* @__PURE__ */ n("div", { className: "mt-2 space-y-2", children: [
1530
+ y ? l.slice(0, 6).map(
1531
+ ($, ne) => L ? L($, ne) : /* @__PURE__ */ e(
1532
+ Le,
1533
+ {
1534
+ participant: $,
1535
+ isEventCanceled: t.isCanceled,
1536
+ labels: r
1537
+ },
1538
+ $.id
1539
+ )
1540
+ ) : x.slice(0, 6).map(($, ne) => {
1541
+ const Ne = {
1542
+ id: String(ne),
1543
+ name: $,
1544
+ email: "",
1545
+ isConfirmed: t.isAccepted,
1546
+ isOrganizer: ne === 0,
1547
+ isClient: !1
1548
+ };
1549
+ return L ? L(Ne, ne) : /* @__PURE__ */ e(
1550
+ Le,
1551
+ {
1552
+ participant: Ne,
1553
+ isEventCanceled: t.isCanceled,
1554
+ labels: r
1555
+ },
1556
+ $
1557
+ );
1558
+ }),
1559
+ F > 6 && /* @__PURE__ */ n("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
1560
+ "+",
1561
+ F - 6,
1562
+ " ",
1563
+ r.more
1564
+ ] })
1565
+ ] })
1566
+ ] })
1567
+ ] }),
1568
+ t.description && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
1569
+ /* @__PURE__ */ e(Ft, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
1570
+ /* @__PURE__ */ e("p", { className: "text-sm text-zinc-700 dark:text-zinc-300 whitespace-pre-wrap", children: t.description })
1571
+ ] }),
1572
+ /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
1573
+ /* @__PURE__ */ e(Bt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
1574
+ /* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: y && l.find(($) => $.isOrganizer)?.name || x[0] || "Calendar" })
1575
+ ] })
1576
+ ] }),
1577
+ B && h && c && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1578
+ m ? /* @__PURE__ */ n(ot, { children: [
1579
+ /* @__PURE__ */ e(lt, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex", children: [
1580
+ /* @__PURE__ */ e(
1581
+ V,
1582
+ {
1583
+ size: "sm",
1584
+ variant: "outline",
1585
+ className: u(
1586
+ "rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
1587
+ S && "!bg-green-700 !text-white hover:!bg-green-700"
1588
+ ),
1589
+ onClick: ($) => {
1590
+ $.stopPropagation(), S || h(t);
1591
+ },
1592
+ disabled: C,
1593
+ children: C ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(Z, { children: [
1594
+ S && /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }),
1595
+ r.going
1596
+ ] })
1597
+ }
1598
+ ),
1599
+ /* @__PURE__ */ e(
1600
+ V,
1601
+ {
1602
+ size: "sm",
1603
+ variant: "outline",
1604
+ className: u(
1605
+ "rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
1606
+ S && "!bg-green-700 !text-white hover:!bg-green-700"
1607
+ ),
1608
+ children: /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" })
1609
+ }
1610
+ )
1611
+ ] }) }),
1612
+ /* @__PURE__ */ n(ct, { align: "start", children: [
1613
+ /* @__PURE__ */ n(
1614
+ Ce,
1615
+ {
1616
+ className: u(
1617
+ "gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
1618
+ S && "!bg-green-700 !text-white hover:!bg-green-700"
1619
+ ),
1620
+ onClick: () => h(t),
1621
+ children: [
1622
+ /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
1623
+ r.acceptThisEvent
1624
+ ]
1625
+ }
1626
+ ),
1627
+ /* @__PURE__ */ n(Ce, { onClick: () => h(t), children: [
1628
+ /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
1629
+ r.acceptAllEvents
1630
+ ] })
1631
+ ] })
1632
+ ] }) : /* @__PURE__ */ e(
1633
+ V,
1634
+ {
1635
+ size: "sm",
1636
+ variant: "outline",
1637
+ className: u(
1638
+ "gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
1639
+ S && "!bg-green-700 !text-white hover:!bg-green-700"
1640
+ ),
1641
+ onClick: () => {
1642
+ S || h(t);
1643
+ },
1644
+ disabled: C,
1645
+ children: C ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(Z, { children: [
1646
+ S && /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }),
1647
+ r.going
1648
+ ] })
1649
+ }
1650
+ ),
1651
+ /* @__PURE__ */ e(
1652
+ V,
1653
+ {
1654
+ size: "sm",
1655
+ variant: "outline",
1656
+ className: u(
1657
+ "gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
1658
+ T && "!bg-rose-700 !text-white hover:!bg-rose-700"
1659
+ ),
1660
+ onClick: () => {
1661
+ T || c(t);
1662
+ },
1663
+ disabled: v,
1664
+ children: v ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(Z, { children: [
1665
+ T && /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5" }),
1666
+ r.notGoing
1667
+ ] })
1668
+ }
1669
+ )
1670
+ ] }) }),
1671
+ b && S && !t.meetingTookPlace && !t.isCanceled && g && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ n(
1672
+ V,
1673
+ {
1674
+ size: "sm",
1675
+ variant: "outline",
1676
+ className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
1677
+ onClick: () => g(t),
1678
+ disabled: M,
1679
+ children: [
1680
+ M && /* @__PURE__ */ e(ie, { className: "h-4 w-4 mr-2" }),
1681
+ r.confirmMeeting
1682
+ ]
1683
+ }
1684
+ ) })
1685
+ ] }),
1686
+ W ? _ && W({
1687
+ onConfirm: X,
1688
+ onCancel: () => f(!1),
1689
+ isLoading: z
1690
+ }) : /* @__PURE__ */ e(
1691
+ Rt,
1692
+ {
1693
+ open: _,
1694
+ onOpenChange: f,
1695
+ title: r.deleteConfirmTitle,
1696
+ description: r.deleteConfirmDescription,
1697
+ cancelLabel: r.cancel,
1698
+ confirmLabel: r.delete,
1699
+ onConfirm: X,
1700
+ isLoading: z
1701
+ }
1702
+ )
1703
+ ] });
1704
+ }
1705
+ function Rr({
1706
+ event: t,
1707
+ children: r,
1708
+ open: s,
1709
+ onOpenChange: a,
1710
+ isLoading: i,
1711
+ labels: o,
1712
+ onEdit: d,
1713
+ onDelete: h,
1714
+ onCancel: c,
1715
+ onAccept: g,
1716
+ onDecline: p,
1717
+ onConfirmMeeting: N,
1718
+ canEdit: w = !0,
1719
+ canDelete: b = !1,
1720
+ canCancel: k = !0,
1721
+ isCurrentUserParticipant: D,
1722
+ isCurrentUserClient: C,
1723
+ currentUserAcceptStatus: v,
1724
+ isAcceptLoading: M,
1725
+ isDeclineLoading: z,
1726
+ isConfirmLoading: L,
1727
+ isDeleteLoading: H,
1728
+ renderParticipant: A,
1729
+ renderHeaderActions: W,
1730
+ renderCancelReason: P,
1731
+ renderDeleteConfirmation: O,
1732
+ formatDate: _,
1733
+ formatTimeRange: f,
1734
+ className: E,
1735
+ width: m = 360
1736
+ }) {
1737
+ const l = Gt("(min-width: 768px)"), x = { ...Pt, ...o }, y = se(() => {
1738
+ a?.(!1);
1739
+ }, [a]), S = {
1740
+ event: t,
1741
+ labels: x,
1742
+ isLoading: i,
1743
+ onClose: y,
1744
+ onEdit: d,
1745
+ onDelete: h,
1746
+ onCancel: c,
1747
+ onAccept: g,
1748
+ onDecline: p,
1749
+ onConfirmMeeting: N,
1750
+ canEdit: w,
1751
+ canDelete: b,
1752
+ canCancel: k,
1753
+ isCurrentUserParticipant: D,
1754
+ isCurrentUserClient: C,
1755
+ currentUserAcceptStatus: v,
1756
+ isAcceptLoading: M,
1757
+ isDeclineLoading: z,
1758
+ isConfirmLoading: L,
1759
+ isDeleteLoading: H,
1760
+ renderParticipant: A,
1761
+ renderHeaderActions: W,
1762
+ renderCancelReason: P,
1763
+ renderDeleteConfirmation: O,
1764
+ formatDate: _,
1765
+ formatTimeRange: f
1766
+ };
1767
+ return l ? /* @__PURE__ */ n(Pe, { open: s ?? !1, onOpenChange: a ?? (() => {
1768
+ }), children: [
1769
+ /* @__PURE__ */ e(Oe, { asChild: !0, children: r }),
1770
+ /* @__PURE__ */ e(
1771
+ _e,
1772
+ {
1773
+ className: u(
1774
+ "p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
1775
+ E
1776
+ ),
1777
+ style: { width: m },
1778
+ align: "center",
1779
+ side: "bottom",
1780
+ sideOffset: 4,
1781
+ children: /* @__PURE__ */ e(Te, { ...S })
1782
+ }
1783
+ )
1784
+ ] }) : /* @__PURE__ */ n(Z, { children: [
1785
+ r,
1786
+ /* @__PURE__ */ e(_t, { open: s ?? !1, onOpenChange: a ?? (() => {
1787
+ }), title: t.title, children: /* @__PURE__ */ e(Te, { ...S }) })
1788
+ ] });
1789
+ }
1790
+ function Kt({ className: t }) {
1791
+ return /* @__PURE__ */ n(
1792
+ "svg",
1793
+ {
1794
+ className: t,
1795
+ xmlns: "http://www.w3.org/2000/svg",
1796
+ width: "24",
1797
+ height: "24",
1798
+ viewBox: "0 0 24 24",
1799
+ fill: "none",
1800
+ stroke: "currentColor",
1801
+ strokeWidth: "2",
1802
+ strokeLinecap: "round",
1803
+ strokeLinejoin: "round",
1804
+ children: [
1805
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1806
+ /* @__PURE__ */ e("path", { d: "M12 16v-4" }),
1807
+ /* @__PURE__ */ e("path", { d: "M12 8h.01" })
1808
+ ]
1809
+ }
1810
+ );
1811
+ }
1812
+ function Jt({ className: t }) {
1813
+ return /* @__PURE__ */ n(
1814
+ "svg",
1815
+ {
1816
+ className: t,
1817
+ xmlns: "http://www.w3.org/2000/svg",
1818
+ width: "24",
1819
+ height: "24",
1820
+ viewBox: "0 0 24 24",
1821
+ fill: "none",
1822
+ stroke: "currentColor",
1823
+ strokeWidth: "2",
1824
+ strokeLinecap: "round",
1825
+ strokeLinejoin: "round",
1826
+ children: [
1827
+ /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
1828
+ /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
1829
+ ]
1830
+ }
1831
+ );
1832
+ }
1833
+ const Qt = [
1834
+ { value: 15, label: "15 minutes" },
1835
+ { value: 30, label: "30 minutes" },
1836
+ { value: 60, label: "1 hour" }
1837
+ ];
1838
+ function Vr({
1839
+ value: t,
1840
+ onChange: r,
1841
+ isLocked: s = !1,
1842
+ className: a,
1843
+ labels: i = {}
1844
+ }) {
1845
+ const o = {
1846
+ title: "Slot duration",
1847
+ lockedMessage: "This setting is locked by the administrator",
1848
+ infoMessage: "Set the time slot duration for day and week calendar views.",
1849
+ ...i
1850
+ }, d = (h) => {
1851
+ s || r(Number(h.target.value));
1852
+ };
1853
+ return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", a), children: [
1854
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1855
+ /* @__PURE__ */ e(U, { className: "text-sm font-semibold", children: o.title }),
1856
+ s ? /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
1857
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(Jt, { className: "size-3 text-muted-foreground" }) }),
1858
+ /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e("p", { children: o.lockedMessage }) })
1859
+ ] }) }) : /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
1860
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(Kt, { className: "size-3 text-muted-foreground" }) }),
1861
+ /* @__PURE__ */ e(J, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: o.infoMessage }) })
1862
+ ] }) })
1863
+ ] }),
1864
+ /* @__PURE__ */ e(
1865
+ Q,
1866
+ {
1867
+ value: t.toString(),
1868
+ onChange: d,
1869
+ disabled: s,
1870
+ className: "h-9 w-[128px] text-sm",
1871
+ children: Qt.map((h) => /* @__PURE__ */ e("option", { value: h.value.toString(), children: h.label }, h.value))
1872
+ }
1873
+ )
1874
+ ] });
1875
+ }
1876
+ function Xt({ className: t }) {
1877
+ return /* @__PURE__ */ n(
1878
+ "svg",
1879
+ {
1880
+ className: t,
1881
+ xmlns: "http://www.w3.org/2000/svg",
1882
+ width: "24",
1883
+ height: "24",
1884
+ viewBox: "0 0 24 24",
1885
+ fill: "none",
1886
+ stroke: "currentColor",
1887
+ strokeWidth: "2",
1888
+ strokeLinecap: "round",
1889
+ strokeLinejoin: "round",
1890
+ children: [
1891
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1892
+ /* @__PURE__ */ e("path", { d: "M12 16v-4" }),
1893
+ /* @__PURE__ */ e("path", { d: "M12 8h.01" })
1894
+ ]
1895
+ }
1896
+ );
1897
+ }
1898
+ function Zt({ className: t }) {
1899
+ return /* @__PURE__ */ n(
1900
+ "svg",
1901
+ {
1902
+ className: t,
1903
+ xmlns: "http://www.w3.org/2000/svg",
1904
+ width: "24",
1905
+ height: "24",
1906
+ viewBox: "0 0 24 24",
1907
+ fill: "none",
1908
+ stroke: "currentColor",
1909
+ strokeWidth: "2",
1910
+ strokeLinecap: "round",
1911
+ strokeLinejoin: "round",
1912
+ children: [
1913
+ /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
1914
+ /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
1915
+ ]
1916
+ }
1917
+ );
1918
+ }
1919
+ function qt() {
1920
+ return Array.from({ length: 25 }, (t, r) => ({
1921
+ value: r,
1922
+ label: `${String(r).padStart(2, "0")}:00`
1923
+ }));
1924
+ }
1925
+ function Ur({
1926
+ value: t,
1927
+ onChange: r,
1928
+ isLocked: s = !1,
1929
+ className: a,
1930
+ labels: i = {}
1931
+ }) {
1932
+ const o = {
1933
+ title: "Visible hours",
1934
+ from: "From",
1935
+ to: "To",
1936
+ lockedMessage: "This setting is locked by the administrator",
1937
+ infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
1938
+ ...i
1939
+ }, d = qt(), h = (g) => {
1940
+ if (s) return;
1941
+ const p = Number(g.target.value);
1942
+ p < t.endHour && r({ ...t, startHour: p });
1943
+ }, c = (g) => {
1944
+ if (s) return;
1945
+ const p = Number(g.target.value);
1946
+ p > t.startHour && r({ ...t, endHour: p });
1947
+ };
1948
+ return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", a), children: [
1949
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1950
+ /* @__PURE__ */ e(U, { className: "text-sm font-semibold", children: o.title }),
1951
+ s ? /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
1952
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(Zt, { className: "size-3 text-muted-foreground" }) }),
1953
+ /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e("p", { children: o.lockedMessage }) })
1954
+ ] }) }) : /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
1955
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(Xt, { className: "size-3 text-muted-foreground" }) }),
1956
+ /* @__PURE__ */ e(J, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: o.infoMessage }) })
1957
+ ] }) })
1958
+ ] }),
1959
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1960
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
1961
+ /* @__PURE__ */ e(U, { className: "text-xs text-muted-foreground", children: o.from }),
1962
+ /* @__PURE__ */ e(
1963
+ Q,
1964
+ {
1965
+ value: t.startHour.toString(),
1966
+ onChange: h,
1967
+ disabled: s,
1968
+ className: "h-9 w-[88px] text-sm",
1969
+ children: d.map((g) => /* @__PURE__ */ e(
1970
+ "option",
1971
+ {
1972
+ value: g.value.toString(),
1973
+ disabled: g.value >= t.endHour,
1974
+ children: g.label
1975
+ },
1976
+ g.value
1977
+ ))
1978
+ }
1979
+ )
1980
+ ] }),
1981
+ /* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
1982
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
1983
+ /* @__PURE__ */ e(U, { className: "text-xs text-muted-foreground", children: o.to }),
1984
+ /* @__PURE__ */ e(
1985
+ Q,
1986
+ {
1987
+ value: t.endHour.toString(),
1988
+ onChange: c,
1989
+ disabled: s,
1990
+ className: "h-9 w-[88px] text-sm",
1991
+ children: d.map((g) => /* @__PURE__ */ e(
1992
+ "option",
1993
+ {
1994
+ value: g.value.toString(),
1995
+ disabled: g.value <= t.startHour,
1996
+ children: g.label
1997
+ },
1998
+ g.value
1999
+ ))
2000
+ }
2001
+ )
2002
+ ] })
2003
+ ] })
2004
+ ] });
2005
+ }
2006
+ function er({ className: t }) {
2007
+ return /* @__PURE__ */ n(
2008
+ "svg",
2009
+ {
2010
+ className: t,
2011
+ xmlns: "http://www.w3.org/2000/svg",
2012
+ width: "24",
2013
+ height: "24",
2014
+ viewBox: "0 0 24 24",
2015
+ fill: "none",
2016
+ stroke: "currentColor",
2017
+ strokeWidth: "2",
2018
+ strokeLinecap: "round",
2019
+ strokeLinejoin: "round",
2020
+ children: [
2021
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
2022
+ /* @__PURE__ */ e("path", { d: "M12 16v-4" }),
2023
+ /* @__PURE__ */ e("path", { d: "M12 8h.01" })
2024
+ ]
2025
+ }
2026
+ );
2027
+ }
2028
+ function tr({ className: t }) {
2029
+ return /* @__PURE__ */ n(
2030
+ "svg",
2031
+ {
2032
+ className: t,
2033
+ xmlns: "http://www.w3.org/2000/svg",
2034
+ width: "24",
2035
+ height: "24",
2036
+ viewBox: "0 0 24 24",
2037
+ fill: "none",
2038
+ stroke: "currentColor",
2039
+ strokeWidth: "2",
2040
+ strokeLinecap: "round",
2041
+ strokeLinejoin: "round",
2042
+ children: [
2043
+ /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
2044
+ /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2045
+ ]
2046
+ }
2047
+ );
2048
+ }
2049
+ const rr = [
2050
+ { value: "dot", label: "Dot indicator" },
2051
+ { value: "colored", label: "Full color" },
2052
+ { value: "mixed", label: "Mixed" }
2053
+ ];
2054
+ function Yr({
2055
+ value: t,
2056
+ onChange: r,
2057
+ isLocked: s = !1,
2058
+ className: a,
2059
+ labels: i = {}
2060
+ }) {
2061
+ const o = {
2062
+ title: "Event display",
2063
+ lockedMessage: "This setting is locked by the administrator",
2064
+ infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
2065
+ options: {
2066
+ dot: "Dot indicator",
2067
+ colored: "Full color",
2068
+ mixed: "Mixed"
2069
+ },
2070
+ ...i
2071
+ }, d = (c) => o.options?.[c] ?? c, h = (c) => {
2072
+ s || r(c.target.value);
2073
+ };
2074
+ return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", a), children: [
2075
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2076
+ /* @__PURE__ */ e(U, { className: "text-sm font-semibold", children: o.title }),
2077
+ s ? /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
2078
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(tr, { className: "size-3 text-muted-foreground" }) }),
2079
+ /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e("p", { children: o.lockedMessage }) })
2080
+ ] }) }) : /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
2081
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(er, { className: "size-3 text-muted-foreground" }) }),
2082
+ /* @__PURE__ */ e(J, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: o.infoMessage }) })
2083
+ ] }) })
2084
+ ] }),
2085
+ /* @__PURE__ */ e(
2086
+ Q,
2087
+ {
2088
+ value: t,
2089
+ onChange: h,
2090
+ disabled: s,
2091
+ className: "h-9 w-[128px] text-sm",
2092
+ children: rr.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: d(c.value) }, c.value))
2093
+ }
2094
+ )
2095
+ ] });
2096
+ }
2097
+ function nr({ className: t }) {
2098
+ return /* @__PURE__ */ n(
2099
+ "svg",
2100
+ {
2101
+ className: t,
2102
+ xmlns: "http://www.w3.org/2000/svg",
2103
+ width: "24",
2104
+ height: "24",
2105
+ viewBox: "0 0 24 24",
2106
+ fill: "none",
2107
+ stroke: "currentColor",
2108
+ strokeWidth: "2",
2109
+ strokeLinecap: "round",
2110
+ strokeLinejoin: "round",
2111
+ children: [
2112
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
2113
+ /* @__PURE__ */ e("path", { d: "M12 16v-4" }),
2114
+ /* @__PURE__ */ e("path", { d: "M12 8h.01" })
2115
+ ]
2116
+ }
2117
+ );
2118
+ }
2119
+ function sr({ className: t }) {
2120
+ return /* @__PURE__ */ n(
2121
+ "svg",
2122
+ {
2123
+ className: t,
2124
+ xmlns: "http://www.w3.org/2000/svg",
2125
+ width: "24",
2126
+ height: "24",
2127
+ viewBox: "0 0 24 24",
2128
+ fill: "none",
2129
+ stroke: "currentColor",
2130
+ strokeWidth: "2",
2131
+ strokeLinecap: "round",
2132
+ strokeLinejoin: "round",
2133
+ children: [
2134
+ /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
2135
+ /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2136
+ ]
2137
+ }
2138
+ );
2139
+ }
2140
+ function ar({ className: t }) {
2141
+ return /* @__PURE__ */ e(
2142
+ "svg",
2143
+ {
2144
+ className: t,
2145
+ xmlns: "http://www.w3.org/2000/svg",
2146
+ width: "24",
2147
+ height: "24",
2148
+ viewBox: "0 0 24 24",
2149
+ fill: "none",
2150
+ stroke: "currentColor",
2151
+ strokeWidth: "2",
2152
+ strokeLinecap: "round",
2153
+ strokeLinejoin: "round",
2154
+ children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" })
2155
+ }
2156
+ );
2157
+ }
2158
+ const ir = [
2159
+ "monday",
2160
+ "tuesday",
2161
+ "wednesday",
2162
+ "thursday",
2163
+ "friday",
2164
+ "saturday",
2165
+ "sunday"
2166
+ ];
2167
+ function or() {
2168
+ return Array.from({ length: 25 }, (t, r) => ({
2169
+ value: r,
2170
+ label: `${String(r).padStart(2, "0")}:00`
2171
+ }));
2172
+ }
2173
+ const je = {
2174
+ sunday: "Sun",
2175
+ monday: "Mon",
2176
+ tuesday: "Tue",
2177
+ wednesday: "Wed",
2178
+ thursday: "Thu",
2179
+ friday: "Fri",
2180
+ saturday: "Sat"
2181
+ };
2182
+ function lr({
2183
+ dayLabel: t,
2184
+ config: r,
2185
+ onChange: s,
2186
+ disabled: a,
2187
+ hourOptions: i
2188
+ }) {
2189
+ const o = () => {
2190
+ a || s({ ...r, enabled: !r.enabled });
2191
+ }, d = (c) => {
2192
+ if (a) return;
2193
+ const g = Number(c.target.value);
2194
+ g < r.to && s({ ...r, from: g });
2195
+ }, h = (c) => {
2196
+ if (a) return;
2197
+ const g = Number(c.target.value);
2198
+ g > r.from && s({ ...r, to: g });
2199
+ };
2200
+ return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2201
+ /* @__PURE__ */ e(
2202
+ "button",
2203
+ {
2204
+ type: "button",
2205
+ role: "checkbox",
2206
+ "aria-checked": r.enabled,
2207
+ "aria-label": `Enable ${t}`,
2208
+ onClick: o,
2209
+ disabled: a,
2210
+ className: u(
2211
+ "flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
2212
+ r.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
2213
+ a && "cursor-not-allowed opacity-50"
2214
+ ),
2215
+ children: r.enabled && /* @__PURE__ */ e(ar, { className: "size-3" })
2216
+ }
2217
+ ),
2218
+ /* @__PURE__ */ e(
2219
+ "span",
2220
+ {
2221
+ className: u(
2222
+ "w-10 text-sm",
2223
+ !r.enabled && "text-muted-foreground"
2224
+ ),
2225
+ children: t
2226
+ }
2227
+ ),
2228
+ /* @__PURE__ */ e(
2229
+ Q,
2230
+ {
2231
+ value: r.from.toString(),
2232
+ onChange: d,
2233
+ disabled: a || !r.enabled,
2234
+ className: "h-8 w-[76px] text-xs",
2235
+ children: i.map((c) => /* @__PURE__ */ e(
2236
+ "option",
2237
+ {
2238
+ value: c.value.toString(),
2239
+ disabled: c.value >= r.to,
2240
+ children: c.label
2241
+ },
2242
+ c.value
2243
+ ))
2244
+ }
2245
+ ),
2246
+ /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
2247
+ /* @__PURE__ */ e(
2248
+ Q,
2249
+ {
2250
+ value: r.to.toString(),
2251
+ onChange: h,
2252
+ disabled: a || !r.enabled,
2253
+ className: "h-8 w-[76px] text-xs",
2254
+ children: i.map((c) => /* @__PURE__ */ e(
2255
+ "option",
2256
+ {
2257
+ value: c.value.toString(),
2258
+ disabled: c.value <= r.from,
2259
+ children: c.label
2260
+ },
2261
+ c.value
2262
+ ))
2263
+ }
2264
+ )
2265
+ ] });
2266
+ }
2267
+ function Gr({
2268
+ value: t,
2269
+ onChange: r,
2270
+ isLocked: s = !1,
2271
+ className: a,
2272
+ labels: i = {}
2273
+ }) {
2274
+ const o = {
2275
+ title: "Working hours",
2276
+ lockedMessage: "This setting is locked by the administrator",
2277
+ infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
2278
+ days: je,
2279
+ ...i
2280
+ }, d = or(), h = (c, g) => {
2281
+ s || r({ ...t, [c]: g });
2282
+ };
2283
+ return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", a), children: [
2284
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2285
+ /* @__PURE__ */ e(U, { className: "text-sm font-semibold", children: o.title }),
2286
+ s ? /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
2287
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(sr, { className: "size-3 text-muted-foreground" }) }),
2288
+ /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e("p", { children: o.lockedMessage }) })
2289
+ ] }) }) : /* @__PURE__ */ e(Y, { delayDuration: 100, children: /* @__PURE__ */ n(G, { children: [
2290
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(nr, { className: "size-3 text-muted-foreground" }) }),
2291
+ /* @__PURE__ */ e(J, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: o.infoMessage }) })
2292
+ ] }) })
2293
+ ] }),
2294
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: ir.map((c) => /* @__PURE__ */ e(
2295
+ lr,
2296
+ {
2297
+ dayLabel: o.days?.[c] ?? je[c],
2298
+ config: t[c],
2299
+ onChange: (g) => h(c, g),
2300
+ disabled: s,
2301
+ hourOptions: d
2302
+ },
2303
+ c
2304
+ )) })
2305
+ ] });
2306
+ }
2307
+ const Kr = {
2308
+ sunday: { enabled: !1, from: 8, to: 18 },
2309
+ monday: { enabled: !0, from: 8, to: 18 },
2310
+ tuesday: { enabled: !0, from: 8, to: 18 },
2311
+ wednesday: { enabled: !0, from: 8, to: 18 },
2312
+ thursday: { enabled: !0, from: 8, to: 18 },
2313
+ friday: { enabled: !0, from: 8, to: 18 },
2314
+ saturday: { enabled: !1, from: 8, to: 18 }
2315
+ };
2316
+ function cr({ className: t }) {
2317
+ return /* @__PURE__ */ n(
2318
+ "svg",
2319
+ {
2320
+ className: t,
2321
+ xmlns: "http://www.w3.org/2000/svg",
2322
+ width: "24",
2323
+ height: "24",
2324
+ viewBox: "0 0 24 24",
2325
+ fill: "none",
2326
+ stroke: "currentColor",
2327
+ strokeWidth: "2",
2328
+ strokeLinecap: "round",
2329
+ strokeLinejoin: "round",
2330
+ children: [
2331
+ /* @__PURE__ */ e("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
2332
+ /* @__PURE__ */ e("circle", { cx: "9", cy: "7", r: "4" }),
2333
+ /* @__PURE__ */ e("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
2334
+ /* @__PURE__ */ e("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
2335
+ ]
2336
+ }
2337
+ );
2338
+ }
2339
+ function Jr({
2340
+ users: t,
2341
+ value: r,
2342
+ onChange: s,
2343
+ allLabel: a = "All users",
2344
+ className: i,
2345
+ label: o
2346
+ }) {
2347
+ const d = (h) => {
2348
+ s(h.target.value);
2349
+ };
2350
+ return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-1", i), children: [
2351
+ o && /* @__PURE__ */ e(U, { className: "text-xs text-muted-foreground", children: o }),
2352
+ /* @__PURE__ */ n("div", { className: "relative", children: [
2353
+ /* @__PURE__ */ e(cr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
2354
+ /* @__PURE__ */ n(
2355
+ Q,
2356
+ {
2357
+ value: r,
2358
+ onChange: d,
2359
+ className: "h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",
2360
+ children: [
2361
+ /* @__PURE__ */ e("option", { value: "all", children: a }),
2362
+ t.map((h) => /* @__PURE__ */ e("option", { value: h.id, children: h.name }, h.id))
2363
+ ]
2364
+ }
2365
+ )
2366
+ ] })
2367
+ ] });
2368
+ }
2369
+ function dr({ className: t }) {
2370
+ return /* @__PURE__ */ n(
2371
+ "svg",
2372
+ {
2373
+ className: t,
2374
+ xmlns: "http://www.w3.org/2000/svg",
2375
+ width: "24",
2376
+ height: "24",
2377
+ viewBox: "0 0 24 24",
2378
+ fill: "none",
2379
+ stroke: "currentColor",
2380
+ strokeWidth: "2",
2381
+ strokeLinecap: "round",
2382
+ strokeLinejoin: "round",
2383
+ children: [
2384
+ /* @__PURE__ */ e("path", { d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z" }),
2385
+ /* @__PURE__ */ e("circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor" })
2386
+ ]
2387
+ }
2388
+ );
2389
+ }
2390
+ function Qr({
2391
+ scheduleTypes: t,
2392
+ value: r,
2393
+ onChange: s,
2394
+ allLabel: a = "All types",
2395
+ className: i,
2396
+ label: o
2397
+ }) {
2398
+ const d = (c) => {
2399
+ s(c.target.value);
2400
+ }, h = t.find(
2401
+ (c) => String(c.id) === r
2402
+ );
2403
+ return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-1", i), children: [
2404
+ o && /* @__PURE__ */ e(U, { className: "text-xs text-muted-foreground", children: o }),
2405
+ /* @__PURE__ */ n("div", { className: "relative", children: [
2406
+ h ? /* @__PURE__ */ e(
2407
+ "span",
2408
+ {
2409
+ className: "pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",
2410
+ style: { backgroundColor: h.color }
2411
+ }
2412
+ ) : /* @__PURE__ */ e(dr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
2413
+ /* @__PURE__ */ n(
2414
+ Q,
2415
+ {
2416
+ value: r,
2417
+ onChange: d,
2418
+ className: "h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",
2419
+ children: [
2420
+ /* @__PURE__ */ e("option", { value: "all", children: a }),
2421
+ t.map((c) => /* @__PURE__ */ e("option", { value: String(c.id), children: c.label }, c.id))
2422
+ ]
2423
+ }
2424
+ )
2425
+ ] })
2426
+ ] });
2427
+ }
2428
+ function pe({ className: t }) {
2429
+ return /* @__PURE__ */ e(
2430
+ "svg",
2431
+ {
2432
+ className: t,
2433
+ xmlns: "http://www.w3.org/2000/svg",
2434
+ viewBox: "0 0 24 24",
2435
+ fill: "none",
2436
+ stroke: "currentColor",
2437
+ strokeWidth: "3",
2438
+ strokeLinecap: "round",
2439
+ strokeLinejoin: "round",
2440
+ children: /* @__PURE__ */ e("polyline", { points: "20 6 9 17 4 12" })
2441
+ }
2442
+ );
2443
+ }
2444
+ function ur({ className: t }) {
2445
+ return /* @__PURE__ */ n(
2446
+ "svg",
2447
+ {
2448
+ className: t,
2449
+ xmlns: "http://www.w3.org/2000/svg",
2450
+ viewBox: "0 0 24 24",
2451
+ fill: "none",
2452
+ stroke: "currentColor",
2453
+ strokeWidth: "2",
2454
+ strokeLinecap: "round",
2455
+ strokeLinejoin: "round",
2456
+ children: [
2457
+ /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "8" }),
2458
+ /* @__PURE__ */ e("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
2459
+ ]
2460
+ }
2461
+ );
2462
+ }
2463
+ function hr({ className: t }) {
2464
+ return /* @__PURE__ */ n(
2465
+ "svg",
2466
+ {
2467
+ className: t,
2468
+ xmlns: "http://www.w3.org/2000/svg",
2469
+ viewBox: "0 0 24 24",
2470
+ fill: "none",
2471
+ stroke: "currentColor",
2472
+ strokeWidth: "2",
2473
+ strokeLinecap: "round",
2474
+ strokeLinejoin: "round",
2475
+ children: [
2476
+ /* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2477
+ /* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2478
+ ]
2479
+ }
2480
+ );
2481
+ }
2482
+ function ve({ checked: t, onCheckedChange: r, className: s, children: a }) {
2483
+ return /* @__PURE__ */ e(
2484
+ "button",
2485
+ {
2486
+ type: "button",
2487
+ role: "checkbox",
2488
+ "aria-checked": t,
2489
+ onClick: () => r(!t),
2490
+ className: s,
2491
+ children: a
2492
+ }
2493
+ );
2494
+ }
2495
+ function mr({ src: t, alt: r, fallback: s, className: a }) {
2496
+ const [i, o] = ae(!1);
2497
+ return !t || i ? /* @__PURE__ */ e(
2498
+ "div",
2499
+ {
2500
+ className: u(
2501
+ "flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
2502
+ a
2503
+ ),
2504
+ children: s || "?"
2505
+ }
2506
+ ) : /* @__PURE__ */ e(
2507
+ "img",
2508
+ {
2509
+ src: t,
2510
+ alt: r || "",
2511
+ className: u("object-cover", a),
2512
+ onError: () => o(!0)
2513
+ }
2514
+ );
2515
+ }
2516
+ function Ie({ value: t, onChange: r, placeholder: s, className: a }) {
2517
+ return /* @__PURE__ */ n("div", { className: u("relative", a), children: [
2518
+ /* @__PURE__ */ e(ur, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
2519
+ /* @__PURE__ */ e(
2520
+ "input",
2521
+ {
2522
+ type: "text",
2523
+ value: t,
2524
+ onChange: (i) => r(i.target.value),
2525
+ placeholder: s,
2526
+ className: "h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
2527
+ }
2528
+ )
2529
+ ] });
2530
+ }
2531
+ function He(t, r, s, a = 0.3) {
2532
+ if (!r.trim()) return t;
2533
+ const i = r.toLowerCase();
2534
+ return t.filter((o) => s(o).some((h) => h ? h.toLowerCase().includes(i) : !1));
2535
+ }
2536
+ const fr = {
2537
+ title: "Filters",
2538
+ subtitle: "Filter calendar events",
2539
+ scheduleTypes: "Event Types",
2540
+ participants: "Participants",
2541
+ clearAll: "Clear all",
2542
+ selectAll: "Select all",
2543
+ unselectAll: "Unselect all",
2544
+ searchScheduleTypes: "Search event types...",
2545
+ searchParticipants: "Search participants...",
2546
+ noScheduleTypes: "No event types found",
2547
+ noParticipants: "No participants found"
2548
+ };
2549
+ function Xr({
2550
+ scheduleTypes: t,
2551
+ users: r,
2552
+ selectedScheduleTypeIds: s,
2553
+ onScheduleTypeChange: a,
2554
+ selectedUserIds: i,
2555
+ onUserChange: o,
2556
+ onClearAll: d,
2557
+ className: h,
2558
+ scheduleTypesLoading: c = !1,
2559
+ usersLoading: g = !1,
2560
+ labels: p,
2561
+ getScheduleTypeName: N
2562
+ }) {
2563
+ const w = { ...fr, ...p }, [b, k] = ae(""), [D, C] = ae(""), v = j(() => b.trim() ? He(t, b, (m) => [
2564
+ m.name,
2565
+ N?.(m) || m.name
2566
+ ]) : t, [t, b, N]), M = j(() => D.trim() ? He(r, D, (m) => [
2567
+ m.name,
2568
+ m.email || ""
2569
+ ]) : r, [r, D]), z = v.length > 0 && v.every((m) => s.includes(m.id)), L = M.length > 0 && M.every((m) => i.includes(m.id)), H = s.length + i.length, A = (m, l) => {
2570
+ const x = l ? [...s, m] : s.filter((y) => y !== m);
2571
+ a(x);
2572
+ }, W = () => {
2573
+ if (z) {
2574
+ const m = new Set(v.map((l) => l.id));
2575
+ a(s.filter((l) => !m.has(l)));
2576
+ } else {
2577
+ const m = /* @__PURE__ */ new Set([
2578
+ ...s,
2579
+ ...v.map((l) => l.id)
2580
+ ]);
2581
+ a(Array.from(m));
2582
+ }
2583
+ }, P = (m, l) => {
2584
+ const x = l ? [...i, m] : i.filter((y) => y !== m);
2585
+ o(x);
2586
+ }, O = () => {
2587
+ if (L) {
2588
+ const m = new Set(M.map((l) => l.id));
2589
+ o(i.filter((l) => !m.has(l)));
2590
+ } else {
2591
+ const m = /* @__PURE__ */ new Set([
2592
+ ...i,
2593
+ ...M.map((l) => l.id)
2594
+ ]);
2595
+ o(Array.from(m));
2596
+ }
2597
+ }, _ = () => {
2598
+ a([]), o([]), d?.();
2599
+ }, f = (m) => N ? N(m) : m.name, E = (m) => m.colorHex || m.color || "#069AD7";
2600
+ return /* @__PURE__ */ n(
2601
+ "div",
2602
+ {
2603
+ className: u(
2604
+ "flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
2605
+ h
2606
+ ),
2607
+ children: [
2608
+ /* @__PURE__ */ n("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
2609
+ /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
2610
+ /* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: w.title }),
2611
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: w.subtitle })
2612
+ ] }),
2613
+ H > 0 && /* @__PURE__ */ n(
2614
+ "button",
2615
+ {
2616
+ type: "button",
2617
+ onClick: _,
2618
+ className: "flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",
2619
+ children: [
2620
+ /* @__PURE__ */ e(hr, { className: "h-3.5 w-3.5" }),
2621
+ w.clearAll
2622
+ ]
2623
+ }
2624
+ )
2625
+ ] }),
2626
+ /* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
2627
+ /* @__PURE__ */ n("section", { className: "flex flex-col", children: [
2628
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
2629
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: w.scheduleTypes }),
2630
+ /* @__PURE__ */ e(
2631
+ "button",
2632
+ {
2633
+ type: "button",
2634
+ onClick: W,
2635
+ className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
2636
+ children: z ? w.unselectAll : w.selectAll
2637
+ }
2638
+ )
2639
+ ] }),
2640
+ t.length > 6 && /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
2641
+ Ie,
2642
+ {
2643
+ value: b,
2644
+ onChange: k,
2645
+ placeholder: w.searchScheduleTypes
2646
+ }
2647
+ ) }),
2648
+ /* @__PURE__ */ n("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
2649
+ c ? (
2650
+ // Loading skeletons
2651
+ Array.from({ length: 4 }).map((m, l) => /* @__PURE__ */ n(
2652
+ "div",
2653
+ {
2654
+ className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
2655
+ children: [
2656
+ /* @__PURE__ */ e("div", { className: "h-5 w-5 rounded bg-muted-foreground/20" }),
2657
+ /* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" })
2658
+ ]
2659
+ },
2660
+ `skeleton-${l}`
2661
+ ))
2662
+ ) : v.map((m) => {
2663
+ const l = s.includes(m.id), x = E(m);
2664
+ return /* @__PURE__ */ n(
2665
+ ve,
2666
+ {
2667
+ checked: l,
2668
+ onCheckedChange: (y) => A(m.id, y),
2669
+ className: u(
2670
+ "relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",
2671
+ l && "border-primary bg-primary/5"
2672
+ ),
2673
+ children: [
2674
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2675
+ /* @__PURE__ */ e(
2676
+ "span",
2677
+ {
2678
+ className: u(
2679
+ "flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
2680
+ l && "border-primary bg-primary text-primary-foreground"
2681
+ ),
2682
+ children: l && /* @__PURE__ */ e(pe, { className: "h-3 w-3" })
2683
+ }
2684
+ ),
2685
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: f(m) })
2686
+ ] }),
2687
+ /* @__PURE__ */ e(
2688
+ "div",
2689
+ {
2690
+ className: "h-4 w-4 rounded-full border",
2691
+ style: {
2692
+ backgroundColor: x,
2693
+ borderColor: x
2694
+ }
2695
+ }
2696
+ )
2697
+ ]
2698
+ },
2699
+ m.id
2700
+ );
2701
+ }),
2702
+ !c && v.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: w.noScheduleTypes })
2703
+ ] })
2704
+ ] }),
2705
+ /* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
2706
+ /* @__PURE__ */ n("section", { className: "flex flex-col", children: [
2707
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
2708
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: w.participants }),
2709
+ /* @__PURE__ */ e(
2710
+ ve,
2711
+ {
2712
+ checked: L,
2713
+ onCheckedChange: () => O(),
2714
+ className: u(
2715
+ "flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
2716
+ L && "border-primary bg-primary text-primary-foreground"
2717
+ ),
2718
+ children: L && /* @__PURE__ */ e(pe, { className: "h-3.5 w-3.5" })
2719
+ }
2720
+ )
2721
+ ] }),
2722
+ /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
2723
+ Ie,
2724
+ {
2725
+ value: D,
2726
+ onChange: C,
2727
+ placeholder: w.searchParticipants
2728
+ }
2729
+ ) }),
2730
+ /* @__PURE__ */ n("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
2731
+ g ? (
2732
+ // Loading skeletons
2733
+ Array.from({ length: 4 }).map((m, l) => /* @__PURE__ */ n(
2734
+ "div",
2735
+ {
2736
+ className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
2737
+ children: [
2738
+ /* @__PURE__ */ e("div", { className: "h-5 w-5 rounded bg-muted-foreground/20" }),
2739
+ /* @__PURE__ */ e("div", { className: "h-10 w-10 rounded-full bg-muted-foreground/20" }),
2740
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
2741
+ /* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" }),
2742
+ /* @__PURE__ */ e("div", { className: "h-2 w-32 rounded bg-muted-foreground/10" })
2743
+ ] })
2744
+ ]
2745
+ },
2746
+ `p-skeleton-${l}`
2747
+ ))
2748
+ ) : M.map((m) => {
2749
+ const l = i.includes(m.id);
2750
+ return /* @__PURE__ */ n(
2751
+ ve,
2752
+ {
2753
+ checked: l,
2754
+ onCheckedChange: (x) => P(m.id, x),
2755
+ className: u(
2756
+ "relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",
2757
+ l && "border-primary bg-zinc-50"
2758
+ ),
2759
+ children: [
2760
+ /* @__PURE__ */ e(
2761
+ "span",
2762
+ {
2763
+ className: u(
2764
+ "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
2765
+ l && "border-primary bg-primary text-primary-foreground"
2766
+ ),
2767
+ children: l && /* @__PURE__ */ e(pe, { className: "h-2.5 w-2.5" })
2768
+ }
2769
+ ),
2770
+ /* @__PURE__ */ n("div", { className: "flex flex-1 items-start gap-2", children: [
2771
+ /* @__PURE__ */ e(
2772
+ mr,
2773
+ {
2774
+ src: m.avatar ?? null,
2775
+ alt: m.name,
2776
+ fallback: m.name?.[0]?.toUpperCase() ?? "?",
2777
+ className: "h-10 w-10 rounded-lg"
2778
+ }
2779
+ ),
2780
+ /* @__PURE__ */ n("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
2781
+ /* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: m.name }),
2782
+ /* @__PURE__ */ e(
2783
+ "span",
2784
+ {
2785
+ className: "truncate text-[11px] text-muted-foreground",
2786
+ title: m.email,
2787
+ children: m.email
2788
+ }
2789
+ )
2790
+ ] })
2791
+ ] })
2792
+ ]
2793
+ },
2794
+ m.id
2795
+ );
2796
+ }),
2797
+ !g && M.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: w.noParticipants })
2798
+ ] })
2799
+ ] })
2800
+ ]
2801
+ }
2802
+ );
2803
+ }
2804
+ function gr({ className: t }) {
2805
+ return /* @__PURE__ */ n(
2806
+ "svg",
2807
+ {
2808
+ xmlns: "http://www.w3.org/2000/svg",
2809
+ width: "24",
2810
+ height: "24",
2811
+ viewBox: "0 0 24 24",
2812
+ fill: "none",
2813
+ stroke: "currentColor",
2814
+ strokeWidth: "2",
2815
+ strokeLinecap: "round",
2816
+ strokeLinejoin: "round",
2817
+ className: t,
2818
+ children: [
2819
+ /* @__PURE__ */ e("path", { d: "M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5" }),
2820
+ /* @__PURE__ */ e("path", { d: "M16 2v4" }),
2821
+ /* @__PURE__ */ e("path", { d: "M8 2v4" }),
2822
+ /* @__PURE__ */ e("path", { d: "M3 10h5" }),
2823
+ /* @__PURE__ */ e("path", { d: "M17.5 17.5 16 16.25V14" }),
2824
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "6" })
2825
+ ]
2826
+ }
2827
+ );
2828
+ }
2829
+ function Ve({ className: t }) {
2830
+ return /* @__PURE__ */ e(
2831
+ "svg",
2832
+ {
2833
+ xmlns: "http://www.w3.org/2000/svg",
2834
+ width: "24",
2835
+ height: "24",
2836
+ viewBox: "0 0 24 24",
2837
+ fill: "none",
2838
+ stroke: "currentColor",
2839
+ strokeWidth: "2",
2840
+ strokeLinecap: "round",
2841
+ strokeLinejoin: "round",
2842
+ className: t,
2843
+ children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" })
2844
+ }
2845
+ );
2846
+ }
2847
+ function xr(t) {
2848
+ const r = /* @__PURE__ */ new Date();
2849
+ return r.setDate(r.getDate() + 1), t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
2850
+ }
2851
+ function $e(t) {
2852
+ const r = t.getHours(), s = t.getMinutes(), a = r >= 12 ? "PM" : "AM";
2853
+ return `${r % 12 || 12}:${s.toString().padStart(2, "0")} ${a}`;
2854
+ }
2855
+ function pr(t) {
2856
+ return new Intl.DateTimeFormat("en-US", {
2857
+ weekday: "long",
2858
+ month: "short",
2859
+ day: "numeric"
2860
+ }).format(t);
2861
+ }
2862
+ function vr(t) {
2863
+ const r = $e(t.startDate), s = $e(t.endDate);
2864
+ return `${r} - ${s}`;
2865
+ }
2866
+ function wr(t) {
2867
+ return q(t) ? "Today" : xr(t) ? "Tomorrow" : pr(t);
2868
+ }
2869
+ function br(t, r) {
2870
+ const s = /* @__PURE__ */ new Map();
2871
+ for (const a of t) {
2872
+ const i = tt(a.startDate), o = s.get(i) ?? [];
2873
+ o.push(a), s.set(i, o);
2874
+ }
2875
+ return Array.from(s.entries()).map(([a, i]) => {
2876
+ const o = [...i].sort(
2877
+ (h, c) => h.startDate.getTime() - c.startDate.getTime()
2878
+ ), d = r > 0 ? o.slice(0, r) : o;
2879
+ return {
2880
+ date: new Date(a),
2881
+ dateKey: a,
2882
+ events: d,
2883
+ hasMore: r > 0 && o.length > r
2884
+ };
2885
+ }).sort((a, i) => a.date.getTime() - i.date.getTime());
2886
+ }
2887
+ function yr({ event: t, onClick: r, compact: s }) {
2888
+ return /* @__PURE__ */ n(
2889
+ "button",
2890
+ {
2891
+ type: "button",
2892
+ onClick: () => r?.(t),
2893
+ className: u(
2894
+ "w-full text-left rounded-lg transition-colors",
2895
+ "hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2896
+ "flex items-start gap-3",
2897
+ s ? "p-2" : "p-3"
2898
+ ),
2899
+ children: [
2900
+ /* @__PURE__ */ e(
2901
+ "div",
2902
+ {
2903
+ className: u("shrink-0 rounded-full mt-1", s ? "size-2" : "size-2.5"),
2904
+ style: { backgroundColor: t.color ?? "#3b82f6" }
2905
+ }
2906
+ ),
2907
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
2908
+ /* @__PURE__ */ e("p", { className: u("font-medium truncate", s ? "text-xs" : "text-sm"), children: t.title }),
2909
+ /* @__PURE__ */ e(
2910
+ "p",
2911
+ {
2912
+ className: u(
2913
+ "text-muted-foreground truncate",
2914
+ s ? "text-[10px]" : "text-xs"
2915
+ ),
2916
+ children: vr(t)
2917
+ }
2918
+ )
2919
+ ] }),
2920
+ r && /* @__PURE__ */ e(
2921
+ Ve,
2922
+ {
2923
+ className: u(
2924
+ "shrink-0 text-muted-foreground/50",
2925
+ s ? "size-3" : "size-4"
2926
+ )
2927
+ }
2928
+ )
2929
+ ]
2930
+ }
2931
+ );
2932
+ }
2933
+ function Nr({
2934
+ group: t,
2935
+ onEventClick: r,
2936
+ onViewMore: s,
2937
+ compact: a
2938
+ }) {
2939
+ return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
2940
+ /* @__PURE__ */ n(
2941
+ "div",
2942
+ {
2943
+ className: u(
2944
+ "flex items-center justify-between px-2",
2945
+ a ? "py-1" : "py-1.5"
2946
+ ),
2947
+ children: [
2948
+ /* @__PURE__ */ e(
2949
+ "h3",
2950
+ {
2951
+ className: u(
2952
+ "font-semibold",
2953
+ a ? "text-xs" : "text-sm",
2954
+ q(t.date) && "text-primary"
2955
+ ),
2956
+ children: wr(t.date)
2957
+ }
2958
+ ),
2959
+ t.hasMore && s && /* @__PURE__ */ e(
2960
+ "button",
2961
+ {
2962
+ type: "button",
2963
+ onClick: () => s(t.date),
2964
+ className: u(
2965
+ "text-primary hover:underline",
2966
+ a ? "text-[10px]" : "text-xs"
2967
+ ),
2968
+ children: "+more"
2969
+ }
2970
+ )
2971
+ ]
2972
+ }
2973
+ ),
2974
+ /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(
2975
+ yr,
2976
+ {
2977
+ event: i,
2978
+ onClick: r,
2979
+ compact: a
2980
+ },
2981
+ i.id
2982
+ )) })
2983
+ ] });
2984
+ }
2985
+ function Zr({
2986
+ events: t,
2987
+ daysAhead: r = 7,
2988
+ maxEventsPerDay: s = 3,
2989
+ onEventClick: a,
2990
+ onViewAll: i,
2991
+ className: o,
2992
+ emptyState: d,
2993
+ title: h = "Upcoming",
2994
+ showHeader: c = !0,
2995
+ compact: g = !1
2996
+ }) {
2997
+ const p = Ae(), N = p?.filteredEvents, w = p?.currentDate ?? /* @__PURE__ */ new Date(), b = t ?? N ?? [], k = j(() => {
2998
+ const v = fe(w), M = new Date(v);
2999
+ return M.setDate(M.getDate() + r), b.filter((z) => z.endDate >= v && z.startDate < M);
3000
+ }, [b, r, w]), D = j(
3001
+ () => br(k, s),
3002
+ [k, s]
3003
+ ), C = k.length;
3004
+ return D.length === 0 ? /* @__PURE__ */ n("div", { className: u("rounded-lg border bg-card", o), children: [
3005
+ c && /* @__PURE__ */ e(
3006
+ "div",
3007
+ {
3008
+ className: u(
3009
+ "border-b px-4 flex items-center justify-between",
3010
+ g ? "py-2" : "py-3"
3011
+ ),
3012
+ children: /* @__PURE__ */ e("h2", { className: u("font-semibold", g ? "text-sm" : "text-base"), children: h })
3013
+ }
3014
+ ),
3015
+ /* @__PURE__ */ e(
3016
+ "div",
3017
+ {
3018
+ className: u(
3019
+ "flex flex-col items-center justify-center text-center",
3020
+ g ? "py-6 px-4" : "py-10 px-6"
3021
+ ),
3022
+ children: d ?? /* @__PURE__ */ n(Z, { children: [
3023
+ /* @__PURE__ */ e(
3024
+ gr,
3025
+ {
3026
+ className: u(
3027
+ "text-muted-foreground/50 mb-2",
3028
+ g ? "size-8" : "size-10"
3029
+ )
3030
+ }
3031
+ ),
3032
+ /* @__PURE__ */ e(
3033
+ "p",
3034
+ {
3035
+ className: u(
3036
+ "text-muted-foreground",
3037
+ g ? "text-xs" : "text-sm"
3038
+ ),
3039
+ children: "No upcoming events"
3040
+ }
3041
+ )
3042
+ ] })
3043
+ }
3044
+ )
3045
+ ] }) : /* @__PURE__ */ n("div", { className: u("rounded-lg border bg-card overflow-hidden", o), children: [
3046
+ c && /* @__PURE__ */ n(
3047
+ "div",
3048
+ {
3049
+ className: u(
3050
+ "border-b px-4 flex items-center justify-between",
3051
+ g ? "py-2" : "py-3"
3052
+ ),
3053
+ children: [
3054
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
3055
+ /* @__PURE__ */ e("h2", { className: u("font-semibold", g ? "text-sm" : "text-base"), children: h }),
3056
+ /* @__PURE__ */ e(
3057
+ "span",
3058
+ {
3059
+ className: u(
3060
+ "text-muted-foreground bg-muted rounded-full px-2",
3061
+ g ? "text-[10px] py-0" : "text-xs py-0.5"
3062
+ ),
3063
+ children: C
3064
+ }
3065
+ )
3066
+ ] }),
3067
+ i && /* @__PURE__ */ n(
3068
+ "button",
3069
+ {
3070
+ type: "button",
3071
+ onClick: () => i(),
3072
+ className: u(
3073
+ "text-primary hover:underline flex items-center gap-0.5",
3074
+ g ? "text-xs" : "text-sm"
3075
+ ),
3076
+ children: [
3077
+ "View all",
3078
+ /* @__PURE__ */ e(Ve, { className: "size-3" })
3079
+ ]
3080
+ }
3081
+ )
3082
+ ]
3083
+ }
3084
+ ),
3085
+ /* @__PURE__ */ e(
3086
+ "div",
3087
+ {
3088
+ className: u(
3089
+ "divide-y overflow-auto",
3090
+ g ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
3091
+ ),
3092
+ children: D.map((v) => /* @__PURE__ */ e(
3093
+ Nr,
3094
+ {
3095
+ group: v,
3096
+ onEventClick: a,
3097
+ onViewMore: i ? (M) => i(M) : void 0,
3098
+ compact: g
3099
+ },
3100
+ v.dateKey
3101
+ ))
3102
+ }
3103
+ )
3104
+ ] });
3105
+ }
3106
+ function kr({ className: t }) {
3107
+ return /* @__PURE__ */ n(
3108
+ "svg",
3109
+ {
3110
+ xmlns: "http://www.w3.org/2000/svg",
3111
+ viewBox: "0 0 24 24",
3112
+ fill: "none",
3113
+ stroke: "currentColor",
3114
+ strokeWidth: 1.8,
3115
+ strokeLinecap: "round",
3116
+ strokeLinejoin: "round",
3117
+ className: t,
3118
+ children: [
3119
+ /* @__PURE__ */ e("path", { d: "M8 2v4" }),
3120
+ /* @__PURE__ */ e("path", { d: "M16 2v4" }),
3121
+ /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2" }),
3122
+ /* @__PURE__ */ e("path", { d: "M3 10h18" }),
3123
+ /* @__PURE__ */ e("path", { d: "M8 14h.01" }),
3124
+ /* @__PURE__ */ e("path", { d: "M12 14h.01" }),
3125
+ /* @__PURE__ */ e("path", { d: "M16 14h.01" }),
3126
+ /* @__PURE__ */ e("path", { d: "M8 18h.01" }),
3127
+ /* @__PURE__ */ e("path", { d: "M12 18h.01" }),
3128
+ /* @__PURE__ */ e("path", { d: "M16 18h.01" })
3129
+ ]
3130
+ }
3131
+ );
3132
+ }
3133
+ function Cr({ className: t }) {
3134
+ return /* @__PURE__ */ n(
3135
+ "svg",
3136
+ {
3137
+ xmlns: "http://www.w3.org/2000/svg",
3138
+ viewBox: "0 0 24 24",
3139
+ fill: "none",
3140
+ stroke: "currentColor",
3141
+ strokeWidth: 2,
3142
+ strokeLinecap: "round",
3143
+ strokeLinejoin: "round",
3144
+ className: t,
3145
+ children: [
3146
+ /* @__PURE__ */ e("path", { d: "M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5" }),
3147
+ /* @__PURE__ */ e("path", { d: "M16 2v4" }),
3148
+ /* @__PURE__ */ e("path", { d: "M8 2v4" }),
3149
+ /* @__PURE__ */ e("path", { d: "M3 10h5" }),
3150
+ /* @__PURE__ */ e("path", { d: "M17.5 17.5 16 16.3V14" }),
3151
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "6" })
3152
+ ]
3153
+ }
3154
+ );
3155
+ }
3156
+ function Dr({ className: t }) {
3157
+ return /* @__PURE__ */ e(
3158
+ "svg",
3159
+ {
3160
+ xmlns: "http://www.w3.org/2000/svg",
3161
+ viewBox: "0 0 24 24",
3162
+ fill: "none",
3163
+ stroke: "currentColor",
3164
+ strokeWidth: 2,
3165
+ strokeLinecap: "round",
3166
+ strokeLinejoin: "round",
3167
+ className: t,
3168
+ children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" })
3169
+ }
3170
+ );
3171
+ }
3172
+ function Mr({ className: t }) {
3173
+ return /* @__PURE__ */ n(
3174
+ "svg",
3175
+ {
3176
+ xmlns: "http://www.w3.org/2000/svg",
3177
+ viewBox: "0 0 24 24",
3178
+ fill: "none",
3179
+ stroke: "currentColor",
3180
+ strokeWidth: 2,
3181
+ strokeLinecap: "round",
3182
+ strokeLinejoin: "round",
3183
+ className: t,
3184
+ children: [
3185
+ /* @__PURE__ */ e("path", { d: "M15 3h6v6" }),
3186
+ /* @__PURE__ */ e("path", { d: "M10 14 21 3" }),
3187
+ /* @__PURE__ */ e("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
3188
+ ]
3189
+ }
3190
+ );
3191
+ }
3192
+ function zr(t) {
3193
+ const r = t.getFullYear(), s = String(t.getMonth() + 1).padStart(2, "0"), a = String(t.getDate()).padStart(2, "0");
3194
+ return `${r}-${s}-${a}`;
3195
+ }
3196
+ function We(t) {
3197
+ const r = t.getHours(), s = t.getMinutes(), a = r >= 12 ? "PM" : "AM", i = r % 12 || 12, o = String(s).padStart(2, "0");
3198
+ return `${i}:${o} ${a}`;
3199
+ }
3200
+ function Sr(t) {
3201
+ const r = We(t.startDate), s = We(t.endDate);
3202
+ return `${r} - ${s}`;
3203
+ }
3204
+ function Er(t) {
3205
+ const r = Fe(/* @__PURE__ */ new Date(), 1);
3206
+ return t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
3207
+ }
3208
+ function Lr(t) {
3209
+ if (q(t)) return "Today";
3210
+ if (Er(t)) return "Tomorrow";
3211
+ const r = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], s = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], a = r[t.getDay()], i = s[t.getMonth()], o = t.getDate();
3212
+ return `${a}, ${i} ${o}`;
3213
+ }
3214
+ function Tr(t, r) {
3215
+ const s = /* @__PURE__ */ new Map();
3216
+ for (const a of t) {
3217
+ const i = zr(a.startDate), o = s.get(i) ?? [];
3218
+ o.push(a), s.set(i, o);
3219
+ }
3220
+ return Array.from(s.entries()).map(([a, i]) => {
3221
+ const o = [...i].sort(
3222
+ (h, c) => h.startDate.getTime() - c.startDate.getTime()
3223
+ ), d = r > 0 ? o.slice(0, r) : o;
3224
+ return {
3225
+ date: new Date(a),
3226
+ dateKey: a,
3227
+ events: d,
3228
+ hasMore: r > 0 && o.length > r
3229
+ };
3230
+ }).sort((a, i) => a.date.getTime() - i.date.getTime());
3231
+ }
3232
+ function jr(t) {
3233
+ const r = fe(/* @__PURE__ */ new Date()), s = Be(/* @__PURE__ */ new Date());
3234
+ return t.filter(
3235
+ (a) => a.startDate >= r && a.startDate <= s
3236
+ ).length;
3237
+ }
3238
+ function we({ className: t }) {
3239
+ return /* @__PURE__ */ e("div", { className: u("animate-pulse rounded-md bg-muted", t) });
3240
+ }
3241
+ function Ir({ event: t, onClick: r }) {
3242
+ return /* @__PURE__ */ n(
3243
+ "button",
3244
+ {
3245
+ type: "button",
3246
+ onClick: () => r?.(t),
3247
+ className: u(
3248
+ "w-full text-left rounded-lg transition-colors",
3249
+ "hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3250
+ "flex items-start gap-3 p-2"
3251
+ ),
3252
+ children: [
3253
+ /* @__PURE__ */ e(
3254
+ "div",
3255
+ {
3256
+ className: "shrink-0 rounded-full mt-1.5 size-2",
3257
+ style: { backgroundColor: t.color ?? "#3b82f6" }
3258
+ }
3259
+ ),
3260
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
3261
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium truncate", children: t.title }),
3262
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: Sr(t) })
3263
+ ] }),
3264
+ r && /* @__PURE__ */ e(Dr, { className: "shrink-0 size-4 text-muted-foreground/50 mt-1" })
3265
+ ]
3266
+ }
3267
+ );
3268
+ }
3269
+ function Hr({ group: t, onEventClick: r }) {
3270
+ return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
3271
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
3272
+ /* @__PURE__ */ e(
3273
+ "h3",
3274
+ {
3275
+ className: u(
3276
+ "text-xs font-semibold",
3277
+ q(t.date) && "text-primary"
3278
+ ),
3279
+ children: Lr(t.date)
3280
+ }
3281
+ ),
3282
+ t.hasMore && /* @__PURE__ */ n("span", { className: "text-[10px] text-muted-foreground", children: [
3283
+ "+",
3284
+ t.events.length,
3285
+ " more"
3286
+ ] })
3287
+ ] }),
3288
+ /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((s) => /* @__PURE__ */ e(Ir, { event: s, onClick: r }, s.id)) })
3289
+ ] });
3290
+ }
3291
+ function qr({
3292
+ events: t,
3293
+ isLoading: r = !1,
3294
+ className: s,
3295
+ daysAhead: a = 7,
3296
+ maxEventsPerDay: i = 3,
3297
+ onEventClick: o,
3298
+ onNavigateToAgenda: d
3299
+ }) {
3300
+ const [h, c] = ae(!1), g = j(() => {
3301
+ const k = fe(/* @__PURE__ */ new Date()), D = Fe(k, a);
3302
+ return t.filter((C) => C.endDate >= k && C.startDate < D);
3303
+ }, [t, a]), p = j(
3304
+ () => Tr(g, i),
3305
+ [g, i]
3306
+ ), N = j(() => jr(t), [t]), w = (k) => {
3307
+ c(!1), o?.(k);
3308
+ }, b = () => {
3309
+ c(!1), d?.();
3310
+ };
3311
+ return /* @__PURE__ */ n(Pe, { open: h, onOpenChange: c, children: [
3312
+ /* @__PURE__ */ n(
3313
+ Oe,
3314
+ {
3315
+ className: u(
3316
+ "relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",
3317
+ s
3318
+ ),
3319
+ children: [
3320
+ /* @__PURE__ */ e(kr, { className: "h-4 w-4" }),
3321
+ N > 0 && /* @__PURE__ */ e(
3322
+ dt,
3323
+ {
3324
+ variant: "destructive",
3325
+ className: "absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",
3326
+ children: N > 99 ? "99+" : N
3327
+ }
3328
+ )
3329
+ ]
3330
+ }
3331
+ ),
3332
+ /* @__PURE__ */ n(_e, { className: "w-80 rounded-xl p-0", align: "end", side: "bottom", sideOffset: 8, children: [
3333
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b p-4", children: [
3334
+ /* @__PURE__ */ n("div", { children: [
3335
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
3336
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: N > 0 ? `${N} event${N > 1 ? "s" : ""} today` : "No events today" })
3337
+ ] }),
3338
+ d && /* @__PURE__ */ n(
3339
+ "button",
3340
+ {
3341
+ type: "button",
3342
+ onClick: b,
3343
+ className: "text-xs text-primary hover:underline flex items-center gap-1",
3344
+ children: [
3345
+ "View all",
3346
+ /* @__PURE__ */ e(Mr, { className: "size-3" })
3347
+ ]
3348
+ }
3349
+ )
3350
+ ] }),
3351
+ /* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: r ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((k, D) => /* @__PURE__ */ n("div", { className: "flex space-x-3", children: [
3352
+ /* @__PURE__ */ e(we, { className: "h-2 w-2 rounded-full mt-2" }),
3353
+ /* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
3354
+ /* @__PURE__ */ e(we, { className: "h-4 w-full" }),
3355
+ /* @__PURE__ */ e(we, { className: "h-3 w-3/4" })
3356
+ ] })
3357
+ ] }, D)) }) : p.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
3358
+ /* @__PURE__ */ e(Cr, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
3359
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
3360
+ /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground/70", children: [
3361
+ "Your schedule is clear for the next ",
3362
+ a,
3363
+ " days"
3364
+ ] })
3365
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: p.map((k) => /* @__PURE__ */ e(
3366
+ Hr,
3367
+ {
3368
+ group: k,
3369
+ onEventClick: w
3370
+ },
3371
+ k.dateKey
3372
+ )) }) })
3373
+ ] })
3374
+ ] });
3375
+ }
3376
+ export {
3377
+ qr as A,
3378
+ Yr as B,
3379
+ Or as C,
3380
+ Kr as D,
3381
+ Rr as E,
3382
+ _r as I,
3383
+ Qr as S,
3384
+ xe as T,
3385
+ Jr as U,
3386
+ Ur as V,
3387
+ Gr as W,
3388
+ xt as Y,
3389
+ Zr as a,
3390
+ Xr as b,
3391
+ Vr as c
3392
+ };
3393
+ //# sourceMappingURL=agenda-dropdown-CU74g7uM.js.map