vue-cal 5.0.1-rc.12 → 5.0.1-rc.14

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 (91) hide show
  1. package/README.md +1 -0
  2. package/dist/i18n/ar.js +42 -0
  3. package/dist/i18n/bg.js +38 -0
  4. package/dist/i18n/bn.js +38 -0
  5. package/dist/i18n/bs.js +38 -0
  6. package/dist/i18n/ca.js +40 -0
  7. package/dist/i18n/cs.js +38 -0
  8. package/dist/i18n/da.js +38 -0
  9. package/dist/i18n/de.js +38 -0
  10. package/dist/i18n/el.js +44 -0
  11. package/dist/i18n/en-gb.js +38 -0
  12. package/dist/i18n/es.js +38 -0
  13. package/dist/i18n/et.js +38 -0
  14. package/dist/i18n/fa.js +42 -0
  15. package/dist/i18n/fi.js +38 -0
  16. package/dist/i18n/fr.js +38 -0
  17. package/dist/i18n/he.js +42 -0
  18. package/dist/i18n/hr.js +38 -0
  19. package/dist/i18n/hu.js +38 -0
  20. package/dist/i18n/id.js +38 -0
  21. package/dist/i18n/is.js +38 -0
  22. package/dist/i18n/it.js +38 -0
  23. package/dist/i18n/ja.js +40 -0
  24. package/dist/i18n/ka.js +38 -0
  25. package/dist/i18n/ko.js +40 -0
  26. package/dist/i18n/lt.js +38 -0
  27. package/dist/i18n/mn.js +38 -0
  28. package/dist/i18n/nl.js +38 -0
  29. package/dist/i18n/no.js +38 -0
  30. package/dist/i18n/pl.js +38 -0
  31. package/dist/i18n/pt-br.js +38 -0
  32. package/dist/i18n/pt-pt.js +38 -0
  33. package/dist/i18n/ro.js +38 -0
  34. package/dist/i18n/ru.js +40 -0
  35. package/dist/i18n/sk.js +38 -0
  36. package/dist/i18n/sl.js +38 -0
  37. package/dist/i18n/sq.js +40 -0
  38. package/dist/i18n/sr.js +38 -0
  39. package/dist/i18n/sv.js +38 -0
  40. package/dist/i18n/tr.js +38 -0
  41. package/dist/i18n/uk.js +40 -0
  42. package/dist/i18n/vi.js +40 -0
  43. package/dist/i18n/zh-cn.js +40 -0
  44. package/dist/i18n/zh-hk.js +40 -0
  45. package/dist/vue-cal.es.js +1140 -1110
  46. package/dist/vue-cal.umd.js +4 -4
  47. package/package.json +10 -11
  48. package/dist/i18n/ar.json +0 -18
  49. package/dist/i18n/bg.json +0 -16
  50. package/dist/i18n/bn.json +0 -16
  51. package/dist/i18n/bs.json +0 -16
  52. package/dist/i18n/ca.json +0 -17
  53. package/dist/i18n/cs.json +0 -16
  54. package/dist/i18n/da.json +0 -16
  55. package/dist/i18n/de.json +0 -16
  56. package/dist/i18n/el.json +0 -19
  57. package/dist/i18n/en-gb.json +0 -16
  58. package/dist/i18n/en-us.json +0 -16
  59. package/dist/i18n/es.json +0 -16
  60. package/dist/i18n/et.json +0 -16
  61. package/dist/i18n/fa.json +0 -18
  62. package/dist/i18n/fi.json +0 -16
  63. package/dist/i18n/fr.json +0 -16
  64. package/dist/i18n/he.json +0 -18
  65. package/dist/i18n/hr.json +0 -16
  66. package/dist/i18n/hu.json +0 -16
  67. package/dist/i18n/id.json +0 -16
  68. package/dist/i18n/is.json +0 -16
  69. package/dist/i18n/it.json +0 -16
  70. package/dist/i18n/ja.json +0 -17
  71. package/dist/i18n/ka.json +0 -16
  72. package/dist/i18n/ko.json +0 -17
  73. package/dist/i18n/lt.json +0 -16
  74. package/dist/i18n/mn.json +0 -16
  75. package/dist/i18n/nl.json +0 -16
  76. package/dist/i18n/no.json +0 -16
  77. package/dist/i18n/pl.json +0 -16
  78. package/dist/i18n/pt-br.json +0 -16
  79. package/dist/i18n/pt-pt.json +0 -16
  80. package/dist/i18n/ro.json +0 -16
  81. package/dist/i18n/ru.json +0 -17
  82. package/dist/i18n/sk.json +0 -16
  83. package/dist/i18n/sl.json +0 -16
  84. package/dist/i18n/sq.json +0 -17
  85. package/dist/i18n/sr.json +0 -16
  86. package/dist/i18n/sv.json +0 -16
  87. package/dist/i18n/tr.json +0 -16
  88. package/dist/i18n/uk.json +0 -17
  89. package/dist/i18n/vi.json +0 -17
  90. package/dist/i18n/zh-cn.json +0 -17
  91. package/dist/i18n/zh-hk.json +0 -17
@@ -1,11 +1,10 @@
1
- import { computed as T, reactive as $e, watch as me, toRefs as rt, ref as ie, onBeforeUnmount as Xe, inject as Ne, createElementBlock as j, openBlock as E, renderSlot as F, createCommentVNode as Z, unref as O, Fragment as te, renderList as we, normalizeClass as _e, createElementVNode as ge, createVNode as Oe, Transition as Ge, withCtx as J, createBlock as Se, resolveDynamicComponent as Ke, mergeProps as De, toHandlers as Ie, normalizeProps as ne, guardReactiveProps as se, toDisplayString as le, onMounted as Ze, withModifiers as Qe, nextTick as Ue, normalizeStyle as Te, createTextVNode as xe, TransitionGroup as et, createSlots as je, useTemplateRef as ot, useId as it, useAttrs as ut, provide as ct } from "vue";
2
- import nt from "./i18n/en-us.json";
1
+ import { computed as T, reactive as Te, watch as de, toRefs as wt, ref as oe, onBeforeUnmount as Xe, inject as Ne, createElementBlock as j, openBlock as E, renderSlot as H, createCommentVNode as q, unref as O, Fragment as te, renderList as pe, normalizeClass as we, createElementVNode as me, createVNode as Ve, Transition as Ge, withCtx as Z, createBlock as Ee, resolveDynamicComponent as Qe, mergeProps as he, toHandlers as Ie, normalizeProps as ne, guardReactiveProps as se, toDisplayString as le, onMounted as qe, withModifiers as xe, nextTick as Ue, normalizeStyle as be, createTextVNode as et, TransitionGroup as tt, createSlots as Oe, useTemplateRef as _t, useId as kt, useAttrs as bt, provide as Tt } from "vue";
3
2
  /**
4
- * vue-cal v5.0.1-rc.12
3
+ * vue-cal v5.0.1-rc.14
5
4
  * (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
6
5
  * @license MIT
7
6
  */
8
- const fe = {
7
+ const ve = {
9
8
  texts: {
10
9
  weekDays: Array(7).fill(""),
11
10
  weekDaysShort: [],
@@ -34,46 +33,46 @@ const fe = {
34
33
  years: { cols: 5, rows: 5 }
35
34
  // Arbitrary range of quarters of century (25y).
36
35
  }
37
- }, dt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], vt = Re.reduce((D, n, r) => (D[n] = r || 7, D), {}), mt = (D, n, r) => {
38
- const { dateUtils: h } = D, p = !1, b = T(() => {
36
+ }, Mt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], $t = Re.reduce((D, n, o) => (D[n] = o || 7, D), {}), Yt = (D, n, o) => {
37
+ const { dateUtils: h } = D, p = !1, k = T(() => {
39
38
  if (W.value[n.view]) return n.view;
40
39
  const s = n.datePicker ? "month" : "week", l = n.view || s;
41
40
  return W.value[l] ? l : (console.warn(
42
41
  `Vue Cal: the provided or default view \`${l}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(W.value)[0]}\`.`
43
42
  ), Object.keys(W.value)[0]);
44
- }), L = T(() => n.sm && !n.xs), v = T(() => n.xs || n.datePicker), C = T(() => n.clickToNavigate || n.datePicker && n.clickToNavigate !== !1), i = T(() => {
43
+ }), L = T(() => n.sm && !n.xs), m = T(() => n.xs || n.datePicker), C = T(() => n.clickToNavigate || n.datePicker && n.clickToNavigate !== !1), u = T(() => {
45
44
  const s = {
46
45
  cell: {},
47
46
  // All possible event listeners to attach to cells.
48
47
  event: {}
49
48
  // All possible event listeners to attach to calendar events.
50
49
  }, l = (_) => _.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
51
- for (const [_, t] of Object.entries(r)) {
52
- const [V, H, U] = _.match(/^on(Cell|Event)(.+)$/) || [];
53
- V && (s[H.toLowerCase()][l(U).replace(/^-+|-+$/g, "")] = t);
50
+ for (const [_, t] of Object.entries(o)) {
51
+ const [V, F, J] = _.match(/^on(Cell|Event)(.+)$/) || [];
52
+ V && (s[F.toLowerCase()][l(J).replace(/^-+|-+$/g, "")] = t);
54
53
  }
55
54
  return s;
56
- }), m = T(() => {
55
+ }), f = T(() => {
57
56
  var l;
58
57
  const s = {};
59
- return n.hideWeekends && (s[6] = !0) && (s[7] = !0), (l = n.hideWeekdays) != null && l.length && n.hideWeekdays.forEach((_) => s[vt[_]] = !0), s;
60
- }), $ = T(() => n.hideWeekends || m.value[6] && m.value[7]), W = T(() => {
58
+ return n.hideWeekends && (s[6] = !0) && (s[7] = !0), (l = n.hideWeekdays) != null && l.length && n.hideWeekdays.forEach((_) => s[$t[_]] = !0), s;
59
+ }), M = T(() => n.hideWeekends || f.value[6] && f.value[7]), W = T(() => {
61
60
  const s = n.datePicker;
62
61
  let l = 0, _ = {};
63
62
  const t = n.views;
64
63
  return s && !t ? {
65
- month: { ...fe.availableViews.month },
66
- year: { ...fe.availableViews.year },
67
- years: { ...fe.availableViews.years }
68
- } : (t ? (Array.isArray(t) ? _ = t.reduce((V, H) => (typeof H == "string" && fe.availableViews[H] ? V[H] = fe.availableViews[H] : l++, V), {}) : typeof t == "object" && (_ = Object.entries(t).reduce((V, [H, U]) => {
69
- const { cols: K, rows: ue } = fe.availableViews[H];
70
- return V[H] = { cols: U.cols || K, rows: U.rows || ue }, V;
71
- }, {})), l && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(_).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), _ = { ...fe.availableViews })) : _ = { ...fe.availableViews }, _);
72
- }), G = T(() => n.datePicker ? "month" : W.value.week ? "week" : Object.keys(W.value)[0]), o = T(() => {
64
+ month: { ...ve.availableViews.month },
65
+ year: { ...ve.availableViews.year },
66
+ years: { ...ve.availableViews.years }
67
+ } : (t ? (Array.isArray(t) ? _ = t.reduce((V, F) => (typeof F == "string" && ve.availableViews[F] ? V[F] = ve.availableViews[F] : l++, V), {}) : typeof t == "object" && (_ = Object.entries(t).reduce((V, [F, J]) => {
68
+ const { cols: K, rows: ie } = ve.availableViews[F];
69
+ return V[F] = { cols: J.cols || K, rows: J.rows || ie }, V;
70
+ }, {})), l && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(_).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), _ = { ...ve.availableViews })) : _ = { ...ve.availableViews }, _);
71
+ }), X = T(() => n.datePicker ? "month" : W.value.week ? "week" : Object.keys(W.value)[0]), i = T(() => {
73
72
  if (typeof n.selectedDate == "string") return h.stringToDate(n.selectedDate);
74
73
  if (n.selectedDate instanceof Date) return n.selectedDate;
75
74
  n.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", n.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
76
- }), u = T(() => {
75
+ }), c = T(() => {
77
76
  if (!n.disableDays) return [];
78
77
  const s = [];
79
78
  if (Array.isArray(n.disableDays))
@@ -86,14 +85,14 @@ const fe = {
86
85
  }), e = T(() => {
87
86
  let s = null;
88
87
  return n.minDate && typeof n.minDate == "string" ? s = h.stringToDate(n.minDate) : n.minDate && n.minDate instanceof Date && (s = n.minDate), (s == null ? void 0 : s.getTime()) || null;
89
- }), d = T(() => {
88
+ }), v = T(() => {
90
89
  let s = null;
91
90
  return n.maxDate && typeof n.maxDate == "string" ? s = h.stringToDate(n.maxDate) : n.maxDate && n.maxDate instanceof Date && (s = n.maxDate), (s == null ? void 0 : s.getTime()) || null;
92
- }), f = T(() => {
91
+ }), g = T(() => {
93
92
  var _;
94
93
  const { view: s } = D;
95
94
  return n.schedules.length && (s.isDay || s.isDays || s.isWeek) && ((_ = n.schedules) == null ? void 0 : _.map((t, V) => ({ ...t, id: t.id ?? V + 1 }))) || void 0;
96
- }), M = T(() => {
95
+ }), $ = T(() => {
97
96
  const s = {
98
97
  drag: !0,
99
98
  resize: !0,
@@ -103,7 +102,7 @@ const fe = {
103
102
  return n.editableEvents === !0 ? s : n.editableEvents === !1 ? Object.keys(s).map((l) => s[l] = !1) : { ...s, ...n.editableEvents };
104
103
  }), P = async (s) => {
105
104
  var _;
106
- let l = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.json").then((t) => t.default), "../i18n/bg.json": () => import("./i18n/bg.json").then((t) => t.default), "../i18n/bn.json": () => import("./i18n/bn.json").then((t) => t.default), "../i18n/bs.json": () => import("./i18n/bs.json").then((t) => t.default), "../i18n/ca.json": () => import("./i18n/ca.json").then((t) => t.default), "../i18n/cs.json": () => import("./i18n/cs.json").then((t) => t.default), "../i18n/da.json": () => import("./i18n/da.json").then((t) => t.default), "../i18n/de.json": () => import("./i18n/de.json").then((t) => t.default), "../i18n/el.json": () => import("./i18n/el.json").then((t) => t.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.json").then((t) => t.default), "../i18n/en-us.json": () => import("./i18n/en-us.json").then((t) => t.default), "../i18n/es.json": () => import("./i18n/es.json").then((t) => t.default), "../i18n/et.json": () => import("./i18n/et.json").then((t) => t.default), "../i18n/fa.json": () => import("./i18n/fa.json").then((t) => t.default), "../i18n/fi.json": () => import("./i18n/fi.json").then((t) => t.default), "../i18n/fr.json": () => import("./i18n/fr.json").then((t) => t.default), "../i18n/he.json": () => import("./i18n/he.json").then((t) => t.default), "../i18n/hr.json": () => import("./i18n/hr.json").then((t) => t.default), "../i18n/hu.json": () => import("./i18n/hu.json").then((t) => t.default), "../i18n/id.json": () => import("./i18n/id.json").then((t) => t.default), "../i18n/is.json": () => import("./i18n/is.json").then((t) => t.default), "../i18n/it.json": () => import("./i18n/it.json").then((t) => t.default), "../i18n/ja.json": () => import("./i18n/ja.json").then((t) => t.default), "../i18n/ka.json": () => import("./i18n/ka.json").then((t) => t.default), "../i18n/ko.json": () => import("./i18n/ko.json").then((t) => t.default), "../i18n/lt.json": () => import("./i18n/lt.json").then((t) => t.default), "../i18n/mn.json": () => import("./i18n/mn.json").then((t) => t.default), "../i18n/nl.json": () => import("./i18n/nl.json").then((t) => t.default), "../i18n/no.json": () => import("./i18n/no.json").then((t) => t.default), "../i18n/pl.json": () => import("./i18n/pl.json").then((t) => t.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.json").then((t) => t.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.json").then((t) => t.default), "../i18n/ro.json": () => import("./i18n/ro.json").then((t) => t.default), "../i18n/ru.json": () => import("./i18n/ru.json").then((t) => t.default), "../i18n/sk.json": () => import("./i18n/sk.json").then((t) => t.default), "../i18n/sl.json": () => import("./i18n/sl.json").then((t) => t.default), "../i18n/sq.json": () => import("./i18n/sq.json").then((t) => t.default), "../i18n/sr.json": () => import("./i18n/sr.json").then((t) => t.default), "../i18n/sv.json": () => import("./i18n/sv.json").then((t) => t.default), "../i18n/tr.json": () => import("./i18n/tr.json").then((t) => t.default), "../i18n/uk.json": () => import("./i18n/uk.json").then((t) => t.default), "../i18n/vi.json": () => import("./i18n/vi.json").then((t) => t.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.json").then((t) => t.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.json").then((t) => t.default) });
105
+ let l = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((t) => t.default), "../i18n/bg.json": () => import("./i18n/bg.js").then((t) => t.default), "../i18n/bn.json": () => import("./i18n/bn.js").then((t) => t.default), "../i18n/bs.json": () => import("./i18n/bs.js").then((t) => t.default), "../i18n/ca.json": () => import("./i18n/ca.js").then((t) => t.default), "../i18n/cs.json": () => import("./i18n/cs.js").then((t) => t.default), "../i18n/da.json": () => import("./i18n/da.js").then((t) => t.default), "../i18n/de.json": () => import("./i18n/de.js").then((t) => t.default), "../i18n/el.json": () => import("./i18n/el.js").then((t) => t.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.js").then((t) => t.default), "../i18n/en-us.json": () => Promise.resolve().then(() => Vt).then((t) => t.default), "../i18n/es.json": () => import("./i18n/es.js").then((t) => t.default), "../i18n/et.json": () => import("./i18n/et.js").then((t) => t.default), "../i18n/fa.json": () => import("./i18n/fa.js").then((t) => t.default), "../i18n/fi.json": () => import("./i18n/fi.js").then((t) => t.default), "../i18n/fr.json": () => import("./i18n/fr.js").then((t) => t.default), "../i18n/he.json": () => import("./i18n/he.js").then((t) => t.default), "../i18n/hr.json": () => import("./i18n/hr.js").then((t) => t.default), "../i18n/hu.json": () => import("./i18n/hu.js").then((t) => t.default), "../i18n/id.json": () => import("./i18n/id.js").then((t) => t.default), "../i18n/is.json": () => import("./i18n/is.js").then((t) => t.default), "../i18n/it.json": () => import("./i18n/it.js").then((t) => t.default), "../i18n/ja.json": () => import("./i18n/ja.js").then((t) => t.default), "../i18n/ka.json": () => import("./i18n/ka.js").then((t) => t.default), "../i18n/ko.json": () => import("./i18n/ko.js").then((t) => t.default), "../i18n/lt.json": () => import("./i18n/lt.js").then((t) => t.default), "../i18n/mn.json": () => import("./i18n/mn.js").then((t) => t.default), "../i18n/nl.json": () => import("./i18n/nl.js").then((t) => t.default), "../i18n/no.json": () => import("./i18n/no.js").then((t) => t.default), "../i18n/pl.json": () => import("./i18n/pl.js").then((t) => t.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.js").then((t) => t.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.js").then((t) => t.default), "../i18n/ro.json": () => import("./i18n/ro.js").then((t) => t.default), "../i18n/ru.json": () => import("./i18n/ru.js").then((t) => t.default), "../i18n/sk.json": () => import("./i18n/sk.js").then((t) => t.default), "../i18n/sl.json": () => import("./i18n/sl.js").then((t) => t.default), "../i18n/sq.json": () => import("./i18n/sq.js").then((t) => t.default), "../i18n/sr.json": () => import("./i18n/sr.js").then((t) => t.default), "../i18n/sv.json": () => import("./i18n/sv.js").then((t) => t.default), "../i18n/tr.json": () => import("./i18n/tr.js").then((t) => t.default), "../i18n/uk.json": () => import("./i18n/uk.js").then((t) => t.default), "../i18n/vi.json": () => import("./i18n/vi.js").then((t) => t.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.js").then((t) => t.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.js").then((t) => t.default) });
107
106
  {
108
107
  if (!l[`../i18n/${s}.json`]) {
109
108
  console.warn(`Vue Cal: the locale \`${s}\` does not exist. Falling back to \`en-us\`.`), s = "en-us";
@@ -111,280 +110,280 @@ const fe = {
111
110
  }
112
111
  l = await ((_ = l[`../i18n/${s}.json`]) == null ? void 0 : _.call(l));
113
112
  }
114
- D.texts = Object.assign(D.texts, Object.assign({ ...fe.texts }, l)), h.updateTexts(D.texts);
115
- }, B = $e(n.events || []);
116
- return me(() => n.events, (s) => B.splice(0, B.length, ...s)), me(() => n.locale, (s) => P(s || "en-us")), (n.locale || !D.texts.today) && P(n.locale || "en-us"), {
117
- ...rt(n),
118
- events: B,
113
+ D.texts = Object.assign(D.texts, Object.assign({ ...ve.texts }, l)), h.updateTexts(D.texts);
114
+ }, A = Te(n.events || []);
115
+ return de(() => n.events, (s) => A.splice(0, A.length, ...s)), de(() => n.locale, (s) => P(s || "en-us")), (n.locale || !D.texts.today) && P(n.locale || "en-us"), {
116
+ ...wt(n),
117
+ events: A,
119
118
  // All the events listeners for cells and events that the end user may have attached to vue-cal.
120
- eventListeners: i,
121
- defaultView: G,
119
+ eventListeners: u,
120
+ defaultView: X,
122
121
  availableViews: W,
123
- disableDays: u,
122
+ disableDays: c,
124
123
  ready: p,
125
124
  sm: L,
126
- xs: v,
125
+ xs: m,
127
126
  clickToNavigate: C,
128
- hideWeekdays: m,
129
- hideWeekends: $,
127
+ hideWeekdays: f,
128
+ hideWeekends: M,
130
129
  minTimestamp: e,
131
- maxTimestamp: d,
132
- schedules: f,
133
- selectedDate: o,
134
- editableEvents: M,
135
- view: b,
130
+ maxTimestamp: v,
131
+ schedules: g,
132
+ selectedDate: i,
133
+ editableEvents: $,
134
+ view: k,
136
135
  // Getters.
137
136
  get hasHiddenDays() {
138
- return Object.keys(m.value).length;
137
+ return Object.keys(f.value).length;
139
138
  },
140
139
  get size() {
141
- return v.value ? "xs" : L.value ? "sm" : "lg";
140
+ return m.value ? "xs" : L.value ? "sm" : "lg";
142
141
  },
143
142
  loadTexts: P
144
143
  };
145
- }, Ve = (D, n) => {
146
- const r = n.timeTo - n.timeFrom;
147
- return (D - n.timeFrom) * 100 / r;
148
- }, Pe = (D, n) => {
149
- const r = n.timeTo - n.timeFrom;
150
- return ~~(D * r / 100 + n.timeFrom);
151
- }, Je = (D, n) => {
152
- const r = n.clientHeight;
153
- return D * 100 / r;
154
- }, Ae = $e({ id: null, date: null });
155
- let tt = !1, qe = !0;
156
- const pe = $e({ el: null, cell: null, timeout: null }), be = $e({
144
+ }, Ce = (D, n) => {
145
+ const o = n.timeTo - n.timeFrom;
146
+ return (D - n.timeFrom) * 100 / o;
147
+ }, je = (D, n) => {
148
+ const o = n.timeTo - n.timeFrom;
149
+ return ~~(D * o / 100 + n.timeFrom);
150
+ }, Ze = (D, n) => {
151
+ const o = n.clientHeight;
152
+ return D * 100 / o;
153
+ }, Be = Te({ id: null, date: null });
154
+ let at = !1, Je = !0;
155
+ const De = Te({ el: null, cell: null, timeout: null }), ke = Te({
157
156
  eventId: null,
158
157
  fromVueCal: null,
159
158
  toVueCal: null
160
159
  });
161
- function ft(D) {
162
- const { config: n, view: r, eventsManager: h, emit: p, uid: b, dateUtils: L } = D, v = (e) => {
160
+ function Et(D) {
161
+ const { config: n, view: o, eventsManager: h, emit: p, uid: k, dateUtils: L } = D, m = (e) => {
163
162
  var l;
164
- const { timeStep: d, timeCellHeight: f, timeFrom: M } = n, P = (((l = e.touches) == null ? void 0 : l[0]) || e).clientY, { top: B } = e.currentTarget.getBoundingClientRect(), s = P - B - ~~e.dataTransfer.getData("cursor-grab-at");
165
- return Pe(Je(s, e.currentTarget), n);
166
- }, C = (e, d, f) => {
167
- const M = d.duration || i(d.start, d.end) || n.timeStep;
168
- let P = Math.max(v(e), 0);
163
+ const { timeStep: v, timeCellHeight: g, timeFrom: $ } = n, P = (((l = e.touches) == null ? void 0 : l[0]) || e).clientY, { top: A } = e.currentTarget.getBoundingClientRect(), s = P - A - ~~e.dataTransfer.getData("cursor-grab-at");
164
+ return je(Ze(s, e.currentTarget), n);
165
+ }, C = (e, v, g) => {
166
+ const $ = v.duration || u(v.start, v.end) || n.timeStep;
167
+ let P = Math.max(m(e), 0);
169
168
  if (n.snapToInterval) {
170
169
  const _ = P + n.snapToInterval / 2;
171
170
  P = _ - _ % n.snapToInterval;
172
171
  }
173
- const B = new Date(new Date(f).setMinutes(P)), s = Math.min(P + M, 24 * 60), l = new Date(new Date(f).setMinutes(s));
174
- return { start: B, end: l };
175
- }, i = (e, d) => Math.round((d - e) / 6e4);
172
+ const A = new Date(new Date(g).setMinutes(P)), s = Math.min(P + $, 24 * 60), l = new Date(new Date(g).setMinutes(s));
173
+ return { start: A, end: l };
174
+ }, u = (e, v) => Math.round((v - e) / 6e4);
176
175
  return {
177
- eventDragStart: (e, d) => {
176
+ eventDragStart: (e, v) => {
178
177
  if (e.target.nodeType === 3 || D.touch.isResizingEvent) return e.preventDefault();
179
178
  e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move";
180
- const f = { ...d, _: { id: d._.id, duration: i(d.start, d.end) } };
179
+ const g = { ...v, _: { id: v._.id, duration: u(v.start, v.end) } };
181
180
  try {
182
- e.dataTransfer.setData("text/plain", ""), e.dataTransfer.setData("event", JSON.stringify(f)), e.dataTransfer.setData("cursor-grab-at", e.offsetY);
181
+ e.dataTransfer.setData("text/plain", ""), e.dataTransfer.setData("event", JSON.stringify(g)), e.dataTransfer.setData("cursor-grab-at", e.offsetY);
183
182
  } catch (P) {
184
183
  return console.warn("Vue Cal: Failed to set drag data:", P), e.preventDefault();
185
184
  }
186
- be.eventId = d._.id, be.fromVueCal = b;
187
- const M = e.target.closest(".vuecal__event");
188
- M.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
189
- M.classList.add("vuecal__event--dragging-original"), M.classList.remove("vuecal__event--dragging-ghost");
190
- }, 0), tt = !1, Object.assign(Ae, { id: r.id, date: r.firstCellDate }), qe = !0, D.touch.isDraggingEvent = !0;
185
+ ke.eventId = v._.id, ke.fromVueCal = k;
186
+ const $ = e.target.closest(".vuecal__event");
187
+ $.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
188
+ $.classList.add("vuecal__event--dragging-original"), $.classList.remove("vuecal__event--dragging-ghost");
189
+ }, 0), at = !1, Object.assign(Be, { id: o.id, date: o.firstCellDate }), Je = !0, D.touch.isDraggingEvent = !0;
191
190
  },
192
- eventDragEnd: (e, d) => {
193
- be.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
194
- const { fromVueCal: f, toVueCal: M } = be;
195
- M && f !== M && h.deleteEvent(d._.id, 3), be.fromVueCal = null, be.toVueCal = null, tt && qe && Ae.id && r.switchView(Ae.id, Ae.date, !0), D.touch.isDraggingEvent = !1;
191
+ eventDragEnd: (e, v) => {
192
+ ke.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
193
+ const { fromVueCal: g, toVueCal: $ } = ke;
194
+ $ && g !== $ && h.deleteEvent(v._.id, 3), ke.fromVueCal = null, ke.toVueCal = null, at && Je && Be.id && o.switchView(Be.id, Be.date, !0), D.touch.isDraggingEvent = !1;
196
195
  },
197
- cellDragEnter: (e, d) => {
198
- const { start: f } = d, M = e.currentTarget;
196
+ cellDragEnter: (e, v) => {
197
+ const { start: g } = v, $ = e.currentTarget;
199
198
  if (!e.currentTarget.contains(e.relatedTarget)) {
200
- if (M === pe.el || !M.className.includes("vuecal__cell-content")) return !1;
201
- pe.el && (pe.cell.highlighted = !1), Object.assign(pe, { el: M, cell: d, timeout: clearTimeout(pe.timeout) }), d.highlighted = !0, ["years", "year", "month"].includes(r.id) && (pe.timeout = setTimeout(() => D.switchToNarrowerView(f), 2e3));
199
+ if ($ === De.el || !$.className.includes("vuecal__cell-content")) return !1;
200
+ De.el && (De.cell.highlighted = !1), Object.assign(De, { el: $, cell: v, timeout: clearTimeout(De.timeout) }), v.highlighted = !0, ["years", "year", "month"].includes(o.id) && (De.timeout = setTimeout(() => D.switchToNarrowerView(g), 2e3));
202
201
  }
203
202
  },
204
- cellDragOver: (e, d) => {
205
- const { start: f, schedule: M } = d;
206
- e.preventDefault(), d.highlighted = !0, (M || M === 0) && (d.highlightedSchedule = M);
203
+ cellDragOver: (e, v) => {
204
+ const { start: g, schedule: $ } = v;
205
+ e.preventDefault(), v.highlighted = !0, ($ || $ === 0) && (v.highlightedSchedule = $);
207
206
  },
208
- cellDragLeave: (e, d) => {
209
- e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (d.highlightedSchedule = !1, pe.cell === d && (clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null }), d.highlighted = !1));
207
+ cellDragLeave: (e, v) => {
208
+ e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (v.highlightedSchedule = !1, De.cell === v && (clearTimeout(De.timeout), Object.assign(De, { el: null, cell: null, timeout: null }), v.highlighted = !1));
210
209
  },
211
- cellDragDrop: async (e, d) => {
212
- var V, H, U;
213
- e.preventDefault(), clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null });
214
- const f = JSON.parse(e.dataTransfer.getData("event") || "{}");
215
- f.start && (f.start = new Date(f.start)), f.end && (f.end = new Date(f.end));
216
- let M;
217
- const { start: P, end: B } = C(e, f, d.start), { schedule: s } = ((V = e.target.closest("[data-schedule]")) == null ? void 0 : V.dataset) || {};
210
+ cellDragDrop: async (e, v) => {
211
+ var V, F, J;
212
+ e.preventDefault(), clearTimeout(De.timeout), Object.assign(De, { el: null, cell: null, timeout: null });
213
+ const g = JSON.parse(e.dataTransfer.getData("event") || "{}");
214
+ g.start && (g.start = new Date(g.start)), g.end && (g.end = new Date(g.end));
215
+ let $;
216
+ const { start: P, end: A } = C(e, g, v.start), { schedule: s } = ((V = e.target.closest("[data-schedule]")) == null ? void 0 : V.dataset) || {};
218
217
  let l = () => {
219
218
  };
220
- be.fromVueCal === b ? (M = h.getEvent(f._.id), M && (M._.dragging = !1, l = () => {
221
- M.start = P, M.end = B, s !== void 0 && (M.schedule = ~~s);
222
- })) : (M = {
223
- ...f,
219
+ ke.fromVueCal === k ? ($ = h.getEvent(g._.id), $ && ($._.dragging = !1, l = () => {
220
+ $.start = P, $.end = A, s !== void 0 && ($.schedule = ~~s);
221
+ })) : ($ = {
222
+ ...g,
224
223
  start: P,
225
- end: B,
224
+ end: A,
226
225
  ...s !== void 0 && { schedule: ~~s },
227
- _: { id: ((H = f._) == null ? void 0 : H.id) || f.id, duration: i(P, B) },
226
+ _: { id: ((F = g._) == null ? void 0 : F.id) || g.id, duration: u(P, A) },
228
227
  getOverlappingEvents: () => h.getEventsInRange(
229
228
  h.getEventsByDate(L.formatDate(P), !0),
230
- { start: P, end: B },
229
+ { start: P, end: A },
231
230
  { schedule: ~~s }
232
231
  )
233
232
  }, l = () => {
234
- M = h.createEvent(M);
233
+ $ = h.createEvent($);
235
234
  });
236
235
  let _ = !0;
237
- const { drop: t } = (U = n.eventListeners) == null ? void 0 : U.event;
236
+ const { drop: t } = (J = n.eventListeners) == null ? void 0 : J.event;
238
237
  t && (_ = await t({
239
238
  e,
240
- event: { ...M, start: P, end: B, schedule: ~~s },
241
- overlaps: M.getOverlappingEvents({ start: P, end: B, schedule: ~~s }),
242
- cell: d,
243
- external: be.fromVueCal !== b
244
- })), _ !== !1 && l(), d.highlighted = !1, d.highlightedSchedule = null, qe = !1, be.toVueCal = b, p("event-dropped", {
239
+ event: { ...$, start: P, end: A, schedule: ~~s },
240
+ overlaps: $.getOverlappingEvents({ start: P, end: A, schedule: ~~s }),
241
+ cell: v,
242
+ external: ke.fromVueCal !== k
243
+ })), _ !== !1 && l(), v.highlighted = !1, v.highlightedSchedule = null, Je = !1, ke.toVueCal = k, p("event-dropped", {
245
244
  e,
246
- cell: d,
247
- event: M,
248
- originalEvent: f,
249
- external: be.fromVueCal !== b
245
+ cell: v,
246
+ event: $,
247
+ originalEvent: g,
248
+ external: ke.fromVueCal !== k
250
249
  });
251
250
  }
252
251
  };
253
252
  }
254
253
  const st = (D, n) => {
255
- let r, h, p, b = {}, L = {};
256
- const v = ie(D), C = () => {
257
- v.value.today || (v.value = n), Date.prototype.addDays = function(a) {
254
+ let o, h, p, k = {}, L = {};
255
+ const m = oe(D), C = () => {
256
+ m.value.today || (m.value = n), Date.prototype.addDays = function(a) {
258
257
  return W(this, a || 0);
259
258
  }, Date.prototype.subtractDays = function(a) {
260
- return G(this, a || 0);
259
+ return X(this, a || 0);
261
260
  }, Date.prototype.addHours = function(a) {
262
- return o(this, a || 0);
261
+ return i(this, a || 0);
263
262
  }, Date.prototype.subtractHours = function(a) {
264
- return u(this, a || 0);
263
+ return c(this, a || 0);
265
264
  }, Date.prototype.addMinutes = function(a) {
266
265
  return e(this, a || 0);
267
266
  }, Date.prototype.subtractMinutes = function(a) {
268
- return d(this, a || 0);
267
+ return v(this, a || 0);
269
268
  }, Date.prototype.getWeek = function() {
270
- return M(this);
269
+ return $(this);
271
270
  }, Date.prototype.isToday = function() {
272
271
  return P(this);
273
272
  }, Date.prototype.isLeapYear = function() {
274
273
  return l(this);
275
274
  }, Date.prototype.format = function(a = "YYYY-MM-DD") {
276
- return ue(this, a);
275
+ return ie(this, a);
277
276
  }, Date.prototype.formatTime = function(a = "HH:mm") {
278
277
  return re(this, a);
279
278
  };
280
- }, i = () => {
279
+ }, u = () => {
281
280
  delete Date.prototype.addDays, delete Date.prototype.subtractDays, delete Date.prototype.addHours, delete Date.prototype.subtractHours, delete Date.prototype.addMinutes, delete Date.prototype.subtractMinutes, delete Date.prototype.getWeek, delete Date.prototype.isToday, delete Date.prototype.isLeapYear, delete Date.prototype.format, delete Date.prototype.formatTime;
282
- }, m = (a) => {
283
- v.value = a, Date.prototype.subtractDays && C();
284
- }, $ = () => (h !== (/* @__PURE__ */ new Date()).getDate() && (r = /* @__PURE__ */ new Date(), h = r.getDate(), p = `${r.getFullYear()}-${r.getMonth()}-${r.getDate()}`), p), W = (a, k) => {
281
+ }, f = (a) => {
282
+ m.value = a, Date.prototype.subtractDays && C();
283
+ }, M = () => (h !== (/* @__PURE__ */ new Date()).getDate() && (o = /* @__PURE__ */ new Date(), h = o.getDate(), p = `${o.getFullYear()}-${o.getMonth()}-${o.getDate()}`), p), W = (a, w) => {
285
284
  const y = new Date(a.valueOf());
286
- return y.setDate(y.getDate() + k), y;
287
- }, G = (a, k) => {
285
+ return y.setDate(y.getDate() + w), y;
286
+ }, X = (a, w) => {
288
287
  const y = new Date(a.valueOf());
289
- return y.setDate(y.getDate() - k), y;
290
- }, o = (a, k) => {
288
+ return y.setDate(y.getDate() - w), y;
289
+ }, i = (a, w) => {
291
290
  const y = new Date(a.valueOf());
292
- return y.setHours(y.getHours() + k), y;
293
- }, u = (a, k) => {
291
+ return y.setHours(y.getHours() + w), y;
292
+ }, c = (a, w) => {
294
293
  const y = new Date(a.valueOf());
295
- return y.setHours(y.getHours() - k), y;
296
- }, e = (a, k) => {
294
+ return y.setHours(y.getHours() - w), y;
295
+ }, e = (a, w) => {
297
296
  const y = new Date(a.valueOf());
298
- return y.setMinutes(y.getMinutes() + k), y;
299
- }, d = (a, k) => {
297
+ return y.setMinutes(y.getMinutes() + w), y;
298
+ }, v = (a, w) => {
300
299
  const y = new Date(a.valueOf());
301
- return y.setMinutes(y.getMinutes() - k), y;
302
- }, f = (a, k) => {
303
- const y = (A) => {
304
- const Q = A % k;
305
- return Q !== 0 && (A += Q >= k / 2 ? k - Q : -Q), A;
300
+ return y.setMinutes(y.getMinutes() - w), y;
301
+ }, g = (a, w) => {
302
+ const y = (I) => {
303
+ const x = I % w;
304
+ return x !== 0 && (I += x >= w / 2 ? w - x : -x), I;
306
305
  };
307
306
  if (typeof a == "number") return y(a);
308
307
  if (a instanceof Date) {
309
- let A = y(a.getMinutes());
310
- A >= 60 && (a.setHours(a.getHours() + 1), A = 0), a.setMinutes(A, 0, 0);
308
+ let I = y(a.getMinutes());
309
+ I >= 60 && (a.setHours(a.getHours() + 1), I = 0), a.setMinutes(I, 0, 0);
311
310
  }
312
- }, M = (a, k = !1) => {
313
- const y = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())), A = y.getUTCDay() || 7;
314
- y.setUTCDate(y.getUTCDate() + 4 - A);
315
- const Q = new Date(Date.UTC(y.getUTCFullYear(), 0, 1));
316
- return Math.ceil(((y - Q) / 864e5 + 1) / 7) + (k ? 1 : 0);
317
- }, P = (a) => `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}` === $(), B = (a, k) => {
318
- if (!a || !k) return console.warn(`Vue Cal: missing date${a ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
311
+ }, $ = (a, w = !1) => {
312
+ const y = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())), I = y.getUTCDay() || 7;
313
+ y.setUTCDate(y.getUTCDate() + 4 - I);
314
+ const x = new Date(Date.UTC(y.getUTCFullYear(), 0, 1));
315
+ return Math.ceil(((y - x) / 864e5 + 1) / 7) + (w ? 1 : 0);
316
+ }, P = (a) => `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}` === M(), A = (a, w) => {
317
+ if (!a || !w) return console.warn(`Vue Cal: missing date${a ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
319
318
  if (K(a)) {
320
- if (!K(k)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${k}\`.`);
319
+ if (!K(w)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${w}\`.`);
321
320
  } else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${a}\`.`);
322
- return a.getFullYear() === k.getFullYear() && a.getMonth() === k.getMonth() && a.getDate() === k.getDate();
323
- }, s = (a, k, y) => K(a) ? a.getTime() >= k && a.getTime() <= y : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${a}\`.`), l = (a) => {
324
- const k = a.getFullYear();
325
- return !(k % 400) || k % 100 && !(k % 4);
326
- }, _ = (a = null, k) => {
327
- const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), A = k ? 7 : 6;
328
- return y.setDate(y.getDate() - (y.getDay() + A) % 7), y;
329
- }, t = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))), V = (a) => a.getHours() * 60 + a.getMinutes(), H = (a, k) => {
330
- typeof a == "string" && (a = a.replace(/-/g, "/")), typeof k == "string" && (k = k.replace(/-/g, "/")), a = new Date(a).setHours(0, 0, 0, 0), k = new Date(k).setHours(0, 0, 1, 0);
331
- const y = (new Date(k).getTimezoneOffset() - new Date(a).getTimezoneOffset()) * 60 * 1e3;
332
- return Math.ceil((k - a - y) / (24 * 3600 * 1e3));
333
- }, U = (a, k, y) => Math.abs(a.getTime() - k.getTime()) <= y * 60 * 1e3, K = (a) => a && a instanceof Date && !isNaN(a), ue = (a, k = "YYYY-MM-DD", y = null) => {
334
- if (y || (y = v.value), k || (k = "YYYY-MM-DD"), k === "YYYY-MM-DD") return ae(a);
335
- b = {}, L = {};
336
- const A = {
337
- YYYY: () => ee(a, y).YYYY,
338
- YY: () => ee(a, y).YY(),
339
- M: () => ee(a, y).M,
340
- MM: () => ee(a, y).MM(),
341
- MMM: () => ee(a, y).MMM(),
342
- MMMM: () => ee(a, y).MMMM(),
343
- MMMMG: () => ee(a, y).MMMMG(),
344
- D: () => ee(a, y).D,
345
- DD: () => ee(a, y).DD(),
346
- S: () => ee(a, y).S(),
347
- d: () => ee(a, y).d,
348
- dd: () => ee(a, y).dd(),
349
- ddd: () => ee(a, y).ddd(),
350
- dddd: () => ee(a, y).dddd(),
351
- HH: () => oe(a, y).HH,
352
- H: () => oe(a, y).H,
353
- hh: () => oe(a, y).hh,
354
- h: () => oe(a, y).h,
355
- am: () => oe(a, y).am,
356
- AM: () => oe(a, y).AM,
357
- mm: () => oe(a, y).mm,
358
- m: () => oe(a, y).m,
359
- s: () => oe(a, y).s
321
+ return a.getFullYear() === w.getFullYear() && a.getMonth() === w.getMonth() && a.getDate() === w.getDate();
322
+ }, s = (a, w, y) => K(a) ? a.getTime() >= w && a.getTime() <= y : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${a}\`.`), l = (a) => {
323
+ const w = a.getFullYear();
324
+ return !(w % 400) || w % 100 && !(w % 4);
325
+ }, _ = (a = null, w) => {
326
+ const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), I = w ? 7 : 6;
327
+ return y.setDate(y.getDate() - (y.getDay() + I) % 7), y;
328
+ }, t = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))), V = (a) => a.getHours() * 60 + a.getMinutes(), F = (a, w) => {
329
+ typeof a == "string" && (a = a.replace(/-/g, "/")), typeof w == "string" && (w = w.replace(/-/g, "/")), a = new Date(a).setHours(0, 0, 0, 0), w = new Date(w).setHours(0, 0, 1, 0);
330
+ const y = (new Date(w).getTimezoneOffset() - new Date(a).getTimezoneOffset()) * 60 * 1e3;
331
+ return Math.ceil((w - a - y) / (24 * 3600 * 1e3));
332
+ }, J = (a, w, y) => Math.abs(a.getTime() - w.getTime()) <= y * 60 * 1e3, K = (a) => a && a instanceof Date && !isNaN(a), ie = (a, w = "YYYY-MM-DD", y = null) => {
333
+ if (y || (y = m.value), w || (w = "YYYY-MM-DD"), w === "YYYY-MM-DD") return ae(a);
334
+ k = {}, L = {};
335
+ const I = {
336
+ YYYY: () => Q(a, y).YYYY,
337
+ YY: () => Q(a, y).YY(),
338
+ M: () => Q(a, y).M,
339
+ MM: () => Q(a, y).MM(),
340
+ MMM: () => Q(a, y).MMM(),
341
+ MMMM: () => Q(a, y).MMMM(),
342
+ MMMMG: () => Q(a, y).MMMMG(),
343
+ D: () => Q(a, y).D,
344
+ DD: () => Q(a, y).DD(),
345
+ S: () => Q(a, y).S(),
346
+ d: () => Q(a, y).d,
347
+ dd: () => Q(a, y).dd(),
348
+ ddd: () => Q(a, y).ddd(),
349
+ dddd: () => Q(a, y).dddd(),
350
+ HH: () => ue(a, y).HH,
351
+ H: () => ue(a, y).H,
352
+ hh: () => ue(a, y).hh,
353
+ h: () => ue(a, y).h,
354
+ am: () => ue(a, y).am,
355
+ AM: () => ue(a, y).AM,
356
+ mm: () => ue(a, y).mm,
357
+ m: () => ue(a, y).m,
358
+ s: () => ue(a, y).s
360
359
  };
361
- return k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (Q, c) => {
362
- const w = A[c.replace(/\{|\}/g, "")];
363
- return w !== void 0 ? w() : c;
360
+ return w.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (x, ge) => {
361
+ const r = I[ge.replace(/\{|\}/g, "")];
362
+ return r !== void 0 ? r() : ge;
364
363
  });
365
364
  }, ae = (a) => {
366
- const k = a.getMonth() + 1, y = a.getDate();
367
- return `${a.getFullYear()}-${k < 10 ? "0" : ""}${k}-${y < 10 ? "0" : ""}${y}`;
368
- }, re = (a, k = "HH:mm", y = null, A = !1) => {
369
- let Q = !1;
370
- if (A) {
371
- const [S, Y, N] = [a.getHours(), a.getMinutes(), a.getSeconds()];
372
- S + Y + N === 141 && (Q = !0);
365
+ const w = a.getMonth() + 1, y = a.getDate();
366
+ return `${a.getFullYear()}-${w < 10 ? "0" : ""}${w}-${y < 10 ? "0" : ""}${y}`;
367
+ }, re = (a, w = "HH:mm", y = null, I = !1) => {
368
+ let x = !1;
369
+ if (I) {
370
+ const [b, S, Y] = [a.getHours(), a.getMinutes(), a.getSeconds()];
371
+ b + S + Y === 141 && (x = !0);
373
372
  }
374
- if (a instanceof Date && k === "HH:mm") return Q ? "24:00" : he(a);
375
- L = {}, y || (y = v.value);
376
- const c = oe(a, y), w = k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (S, Y) => {
377
- const N = c[Y.replace(/\{|\}/g, "")];
378
- return N !== void 0 ? N : Y;
373
+ if (a instanceof Date && w === "HH:mm") return x ? "24:00" : fe(a);
374
+ L = {}, y || (y = m.value);
375
+ const ge = ue(a, y), r = w.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (b, S) => {
376
+ const Y = ge[S.replace(/\{|\}/g, "")];
377
+ return Y !== void 0 ? Y : S;
379
378
  });
380
- return Q ? w.replace("23:59", "24:00") : w;
381
- }, he = (a) => {
382
- const k = a.getHours(), y = a.getMinutes();
383
- return `${(k < 10 ? "0" : "") + k}:${(y < 10 ? "0" : "") + y}`;
384
- }, q = (a) => {
385
- const k = Math.floor(a / 60).toString().padStart(2, 0), y = (a % 60).toString().padStart(2, 0);
386
- return `${k}:${y}`;
387
- }, ce = (a) => {
379
+ return x ? r.replace("23:59", "24:00") : r;
380
+ }, fe = (a) => {
381
+ const w = a.getHours(), y = a.getMinutes();
382
+ return `${(w < 10 ? "0" : "") + w}:${(y < 10 ? "0" : "") + y}`;
383
+ }, G = (a) => {
384
+ const w = Math.floor(a / 60).toString().padStart(2, 0), y = (a % 60).toString().padStart(2, 0);
385
+ return `${w}:${y}`;
386
+ }, Pe = (a) => {
388
387
  if (a > 3 && a < 21) return "th";
389
388
  switch (a % 10) {
390
389
  case 1:
@@ -396,94 +395,94 @@ const st = (D, n) => {
396
395
  default:
397
396
  return "th";
398
397
  }
399
- }, ee = (a, k) => {
400
- if (b.D) return b;
401
- const y = a.getFullYear(), A = a.getMonth() + 1, Q = a.getDate(), w = (a.getDay() - 1 + 7) % 7;
402
- return b = {
398
+ }, Q = (a, w) => {
399
+ if (k.D) return k;
400
+ const y = a.getFullYear(), I = a.getMonth() + 1, x = a.getDate(), r = (a.getDay() - 1 + 7) % 7;
401
+ return k = {
403
402
  // Year.
404
403
  YYYY: y,
405
404
  // 2024.
406
405
  YY: () => y.toString().substring(2),
407
406
  // 24.
408
407
  // Month.
409
- M: A,
408
+ M: I,
410
409
  // 1 to 12.
411
- MM: () => A.toString().padStart(2, 0),
410
+ MM: () => I.toString().padStart(2, 0),
412
411
  // 01 to 12.
413
- MMM: () => k.months[A - 1].substring(0, 3),
412
+ MMM: () => w.months[I - 1].substring(0, 3),
414
413
  // Jan to Dec.
415
- MMMM: () => k.months[A - 1],
414
+ MMMM: () => w.months[I - 1],
416
415
  // January to December.
417
- MMMMG: () => (k.monthsGenitive || k.months)[A - 1],
416
+ MMMMG: () => (w.monthsGenitive || w.months)[I - 1],
418
417
  // January to December in genitive form (Greek...)
419
418
  // Day.
420
- D: Q,
419
+ D: x,
421
420
  // 1 to 31.
422
- DD: () => Q.toString().padStart(2, 0),
421
+ DD: () => x.toString().padStart(2, 0),
423
422
  // 01 to 31.
424
- S: () => ce(Q),
423
+ S: () => Pe(x),
425
424
  // st, nd, rd, th.
426
425
  // Day of the week.
427
- d: w + 1,
426
+ d: r + 1,
428
427
  // 1 to 7 with 7 = Sunday.
429
428
  // Some locales have same start for all the days, so they have specific abbrev in weekDaysShort.
430
- dd: () => k.weekDaysShort.length ? k.weekDaysShort[w] : k.weekDays[w][0],
429
+ dd: () => w.weekDaysShort.length ? w.weekDaysShort[r] : w.weekDays[r][0],
431
430
  // M to S.
432
- ddd: () => k.weekDaysShort.length ? k.weekDaysShort[w] : k.weekDays[w].substr(0, 3),
431
+ ddd: () => w.weekDaysShort.length ? w.weekDaysShort[r] : w.weekDays[r].substr(0, 3),
433
432
  // Mon to Sun.
434
- dddd: () => k.weekDays[w]
433
+ dddd: () => w.weekDays[r]
435
434
  // Monday to Sunday.
436
- }, b;
437
- }, oe = (a, k) => {
435
+ }, k;
436
+ }, ue = (a, w) => {
438
437
  if (L.am) return L;
439
- let y, A, Q;
440
- a instanceof Date ? (y = a.getHours(), A = a.getMinutes(), Q = a.getSeconds()) : (y = Math.floor(a / 60), A = Math.floor(a % 60));
441
- const c = y % 12 ? y % 12 : 12, w = (k || { am: "am", pm: "pm" })[y === 24 || y < 12 ? "am" : "pm"];
438
+ let y, I, x;
439
+ a instanceof Date ? (y = a.getHours(), I = a.getMinutes(), x = a.getSeconds()) : (y = Math.floor(a / 60), I = Math.floor(a % 60));
440
+ const ge = y % 12 ? y % 12 : 12, r = (w || { am: "am", pm: "pm" })[y === 24 || y < 12 ? "am" : "pm"];
442
441
  return L = {
443
442
  H: y,
444
- h: c,
443
+ h: ge,
445
444
  HH: y.toString().padStart(2, 0),
446
- hh: c.toString().padStart(2, 0),
447
- am: w,
448
- AM: w.toUpperCase(),
449
- m: A,
450
- mm: A.toString().padStart(2, 0),
451
- s: Q
445
+ hh: ge.toString().padStart(2, 0),
446
+ am: r,
447
+ AM: r.toUpperCase(),
448
+ m: I,
449
+ mm: I.toString().padStart(2, 0),
450
+ s: x
452
451
  }, L;
453
452
  };
454
453
  return {
455
454
  addDatePrototypes: C,
456
- removeDatePrototypes: i,
457
- updateTexts: m,
455
+ removeDatePrototypes: u,
456
+ updateTexts: f,
458
457
  addDays: W,
459
- subtractDays: G,
460
- addHours: o,
461
- subtractHours: u,
458
+ subtractDays: X,
459
+ addHours: i,
460
+ subtractHours: c,
462
461
  addMinutes: e,
463
- subtractMinutes: d,
464
- snapToInterval: f,
465
- getWeek: M,
462
+ subtractMinutes: v,
463
+ snapToInterval: g,
464
+ getWeek: $,
466
465
  isToday: P,
467
- isSameDate: B,
466
+ isSameDate: A,
468
467
  isInRange: s,
469
468
  isLeapYear: l,
470
469
  getPreviousFirstDayOfWeek: _,
471
470
  stringToDate: t,
472
471
  dateToMinutes: V,
473
- countDays: H,
474
- datesInSameTimeStep: U,
472
+ countDays: F,
473
+ datesInSameTimeStep: J,
475
474
  isValid: K,
476
- formatDate: ue,
475
+ formatDate: ie,
477
476
  formatDateLite: ae,
478
477
  formatTime: re,
479
- formatTimeLite: he,
480
- formatMinutes: q
478
+ formatTimeLite: fe,
479
+ formatMinutes: G
481
480
  };
482
- }, gt = (D) => {
483
- const { dateUtils: n, config: r } = D;
481
+ }, St = (D) => {
482
+ const { dateUtils: n, config: o } = D;
484
483
  let h = 0;
485
484
  const p = T(() => {
486
- const o = {
485
+ const i = {
487
486
  byDate: {},
488
487
  // A map of single-day events indexed by date.
489
488
  recurring: [],
@@ -492,450 +491,482 @@ const st = (D, n) => {
492
491
  // An array of events IDs that are multiday.
493
492
  byId: {}
494
493
  // A map of all the events indexed by ID for fast lookup.
495
- }, u = r.events.sort((e, d) => e.start - d.start < 0 ? -1 : 1);
496
- for (const e of u)
497
- b(e), e._ || (e._ = {}), e._.id = e._.id || ++h, e.delete || (e.delete = (d) => m(e._.id, d)), e._.deleting = !1, e._.deleted = !1, e.isOverlapping = (d = null) => e.getOverlappingEvents(d).length, e.getOverlappingEvents = (d = null) => {
498
- var f;
494
+ }, c = o.events.sort((e, v) => e.start - v.start < 0 ? -1 : 1);
495
+ for (const e of c)
496
+ k(e), e._ || (e._ = {}), e._.id = e._.id || ++h, e.delete || (e.delete = (v) => f(e._.id, v)), e._.deleting = !1, e._.deleted = !1, e.isOverlapping = (v = null) => e.getOverlappingEvents(v).length, e.getOverlappingEvents = (v = null) => {
497
+ var g;
499
498
  return W(
500
- v(n.formatDate((d == null ? void 0 : d.start) || e.start), !0),
501
- { start: (d == null ? void 0 : d.start) || e.start, end: (d == null ? void 0 : d.end) || e.end },
502
- { excludeIds: [e._.id], schedule: (f = r.schedules) != null && f.length ? ~~((d == null ? void 0 : d.schedule) || e.schedule) : null }
499
+ m(n.formatDate((v == null ? void 0 : v.start) || e.start), !0),
500
+ { start: (v == null ? void 0 : v.start) || e.start, end: (v == null ? void 0 : v.end) || e.end },
501
+ { excludeIds: [e._.id], schedule: (g = o.schedules) != null && g.length ? ~~((v == null ? void 0 : v.schedule) || e.schedule) : null }
503
502
  );
504
- }, e._.register = (d) => {
505
- e._.$el = d, e._.fireCreated && (D.emit("event-created", e), delete e._.fireCreated);
503
+ }, e._.register = (v) => {
504
+ e._.$el = v, e._.fireCreated && (D.emit("event-created", e), delete e._.fireCreated);
506
505
  }, e._.unregister = () => {
507
506
  e._.$el = null, e._.register = null, e.isOverlapping = null, e.getOverlappingEvents = null, e.delete = null;
508
- }, o.byId[e._.id] = e, e.recurring ? o.recurring.push(e._.id) : e._.multiday ? (o.multiday.push(e._.id), o.byDate[e._.startFormatted] || (o.byDate[e._.startFormatted] = []), o.byDate[e._.startFormatted].push(e._.id)) : (o.byDate[e._.startFormatted] || (o.byDate[e._.startFormatted] = []), o.byDate[e._.startFormatted].push(e._.id));
509
- return o;
510
- }), b = (o) => {
511
- if (typeof o.start == "string" && (o.start = n.stringToDate(o.start)), typeof o.end == "string" && (o.end = n.stringToDate(o.end)), o.start.setSeconds(0, 0), o.end.setSeconds(0, 0), isNaN(o.start) || isNaN(o.end)) {
512
- isNaN(o.start) ? console.error(`Vue Cal: invalid start date for event "${o.title}".`, o.start) : console.error(`Vue Cal: invalid end date for event "${o.title}".`, o.end);
507
+ }, i.byId[e._.id] = e, e.recurring ? i.recurring.push(e._.id) : e._.multiday ? (i.multiday.push(e._.id), i.byDate[e._.startFormatted] || (i.byDate[e._.startFormatted] = []), i.byDate[e._.startFormatted].push(e._.id)) : (i.byDate[e._.startFormatted] || (i.byDate[e._.startFormatted] = []), i.byDate[e._.startFormatted].push(e._.id));
508
+ return i;
509
+ }), k = (i) => {
510
+ if (typeof i.start == "string" && (i.start = n.stringToDate(i.start)), typeof i.end == "string" && (i.end = n.stringToDate(i.end)), i.start.setSeconds(0, 0), i.end.setSeconds(0, 0), isNaN(i.start) || isNaN(i.end)) {
511
+ isNaN(i.start) ? console.error(`Vue Cal: invalid start date for event "${i.title}".`, i.start) : console.error(`Vue Cal: invalid end date for event "${i.title}".`, i.end);
513
512
  return;
514
- } else o.end.getTime() < o.start.getTime() && console.error(`Vue Cal: invalid event dates for event "${o.title}". The event ends before it starts.`, o.start, o.end);
515
- o._ || (o._ = {}), o._.multiday = !n.isSameDate(o.start, new Date(o.end.getTime() - 1)), o._.startFormatted = n.formatDate(o.start), o._.startMinutes = ~~n.dateToMinutes(o.start), o._.endMinutes = ~~n.dateToMinutes(o.end);
516
- const u = o.start.getHours(), e = o.start.getMinutes().toString().padStart(2, 0), d = o.end.getHours(), f = o.end.getMinutes().toString().padStart(2, 0);
517
- o._.startTimeFormatted24 = `${u.toString().padStart(2, 0)}:${e}`, o._.startTimeFormatted12 = `${u % 12 || 12}${e ? `:${e}` : ""} ${u < 12 ? "AM" : "PM"}`, o._.endTimeFormatted24 = `${d.toString().padStart(2, 0)}:${f}`, o._.endTimeFormatted12 = `${d % 12 || 12}${f ? `:${f}` : ""} ${d < 12 ? "AM" : "PM"}`, o._.duration = Math.abs(~~((o.end - o.start) / 6e4));
518
- }, L = (o) => p.value.byId[o], v = (o, u = !1, e = !1) => {
519
- let d = p.value.byDate[o] || [];
520
- return d = u || e ? d.map(L) : d, e || (d = d.filter((f) => !f.background && !f._.deleted), u || (d = d.map((f) => f._.id))), d;
521
- }, C = (o) => {
522
- const u = {};
523
- for (const { startFormatted: e } of o) {
524
- u[e] = [];
525
- const d = v(e, !1, !0);
526
- d.length && u[e].push(...d);
513
+ } else i.end.getTime() < i.start.getTime() && console.error(`Vue Cal: invalid event dates for event "${i.title}". The event ends before it starts.`, i.start, i.end);
514
+ i._ || (i._ = {}), i._.multiday = !n.isSameDate(i.start, new Date(i.end.getTime() - 1)), i._.startFormatted = n.formatDate(i.start), i._.startMinutes = ~~n.dateToMinutes(i.start), i._.endMinutes = ~~n.dateToMinutes(i.end);
515
+ const c = i.start.getHours(), e = i.start.getMinutes().toString().padStart(2, 0), v = i.end.getHours(), g = i.end.getMinutes().toString().padStart(2, 0);
516
+ i._.startTimeFormatted24 = `${c.toString().padStart(2, 0)}:${e}`, i._.startTimeFormatted12 = `${c % 12 || 12}${e ? `:${e}` : ""} ${c < 12 ? "AM" : "PM"}`, i._.endTimeFormatted24 = `${v.toString().padStart(2, 0)}:${g}`, i._.endTimeFormatted12 = `${v % 12 || 12}${g ? `:${g}` : ""} ${v < 12 ? "AM" : "PM"}`, i._.duration = Math.abs(~~((i.end - i.start) / 6e4));
517
+ }, L = (i) => p.value.byId[i], m = (i, c = !1, e = !1) => {
518
+ let v = p.value.byDate[i] || [];
519
+ return v = c || e ? v.map(L) : v, e || (v = v.filter((g) => !g.background && !g._.deleted), c || (v = v.map((g) => g._.id))), v;
520
+ }, C = (i) => {
521
+ const c = {};
522
+ for (const { startFormatted: e } of i) {
523
+ c[e] = [];
524
+ const v = m(e, !1, !0);
525
+ v.length && c[e].push(...v);
527
526
  }
528
- return u;
529
- }, i = (o) => {
530
- if (!o.start || !o.end) {
527
+ return c;
528
+ }, u = (i) => {
529
+ if (!i.start || !i.end) {
531
530
  console.error("Vue Cal: Cannot create an event without valid start and end dates.");
532
531
  return;
533
532
  }
534
- return r.snapToInterval && (n.snapToInterval(o.start, r.snapToInterval), n.snapToInterval(o.end, r.snapToInterval)), o = { ...o }, o._ || (o._ = {}), o._.id = ++h, o._.fireCreated = !0, r.events.push(o), o;
535
- }, m = async (o, u = 0) => {
536
- var P, B;
537
- if (!o) return console.warn("Vue Cal: Cannot delete event without its ID or criteria.");
538
- let e = typeof o == "string" || !isNaN(o) ? o : null;
539
- const d = typeof o == "object" ? Object.entries(o) : null;
540
- if (d) {
541
- const [s, l] = d[0];
542
- e = (P = r.events.find((_) => _[s] === l)) == null ? void 0 : P._.id;
533
+ return o.snapToInterval && (n.snapToInterval(i.start, o.snapToInterval), n.snapToInterval(i.end, o.snapToInterval)), i = { ...i }, i._ || (i._ = {}), i._.id = ++h, i._.fireCreated = !0, o.events.push(i), i;
534
+ }, f = async (i, c = 0) => {
535
+ var P, A;
536
+ if (!i) return console.warn("Vue Cal: Cannot delete event without its ID or criteria.");
537
+ let e = typeof i == "string" || !isNaN(i) ? i : null;
538
+ const v = typeof i == "object" ? Object.entries(i) : null;
539
+ if (v) {
540
+ const [s, l] = v[0];
541
+ e = (P = o.events.find((_) => _[s] === l)) == null ? void 0 : P._.id;
543
542
  }
544
- if (!r.editableEvents.delete)
543
+ if (!o.editableEvents.delete)
545
544
  return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
546
545
  if (!e) return console.warn("Vue Cal: Cannot delete event without its ID.");
547
- const f = r.events.findIndex((s) => s._.id === e);
548
- if (f === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${e}\`.`);
549
- const M = r.events[f];
550
- if (M.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${e}\` since it was explicitely set to \`delete: false\`.`);
551
- switch (u) {
546
+ const g = o.events.findIndex((s) => s._.id === e);
547
+ if (g === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${e}\`.`);
548
+ const $ = o.events[g];
549
+ if ($.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${e}\` since it was explicitely set to \`delete: false\`.`);
550
+ switch (c) {
552
551
  case 0:
553
- M._.deleting ? r.events.splice(f, 1) : M._.deleting = !0;
552
+ $._.deleting ? o.events.splice(g, 1) : $._.deleting = !0;
554
553
  break;
555
554
  // Display the delete button.
556
555
  case 1:
557
- M._.deleting = !0;
556
+ $._.deleting = !0;
558
557
  break;
559
558
  // Visual deletion + external DOM event firing.
560
559
  // When explicitly using this stage, the event will be visually deleted but still present in the
561
560
  // source of truth until the cell is unmounted (by navigating away).
562
561
  case 2:
563
- M._.deleted = !0, r.events[f]._.deleted = !0, (B = M._.$el) == null || B.dispatchEvent(new CustomEvent("event-deleted", { detail: M._.id }));
562
+ $._.deleted = !0, o.events[g]._.deleted = !0, (A = $._.$el) == null || A.dispatchEvent(new CustomEvent("event-deleted", { detail: $._.id }));
564
563
  break;
565
564
  // Effective deletion from the source of truth (by default, when unmounting the cell).
566
565
  case 3:
567
- r.events.splice(f, 1), D.emit("update:events", r.events), D.emit("event-delete", M);
566
+ o.events.splice(g, 1), D.emit("update:events", o.events), D.emit("event-delete", $);
568
567
  break;
569
568
  }
570
569
  return !0;
571
- }, $ = (o) => {
572
- const u = v(o, !0);
573
- if (!u.length) return { cellOverlaps: {}, longestStreak: 0 };
570
+ }, M = (i) => {
571
+ const c = m(i, !0);
572
+ if (!c.length) return { cellOverlaps: {}, longestStreak: 0 };
574
573
  const e = {};
575
- let d = [], f = 0;
576
- u.sort((M, P) => M.start - P.start || M.end - M.start - (P.end - P.start));
577
- for (const M of u) {
578
- const P = M._.id;
579
- e[P] || (e[P] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), d = d.filter((t) => t.end > M.start);
580
- let B = d.filter((t) => {
581
- var H;
582
- return (!((H = r.schedules) != null && H.length) || M.schedule === t.schedule) && t.start < M.end;
583
- }), s = new Set(B.map((t) => {
574
+ let v = [], g = 0;
575
+ c.sort(($, P) => $.start - P.start || $.end - $.start - (P.end - P.start));
576
+ for (const $ of c) {
577
+ const P = $._.id;
578
+ e[P] || (e[P] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), v = v.filter((t) => t.end > $.start);
579
+ let A = v.filter((t) => {
580
+ var F;
581
+ return (!((F = o.schedules) != null && F.length) || $.schedule === t.schedule) && t.start < $.end;
582
+ }), s = new Set(A.map((t) => {
584
583
  var V;
585
584
  return ((V = e[t._.id]) == null ? void 0 : V.position) ?? 0;
586
585
  })), l = 0;
587
586
  for (; s.has(l); ) l++;
588
- e[P].position = l, d.push(M);
589
- let _ = Math.max(1, ...B.map((t) => {
587
+ e[P].position = l, v.push($);
588
+ let _ = Math.max(1, ...A.map((t) => {
590
589
  var V;
591
590
  return ((V = e[t._.id]) == null ? void 0 : V.maxConcurrent) ?? 1;
592
591
  }));
593
- e[P].maxConcurrent = Math.max(B.length + 1, _);
594
- for (const t of B)
592
+ e[P].maxConcurrent = Math.max(A.length + 1, _);
593
+ for (const t of A)
595
594
  e[t._.id].overlaps.add(P), e[P].overlaps.add(t._.id), e[t._.id].maxConcurrent = e[P].maxConcurrent;
596
- f = Math.max(f, e[P].maxConcurrent);
595
+ g = Math.max(g, e[P].maxConcurrent);
597
596
  }
598
- for (const M in e) e[M].overlaps = [...e[M].overlaps];
599
- return { cellOverlaps: e, longestStreak: f };
600
- }, W = (o = [], { start: u, end: e }, { excludeIds: d = [], schedule: f = null }) => {
601
- var B;
602
- const M = new Set(d), P = [];
603
- for (const s of o)
604
- !M.has((B = s._) == null ? void 0 : B.id) && (f === null || f === s.schedule) && G(s, u, e) && P.push(s);
597
+ for (const $ in e) e[$].overlaps = [...e[$].overlaps];
598
+ return { cellOverlaps: e, longestStreak: g };
599
+ }, W = (i = [], { start: c, end: e }, { excludeIds: v = [], schedule: g = null }) => {
600
+ var A;
601
+ const $ = new Set(v), P = [];
602
+ for (const s of i)
603
+ !$.has((A = s._) == null ? void 0 : A.id) && (g === null || g === s.schedule) && X(s, c, e) && P.push(s);
605
604
  return P;
606
- }, G = (o, u, e) => {
607
- const d = o.allDay || !r.time, f = d ? new Date(o.start).setHours(0, 0, 0, 0) : o.start.getTime(), M = d ? new Date(o.end).setHours(23, 59, 59, 999) : o.end.getTime(), P = d ? new Date(u).setHours(0, 0, 0, 0) : u.getTime(), B = d ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
608
- return M > P && f < B;
605
+ }, X = (i, c, e) => {
606
+ const v = i.allDay || !o.time, g = v ? new Date(i.start).setHours(0, 0, 0, 0) : i.start.getTime(), $ = v ? new Date(i.end).setHours(23, 59, 59, 999) : i.end.getTime(), P = v ? new Date(c).setHours(0, 0, 0, 0) : c.getTime(), A = v ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
607
+ return $ > P && g < A;
609
608
  };
610
609
  return {
611
610
  events: p,
612
611
  getEvent: L,
613
- getEventsByDate: v,
612
+ getEventsByDate: m,
614
613
  getViewEvents: C,
615
- getCellOverlappingEvents: $,
614
+ getCellOverlappingEvents: M,
616
615
  getEventsInRange: W,
617
- createEvent: i,
618
- deleteEvent: m,
619
- isEventInRange: G
616
+ createEvent: u,
617
+ deleteEvent: f,
618
+ isEventInRange: X
620
619
  };
621
- }, ht = ({ config: D, dateUtils: n, emit: r, texts: h, eventsManager: p }, b) => {
622
- const { availableViews: L } = D, v = ie(D.view && L[D.view] ? D.view : D.defaultView), C = ie(D.selectedDate || null), i = ie(/* @__PURE__ */ new Date()), m = ie(new Date(D.viewDate || i.value));
623
- m.value.setHours(0, 0, 0, 0);
624
- const $ = ie(new Date(m));
620
+ }, Ct = ({ config: D, dateUtils: n, emit: o, texts: h, eventsManager: p }, k) => {
621
+ const { availableViews: L } = D, m = oe(D.view && L[D.view] ? D.view : D.defaultView), C = oe(D.selectedDate || null), u = oe(/* @__PURE__ */ new Date()), f = oe(new Date(D.viewDate || u.value));
622
+ f.value.setHours(0, 0, 0, 0);
623
+ const M = oe(new Date(f));
625
624
  let W = null;
626
- const G = T(() => v.value === "month" ? $.value : l.value), o = T(() => v.value === "month" ? new Date($.value.getFullYear(), $.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), u = T(() => v.value === "week" ? n.getPreviousFirstDayOfWeek(l.value, D.startWeekOnSunday) : v.value === "month" ? l.value : G.value), e = T(() => {
627
- if (v.value === "week") {
628
- const g = n.addDays(u.value, 7);
629
- return g.setMilliseconds(-1), g;
625
+ const X = T(() => m.value === "month" ? M.value : l.value), i = T(() => m.value === "month" ? new Date(M.value.getFullYear(), M.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), c = T(() => m.value === "week" ? n.getPreviousFirstDayOfWeek(l.value, D.startWeekOnSunday) : m.value === "month" ? l.value : X.value), e = T(() => {
626
+ if (m.value === "week") {
627
+ const d = n.addDays(c.value, 7);
628
+ return d.setMilliseconds(-1), d;
630
629
  }
631
- return v.value === "month" ? t.value : o.value;
632
- }), d = T(() => {
633
- const g = i.value.getTime();
634
- if (v.value === "week")
635
- return u.value.getTime() <= g && g <= e.value.getTime();
636
- const z = l.value.getTime(), R = t.value.getTime();
637
- return z <= g && g <= R;
630
+ return m.value === "month" ? t.value : i.value;
631
+ }), v = T(() => {
632
+ const d = u.value.getTime();
633
+ if (m.value === "week")
634
+ return c.value.getTime() <= d && d <= e.value.getTime();
635
+ const z = l.value.getTime(), U = t.value.getTime();
636
+ return z <= d && d <= U;
638
637
  });
639
- function f() {
640
- i.value = /* @__PURE__ */ new Date(), W = setTimeout(f, 60 * 1e3);
638
+ function g() {
639
+ u.value = /* @__PURE__ */ new Date(), W = setTimeout(g, 60 * 1e3);
641
640
  }
642
- function M() {
643
- W = setTimeout(f, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), f();
641
+ function $() {
642
+ W = setTimeout(g, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), g();
644
643
  }
645
644
  const P = T(() => {
646
- if (!D.availableViews[v.value]) return 1;
647
- let g = D.availableViews[v.value].cols;
648
- return D.hasHiddenDays && ["week", "month"].includes(v.value) && (g -= D.hasHiddenDays), g;
649
- }), B = T(() => {
650
- var g;
651
- return ((g = D.availableViews[v.value]) == null ? void 0 : g.rows) || 1;
652
- }), s = T(() => P.value * B.value), l = T(() => {
653
- if (v.value === "month") {
654
- let g = $.value.getDay() || 7;
655
- return D.startWeekOnSunday && !D.hideWeekdays[7] && (g += 1), D.viewDayOffset && (g -= D.viewDayOffset), n.subtractDays($.value, g - 1);
645
+ if (!D.availableViews[m.value]) return 1;
646
+ let d = D.availableViews[m.value].cols;
647
+ return D.hasHiddenDays && ["week", "month"].includes(m.value) && (d -= D.hasHiddenDays), d;
648
+ }), A = T(() => {
649
+ var d;
650
+ return ((d = D.availableViews[m.value]) == null ? void 0 : d.rows) || 1;
651
+ }), s = T(() => P.value * A.value), l = T(() => {
652
+ if (m.value === "month") {
653
+ let d = M.value.getDay() || 7;
654
+ return D.startWeekOnSunday && !D.hideWeekdays[7] && (d += 1), D.viewDayOffset && (d -= D.viewDayOffset), n.subtractDays(M.value, d - 1);
656
655
  }
657
- if (v.value === "week") {
658
- const g = "1234567".split("").filter((R) => !Object.keys(D.hideWeekdays).includes(R));
659
- let z = Math.min(...g);
660
- return D.startWeekOnSunday && !D.hideWeekdays[7] && (z = 1), D.viewDayOffset && (z += D.viewDayOffset), n.addDays($.value, z - 1);
656
+ if (m.value === "week") {
657
+ const d = "1234567".split("").filter((U) => !Object.keys(D.hideWeekdays).includes(U));
658
+ let z = Math.min(...d);
659
+ return D.startWeekOnSunday && !D.hideWeekdays[7] && (z = 1), D.viewDayOffset && (z += D.viewDayOffset), n.addDays(M.value, z - 1);
661
660
  }
662
- return $.value;
661
+ return M.value;
663
662
  }), _ = T(() => {
664
- const g = [], z = ["days", "week", "month"].includes(v.value);
665
- let R = 0;
666
- for (let X = 0; X < s.value + R; X++)
667
- switch (v.value) {
663
+ const d = [], z = ["days", "week", "month"].includes(m.value);
664
+ let U = 0;
665
+ for (let R = 0; R < s.value + U; R++)
666
+ switch (m.value) {
668
667
  case "day":
669
668
  case "days":
670
669
  case "week":
671
670
  case "month": {
672
- const ve = n.addDays(l.value, X), We = ve.getDay() || 7;
671
+ const ce = n.addDays(l.value, R), We = ce.getDay() || 7;
673
672
  if (z && D.hasHiddenDays && D.hideWeekdays[We]) {
674
- R++;
673
+ U++;
675
674
  continue;
676
675
  }
677
- const Ce = new Date(ve);
678
- Ce.setHours(23, 59, 59, 999), g.push({ start: ve, startFormatted: n.formatDate(ve), end: Ce });
676
+ const Se = new Date(ce);
677
+ Se.setHours(23, 59, 59, 999), d.push({ start: ce, startFormatted: n.formatDate(ce), end: Se });
679
678
  break;
680
679
  }
681
680
  case "year":
682
- g.push({
683
- start: new Date(l.value.getFullYear(), X, 1, 0, 0, 0, 0),
684
- end: new Date(l.value.getFullYear(), X + 1, 0, 23, 59, 59, 999)
681
+ d.push({
682
+ start: new Date(l.value.getFullYear(), R, 1, 0, 0, 0, 0),
683
+ end: new Date(l.value.getFullYear(), R + 1, 0, 23, 59, 59, 999)
685
684
  });
686
685
  break;
687
686
  case "years":
688
- g.push({
689
- start: new Date(l.value.getFullYear() + X, 0, 1, 0, 0, 0, 0),
690
- end: new Date(l.value.getFullYear() + X + 1, 0, 0, 23, 59, 59, 999)
687
+ d.push({
688
+ start: new Date(l.value.getFullYear() + R, 0, 1, 0, 0, 0, 0),
689
+ end: new Date(l.value.getFullYear() + R + 1, 0, 0, 23, 59, 59, 999)
691
690
  });
692
691
  break;
693
692
  }
694
- return g;
695
- }), t = T(() => _.value[_.value.length - 1].end), V = ie("right"), H = T(() => {
696
- const g = Object.keys(D.availableViews);
697
- return g[g.indexOf(v.value) + 1];
698
- }), U = T(() => {
699
- const g = Object.keys(D.availableViews);
700
- return g[g.indexOf(v.value) - 1];
693
+ return d;
694
+ }), t = T(() => _.value[_.value.length - 1].end), V = oe("right"), F = T(() => {
695
+ const d = Object.keys(D.availableViews);
696
+ return d[d.indexOf(m.value) + 1];
697
+ }), J = T(() => {
698
+ const d = Object.keys(D.availableViews);
699
+ return d[d.indexOf(m.value) - 1];
701
700
  });
702
- function K(g, z, R = !1) {
703
- if (!z || !z[g]) return g + 1;
704
- const X = z[g];
705
- return R && typeof X == "string" ? X.substring(0, 3) : X;
701
+ function K(d, z, U = !1) {
702
+ if (!z || !z[d]) return d + 1;
703
+ const R = z[d];
704
+ return U && typeof R == "string" ? R.substring(0, 3) : R;
706
705
  }
707
- function ue(g, z, R) {
708
- const { monthsArray: X, monthBeforeDay: ve, canTruncate: We, xs: Ce } = R, Me = g.getMonth(), Ye = g.getFullYear(), Ee = z.getMonth(), He = z.getFullYear(), Be = Me !== Ee, lt = Ye !== He, ke = We && (Ce || Be), Le = g.getDate(), ze = z.getDate();
709
- return lt ? ve ? `${K(Me, X, ke)} ${Le}, ${Ye} - ${K(Ee, X, ke)} ${ze}, ${He}` : `${Le} ${K(Me, X, ke)} ${Ye} - ${ze} ${K(Ee, X, ke)} ${He}` : Be ? ve ? `${K(Me, X, ke)} ${Le} - ${K(Ee, X, ke)} ${ze}, ${Ye}` : `${Le} ${K(Me, X, ke)} - ${ze} ${K(Ee, X, ke)} ${Ye}` : ve ? `${K(Me, X, ke)} ${Le}-${ze}, ${Ye}` : `${Le}-${ze} ${K(Me, X, ke)} ${Ye}`;
706
+ function ie(d, z, U) {
707
+ const { monthsArray: R, monthBeforeDay: ce, canTruncate: We, xs: Se } = U, Me = d.getMonth(), $e = d.getFullYear(), Ye = z.getMonth(), Fe = z.getFullYear(), Ae = Me !== Ye, pt = $e !== Fe, _e = We && (Se || Ae), Le = d.getDate(), ze = z.getDate();
708
+ return pt ? ce ? `${K(Me, R, _e)} ${Le}, ${$e} - ${K(Ye, R, _e)} ${ze}, ${Fe}` : `${Le} ${K(Me, R, _e)} ${$e} - ${ze} ${K(Ye, R, _e)} ${Fe}` : Ae ? ce ? `${K(Me, R, _e)} ${Le} - ${K(Ye, R, _e)} ${ze}, ${$e}` : `${Le} ${K(Me, R, _e)} - ${ze} ${K(Ye, R, _e)} ${$e}` : ce ? `${K(Me, R, _e)} ${Le}-${ze}, ${$e}` : `${Le}-${ze} ${K(Me, R, _e)} ${$e}`;
710
709
  }
711
710
  const ae = T(() => {
712
- const { dateFormat: g, months: z, monthsGenitive: R, week: X, truncations: ve } = h, We = D.locale, Ce = ve !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ye = R && We === "el" ? R : z;
713
- switch (v.value) {
711
+ const { dateFormat: d, months: z, monthsGenitive: U, week: R, truncations: ce } = h, We = D.locale, Se = ce !== !1, Me = d.indexOf("M") < d.indexOf("D"), $e = U && We === "el" ? U : z;
712
+ switch (m.value) {
714
713
  case "day":
715
- return n.formatDate(l.value, g);
714
+ return n.formatDate(l.value, d);
716
715
  case "days":
717
716
  case "week": {
718
- const Ee = {
719
- monthsArray: Ye,
717
+ const Ye = {
718
+ monthsArray: $e,
720
719
  monthBeforeDay: Me,
721
- canTruncate: Ce,
720
+ canTruncate: Se,
722
721
  xs: D.xs
723
722
  };
724
- let He = ue(l.value, t.value, Ee);
725
- if (v.value === "week") {
726
- const Be = n.getWeek(
723
+ let Fe = ie(l.value, t.value, Ye);
724
+ if (m.value === "week") {
725
+ const Ae = n.getWeek(
727
726
  l.value,
728
727
  D.startWeekOnSunday && !D.hideWeekdays[7]
729
728
  );
730
- He += ` <small>${X} ${Be}</small>`;
729
+ Fe += ` <small>${R} ${Ae}</small>`;
731
730
  }
732
- return He;
731
+ return Fe;
733
732
  }
734
733
  case "month": {
735
- const Ee = `${D.xs && Ce ? "MMM" : "MMMM"} YYYY`;
736
- return n.formatDate(G.value, Ee);
734
+ const Ye = `${D.xs && Se ? "MMM" : "MMMM"} YYYY`;
735
+ return n.formatDate(X.value, Ye);
737
736
  }
738
737
  case "year":
739
738
  return l.value.getFullYear();
740
739
  case "years":
741
- return `${l.value.getFullYear()} - ${o.value.getFullYear()}`;
740
+ return `${l.value.getFullYear()} - ${i.value.getFullYear()}`;
742
741
  }
743
742
  });
744
743
  function re() {
745
- switch ($.value = new Date(m.value || i.value), $.value.setHours(0, 0, 0, 0), v.value) {
744
+ switch (M.value = new Date(f.value || u.value), M.value.setHours(0, 0, 0, 0), m.value) {
746
745
  case "day":
747
746
  break;
748
747
  case "days":
749
748
  break;
750
749
  case "week":
751
- $.value = n.getPreviousFirstDayOfWeek($.value, D.startWeekOnSunday && !D.hideWeekdays[7]);
750
+ M.value = n.getPreviousFirstDayOfWeek(M.value, D.startWeekOnSunday && !D.hideWeekdays[7]);
752
751
  break;
753
752
  case "month":
754
- $.value = new Date($.value.getFullYear(), $.value.getMonth(), 1, 0, 0, 0, 0);
753
+ M.value = new Date(M.value.getFullYear(), M.value.getMonth(), 1, 0, 0, 0, 0);
755
754
  break;
756
755
  case "year":
757
- $.value = new Date($.value.getFullYear(), 0, 1, 0, 0, 0, 0);
756
+ M.value = new Date(M.value.getFullYear(), 0, 1, 0, 0, 0, 0);
758
757
  break;
759
758
  case "years":
760
- $.value = new Date($.value.getFullYear() - $.value.getFullYear() % s.value, 0, 1, 0, 0, 0, 0);
759
+ M.value = new Date(M.value.getFullYear() - M.value.getFullYear() % s.value, 0, 1, 0, 0, 0, 0);
761
760
  break;
762
761
  }
763
- D.ready && r("view-change", {
764
- id: v.value,
762
+ D.ready && o("view-change", {
763
+ id: m.value,
765
764
  title: ae.value,
766
- start: G.value,
767
- end: o.value,
768
- extendedStart: u.value,
765
+ start: X.value,
766
+ end: i.value,
767
+ extendedStart: c.value,
769
768
  extendedEnd: e.value,
770
769
  cellDates: _.value,
771
- containsToday: d.value,
772
- events: x.value
773
- }), i.value = /* @__PURE__ */ new Date();
770
+ containsToday: v.value,
771
+ events: B.value
772
+ }), u.value = /* @__PURE__ */ new Date();
774
773
  }
775
- function he(g) {
776
- const z = v.value, R = D.availableViews[z];
777
- g[z] && JSON.stringify(g[z]) === JSON.stringify(R) || re();
774
+ function fe(d) {
775
+ const z = m.value, U = D.availableViews[z];
776
+ d[z] && JSON.stringify(d[z]) === JSON.stringify(U) || re();
778
777
  }
779
- function q(g, z = !0) {
780
- const R = Object.keys(D.availableViews);
781
- v.value !== g && (R.includes(g) ? (V.value = R.indexOf(g) < R.indexOf(v.value) ? "left" : "right", v.value = g, r("update:view", g), re()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
778
+ function G(d, z = !0) {
779
+ const U = Object.keys(D.availableViews);
780
+ m.value !== d && (U.includes(d) ? (V.value = U.indexOf(d) < U.indexOf(m.value) ? "left" : "right", m.value = d, o("update:view", d), re()) : console.warn(`Vue Cal: the \`${d}\` view is not available.`));
782
781
  }
783
- function ce() {
784
- H.value ? q(H.value) : console.warn("Vue Cal: no broader view is available.");
782
+ function Pe() {
783
+ F.value ? G(F.value) : console.warn("Vue Cal: no broader view is available.");
785
784
  }
786
- function ee() {
787
- U.value ? q(U.value) : console.warn("Vue Cal: no narrower view is available.");
785
+ function Q() {
786
+ J.value ? G(J.value) : console.warn("Vue Cal: no narrower view is available.");
788
787
  }
789
- function oe() {
790
- k(!1);
788
+ function ue() {
789
+ w(!1);
791
790
  }
792
791
  function a() {
793
- k(!0);
792
+ w(!0);
794
793
  }
795
- function k(g = !0) {
796
- let z = new Date(m.value);
797
- switch (v.value) {
794
+ function w(d = !0) {
795
+ let z = new Date(f.value);
796
+ switch (m.value) {
798
797
  case "day":
799
798
  case "days":
800
- g ? z = n.addDays(t.value, 1) : z = n.subtractDays(l.value, s.value);
799
+ d ? z = n.addDays(t.value, 1) : z = n.subtractDays(l.value, s.value);
801
800
  break;
802
801
  case "week": {
803
- g ? (z = n.addDays(e.value, 1), z.setHours(0, 0, 0, 0)) : z = n.subtractDays(u.value, s.value);
802
+ d ? (z = n.addDays(e.value, 1), z.setHours(0, 0, 0, 0)) : z = n.subtractDays(c.value, s.value);
804
803
  break;
805
804
  }
806
805
  case "month": {
807
- const R = g ? 1 : -1;
808
- z = new Date(z.getFullYear(), z.getMonth() + R, 1, 0, 0, 0, 0);
806
+ const U = d ? 1 : -1;
807
+ z = new Date(z.getFullYear(), z.getMonth() + U, 1, 0, 0, 0, 0);
809
808
  break;
810
809
  }
811
810
  case "year": {
812
- const R = g ? 1 : -1;
813
- z = new Date(z.getFullYear() + R, 1, 1, 0, 0, 0, 0);
811
+ const U = d ? 1 : -1;
812
+ z = new Date(z.getFullYear() + U, 1, 1, 0, 0, 0, 0);
814
813
  break;
815
814
  }
816
815
  case "years": {
817
- const R = g ? s.value : -s.value;
818
- z = new Date(z.getFullYear() + R, 1, 1, 0, 0, 0, 0);
816
+ const U = d ? s.value : -s.value;
817
+ z = new Date(z.getFullYear() + U, 1, 1, 0, 0, 0, 0);
819
818
  break;
820
819
  }
821
820
  }
822
- A(z);
821
+ I(z);
823
822
  }
824
823
  function y() {
825
- const g = /* @__PURE__ */ new Date();
826
- g.setHours(0, 0, 0, 0), A(g);
824
+ const d = /* @__PURE__ */ new Date();
825
+ d.setHours(0, 0, 0, 0), I(d);
827
826
  }
828
- function A(g, z = !0, R = !1) {
829
- if (!n.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
830
- let [X, ve] = [l.value, t.value];
831
- v.value === "month" && ([X, ve] = [G.value, o.value]), (!n.isInRange(g, X, ve) || R) && (g.setHours(0, 0, 0, 0), V.value = g.getTime() < X.getTime() ? "left" : "right", m.value = g, z && r("update:viewDate", g), re());
827
+ function I(d, z = !0, U = !1) {
828
+ if (!n.isValid(d)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
829
+ let [R, ce] = [l.value, t.value];
830
+ m.value === "month" && ([R, ce] = [X.value, i.value]), (!n.isInRange(d, R, ce) || U) && (d.setHours(0, 0, 0, 0), V.value = d.getTime() < R.getTime() ? "left" : "right", f.value = d, z && o("update:viewDate", d), re());
832
831
  }
833
- function Q(g, z = !0) {
834
- if (!n.isValid(g)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
835
- const { isValid: R, isSameDate: X } = n;
836
- (!C.value || !R(C.value) || !X(g, C.value)) && (g.setHours(0, 0, 0, 0), C.value = g, z && r("update:selectedDate", g));
832
+ function x(d, z = !0) {
833
+ if (!n.isValid(d)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
834
+ const { isValid: U, isSameDate: R } = n;
835
+ (!C.value || !U(C.value) || !R(d, C.value)) && (d.setHours(0, 0, 0, 0), C.value = d, z && o("update:selectedDate", d));
837
836
  }
838
- function c(g) {
839
- !g && !$.value.getDay() ? A(n.addDays($.value, 1), !0, !0) : (V.value = "left", re());
837
+ function ge(d) {
838
+ !d && !M.value.getDay() ? I(n.addDays(M.value, 1), !0, !0) : (V.value = "left", re());
840
839
  }
841
- function w(g) {
842
- g && D.startWeekOnSunday && !$.value.getDay() ? A(n.addDays($.value, 1), !0, !0) : !g && D.startWeekOnSunday && $.value.getDay() === 1 && A(n.subtractDays($.value, 1), !0, !0);
840
+ function r(d) {
841
+ d && D.startWeekOnSunday && !M.value.getDay() ? I(n.addDays(M.value, 1), !0, !0) : !d && D.startWeekOnSunday && M.value.getDay() === 1 && I(n.subtractDays(M.value, 1), !0, !0);
843
842
  }
844
- function S() {
843
+ function b() {
845
844
  console.log("toggling weekdays", D.hideWeekdays);
846
845
  }
847
- function Y(g) {
848
- var X;
849
- const z = (X = b.value) == null ? void 0 : X.querySelector(".vuecal__scrollable"), R = g ? g * D.timeCellHeight / D.timeStep : 0;
850
- z == null || z.scrollTo({ top: R, behavior: "smooth" });
846
+ function S(d) {
847
+ var R;
848
+ const z = (R = k.value) == null ? void 0 : R.querySelector(".vuecal__scrollable"), U = d ? d * D.timeCellHeight / D.timeStep : 0;
849
+ z == null || z.scrollTo({ top: U, behavior: "smooth" });
851
850
  }
852
- function N() {
853
- const g = /* @__PURE__ */ new Date();
854
- Y(g.getHours() * 60 + g.getMinutes());
851
+ function Y() {
852
+ const d = /* @__PURE__ */ new Date();
853
+ S(d.getHours() * 60 + d.getMinutes());
855
854
  }
856
- function I() {
857
- Y(0);
855
+ function N() {
856
+ S(0);
858
857
  }
859
- const x = T(() => p.getViewEvents(_.value)), de = p.createEvent, ye = p.deleteEvent;
860
- return me(() => D.view, (g) => q(g, !1)), me(() => D.availableViews, he), me(() => D.datePicker, () => q("month", !1)), me(() => D.viewDate, (g) => A(g, !1)), me(() => D.selectedDate, (g) => Q(g, !1)), me(() => D.startWeekOnSunday, (g) => c(g)), me(() => D.hideWeekends, (g) => w(g)), me(() => D.hideWeekdays, S), me(() => s.value, () => {
858
+ const B = T(() => p.getViewEvents(_.value)), ee = p.createEvent, ye = p.deleteEvent;
859
+ return de(() => D.view, (d) => G(d, !1)), de(() => D.availableViews, fe), de(() => D.datePicker, () => G("month", !1)), de(() => D.viewDate, (d) => I(d, !1)), de(() => D.selectedDate, (d) => x(d, !1)), de(() => D.startWeekOnSunday, (d) => ge(d)), de(() => D.hideWeekends, (d) => r(d)), de(() => D.hideWeekdays, b), de(() => s.value, () => {
861
860
  s.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
862
- }), me(() => D.watchRealTime, (g) => {
863
- g && D.time ? M() : W = clearTimeout(W);
864
- }), re(), D.time && D.watchRealTime && M(), Xe(() => W = clearTimeout(W)), {
865
- now: i,
866
- id: v,
867
- broaderView: H,
868
- narrowerView: U,
861
+ }), de(() => D.watchRealTime, (d) => {
862
+ d && D.time ? $() : W = clearTimeout(W);
863
+ }), re(), D.time && D.watchRealTime && $(), Xe(() => W = clearTimeout(W)), {
864
+ now: u,
865
+ id: m,
866
+ broaderView: F,
867
+ narrowerView: J,
869
868
  title: ae,
870
- viewDate: m,
871
- start: G,
872
- end: o,
873
- extendedStart: u,
869
+ viewDate: f,
870
+ start: X,
871
+ end: i,
872
+ extendedStart: c,
874
873
  // Full range, including out of scope month days, and hidden leading/trailing days.
875
874
  extendedEnd: e,
876
875
  // Full range, including out of scope month days, and hidden leading/trailing days.
877
876
  firstCellDate: l,
878
877
  lastCellDate: t,
879
- containsToday: d,
878
+ containsToday: v,
880
879
  selectedDate: C,
881
880
  cellDates: _,
882
881
  cols: P,
883
- rows: B,
882
+ rows: A,
884
883
  // All the events are stored and indexed in the events object of the eventsManager.
885
884
  // The following events array is only a subset of visible ones, plus any potential recurring
886
885
  // and multi-day events.
887
- events: x,
886
+ events: B,
888
887
  transitionDirection: V,
889
- switch: q,
890
- broader: ce,
891
- narrower: ee,
892
- previous: oe,
888
+ switch: G,
889
+ broader: Pe,
890
+ narrower: Q,
891
+ previous: ue,
893
892
  next: a,
894
- navigate: k,
893
+ navigate: w,
895
894
  goToToday: y,
896
- updateViewDate: A,
897
- updateSelectedDate: Q,
898
- scrollToCurrentTime: N,
899
- scrollToTime: Y,
900
- scrollTop: I,
901
- createEvent: de,
895
+ updateViewDate: I,
896
+ updateSelectedDate: x,
897
+ scrollToCurrentTime: Y,
898
+ scrollToTime: S,
899
+ scrollTop: N,
900
+ createEvent: ee,
902
901
  deleteEvent: ye,
903
902
  // Getters.
904
903
  get isDay() {
905
- return v.value === "day";
904
+ return m.value === "day";
906
905
  },
907
906
  get isDays() {
908
- return v.value === "days";
907
+ return m.value === "days";
909
908
  },
910
909
  get isWeek() {
911
- return v.value === "week";
910
+ return m.value === "week";
912
911
  },
913
912
  get isMonth() {
914
- return v.value === "month";
913
+ return m.value === "month";
915
914
  },
916
915
  get isYear() {
917
- return v.value === "year";
916
+ return m.value === "year";
918
917
  },
919
918
  get isYears() {
920
- return v.value === "years";
919
+ return m.value === "years";
921
920
  }
922
921
  };
923
- }, Fe = $e({
924
- texts: { ...fe.texts },
922
+ }, lt = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], rt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ot = "Years", it = "Year", ut = "Month", ct = "Week", dt = "Days", vt = "Day", mt = "Today", ft = "No Event", gt = "All day", ht = "Delete", yt = "Create an event", Dt = "dddd, MMMM D, YYYY", Ke = {
923
+ weekDays: lt,
924
+ months: rt,
925
+ years: ot,
926
+ year: it,
927
+ month: ut,
928
+ week: ct,
929
+ days: dt,
930
+ day: vt,
931
+ today: mt,
932
+ noEvent: ft,
933
+ allDay: gt,
934
+ deleteEvent: ht,
935
+ createEvent: yt,
936
+ dateFormat: Dt
937
+ }, Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
938
+ __proto__: null,
939
+ allDay: gt,
940
+ createEvent: yt,
941
+ dateFormat: Dt,
942
+ day: vt,
943
+ days: dt,
944
+ default: Ke,
945
+ deleteEvent: ht,
946
+ month: ut,
947
+ months: rt,
948
+ noEvent: ft,
949
+ today: mt,
950
+ week: ct,
951
+ weekDays: lt,
952
+ year: it,
953
+ years: ot
954
+ }, Symbol.toStringTag, { value: "Module" })), He = Te({
955
+ texts: { ...ve.texts },
925
956
  // Make texts reactive before a locale is loaded.
926
- dateUtils: st(fe.texts, nt)
957
+ dateUtils: st(ve.texts, Ke)
927
958
  // Some Date utils functions need localized texts.
928
- }), yt = ({ props: D, emit: n, attrs: r, vuecalEl: h, uid: p }) => {
929
- const b = $e({
959
+ }), Ot = ({ props: D, emit: n, attrs: o, vuecalEl: h, uid: p }) => {
960
+ const k = Te({
930
961
  uid: p,
931
962
  // The Vuecal instance unique ID, used for dnd source-target identification.
932
963
  emit: n,
933
- texts: { ...Fe.texts },
964
+ texts: { ...He.texts },
934
965
  // Make texts reactive before a locale is loaded.
935
966
  // The date utils composable.
936
967
  // A class/composable is needed in order to access the user locale in all the methods, and
937
968
  // independently of other potential Vue Cal instances on the same page.
938
- dateUtils: { ...Fe.dateUtils },
969
+ dateUtils: { ...He.dateUtils },
939
970
  now: /* @__PURE__ */ new Date(),
940
971
  config: {},
941
972
  eventsManager: {},
@@ -950,8 +981,8 @@ const st = (D, n) => {
950
981
  isResizingEvent: !1
951
982
  }
952
983
  });
953
- return b.dateUtils = st(Object.assign(fe.texts, b.texts), nt), b.config = mt(b, D, r), b.eventsManager = gt(b), b.view = ht(b, h), b.dnd = ft(b), b;
954
- }, Dt = 24 * 60, pt = {
984
+ return k.dateUtils = st(Object.assign(ve.texts, k.texts), Ke), k.config = Yt(k, D, o), k.eventsManager = St(k), k.view = Ct(k, h), k.dnd = Et(k), k;
985
+ }, jt = 24 * 60, Pt = {
955
986
  allDayEvents: { type: [Boolean, String], default: !1 },
956
987
  // Coming soon.
957
988
  // avoidEventOverlap: { type: Boolean, default: undefined }, // Coming soon.
@@ -1015,7 +1046,7 @@ const st = (D, n) => {
1015
1046
  // Start time of the time column, in minutes.
1016
1047
  timeStep: { type: Number, default: 60 },
1017
1048
  // Step amount for the time in the time column, in minutes.
1018
- timeTo: { type: Number, default: Dt },
1049
+ timeTo: { type: Number, default: jt },
1019
1050
  // End time of the time column, in minutes.
1020
1051
  titleBar: { type: Boolean, default: !0 },
1021
1052
  // Show or hide the header title bar.
@@ -1047,62 +1078,62 @@ const st = (D, n) => {
1047
1078
  // minScheduleWidth: { type: Number, default: 0 },
1048
1079
  // overlapsPerTimeStep: { type: Boolean, default: false },
1049
1080
  // resizeX: { type: Boolean, default: false },
1050
- }, wt = { class: "vuecal__header" }, _t = {
1081
+ }, Ft = { class: "vuecal__header" }, Lt = {
1051
1082
  key: 0,
1052
1083
  class: "vuecal__views-bar"
1053
- }, kt = ["onClick", "innerHTML"], bt = {
1084
+ }, zt = ["onClick", "innerHTML"], Ht = {
1054
1085
  key: 1,
1055
1086
  class: "vuecal__title-bar"
1056
- }, Tt = { class: "vuecal__transition-wrap" }, $t = ["disabled", "innerHTML"], Mt = {
1087
+ }, Nt = { class: "vuecal__transition-wrap" }, Wt = ["disabled", "innerHTML"], At = {
1057
1088
  __name: "header",
1058
1089
  setup(D) {
1059
- const n = Ne("vuecal"), { view: r, config: h } = n, p = () => {
1060
- h.clickToNavigate && r.broader();
1061
- }, b = T(() => h.clickToNavigate ? { click: p } : {});
1062
- return (L, v) => (E(), j("div", wt, [
1063
- F(L.$slots, "header", {
1064
- view: O(r),
1090
+ const n = Ne("vuecal"), { view: o, config: h } = n, p = () => {
1091
+ h.clickToNavigate && o.broader();
1092
+ }, k = T(() => h.clickToNavigate ? { click: p } : {});
1093
+ return (L, m) => (E(), j("div", Ft, [
1094
+ H(L.$slots, "header", {
1095
+ view: O(o),
1065
1096
  availableViews: O(h).availableViews,
1066
1097
  vuecal: O(n)
1067
1098
  }),
1068
- L.$slots.header ? Z("", !0) : (E(), j(te, { key: 0 }, [
1069
- O(h).viewsBar ? (E(), j("div", _t, [
1070
- (E(!0), j(te, null, we(O(h).availableViews, (C, i) => (E(), j("button", {
1071
- class: _e(["vuecal__view-button", { "vuecal__view-button--active": O(r).id === i }]),
1072
- onClick: (m) => O(r).switch(i),
1073
- innerHTML: O(n).texts[i],
1099
+ L.$slots.header ? q("", !0) : (E(), j(te, { key: 0 }, [
1100
+ O(h).viewsBar ? (E(), j("div", Lt, [
1101
+ (E(!0), j(te, null, pe(O(h).availableViews, (C, u) => (E(), j("button", {
1102
+ class: we(["vuecal__view-button", { "vuecal__view-button--active": O(o).id === u }]),
1103
+ onClick: (f) => O(o).switch(u),
1104
+ innerHTML: O(n).texts[u],
1074
1105
  type: "button"
1075
- }, null, 10, kt))), 256))
1076
- ])) : Z("", !0),
1077
- O(h).titleBar ? (E(), j("nav", bt, [
1078
- ge("button", {
1079
- class: _e(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !L.$slots["previous-button"] }]),
1080
- onClick: v[0] || (v[0] = (...C) => O(r).previous && O(r).previous(...C)),
1106
+ }, null, 10, zt))), 256))
1107
+ ])) : q("", !0),
1108
+ O(h).titleBar ? (E(), j("nav", Ht, [
1109
+ me("button", {
1110
+ class: we(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !L.$slots["previous-button"] }]),
1111
+ onClick: m[0] || (m[0] = (...C) => O(o).previous && O(o).previous(...C)),
1081
1112
  type: "button"
1082
1113
  }, [
1083
- F(L.$slots, "previous-button")
1114
+ H(L.$slots, "previous-button")
1084
1115
  ], 2),
1085
- ge("div", Tt, [
1086
- Oe(Ge, {
1087
- name: `vuecal-slide-fade--${O(r).transitionDirection}`
1116
+ me("div", Nt, [
1117
+ Ve(Ge, {
1118
+ name: `vuecal-slide-fade--${O(o).transitionDirection}`
1088
1119
  }, {
1089
- default: J(() => [
1120
+ default: Z(() => [
1090
1121
  (E(), j("div", {
1091
- key: O(r).id + O(r).start.getTime()
1122
+ key: O(o).id + O(o).start.getTime()
1092
1123
  }, [
1093
- L.$slots.title ? (E(), Se(Ke(O(h).clickToNavigate && O(r).broaderView ? "button" : "div"), De({
1124
+ L.$slots.title ? (E(), Ee(Qe(O(h).clickToNavigate && O(o).broaderView ? "button" : "div"), he({
1094
1125
  key: 0,
1095
1126
  class: "vuecal__title"
1096
- }, Ie(b.value)), {
1097
- default: J(() => [
1098
- F(L.$slots, "title", ne(se(O(r))))
1127
+ }, Ie(k.value)), {
1128
+ default: Z(() => [
1129
+ H(L.$slots, "title", ne(se(O(o))))
1099
1130
  ]),
1100
1131
  _: 3
1101
- }, 16)) : (E(), Se(Ke(O(h).clickToNavigate && O(r).broaderView ? "button" : "div"), De({
1132
+ }, 16)) : (E(), Ee(Qe(O(h).clickToNavigate && O(o).broaderView ? "button" : "div"), he({
1102
1133
  key: 1,
1103
1134
  class: "vuecal__title"
1104
- }, Ie(b.value), {
1105
- innerHTML: O(r).title
1135
+ }, Ie(k.value), {
1136
+ innerHTML: O(o).title
1106
1137
  }), null, 16, ["innerHTML"]))
1107
1138
  ]))
1108
1139
  ]),
@@ -1110,143 +1141,143 @@ const st = (D, n) => {
1110
1141
  }, 8, ["name"])
1111
1142
  ]),
1112
1143
  O(h).todayButton ? (E(), j(te, { key: 0 }, [
1113
- L.$slots["today-button"] ? F(L.$slots, "today-button", {
1144
+ L.$slots["today-button"] ? H(L.$slots, "today-button", {
1114
1145
  key: 0,
1115
- navigate: () => !O(r).containsToday && O(r).goToToday(),
1116
- active: O(r).containsToday
1146
+ navigate: () => !O(o).containsToday && O(o).goToToday(),
1147
+ active: O(o).containsToday
1117
1148
  }) : (E(), j("button", {
1118
1149
  key: 1,
1119
- class: _e(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": O(r).containsToday }]),
1120
- onClick: v[1] || (v[1] = (C) => !O(r).containsToday && O(r).goToToday()),
1121
- disabled: !!O(r).containsToday,
1150
+ class: we(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": O(o).containsToday }]),
1151
+ onClick: m[1] || (m[1] = (C) => !O(o).containsToday && O(o).goToToday()),
1152
+ disabled: !!O(o).containsToday,
1122
1153
  type: "button",
1123
1154
  innerHTML: O(n).texts.today
1124
- }, null, 10, $t))
1125
- ], 64)) : Z("", !0),
1126
- ge("button", {
1127
- class: _e(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !L.$slots["next-button"] }]),
1128
- onClick: v[2] || (v[2] = (...C) => O(r).next && O(r).next(...C)),
1155
+ }, null, 10, Wt))
1156
+ ], 64)) : q("", !0),
1157
+ me("button", {
1158
+ class: we(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !L.$slots["next-button"] }]),
1159
+ onClick: m[2] || (m[2] = (...C) => O(o).next && O(o).next(...C)),
1129
1160
  type: "button"
1130
1161
  }, [
1131
- F(L.$slots, "next-button")
1162
+ H(L.$slots, "next-button")
1132
1163
  ], 2)
1133
- ])) : Z("", !0)
1164
+ ])) : q("", !0)
1134
1165
  ], 64))
1135
1166
  ]));
1136
1167
  }
1137
- }, Yt = {
1168
+ }, Bt = {
1138
1169
  key: 0,
1139
1170
  class: "vuecal__headings"
1140
- }, Et = {
1171
+ }, It = {
1141
1172
  key: 0,
1142
1173
  class: "vuecal__weekdays-headings"
1143
- }, St = ["onClick"], Ct = { class: "vuecal__weekday-day" }, Vt = {
1174
+ }, Rt = ["onClick"], Xt = { class: "vuecal__weekday-day" }, Gt = {
1144
1175
  key: 0,
1145
1176
  class: "vuecal__weekday-date"
1146
- }, Ot = {
1177
+ }, Jt = {
1147
1178
  key: 1,
1148
1179
  class: "vuecal__schedules-headings w-flex grow"
1149
- }, jt = ["innerHTML"], Pt = {
1180
+ }, Ut = ["innerHTML"], qt = {
1150
1181
  __name: "headings-bar",
1151
1182
  setup(D) {
1152
- const n = Ne("vuecal"), { view: r, config: h, dateUtils: p } = n, b = T(() => h.xs ? "day-xs" : h.sm || r.isDays || r.isMonth ? "day-sm" : "day"), L = T(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !h.schedules)), v = T(() => r.cellDates.slice(0, r.cols).map(({ start: i }) => ({
1153
- id: Re[i.getDay()],
1154
- date: i,
1155
- dateNumber: i.getDate(),
1156
- day: p.formatDate(i, "dddd"),
1157
- "day-sm": p.formatDate(i, "ddd"),
1158
- "day-xs": p.formatDate(i, "dd"),
1159
- isToday: p.isToday(i)
1183
+ const n = Ne("vuecal"), { view: o, config: h, dateUtils: p } = n, k = T(() => h.xs ? "day-xs" : h.sm || o.isDays || o.isMonth ? "day-sm" : "day"), L = T(() => (o.isDay || o.isDays || o.isWeek || o.isMonth) && !(o.isDay && !h.schedules)), m = T(() => o.cellDates.slice(0, o.cols).map(({ start: u }) => ({
1184
+ id: Re[u.getDay()],
1185
+ date: u,
1186
+ dateNumber: u.getDate(),
1187
+ day: p.formatDate(u, "dddd"),
1188
+ "day-sm": p.formatDate(u, "ddd"),
1189
+ "day-xs": p.formatDate(u, "dd"),
1190
+ isToday: p.isToday(u)
1160
1191
  }))), C = {
1161
- click: (i) => {
1162
- (r.isDays || r.isWeek) && r.updateSelectedDate(i);
1192
+ click: (u) => {
1193
+ (o.isDays || o.isWeek) && o.updateSelectedDate(u);
1163
1194
  }
1164
1195
  };
1165
- return (i, m) => L.value ? (E(), j("div", Yt, [
1166
- O(r).isDay ? Z("", !0) : (E(), j("div", Et, [
1167
- (E(!0), j(te, null, we(v.value, ($, W) => (E(), j("div", {
1168
- class: _e(["vuecal__weekday", { "vuecal__weekday--today": $.isToday }]),
1196
+ return (u, f) => L.value ? (E(), j("div", Bt, [
1197
+ O(o).isDay ? q("", !0) : (E(), j("div", It, [
1198
+ (E(!0), j(te, null, pe(m.value, (M, W) => (E(), j("div", {
1199
+ class: we(["vuecal__weekday", { "vuecal__weekday--today": M.isToday }]),
1169
1200
  key: W,
1170
- onClick: (G) => C.click($.date)
1201
+ onClick: (X) => C.click(M.date)
1171
1202
  }, [
1172
- F(i.$slots, "weekday-heading", {
1173
- label: $[b.value],
1174
- id: $.id,
1175
- date: $.date
1203
+ H(u.$slots, "weekday-heading", {
1204
+ label: M[k.value],
1205
+ id: M.id,
1206
+ date: M.date
1176
1207
  }, () => [
1177
- ge("span", Ct, le($[b.value]), 1),
1178
- O(r).isMonth ? Z("", !0) : (E(), j("strong", Vt, le($.dateNumber), 1))
1208
+ me("span", Xt, le(M[k.value]), 1),
1209
+ O(o).isMonth ? q("", !0) : (E(), j("strong", Gt, le(M.dateNumber), 1))
1179
1210
  ])
1180
- ], 10, St))), 128))
1211
+ ], 10, Rt))), 128))
1181
1212
  ])),
1182
- O(h).schedules ? (E(), j("div", Ot, [
1183
- (E(!0), j(te, null, we(v.value, ($, W) => (E(), j(te, { key: W }, [
1184
- (E(!0), j(te, null, we(O(h).schedules, (G, o) => (E(), j(te, { key: o }, [
1185
- i.$slots["schedule-heading"] ? (E(), j("div", {
1213
+ O(h).schedules ? (E(), j("div", Jt, [
1214
+ (E(!0), j(te, null, pe(m.value, (M, W) => (E(), j(te, { key: W }, [
1215
+ (E(!0), j(te, null, pe(O(h).schedules, (X, i) => (E(), j(te, { key: i }, [
1216
+ u.$slots["schedule-heading"] ? (E(), j("div", {
1186
1217
  key: 0,
1187
- class: _e(["vuecal__schedule vuecal__schedule--heading", G.class])
1218
+ class: we(["vuecal__schedule vuecal__schedule--heading", X.class])
1188
1219
  }, [
1189
- F(i.$slots, "schedule-heading", {
1190
- schedule: G,
1191
- view: O(r)
1220
+ H(u.$slots, "schedule-heading", {
1221
+ schedule: X,
1222
+ view: O(o)
1192
1223
  })
1193
1224
  ], 2)) : (E(), j("div", {
1194
1225
  key: 1,
1195
- class: _e(["vuecal__schedule vuecal__schedule--heading", G.class]),
1196
- innerHTML: G.label
1197
- }, null, 10, jt))
1226
+ class: we(["vuecal__schedule vuecal__schedule--heading", X.class]),
1227
+ innerHTML: X.label
1228
+ }, null, 10, Ut))
1198
1229
  ], 64))), 128))
1199
1230
  ], 64))), 128))
1200
- ])) : Z("", !0)
1201
- ])) : Z("", !0);
1231
+ ])) : q("", !0)
1232
+ ])) : q("", !0);
1202
1233
  }
1203
- }, Ht = { class: "vuecal__time-column" }, Lt = {
1234
+ }, Zt = { class: "vuecal__time-column" }, Kt = {
1204
1235
  __name: "time-column",
1205
1236
  setup(D) {
1206
- const n = Ne("vuecal"), { config: r, texts: h } = n, p = T(() => {
1207
- const b = [];
1208
- for (let v = r.timeFrom; v < r.timeTo; v += r.timeStep) {
1209
- const C = ~~(v / 60), i = v % 60, m = h[v < 720 ? "am" : "pm"];
1210
- b.push({
1211
- minutesSum: v,
1237
+ const n = Ne("vuecal"), { config: o, texts: h } = n, p = T(() => {
1238
+ const k = [];
1239
+ for (let m = o.timeFrom; m < o.timeTo; m += o.timeStep) {
1240
+ const C = ~~(m / 60), u = m % 60, f = h[m < 720 ? "am" : "pm"];
1241
+ k.push({
1242
+ minutesSum: m,
1212
1243
  // The sum of hours + minutes in minutes.
1213
1244
  hours: C,
1214
- minutes: i,
1215
- formatted12: `${C % 12 ? C % 12 : 12}${i ? ":" + i.toString().padStart(2, 0) : ""}${m}`,
1216
- formatted24: `${C.toString().padStart(2, 0)}:${i.toString().padStart(2, 0)}`
1245
+ minutes: u,
1246
+ formatted12: `${C % 12 ? C % 12 : 12}${u ? ":" + u.toString().padStart(2, 0) : ""}${f}`,
1247
+ formatted24: `${C.toString().padStart(2, 0)}:${u.toString().padStart(2, 0)}`
1217
1248
  });
1218
1249
  }
1219
- return b;
1250
+ return k;
1220
1251
  });
1221
- return (b, L) => (E(), j("div", Ht, [
1222
- (E(!0), j(te, null, we(p.value, (v, C) => (E(), j("div", {
1252
+ return (k, L) => (E(), j("div", Zt, [
1253
+ (E(!0), j(te, null, pe(p.value, (m, C) => (E(), j("div", {
1223
1254
  class: "vuecal__time-cell",
1224
1255
  key: C
1225
1256
  }, [
1226
- F(b.$slots, "time-cell", {
1257
+ H(k.$slots, "time-cell", {
1227
1258
  index: C,
1228
- minutes: v.minutes,
1229
- hours: v.hours,
1230
- minutesSum: v.minutesSum,
1231
- format12: v.formatted12,
1232
- format24: v.formatted24
1259
+ minutes: m.minutes,
1260
+ hours: m.hours,
1261
+ minutesSum: m.minutesSum,
1262
+ format12: m.formatted12,
1263
+ format24: m.formatted24
1233
1264
  }, () => [
1234
- ge("label", null, le(O(r).twelveHour ? v.formatted12 : v.formatted24), 1)
1265
+ me("label", null, le(O(o).twelveHour ? m.formatted12 : m.formatted24), 1)
1235
1266
  ])
1236
1267
  ]))), 128))
1237
1268
  ]));
1238
1269
  }
1239
- }, zt = ["draggable"], Ft = { class: "vuecal__event-details" }, Nt = { class: "vuecal__event-title" }, Wt = {
1270
+ }, Qt = ["draggable"], xt = { class: "vuecal__event-details" }, ea = { class: "vuecal__event-title" }, ta = {
1240
1271
  key: 0,
1241
1272
  class: "vuecal__event-time"
1242
- }, Bt = ["innerHTML"], at = {
1273
+ }, aa = ["innerHTML"], nt = {
1243
1274
  __name: "event",
1244
1275
  props: {
1245
1276
  event: { type: Object, required: !0 }
1246
1277
  },
1247
1278
  emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
1248
1279
  setup(D, { emit: n }) {
1249
- const { config: r, view: h, dnd: p, touch: b, dateUtils: L } = Ne("vuecal"), v = D, C = ie(null), i = $e(v.event), m = $e({
1280
+ const { config: o, view: h, dnd: p, touch: k, dateUtils: L } = Ne("vuecal"), m = D, C = oe(null), u = Te(m.event), f = Te({
1250
1281
  dragging: !1,
1251
1282
  resizing: !1,
1252
1283
  fromResizer: !1,
@@ -1280,186 +1311,186 @@ const st = (D, n) => {
1280
1311
  cellEl: null,
1281
1312
  // Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
1282
1313
  schedule: null
1283
- }), $ = T(() => r.editableEvents.drag && i.draggable !== !1 && !i.background), W = T(() => r.time && r.editableEvents.resize && i.resizable !== !1 && !i.background);
1284
- T(() => r.editableEvents.delete && i.deletable !== !1 && !i.background);
1285
- const G = T(() => {
1314
+ }), M = T(() => o.editableEvents.drag && u.draggable !== !1 && !u.background), W = T(() => o.time && o.editableEvents.resize && u.resizable !== !1 && !u.background);
1315
+ T(() => o.editableEvents.delete && u.deletable !== !1 && !u.background);
1316
+ const X = T(() => {
1286
1317
  var s, l, _;
1287
1318
  return {
1288
- [`vuecal__event--${i._.id}`]: !0,
1289
- [i.class]: !!i.class,
1290
- "vuecal__event--recurring": !!i.recurring,
1291
- "vuecal__event--background": !!i.background,
1292
- "vuecal__event--multiday": !!((s = i._) != null && s.multiday),
1293
- "vuecal__event--cut-top": ((l = i._) == null ? void 0 : l.startMinutes) < r.timeFrom,
1294
- "vuecal__event--cut-bottom": ((_ = i._) == null ? void 0 : _.endMinutes) > r.timeTo || i.end.getDate() !== i.start.getDate(),
1319
+ [`vuecal__event--${u._.id}`]: !0,
1320
+ [u.class]: !!u.class,
1321
+ "vuecal__event--recurring": !!u.recurring,
1322
+ "vuecal__event--background": !!u.background,
1323
+ "vuecal__event--multiday": !!((s = u._) != null && s.multiday),
1324
+ "vuecal__event--cut-top": ((l = u._) == null ? void 0 : l.startMinutes) < o.timeFrom,
1325
+ "vuecal__event--cut-bottom": ((_ = u._) == null ? void 0 : _.endMinutes) > o.timeTo || u.end.getDate() !== u.start.getDate(),
1295
1326
  // Only apply the dragging class on the event copy that is being dragged.
1296
- "vuecal__event--dragging": !i._.draggingGhost && i._.dragging,
1327
+ "vuecal__event--dragging": !u._.draggingGhost && u._.dragging,
1297
1328
  // Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
1298
1329
  // dragged. Sometimes when dragging fast the dragging-ghost class would get stuck and events stays
1299
1330
  // invisible, so if dragging is false, disable the dragging-ghost class as well.
1300
1331
  // On event drop, if the new position of the event is approved, only remove the dragging-ghost class
1301
1332
  // after event deletion (event._.dragging is already false) so the event ghost does not flash in before
1302
1333
  // deletion.
1303
- "vuecal__event--dragging-ghost": i._.draggingGhost,
1304
- "vuecal__event--resizing": m.resizing
1334
+ "vuecal__event--dragging-ghost": u._.draggingGhost,
1335
+ "vuecal__event--resizing": f.resizing
1305
1336
  };
1306
- }), o = T(() => {
1307
- const s = (h.isDay || h.isDays || h.isWeek) && r.time;
1308
- if (!s && !i.backgroundColor && !i.color) return !1;
1337
+ }), i = T(() => {
1338
+ const s = (h.isDay || h.isDays || h.isWeek) && o.time;
1339
+ if (!s && !u.backgroundColor && !u.color) return !1;
1309
1340
  const l = {
1310
- backgroundColor: i.backgroundColor || null,
1311
- color: i.color || null
1341
+ backgroundColor: u.backgroundColor || null,
1342
+ color: u.color || null
1312
1343
  };
1313
1344
  if (s) {
1314
- const _ = Math.max(r.timeFrom, i._.startMinutes), t = Math.min(r.timeTo, i._.endMinutes), V = Ve(_, r), H = Ve(t, r) - V;
1315
- l.top = `${V}%`, l.height = `${H}%`;
1345
+ const _ = Math.max(o.timeFrom, u._.startMinutes), t = Math.min(o.timeTo, u._.endMinutes), V = Ce(_, o), F = Ce(t, o) - V;
1346
+ l.top = `${V}%`, l.height = `${F}%`;
1316
1347
  }
1317
1348
  return l;
1318
- }), u = T(() => {
1319
- const s = { ...r.eventListeners.event };
1349
+ }), c = T(() => {
1350
+ const s = { ...o.eventListeners.event };
1320
1351
  Object.entries(s).forEach(([t, V]) => {
1321
- ["resize-end"].includes(t) || (s[t] = (H) => {
1322
- H.type !== "drop" && V(H.type ? { e: H, event: i } : H);
1352
+ ["resize-end"].includes(t) || (s[t] = (F) => {
1353
+ F.type !== "drop" && V(F.type ? { e: F, event: u } : F);
1323
1354
  });
1324
1355
  });
1325
1356
  const l = { ...s };
1326
1357
  s.touchstart = (t) => {
1327
1358
  var V;
1328
- t.stopPropagation(), e(t), (V = l.touchstart) == null || V.call(l, { e: t, event: i });
1359
+ t.stopPropagation(), e(t), (V = l.touchstart) == null || V.call(l, { e: t, event: u });
1329
1360
  }, s.mousedown = (t) => {
1330
1361
  var V;
1331
- t.stopPropagation(), e(t), (V = l.mousedown) == null || V.call(l, { e: t, event: i });
1362
+ t.stopPropagation(), e(t), (V = l.mousedown) == null || V.call(l, { e: t, event: u });
1332
1363
  };
1333
1364
  let _ = null;
1334
1365
  return s.click = (t) => {
1335
1366
  var V;
1336
- (V = l.click) == null || V.call(l, { e: t, event: i }), _ ? _ = clearTimeout(_) : _ = setTimeout(() => {
1337
- var H;
1338
- _ = null, (H = l["delayed-click"]) == null || H.call(l, { e: t, event: i });
1367
+ (V = l.click) == null || V.call(l, { e: t, event: u }), _ ? _ = clearTimeout(_) : _ = setTimeout(() => {
1368
+ var F;
1369
+ _ = null, (F = l["delayed-click"]) == null || F.call(l, { e: t, event: u });
1339
1370
  }, 400);
1340
1371
  }, s.dblclick = (t) => {
1341
- l.dblclick ? l.dblclick({ e: t, event: i }) : i.delete(1);
1372
+ l.dblclick ? l.dblclick({ e: t, event: u }) : u.delete(1);
1342
1373
  }, s;
1343
1374
  }), e = (s) => {
1344
- var t, V, H;
1375
+ var t, V, F;
1345
1376
  const l = ((t = s.touches) == null ? void 0 : t[0]) || s;
1346
- m.fromResizer = l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1377
+ f.fromResizer = l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1347
1378
  const _ = C.value.getBoundingClientRect();
1348
- m.startX = (((V = s.touches) == null ? void 0 : V[0]) || s).clientX - _.left, m.startY = (((H = s.touches) == null ? void 0 : H[0]) || s).clientY - _.top, m.startPercentageX = m.startX * 100 / _.width, m.startPercentageY = m.startY * 100 / _.height, m.cellEl = C.value.closest(".vuecal__cell"), m.resizeStartDate = i.start, B(s.type === "touchstart" ? "touchmove" : "mousemove", d), B(s.type === "touchstart" ? "touchend" : "mouseup", f, { once: !0 }), m.holdTimer = setTimeout(() => {
1349
- var U, K;
1350
- m.holding = !0, (K = (U = u.value).hold) == null || K.call(U, { e: s, event: i });
1379
+ f.startX = (((V = s.touches) == null ? void 0 : V[0]) || s).clientX - _.left, f.startY = (((F = s.touches) == null ? void 0 : F[0]) || s).clientY - _.top, f.startPercentageX = f.startX * 100 / _.width, f.startPercentageY = f.startY * 100 / _.height, f.cellEl = C.value.closest(".vuecal__cell"), f.resizeStartDate = u.start, A(s.type === "touchstart" ? "touchmove" : "mousemove", v), A(s.type === "touchstart" ? "touchend" : "mouseup", g, { once: !0 }), f.holdTimer = setTimeout(() => {
1380
+ var J, K;
1381
+ f.holding = !0, (K = (J = c.value).hold) == null || K.call(J, { e: s, event: u });
1351
1382
  }, 1e3);
1352
- }, d = async (s) => {
1353
- var _, t, V, H;
1383
+ }, v = async (s) => {
1384
+ var _, t, V, F;
1354
1385
  const l = ((_ = s.touches) == null ? void 0 : _[0]) || s;
1355
- if (m.fromResizer && !m.resizing && (m.resizing = !0, m.resizingOriginalEvent = { ...i, _: { ...i._ } }, b.isResizingEvent = !0, (V = (t = u.value).resizeStart) == null || V.call(t, { e: s, event: i })), m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.cellEl) {
1356
- const { top: U, left: K, width: ue, height: ae } = m.cellEl.getBoundingClientRect();
1357
- m.moveX = l.clientX - K, m.moveY = l.clientY - U, m.movePercentageX = m.moveX * 100 / ue, m.movePercentageY = m.moveY * 100 / ae;
1386
+ if (f.fromResizer && !f.resizing && (f.resizing = !0, f.resizingOriginalEvent = { ...u, _: { ...u._ } }, k.isResizingEvent = !0, (V = (t = c.value).resizeStart) == null || V.call(t, { e: s, event: u })), f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.cellEl) {
1387
+ const { top: J, left: K, width: ie, height: ae } = f.cellEl.getBoundingClientRect();
1388
+ f.moveX = l.clientX - K, f.moveY = l.clientY - J, f.movePercentageX = f.moveX * 100 / ie, f.movePercentageY = f.moveY * 100 / ae;
1358
1389
  }
1359
- if (m.fromResizer) {
1360
- const { newStart: U, newEnd: K } = M(i);
1361
- let ue = !0;
1362
- const { resize: ae } = (H = r.eventListeners) == null ? void 0 : H.event;
1363
- ae && (ue = await ae({
1390
+ if (f.fromResizer) {
1391
+ const { newStart: J, newEnd: K } = $(u);
1392
+ let ie = !0;
1393
+ const { resize: ae } = (F = o.eventListeners) == null ? void 0 : F.event;
1394
+ ae && (ie = await ae({
1364
1395
  e: s,
1365
- event: { ...i, start: U, end: K },
1366
- overlaps: i.getOverlappingEvents({ start: U, end: K })
1367
- })), ue !== !1 ? (i.start = U, i.end = K, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null)) : ae && (m.resizingLastAcceptedEvent = { ...i, _: { ...i._ } });
1396
+ event: { ...u, start: J, end: K },
1397
+ overlaps: u.getOverlappingEvents({ start: J, end: K })
1398
+ })), ie !== !1 ? (u.start = J, u.end = K, f.resizingLastAcceptedEvent && (f.resizingLastAcceptedEvent = null)) : ae && (f.resizingLastAcceptedEvent = { ...u, _: { ...u._ } });
1368
1399
  }
1369
- }, f = async (s) => {
1400
+ }, g = async (s) => {
1370
1401
  var l, _;
1371
- if (m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.resizing) {
1372
- const { newStart: t, newEnd: V } = M(i);
1373
- let H = !0;
1374
- const U = u.value["resize-end"];
1375
- U && (H = await U({
1402
+ if (f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.resizing) {
1403
+ const { newStart: t, newEnd: V } = $(u);
1404
+ let F = !0;
1405
+ const J = c.value["resize-end"];
1406
+ J && (F = await J({
1376
1407
  e: s,
1377
- event: i,
1378
- original: m.resizingOriginalEvent,
1408
+ event: u,
1409
+ original: f.resizingOriginalEvent,
1379
1410
  // Original event details before resizing.
1380
- overlaps: i.getOverlappingEvents({ start: t, end: V })
1381
- })), i.start = H === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((l = m.resizingLastAcceptedEvent) == null ? void 0 : l.start) || t, i.end = H === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((_ = m.resizingLastAcceptedEvent) == null ? void 0 : _.end) || V, i._.duration < 1 && (i.start = m.resizingOriginalEvent.start, i.end = m.resizingOriginalEvent.end), b.isResizingEvent = !1;
1411
+ overlaps: u.getOverlappingEvents({ start: t, end: V })
1412
+ })), u.start = F === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).start : ((l = f.resizingLastAcceptedEvent) == null ? void 0 : l.start) || t, u.end = F === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).end : ((_ = f.resizingLastAcceptedEvent) == null ? void 0 : _.end) || V, u._.duration < 1 && (u.start = f.resizingOriginalEvent.start, u.end = f.resizingOriginalEvent.end), k.isResizingEvent = !1;
1382
1413
  }
1383
- document.removeEventListener(s.type === "touchend" ? "touchmove" : "mousemove", d), m.resizing = !1, m.fromResizer = !1, m.dragging = !1, m.startX = 0, m.startY = 0, m.moveX = 0, m.moveY = 0, m.startPercentageX = 0, m.startPercentageY = 0, m.movePercentageX = 0, m.movePercentageY = 0, m.cellEl = null, m.resizeStartDate = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, m.schedule = null;
1384
- }, M = (s) => {
1414
+ document.removeEventListener(s.type === "touchend" ? "touchmove" : "mousemove", v), f.resizing = !1, f.fromResizer = !1, f.dragging = !1, f.startX = 0, f.startY = 0, f.moveX = 0, f.moveY = 0, f.startPercentageX = 0, f.startPercentageY = 0, f.movePercentageX = 0, f.movePercentageY = 0, f.cellEl = null, f.resizeStartDate = null, f.resizingOriginalEvent = null, f.resizingLastAcceptedEvent = null, f.schedule = null;
1415
+ }, $ = (s) => {
1385
1416
  const l = new Date(s.start.getFullYear(), s.start.getMonth(), s.start.getDate());
1386
1417
  new Date(l).setDate(l.getDate() + 1);
1387
- let t = Pe(m.movePercentageY, r);
1388
- if (t = Math.max(0, Math.min(t, 24 * 60)), r.snapToInterval) {
1389
- const U = t + r.snapToInterval / 2;
1390
- t = U - U % r.snapToInterval;
1418
+ let t = je(f.movePercentageY, o);
1419
+ if (t = Math.max(0, Math.min(t, 24 * 60)), o.snapToInterval) {
1420
+ const J = t + o.snapToInterval / 2;
1421
+ t = J - J % o.snapToInterval;
1391
1422
  }
1392
- let V = s.start, H = new Date(l.getTime() + t * 6e4);
1393
- return H < m.resizeStartDate && (V = H, H = m.resizeStartDate), { newStart: V, newEnd: H };
1423
+ let V = s.start, F = new Date(l.getTime() + t * 6e4);
1424
+ return F < f.resizeStartDate && (V = F, F = f.resizeStartDate), { newStart: V, newEnd: F };
1394
1425
  };
1395
- Ze(() => i._.register(C.value));
1396
- const P = [], B = (s, l, _) => {
1426
+ qe(() => u._.register(C.value));
1427
+ const P = [], A = (s, l, _) => {
1397
1428
  document.addEventListener(s, l, _), P.push({ event: s, handler: l, options: _ });
1398
1429
  };
1399
1430
  return Xe(() => {
1400
- i._.unregister(), P.forEach(({ event: s, handler: l, options: _ }) => {
1431
+ u._.unregister(), P.forEach(({ event: s, handler: l, options: _ }) => {
1401
1432
  document.removeEventListener(s, l, _);
1402
1433
  });
1403
- }), (s, l) => (E(), j("div", De({ class: "vuecal__event" }, Ie(u.value, !0), {
1434
+ }), (s, l) => (E(), j("div", he({ class: "vuecal__event" }, Ie(c.value, !0), {
1404
1435
  ref_key: "eventEl",
1405
1436
  ref: C,
1406
- class: G.value,
1407
- style: o.value,
1408
- draggable: $.value ? "true" : void 0,
1409
- onDragstart: l[2] || (l[2] = (_) => $.value && O(p).eventDragStart(_, i)),
1410
- onDragend: l[3] || (l[3] = (_) => $.value && O(p).eventDragEnd(_, i))
1437
+ class: X.value,
1438
+ style: i.value,
1439
+ draggable: M.value ? "true" : void 0,
1440
+ onDragstart: l[2] || (l[2] = (_) => M.value && O(p).eventDragStart(_, u)),
1441
+ onDragend: l[3] || (l[3] = (_) => M.value && O(p).eventDragEnd(_, u))
1411
1442
  }), [
1412
- ge("div", Ft, [
1413
- F(s.$slots, "event", { event: i }, () => [
1414
- ge("div", Nt, le(i.title), 1),
1415
- O(r).time ? (E(), j("div", Wt, le(i._[`startTimeFormatted${O(r).twelveHour ? 12 : 24}`]) + `
1416
- - ` + le(i._[`endTimeFormatted${O(r).twelveHour ? 12 : 24}`]), 1)) : Z("", !0),
1417
- ge("div", {
1443
+ me("div", xt, [
1444
+ H(s.$slots, "event", { event: u }, () => [
1445
+ me("div", ea, le(u.title), 1),
1446
+ O(o).time ? (E(), j("div", ta, le(u._[`startTimeFormatted${O(o).twelveHour ? 12 : 24}`]) + `
1447
+ - ` + le(u._[`endTimeFormatted${O(o).twelveHour ? 12 : 24}`]), 1)) : q("", !0),
1448
+ me("div", {
1418
1449
  class: "vuecal__event-content",
1419
- innerHTML: i.content
1420
- }, null, 8, Bt)
1450
+ innerHTML: u.content
1451
+ }, null, 8, aa)
1421
1452
  ])
1422
1453
  ]),
1423
1454
  W.value ? (E(), j("div", {
1424
1455
  key: 0,
1425
1456
  class: "vuecal__event-resizer",
1426
- onDragstart: l[0] || (l[0] = Qe(() => {
1457
+ onDragstart: l[0] || (l[0] = xe(() => {
1427
1458
  }, ["prevent", "stop"]))
1428
- }, null, 32)) : Z("", !0),
1429
- Oe(Ge, { name: "vuecal-delete-btn" }, {
1430
- default: J(() => [
1431
- i._.deleting ? (E(), j("div", {
1459
+ }, null, 32)) : q("", !0),
1460
+ Ve(Ge, { name: "vuecal-delete-btn" }, {
1461
+ default: Z(() => [
1462
+ u._.deleting ? (E(), j("div", {
1432
1463
  key: 0,
1433
1464
  class: "vuecal__event-delete",
1434
- onClick: l[1] || (l[1] = Qe((_) => i.delete(3), ["stop"]))
1435
- }, "Delete")) : Z("", !0)
1465
+ onClick: l[1] || (l[1] = xe((_) => u.delete(3), ["stop"]))
1466
+ }, "Delete")) : q("", !0)
1436
1467
  ]),
1437
1468
  _: 1
1438
1469
  })
1439
- ], 16, zt));
1470
+ ], 16, Qt));
1440
1471
  }
1441
- }, At = ["innerHTML"], It = ["data-schedule"], Rt = {
1472
+ }, na = ["innerHTML"], sa = ["data-schedule"], la = {
1442
1473
  key: 1,
1443
1474
  class: "vuecal__cell-date"
1444
- }, Xt = {
1475
+ }, ra = {
1445
1476
  key: 2,
1446
1477
  class: "vuecal__cell-content"
1447
- }, Gt = {
1478
+ }, oa = {
1448
1479
  key: 3,
1449
1480
  class: "vuecal__cell-events"
1450
- }, qt = {
1481
+ }, ia = {
1451
1482
  key: 1,
1452
1483
  class: "vuecal__cell-date"
1453
- }, Ut = {
1484
+ }, ua = {
1454
1485
  key: 2,
1455
1486
  class: "vuecal__cell-content"
1456
- }, Zt = {
1487
+ }, ca = {
1457
1488
  key: 3,
1458
1489
  class: "vuecal__cell-events"
1459
- }, Jt = {
1490
+ }, da = {
1460
1491
  key: 5,
1461
1492
  class: "vuecal__cell-events-count"
1462
- }, Kt = ["title"], Qt = {
1493
+ }, va = ["title"], ma = {
1463
1494
  __name: "cell",
1464
1495
  props: {
1465
1496
  // Even with time=false, the date of the cell will still be provided in order to attach
@@ -1469,9 +1500,9 @@ const st = (D, n) => {
1469
1500
  index: { type: Number, required: !0 }
1470
1501
  },
1471
1502
  setup(D) {
1472
- const n = D, r = Ne("vuecal"), { view: h, config: p, dateUtils: b, eventsManager: L, dnd: v, touch: C } = r, i = T(() => b.isToday(n.start)), m = ie(null), $ = ie([]), W = ie(!1), G = (c) => {
1473
- $.value.push(c.detail), W.value = !0;
1474
- }, o = () => setTimeout(() => W.value = !1, 300), u = $e({
1503
+ const n = D, o = Ne("vuecal"), { view: h, config: p, dateUtils: k, eventsManager: L, dnd: m, touch: C } = o, u = T(() => k.isToday(n.start)), f = oe(null), M = oe([]), W = oe(!1), X = (r) => {
1504
+ M.value.push(r.detail), W.value = !0;
1505
+ }, i = () => setTimeout(() => W.value = !1, 300), c = Te({
1475
1506
  dragging: !1,
1476
1507
  holding: !1,
1477
1508
  // When the cell is clicked and hold for a certain amount of time.
@@ -1492,419 +1523,418 @@ const st = (D, n) => {
1492
1523
  movePercentageX: 0,
1493
1524
  movePercentageY: 0,
1494
1525
  schedule: null
1495
- }), e = ie(!1), d = ie({ cellOverlaps: {}, longestStreak: 0 }), f = T(() => {
1496
- let c = Math.min(u.startPercentageY, u.movePercentageY), w = Math.max(u.startPercentageY, u.movePercentageY), S = Pe(c, p), Y = Pe(w, p);
1497
- return p.snapToInterval && (S = b.snapToInterval(S, p.snapToInterval), Y = b.snapToInterval(Y, p.snapToInterval), c = Ve(S, p), w = Ve(Y, p)), {
1526
+ }), e = oe(!1), v = oe({ cellOverlaps: {}, longestStreak: 0 }), g = T(() => {
1527
+ let r = Math.min(c.startPercentageY, c.movePercentageY), b = Math.max(c.startPercentageY, c.movePercentageY), S = je(r, p), Y = je(b, p);
1528
+ return p.snapToInterval && (S = k.snapToInterval(S, p.snapToInterval), Y = k.snapToInterval(Y, p.snapToInterval), r = Ce(S, p), b = Ce(Y, p)), {
1498
1529
  style: {
1499
- top: c + "%",
1500
- height: Math.abs(w - c) + "%"
1530
+ top: `${r}%`,
1531
+ height: `${Math.abs(b - r)}%`
1501
1532
  },
1502
1533
  startMinutes: S,
1503
1534
  endMinutes: Y,
1504
- start: b.formatMinutes(S),
1505
- end: b.formatMinutes(Y),
1506
- ...u.schedule ? { schedule: u.schedule } : {}
1535
+ start: k.formatMinutes(S),
1536
+ end: k.formatMinutes(Y),
1537
+ ...c.schedule ? { schedule: c.schedule } : {}
1507
1538
  };
1508
- }), M = T(() => {
1509
- const c = p.editableEvents.create && (u.dragging || e.value), w = p.eventCreateMinDrag && u.thresholdPassed || !p.eventCreateMinDrag;
1510
- return c && w;
1539
+ }), $ = T(() => {
1540
+ const r = p.editableEvents.create && (c.dragging || e.value), b = p.eventCreateMinDrag && c.thresholdPassed || !p.eventCreateMinDrag;
1541
+ return r && b;
1511
1542
  }), P = T(() => {
1512
- var x;
1513
- const c = /* @__PURE__ */ new Date(), w = h.start.getFullYear(), S = h.start.getMonth(), Y = n.start.getFullYear(), N = n.start.getMonth();
1543
+ var ee;
1544
+ const r = /* @__PURE__ */ new Date(), b = h.start.getFullYear(), S = h.start.getMonth(), Y = n.start.getFullYear(), N = n.start.getMonth();
1514
1545
  return {
1515
1546
  [`vuecal__cell--${Re[n.start.getDay()]}`]: h.isDay || h.isDays || h.isWeek || h.isMonth,
1516
- [`vuecal__cell--${dt[N]}`]: h.isYear,
1547
+ [`vuecal__cell--${Mt[N]}`]: h.isYear,
1517
1548
  [`vuecal__cell--${Y}`]: h.isYears,
1518
- "vuecal__cell--today": i.value,
1519
- "vuecal__cell--current-month": h.isYear && Y === c.getFullYear() && N === c.getMonth(),
1520
- "vuecal__cell--current-year": h.isYears && Y === c.getFullYear(),
1521
- "vuecal__cell--out-of-range": h.isMonth && (Y !== w || N !== S),
1549
+ "vuecal__cell--today": u.value,
1550
+ "vuecal__cell--current-month": h.isYear && Y === r.getFullYear() && N === r.getMonth(),
1551
+ "vuecal__cell--current-year": h.isYears && Y === r.getFullYear(),
1552
+ "vuecal__cell--out-of-range": h.isMonth && (Y !== b || N !== S),
1522
1553
  "vuecal__cell--before-min": ae.value && K.value,
1523
- "vuecal__cell--after-max": ae.value && ue.value,
1554
+ "vuecal__cell--after-max": ae.value && ie.value,
1524
1555
  "vuecal__cell--disabled": ae.value,
1525
1556
  "vuecal__cell--selected": h.selectedDate && h.selectedDate.getTime() >= n.start.getTime() && h.selectedDate.getTime() <= n.end.getTime(),
1526
- "vuecal__cell--has-schedules": (x = p.schedules) == null ? void 0 : x.length,
1527
- "vuecal__cell--dragging": u.dragging,
1557
+ "vuecal__cell--has-schedules": (ee = p.schedules) == null ? void 0 : ee.length,
1558
+ "vuecal__cell--dragging": c.dragging,
1528
1559
  "vuecal__cell--has-events": l.value.length
1529
1560
  };
1530
- }), B = T(() => b.formatDate(n.start)), s = T(() => {
1561
+ }), A = T(() => k.formatDate(n.start)), s = T(() => {
1531
1562
  switch (h.id) {
1532
1563
  case "day":
1533
1564
  return "";
1534
1565
  case "days":
1535
- return p.availableViews.days.rows > 1 && b.formatDate(n.start, "D"), "";
1566
+ return p.availableViews.days.rows > 1 && k.formatDate(n.start, "D"), "";
1536
1567
  case "week":
1537
1568
  return "";
1538
1569
  case "month":
1539
- return b.formatDate(n.start, "D");
1570
+ return k.formatDate(n.start, "D");
1540
1571
  case "year":
1541
- return b.formatDate(n.start, p.xs ? "MMM" : "MMMM");
1572
+ return k.formatDate(n.start, p.xs ? "MMM" : "MMMM");
1542
1573
  case "years":
1543
- return b.formatDate(n.start, "YYYY");
1574
+ return k.formatDate(n.start, "YYYY");
1544
1575
  }
1545
- }), l = T(() => p.datePicker ? [] : L.getEventsByDate(B.value, !0, !0).filter((c) => !$.value.includes(c._.id))), _ = T(() => l.value.filter((c) => !c.background)), t = T(() => {
1546
- var c;
1547
- return (c = p.schedules) == null ? void 0 : c.reduce((w, S) => (w[S.id] = l.value.filter((Y) => Y.schedule === S.id), w), {});
1576
+ }), l = T(() => p.datePicker ? [] : L.getEventsByDate(A.value, !0, !0).filter((r) => !M.value.includes(r._.id))), _ = T(() => l.value.filter((r) => !r.background)), t = T(() => {
1577
+ var r;
1578
+ return (r = p.schedules) == null ? void 0 : r.reduce((b, S) => (b[S.id] = l.value.filter((Y) => Y.schedule === S.id), b), {});
1548
1579
  }), V = T(() => {
1549
- const c = {};
1550
- for (const w of l.value) {
1551
- const S = w._.id, { maxConcurrent: Y = 1, position: N = 0 } = d.value.cellOverlaps[S] || {};
1552
- c[S] = {
1580
+ const r = {};
1581
+ for (const b of l.value) {
1582
+ const S = b._.id, { maxConcurrent: Y = 1, position: N = 0 } = v.value.cellOverlaps[S] || {};
1583
+ r[S] = {
1553
1584
  width: `${100 / Y}%`,
1554
1585
  left: `${100 / Y * N}%`
1555
1586
  };
1556
1587
  }
1557
- return c;
1558
- }), H = T(() => h.isMonth && p.eventCount && !p.eventsOnMonthView && _.value.length), U = T(() => {
1588
+ return r;
1589
+ }), F = T(() => h.isMonth && p.eventCount && !p.eventsOnMonthView && _.value.length), J = T(() => {
1559
1590
  var S;
1560
1591
  if (!p.specialHours || h.isMonth || h.isYear || h.isYears) return;
1561
- const c = Re[n.start.getDay()];
1562
- let w = (S = p.specialHours) == null ? void 0 : S[c];
1563
- if (w)
1564
- return Array.isArray(w) || (w = [w]), w.map((Y) => {
1565
- let { from: N, to: I, class: x, label: de } = Y;
1566
- if (isNaN(N) || isNaN(I) || p.timeFrom >= I || p.timeTo <= N) return;
1567
- N = Math.max(p.timeFrom, N), I = Math.min(p.timeTo, I);
1568
- const ye = Ve(N, p), g = Ve(I, p) - ye;
1592
+ const r = Re[n.start.getDay()];
1593
+ let b = (S = p.specialHours) == null ? void 0 : S[r];
1594
+ if (b)
1595
+ return Array.isArray(b) || (b = [b]), b.map((Y) => {
1596
+ let { from: N, to: B, class: ee, label: ye } = Y;
1597
+ if (isNaN(N) || isNaN(B) || p.timeFrom >= B || p.timeTo <= N) return;
1598
+ N = Math.max(p.timeFrom, N), B = Math.min(p.timeTo, B);
1599
+ const d = Ce(N, p), z = Ce(B, p) - d;
1569
1600
  return {
1570
- style: { top: `${ye}%`, height: `${g}%` },
1571
- label: de,
1572
- class: x
1601
+ style: { top: `${d}%`, height: `${z}%` },
1602
+ label: ye,
1603
+ class: ee
1573
1604
  };
1574
1605
  }).filter((Y) => !!Y);
1575
- }), K = T(() => p.minTimestamp !== null && p.minTimestamp > n.end.getTime()), ue = T(() => p.maxTimestamp && p.maxTimestamp < n.start.getTime()), ae = T(() => {
1576
- const { disableDays: c } = p, w = h.isYear || h.isYears;
1577
- return c.length && c.includes(b.formatDate(n.start)) && !w ? !0 : K.value || ue.value;
1578
- }), re = $e({
1606
+ }), K = T(() => p.minTimestamp !== null && p.minTimestamp > n.end.getTime()), ie = T(() => p.maxTimestamp && p.maxTimestamp < n.start.getTime()), ae = T(() => {
1607
+ const { disableDays: r } = p, b = h.isYear || h.isYears;
1608
+ return r.length && r.includes(k.formatDate(n.start)) && !b ? !0 : K.value || ie.value;
1609
+ }), re = Te({
1579
1610
  show: T(() => {
1580
- if (!(!h.isDay && !h.isDays && !h.isWeek) && !(!i.value || !p.time) && !(p.timeFrom > b.dateToMinutes(h.now)) && !(b.dateToMinutes(h.now) > p.timeTo))
1611
+ if (!(!h.isDay && !h.isDays && !h.isWeek) && !(!u.value || !p.time) && !(p.timeFrom > k.dateToMinutes(h.now)) && !(k.dateToMinutes(h.now) > p.timeTo))
1581
1612
  return !0;
1582
1613
  }),
1583
- nowInMinutes: T(() => b.dateToMinutes(h.now)),
1584
- todaysTimePosition: T(() => Ve(re.nowInMinutes, p)),
1614
+ nowInMinutes: T(() => k.dateToMinutes(h.now)),
1615
+ todaysTimePosition: T(() => Ce(re.nowInMinutes, p)),
1585
1616
  style: T(() => `top: ${re.todaysTimePosition}%`),
1586
- currentTime: T(() => b.formatTime(h.now))
1587
- }), he = T(() => {
1617
+ currentTime: T(() => k.formatTime(h.now))
1618
+ }), fe = T(() => {
1588
1619
  if (ae.value) return {};
1589
- const c = { ...p.eventListeners.cell };
1590
- Object.entries(c).forEach(([Y, N]) => {
1591
- c[Y] = (I) => {
1592
- var x, de, ye;
1593
- (ye = (de = I.target || ((x = I.e) == null ? void 0 : x.target)).closest) != null && ye.call(de, ".vuecal__event") || N(I.type ? { e: I, cell: q.value, cursor: ce.value } : I);
1620
+ const r = { ...p.eventListeners.cell };
1621
+ for (const [Y, N] of Object.entries(r))
1622
+ r[Y] = (B) => {
1623
+ var ee, ye, d;
1624
+ (d = (ye = B.target || ((ee = B.e) == null ? void 0 : ee.target)).closest) != null && d.call(ye, ".vuecal__event") || N(B.type ? { e: B, cell: G.value, cursor: Q.value } : B);
1594
1625
  };
1595
- });
1596
- const w = { ...c };
1626
+ const b = { ...r };
1597
1627
  let S = null;
1598
- return c.click = (Y) => {
1599
- var N;
1600
- ee(), (N = w.click) == null || N.call(w, { e: Y, cell: q.value, cursor: ce.value }), S ? S = clearTimeout(S) : S = setTimeout(() => {
1601
- var I;
1602
- S = null, (I = w["delayed-click"]) == null || I.call(w, { e: Y, cell: q.value, cursor: ce.value });
1628
+ return r.click = (Y) => {
1629
+ var B;
1630
+ ue();
1631
+ const N = Pe(Y);
1632
+ (B = b.click) == null || B.call(b, { e: Y, cell: G.value, cursor: N }), S ? S = clearTimeout(S) : S = setTimeout(() => {
1633
+ var ee;
1634
+ S = null, (ee = b["delayed-click"]) == null || ee.call(b, { e: Y, cell: G.value, cursor: N });
1603
1635
  }, 400);
1604
- }, (p.time && h.isDay || h.isDays || h.isWeek) && (c.touchstart = (Y) => {
1636
+ }, (p.time && h.isDay || h.isDays || h.isWeek) && (r.touchstart = (Y) => {
1605
1637
  var N;
1606
- oe(Y.e || Y), (N = w.touchstart) == null || N.call(w, { e: Y, cell: q.value, cursor: ce.value });
1607
- }, c.mousedown = (Y) => {
1638
+ a(Y.e || Y), (N = b.touchstart) == null || N.call(b, { e: Y, cell: G.value, cursor: Q.value });
1639
+ }, r.mousedown = (Y) => {
1608
1640
  var N;
1609
- oe(Y.e || Y), (N = w.mousedown) == null || N.call(w, { e: Y, cell: q.value, cursor: ce.value });
1610
- }), w.dblclick && (c.dblclick = (Y) => {
1611
- var z, R;
1612
- const N = (((z = Y.touches) == null ? void 0 : z[0]) || Y).clientY, { top: I } = m.value.getBoundingClientRect(), x = Je(N - I, m.value), de = Pe(x, p), ye = new Date(n.start);
1613
- ye.setMinutes(de);
1614
- const g = {
1615
- y: x,
1616
- date: ye
1617
- };
1618
- (R = w.dblclick) == null || R.call(w, { e: Y, cell: q.value, cursor: g });
1619
- }), p.editableEvents.drag && (c.dragenter = (Y) => v.cellDragEnter(Y, q.value), c.dragover = (Y) => {
1620
- Y.preventDefault(), v.cellDragOver(Y, q.value);
1621
- }, c.dragleave = (Y) => v.cellDragLeave(Y, q.value), c.drop = (Y) => v.cellDragDrop(Y, q.value)), c;
1622
- }), q = T(() => ({
1641
+ a(Y.e || Y), (N = b.mousedown) == null || N.call(b, { e: Y, cell: G.value, cursor: Q.value });
1642
+ }), b.dblclick && (r.dblclick = (Y) => {
1643
+ var N;
1644
+ (N = b.dblclick) == null || N.call(b, { e: Y, cell: G.value, cursor: Pe(Y) });
1645
+ }), p.editableEvents.drag && (r.dragenter = (Y) => m.cellDragEnter(Y, G.value), r.dragover = (Y) => {
1646
+ Y.preventDefault(), m.cellDragOver(Y, G.value);
1647
+ }, r.dragleave = (Y) => m.cellDragLeave(Y, G.value), r.drop = (Y) => m.cellDragDrop(Y, G.value)), r;
1648
+ }), G = T(() => ({
1623
1649
  start: n.start,
1624
1650
  end: n.end,
1625
1651
  events: l,
1626
- ...u.schedule ? { schedule: u.schedule } : {},
1652
+ ...c.schedule ? { schedule: c.schedule } : {},
1627
1653
  goNarrower: () => h.narrower(),
1628
1654
  goBroader: () => h.broader(),
1629
1655
  broader: h.broaderView,
1630
1656
  narrower: h.narrowerView
1631
- })), ce = T(() => {
1632
- const c = Pe(u.movePercentageY || u.startPercentageY, p), w = new Date(n.start);
1633
- return w.setMinutes(c), {
1634
- x: u.movePercentageX || u.startPercentageX,
1635
- y: u.movePercentageY || u.startPercentageY,
1636
- date: w
1657
+ })), Pe = (r) => {
1658
+ var B;
1659
+ const b = (((B = r.touches) == null ? void 0 : B[0]) || r).clientY, { top: S } = f.value.getBoundingClientRect(), Y = Ze(b - S, f.value), N = new Date(n.start);
1660
+ return N.setMinutes(je(Y, p)), { y: Y, date: N };
1661
+ }, Q = T(() => {
1662
+ const r = je(c.movePercentageY || c.startPercentageY, p), b = new Date(n.start);
1663
+ return b.setMinutes(r), {
1664
+ x: c.movePercentageX || c.startPercentageX,
1665
+ y: c.movePercentageY || c.startPercentageY,
1666
+ date: b
1637
1667
  };
1638
- }), ee = () => {
1668
+ }), ue = () => {
1639
1669
  h.updateSelectedDate(n.start), p.clickToNavigate && ((h.isMonth || h.isDays || h.isWeek) && p.availableViews.day ? h.switch("day") : h.isYear && p.availableViews.month ? h.switch("month") : h.isYears && p.availableViews.year && h.switch("year")), h.updateViewDate(n.start);
1640
- }, oe = (c) => {
1670
+ }, a = (r) => {
1641
1671
  var S, Y;
1642
- u.schedule = ~~c.target.dataset.schedule;
1643
- const w = m.value.getBoundingClientRect();
1644
- u.startX = (((S = c.touches) == null ? void 0 : S[0]) || c).clientX - w.left, u.startY = (((Y = c.touches) == null ? void 0 : Y[0]) || c).clientY - w.top, u.startPercentageX = u.startX * 100 / w.width, u.startPercentageY = u.startY * 100 / w.height, u.thresholdPassed = !1, document.addEventListener(c.type === "touchstart" ? "touchmove" : "mousemove", a), document.addEventListener(c.type === "touchstart" ? "touchend" : "mouseup", k, { once: !0 }), u.holdTimer = setTimeout(() => {
1645
- var N, I;
1646
- u.holding = !0, (I = (N = he.value).hold) == null || I.call(N, { e: c, cell: q.value, cursor: ce.value });
1672
+ c.schedule = ~~r.target.dataset.schedule;
1673
+ const b = f.value.getBoundingClientRect();
1674
+ c.startX = (((S = r.touches) == null ? void 0 : S[0]) || r).clientX - b.left, c.startY = (((Y = r.touches) == null ? void 0 : Y[0]) || r).clientY - b.top, c.startPercentageX = c.startX * 100 / b.width, c.startPercentageY = c.startY * 100 / b.height, c.thresholdPassed = !1, document.addEventListener(r.type === "touchstart" ? "touchmove" : "mousemove", w), document.addEventListener(r.type === "touchstart" ? "touchend" : "mouseup", y, { once: !0 }), c.holdTimer = setTimeout(() => {
1675
+ var N, B;
1676
+ c.holding = !0, (B = (N = fe.value).hold) == null || B.call(N, { e: r, cell: G.value, cursor: Q.value });
1647
1677
  }, 1e3);
1648
- }, a = (c) => {
1649
- var S, Y, N, I, x, de;
1650
- u.dragging || (C.isDraggingCell = !0, (Y = (S = he.value).dragStart) == null || Y.call(S, { e: c, cell: q.value, cursor: ce.value })), u.dragging = !0, u.holdTimer = clearTimeout(u.holdTimer), u.holding = !1;
1651
- const w = m.value.getBoundingClientRect();
1652
- u.moveX = (((N = c.touches) == null ? void 0 : N[0]) || c).clientX - w.left, u.moveY = (((I = c.touches) == null ? void 0 : I[0]) || c).clientY - w.top, u.movePercentageX = u.moveX * 100 / w.width, u.movePercentageY = u.moveY * 100 / w.height, p.eventCreateMinDrag && Math.abs(u.startY - u.moveY) > p.eventCreateMinDrag && (u.thresholdPassed = !0), (de = (x = he.value).drag) == null || de.call(x, { e: c, cell: q.value, cursor: ce.value });
1653
- }, k = async (c) => {
1654
- var w, S;
1655
- document.removeEventListener(c.type === "touchend" ? "touchmove" : "mousemove", a, { passive: !1 }), u.dragging && ((S = (w = he.value).dragEnd) == null || S.call(w, { e: c, cell: q.value, cursor: ce.value }), C.isDraggingCell = !1, p.editableEvents.create && (e.value = !0, await y(c), e.value = !1)), u.holdTimer = clearTimeout(u.holdTimer), u.holding = !1, u.dragging = !1, u.startX = 0, u.startY = 0, u.moveX = 0, u.moveY = 0, u.startPercentageX = 0, u.startPercentageY = 0, u.movePercentageX = 0, u.movePercentageY = 0, u.thresholdPassed = !1, u.schedule = null;
1656
- }, y = async (c) => {
1657
- if (!M.value) return;
1658
- let { start: w, end: S, startMinutes: Y, endMinutes: N } = f.value;
1659
- w = new Date(n.start), w.setMinutes(Y), S = new Date(n.start), S.setMinutes(N);
1660
- let I = { ...f.value, start: w, end: S };
1661
- const { create: x } = p.eventListeners.event;
1662
- if (typeof x == "function") {
1663
- const de = I;
1664
- I = await new Promise((ye) => x({ e: c, event: I, cell: q.value, resolve: ye, cursor: ce.value })), I && typeof I == "object" && h.createEvent(I), I && typeof I == "boolean" && h.createEvent(de);
1665
- } else h.createEvent(I);
1666
- }, A = () => {
1667
- Object.keys(he.value).forEach((c) => {
1668
- var w;
1669
- (w = m.value) == null || w.removeEventListener(c, he.value[c]);
1670
- });
1671
- }, Q = () => {
1672
- d.value = L.getCellOverlappingEvents(B.value);
1678
+ }, w = (r) => {
1679
+ var S, Y, N, B, ee, ye;
1680
+ c.dragging || (C.isDraggingCell = !0, (Y = (S = fe.value).dragStart) == null || Y.call(S, { e: r, cell: G.value, cursor: Q.value })), c.dragging = !0, c.holdTimer = clearTimeout(c.holdTimer), c.holding = !1;
1681
+ const b = f.value.getBoundingClientRect();
1682
+ c.moveX = (((N = r.touches) == null ? void 0 : N[0]) || r).clientX - b.left, c.moveY = (((B = r.touches) == null ? void 0 : B[0]) || r).clientY - b.top, c.movePercentageX = c.moveX * 100 / b.width, c.movePercentageY = c.moveY * 100 / b.height, p.eventCreateMinDrag && Math.abs(c.startY - c.moveY) > p.eventCreateMinDrag && (c.thresholdPassed = !0), (ye = (ee = fe.value).drag) == null || ye.call(ee, { e: r, cell: G.value, cursor: Q.value });
1683
+ }, y = async (r) => {
1684
+ var b, S;
1685
+ document.removeEventListener(r.type === "touchend" ? "touchmove" : "mousemove", w, { passive: !1 }), c.dragging && ((S = (b = fe.value).dragEnd) == null || S.call(b, { e: r, cell: G.value, cursor: Q.value }), C.isDraggingCell = !1, p.editableEvents.create && (e.value = !0, await I(r), e.value = !1)), c.holdTimer = clearTimeout(c.holdTimer), c.holding = !1, c.dragging = !1, c.startX = 0, c.startY = 0, c.moveX = 0, c.moveY = 0, c.startPercentageX = 0, c.startPercentageY = 0, c.movePercentageX = 0, c.movePercentageY = 0, c.thresholdPassed = !1, c.schedule = null;
1686
+ }, I = async (r) => {
1687
+ if (!$.value) return;
1688
+ let { start: b, end: S, startMinutes: Y, endMinutes: N } = g.value;
1689
+ b = new Date(n.start), b.setMinutes(Y), S = new Date(n.start), S.setMinutes(N);
1690
+ let B = { ...g.value, start: b, end: S };
1691
+ const { create: ee } = p.eventListeners.event;
1692
+ if (typeof ee == "function") {
1693
+ const ye = B;
1694
+ B = await new Promise((d) => ee({ e: r, event: B, cell: G.value, resolve: d, cursor: Q.value })), B && typeof B == "object" && h.createEvent(B), B && typeof B == "boolean" && h.createEvent(ye);
1695
+ } else h.createEvent(B);
1696
+ }, x = () => {
1697
+ var r;
1698
+ for (const b of Object.keys(fe.value))
1699
+ (r = f.value) == null || r.removeEventListener(b, fe.value[b]);
1700
+ }, ge = () => {
1701
+ v.value = L.getCellOverlappingEvents(A.value);
1673
1702
  };
1674
- return me(
1703
+ return de(
1675
1704
  // Watch event IDs and start/end dates (only) to detect event resizing/dnd.
1676
- () => _.value.map((c) => `${c._.id}${c.start.getTime()}${c.end.getTime()}`).join(),
1705
+ () => _.value.map((r) => `${r._.id}${r.start.getTime()}${r.end.getTime()}`).join(),
1677
1706
  async () => {
1678
- await Ue(), Q();
1707
+ await Ue(), ge();
1679
1708
  },
1680
1709
  { immediate: !0, flush: "post" }
1681
1710
  // Use flush: 'post' to prevent infinite updates.
1682
1711
  ), Xe(async () => {
1683
- $.value.forEach((c) => L.deleteEvent(c, 3)), A(), await Ue();
1684
- }), (c, w) => (E(), j("div", De({
1712
+ for (const r of M.value) L.deleteEvent(r, 3);
1713
+ x(), await Ue();
1714
+ }), (r, b) => (E(), j("div", he({
1685
1715
  class: ["vuecal__cell", P.value],
1686
1716
  ref_key: "cellEl",
1687
- ref: m
1688
- }, Ie(he.value, !0)), [
1689
- c.$slots.cell ? F(c.$slots, "cell", {
1717
+ ref: f
1718
+ }, Ie(fe.value, !0)), [
1719
+ r.$slots.cell ? H(r.$slots, "cell", {
1690
1720
  key: 0,
1691
- cell: q.value
1692
- }) : Z("", !0),
1693
- U.value ? (E(!0), j(te, { key: 1 }, we(U.value, (S, Y) => (E(), j("div", {
1694
- class: _e(["vuecal__special-hours", S.class]),
1695
- style: Te(S.style),
1721
+ cell: G.value
1722
+ }) : q("", !0),
1723
+ J.value ? (E(!0), j(te, { key: 1 }, pe(J.value, (S, Y) => (E(), j("div", {
1724
+ class: we(["vuecal__special-hours", S.class]),
1725
+ style: be(S.style),
1696
1726
  innerHTML: S.label || ""
1697
- }, null, 14, At))), 256)) : Z("", !0),
1698
- !c.$slots.cell && O(p).schedules ? (E(!0), j(te, { key: 2 }, we(O(p).schedules, (S) => (E(), j("div", {
1699
- class: _e(["vuecal__schedule vuecal__schedule--cell", S.class]),
1727
+ }, null, 14, na))), 256)) : q("", !0),
1728
+ !r.$slots.cell && O(p).schedules ? (E(!0), j(te, { key: 2 }, pe(O(p).schedules, (S) => (E(), j("div", {
1729
+ class: we(["vuecal__schedule vuecal__schedule--cell", S.class]),
1700
1730
  key: S.id,
1701
- style: Te(S.style || null),
1731
+ style: be(S.style || null),
1702
1732
  "data-schedule": S.id
1703
1733
  }, [
1704
- c.$slots["cell-events"] ? F(c.$slots, "cell-events", {
1734
+ r.$slots["cell-events"] ? H(r.$slots, "cell-events", {
1705
1735
  key: 0,
1706
- cell: q.value
1707
- }) : Z("", !0),
1708
- s.value || c.$slots["cell-date"] ? (E(), j("div", Rt, [
1709
- F(c.$slots, "cell-date", { cell: q.value }, () => [
1710
- xe(le(s.value), 1)
1736
+ cell: G.value
1737
+ }) : q("", !0),
1738
+ s.value || r.$slots["cell-date"] ? (E(), j("div", la, [
1739
+ H(r.$slots, "cell-date", { cell: G.value }, () => [
1740
+ et(le(s.value), 1)
1711
1741
  ])
1712
- ])) : Z("", !0),
1713
- c.$slots["cell-content"] ? (E(), j("div", Xt, [
1714
- F(c.$slots, "cell-content", { cell: q.value })
1715
- ])) : Z("", !0),
1716
- c.$slots["cell-events"] && l.value.length ? (E(), j("div", Gt, [
1717
- F(c.$slots, "cell-events", { cell: q.value })
1718
- ])) : l.value.length || W.value ? (E(), Se(et, {
1742
+ ])) : q("", !0),
1743
+ r.$slots["cell-content"] ? (E(), j("div", ra, [
1744
+ H(r.$slots, "cell-content", { cell: G.value })
1745
+ ])) : q("", !0),
1746
+ r.$slots["cell-events"] && l.value.length ? (E(), j("div", oa, [
1747
+ H(r.$slots, "cell-events", { cell: G.value })
1748
+ ])) : l.value.length || W.value ? (E(), Ee(tt, {
1719
1749
  key: 4,
1720
1750
  class: "vuecal__cell-events",
1721
1751
  name: "vuecal-event-delete",
1722
- onBeforeLeave: w[0] || (w[0] = (Y) => W.value = !0),
1723
- onAfterLeave: o,
1752
+ onBeforeLeave: b[0] || (b[0] = (Y) => W.value = !0),
1753
+ onAfterLeave: i,
1724
1754
  tag: "div"
1725
1755
  }, {
1726
- default: J(() => [
1727
- (E(!0), j(te, null, we(t.value[S.id], (Y) => (E(), Se(at, {
1756
+ default: Z(() => [
1757
+ (E(!0), j(te, null, pe(t.value[S.id], (Y) => (E(), Ee(nt, {
1728
1758
  key: Y._.id,
1729
1759
  event: Y,
1730
- onEventDeleted: G,
1731
- style: Te(V.value[Y._.id])
1732
- }, je({ _: 2 }, [
1733
- c.$slots.event ? {
1760
+ onEventDeleted: X,
1761
+ style: be(V.value[Y._.id])
1762
+ }, Oe({ _: 2 }, [
1763
+ r.$slots.event ? {
1734
1764
  name: "event",
1735
- fn: J((N) => [
1736
- F(c.$slots, "event", De({ ref_for: !0 }, N))
1765
+ fn: Z((N) => [
1766
+ H(r.$slots, "event", he({ ref_for: !0 }, N))
1737
1767
  ]),
1738
1768
  key: "0"
1739
1769
  } : void 0
1740
1770
  ]), 1032, ["event", "style"]))), 128))
1741
1771
  ]),
1742
1772
  _: 2
1743
- }, 1024)) : Z("", !0),
1744
- M.value && u.schedule === S.id ? (E(), j("div", {
1773
+ }, 1024)) : q("", !0),
1774
+ $.value && c.schedule === S.id ? (E(), j("div", {
1745
1775
  key: 5,
1746
1776
  class: "vuecal__event-placeholder",
1747
- style: Te(f.value.style)
1748
- }, le(f.value.start) + " - " + le(f.value.end), 5)) : Z("", !0)
1749
- ], 14, It))), 128)) : Z("", !0),
1750
- !c.$slots.cell && !O(p).schedules ? (E(), j(te, { key: 3 }, [
1751
- c.$slots["cell-events"] ? F(c.$slots, "cell-events", {
1777
+ style: be(g.value.style)
1778
+ }, le(g.value.start) + " - " + le(g.value.end), 5)) : q("", !0)
1779
+ ], 14, sa))), 128)) : q("", !0),
1780
+ !r.$slots.cell && !O(p).schedules ? (E(), j(te, { key: 3 }, [
1781
+ r.$slots["cell-events"] ? H(r.$slots, "cell-events", {
1752
1782
  key: 0,
1753
- cell: q.value
1754
- }) : Z("", !0),
1755
- s.value || c.$slots["cell-date"] ? (E(), j("div", qt, [
1756
- F(c.$slots, "cell-date", { cell: q.value }, () => [
1757
- xe(le(s.value), 1)
1783
+ cell: G.value
1784
+ }) : q("", !0),
1785
+ s.value || r.$slots["cell-date"] ? (E(), j("div", ia, [
1786
+ H(r.$slots, "cell-date", { cell: G.value }, () => [
1787
+ et(le(s.value), 1)
1758
1788
  ])
1759
- ])) : Z("", !0),
1760
- c.$slots["cell-content"] ? (E(), j("div", Ut, [
1761
- F(c.$slots, "cell-content", { cell: q.value })
1762
- ])) : Z("", !0),
1763
- c.$slots["cell-events"] && l.value.length ? (E(), j("div", Zt, [
1764
- F(c.$slots, "cell-events", { cell: q.value })
1765
- ])) : (l.value.length || W.value) && !(O(h).isMonth && !O(p).eventsOnMonthView) ? (E(), Se(et, {
1789
+ ])) : q("", !0),
1790
+ r.$slots["cell-content"] ? (E(), j("div", ua, [
1791
+ H(r.$slots, "cell-content", { cell: G.value })
1792
+ ])) : q("", !0),
1793
+ r.$slots["cell-events"] && l.value.length ? (E(), j("div", ca, [
1794
+ H(r.$slots, "cell-events", { cell: G.value })
1795
+ ])) : (l.value.length || W.value) && !(O(h).isMonth && !O(p).eventsOnMonthView) ? (E(), Ee(tt, {
1766
1796
  key: 4,
1767
1797
  class: "vuecal__cell-events",
1768
1798
  name: "vuecal-event-delete",
1769
- onBeforeLeave: w[1] || (w[1] = (S) => W.value = !0),
1770
- onAfterLeave: o,
1799
+ onBeforeLeave: b[1] || (b[1] = (S) => W.value = !0),
1800
+ onAfterLeave: i,
1771
1801
  tag: "div"
1772
1802
  }, {
1773
- default: J(() => [
1774
- (E(!0), j(te, null, we(l.value, (S) => (E(), Se(at, {
1803
+ default: Z(() => [
1804
+ (E(!0), j(te, null, pe(l.value, (S) => (E(), Ee(nt, {
1775
1805
  key: S._.id,
1776
1806
  event: S,
1777
- onEventDeleted: G,
1778
- style: Te(V.value[S._.id])
1779
- }, je({ _: 2 }, [
1780
- c.$slots.event ? {
1807
+ onEventDeleted: X,
1808
+ style: be(V.value[S._.id])
1809
+ }, Oe({ _: 2 }, [
1810
+ r.$slots.event ? {
1781
1811
  name: "event",
1782
- fn: J((Y) => [
1783
- F(c.$slots, "event", De({ ref_for: !0 }, Y))
1812
+ fn: Z((Y) => [
1813
+ H(r.$slots, "event", he({ ref_for: !0 }, Y))
1784
1814
  ]),
1785
1815
  key: "0"
1786
1816
  } : void 0
1787
1817
  ]), 1032, ["event", "style"]))), 128))
1788
1818
  ]),
1789
1819
  _: 3
1790
- })) : Z("", !0),
1791
- M.value ? (E(), j("div", {
1820
+ })) : q("", !0),
1821
+ $.value ? (E(), j("div", {
1792
1822
  key: 5,
1793
1823
  class: "vuecal__event-placeholder",
1794
- style: Te(f.value.style)
1795
- }, le(f.value.start) + " - " + le(f.value.end), 5)) : Z("", !0)
1796
- ], 64)) : Z("", !0),
1797
- c.$slots["event-count"] ? F(c.$slots, "event-count", {
1824
+ style: be(g.value.style)
1825
+ }, le(g.value.start) + " - " + le(g.value.end), 5)) : q("", !0)
1826
+ ], 64)) : q("", !0),
1827
+ r.$slots["event-count"] ? H(r.$slots, "event-count", {
1798
1828
  key: 4,
1799
1829
  events: _.value
1800
- }) : H.value ? (E(), j("div", Jt, le(_.value.length), 1)) : Z("", !0),
1830
+ }) : F.value ? (E(), j("div", da, le(_.value.length), 1)) : q("", !0),
1801
1831
  re.show ? (E(), j("div", {
1802
1832
  key: 6,
1803
1833
  class: "vuecal__now-line",
1804
- style: Te(re.style),
1834
+ style: be(re.style),
1805
1835
  title: re.currentTime
1806
1836
  }, [
1807
- ge("span", null, le(re.currentTime), 1)
1808
- ], 12, Kt)) : Z("", !0)
1837
+ me("span", null, le(re.currentTime), 1)
1838
+ ], 12, va)) : q("", !0)
1809
1839
  ], 16));
1810
1840
  }
1811
- }, xt = {
1841
+ }, fa = {
1812
1842
  __name: "body",
1813
1843
  setup(D) {
1814
- const n = Ne("vuecal"), { view: r, config: h, dateUtils: p } = n, b = ie(null), L = ie(null), v = T(() => ({
1815
- "--vuecal-grid-columns": r.cols,
1816
- "--vuecal-grid-rows": r.rows
1844
+ const n = Ne("vuecal"), { view: o, config: h, dateUtils: p } = n, k = oe(null), L = oe(null), m = T(() => ({
1845
+ "--vuecal-grid-columns": o.cols,
1846
+ "--vuecal-grid-rows": o.rows
1817
1847
  })), C = T(() => {
1818
- const $ = p.formatTime(Pe(L.value, h));
1848
+ const M = p.formatTime(je(L.value, h));
1819
1849
  return {
1820
1850
  style: { top: `${L.value}%` },
1821
- time: $
1851
+ time: M
1822
1852
  };
1823
- }), i = ($) => {
1824
- var o;
1825
- if (r.isMonth || r.isYear || r.isYears) return;
1826
- const W = (((o = $.touches) == null ? void 0 : o[0]) || $).clientY, { top: G } = b.value.getBoundingClientRect();
1827
- L.value = Je(W - G, b.value);
1828
- }, m = () => {
1853
+ }), u = (M) => {
1854
+ var i;
1855
+ if (o.isMonth || o.isYear || o.isYears) return;
1856
+ const W = (((i = M.touches) == null ? void 0 : i[0]) || M).clientY, { top: X } = k.value.getBoundingClientRect();
1857
+ L.value = Ze(W - X, k.value);
1858
+ }, f = () => {
1829
1859
  L.value = null;
1830
1860
  };
1831
- return Ze(() => {
1832
- b.value.addEventListener("mousemove", i), b.value.addEventListener("touchmove", i), b.value.addEventListener("mouseleave", m), b.value.addEventListener("touchend", m);
1861
+ return qe(() => {
1862
+ k.value.addEventListener("mousemove", u), k.value.addEventListener("touchmove", u), k.value.addEventListener("mouseleave", f), k.value.addEventListener("touchend", f);
1833
1863
  }), Xe(() => {
1834
- b.value && (b.value.removeEventListener("mousemove", i), b.value.removeEventListener("touchmove", i), b.value.removeEventListener("mouseleave", m), b.value.removeEventListener("touchend", m));
1835
- }), ($, W) => (E(), j("div", {
1864
+ k.value && (k.value.removeEventListener("mousemove", u), k.value.removeEventListener("touchmove", u), k.value.removeEventListener("mouseleave", f), k.value.removeEventListener("touchend", f));
1865
+ }), (M, W) => (E(), j("div", {
1836
1866
  class: "vuecal__body",
1837
1867
  ref_key: "bodyEl",
1838
- ref: b,
1839
- style: Te(v.value)
1868
+ ref: k,
1869
+ style: be(m.value)
1840
1870
  }, [
1841
- Oe(Ge, { name: "vuecal-shrink" }, {
1842
- default: J(() => [
1871
+ Ve(Ge, { name: "vuecal-shrink" }, {
1872
+ default: Z(() => [
1843
1873
  O(h).timeAtCursor && L.value !== null ? (E(), j("div", {
1844
1874
  key: 0,
1845
1875
  class: "vuecal__time-at-cursor",
1846
- style: Te(C.value.style)
1876
+ style: be(C.value.style)
1847
1877
  }, [
1848
- ge("label", null, le(C.value.time), 1)
1849
- ], 4)) : Z("", !0)
1878
+ me("label", null, le(C.value.time), 1)
1879
+ ], 4)) : q("", !0)
1850
1880
  ]),
1851
1881
  _: 1
1852
1882
  }),
1853
- (E(!0), j(te, null, we(O(r).cellDates, (G, o) => (E(), Se(Qt, {
1854
- key: o,
1855
- start: G.start,
1856
- end: G.end,
1857
- index: o
1858
- }, je({ _: 2 }, [
1859
- $.$slots.cell ? {
1883
+ (E(!0), j(te, null, pe(O(o).cellDates, (X, i) => (E(), Ee(ma, {
1884
+ key: i,
1885
+ start: X.start,
1886
+ end: X.end,
1887
+ index: i
1888
+ }, Oe({ _: 2 }, [
1889
+ M.$slots.cell ? {
1860
1890
  name: "cell",
1861
- fn: J((u) => [
1862
- F($.$slots, "cell", De({ ref_for: !0 }, u))
1891
+ fn: Z((c) => [
1892
+ H(M.$slots, "cell", he({ ref_for: !0 }, c))
1863
1893
  ]),
1864
1894
  key: "0"
1865
1895
  } : void 0,
1866
- $.$slots["cell-date"] ? {
1896
+ M.$slots["cell-date"] ? {
1867
1897
  name: "cell-date",
1868
- fn: J((u) => [
1869
- F($.$slots, "cell-date", De({ ref_for: !0 }, u))
1898
+ fn: Z((c) => [
1899
+ H(M.$slots, "cell-date", he({ ref_for: !0 }, c))
1870
1900
  ]),
1871
1901
  key: "1"
1872
1902
  } : void 0,
1873
- $.$slots["cell-content"] ? {
1903
+ M.$slots["cell-content"] ? {
1874
1904
  name: "cell-content",
1875
- fn: J((u) => [
1876
- F($.$slots, "cell-content", De({ ref_for: !0 }, u))
1905
+ fn: Z((c) => [
1906
+ H(M.$slots, "cell-content", he({ ref_for: !0 }, c))
1877
1907
  ]),
1878
1908
  key: "2"
1879
1909
  } : void 0,
1880
- $.$slots["cell-events"] ? {
1910
+ M.$slots["cell-events"] ? {
1881
1911
  name: "cell-events",
1882
- fn: J((u) => [
1883
- F($.$slots, "cell-events", De({ ref_for: !0 }, u))
1912
+ fn: Z((c) => [
1913
+ H(M.$slots, "cell-events", he({ ref_for: !0 }, c))
1884
1914
  ]),
1885
1915
  key: "3"
1886
- } : $.$slots.event ? {
1916
+ } : M.$slots.event ? {
1887
1917
  name: "event",
1888
- fn: J((u) => [
1889
- F($.$slots, "event", De({ ref_for: !0 }, u))
1918
+ fn: Z((c) => [
1919
+ H(M.$slots, "event", he({ ref_for: !0 }, c))
1890
1920
  ]),
1891
1921
  key: "4"
1892
- } : $.$slots["event-count"] ? {
1922
+ } : M.$slots["event-count"] ? {
1893
1923
  name: "event-count",
1894
- fn: J((u) => [
1895
- F($.$slots, "event-count", De({ ref_for: !0 }, u))
1924
+ fn: Z((c) => [
1925
+ H(M.$slots, "event-count", he({ ref_for: !0 }, c))
1896
1926
  ]),
1897
1927
  key: "5"
1898
1928
  } : void 0
1899
1929
  ]), 1032, ["start", "end", "index"]))), 128))
1900
1930
  ], 4));
1901
1931
  }
1902
- }, ea = ["data-locale"], ta = { class: "vuecal__scrollable-wrap" }, aa = {
1932
+ }, ga = ["data-locale"], ha = { class: "vuecal__scrollable-wrap" }, ya = {
1903
1933
  key: 1,
1904
1934
  class: "vuecal__week-numbers"
1905
- }, na = { class: "vuecal__week-number" }, sa = { class: "vuecal__body-wrap" }, oa = {
1935
+ }, Da = { class: "vuecal__week-number" }, pa = { class: "vuecal__body-wrap" }, _a = {
1906
1936
  __name: "index",
1907
- props: pt,
1937
+ props: Pt,
1908
1938
  emits: [
1909
1939
  "ready",
1910
1940
  "view-change",
@@ -1916,174 +1946,174 @@ const st = (D, n) => {
1916
1946
  "event-created",
1917
1947
  "event-dropped"
1918
1948
  ],
1919
- setup(D, { expose: n, emit: r }) {
1920
- const h = D, p = r, b = ot("vuecal-el"), L = yt({ props: h, emit: p, attrs: ut(), vuecalEl: b, uid: it() }), { config: v, view: C, dateUtils: i, touch: m } = L, $ = T(() => v.time && (C.isDay || C.isDays || C.isWeek)), W = T(() => Array(C.rows).fill().map((e, d) => i.getWeek(i.addDays(C.firstCellDate, 7 * d)))), G = T(() => {
1949
+ setup(D, { expose: n, emit: o }) {
1950
+ const h = D, p = o, k = _t("vuecal-el"), L = Ot({ props: h, emit: p, attrs: bt(), vuecalEl: k, uid: kt() }), { config: m, view: C, dateUtils: u, touch: f } = L, M = T(() => m.time && (C.isDay || C.isDays || C.isWeek)), W = T(() => Array(C.rows).fill().map((e, v) => u.getWeek(u.addDays(C.firstCellDate, 7 * v)))), X = T(() => {
1921
1951
  var e;
1922
1952
  return {
1923
- "vuecal--ready": v.ready,
1924
- [`vuecal--${v.theme}-theme`]: v.theme,
1925
- [`vuecal--${v.size}`]: !0,
1926
- "vuecal--date-picker": v.datePicker,
1927
- "vuecal--dark": v.dark,
1928
- "vuecal--light": !v.dark,
1953
+ "vuecal--ready": m.ready,
1954
+ [`vuecal--${m.theme}-theme`]: m.theme,
1955
+ [`vuecal--${m.size}`]: !0,
1956
+ "vuecal--date-picker": m.datePicker,
1957
+ "vuecal--dark": m.dark,
1958
+ "vuecal--light": !m.dark,
1929
1959
  [`vuecal--${C.id}-view`]: !0,
1930
- "vuecal--view-has-time": $.value,
1931
- "vuecal--timeless": !v.time,
1932
- "vuecal--dragging-cell": m.isDraggingCell,
1933
- "vuecal--dragging-event": m.isDraggingEvent,
1934
- "vuecal--resizing-event": m.isResizingEvent,
1935
- "vuecal--has-schedules": (e = v.schedules) == null ? void 0 : e.length
1960
+ "vuecal--view-has-time": M.value,
1961
+ "vuecal--timeless": !m.time,
1962
+ "vuecal--dragging-cell": f.isDraggingCell,
1963
+ "vuecal--dragging-event": f.isDraggingEvent,
1964
+ "vuecal--resizing-event": f.isResizingEvent,
1965
+ "vuecal--has-schedules": (e = m.schedules) == null ? void 0 : e.length
1936
1966
  };
1937
- }), o = T(() => ({
1938
- "--vuecal-time-cell-height": v.timeCellHeight && `${v.timeCellHeight}px`
1939
- })), u = T(() => {
1940
- var e, d;
1967
+ }), i = T(() => ({
1968
+ "--vuecal-time-cell-height": m.timeCellHeight && `${m.timeCellHeight}px`
1969
+ })), c = T(() => {
1970
+ var e, v;
1941
1971
  return {
1942
- "vuecal__scrollable--row": $.value || v.weekNumbers && C.isMonth,
1972
+ "vuecal__scrollable--row": M.value || m.weekNumbers && C.isMonth,
1943
1973
  // Keep the states inside the Vue transition wrapper for smooth CSS transitions.
1944
1974
  [`vuecal__scrollable--${C.id}-view`]: !0,
1945
- "vuecal__scrollable--has-schedules": (e = v.schedules) == null ? void 0 : e.length,
1946
- "vuecal__scrollable--no-schedules": !((d = v.schedules) != null && d.length)
1975
+ "vuecal__scrollable--has-schedules": (e = m.schedules) == null ? void 0 : e.length,
1976
+ "vuecal__scrollable--no-schedules": !((v = m.schedules) != null && v.length)
1947
1977
  };
1948
1978
  });
1949
- return Ze(async () => {
1950
- await Ue(), v.ready = !0, p("ready", { config: v, view: C });
1951
- }), ct("vuecal", L), n({ view: L.view }), (e, d) => (E(), j("div", {
1952
- class: _e(["vuecal", G.value]),
1979
+ return qe(async () => {
1980
+ await Ue(), m.ready = !0, p("ready", { config: m, view: C });
1981
+ }), Tt("vuecal", L), n({ view: L.view }), (e, v) => (E(), j("div", {
1982
+ class: we(["vuecal", X.value]),
1953
1983
  ref: "vuecal-el",
1954
1984
  "data-locale": e.locale,
1955
- style: Te(o.value)
1985
+ style: be(i.value)
1956
1986
  }, [
1957
- e.$slots.diy ? F(e.$slots, "diy", {
1987
+ e.$slots.diy ? H(e.$slots, "diy", {
1958
1988
  key: 0,
1959
1989
  vuecal: O(L)
1960
1990
  }) : (E(), j(te, { key: 1 }, [
1961
- Oe(Mt, null, je({ _: 2 }, [
1991
+ Ve(At, null, Oe({ _: 2 }, [
1962
1992
  e.$slots.header ? {
1963
1993
  name: "header",
1964
- fn: J((f) => [
1965
- F(e.$slots, "header", ne(se(f)))
1994
+ fn: Z((g) => [
1995
+ H(e.$slots, "header", ne(se(g)))
1966
1996
  ]),
1967
1997
  key: "0"
1968
1998
  } : void 0,
1969
1999
  !e.$slots.header && e.$slots["previous-button"] ? {
1970
2000
  name: "previous-button",
1971
- fn: J((f) => [
1972
- F(e.$slots, "previous-button", ne(se(f)))
2001
+ fn: Z((g) => [
2002
+ H(e.$slots, "previous-button", ne(se(g)))
1973
2003
  ]),
1974
2004
  key: "1"
1975
2005
  } : void 0,
1976
2006
  !e.$slots.header && e.$slots["next-button"] ? {
1977
2007
  name: "next-button",
1978
- fn: J((f) => [
1979
- F(e.$slots, "next-button", ne(se(f)))
2008
+ fn: Z((g) => [
2009
+ H(e.$slots, "next-button", ne(se(g)))
1980
2010
  ]),
1981
2011
  key: "2"
1982
2012
  } : void 0,
1983
2013
  !e.$slots.header && e.$slots["today-button"] ? {
1984
2014
  name: "today-button",
1985
- fn: J((f) => [
1986
- F(e.$slots, "today-button", ne(se(f)))
2015
+ fn: Z((g) => [
2016
+ H(e.$slots, "today-button", ne(se(g)))
1987
2017
  ]),
1988
2018
  key: "3"
1989
2019
  } : void 0,
1990
2020
  !e.$slots.header && e.$slots.title ? {
1991
2021
  name: "title",
1992
- fn: J((f) => [
1993
- F(e.$slots, "title", ne(se(f)))
2022
+ fn: Z((g) => [
2023
+ H(e.$slots, "title", ne(se(g)))
1994
2024
  ]),
1995
2025
  key: "4"
1996
2026
  } : void 0,
1997
2027
  !e.$slots.header && e.$slots["schedule-heading"] ? {
1998
2028
  name: "schedule-heading",
1999
- fn: J((f) => [
2000
- F(e.$slots, "schedule-heading", ne(se(f)))
2029
+ fn: Z((g) => [
2030
+ H(e.$slots, "schedule-heading", ne(se(g)))
2001
2031
  ]),
2002
2032
  key: "5"
2003
2033
  } : void 0
2004
2034
  ]), 1024),
2005
- ge("div", ta, [
2006
- Oe(Ge, {
2035
+ me("div", ha, [
2036
+ Ve(Ge, {
2007
2037
  name: `vuecal-slide-fade--${O(C).transitionDirection}`
2008
2038
  }, {
2009
- default: J(() => [
2039
+ default: Z(() => [
2010
2040
  (E(), j("div", {
2011
- class: _e(["vuecal__scrollable", u.value]),
2041
+ class: we(["vuecal__scrollable", c.value]),
2012
2042
  key: O(C).id + O(C).start.getTime()
2013
2043
  }, [
2014
- $.value ? (E(), Se(Lt, { key: 0 }, je({ _: 2 }, [
2044
+ M.value ? (E(), Ee(Kt, { key: 0 }, Oe({ _: 2 }, [
2015
2045
  e.$slots["time-cell"] ? {
2016
2046
  name: "time-cell",
2017
- fn: J((f) => [
2018
- F(e.$slots, "time-cell", ne(se(f)))
2047
+ fn: Z((g) => [
2048
+ H(e.$slots, "time-cell", ne(se(g)))
2019
2049
  ]),
2020
2050
  key: "0"
2021
2051
  } : void 0
2022
- ]), 1024)) : Z("", !0),
2023
- O(v).weekNumbers && O(C).isMonth ? (E(), j("div", aa, [
2024
- (E(!0), j(te, null, we(W.value, (f) => (E(), j("div", na, [
2025
- F(e.$slots, "week-number", {}, () => [
2026
- ge("small", null, le(f), 1)
2052
+ ]), 1024)) : q("", !0),
2053
+ O(m).weekNumbers && O(C).isMonth ? (E(), j("div", ya, [
2054
+ (E(!0), j(te, null, pe(W.value, (g) => (E(), j("div", Da, [
2055
+ H(e.$slots, "week-number", {}, () => [
2056
+ me("small", null, le(g), 1)
2027
2057
  ])
2028
2058
  ]))), 256))
2029
- ])) : Z("", !0),
2030
- ge("div", sa, [
2031
- Oe(Pt, null, je({ _: 2 }, [
2059
+ ])) : q("", !0),
2060
+ me("div", pa, [
2061
+ Ve(qt, null, Oe({ _: 2 }, [
2032
2062
  e.$slots["weekday-heading"] ? {
2033
2063
  name: "weekday-heading",
2034
- fn: J((f) => [
2035
- F(e.$slots, "weekday-heading", ne(se(f)))
2064
+ fn: Z((g) => [
2065
+ H(e.$slots, "weekday-heading", ne(se(g)))
2036
2066
  ]),
2037
2067
  key: "0"
2038
2068
  } : void 0,
2039
2069
  e.$slots["schedule-heading"] ? {
2040
2070
  name: "schedule-heading",
2041
- fn: J((f) => [
2042
- F(e.$slots, "schedule-heading", ne(se(f)))
2071
+ fn: Z((g) => [
2072
+ H(e.$slots, "schedule-heading", ne(se(g)))
2043
2073
  ]),
2044
2074
  key: "1"
2045
2075
  } : void 0
2046
2076
  ]), 1024),
2047
- Oe(xt, null, je({ _: 2 }, [
2077
+ Ve(fa, null, Oe({ _: 2 }, [
2048
2078
  e.$slots.cell ? {
2049
2079
  name: "cell",
2050
- fn: J((f) => [
2051
- F(e.$slots, "cell", ne(se(f)))
2080
+ fn: Z((g) => [
2081
+ H(e.$slots, "cell", ne(se(g)))
2052
2082
  ]),
2053
2083
  key: "0"
2054
2084
  } : void 0,
2055
2085
  !e.$slots.cell && e.$slots["cell-date"] ? {
2056
2086
  name: "cell-date",
2057
- fn: J((f) => [
2058
- F(e.$slots, "cell-date", ne(se(f)))
2087
+ fn: Z((g) => [
2088
+ H(e.$slots, "cell-date", ne(se(g)))
2059
2089
  ]),
2060
2090
  key: "1"
2061
2091
  } : void 0,
2062
2092
  !e.$slots.cell && e.$slots["cell-content"] ? {
2063
2093
  name: "cell-content",
2064
- fn: J((f) => [
2065
- F(e.$slots, "cell-content", ne(se(f)))
2094
+ fn: Z((g) => [
2095
+ H(e.$slots, "cell-content", ne(se(g)))
2066
2096
  ]),
2067
2097
  key: "2"
2068
2098
  } : void 0,
2069
2099
  !e.$slots.cell && e.$slots["cell-events"] ? {
2070
2100
  name: "cell-events",
2071
- fn: J((f) => [
2072
- F(e.$slots, "cell-events", ne(se(f)))
2101
+ fn: Z((g) => [
2102
+ H(e.$slots, "cell-events", ne(se(g)))
2073
2103
  ]),
2074
2104
  key: "3"
2075
2105
  } : void 0,
2076
2106
  !e.$slots.cell && e.$slots.event ? {
2077
2107
  name: "event",
2078
- fn: J((f) => [
2079
- F(e.$slots, "event", ne(se(f)))
2108
+ fn: Z((g) => [
2109
+ H(e.$slots, "event", ne(se(g)))
2080
2110
  ]),
2081
2111
  key: "4"
2082
2112
  } : void 0,
2083
2113
  !e.$slots.cell && e.$slots["event-count"] ? {
2084
2114
  name: "event-count",
2085
- fn: J((f) => [
2086
- F(e.$slots, "event-count", ne(se(f)))
2115
+ fn: Z((g) => [
2116
+ H(e.$slots, "event-count", ne(se(g)))
2087
2117
  ]),
2088
2118
  key: "5"
2089
2119
  } : void 0
@@ -2095,63 +2125,63 @@ const st = (D, n) => {
2095
2125
  }, 8, ["name"])
2096
2126
  ])
2097
2127
  ], 64))
2098
- ], 14, ea));
2128
+ ], 14, ga));
2099
2129
  }
2100
- }, ia = (D) => {
2101
- Fe.texts = { ...fe.texts, ...D }, Fe.dateUtils.updateTexts(Fe.texts);
2130
+ }, ka = (D) => {
2131
+ He.texts = { ...ve.texts, ...D }, He.dateUtils.updateTexts(He.texts);
2102
2132
  }, {
2103
- addDatePrototypes: ua,
2104
- removeDatePrototypes: ca,
2105
- updateTexts: da,
2106
- addDays: va,
2107
- subtractDays: ma,
2108
- addHours: fa,
2109
- subtractHours: ga,
2110
- addMinutes: ha,
2111
- subtractMinutes: ya,
2112
- getWeek: Da,
2113
- isToday: pa,
2114
- isSameDate: wa,
2115
- isInRange: _a,
2116
- isLeapYear: ka,
2117
- getPreviousFirstDayOfWeek: ba,
2118
- stringToDate: Ta,
2119
- dateToMinutes: $a,
2120
- countDays: Ma,
2121
- datesInSameTimeStep: Ya,
2122
- isValid: Ea,
2123
- formatDate: Sa,
2124
- formatDateLite: Ca,
2125
- formatTime: Va,
2126
- formatTimeLite: Oa,
2127
- formatMinutes: ja
2128
- } = Fe.dateUtils;
2133
+ addDatePrototypes: ba,
2134
+ removeDatePrototypes: Ta,
2135
+ updateTexts: Ma,
2136
+ addDays: $a,
2137
+ subtractDays: Ya,
2138
+ addHours: Ea,
2139
+ subtractHours: Sa,
2140
+ addMinutes: Ca,
2141
+ subtractMinutes: Va,
2142
+ getWeek: Oa,
2143
+ isToday: ja,
2144
+ isSameDate: Pa,
2145
+ isInRange: Fa,
2146
+ isLeapYear: La,
2147
+ getPreviousFirstDayOfWeek: za,
2148
+ stringToDate: Ha,
2149
+ dateToMinutes: Na,
2150
+ countDays: Wa,
2151
+ datesInSameTimeStep: Aa,
2152
+ isValid: Ba,
2153
+ formatDate: Ia,
2154
+ formatDateLite: Ra,
2155
+ formatTime: Xa,
2156
+ formatTimeLite: Ga,
2157
+ formatMinutes: Ja
2158
+ } = He.dateUtils;
2129
2159
  export {
2130
- oa as VueCal,
2131
- ua as addDatePrototypes,
2132
- va as addDays,
2133
- fa as addHours,
2134
- ha as addMinutes,
2135
- Ma as countDays,
2136
- $a as dateToMinutes,
2137
- Ya as datesInSameTimeStep,
2138
- Sa as formatDate,
2139
- Ca as formatDateLite,
2140
- ja as formatMinutes,
2141
- Va as formatTime,
2142
- Oa as formatTimeLite,
2143
- ba as getPreviousFirstDayOfWeek,
2144
- Da as getWeek,
2145
- _a as isInRange,
2146
- ka as isLeapYear,
2147
- wa as isSameDate,
2148
- pa as isToday,
2149
- Ea as isValidDate,
2150
- ca as removeDatePrototypes,
2151
- Ta as stringToDate,
2152
- ma as subtractDays,
2153
- ga as subtractHours,
2154
- ya as subtractMinutes,
2155
- da as updateTexts,
2156
- ia as useLocale
2160
+ _a as VueCal,
2161
+ ba as addDatePrototypes,
2162
+ $a as addDays,
2163
+ Ea as addHours,
2164
+ Ca as addMinutes,
2165
+ Wa as countDays,
2166
+ Na as dateToMinutes,
2167
+ Aa as datesInSameTimeStep,
2168
+ Ia as formatDate,
2169
+ Ra as formatDateLite,
2170
+ Ja as formatMinutes,
2171
+ Xa as formatTime,
2172
+ Ga as formatTimeLite,
2173
+ za as getPreviousFirstDayOfWeek,
2174
+ Oa as getWeek,
2175
+ Fa as isInRange,
2176
+ La as isLeapYear,
2177
+ Pa as isSameDate,
2178
+ ja as isToday,
2179
+ Ba as isValidDate,
2180
+ Ta as removeDatePrototypes,
2181
+ Ha as stringToDate,
2182
+ Ya as subtractDays,
2183
+ Sa as subtractHours,
2184
+ Va as subtractMinutes,
2185
+ Ma as updateTexts,
2186
+ ka as useLocale
2157
2187
  };