@reservi/preact 1.6.0 → 1.7.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.
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import { render as At, h as ke } from "preact";
2
- import { getLocaleText as W, dl as g, timeStringToMinutes as X, computeDrop as ht, pxToSnappedMinutes as It, computeResize as $t, resolveBusinessHours as xe, isWithinBusinessHours as Pe, THEME_TOKEN_VARS as Ae, themeToStyle as Ie, CalendarApi as $e, eventsToICS as je } from "@reservi/core";
2
+ import { getLocaleText as W, dl as f, timeStringToMinutes as X, computeDrop as ht, pxToSnappedMinutes as It, computeResize as $t, resolveBusinessHours as xe, isWithinBusinessHours as Pe, THEME_TOKEN_VARS as Ae, themeToStyle as Ie, CalendarApi as $e, eventsToICS as je } from "@reservi/core";
3
3
  import { dayGridPlugin as On, definePlugin as Tn, defineTheme as En, eventsToICS as Mn, listPlugin as Cn, multiMonthPlugin as kn, parseICS as xn, resourcePlugin as Pn, themeToStyle as An, timeGridPlugin as In, timelinePlugin as $n } from "@reservi/core";
4
4
  import { jsx as u, jsxs as C } from "preact/jsx-runtime";
5
5
  import "@preact/signals";
6
- import { useRef as F, useLayoutEffect as jt, useState as V, useEffect as H } from "preact/hooks";
6
+ import { useRef as F, useLayoutEffect as jt, useState as V, useEffect as R } from "preact/hooks";
7
7
  function hn(t) {
8
8
  return { __rsvHost: !0, node: t };
9
9
  }
10
- function Fe(t) {
10
+ function He(t) {
11
11
  return typeof t == "object" && t !== null && t.__rsvHost === !0;
12
12
  }
13
13
  function B(t, e, r, n) {
14
14
  if (!t) return r;
15
15
  const a = t(e);
16
- return a === void 0 ? r : Fe(a) ? n ? /* @__PURE__ */ u(He, { bridge: n, node: a.node }) : r : a;
16
+ return a === void 0 ? r : He(a) ? n ? /* @__PURE__ */ u(Re, { bridge: n, node: a.node }) : r : a;
17
17
  }
18
- let Re = 0;
19
- function He({ bridge: t, node: e }) {
18
+ let Fe = 0;
19
+ function Re({ bridge: t, node: e }) {
20
20
  const r = F("");
21
- r.current || (r.current = `rsv-host-${++Re}`);
21
+ r.current || (r.current = `rsv-host-${++Fe}`);
22
22
  const n = F(null), a = F(e);
23
23
  a.current = e;
24
24
  const o = F(!1);
@@ -36,11 +36,11 @@ function He({ bridge: t, node: e }) {
36
36
  function K(...t) {
37
37
  return t.filter(Boolean).join(" ");
38
38
  }
39
- const Ft = /* @__PURE__ */ new WeakSet();
39
+ const Ht = /* @__PURE__ */ new WeakSet();
40
40
  function U(t, e, r) {
41
41
  if (!t || !e) return;
42
42
  const n = t;
43
- Ft.has(n) || (Ft.add(n), e(Object.assign(r(), { el: n })));
43
+ Ht.has(n) || (Ht.add(n), e(Object.assign(r(), { el: n })));
44
44
  }
45
45
  function Le(t, e) {
46
46
  if (!t.length) return null;
@@ -81,22 +81,22 @@ function Ye(t) {
81
81
  return e ? [e.start, e.center, e.end].filter((n) => !!n).flatMap((n) => n.split(/\s+/)).flatMap((n) => n.split(",")).filter((n) => !Ne.has(n)) : [];
82
82
  }
83
83
  function Ve({ api: t, title: e, activeView: r, options: n }) {
84
- var P, O, A, j, L;
85
- const a = W(n.locale), o = (O = (P = n.slots) == null ? void 0 : P.toolbarStart) == null ? void 0 : O.call(P), d = (j = (A = n.slots) == null ? void 0 : A.toolbarEnd) == null ? void 0 : j.call(A), i = Ye(n), s = Be.test(r), l = n.firstDay ?? a.firstDay, c = F(null), [y, T] = V(!1), v = g.toDate(t.getDate()), f = g.toDate(n.now ? g.from(n.now) : g.now()), [p, h] = V(v.getFullYear()), [w, D] = V(v.getMonth()), M = new Intl.DateTimeFormat(n.locale, { month: "short" }), k = new Intl.DateTimeFormat(n.locale, { month: "long" }), m = new Intl.DateTimeFormat(n.locale, { weekday: "short" }), x = Array.from(
84
+ var P, O, A, H, L;
85
+ const a = W(n.locale), o = (O = (P = n.slots) == null ? void 0 : P.toolbarStart) == null ? void 0 : O.call(P), d = (H = (A = n.slots) == null ? void 0 : A.toolbarEnd) == null ? void 0 : H.call(A), i = Ye(n), s = Be.test(r), l = n.firstDay ?? a.firstDay, c = F(null), [y, T] = V(!1), v = f.toDate(t.getDate()), p = f.toDate(n.now ? f.from(n.now) : f.now()), [D, m] = V(v.getFullYear()), [b, w] = V(v.getMonth()), M = new Intl.DateTimeFormat(n.locale, { month: "short" }), x = new Intl.DateTimeFormat(n.locale, { month: "long" }), g = new Intl.DateTimeFormat(n.locale, { weekday: "short" }), k = Array.from(
86
86
  { length: 12 },
87
87
  (S, I) => M.format(new Date(2020, I, 1))
88
- ), R = () => {
89
- const S = g.toDate(t.getDate());
90
- h(S.getFullYear()), D(S.getMonth()), T(!0);
88
+ ), j = () => {
89
+ const S = f.toDate(t.getDate());
90
+ m(S.getFullYear()), w(S.getMonth()), T(!0);
91
91
  }, $ = (S) => {
92
- const I = p * 12 + w + S;
93
- h(Math.floor(I / 12)), D((I % 12 + 12) % 12);
94
- }, b = (S) => {
92
+ const I = D * 12 + b + S;
93
+ m(Math.floor(I / 12)), w((I % 12 + 12) % 12);
94
+ }, h = (S) => {
95
95
  t.gotoDate(S), T(!1);
96
96
  };
97
- H(() => {
97
+ R(() => {
98
98
  const S = (N) => {
99
- (N.ctrlKey || N.metaKey) && (N.key === "m" || N.key === "M") ? (N.preventDefault(), R()) : N.key === "Escape" && T(!1);
99
+ (N.ctrlKey || N.metaKey) && (N.key === "m" || N.key === "M") ? (N.preventDefault(), j()) : N.key === "Escape" && T(!1);
100
100
  }, I = (N) => {
101
101
  c.current && !c.current.contains(N.target) && T(!1);
102
102
  };
@@ -106,7 +106,7 @@ function Ve({ api: t, title: e, activeView: r, options: n }) {
106
106
  }, []);
107
107
  const E = (() => {
108
108
  if (s) return { cells: [], dows: [] };
109
- const S = g.from(`${p}-${nt(w + 1)}-01`), I = (g.dayOfWeek(S) - l + 7) % 7, N = g.subtract(S, { days: I }), xt = Array.from({ length: 42 }, (Pt, Ce) => g.toDate(g.add(N, { days: Ce }))), Me = xt.slice(0, 7).map((Pt) => m.format(Pt));
109
+ const S = f.from(`${D}-${nt(b + 1)}-01`), I = (f.dayOfWeek(S) - l + 7) % 7, N = f.subtract(S, { days: I }), xt = Array.from({ length: 42 }, (Pt, Ce) => f.toDate(f.add(N, { days: Ce }))), Me = xt.slice(0, 7).map((Pt) => g.format(Pt));
110
110
  return { cells: xt, dows: Me };
111
111
  })();
112
112
  return /* @__PURE__ */ C("div", { "data-rsv": "toolbar-wrap", class: K((L = n.classNames) == null ? void 0 : L.toolbar), ref: c, children: [
@@ -145,7 +145,7 @@ function Ve({ api: t, title: e, activeView: r, options: n }) {
145
145
  "aria-haspopup": "dialog",
146
146
  "aria-expanded": y,
147
147
  title: `${e} · Ctrl+M`,
148
- onClick: () => y ? T(!1) : R(),
148
+ onClick: () => y ? T(!1) : j(),
149
149
  children: [
150
150
  /* @__PURE__ */ u(Ke, {}),
151
151
  e
@@ -167,34 +167,34 @@ function Ve({ api: t, title: e, activeView: r, options: n }) {
167
167
  type: "button",
168
168
  "data-rsv": "dp-nav",
169
169
  "aria-label": a.prev,
170
- onClick: () => s ? h((S) => S - 1) : $(-1),
170
+ onClick: () => s ? m((S) => S - 1) : $(-1),
171
171
  children: rt.prev
172
172
  }
173
173
  ),
174
- /* @__PURE__ */ u("span", { "data-rsv": "dp-label", children: s ? p : `${k.format(new Date(p, w, 1))} ${p}` }),
174
+ /* @__PURE__ */ u("span", { "data-rsv": "dp-label", children: s ? D : `${x.format(new Date(D, b, 1))} ${D}` }),
175
175
  /* @__PURE__ */ u(
176
176
  "button",
177
177
  {
178
178
  type: "button",
179
179
  "data-rsv": "dp-nav",
180
180
  "aria-label": a.next,
181
- onClick: () => s ? h((S) => S + 1) : $(1),
181
+ onClick: () => s ? m((S) => S + 1) : $(1),
182
182
  children: rt.next
183
183
  }
184
184
  )
185
185
  ] }),
186
- s ? /* @__PURE__ */ u("div", { "data-rsv": "dp-grid", children: x.map((S, I) => /* @__PURE__ */ u(
186
+ s ? /* @__PURE__ */ u("div", { "data-rsv": "dp-grid", children: k.map((S, I) => /* @__PURE__ */ u(
187
187
  "button",
188
188
  {
189
189
  type: "button",
190
190
  "data-rsv": "dp-month",
191
191
  "data-active": String(
192
- p === v.getFullYear() && I === v.getMonth()
192
+ D === v.getFullYear() && I === v.getMonth()
193
193
  ),
194
194
  "data-today": String(
195
- p === f.getFullYear() && I === f.getMonth()
195
+ D === p.getFullYear() && I === p.getMonth()
196
196
  ),
197
- onClick: () => b(`${p}-${nt(I + 1)}-01`),
197
+ onClick: () => h(`${D}-${nt(I + 1)}-01`),
198
198
  children: S
199
199
  },
200
200
  S
@@ -207,14 +207,14 @@ function Ve({ api: t, title: e, activeView: r, options: n }) {
207
207
  {
208
208
  type: "button",
209
209
  "data-rsv": "dp-day",
210
- "data-other": String(S.getMonth() !== w),
210
+ "data-other": String(S.getMonth() !== b),
211
211
  "data-active": String(
212
212
  S.getFullYear() === v.getFullYear() && S.getMonth() === v.getMonth() && S.getDate() === v.getDate()
213
213
  ),
214
214
  "data-today": String(
215
- S.getFullYear() === f.getFullYear() && S.getMonth() === f.getMonth() && S.getDate() === f.getDate()
215
+ S.getFullYear() === p.getFullYear() && S.getMonth() === p.getMonth() && S.getDate() === p.getDate()
216
216
  ),
217
- onClick: () => b(I),
217
+ onClick: () => h(I),
218
218
  children: S.getDate()
219
219
  },
220
220
  I
@@ -295,7 +295,7 @@ function dt(t, e, r) {
295
295
  function ee(t, e) {
296
296
  t.trigger("navLinkDay", { date: e });
297
297
  const r = t.hasView("timeGridDay") ? "timeGridDay" : t.hasView("dayGridDay") ? "dayGridDay" : null;
298
- r && (t.gotoDate(g.toISOString(e)), t.changeView(r));
298
+ r && (t.gotoDate(f.toISOString(e)), t.changeView(r));
299
299
  }
300
300
  const at = 1440, Ue = {
301
301
  moveLeft: ["ArrowLeft"],
@@ -333,7 +333,7 @@ function re(t, e) {
333
333
  break;
334
334
  }
335
335
  t.preventDefault();
336
- const s = ht(n.start, n.end, i, g);
336
+ const s = ht(n.start, n.end, i, f);
337
337
  if (r.moveEvent(n.id, s.start, s.end)) {
338
338
  const l = r.getEventById(n.id);
339
339
  l && r.trigger("eventDrop", { event: l });
@@ -356,8 +356,8 @@ function Xe(t, e) {
356
356
  var T;
357
357
  if (document.removeEventListener("pointermove", d), document.removeEventListener("pointerup", i), !o) return;
358
358
  (T = e.onRangeSelect) == null || T.call(e);
359
- const s = g.from(e.startDate), l = g.from(a), [c, y] = g.isBefore(s, l) ? [s, l] : [l, s];
360
- n.select(g.toISOString(c), g.toISOString(g.add(y, { days: 1 })));
359
+ const s = f.from(e.startDate), l = f.from(a), [c, y] = f.isBefore(s, l) ? [s, l] : [l, s];
360
+ n.select(f.toISOString(c), f.toISOString(f.add(y, { days: 1 })));
361
361
  };
362
362
  document.addEventListener("pointermove", d), document.addEventListener("pointerup", i);
363
363
  }
@@ -401,10 +401,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
401
401
  function ae(t, e) {
402
402
  return _e(t) || Ze(t, e) || ne(t, e) || Je();
403
403
  }
404
- var ft = {}, Z = {}, Rt;
404
+ var ft = {}, Z = {}, Ft;
405
405
  function oe() {
406
- if (Rt) return Z;
407
- Rt = 1, Object.defineProperty(Z, "__esModule", { value: !0 }), Z.bind = void 0;
406
+ if (Ft) return Z;
407
+ Ft = 1, Object.defineProperty(Z, "__esModule", { value: !0 }), Z.bind = void 0;
408
408
  function t(e, r) {
409
409
  var n = r.type, a = r.listener, o = r.options;
410
410
  return e.addEventListener(n, a, o), function() {
@@ -413,10 +413,10 @@ function oe() {
413
413
  }
414
414
  return Z.bind = t, Z;
415
415
  }
416
- var G = {}, Ht;
416
+ var G = {}, Rt;
417
417
  function Qe() {
418
- if (Ht) return G;
419
- Ht = 1;
418
+ if (Rt) return G;
419
+ Rt = 1;
420
420
  var t = G && G.__assign || function() {
421
421
  return t = Object.assign || function(o) {
422
422
  for (var d, i = 1, s = arguments.length; i < s; i++) {
@@ -1054,30 +1054,30 @@ function Or(t) {
1054
1054
  initial: o
1055
1055
  });
1056
1056
  function s(v) {
1057
- var f = Sr({
1057
+ var p = Sr({
1058
1058
  current: d.current.dropTargets,
1059
1059
  next: v.dropTargets
1060
1060
  });
1061
- d.current = v, f && i.dragUpdate({
1061
+ d.current = v, p && i.dragUpdate({
1062
1062
  current: d.current
1063
1063
  });
1064
1064
  }
1065
1065
  function l(v) {
1066
- var f = J(v), p = se(v.target) ? de({
1067
- x: f.clientX,
1068
- y: f.clientY
1069
- }) : v.target, h = n({
1070
- target: p,
1071
- input: f,
1066
+ var p = J(v), D = se(v.target) ? de({
1067
+ x: p.clientX,
1068
+ y: p.clientY
1069
+ }) : v.target, m = n({
1070
+ target: D,
1071
+ input: p,
1072
1072
  source: r.payload,
1073
1073
  current: d.current.dropTargets
1074
1074
  });
1075
- h.length && (v.preventDefault(), mt({
1075
+ m.length && (v.preventDefault(), mt({
1076
1076
  event: v,
1077
- current: h
1077
+ current: m
1078
1078
  })), s({
1079
- dropTargets: h,
1080
- input: f
1079
+ dropTargets: m,
1080
+ input: p
1081
1081
  });
1082
1082
  }
1083
1083
  function c() {
@@ -1102,8 +1102,8 @@ function Or(t) {
1102
1102
  // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`
1103
1103
  // 🦊😤
1104
1104
  type: "dragover",
1105
- listener: function(f) {
1106
- l(f), i.drag({
1105
+ listener: function(p) {
1106
+ l(p), i.drag({
1107
1107
  current: d.current
1108
1108
  });
1109
1109
  }
@@ -1112,9 +1112,9 @@ function Or(t) {
1112
1112
  listener: l
1113
1113
  }, {
1114
1114
  type: "dragleave",
1115
- listener: function(f) {
1115
+ listener: function(p) {
1116
1116
  pr({
1117
- dragLeave: f
1117
+ dragLeave: p
1118
1118
  }) && (s({
1119
1119
  input: d.current.input,
1120
1120
  dropTargets: []
@@ -1123,22 +1123,22 @@ function Or(t) {
1123
1123
  }, {
1124
1124
  // A "drop" can only happen if the browser allowed the drop
1125
1125
  type: "drop",
1126
- listener: function(f) {
1126
+ listener: function(p) {
1127
1127
  if (d.current = {
1128
1128
  dropTargets: d.current.dropTargets,
1129
- input: J(f)
1129
+ input: J(p)
1130
1130
  }, !d.current.dropTargets.length) {
1131
1131
  c();
1132
1132
  return;
1133
1133
  }
1134
- f.preventDefault(), mt({
1135
- event: f,
1134
+ p.preventDefault(), mt({
1135
+ event: p,
1136
1136
  current: d.current.dropTargets
1137
1137
  }), i.drop({
1138
1138
  current: d.current,
1139
1139
  // When dropping something native, we need to extract the latest
1140
1140
  // `.items` from the "drop" event as it is now accessible
1141
- updatedSourcePayload: r.type === "external" ? r.getDropPayload(f) : null
1141
+ updatedSourcePayload: r.type === "external" ? r.getDropPayload(p) : null
1142
1142
  }), y();
1143
1143
  }
1144
1144
  }, {
@@ -1150,10 +1150,10 @@ function Or(t) {
1150
1150
  // This "dragend" listener will not fire if there was a successful drop
1151
1151
  // as we will have already removed the event listener
1152
1152
  type: "dragend",
1153
- listener: function(f) {
1153
+ listener: function(p) {
1154
1154
  d.current = {
1155
1155
  dropTargets: d.current.dropTargets,
1156
- input: J(f)
1156
+ input: J(p)
1157
1157
  }, c();
1158
1158
  }
1159
1159
  }].concat(ue(hr({
@@ -1306,51 +1306,51 @@ function kr(t) {
1306
1306
  }
1307
1307
  function i(v) {
1308
1308
  if (process.env.NODE_ENV !== "production") {
1309
- var f = n.get(v.element);
1310
- f && console.warn("You have already registered a [".concat(e, "] dropTarget on the same element"), {
1311
- existing: f,
1309
+ var p = n.get(v.element);
1310
+ p && console.warn("You have already registered a [".concat(e, "] dropTarget on the same element"), {
1311
+ existing: p,
1312
1312
  proposed: v
1313
1313
  }), v.element instanceof HTMLIFrameElement && console.warn(`
1314
1314
  We recommend not registering <iframe> elements as drop targets
1315
1315
  as it can result in some strange browser event ordering.
1316
1316
  `.replace(/\s{2,}/g, " ").trim());
1317
1317
  }
1318
- var p = Et(fe(v.element, {
1318
+ var D = Et(fe(v.element, {
1319
1319
  attribute: a,
1320
1320
  value: "true"
1321
1321
  }), d(v));
1322
- return z(p);
1322
+ return z(D);
1323
1323
  }
1324
1324
  function s(v) {
1325
- var f, p, h, w, D = v.source, M = v.target, k = v.input, m = v.result, x = m === void 0 ? [] : m;
1325
+ var p, D, m, b, w = v.source, M = v.target, x = v.input, g = v.result, k = g === void 0 ? [] : g;
1326
1326
  if (M == null)
1327
- return x;
1327
+ return k;
1328
1328
  if (!(M instanceof Element))
1329
1329
  return M instanceof Node ? s({
1330
- source: D,
1330
+ source: w,
1331
1331
  target: M.parentElement,
1332
- input: k,
1333
- result: x
1334
- }) : x;
1335
- var R = M.closest(o);
1336
- if (R == null)
1337
- return x;
1338
- var $ = n.get(R);
1332
+ input: x,
1333
+ result: k
1334
+ }) : k;
1335
+ var j = M.closest(o);
1336
+ if (j == null)
1337
+ return k;
1338
+ var $ = n.get(j);
1339
1339
  if ($ == null)
1340
- return x;
1341
- var b = {
1342
- input: k,
1343
- source: D,
1340
+ return k;
1341
+ var h = {
1342
+ input: x,
1343
+ source: w,
1344
1344
  element: $.element
1345
1345
  };
1346
- if ($.canDrop && !$.canDrop(b))
1346
+ if ($.canDrop && !$.canDrop(h))
1347
1347
  return s({
1348
- source: D,
1348
+ source: w,
1349
1349
  target: $.element.parentElement,
1350
- input: k,
1351
- result: x
1350
+ input: x,
1351
+ result: k
1352
1352
  });
1353
- var E = (f = (p = $.getData) === null || p === void 0 ? void 0 : p.call($, b)) !== null && f !== void 0 ? f : {}, P = (h = (w = $.getDropEffect) === null || w === void 0 ? void 0 : w.call($, b)) !== null && h !== void 0 ? h : r, O = {
1353
+ var E = (p = (D = $.getData) === null || D === void 0 ? void 0 : D.call($, h)) !== null && p !== void 0 ? p : {}, P = (m = (b = $.getDropEffect) === null || b === void 0 ? void 0 : b.call($, h)) !== null && m !== void 0 ? m : r, O = {
1354
1354
  data: E,
1355
1355
  element: $.element,
1356
1356
  dropEffect: P,
@@ -1359,32 +1359,32 @@ function kr(t) {
1359
1359
  isActiveDueToStickiness: !1
1360
1360
  };
1361
1361
  return s({
1362
- source: D,
1362
+ source: w,
1363
1363
  target: $.element.parentElement,
1364
- input: k,
1364
+ input: x,
1365
1365
  // Using bubble ordering. Same ordering as `event.getPath()`
1366
- result: [].concat(ue(x), [O])
1366
+ result: [].concat(ue(k), [O])
1367
1367
  });
1368
1368
  }
1369
1369
  function l(v) {
1370
- var f = v.eventName, p = v.payload, h = yt(p.location.current.dropTargets), w;
1370
+ var p = v.eventName, D = v.payload, m = yt(D.location.current.dropTargets), b;
1371
1371
  try {
1372
- for (h.s(); !(w = h.n()).done; ) {
1373
- var D, M = w.value, k = n.get(M.element), m = Y(Y({}, p), {}, {
1372
+ for (m.s(); !(b = m.n()).done; ) {
1373
+ var w, M = b.value, x = n.get(M.element), g = Y(Y({}, D), {}, {
1374
1374
  self: M
1375
1375
  });
1376
- k == null || (D = k[f]) === null || D === void 0 || D.call(
1377
- k,
1376
+ x == null || (w = x[p]) === null || w === void 0 || w.call(
1377
+ x,
1378
1378
  // I cannot seem to get the types right here.
1379
1379
  // TS doesn't seem to like that one event can need `nativeSetDragImage`
1380
1380
  // @ts-expect-error
1381
- m
1381
+ g
1382
1382
  );
1383
1383
  }
1384
- } catch (x) {
1385
- h.e(x);
1384
+ } catch (k) {
1385
+ m.e(k);
1386
1386
  } finally {
1387
- h.f();
1387
+ m.f();
1388
1388
  }
1389
1389
  }
1390
1390
  var c = {
@@ -1392,35 +1392,35 @@ function kr(t) {
1392
1392
  onDrag: l,
1393
1393
  onDragStart: l,
1394
1394
  onDrop: l,
1395
- onDropTargetChange: function(f) {
1396
- var p = f.payload, h = new Set(p.location.current.dropTargets.map(function(I) {
1395
+ onDropTargetChange: function(p) {
1396
+ var D = p.payload, m = new Set(D.location.current.dropTargets.map(function(I) {
1397
1397
  return I.element;
1398
- })), w = /* @__PURE__ */ new Set(), D = yt(p.location.previous.dropTargets), M;
1398
+ })), b = /* @__PURE__ */ new Set(), w = yt(D.location.previous.dropTargets), M;
1399
1399
  try {
1400
- for (D.s(); !(M = D.n()).done; ) {
1401
- var k, m = M.value;
1402
- w.add(m.element);
1403
- var x = n.get(m.element), R = h.has(m.element), $ = Y(Y({}, p), {}, {
1404
- self: m
1400
+ for (w.s(); !(M = w.n()).done; ) {
1401
+ var x, g = M.value;
1402
+ b.add(g.element);
1403
+ var k = n.get(g.element), j = m.has(g.element), $ = Y(Y({}, D), {}, {
1404
+ self: g
1405
1405
  });
1406
- if (x == null || (k = x.onDropTargetChange) === null || k === void 0 || k.call(x, $), !R) {
1407
- var b;
1408
- x == null || (b = x.onDragLeave) === null || b === void 0 || b.call(x, $);
1406
+ if (k == null || (x = k.onDropTargetChange) === null || x === void 0 || x.call(k, $), !j) {
1407
+ var h;
1408
+ k == null || (h = k.onDragLeave) === null || h === void 0 || h.call(k, $);
1409
1409
  }
1410
1410
  }
1411
1411
  } catch (I) {
1412
- D.e(I);
1412
+ w.e(I);
1413
1413
  } finally {
1414
- D.f();
1414
+ w.f();
1415
1415
  }
1416
- var E = yt(p.location.current.dropTargets), P;
1416
+ var E = yt(D.location.current.dropTargets), P;
1417
1417
  try {
1418
1418
  for (E.s(); !(P = E.n()).done; ) {
1419
- var O, A, j = P.value;
1420
- if (!w.has(j.element)) {
1421
- var L = Y(Y({}, p), {}, {
1422
- self: j
1423
- }), S = n.get(j.element);
1419
+ var O, A, H = P.value;
1420
+ if (!b.has(H.element)) {
1421
+ var L = Y(Y({}, D), {}, {
1422
+ self: H
1423
+ }), S = n.get(H.element);
1424
1424
  S == null || (O = S.onDropTargetChange) === null || O === void 0 || O.call(S, L), S == null || (A = S.onDragEnter) === null || A === void 0 || A.call(S, L);
1425
1425
  }
1426
1426
  }
@@ -1435,38 +1435,38 @@ function kr(t) {
1435
1435
  c[v.eventName](v);
1436
1436
  }
1437
1437
  function T(v) {
1438
- var f = v.source, p = v.target, h = v.input, w = v.current, D = s({
1439
- source: f,
1440
- target: p,
1441
- input: h
1438
+ var p = v.source, D = v.target, m = v.input, b = v.current, w = s({
1439
+ source: p,
1440
+ target: D,
1441
+ input: m
1442
1442
  });
1443
- if (D.length >= w.length)
1444
- return D;
1445
- for (var M = pt(w), k = pt(D), m = [], x = 0; x < M.length; x++) {
1446
- var R, $ = M[x], b = k[x];
1447
- if (b != null) {
1448
- m.push(b);
1443
+ if (w.length >= b.length)
1444
+ return w;
1445
+ for (var M = pt(b), x = pt(w), g = [], k = 0; k < M.length; k++) {
1446
+ var j, $ = M[k], h = x[k];
1447
+ if (h != null) {
1448
+ g.push(h);
1449
1449
  continue;
1450
1450
  }
1451
- var E = m[x - 1], P = M[x - 1];
1451
+ var E = g[k - 1], P = M[k - 1];
1452
1452
  if ((E == null ? void 0 : E.element) !== (P == null ? void 0 : P.element))
1453
1453
  break;
1454
1454
  var O = n.get($.element);
1455
1455
  if (!O)
1456
1456
  break;
1457
1457
  var A = {
1458
- input: h,
1459
- source: f,
1458
+ input: m,
1459
+ source: p,
1460
1460
  element: O.element
1461
1461
  };
1462
- if (O.canDrop && !O.canDrop(A) || !((R = O.getIsSticky) !== null && R !== void 0 && R.call(O, A)))
1462
+ if (O.canDrop && !O.canDrop(A) || !((j = O.getIsSticky) !== null && j !== void 0 && j.call(O, A)))
1463
1463
  break;
1464
- m.push(Y(Y({}, $), {}, {
1464
+ g.push(Y(Y({}, $), {}, {
1465
1465
  // making it clear to consumers this drop target is active due to stickiness
1466
1466
  isActiveDueToStickiness: !0
1467
1467
  }));
1468
1468
  }
1469
- return pt(m);
1469
+ return pt(g);
1470
1470
  }
1471
1471
  return {
1472
1472
  dropTargetForConsumers: i,
@@ -1568,18 +1568,18 @@ function Ir() {
1568
1568
  var c = l.value;
1569
1569
  r(c);
1570
1570
  }
1571
- } catch (h) {
1572
- s.e(h);
1571
+ } catch (m) {
1572
+ s.e(m);
1573
1573
  } finally {
1574
1574
  s.f();
1575
1575
  }
1576
1576
  }
1577
1577
  if (e) {
1578
1578
  for (var y = Array.from(e.active), T = 0, v = y; T < v.length; T++) {
1579
- var f = v[T];
1580
- if (e.active.has(f)) {
1581
- var p;
1582
- (p = f[d]) === null || p === void 0 || p.call(f, i);
1579
+ var p = v[T];
1580
+ if (e.active.has(p)) {
1581
+ var D;
1582
+ (D = p[d]) === null || D === void 0 || D.call(p, i);
1583
1583
  }
1584
1584
  }
1585
1585
  d === "onDrop" && (e.active.clear(), e = null);
@@ -1628,7 +1628,7 @@ function $r(t) {
1628
1628
  }
1629
1629
  var jr = z(function() {
1630
1630
  return navigator.userAgent.toLocaleLowerCase().includes("android");
1631
- }), Fr = "pdnd:android-fallback", Xt = "text/plain", Rr = "text/uri-list", Hr = "application/vnd.pdnd", et = /* @__PURE__ */ new WeakMap();
1631
+ }), Hr = "pdnd:android-fallback", Xt = "text/plain", Fr = "text/uri-list", Rr = "application/vnd.pdnd", et = /* @__PURE__ */ new WeakMap();
1632
1632
  function Lr(t) {
1633
1633
  return et.set(t.element, t), function() {
1634
1634
  et.delete(t.element);
@@ -1669,34 +1669,34 @@ var _t = lr(), Mt = $r({
1669
1669
  return;
1670
1670
  }
1671
1671
  if (y.dragHandle) {
1672
- var f = de({
1672
+ var p = de({
1673
1673
  x: T.clientX,
1674
1674
  y: T.clientY
1675
1675
  });
1676
- if (!y.dragHandle.contains(f)) {
1676
+ if (!y.dragHandle.contains(p)) {
1677
1677
  n.preventDefault();
1678
1678
  return;
1679
1679
  }
1680
1680
  }
1681
- var p = (o = (d = y.getInitialDataForExternal) === null || d === void 0 ? void 0 : d.call(y, v)) !== null && o !== void 0 ? o : null;
1682
- if (p)
1683
- for (var h = 0, w = Object.entries(p); h < w.length; h++) {
1684
- var D = ae(w[h], 2), M = D[0], k = D[1];
1685
- n.dataTransfer.setData(M, k ?? "");
1681
+ var D = (o = (d = y.getInitialDataForExternal) === null || d === void 0 ? void 0 : d.call(y, v)) !== null && o !== void 0 ? o : null;
1682
+ if (D)
1683
+ for (var m = 0, b = Object.entries(D); m < b.length; m++) {
1684
+ var w = ae(b[m], 2), M = w[0], x = w[1];
1685
+ n.dataTransfer.setData(M, x ?? "");
1686
1686
  }
1687
- jr() && !n.dataTransfer.types.includes(Xt) && !n.dataTransfer.types.includes(Rr) && n.dataTransfer.setData(Xt, Fr), n.dataTransfer.setData(Hr, "");
1688
- var m = {
1687
+ jr() && !n.dataTransfer.types.includes(Xt) && !n.dataTransfer.types.includes(Fr) && n.dataTransfer.setData(Xt, Hr), n.dataTransfer.setData(Rr, "");
1688
+ var g = {
1689
1689
  element: y.element,
1690
1690
  dragHandle: (i = y.dragHandle) !== null && i !== void 0 ? i : null,
1691
1691
  data: (s = (l = y.getInitialData) === null || l === void 0 ? void 0 : l.call(y, v)) !== null && s !== void 0 ? s : {}
1692
- }, x = {
1692
+ }, k = {
1693
1693
  type: "element",
1694
- payload: m,
1694
+ payload: g,
1695
1695
  startedFrom: "internal"
1696
1696
  };
1697
1697
  e.start({
1698
1698
  event: n,
1699
- dragType: x
1699
+ dragType: k
1700
1700
  });
1701
1701
  }
1702
1702
  }
@@ -1886,15 +1886,15 @@ function Wr(t, e, r, n) {
1886
1886
  return Math.round(i / n) * n;
1887
1887
  }
1888
1888
  function Ot(t, e) {
1889
- return g.diff(t, e, "minute");
1889
+ return f.diff(t, e, "minute");
1890
1890
  }
1891
1891
  function Gr(t, e, r) {
1892
- const n = g.add(g.startOf(t, "day"), { minutes: e });
1892
+ const n = f.add(f.startOf(t, "day"), { minutes: e });
1893
1893
  if (Ot(n, r.start) === 0) return null;
1894
1894
  const a = r.end ? Ot(r.start, r.end) : 0;
1895
1895
  return {
1896
1896
  start: n,
1897
- end: r.end ? g.add(n, { minutes: a }) : null
1897
+ end: r.end ? f.add(n, { minutes: a }) : null
1898
1898
  };
1899
1899
  }
1900
1900
  function Ur({
@@ -1943,18 +1943,18 @@ function Ur({
1943
1943
  if (!y) return;
1944
1944
  const T = Gr(y, l.inicio, c);
1945
1945
  if (T && t.moveEvent(c.id, T.start, T.end)) {
1946
- const f = t.getEventById(c.id);
1947
- f && t.trigger("eventDrop", { event: f });
1946
+ const p = t.getEventById(c.id);
1947
+ p && t.trigger("eventDrop", { event: p });
1948
1948
  }
1949
1949
  }
1950
1950
  });
1951
1951
  }
1952
1952
  const be = "rsv-timegrid-event", we = "rsv-daygrid-day";
1953
1953
  function zr(t, e) {
1954
- const r = g.diff(g.startOf(e.start, "day"), g.startOf(t, "day"), "day");
1954
+ const r = f.diff(f.startOf(e.start, "day"), f.startOf(t, "day"), "day");
1955
1955
  return r === 0 ? null : {
1956
- start: g.add(e.start, { days: r }),
1957
- end: e.end ? g.add(e.end, { days: r }) : null
1956
+ start: f.add(e.start, { days: r }),
1957
+ end: e.end ? f.add(e.end, { days: r }) : null
1958
1958
  };
1959
1959
  }
1960
1960
  function qr(t) {
@@ -1990,7 +1990,7 @@ function Xr({
1990
1990
  if (!d) return;
1991
1991
  const i = t.getEventById(String(a.data.id));
1992
1992
  if (!i) return;
1993
- const s = zr(g.from(String(d.data.fechaISO)), i);
1993
+ const s = zr(f.from(String(d.data.fechaISO)), i);
1994
1994
  if (s && t.moveEvent(i.id, s.start, s.end)) {
1995
1995
  const l = t.getEventById(i.id);
1996
1996
  l && t.trigger("eventDrop", { event: l });
@@ -1999,34 +1999,35 @@ function Xr({
1999
1999
  });
2000
2000
  }
2001
2001
  function De({ api: t, model: e, options: r }) {
2002
- var v;
2003
- const n = r.locale ?? "en", a = { type: t.getView().type }, o = dt(n, r.dayHeaderFormat, { weekday: "short" }), d = ((v = e.weeks[0]) == null ? void 0 : v.days) ?? [], i = r.weekNumbers === !0, [s, l] = V(null), [c, y] = V(null), T = F(/* @__PURE__ */ new Map());
2004
- return H(
2005
- () => Xr({ api: t, onPreview: l, onDragging: y }),
2002
+ var D;
2003
+ const n = r.locale ?? "en", a = { type: t.getView().type }, o = dt(n, r.dayHeaderFormat, { weekday: "short" }), d = ((D = e.weeks[0]) == null ? void 0 : D.days) ?? [], i = r.weekNumbers === !0, s = r.dayHeaders !== !1, l = r.dayNumberAlign ?? "end", [c, y] = V(null), [T, v] = V(null), p = F(/* @__PURE__ */ new Map());
2004
+ return R(
2005
+ () => Xr({ api: t, onPreview: y, onDragging: v }),
2006
2006
  [t]
2007
- ), H(() => {
2008
- const f = T.current;
2007
+ ), R(() => {
2008
+ const m = p.current;
2009
2009
  return () => {
2010
- for (const p of f.values()) p();
2011
- f.clear();
2010
+ for (const b of m.values()) b();
2011
+ m.clear();
2012
2012
  };
2013
2013
  }, []), /* @__PURE__ */ C(
2014
2014
  "div",
2015
2015
  {
2016
2016
  "data-rsv": "daygrid",
2017
2017
  "data-weeknumbers": String(i),
2018
+ "data-daynumber-align": l,
2018
2019
  style: `--rsv-cols:${e.columnCount}`,
2019
2020
  children: [
2020
- /* @__PURE__ */ C("div", { "data-rsv": "daygrid-header", role: "row", children: [
2021
+ s && /* @__PURE__ */ C("div", { "data-rsv": "daygrid-header", role: "row", children: [
2021
2022
  i && /* @__PURE__ */ u("div", { "data-rsv": "daygrid-weeknum-header", role: "columnheader" }),
2022
- d.map((f) => {
2023
- var D, M;
2024
- const p = g.toDate(f.date), h = o ? o(p) : "", w = {
2025
- date: p,
2026
- text: h,
2027
- dayOfWeek: f.dayOfWeek,
2028
- dayNumber: g.dayOfMonth(f.date),
2029
- isToday: f.isToday,
2023
+ d.map((m) => {
2024
+ var x, g;
2025
+ const b = f.toDate(m.date), w = o ? o(b) : "", M = {
2026
+ date: b,
2027
+ text: w,
2028
+ dayOfWeek: m.dayOfWeek,
2029
+ dayNumber: f.dayOfMonth(m.date),
2030
+ isToday: m.isToday,
2030
2031
  view: a
2031
2032
  };
2032
2033
  return /* @__PURE__ */ u(
@@ -2034,34 +2035,34 @@ function De({ api: t, model: e, options: r }) {
2034
2035
  {
2035
2036
  "data-rsv": "daygrid-dow",
2036
2037
  role: "columnheader",
2037
- "data-dow": String(f.dayOfWeek),
2038
- class: K((D = r.classNames) == null ? void 0 : D.dayHeader),
2038
+ "data-dow": String(m.dayOfWeek),
2039
+ class: K((x = r.classNames) == null ? void 0 : x.dayHeader),
2039
2040
  ref: (k) => {
2040
- var m;
2041
- return U(k, (m = r.hooks) == null ? void 0 : m.dayHeaderDidMount, () => w);
2041
+ var j;
2042
+ return U(k, (j = r.hooks) == null ? void 0 : j.dayHeaderDidMount, () => M);
2042
2043
  },
2043
- children: B((M = r.slots) == null ? void 0 : M.dayHeaderContent, w, h, r.hostBridge)
2044
+ children: B((g = r.slots) == null ? void 0 : g.dayHeaderContent, M, w, r.hostBridge)
2044
2045
  },
2045
- f.dayOfWeek
2046
+ m.dayOfWeek
2046
2047
  );
2047
2048
  })
2048
2049
  ] }),
2049
- e.weeks.map((f, p) => /* @__PURE__ */ C("div", { "data-rsv": "daygrid-week", role: "row", children: [
2050
- i && /* @__PURE__ */ u("div", { "data-rsv": "daygrid-weeknum", role: "rowheader", children: f.weekNumber }),
2051
- f.days.map((h) => /* @__PURE__ */ u(
2050
+ e.weeks.map((m, b) => /* @__PURE__ */ C("div", { "data-rsv": "daygrid-week", role: "row", children: [
2051
+ i && /* @__PURE__ */ u("div", { "data-rsv": "daygrid-weeknum", role: "rowheader", children: m.weekNumber }),
2052
+ m.days.map((w) => /* @__PURE__ */ u(
2052
2053
  _r,
2053
2054
  {
2054
2055
  api: t,
2055
- cell: h,
2056
+ cell: w,
2056
2057
  options: r,
2057
2058
  view: a,
2058
- dropActivo: s === g.toISOString(h.date),
2059
- limpiezaDias: T,
2060
- idArrastrado: c
2059
+ dropActivo: c === f.toISOString(w.date),
2060
+ limpiezaDias: p,
2061
+ idArrastrado: T
2061
2062
  },
2062
- g.toISOString(h.date)
2063
+ f.toISOString(w.date)
2063
2064
  ))
2064
- ] }, p))
2065
+ ] }, b))
2065
2066
  ]
2066
2067
  }
2067
2068
  );
@@ -2075,8 +2076,8 @@ function _r({
2075
2076
  limpiezaDias: o,
2076
2077
  idArrastrado: d
2077
2078
  }) {
2078
- var D, M, k;
2079
- const i = g.toDate(e.date), s = g.dayOfMonth(e.date), l = r.navLinks ? /* @__PURE__ */ u(
2079
+ var w, M, x;
2080
+ const i = f.toDate(e.date), s = f.dayOfMonth(e.date), l = r.navLinks ? /* @__PURE__ */ u(
2080
2081
  "a",
2081
2082
  {
2082
2083
  "data-rsv": "day-number",
@@ -2086,24 +2087,24 @@ function _r({
2086
2087
  title: W(r.locale).navLinkHint(
2087
2088
  new Intl.DateTimeFormat(r.locale, { dateStyle: "long" }).format(i)
2088
2089
  ),
2089
- onClick: (m) => {
2090
- m.stopPropagation(), ee(t, e.date);
2090
+ onClick: (g) => {
2091
+ g.stopPropagation(), ee(t, e.date);
2091
2092
  },
2092
2093
  children: s
2093
2094
  }
2094
2095
  ) : /* @__PURE__ */ u("span", { "data-rsv": "day-number", children: s }), c = { date: i, dayNumber: s, isToday: e.isToday, isOther: e.isOther, view: n }, y = B(
2095
- (D = r.slots) == null ? void 0 : D.dayCellContent,
2096
+ (w = r.slots) == null ? void 0 : w.dayCellContent,
2096
2097
  c,
2097
2098
  l,
2098
2099
  r.hostBridge
2099
- ), [T, v] = V(!1), f = g.toISOString(e.date), p = F(!1), h = () => {
2100
- if (p.current) {
2101
- p.current = !1;
2100
+ ), [T, v] = V(!1), p = f.toISOString(e.date), D = F(!1), m = () => {
2101
+ if (D.current) {
2102
+ D.current = !1;
2102
2103
  return;
2103
2104
  }
2104
- r.selectConstraint === "businessHours" && !e.isBusiness || (t.trigger("dateClick", { date: e.date }), r.selectable && t.select(f, g.toISOString(g.add(e.date, { days: 1 }))));
2105
- }, w = (m) => {
2106
- m.stopPropagation(), v(!0), t.trigger("moreLinkClick", {
2105
+ r.selectConstraint === "businessHours" && !e.isBusiness || (t.trigger("dateClick", { date: e.date }), r.selectable && t.select(p, f.toISOString(f.add(e.date, { days: 1 }))));
2106
+ }, b = (g) => {
2107
+ g.stopPropagation(), r.moreLinkPopover !== !1 && v(!0), t.trigger("moreLinkClick", {
2107
2108
  date: e.date,
2108
2109
  allEvents: [...e.events, ...e.hiddenEvents],
2109
2110
  hiddenEvents: e.hiddenEvents
@@ -2114,7 +2115,7 @@ function _r({
2114
2115
  {
2115
2116
  "data-rsv": "day",
2116
2117
  role: "gridcell",
2117
- "data-date": f,
2118
+ "data-date": p,
2118
2119
  "data-rsv-drop": a ? "true" : void 0,
2119
2120
  "data-today": String(e.isToday),
2120
2121
  "data-other": String(e.isOther),
@@ -2122,34 +2123,34 @@ function _r({
2122
2123
  "data-business": String(e.isBusiness),
2123
2124
  "data-selected": String(e.isSelected),
2124
2125
  class: K((M = r.classNames) == null ? void 0 : M.day),
2125
- ref: (m) => {
2126
- var x;
2127
- U(m, (x = r.hooks) == null ? void 0 : x.dayCellDidMount, () => c), !(!m || o.current.has(m)) && o.current.set(m, qr(m));
2126
+ ref: (g) => {
2127
+ var k;
2128
+ U(g, (k = r.hooks) == null ? void 0 : k.dayCellDidMount, () => c), !(!g || o.current.has(g)) && o.current.set(g, qr(g));
2128
2129
  },
2129
- onClick: h,
2130
- onPointerDown: r.selectable ? (m) => Xe(m, {
2130
+ onClick: m,
2131
+ onPointerDown: r.selectable ? (g) => Xe(g, {
2131
2132
  api: t,
2132
- startDate: f,
2133
+ startDate: p,
2133
2134
  onRangeSelect: () => {
2134
- p.current = !0;
2135
+ D.current = !0;
2135
2136
  }
2136
2137
  }) : void 0,
2137
2138
  children: [
2138
2139
  y,
2139
- e.events.filter((m) => m.display !== "none").map((m) => /* @__PURE__ */ u(
2140
+ e.events.filter((g) => g.display !== "none").map((g) => /* @__PURE__ */ u(
2140
2141
  Se,
2141
2142
  {
2142
2143
  api: t,
2143
- event: m,
2144
+ event: g,
2144
2145
  options: r,
2145
2146
  view: n,
2146
- arrastrandose: d === m.id
2147
+ arrastrandose: d === g.id
2147
2148
  },
2148
- m.id
2149
+ g.id
2149
2150
  )),
2150
2151
  e.moreCount > 0 && /* @__PURE__ */ C("div", { "data-rsv": "more-anchor", children: [
2151
- /* @__PURE__ */ u("button", { type: "button", "data-rsv": "more-link", onClick: w, children: B(
2152
- (k = r.slots) == null ? void 0 : k.moreLinkContent,
2152
+ /* @__PURE__ */ u("button", { type: "button", "data-rsv": "more-link", onClick: b, children: B(
2153
+ (x = r.slots) == null ? void 0 : x.moreLinkContent,
2153
2154
  {
2154
2155
  date: i,
2155
2156
  moreCount: e.moreCount,
@@ -2187,7 +2188,7 @@ function Zr({
2187
2188
  day: "numeric",
2188
2189
  month: "long"
2189
2190
  }), i = [...e.events, ...e.hiddenEvents].filter((s) => s.display !== "none");
2190
- return H(() => {
2191
+ return R(() => {
2191
2192
  const s = (c) => {
2192
2193
  o.current && !o.current.contains(c.target) && a();
2193
2194
  }, l = (c) => {
@@ -2198,7 +2199,7 @@ function Zr({
2198
2199
  };
2199
2200
  }, [a]), /* @__PURE__ */ C("div", { "data-rsv": "more-popover", role: "dialog", ref: o, onClick: (s) => s.stopPropagation(), children: [
2200
2201
  /* @__PURE__ */ C("div", { "data-rsv": "more-popover-header", children: [
2201
- /* @__PURE__ */ u("span", { "data-rsv": "more-popover-title", children: d.format(g.toDate(e.date)) }),
2202
+ /* @__PURE__ */ u("span", { "data-rsv": "more-popover-title", children: d.format(f.toDate(e.date)) }),
2202
2203
  /* @__PURE__ */ u("button", { type: "button", "data-rsv": "more-popover-close", "aria-label": "✕", onClick: a, children: "✕" })
2203
2204
  ] }),
2204
2205
  /* @__PURE__ */ u("div", { "data-rsv": "more-popover-body", children: i.map((s) => /* @__PURE__ */ u(
@@ -2221,14 +2222,14 @@ function Se({
2221
2222
  view: n,
2222
2223
  arrastrandose: a
2223
2224
  }) {
2224
- var p, h;
2225
+ var D, m;
2225
2226
  const o = r.editable === !0 && e.editable !== !1, d = o && r.eventDraggable === !0, i = F(null), s = F(null);
2226
- H(() => () => {
2227
- var w;
2228
- return (w = i.current) == null ? void 0 : w.call(i);
2227
+ R(() => () => {
2228
+ var b;
2229
+ return (b = i.current) == null ? void 0 : b.call(i);
2229
2230
  }, []);
2230
- const l = t.selectedEventIds.value.has(e.id), c = F(!1), y = ct(r.locale ?? "en", r.eventTimeFormat), T = e.allDay ? "" : y ? y(g.toDate(e.start)) : g.format(e.start, "HH:mm"), v = { event: e, isAllDay: e.allDay, timeText: T, view: n }, f = B(
2231
- (p = r.slots) == null ? void 0 : p.eventContent,
2231
+ const l = t.selectedEventIds.value.has(e.id), c = F(!1), y = ct(r.locale ?? "en", r.eventTimeFormat), T = e.allDay ? "" : y ? y(f.toDate(e.start)) : f.format(e.start, "HH:mm"), v = { event: e, isAllDay: e.allDay, timeText: T, view: n }, p = B(
2232
+ (D = r.slots) == null ? void 0 : D.eventContent,
2232
2233
  v,
2233
2234
  /* @__PURE__ */ C("span", { "data-rsv": "event-title", children: [
2234
2235
  T ? `${T} ` : "",
@@ -2242,36 +2243,36 @@ function Se({
2242
2243
  "data-rsv": "event",
2243
2244
  role: "button",
2244
2245
  tabIndex: 0,
2245
- class: K((h = r.classNames) == null ? void 0 : h.event, ...e.classNames),
2246
+ class: K((m = r.classNames) == null ? void 0 : m.event, ...e.classNames),
2246
2247
  "data-all-day": String(e.allDay),
2247
2248
  "data-display": e.display,
2248
2249
  "data-event-id": e.id,
2249
2250
  "data-editable": String(o),
2250
2251
  "data-rsv-selected": String(l),
2251
2252
  "data-rsv-dragging": a ? "true" : void 0,
2252
- ref: (w) => {
2253
- var D, M;
2254
- U(w, (D = r.hooks) == null ? void 0 : D.eventDidMount, () => v), w !== s.current && ((M = i.current) == null || M.call(i), s.current = w, i.current = w ? he(w, e, d) : null);
2253
+ ref: (b) => {
2254
+ var w, M;
2255
+ U(b, (w = r.hooks) == null ? void 0 : w.eventDidMount, () => v), b !== s.current && ((M = i.current) == null || M.call(i), s.current = b, i.current = b ? he(b, e, d) : null);
2255
2256
  },
2256
2257
  style: `--rsv-event-bg:${e.backgroundColor};--rsv-event-fg:${e.textColor};--rsv-event-border:${e.borderColor}`,
2257
- onClick: (w) => {
2258
- if (w.stopPropagation(), c.current) {
2258
+ onClick: (b) => {
2259
+ if (b.stopPropagation(), c.current) {
2259
2260
  c.current = !1;
2260
2261
  return;
2261
2262
  }
2262
- if (w.ctrlKey || w.metaKey) {
2263
+ if (b.ctrlKey || b.metaKey) {
2263
2264
  t.toggleEventSelection(e.id);
2264
2265
  return;
2265
2266
  }
2266
- t.trigger("eventClick", { event: e, el: w.currentTarget }), e.url && window.open(e.url, "_self");
2267
+ t.trigger("eventClick", { event: e, el: b.currentTarget }), e.url && window.open(e.url, "_self");
2267
2268
  },
2268
- onKeyDown: o ? (w) => re(w, {
2269
+ onKeyDown: o ? (b) => re(b, {
2269
2270
  api: t,
2270
2271
  event: e,
2271
2272
  kind: "dayGrid",
2272
2273
  shortcuts: r.keyboardShortcuts
2273
2274
  }) : void 0,
2274
- children: f
2275
+ children: p
2275
2276
  }
2276
2277
  );
2277
2278
  }
@@ -2311,111 +2312,111 @@ function te(t, e) {
2311
2312
  t.preventDefault(), t.stopPropagation();
2312
2313
  const { api: r, event: n, model: a, columnEl: o, snap: d = "00:15", edge: i, onPreview: s } = e, l = o.getBoundingClientRect(), c = a.maxMinutes - a.minMinutes, y = l.height === 0 ? 0 : l.height / c, T = t.clientY, v = Oe(Te(o));
2313
2314
  v.update(t.clientY);
2314
- const f = X(d) || 15, p = (D) => {
2315
- const M = g.toDate(D);
2315
+ const p = X(d) || 15, D = (w) => {
2316
+ const M = f.toDate(w);
2316
2317
  return M.getHours() * 60 + M.getMinutes();
2317
- }, h = (D) => {
2318
- if (v.update(D.clientY), !s) return;
2319
- const M = It(D.clientY - T + v.getScrolled(), y, d), k = i ? $t(n.start, n.end, i, M, g) : ht(n.start, n.end, M, g), m = p(k.start), x = k.end ? p(k.end) : m + f;
2320
- s({ startMin: Math.min(m, x), endMin: Math.max(m, x) });
2321
- }, w = (D) => {
2322
- document.removeEventListener("pointermove", h), document.removeEventListener("pointerup", w), v.stop(), s == null || s(null);
2323
- const M = It(D.clientY - T + v.getScrolled(), y, d);
2318
+ }, m = (w) => {
2319
+ if (v.update(w.clientY), !s) return;
2320
+ const M = It(w.clientY - T + v.getScrolled(), y, d), x = i ? $t(n.start, n.end, i, M, f) : ht(n.start, n.end, M, f), g = D(x.start), k = x.end ? D(x.end) : g + p;
2321
+ s({ startMin: Math.min(g, k), endMin: Math.max(g, k) });
2322
+ }, b = (w) => {
2323
+ document.removeEventListener("pointermove", m), document.removeEventListener("pointerup", b), v.stop(), s == null || s(null);
2324
+ const M = It(w.clientY - T + v.getScrolled(), y, d);
2324
2325
  if (M === 0) return;
2325
- const k = i ? $t(n.start, n.end, i, M, g) : ht(n.start, n.end, M, g);
2326
- if (r.moveEvent(n.id, k.start, k.end)) {
2327
- const m = r.getEventById(n.id);
2328
- m && r.trigger(i ? "eventResize" : "eventDrop", { event: m });
2326
+ const x = i ? $t(n.start, n.end, i, M, f) : ht(n.start, n.end, M, f);
2327
+ if (r.moveEvent(n.id, x.start, x.end)) {
2328
+ const g = r.getEventById(n.id);
2329
+ g && r.trigger(i ? "eventResize" : "eventDrop", { event: g });
2329
2330
  }
2330
2331
  };
2331
- document.addEventListener("pointermove", h), document.addEventListener("pointerup", w);
2332
+ document.addEventListener("pointermove", m), document.addEventListener("pointerup", b);
2332
2333
  }
2333
2334
  function Qr(t, e) {
2334
2335
  if (t.target.closest('[data-rsv="event"]')) return;
2335
- const { api: r, date: n, model: a, columnEl: o, snap: d = "00:15" } = e, i = a.maxMinutes - a.minMinutes, s = X(d) || 15, l = (h) => {
2336
- const w = o.getBoundingClientRect(), D = w.height === 0 ? 0 : w.height / i, M = a.minMinutes + (D === 0 ? 0 : (h - w.top) / D), k = Math.max(a.minMinutes, Math.min(a.maxMinutes, M));
2337
- return Math.round(k / s) * s;
2336
+ const { api: r, date: n, model: a, columnEl: o, snap: d = "00:15" } = e, i = a.maxMinutes - a.minMinutes, s = X(d) || 15, l = (m) => {
2337
+ const b = o.getBoundingClientRect(), w = b.height === 0 ? 0 : b.height / i, M = a.minMinutes + (w === 0 ? 0 : (m - b.top) / w), x = Math.max(a.minMinutes, Math.min(a.maxMinutes, M));
2338
+ return Math.round(x / s) * s;
2338
2339
  }, c = l(t.clientY);
2339
2340
  let y = c, T = !1;
2340
2341
  const v = Oe(Te(o));
2341
2342
  v.update(t.clientY);
2342
- const f = (h) => {
2343
- var D;
2344
- v.update(h.clientY);
2345
- const w = l(h.clientY);
2346
- w !== c && (T = !0), y = w, T && ((D = e.onPreview) == null || D.call(e, {
2343
+ const p = (m) => {
2344
+ var w;
2345
+ v.update(m.clientY);
2346
+ const b = l(m.clientY);
2347
+ b !== c && (T = !0), y = b, T && ((w = e.onPreview) == null || w.call(e, {
2347
2348
  startMin: Math.min(c, y),
2348
2349
  endMin: Math.max(c, y)
2349
2350
  }));
2350
- }, p = () => {
2351
+ }, D = () => {
2351
2352
  var M;
2352
- if (document.removeEventListener("pointermove", f), document.removeEventListener("pointerup", p), v.stop(), (M = e.onPreview) == null || M.call(e, null), !T) return;
2353
- const h = Math.min(c, y), w = Math.max(c, y), D = g.startOf(n, "day");
2353
+ if (document.removeEventListener("pointermove", p), document.removeEventListener("pointerup", D), v.stop(), (M = e.onPreview) == null || M.call(e, null), !T) return;
2354
+ const m = Math.min(c, y), b = Math.max(c, y), w = f.startOf(n, "day");
2354
2355
  r.select(
2355
- g.toISOString(g.add(D, { minutes: h })),
2356
- g.toISOString(g.add(D, { minutes: w }))
2356
+ f.toISOString(f.add(w, { minutes: m })),
2357
+ f.toISOString(f.add(w, { minutes: b }))
2357
2358
  );
2358
2359
  };
2359
- document.addEventListener("pointermove", f), document.addEventListener("pointerup", p);
2360
+ document.addEventListener("pointermove", p), document.addEventListener("pointerup", D);
2360
2361
  }
2361
2362
  function tn({ api: t, model: e, options: r }) {
2362
2363
  const n = r.locale ?? "en", a = { type: t.getView().type }, o = dt(n, r.dayHeaderFormat, {
2363
2364
  weekday: "short",
2364
2365
  day: "numeric"
2365
- }), d = ct(n, r.slotLabelFormat), i = r.allDaySlot !== !1, s = `calc(var(--spacing-rsv-slot, 2.5rem) * ${e.slots.length})`, l = e.maxMinutes - e.minMinutes, c = X(r.snapDuration ?? r.slotDuration ?? "00:15") || 15, y = xe(r.businessHours), T = r.selectConstraint === "businessHours" && y !== null, v = (b, E) => {
2366
+ }), d = ct(n, r.slotLabelFormat), i = r.allDaySlot !== !1, s = `calc(var(--spacing-rsv-slot, 2.5rem) * ${e.slots.length})`, l = e.maxMinutes - e.minMinutes, c = X(r.snapDuration ?? r.slotDuration ?? "00:15") || 15, y = xe(r.businessHours), T = r.selectConstraint === "businessHours" && y !== null, v = (h, E) => {
2366
2367
  if (!T) return !0;
2367
- const P = g.add(g.startOf(b, "day"), { minutes: E });
2368
- return Pe(P, null, y, g);
2369
- }, f = F(null), p = F(e);
2370
- p.current = e;
2371
- const [h, w] = V(null), [D, M] = V(null), k = F(null), m = F(/* @__PURE__ */ new Map());
2372
- H(() => {
2373
- const b = m.current;
2368
+ const P = f.add(f.startOf(h, "day"), { minutes: E });
2369
+ return Pe(P, null, y, f);
2370
+ }, p = F(null), D = F(e);
2371
+ D.current = e;
2372
+ const [m, b] = V(null), [w, M] = V(null), x = F(null), g = F(/* @__PURE__ */ new Map());
2373
+ R(() => {
2374
+ const h = g.current;
2374
2375
  return () => {
2375
- for (const E of b.values()) E();
2376
- b.clear();
2376
+ for (const E of h.values()) E();
2377
+ h.clear();
2377
2378
  };
2378
- }, []), H(
2379
+ }, []), R(
2379
2380
  () => Ur({
2380
2381
  api: t,
2381
- getModel: () => p.current,
2382
+ getModel: () => D.current,
2382
2383
  snap: r.snapDuration ?? r.slotDuration,
2383
- onPreview: (b) => M(b ? { id: k.current ?? "", preview: b } : null),
2384
- onDragging: (b) => {
2385
- k.current = b, b === null && M(null);
2384
+ onPreview: (h) => M(h ? { id: x.current ?? "", preview: h } : null),
2385
+ onDragging: (h) => {
2386
+ x.current = h, h === null && M(null);
2386
2387
  }
2387
2388
  }),
2388
2389
  [t, r.snapDuration, r.slotDuration]
2389
- ), H(() => {
2390
- const b = f.current;
2391
- if (!b) return;
2390
+ ), R(() => {
2391
+ const h = p.current;
2392
+ if (!h) return;
2392
2393
  const E = {
2393
2394
  scrollToTime(P) {
2394
- const O = p.current, A = O.maxMinutes - O.minMinutes, j = b.scrollHeight;
2395
- if (A <= 0 || j <= 0) return;
2396
- const S = (Math.max(O.minMinutes, Math.min(O.maxMinutes, X(P))) - O.minMinutes) / A * j;
2397
- b.scrollTop = Math.max(0, Math.min(S, j - b.clientHeight));
2395
+ const O = D.current, A = O.maxMinutes - O.minMinutes, H = h.scrollHeight;
2396
+ if (A <= 0 || H <= 0) return;
2397
+ const S = (Math.max(O.minMinutes, Math.min(O.maxMinutes, X(P))) - O.minMinutes) / A * H;
2398
+ h.scrollTop = Math.max(0, Math.min(S, H - h.clientHeight));
2398
2399
  },
2399
2400
  getScrollTime() {
2400
- const P = p.current, O = P.maxMinutes - P.minMinutes, A = b.scrollHeight;
2401
- return O <= 0 || A <= 0 ? null : Ge(P.minMinutes + b.scrollTop / A * O);
2401
+ const P = D.current, O = P.maxMinutes - P.minMinutes, A = h.scrollHeight;
2402
+ return O <= 0 || A <= 0 ? null : Ge(P.minMinutes + h.scrollTop / A * O);
2402
2403
  }
2403
2404
  };
2404
2405
  return t.setViewAdapter(E), () => t.setViewAdapter(null);
2405
2406
  }, [t]);
2406
- const x = r.scrollTime;
2407
- H(() => {
2408
- if (!x) return;
2409
- let b = 0;
2407
+ const k = r.scrollTime;
2408
+ R(() => {
2409
+ if (!k) return;
2410
+ let h = 0;
2410
2411
  const E = requestAnimationFrame(() => {
2411
- b = requestAnimationFrame(() => t.scrollToTime(x));
2412
+ h = requestAnimationFrame(() => t.scrollToTime(k));
2412
2413
  });
2413
2414
  return () => {
2414
- cancelAnimationFrame(E), cancelAnimationFrame(b);
2415
+ cancelAnimationFrame(E), cancelAnimationFrame(h);
2415
2416
  };
2416
2417
  }, [t]);
2417
- const R = (b, E) => {
2418
- const P = b.getBoundingClientRect();
2418
+ const j = (h, E) => {
2419
+ const P = h.getBoundingClientRect();
2419
2420
  if (P.height === 0 || l <= 0) return e.minMinutes;
2420
2421
  const O = (E - P.top) / P.height * l, A = Math.floor(Math.max(0, Math.min(l, O)) / c) * c;
2421
2422
  return e.minMinutes + A;
@@ -2423,14 +2424,14 @@ function tn({ api: t, model: e, options: r }) {
2423
2424
  return /* @__PURE__ */ C("div", { "data-rsv": "timegrid", style: `--rsv-tg-days:${e.days.length}`, children: [
2424
2425
  /* @__PURE__ */ C("div", { "data-rsv": "tg-header", role: "row", children: [
2425
2426
  /* @__PURE__ */ u("div", { "data-rsv": "tg-axis-corner" }),
2426
- e.days.map((b) => {
2427
- var A, j;
2428
- const E = g.toDate(b.date), P = o ? o(E) : "", O = {
2427
+ e.days.map((h) => {
2428
+ var A, H;
2429
+ const E = f.toDate(h.date), P = o ? o(E) : "", O = {
2429
2430
  date: E,
2430
2431
  text: P,
2431
- dayOfWeek: g.dayOfWeek(b.date),
2432
- dayNumber: g.dayOfMonth(b.date),
2433
- isToday: b.isToday,
2432
+ dayOfWeek: f.dayOfWeek(h.date),
2433
+ dayNumber: f.dayOfMonth(h.date),
2434
+ isToday: h.isToday,
2434
2435
  view: a
2435
2436
  };
2436
2437
  return /* @__PURE__ */ u(
@@ -2438,29 +2439,29 @@ function tn({ api: t, model: e, options: r }) {
2438
2439
  {
2439
2440
  "data-rsv": "tg-col-header",
2440
2441
  role: "columnheader",
2441
- "data-today": String(b.isToday),
2442
- "data-date": g.toISOString(b.date),
2442
+ "data-today": String(h.isToday),
2443
+ "data-date": f.toISOString(h.date),
2443
2444
  "data-nav-link": r.navLinks ? "true" : void 0,
2444
2445
  class: K((A = r.classNames) == null ? void 0 : A.dayHeader),
2445
2446
  ref: (L) => {
2446
2447
  var S;
2447
2448
  return U(L, (S = r.hooks) == null ? void 0 : S.dayHeaderDidMount, () => O);
2448
2449
  },
2449
- onClick: r.navLinks ? () => ee(t, b.date) : void 0,
2450
- children: B((j = r.slots) == null ? void 0 : j.dayHeaderContent, O, P, r.hostBridge)
2450
+ onClick: r.navLinks ? () => ee(t, h.date) : void 0,
2451
+ children: B((H = r.slots) == null ? void 0 : H.dayHeaderContent, O, P, r.hostBridge)
2451
2452
  },
2452
- g.toISOString(b.date)
2453
+ f.toISOString(h.date)
2453
2454
  );
2454
2455
  })
2455
2456
  ] }),
2456
2457
  i && /* @__PURE__ */ C("div", { "data-rsv": "tg-allday", role: "row", children: [
2457
2458
  /* @__PURE__ */ u("div", { "data-rsv": "tg-axis-label", children: W(r.locale).allDay }),
2458
- e.days.map((b) => /* @__PURE__ */ u(
2459
+ e.days.map((h) => /* @__PURE__ */ u(
2459
2460
  "div",
2460
2461
  {
2461
2462
  "data-rsv": "tg-allday-cell",
2462
- onClick: () => t.trigger("dateClick", { date: b.date, allDay: !0 }),
2463
- children: b.allDayEvents.filter((E) => E.display !== "none").map((E) => {
2463
+ onClick: () => t.trigger("dateClick", { date: h.date, allDay: !0 }),
2464
+ children: h.allDayEvents.filter((E) => E.display !== "none").map((E) => {
2464
2465
  var P, O;
2465
2466
  return /* @__PURE__ */ u(
2466
2467
  "div",
@@ -2485,17 +2486,17 @@ function tn({ api: t, model: e, options: r }) {
2485
2486
  );
2486
2487
  })
2487
2488
  },
2488
- g.toISOString(b.date)
2489
+ f.toISOString(h.date)
2489
2490
  ))
2490
2491
  ] }),
2491
- /* @__PURE__ */ C("div", { "data-rsv": "tg-body", ref: f, children: [
2492
- /* @__PURE__ */ u("div", { "data-rsv": "tg-axis", style: `height:${s}`, children: e.slots.map((b) => {
2493
- var A, j;
2494
- const E = e.minMinutes + b.offsetMin;
2492
+ /* @__PURE__ */ C("div", { "data-rsv": "tg-body", ref: p, children: [
2493
+ /* @__PURE__ */ u("div", { "data-rsv": "tg-axis", style: `height:${s}`, children: e.slots.map((h) => {
2494
+ var A, H;
2495
+ const E = e.minMinutes + h.offsetMin;
2495
2496
  let P = "";
2496
- b.isMajor && (P = d && $ ? d(g.toDate(g.add(g.startOf($.date, "day"), { minutes: E }))) : b.label || We(E));
2497
- const O = { text: P, minutes: E, isMajor: b.isMajor, view: a };
2498
- return /* @__PURE__ */ u("div", { "data-rsv": "tg-slot", "data-major": String(b.isMajor), children: /* @__PURE__ */ u(
2497
+ h.isMajor && (P = d && $ ? d(f.toDate(f.add(f.startOf($.date, "day"), { minutes: E }))) : h.label || We(E));
2498
+ const O = { text: P, minutes: E, isMajor: h.isMajor, view: a };
2499
+ return /* @__PURE__ */ u("div", { "data-rsv": "tg-slot", "data-major": String(h.isMajor), children: /* @__PURE__ */ u(
2499
2500
  "span",
2500
2501
  {
2501
2502
  "data-rsv": "tg-slot-label",
@@ -2504,47 +2505,47 @@ function tn({ api: t, model: e, options: r }) {
2504
2505
  var S;
2505
2506
  return U(L, (S = r.hooks) == null ? void 0 : S.slotLabelDidMount, () => O);
2506
2507
  },
2507
- children: B((j = r.slots) == null ? void 0 : j.slotLabelContent, O, P, r.hostBridge)
2508
+ children: B((H = r.slots) == null ? void 0 : H.slotLabelContent, O, P, r.hostBridge)
2508
2509
  }
2509
- ) }, b.offsetMin);
2510
+ ) }, h.offsetMin);
2510
2511
  }) }),
2511
- e.days.map((b, E) => {
2512
+ e.days.map((h, E) => {
2512
2513
  var P;
2513
2514
  return /* @__PURE__ */ C(
2514
2515
  "div",
2515
2516
  {
2516
2517
  "data-rsv": "tg-col",
2517
- "data-today": String(b.isToday),
2518
- "data-business": String(b.isBusiness),
2519
- "data-date": g.toISOString(b.date),
2518
+ "data-today": String(h.isToday),
2519
+ "data-business": String(h.isBusiness),
2520
+ "data-date": f.toISOString(h.date),
2520
2521
  "data-rsv-day-index": String(E),
2521
2522
  ref: (O) => {
2522
- !O || m.current.has(O) || m.current.set(O, Vr(O));
2523
+ !O || g.current.has(O) || g.current.set(O, Vr(O));
2523
2524
  },
2524
2525
  style: `height:${s}`,
2525
2526
  onClick: (O) => {
2526
2527
  if (ye()) return;
2527
- const A = R(O.currentTarget, O.clientY);
2528
- v(b.date, A) && t.trigger("dateClick", {
2529
- date: g.add(g.startOf(b.date, "day"), { minutes: A }),
2528
+ const A = j(O.currentTarget, O.clientY);
2529
+ v(h.date, A) && t.trigger("dateClick", {
2530
+ date: f.add(f.startOf(h.date, "day"), { minutes: A }),
2530
2531
  allDay: !1
2531
2532
  });
2532
2533
  },
2533
2534
  onPointerDown: r.selectable ? (O) => {
2534
- const A = R(O.currentTarget, O.clientY);
2535
- v(b.date, A) && Qr(O, {
2535
+ const A = j(O.currentTarget, O.clientY);
2536
+ v(h.date, A) && Qr(O, {
2536
2537
  api: t,
2537
- date: b.date,
2538
+ date: h.date,
2538
2539
  model: e,
2539
2540
  columnEl: O.currentTarget,
2540
2541
  snap: r.snapDuration ?? r.slotDuration,
2541
- onPreview: r.selectMirror ? (j) => w(
2542
- j ? { dayIndex: E, startMin: j.startMin, endMin: j.endMin } : null
2542
+ onPreview: r.selectMirror ? (H) => b(
2543
+ H ? { dayIndex: E, startMin: H.startMin, endMin: H.endMin } : null
2543
2544
  ) : void 0
2544
2545
  });
2545
2546
  } : void 0,
2546
2547
  children: [
2547
- b.nonBusinessPct.map((O) => /* @__PURE__ */ u(
2548
+ h.nonBusinessPct.map((O) => /* @__PURE__ */ u(
2548
2549
  "div",
2549
2550
  {
2550
2551
  "data-rsv": "tg-nonbusiness",
@@ -2552,14 +2553,14 @@ function tn({ api: t, model: e, options: r }) {
2552
2553
  },
2553
2554
  O.topPct
2554
2555
  )),
2555
- (h == null ? void 0 : h.dayIndex) === E && l > 0 && /* @__PURE__ */ u(
2556
+ (m == null ? void 0 : m.dayIndex) === E && l > 0 && /* @__PURE__ */ u(
2556
2557
  "div",
2557
2558
  {
2558
2559
  "data-rsv": "select-mirror",
2559
- style: `top:${(h.startMin - e.minMinutes) / l * 100}%;height:${(h.endMin - h.startMin) / l * 100}%`
2560
+ style: `top:${(m.startMin - e.minMinutes) / l * 100}%;height:${(m.endMin - m.startMin) / l * 100}%`
2560
2561
  }
2561
2562
  ),
2562
- b.timedSegs.filter((O) => O.event.display !== "none").map((O) => /* @__PURE__ */ u(
2563
+ h.timedSegs.filter((O) => O.event.display !== "none").map((O) => /* @__PURE__ */ u(
2563
2564
  en,
2564
2565
  {
2565
2566
  api: t,
@@ -2567,22 +2568,22 @@ function tn({ api: t, model: e, options: r }) {
2567
2568
  model: e,
2568
2569
  options: r,
2569
2570
  view: a,
2570
- dragging: (D == null ? void 0 : D.id) === O.event.id,
2571
+ dragging: (w == null ? void 0 : w.id) === O.event.id,
2571
2572
  onDragPreview: (A) => M(A ? { id: O.event.id, preview: { dayIndex: E, ...A } } : null)
2572
2573
  },
2573
2574
  O.event.id
2574
2575
  )),
2575
- (D == null ? void 0 : D.preview.dayIndex) === E && l > 0 && /* @__PURE__ */ u(
2576
+ (w == null ? void 0 : w.preview.dayIndex) === E && l > 0 && /* @__PURE__ */ u(
2576
2577
  "div",
2577
2578
  {
2578
2579
  "data-rsv": "drag-mirror",
2579
- style: `top:${(D.preview.startMin - e.minMinutes) / l * 100}%;height:${(D.preview.endMin - D.preview.startMin) / l * 100}%`
2580
+ style: `top:${(w.preview.startMin - e.minMinutes) / l * 100}%;height:${(w.preview.endMin - w.preview.startMin) / l * 100}%`
2580
2581
  }
2581
2582
  ),
2582
2583
  ((P = e.nowIndicator) == null ? void 0 : P.dayIndex) === E && /* @__PURE__ */ u("div", { "data-rsv": "now-indicator", style: `top:${e.nowIndicator.topPct}%` })
2583
2584
  ]
2584
2585
  },
2585
- g.toISOString(b.date)
2586
+ f.toISOString(h.date)
2586
2587
  );
2587
2588
  })
2588
2589
  ] })
@@ -2597,22 +2598,22 @@ function en({
2597
2598
  dragging: o,
2598
2599
  onDragPreview: d
2599
2600
  }) {
2600
- var M, k;
2601
+ var M, x;
2601
2602
  const { event: i } = e, s = n.editable === !0 && i.editable !== !1, l = s && n.eventDraggable === !0, c = F(null), y = F(null);
2602
- H(() => () => {
2603
- var m;
2604
- return (m = c.current) == null ? void 0 : m.call(c);
2603
+ R(() => () => {
2604
+ var g;
2605
+ return (g = c.current) == null ? void 0 : g.call(c);
2605
2606
  }, []);
2606
- const T = t.selectedEventIds.value.has(i.id), v = 100 / e.colCount, f = ct(n.locale ?? "en", n.eventTimeFormat), p = f ? f(g.toDate(i.start)) : g.format(i.start, "HH:mm"), h = { event: i, isAllDay: !1, timeText: p, view: a }, w = B(
2607
+ const T = t.selectedEventIds.value.has(i.id), v = 100 / e.colCount, p = ct(n.locale ?? "en", n.eventTimeFormat), D = p ? p(f.toDate(i.start)) : f.format(i.start, "HH:mm"), m = { event: i, isAllDay: !1, timeText: D, view: a }, b = B(
2607
2608
  (M = n.slots) == null ? void 0 : M.eventContent,
2608
- h,
2609
+ m,
2609
2610
  /* @__PURE__ */ C("span", { "data-rsv": "event-title", children: [
2610
- p,
2611
+ D,
2611
2612
  " ",
2612
2613
  i.title
2613
2614
  ] }),
2614
2615
  n.hostBridge
2615
- ), D = (m) => m.closest('[data-rsv="tg-col"]') ?? m;
2616
+ ), w = (g) => g.closest('[data-rsv="tg-col"]') ?? g;
2616
2617
  return /* @__PURE__ */ C(
2617
2618
  "div",
2618
2619
  {
@@ -2622,24 +2623,24 @@ function en({
2622
2623
  "data-event-id": i.id,
2623
2624
  "data-rsv-selected": String(T),
2624
2625
  "data-rsv-dragging": o ? "true" : void 0,
2625
- class: K((k = n.classNames) == null ? void 0 : k.event, ...i.classNames),
2626
+ class: K((x = n.classNames) == null ? void 0 : x.event, ...i.classNames),
2626
2627
  role: "button",
2627
2628
  tabIndex: 0,
2628
- ref: (m) => {
2629
- var x, R;
2630
- U(m, (x = n.hooks) == null ? void 0 : x.eventDidMount, () => h), m !== y.current && ((R = c.current) == null || R.call(c), y.current = m, c.current = m ? he(m, i, l) : null);
2629
+ ref: (g) => {
2630
+ var k, j;
2631
+ U(g, (k = n.hooks) == null ? void 0 : k.eventDidMount, () => m), g !== y.current && ((j = c.current) == null || j.call(c), y.current = g, c.current = g ? he(g, i, l) : null);
2631
2632
  },
2632
2633
  style: `position:absolute;top:${e.topPct}%;height:${e.heightPct}%;left:${e.col * v}%;width:${v}%;--rsv-event-bg:${i.backgroundColor};--rsv-event-fg:${i.textColor};--rsv-event-border:${i.borderColor}`,
2633
- onClick: (m) => {
2634
- if (m.stopPropagation(), !ye()) {
2635
- if (m.ctrlKey || m.metaKey) {
2634
+ onClick: (g) => {
2635
+ if (g.stopPropagation(), !ye()) {
2636
+ if (g.ctrlKey || g.metaKey) {
2636
2637
  t.toggleEventSelection(i.id);
2637
2638
  return;
2638
2639
  }
2639
- t.trigger("eventClick", { event: i, el: m.currentTarget }), i.url && window.open(i.url, "_self");
2640
+ t.trigger("eventClick", { event: i, el: g.currentTarget }), i.url && window.open(i.url, "_self");
2640
2641
  }
2641
2642
  },
2642
- onKeyDown: s ? (m) => re(m, {
2643
+ onKeyDown: s ? (g) => re(g, {
2643
2644
  api: t,
2644
2645
  event: i,
2645
2646
  kind: "timeGrid",
@@ -2652,28 +2653,28 @@ function en({
2652
2653
  {
2653
2654
  "data-rsv": "resize-handle",
2654
2655
  "data-edge": "start",
2655
- onPointerDown: (m) => te(m, {
2656
+ onPointerDown: (g) => te(g, {
2656
2657
  api: t,
2657
2658
  event: i,
2658
2659
  model: r,
2659
- columnEl: D(m.currentTarget),
2660
+ columnEl: w(g.currentTarget),
2660
2661
  snap: n.snapDuration,
2661
2662
  onPreview: d,
2662
2663
  edge: "start"
2663
2664
  })
2664
2665
  }
2665
2666
  ),
2666
- w,
2667
+ b,
2667
2668
  s && /* @__PURE__ */ u(
2668
2669
  "span",
2669
2670
  {
2670
2671
  "data-rsv": "resize-handle",
2671
2672
  "data-edge": "end",
2672
- onPointerDown: (m) => te(m, {
2673
+ onPointerDown: (g) => te(g, {
2673
2674
  api: t,
2674
2675
  event: i,
2675
2676
  model: r,
2676
- columnEl: D(m.currentTarget),
2677
+ columnEl: w(g.currentTarget),
2677
2678
  snap: n.snapDuration,
2678
2679
  onPreview: d,
2679
2680
  edge: "end"
@@ -2692,12 +2693,12 @@ function rn({ api: t, model: e, options: r }) {
2692
2693
  }), i = r.listDaySideFormat ? dt(n, r.listDaySideFormat, { month: "short", day: "2-digit" }) : null, s = ct(n, r.eventTimeFormat);
2693
2694
  return e.isEmpty ? /* @__PURE__ */ u("div", { "data-rsv": "list", children: /* @__PURE__ */ u("div", { "data-rsv": "list-empty", children: o.noEvents }) }) : /* @__PURE__ */ u("div", { "data-rsv": "list", role: "list", children: e.days.map((l) => /* @__PURE__ */ C("div", { "data-rsv": "list-day", "data-today": String(l.isToday), children: [
2694
2695
  /* @__PURE__ */ C("div", { "data-rsv": "list-day-header", role: "heading", "aria-level": 3, children: [
2695
- /* @__PURE__ */ u("span", { "data-rsv": "list-day-text", children: d ? d(g.toDate(l.date)) : "" }),
2696
- i && /* @__PURE__ */ u("span", { "data-rsv": "list-day-side-text", children: i(g.toDate(l.date)) })
2696
+ /* @__PURE__ */ u("span", { "data-rsv": "list-day-text", children: d ? d(f.toDate(l.date)) : "" }),
2697
+ i && /* @__PURE__ */ u("span", { "data-rsv": "list-day-side-text", children: i(f.toDate(l.date)) })
2697
2698
  ] }),
2698
2699
  l.events.filter((c) => c.display !== "none").map((c) => {
2699
- var v, f;
2700
- const y = c.allDay ? o.allDay : s ? s(g.toDate(c.start)) : g.format(c.start, "HH:mm"), T = { event: c, isAllDay: c.allDay, timeText: y, view: a };
2700
+ var v, p;
2701
+ const y = c.allDay ? o.allDay : s ? s(f.toDate(c.start)) : f.format(c.start, "HH:mm"), T = { event: c, isAllDay: c.allDay, timeText: y, view: a };
2701
2702
  return /* @__PURE__ */ C(
2702
2703
  "div",
2703
2704
  {
@@ -2707,13 +2708,13 @@ function rn({ api: t, model: e, options: r }) {
2707
2708
  "data-event-id": c.id,
2708
2709
  class: K((v = r.classNames) == null ? void 0 : v.event, ...c.classNames),
2709
2710
  "data-display": c.display,
2710
- ref: (p) => {
2711
- var h;
2712
- return U(p, (h = r.hooks) == null ? void 0 : h.eventDidMount, () => T);
2711
+ ref: (D) => {
2712
+ var m;
2713
+ return U(D, (m = r.hooks) == null ? void 0 : m.eventDidMount, () => T);
2713
2714
  },
2714
2715
  style: `--rsv-event-bg:${c.backgroundColor};--rsv-event-fg:${c.textColor};--rsv-event-border:${c.borderColor}`,
2715
- onClick: (p) => {
2716
- t.trigger("eventClick", { event: c, el: p.currentTarget }), c.url && window.open(c.url, "_self");
2716
+ onClick: (D) => {
2717
+ t.trigger("eventClick", { event: c, el: D.currentTarget }), c.url && window.open(c.url, "_self");
2717
2718
  },
2718
2719
  children: [
2719
2720
  /* @__PURE__ */ u("span", { "data-rsv": "list-item-time", children: y }),
@@ -2725,7 +2726,7 @@ function rn({ api: t, model: e, options: r }) {
2725
2726
  }
2726
2727
  ),
2727
2728
  /* @__PURE__ */ u("div", { "data-rsv": "list-item-title", children: B(
2728
- (f = r.slots) == null ? void 0 : f.eventContent,
2729
+ (p = r.slots) == null ? void 0 : p.eventContent,
2729
2730
  T,
2730
2731
  c.title,
2731
2732
  r.hostBridge
@@ -2735,14 +2736,14 @@ function rn({ api: t, model: e, options: r }) {
2735
2736
  c.id
2736
2737
  );
2737
2738
  })
2738
- ] }, g.toISOString(l.date))) });
2739
+ ] }, f.toISOString(l.date))) });
2739
2740
  }
2740
2741
  function nn({ api: t, model: e, options: r }) {
2741
2742
  const n = r.locale ?? "en", a = new Intl.DateTimeFormat(n, { month: "long" });
2742
2743
  return /* @__PURE__ */ u("div", { "data-rsv": "multimonth", children: e.months.map((o) => /* @__PURE__ */ C("section", { "data-rsv": "mm-month", children: [
2743
- /* @__PURE__ */ u("header", { "data-rsv": "mm-title", children: a.format(g.toDate(o.date)) }),
2744
+ /* @__PURE__ */ u("header", { "data-rsv": "mm-title", children: a.format(f.toDate(o.date)) }),
2744
2745
  /* @__PURE__ */ u(De, { api: t, model: o.dayGrid, options: r })
2745
- ] }, g.toISOString(o.date))) });
2746
+ ] }, f.toISOString(o.date))) });
2746
2747
  }
2747
2748
  const Tt = 1.6;
2748
2749
  function an({ api: t, model: e, options: r }) {
@@ -2856,7 +2857,7 @@ function dn({ api: t, model: e, options: r }) {
2856
2857
  i.stopPropagation(), t.trigger("eventClick", { event: o.event });
2857
2858
  },
2858
2859
  children: [
2859
- g.format(o.event.start, "HH:mm"),
2860
+ f.format(o.event.start, "HH:mm"),
2860
2861
  " ",
2861
2862
  o.event.title
2862
2863
  ]
@@ -2891,7 +2892,7 @@ function ln({ api: t, model: e }) {
2891
2892
  style: `--rsv-event-bg:${n.backgroundColor};--rsv-event-fg:${n.textColor};--rsv-event-border:${n.borderColor}`,
2892
2893
  onClick: (a) => t.trigger("eventClick", { event: n, el: a.currentTarget }),
2893
2894
  children: [
2894
- n.allDay ? "" : g.format(n.start, "HH:mm") + " ",
2895
+ n.allDay ? "" : f.format(n.start, "HH:mm") + " ",
2895
2896
  n.title
2896
2897
  ]
2897
2898
  },
@@ -2910,7 +2911,7 @@ function cn({ api: t, model: e, options: r }) {
2910
2911
  cell: o,
2911
2912
  options: r
2912
2913
  },
2913
- g.toISOString(o.date)
2914
+ f.toISOString(o.date)
2914
2915
  )) }, `week-${a}`)) });
2915
2916
  }
2916
2917
  function un({
@@ -2918,13 +2919,13 @@ function un({
2918
2919
  cell: e,
2919
2920
  options: r
2920
2921
  }) {
2921
- const n = g.dayOfMonth(e.date);
2922
+ const n = f.dayOfMonth(e.date);
2922
2923
  return /* @__PURE__ */ C(
2923
2924
  "div",
2924
2925
  {
2925
2926
  "data-rsv": "day",
2926
2927
  role: "gridcell",
2927
- "data-date": g.toISOString(e.date),
2928
+ "data-date": f.toISOString(e.date),
2928
2929
  "data-today": String(e.isToday),
2929
2930
  "data-other": String(e.isOther),
2930
2931
  children: [
@@ -2951,7 +2952,7 @@ function un({
2951
2952
  t.trigger("eventClick", { event: o, el: i.currentTarget }), o.url && window.open(o.url, "_self");
2952
2953
  },
2953
2954
  children: [
2954
- o.allDay ? "" : `${g.format(o.start, "HH:mm")} `,
2955
+ o.allDay ? "" : `${f.format(o.start, "HH:mm")} `,
2955
2956
  o.title
2956
2957
  ]
2957
2958
  },
@@ -2984,19 +2985,19 @@ function vn({ api: t, options: e }) {
2984
2985
  a ? `${Ae.slotHeight}:${a}px` : "",
2985
2986
  o != null && o !== "auto" ? `height:${typeof o == "number" ? `${o}px` : o}` : ""
2986
2987
  ].filter(Boolean).join(";") || void 0, i = F(null);
2987
- H(() => (t.setRootEl(i.current), () => t.setRootEl(null)), [t]);
2988
+ R(() => (t.setRootEl(i.current), () => t.setRootEl(null)), [t]);
2988
2989
  const s = F(e.responsiveViews);
2989
- return s.current = e.responsiveViews, H(() => {
2990
+ return s.current = e.responsiveViews, R(() => {
2990
2991
  const c = i.current;
2991
2992
  if (!c || typeof ResizeObserver > "u") return;
2992
2993
  let y = 0;
2993
2994
  const T = new ResizeObserver((v) => {
2994
- const f = v[0], p = (f == null ? void 0 : f.contentRect.width) ?? c.clientWidth;
2995
+ const p = v[0], D = (p == null ? void 0 : p.contentRect.width) ?? c.clientWidth;
2995
2996
  cancelAnimationFrame(y), y = requestAnimationFrame(() => {
2996
- const h = s.current;
2997
- if (!(h != null && h.length)) return;
2998
- const w = Le(h, p);
2999
- w && w !== t.getView().type && t.hasView(w) && t.changeView(w);
2997
+ const m = s.current;
2998
+ if (!(m != null && m.length)) return;
2999
+ const b = Le(m, D);
3000
+ b && b !== t.getView().type && t.hasView(b) && t.changeView(b);
3000
3001
  });
3001
3002
  });
3002
3003
  return T.observe(c), () => {
@@ -3058,7 +3059,7 @@ export {
3058
3059
  Mn as eventsToICS,
3059
3060
  re as handleEventKeydown,
3060
3061
  hn as hostSlot,
3061
- Fe as isHostSlot,
3062
+ He as isHostSlot,
3062
3063
  Cn as listPlugin,
3063
3064
  We as minutesToLabel,
3064
3065
  Ge as minutesToTimeString,