vue-cal 5.0.1-rc.2 → 5.0.1-rc.20

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