@bagelink/vue 0.0.1216 → 0.0.1220

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 (140) hide show
  1. package/dist/components/Calendar/Index.vue.d.ts +510 -0
  2. package/dist/components/Calendar/Index.vue.d.ts.map +1 -0
  3. package/dist/components/Calendar/components/header/Header.vue.d.ts +117 -0
  4. package/dist/components/Calendar/components/header/Header.vue.d.ts.map +1 -0
  5. package/dist/components/Calendar/components/month/AgendaEventTile.vue.d.ts +37 -0
  6. package/dist/components/Calendar/components/month/AgendaEventTile.vue.d.ts.map +1 -0
  7. package/dist/components/Calendar/components/month/AgendaEvents.vue.d.ts +37 -0
  8. package/dist/components/Calendar/components/month/AgendaEvents.vue.d.ts.map +1 -0
  9. package/dist/components/Calendar/components/month/Day.vue.d.ts +84 -0
  10. package/dist/components/Calendar/components/month/Day.vue.d.ts.map +1 -0
  11. package/dist/components/Calendar/components/month/Event.vue.d.ts +69 -0
  12. package/dist/components/Calendar/components/month/Event.vue.d.ts.map +1 -0
  13. package/dist/components/Calendar/components/month/Month.vue.d.ts +134 -0
  14. package/dist/components/Calendar/components/month/Month.vue.d.ts.map +1 -0
  15. package/dist/components/Calendar/components/month/WeekDay.vue.d.ts +7 -0
  16. package/dist/components/Calendar/components/month/WeekDay.vue.d.ts.map +1 -0
  17. package/dist/components/Calendar/components/partials/EventFlyout.vue.d.ts +122 -0
  18. package/dist/components/Calendar/components/partials/EventFlyout.vue.d.ts.map +1 -0
  19. package/dist/components/Calendar/components/week/Day.vue.d.ts +152 -0
  20. package/dist/components/Calendar/components/week/Day.vue.d.ts.map +1 -0
  21. package/dist/components/Calendar/components/week/DayEvent.vue.d.ts +136 -0
  22. package/dist/components/Calendar/components/week/DayEvent.vue.d.ts.map +1 -0
  23. package/dist/components/Calendar/components/week/DayTimeline.vue.d.ts +23 -0
  24. package/dist/components/Calendar/components/week/DayTimeline.vue.d.ts.map +1 -0
  25. package/dist/components/Calendar/components/week/FullDayEvent.vue.d.ts +42 -0
  26. package/dist/components/Calendar/components/week/FullDayEvent.vue.d.ts.map +1 -0
  27. package/dist/components/Calendar/components/week/Week.vue.d.ts +196 -0
  28. package/dist/components/Calendar/components/week/Week.vue.d.ts.map +1 -0
  29. package/dist/components/Calendar/components/week/WeekTimeline.vue.d.ts +21 -0
  30. package/dist/components/Calendar/components/week/WeekTimeline.vue.d.ts.map +1 -0
  31. package/dist/components/Calendar/constants.d.ts +13 -0
  32. package/dist/components/Calendar/constants.d.ts.map +1 -0
  33. package/dist/components/Calendar/helpers/DayIntervals.d.ts +17 -0
  34. package/dist/components/Calendar/helpers/DayIntervals.d.ts.map +1 -0
  35. package/dist/components/Calendar/helpers/EDate.d.ts +10 -0
  36. package/dist/components/Calendar/helpers/EDate.d.ts.map +1 -0
  37. package/dist/components/Calendar/helpers/Errors.d.ts +18 -0
  38. package/dist/components/Calendar/helpers/Errors.d.ts.map +1 -0
  39. package/dist/components/Calendar/helpers/EventChange.d.ts +19 -0
  40. package/dist/components/Calendar/helpers/EventChange.d.ts.map +1 -0
  41. package/dist/components/Calendar/helpers/EventConcurrency.d.ts +12 -0
  42. package/dist/components/Calendar/helpers/EventConcurrency.d.ts.map +1 -0
  43. package/dist/components/Calendar/helpers/EventFlyoutPosition.d.ts +14 -0
  44. package/dist/components/Calendar/helpers/EventFlyoutPosition.d.ts.map +1 -0
  45. package/dist/components/Calendar/helpers/EventPosition.d.ts +11 -0
  46. package/dist/components/Calendar/helpers/EventPosition.d.ts.map +1 -0
  47. package/dist/components/Calendar/helpers/EventsFilter.d.ts +11 -0
  48. package/dist/components/Calendar/helpers/EventsFilter.d.ts.map +1 -0
  49. package/dist/components/Calendar/helpers/Helpers.d.ts +19 -0
  50. package/dist/components/Calendar/helpers/Helpers.d.ts.map +1 -0
  51. package/dist/components/Calendar/helpers/Time.d.ts +118 -0
  52. package/dist/components/Calendar/helpers/Time.d.ts.map +1 -0
  53. package/dist/components/Calendar/helpers/Week.d.ts +10 -0
  54. package/dist/components/Calendar/helpers/Week.d.ts.map +1 -0
  55. package/dist/components/Calendar/index.d.ts +4 -0
  56. package/dist/components/Calendar/index.d.ts.map +1 -0
  57. package/dist/components/Calendar/language/index.d.ts +6 -0
  58. package/dist/components/Calendar/language/index.d.ts.map +1 -0
  59. package/dist/components/Calendar/language/keys.d.ts +90 -0
  60. package/dist/components/Calendar/language/keys.d.ts.map +1 -0
  61. package/dist/components/Calendar/models/Event.d.ts +50 -0
  62. package/dist/components/Calendar/models/Event.d.ts.map +1 -0
  63. package/dist/components/Calendar/typings/config.interface.d.ts +77 -0
  64. package/dist/components/Calendar/typings/config.interface.d.ts.map +1 -0
  65. package/dist/components/Calendar/typings/interfaces/day.interface.d.ts +10 -0
  66. package/dist/components/Calendar/typings/interfaces/day.interface.d.ts.map +1 -0
  67. package/dist/components/Calendar/typings/interfaces/event.interface.d.ts +32 -0
  68. package/dist/components/Calendar/typings/interfaces/event.interface.d.ts.map +1 -0
  69. package/dist/components/Calendar/typings/interfaces/full-day-events-week.type.d.ts +7 -0
  70. package/dist/components/Calendar/typings/interfaces/full-day-events-week.type.d.ts.map +1 -0
  71. package/dist/components/Calendar/typings/interfaces/period.interface.d.ts +6 -0
  72. package/dist/components/Calendar/typings/interfaces/period.interface.d.ts.map +1 -0
  73. package/dist/components/Calendar/typings/interfaces/time-modes.d.ts +6 -0
  74. package/dist/components/Calendar/typings/interfaces/time-modes.d.ts.map +1 -0
  75. package/dist/components/Calendar/typings/types.d.ts +21 -0
  76. package/dist/components/Calendar/typings/types.d.ts.map +1 -0
  77. package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
  78. package/dist/components/Draggable/useDraggable.d.ts.map +1 -1
  79. package/dist/components/form/inputs/DatePick.vue.d.ts +8 -0
  80. package/dist/components/form/inputs/DatePick.vue.d.ts.map +1 -1
  81. package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
  82. package/dist/components/index.d.ts +2 -1
  83. package/dist/components/index.d.ts.map +1 -1
  84. package/dist/directives/index.d.ts +2 -0
  85. package/dist/directives/index.d.ts.map +1 -1
  86. package/dist/directives/vResize.d.ts +18 -0
  87. package/dist/directives/vResize.d.ts.map +1 -0
  88. package/dist/index.cjs +3657 -169
  89. package/dist/index.mjs +3658 -170
  90. package/dist/style.css +843 -77
  91. package/package.json +2 -1
  92. package/src/components/Calendar/Index.vue +420 -0
  93. package/src/components/Calendar/assets/base.css +60 -0
  94. package/src/components/Calendar/components/header/Header.vue +274 -0
  95. package/src/components/Calendar/components/month/AgendaEventTile.vue +137 -0
  96. package/src/components/Calendar/components/month/AgendaEvents.vue +107 -0
  97. package/src/components/Calendar/components/month/Day.vue +271 -0
  98. package/src/components/Calendar/components/month/Event.vue +221 -0
  99. package/src/components/Calendar/components/month/Month.vue +278 -0
  100. package/src/components/Calendar/components/month/WeekDay.vue +25 -0
  101. package/src/components/Calendar/components/partials/EventFlyout.vue +429 -0
  102. package/src/components/Calendar/components/week/Day.vue +212 -0
  103. package/src/components/Calendar/components/week/DayEvent.vue +585 -0
  104. package/src/components/Calendar/components/week/DayTimeline.vue +86 -0
  105. package/src/components/Calendar/components/week/FullDayEvent.vue +121 -0
  106. package/src/components/Calendar/components/week/Week.vue +414 -0
  107. package/src/components/Calendar/components/week/WeekTimeline.vue +126 -0
  108. package/src/components/Calendar/constants.ts +13 -0
  109. package/src/components/Calendar/env.d.ts +8 -0
  110. package/src/components/Calendar/helpers/DayIntervals.ts +48 -0
  111. package/src/components/Calendar/helpers/EDate.ts +18 -0
  112. package/src/components/Calendar/helpers/Errors.ts +69 -0
  113. package/src/components/Calendar/helpers/EventChange.ts +88 -0
  114. package/src/components/Calendar/helpers/EventConcurrency.ts +69 -0
  115. package/src/components/Calendar/helpers/EventFlyoutPosition.ts +96 -0
  116. package/src/components/Calendar/helpers/EventPosition.ts +154 -0
  117. package/src/components/Calendar/helpers/EventsFilter.ts +50 -0
  118. package/src/components/Calendar/helpers/Helpers.ts +86 -0
  119. package/src/components/Calendar/helpers/Time.ts +588 -0
  120. package/src/components/Calendar/helpers/Week.ts +37 -0
  121. package/src/components/Calendar/index.ts +4 -0
  122. package/src/components/Calendar/language/index.ts +37 -0
  123. package/src/components/Calendar/language/keys.ts +90 -0
  124. package/src/components/Calendar/models/Event.ts +112 -0
  125. package/src/components/Calendar/styles/_mixins.css +21 -0
  126. package/src/components/Calendar/styles/_variables.css +51 -0
  127. package/src/components/Calendar/typings/config.interface.ts +87 -0
  128. package/src/components/Calendar/typings/interfaces/day.interface.ts +10 -0
  129. package/src/components/Calendar/typings/interfaces/event.interface.ts +32 -0
  130. package/src/components/Calendar/typings/interfaces/full-day-events-week.type.ts +8 -0
  131. package/src/components/Calendar/typings/interfaces/period.interface.ts +5 -0
  132. package/src/components/Calendar/typings/interfaces/time-modes.ts +9 -0
  133. package/src/components/Calendar/typings/types.ts +23 -0
  134. package/src/components/DataTable/DataTable.vue +4 -0
  135. package/src/components/Draggable/useDraggable.ts +53 -37
  136. package/src/components/form/inputs/DatePick.vue +189 -152
  137. package/src/components/form/inputs/NumberInput.vue +1 -3
  138. package/src/components/index.ts +3 -6
  139. package/src/directives/index.ts +2 -0
  140. package/src/directives/vResize.ts +205 -0
package/dist/index.cjs CHANGED
@@ -47,7 +47,7 @@ const bagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
47
47
  return uploadField;
48
48
  }
49
49
  }, Symbol.toStringTag, { value: "Module" }));
50
- const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
50
+ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
51
51
  __name: "Accordion",
52
52
  setup(__props) {
53
53
  const state2 = vue.reactive({
@@ -61,10 +61,10 @@ const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
61
61
  };
62
62
  }
63
63
  });
64
- const _hoisted_1$W = ["aria-expanded", "aria-controls"];
65
- const _hoisted_2$D = { class: "accordion-label" };
66
- const _hoisted_3$u = ["id", "aria-hidden"];
67
- const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
64
+ const _hoisted_1$19 = ["aria-expanded", "aria-controls"];
65
+ const _hoisted_2$Q = { class: "accordion-label" };
66
+ const _hoisted_3$F = ["id", "aria-hidden"];
67
+ const _sfc_main$1l = /* @__PURE__ */ vue.defineComponent({
68
68
  __name: "AccordionItem",
69
69
  props: {
70
70
  label: {},
@@ -130,7 +130,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
130
130
  vue.createVNode(vue.unref(_sfc_main$q), { icon: computedIcon.value }, null, 8, ["icon"])
131
131
  ], 2)) : vue.createCommentVNode("", true),
132
132
  vue.renderSlot(_ctx.$slots, "head", {}, () => [
133
- vue.createElementVNode("span", _hoisted_2$D, vue.toDisplayString(_ctx.label), 1)
133
+ vue.createElementVNode("span", _hoisted_2$Q, vue.toDisplayString(_ctx.label), 1)
134
134
  ], true),
135
135
  iconPosition.value === "end" ? (vue.openBlock(), vue.createElementBlock("span", {
136
136
  key: 1,
@@ -138,7 +138,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
138
138
  }, [
139
139
  vue.createVNode(vue.unref(_sfc_main$q), { icon: computedIcon.value }, null, 8, ["icon"])
140
140
  ], 2)) : vue.createCommentVNode("", true)
141
- ], 8, _hoisted_1$W),
141
+ ], 8, _hoisted_1$19),
142
142
  vue.createVNode(vue.Transition, { name: "expand" }, {
143
143
  default: vue.withCtx(() => [
144
144
  vue.unref(isOpen) ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -148,7 +148,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
148
148
  "aria-hidden": vue.unref(isOpen) ? "false" : "true"
149
149
  }, [
150
150
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
151
- ], 8, _hoisted_3$u)) : vue.createCommentVNode("", true)
151
+ ], 8, _hoisted_3$F)) : vue.createCommentVNode("", true)
152
152
  ]),
153
153
  _: 3
154
154
  })
@@ -163,9 +163,9 @@ const _export_sfc = (sfc, props2) => {
163
163
  }
164
164
  return target;
165
165
  };
166
- const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-3334f637"]]);
167
- const _hoisted_1$V = { class: "relative" };
168
- const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
166
+ const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-3334f637"]]);
167
+ const _hoisted_1$18 = { class: "relative" };
168
+ const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
169
169
  __name: "AddressSearch",
170
170
  emits: ["addressSelected"],
171
171
  setup(__props, { emit: __emit }) {
@@ -187,7 +187,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
187
187
  (_a2 = suggestion.value) == null ? void 0 : _a2.show();
188
188
  }
189
189
  return (_ctx, _cache) => {
190
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$V, [
190
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$18, [
191
191
  vue.createVNode(vue.unref(_sfc_main$U), {
192
192
  ref_key: "suggestion",
193
193
  ref: suggestion,
@@ -223,11 +223,11 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
223
223
  };
224
224
  }
225
225
  });
226
- const _hoisted_1$U = {
226
+ const _hoisted_1$17 = {
227
227
  key: 1,
228
228
  class: "bgl_btn-flex"
229
229
  };
230
- const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
230
+ const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
231
231
  __name: "Btn",
232
232
  props: {
233
233
  disabled: { type: Boolean, default: false },
@@ -293,7 +293,7 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
293
293
  key: 0,
294
294
  class: "h-100p",
295
295
  size: "15"
296
- })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$U, [
296
+ })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$17, [
297
297
  _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$q), {
298
298
  key: 0,
299
299
  icon: _ctx.icon,
@@ -317,10 +317,10 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
317
317
  };
318
318
  }
319
319
  });
320
- const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-7b18a02c"]]);
321
- const _hoisted_1$T = ["dismissable"];
322
- const _hoisted_2$C = { class: "m-0" };
323
- const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
320
+ const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__scopeId", "data-v-7b18a02c"]]);
321
+ const _hoisted_1$16 = ["dismissable"];
322
+ const _hoisted_2$P = { class: "m-0" };
323
+ const _sfc_main$1i = /* @__PURE__ */ vue.defineComponent({
324
324
  __name: "Alert",
325
325
  props: {
326
326
  message: {},
@@ -348,7 +348,7 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
348
348
  size: 2,
349
349
  color: color2[_ctx.type]
350
350
  }, null, 8, ["icon", "color"])) : vue.createCommentVNode("", true),
351
- vue.createElementVNode("p", _hoisted_2$C, vue.toDisplayString(_ctx.message), 1),
351
+ vue.createElementVNode("p", _hoisted_2$P, vue.toDisplayString(_ctx.message), 1),
352
352
  vue.createVNode(Btn, {
353
353
  flat: "",
354
354
  thin: "",
@@ -356,13 +356,13 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
356
356
  icon: "close",
357
357
  onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true)
358
358
  })
359
- ], 10, _hoisted_1$T)) : vue.createCommentVNode("", true);
359
+ ], 10, _hoisted_1$16)) : vue.createCommentVNode("", true);
360
360
  };
361
361
  }
362
362
  });
363
- const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-064bdd20"]]);
364
- const _hoisted_1$S = ["src", "alt"];
365
- const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
363
+ const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__scopeId", "data-v-064bdd20"]]);
364
+ const _hoisted_1$15 = ["src", "alt"];
365
+ const _sfc_main$1h = /* @__PURE__ */ vue.defineComponent({
366
366
  __name: "Avatar",
367
367
  props: {
368
368
  fallback: {},
@@ -380,7 +380,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
380
380
  key: 0,
381
381
  src: _ctx.src,
382
382
  alt: _ctx.name
383
- }, null, 8, _hoisted_1$S)) : (vue.openBlock(), vue.createElementBlock("p", {
383
+ }, null, 8, _hoisted_1$15)) : (vue.openBlock(), vue.createElementBlock("p", {
384
384
  key: 1,
385
385
  style: vue.normalizeStyle({ "line-height": `${_ctx.size}px`, "font-size": `calc(1.5rem * ${_ctx.size} / 50)` })
386
386
  }, vue.toDisplayString((_ctx.fallback || vue.unref(initials)(_ctx.name || "")).toUpperCase()), 5))
@@ -388,8 +388,8 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
388
388
  };
389
389
  }
390
390
  });
391
- const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-46ad8c25"]]);
392
- const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
391
+ const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-46ad8c25"]]);
392
+ const _sfc_main$1g = /* @__PURE__ */ vue.defineComponent({
393
393
  __name: "Badge",
394
394
  props: {
395
395
  color: {},
@@ -418,9 +418,9 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
418
418
  };
419
419
  }
420
420
  });
421
- const Badge = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-689f051f"]]);
422
- const _hoisted_1$R = { key: 1 };
423
- const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
421
+ const Badge = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__scopeId", "data-v-689f051f"]]);
422
+ const _hoisted_1$14 = { key: 1 };
423
+ const _sfc_main$1f = /* @__PURE__ */ vue.defineComponent({
424
424
  __name: "BglComponent",
425
425
  props: {
426
426
  field: {},
@@ -566,7 +566,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
566
566
  id: [props2.id, child.id].filter(Boolean).join("."),
567
567
  field: child,
568
568
  "parent-path": props2.id
569
- }, null, 8, ["id", "field", "parent-path"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$R, vue.toDisplayString(child), 1))
569
+ }, null, 8, ["id", "field", "parent-path"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$14, vue.toDisplayString(child), 1))
570
570
  ], 64);
571
571
  }), 128))
572
572
  ], 64))
@@ -576,10 +576,10 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
576
576
  };
577
577
  }
578
578
  });
579
- const _hoisted_1$Q = ["src"];
580
- const _hoisted_2$B = ["autoplay", "muted", "loop", "controls", "playsinline"];
581
- const _hoisted_3$t = ["src", "type"];
582
- const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
579
+ const _hoisted_1$13 = ["src"];
580
+ const _hoisted_2$O = ["autoplay", "muted", "loop", "controls", "playsinline"];
581
+ const _hoisted_3$E = ["src", "type"];
582
+ const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
583
583
  __name: "BglVideo",
584
584
  props: {
585
585
  src: {},
@@ -656,7 +656,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
656
656
  allowfullscreen: "",
657
657
  title: "Video",
658
658
  allow: "autoplay"
659
- }, null, 12, _hoisted_1$Q)) : _ctx.src ? (vue.openBlock(), vue.createElementBlock("video", {
659
+ }, null, 12, _hoisted_1$13)) : _ctx.src ? (vue.openBlock(), vue.createElementBlock("video", {
660
660
  key: 1,
661
661
  ref_key: "video",
662
662
  ref: video,
@@ -670,13 +670,3467 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
670
670
  vue.createElementVNode("source", {
671
671
  src: _ctx.src,
672
672
  type: `video/${videoFormat.value}`
673
- }, null, 8, _hoisted_3$t)
674
- ], 12, _hoisted_2$B)) : vue.createCommentVNode("", true)
673
+ }, null, 8, _hoisted_3$E)
674
+ ], 12, _hoisted_2$O)) : vue.createCommentVNode("", true)
675
675
  ], 2);
676
676
  };
677
677
  }
678
678
  });
679
- const BglVideo = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-006552f6"]]);
679
+ const BglVideo = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["__scopeId", "data-v-006552f6"]]);
680
+ const _hoisted_1$12 = { class: "calendar-header" };
681
+ const _hoisted_2$N = {
682
+ key: 0,
683
+ class: "calendar-header__period-name"
684
+ };
685
+ const _hoisted_3$D = { class: "flex gap-05" };
686
+ const _hoisted_4$q = { class: "calendar-header__chevron-arrows" };
687
+ const _hoisted_5$o = {
688
+ key: 0,
689
+ class: "calendar-header__mode-picker"
690
+ };
691
+ const _sfc_main$1d = /* @__PURE__ */ vue.defineComponent({
692
+ __name: "Header",
693
+ props: {
694
+ config: {
695
+ type: Object,
696
+ default: () => ({})
697
+ },
698
+ mode: {
699
+ type: String,
700
+ default: "week"
701
+ },
702
+ time: {
703
+ type: Object,
704
+ default: () => ({})
705
+ },
706
+ period: {
707
+ type: Object,
708
+ required: true
709
+ },
710
+ isSmall: {
711
+ type: Boolean,
712
+ required: true
713
+ }
714
+ },
715
+ emits: ["changeMode", "updatedPeriod"],
716
+ setup(__props, { emit: __emit }) {
717
+ const props2 = __props;
718
+ const emit2 = __emit;
719
+ const periodSelect = vue.ref();
720
+ const currentPeriod = vue.ref(props2.period);
721
+ const modeOptions = vue.ref(["month", "week", "day", "agenda"]);
722
+ const icons = {
723
+ chevronLeft: "chevron_left",
724
+ chevronRight: "chevron_right"
725
+ };
726
+ const periodName = vue.computed(() => {
727
+ if (props2.mode === "week") {
728
+ const startMonth = props2.time.getLocalizedNameOfMonth(
729
+ currentPeriod.value.start,
730
+ "short"
731
+ );
732
+ const endMonth = props2.time.getLocalizedNameOfMonth(
733
+ currentPeriod.value.end,
734
+ "short"
735
+ );
736
+ return startMonth === endMonth ? startMonth : `${startMonth} - ${endMonth}`;
737
+ }
738
+ return `${props2.time.getLocalizedNameOfMonth(
739
+ currentPeriod.value.selectedDate,
740
+ "short"
741
+ )} ${currentPeriod.value.selectedDate.getFullYear()}`;
742
+ });
743
+ const modeLocal = vue.ref(props2.mode);
744
+ const onlyDayModeIsEnabled = vue.computed(() => {
745
+ var _a2, _b;
746
+ const weekIsDisabled = (_a2 = props2.config.disableModes) == null ? void 0 : _a2.includes("week");
747
+ const monthIsDisabled = (_b = props2.config.disableModes) == null ? void 0 : _b.includes("month");
748
+ return props2.config.disableModes && weekIsDisabled && monthIsDisabled;
749
+ });
750
+ vue.watch(() => props2.isSmall, (value) => {
751
+ if (value) modeOptions.value = ["month", "day"];
752
+ else modeOptions.value = ["month", "week", "day", "agenda"];
753
+ }, { immediate: true });
754
+ function dateToPeriod(selectedDate) {
755
+ const period = {
756
+ start: /* @__PURE__ */ new Date(),
757
+ end: /* @__PURE__ */ new Date(),
758
+ selectedDate
759
+ };
760
+ if (props2.mode === "week") {
761
+ period.start = props2.time.getCalendarWeekDateObjects(selectedDate)[0];
762
+ period.end = props2.time.getCalendarWeekDateObjects(selectedDate)[6];
763
+ } else if (props2.mode === "month") {
764
+ period.start = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1);
765
+ period.end = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + 1, 0);
766
+ } else {
767
+ period.start = selectedDate;
768
+ period.end = selectedDate;
769
+ }
770
+ return period;
771
+ }
772
+ function handlePeriodChange() {
773
+ if (!currentPeriod.value) return;
774
+ currentPeriod.value = dateToPeriod(currentPeriod.value.selectedDate);
775
+ emit2("updatedPeriod", currentPeriod.value);
776
+ }
777
+ function goToPeriod(direction) {
778
+ const date2 = currentPeriod.value.selectedDate;
779
+ if (props2.mode === "month") {
780
+ date2.setMonth(direction === "previous" ? date2.getMonth() - 1 : date2.getMonth() + 1);
781
+ } else if (props2.mode === "week") {
782
+ date2.setDate(direction === "previous" ? date2.getDate() - 7 : date2.getDate() + 7);
783
+ } else {
784
+ date2.setDate(direction === "previous" ? date2.getDate() - 1 : date2.getDate() + 1);
785
+ }
786
+ currentPeriod.value = dateToPeriod(date2);
787
+ emit2("updatedPeriod", currentPeriod.value);
788
+ }
789
+ return (_ctx, _cache) => {
790
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$12, [
791
+ periodName.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$N, vue.toDisplayString(periodName.value), 1)) : vue.createCommentVNode("", true),
792
+ vue.createElementVNode("div", _hoisted_3$D, [
793
+ vue.createElementVNode("div", _hoisted_4$q, [
794
+ vue.createVNode(vue.unref(_sfc_main$q), {
795
+ class: "calendar-header__chevron-arrow calendar-header__chevron-arrow-left",
796
+ icon: icons.chevronLeft,
797
+ onClick: _cache[0] || (_cache[0] = ($event) => goToPeriod("previous"))
798
+ }, null, 8, ["icon"]),
799
+ vue.createVNode(vue.unref(_sfc_main$q), {
800
+ class: "calendar-header__chevron-arrow calendar-header__chevron-arrow-right",
801
+ icon: icons.chevronRight,
802
+ onClick: _cache[1] || (_cache[1] = ($event) => goToPeriod("next"))
803
+ }, null, 8, ["icon"])
804
+ ]),
805
+ vue.createVNode(vue.unref(DatePick), {
806
+ ref_key: "periodSelect",
807
+ ref: periodSelect,
808
+ modelValue: currentPeriod.value.selectedDate,
809
+ "onUpdate:modelValue": [
810
+ _cache[2] || (_cache[2] = ($event) => currentPeriod.value.selectedDate = $event),
811
+ handlePeriodChange
812
+ ],
813
+ mode: __props.mode
814
+ }, null, 8, ["modelValue", "mode"]),
815
+ !onlyDayModeIsEnabled.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$o, [
816
+ vue.createVNode(vue.unref(TabsNav), {
817
+ modelValue: modeLocal.value,
818
+ "onUpdate:modelValue": [
819
+ _cache[3] || (_cache[3] = ($event) => modeLocal.value = $event),
820
+ _cache[4] || (_cache[4] = ($event) => emit2("changeMode", $event))
821
+ ],
822
+ tabs: modeOptions.value,
823
+ group: "mode"
824
+ }, null, 8, ["modelValue", "tabs"])
825
+ ])) : vue.createCommentVNode("", true)
826
+ ])
827
+ ]);
828
+ };
829
+ }
830
+ });
831
+ const AppHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__scopeId", "data-v-34cb97da"]]);
832
+ class EDate extends Date {
833
+ get fullYear() {
834
+ return this.getFullYear();
835
+ }
836
+ get month() {
837
+ return this.getMonth();
838
+ }
839
+ get date() {
840
+ return this.getDate();
841
+ }
842
+ }
843
+ var DAY_TIME_POINT = /* @__PURE__ */ ((DAY_TIME_POINT2) => {
844
+ DAY_TIME_POINT2[DAY_TIME_POINT2["MIDNIGHT"] = 0] = "MIDNIGHT";
845
+ DAY_TIME_POINT2[DAY_TIME_POINT2["ONE_AM"] = 100] = "ONE_AM";
846
+ DAY_TIME_POINT2[DAY_TIME_POINT2["TWO_AM"] = 200] = "TWO_AM";
847
+ DAY_TIME_POINT2[DAY_TIME_POINT2["THREE_AM"] = 300] = "THREE_AM";
848
+ DAY_TIME_POINT2[DAY_TIME_POINT2["FOUR_AM"] = 400] = "FOUR_AM";
849
+ DAY_TIME_POINT2[DAY_TIME_POINT2["FIVE_AM"] = 500] = "FIVE_AM";
850
+ DAY_TIME_POINT2[DAY_TIME_POINT2["SIX_AM"] = 600] = "SIX_AM";
851
+ DAY_TIME_POINT2[DAY_TIME_POINT2["SEVEN_AM"] = 700] = "SEVEN_AM";
852
+ DAY_TIME_POINT2[DAY_TIME_POINT2["EIGHT_AM"] = 800] = "EIGHT_AM";
853
+ DAY_TIME_POINT2[DAY_TIME_POINT2["NINE_AM"] = 900] = "NINE_AM";
854
+ DAY_TIME_POINT2[DAY_TIME_POINT2["TEN_AM"] = 1e3] = "TEN_AM";
855
+ DAY_TIME_POINT2[DAY_TIME_POINT2["ELEVEN_AM"] = 1100] = "ELEVEN_AM";
856
+ DAY_TIME_POINT2[DAY_TIME_POINT2["TWELVE_PM"] = 1200] = "TWELVE_PM";
857
+ DAY_TIME_POINT2[DAY_TIME_POINT2["ONE_PM"] = 1300] = "ONE_PM";
858
+ DAY_TIME_POINT2[DAY_TIME_POINT2["TWO_PM"] = 1400] = "TWO_PM";
859
+ DAY_TIME_POINT2[DAY_TIME_POINT2["THREE_PM"] = 1500] = "THREE_PM";
860
+ DAY_TIME_POINT2[DAY_TIME_POINT2["FOUR_PM"] = 1600] = "FOUR_PM";
861
+ DAY_TIME_POINT2[DAY_TIME_POINT2["FIVE_PM"] = 1700] = "FIVE_PM";
862
+ DAY_TIME_POINT2[DAY_TIME_POINT2["SIX_PM"] = 1800] = "SIX_PM";
863
+ DAY_TIME_POINT2[DAY_TIME_POINT2["SEVEN_PM"] = 1900] = "SEVEN_PM";
864
+ DAY_TIME_POINT2[DAY_TIME_POINT2["EIGHT_PM"] = 2e3] = "EIGHT_PM";
865
+ DAY_TIME_POINT2[DAY_TIME_POINT2["NINE_PM"] = 2100] = "NINE_PM";
866
+ DAY_TIME_POINT2[DAY_TIME_POINT2["TEN_PM"] = 2200] = "TEN_PM";
867
+ DAY_TIME_POINT2[DAY_TIME_POINT2["ELEVEN_PM"] = 2300] = "ELEVEN_PM";
868
+ DAY_TIME_POINT2[DAY_TIME_POINT2["TWELVE_AM"] = 2400] = "TWELVE_AM";
869
+ return DAY_TIME_POINT2;
870
+ })(DAY_TIME_POINT || {});
871
+ var DAY_MODE = /* @__PURE__ */ ((DAY_MODE2) => {
872
+ DAY_MODE2["REGULAR"] = "regular";
873
+ DAY_MODE2["SHORTENED"] = "shortened";
874
+ DAY_MODE2["FLEXIBLE"] = "flexible";
875
+ return DAY_MODE2;
876
+ })(DAY_MODE || {});
877
+ const EVENT_COLORS = {
878
+ yellow: "rgb(244, 180, 0)",
879
+ blue: "rgb(38, 132, 255)",
880
+ green: "rgb(51, 182, 121)",
881
+ red: "rgb(255, 84, 86)",
882
+ pink: "rgb(239, 139, 239)",
883
+ purple: "rgb(157, 114, 245)",
884
+ turquoise: "rgb(64, 190, 190)",
885
+ brown: "rgb(169, 99, 30)"
886
+ };
887
+ const DATE_TIME_STRING_PATTERN = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/;
888
+ const DATE_TIME_STRING_FULL_DAY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
889
+ class Helpers {
890
+ /**
891
+ * If navigator.languages is present (correlating to the browser's Accept-Language header), then use it
892
+ * otherwise just use navigator.language
893
+ */
894
+ static getBrowserNavigatorLocale() {
895
+ if (typeof navigator !== "object") return "en-US";
896
+ return navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language;
897
+ }
898
+ /**
899
+ * Solution from https://github.com/vuejs/core/issues/4733#issuecomment-1024816095
900
+ */
901
+ static hasSlotContent(slot) {
902
+ if (!slot) return false;
903
+ return slot().some((vnode) => {
904
+ if (vnode.type === vue.Comment) return false;
905
+ if (Array.isArray(vnode.children) && !vnode.children.length) return false;
906
+ return vnode.type !== vue.Text || typeof vnode.children === "string" && vnode.children.trim() !== "";
907
+ });
908
+ }
909
+ static getEventType(event, time) {
910
+ const isTimedEvent = DATE_TIME_STRING_PATTERN.test(event.time.start) && DATE_TIME_STRING_PATTERN.test(event.time.end);
911
+ const isFullDayEvent = DATE_TIME_STRING_FULL_DAY_PATTERN.test(event.time.start) && DATE_TIME_STRING_FULL_DAY_PATTERN.test(event.time.end);
912
+ if (isTimedEvent) return this.getTimedEventType(event, time);
913
+ if (isFullDayEvent) return this.getFullDayEventType(event, time);
914
+ throw new Error("Event has invalid type");
915
+ }
916
+ static getTimedEventType(event, time) {
917
+ if (time.dateStringsHaveEqualDates(event.time.start, event.time.end)) {
918
+ return "SINGLE_DAY_TIMED";
919
+ }
920
+ if (time.dayMode === DAY_MODE.FLEXIBLE) {
921
+ const endBoundaryForSingleHybridDay = time.setHourInDateTimeString(
922
+ time.addDaysToDateTimeString(
923
+ 1,
924
+ time.dateStringFrom(event.time.start)
925
+ ),
926
+ Time.getHourFromTimePoints(time.DAY_END)
927
+ );
928
+ if (event.time.end < endBoundaryForSingleHybridDay) {
929
+ return "SINGLE_HYBRID_DAY_TIMED";
930
+ }
931
+ }
932
+ return "MULTI_DAY_TIMED";
933
+ }
934
+ static getFullDayEventType(event, time) {
935
+ if (time.dateStringsHaveEqualDates(event.time.start, event.time.end)) {
936
+ return "SINGLE_DAY_FULL_DAY";
937
+ }
938
+ return "MULTI_DAY_FULL_DAY";
939
+ }
940
+ static isUIEventTouchEvent(event) {
941
+ return "touches" in event && typeof event.touches === "object";
942
+ }
943
+ }
944
+ var WEEK_START_DAY = /* @__PURE__ */ ((WEEK_START_DAY2) => {
945
+ WEEK_START_DAY2["SUNDAY"] = "sunday";
946
+ WEEK_START_DAY2["MONDAY"] = "monday";
947
+ return WEEK_START_DAY2;
948
+ })(WEEK_START_DAY || {});
949
+ class Time {
950
+ constructor(firstDayOfWeek = "monday", locale2 = null, dayBoundaries = { start: 0, end: 2400 }) {
951
+ __publicField(this, "FIRST_DAY_OF_WEEK");
952
+ __publicField(this, "CALENDAR_LOCALE");
953
+ __publicField(this, "ALL_HOURS", [
954
+ 0,
955
+ 100,
956
+ 200,
957
+ 300,
958
+ 400,
959
+ 500,
960
+ 600,
961
+ 700,
962
+ 800,
963
+ 900,
964
+ 1e3,
965
+ 1100,
966
+ 1200,
967
+ 1300,
968
+ 1400,
969
+ 1500,
970
+ 1600,
971
+ 1700,
972
+ 1800,
973
+ 1900,
974
+ 2e3,
975
+ 2100,
976
+ 2200,
977
+ 2300
978
+ ]);
979
+ __publicField(this, "DAY_START");
980
+ __publicField(this, "DAY_END");
981
+ __publicField(this, "HOURS_PER_DAY", 24);
982
+ __publicField(this, "MS_PER_DAY");
983
+ this.FIRST_DAY_OF_WEEK = firstDayOfWeek;
984
+ this.CALENDAR_LOCALE = locale2 || Helpers.getBrowserNavigatorLocale();
985
+ this.DAY_START = dayBoundaries.start;
986
+ this.DAY_END = dayBoundaries.end;
987
+ this.HOURS_PER_DAY = (() => {
988
+ const dayEnd = Time.getHourFromTimePoints(this.DAY_END);
989
+ const dayStart = Time.getHourFromTimePoints(this.DAY_START);
990
+ if (dayEnd > dayStart) return dayEnd - dayStart;
991
+ return this.HOURS_PER_DAY - dayStart + dayEnd;
992
+ })();
993
+ this.MS_PER_DAY = 864e5;
994
+ }
995
+ get dayMode() {
996
+ if (this.DAY_START === 0 && this.DAY_END === 2400) return DAY_MODE.REGULAR;
997
+ if (this.DAY_START >= this.DAY_END) return DAY_MODE.FLEXIBLE;
998
+ return DAY_MODE.SHORTENED;
999
+ }
1000
+ getDatesBetweenTwoDates(start, end) {
1001
+ let arr = [];
1002
+ let dt2 = new Date(start);
1003
+ while (dt2 <= end) {
1004
+ arr.push(new Date(dt2.getFullYear(), dt2.getMonth(), dt2.getDate()));
1005
+ dt2.setDate(dt2.getDate() + 1);
1006
+ }
1007
+ return arr;
1008
+ }
1009
+ getCalendarWeekDateObjects(date2) {
1010
+ let subtractedDaysToGetFirstDate;
1011
+ if (this.FIRST_DAY_OF_WEEK === "sunday") {
1012
+ subtractedDaysToGetFirstDate = date2.getDay();
1013
+ } else {
1014
+ subtractedDaysToGetFirstDate = date2.getDay() === 0 ? 6 : date2.getDay() - 1;
1015
+ }
1016
+ const dateOfFirstDayOfWeek = date2.getDate() - subtractedDaysToGetFirstDate;
1017
+ const firstDay = new Date(
1018
+ date2.getFullYear(),
1019
+ date2.getMonth(),
1020
+ dateOfFirstDayOfWeek
1021
+ );
1022
+ return this.getDatesBetweenTwoDates(
1023
+ firstDay,
1024
+ new Date(
1025
+ firstDay.getFullYear(),
1026
+ firstDay.getMonth(),
1027
+ firstDay.getDate() + 6
1028
+ )
1029
+ );
1030
+ }
1031
+ /**
1032
+ * Returns an array of the weeks that comprise a month
1033
+ *
1034
+ * @param {number} yyyy
1035
+ * @param {number} mm - zero indexed (January === 0)
1036
+ */
1037
+ getCalendarMonthSplitInWeeks(yyyy, mm) {
1038
+ const month = [];
1039
+ const selectedDate = new Date(yyyy, mm, 1);
1040
+ const firstDateOfMonth = new Date(
1041
+ selectedDate.getFullYear(),
1042
+ selectedDate.getMonth(),
1043
+ 1
1044
+ );
1045
+ const firstWeekOfMonth = this.getCalendarWeekDateObjects(firstDateOfMonth);
1046
+ month.push(firstWeekOfMonth);
1047
+ let isInMonth = true;
1048
+ let mondayOfWeekToPush = firstWeekOfMonth[0];
1049
+ const specifiedMonth = selectedDate.getMonth();
1050
+ while (isInMonth) {
1051
+ const newMonday = new Date(
1052
+ mondayOfWeekToPush.getFullYear(),
1053
+ mondayOfWeekToPush.getMonth(),
1054
+ mondayOfWeekToPush.getDate() + 7
1055
+ );
1056
+ if (newMonday.getMonth() === specifiedMonth) {
1057
+ month.push(this.getCalendarWeekDateObjects(newMonday));
1058
+ mondayOfWeekToPush = newMonday;
1059
+ } else {
1060
+ isInMonth = false;
1061
+ }
1062
+ }
1063
+ return month;
1064
+ }
1065
+ /**
1066
+ * Returns an array with the length of 12 dates,
1067
+ * one date for the first day of each month of the year
1068
+ */
1069
+ getCalendarYearMonths(year) {
1070
+ const yearList = [];
1071
+ let month = 0;
1072
+ while (month <= 11) {
1073
+ yearList.push(new Date(year, month, 1));
1074
+ month++;
1075
+ }
1076
+ return yearList;
1077
+ }
1078
+ getHourAndMinutesFromTimePoints(timePoints) {
1079
+ const time = timePoints.toString();
1080
+ let hour = "0";
1081
+ let minutes = "0";
1082
+ if (time.length === 4) {
1083
+ hour = time[0] + time[1];
1084
+ minutes = time[2] + time[3];
1085
+ } else if (time.length === 3) {
1086
+ hour = time[0];
1087
+ minutes = time[1] + time[2];
1088
+ }
1089
+ return {
1090
+ hour: +hour,
1091
+ minutes: +minutes
1092
+ };
1093
+ }
1094
+ /**
1095
+ * Given timePoints (0, 100, 200 etc.), this function returns
1096
+ * a localized string with the respective hour
1097
+ * (in en-US for example: 0 => 12 AM, 1600 => 4 PM )
1098
+ */
1099
+ getHourLocaleStringFromHourDigits(timePoints) {
1100
+ const { hour, minutes } = this.getHourAndMinutesFromTimePoints(timePoints);
1101
+ const hourLocaleString = new Date(
1102
+ 2100,
1103
+ 0,
1104
+ 1,
1105
+ +hour,
1106
+ +minutes,
1107
+ 0
1108
+ ).toLocaleTimeString(this.CALENDAR_LOCALE, {
1109
+ hour: "2-digit"
1110
+ });
1111
+ if (hourLocaleString[0] === "0") return hourLocaleString.substring(1);
1112
+ return hourLocaleString;
1113
+ }
1114
+ getLocalizedNameOfWeekday(date2, weekdayNameLength = "short") {
1115
+ return date2.toLocaleDateString(this.CALENDAR_LOCALE, {
1116
+ weekday: weekdayNameLength
1117
+ });
1118
+ }
1119
+ getLocalizedNameOfMonth(date2, monthNameLength = "short") {
1120
+ return date2.toLocaleDateString(this.CALENDAR_LOCALE, {
1121
+ month: monthNameLength
1122
+ });
1123
+ }
1124
+ getLocalizedDateString(date2) {
1125
+ return date2.toLocaleDateString(this.CALENDAR_LOCALE);
1126
+ }
1127
+ /**
1128
+ * Takes a date object, and creates a time string from it, in the format of
1129
+ * YYYY-MM-DD hh:mm
1130
+ */
1131
+ getDateTimeStringFromDate(date2, timeIsStartOrEndOfDay) {
1132
+ const y2 = date2.getFullYear();
1133
+ const m2 = date2.getMonth() + 1;
1134
+ const d2 = date2.getDate();
1135
+ const fullDate = `${y2}-${m2 >= 10 ? m2 : `0${m2}`}-${d2 >= 10 ? d2 : `0${d2}`}`;
1136
+ if (!timeIsStartOrEndOfDay) {
1137
+ const hour = date2.getHours();
1138
+ const minutes = date2.getMinutes();
1139
+ return `${fullDate} ${hour >= 10 ? hour : `0${hour}`}:${minutes >= 10 ? minutes : `0${minutes}`}`;
1140
+ }
1141
+ const fullTime = timeIsStartOrEndOfDay === "start" ? "00:00" : "23:59";
1142
+ return `${fullDate} ${fullTime}`;
1143
+ }
1144
+ getLocalizedTime(dateTimeString) {
1145
+ const {
1146
+ year,
1147
+ month,
1148
+ date: date2,
1149
+ hour,
1150
+ minutes
1151
+ } = this.getAllVariablesFromDateTimeString(dateTimeString);
1152
+ const d2 = new Date(year, month, date2, hour, minutes);
1153
+ return d2.toLocaleTimeString(this.CALENDAR_LOCALE, {
1154
+ hour: "numeric",
1155
+ minute: "numeric"
1156
+ });
1157
+ }
1158
+ getLocalizedHour(date2) {
1159
+ return date2.toLocaleTimeString(this.CALENDAR_LOCALE, { hour: "2-digit" });
1160
+ }
1161
+ getLocalizedTimeRange(start, end) {
1162
+ return `${this.getLocalizedTime(start)} - ${this.getLocalizedTime(end)}`;
1163
+ }
1164
+ /**
1165
+ * Returns numeric values for year, month, date, hour and minutes, given a dateTimeString
1166
+ * All variables are Date-Object compatible, meaning "month" is zero-indexed
1167
+ */
1168
+ getAllVariablesFromDateTimeString(dateTimeString) {
1169
+ return {
1170
+ year: +dateTimeString.substring(0, 4),
1171
+ month: +dateTimeString.substring(5, 7) - 1,
1172
+ date: +dateTimeString.substring(8, 10),
1173
+ hour: this.hourFrom(dateTimeString),
1174
+ minutes: this.minutesFrom(dateTimeString)
1175
+ };
1176
+ }
1177
+ dateIsToday(date2) {
1178
+ const {
1179
+ fullYear: yearToday,
1180
+ month: monthToday,
1181
+ date: dateToday
1182
+ } = new EDate();
1183
+ const {
1184
+ fullYear: dateYear,
1185
+ month: dateMonth,
1186
+ date: dateDate
1187
+ } = new EDate(date2);
1188
+ return yearToday === dateYear && monthToday === dateMonth && dateToday === dateDate;
1189
+ }
1190
+ dateIsInWeek(dateToCheck, week) {
1191
+ const { date: date2, month, fullYear } = new EDate(dateToCheck);
1192
+ for (const weekDay of week) {
1193
+ const dateIsSame = date2 === weekDay.getDate();
1194
+ const monthIsSame = month === weekDay.getMonth();
1195
+ const yearIsSame = fullYear === weekDay.getFullYear();
1196
+ if (dateIsSame && monthIsSame && yearIsSame) return true;
1197
+ }
1198
+ return false;
1199
+ }
1200
+ getDateStringFromDate(date2) {
1201
+ const yyyy = date2.getFullYear();
1202
+ const mm = date2.getMonth() + 1;
1203
+ const dd = date2.getDate();
1204
+ return `${yyyy}-${mm >= 10 ? mm : `0${mm}`}-${dd >= 10 ? dd : `0${dd}`}`;
1205
+ }
1206
+ addMinutesToDateTimeString(minutes, dateTimeString) {
1207
+ const {
1208
+ year: oldYear,
1209
+ month: oldMonth,
1210
+ date: oldDate,
1211
+ hour: oldHour,
1212
+ minutes: oldMinutes
1213
+ } = this.getAllVariablesFromDateTimeString(dateTimeString);
1214
+ const oldDateObject = new Date(oldYear, oldMonth, oldDate, oldHour, oldMinutes);
1215
+ const newDateObject = new Date(oldDateObject.getTime() + minutes * 6e4);
1216
+ return this.getDateTimeStringFromDate(newDateObject);
1217
+ }
1218
+ addDaysToDateTimeString(days, dateTimeString) {
1219
+ return this.addMinutesToDateTimeString(days * 1440, dateTimeString);
1220
+ }
1221
+ dateStringsHaveEqualDates(dateTimeString1, dateTimeString2) {
1222
+ const { year: year1, month: month1, date: date1 } = this.getAllVariablesFromDateTimeString(dateTimeString1);
1223
+ const { year: year2, month: month2, date: date2 } = this.getAllVariablesFromDateTimeString(dateTimeString2);
1224
+ return year1 === year2 && month1 === month2 && date1 === date2;
1225
+ }
1226
+ setDateToEndOfDay(date2) {
1227
+ return new Date(
1228
+ date2.getFullYear(),
1229
+ date2.getMonth(),
1230
+ date2.getDate(),
1231
+ 23,
1232
+ 59,
1233
+ 59,
1234
+ 999
1235
+ );
1236
+ }
1237
+ turnMinutesIntoPercentageOfHour(minutes) {
1238
+ const oneMinutePercentage = 100 / 60;
1239
+ const minutePoints = oneMinutePercentage * minutes;
1240
+ if (minutePoints < 10) return `0${minutePoints}`;
1241
+ return minutePoints.toString();
1242
+ }
1243
+ /**
1244
+ * Every hour between 'dayStart' and 'dayEnd' is 100, in this function referred to as 100 points
1245
+ * If an event starts 30 minutes after 'dayStart', it should have 50 pointsIntoDay
1246
+ * If a day consists of 4 hours (400 points), we then have to count
1247
+ * (50 / 400) * 100 = 12.5 => event starts after 12.5 percent of the day
1248
+ *
1249
+ * Result is supposed to be a number between 0 and 100, and is used for setting the CSS- top- and height-attributes for events
1250
+ */
1251
+ getPercentageOfDayFromDateTimeString(dateTimeString, dayStart, dayEnd) {
1252
+ const hour = this.hourFrom(dateTimeString);
1253
+ const hourPoints = hour * 100;
1254
+ const minutes = +dateTimeString.substring(14, 16);
1255
+ const minutesPoints = +this.turnMinutesIntoPercentageOfHour(+minutes);
1256
+ if (dayEnd > dayStart) {
1257
+ const pointsInDay2 = dayEnd - dayStart;
1258
+ const eventPoints2 = hourPoints + minutesPoints;
1259
+ const eventPointsIntoDay = eventPoints2 - dayStart;
1260
+ return eventPointsIntoDay / pointsInDay2 * 100;
1261
+ }
1262
+ const hourPointsInOriginalDay = DAY_TIME_POINT.TWELVE_AM - dayStart;
1263
+ const pointsInDay = hourPointsInOriginalDay + dayEnd;
1264
+ const eventPoints = hourPoints + minutesPoints;
1265
+ const pointsIntoDay = eventPoints >= dayStart ? eventPoints - dayStart : hourPointsInOriginalDay + eventPoints;
1266
+ return pointsIntoDay / pointsInDay * 100;
1267
+ }
1268
+ getTimeFromClick(clickOffsetY, weekHeight) {
1269
+ if (weekHeight <= 0) throw new Error("weekHeight cannot be a negative number");
1270
+ if (clickOffsetY < 0) throw new Error("clickOffsetY cannot be a negative number");
1271
+ const dayStartHour = this.DAY_START / 100;
1272
+ const hourHeight = weekHeight / this.HOURS_PER_DAY;
1273
+ const minutes = Math.floor(clickOffsetY % hourHeight / (hourHeight / 60));
1274
+ if (this.DAY_END <= this.DAY_START) {
1275
+ const dayEndHour = this.DAY_END / 100;
1276
+ const nightHeight = dayEndHour * hourHeight;
1277
+ const nightOffset = weekHeight - nightHeight;
1278
+ if (clickOffsetY > nightOffset) {
1279
+ const hour2 = Math.floor((clickOffsetY - nightOffset) / hourHeight);
1280
+ return `${this.doubleDigit(hour2)}:${this.doubleDigit(minutes)}`;
1281
+ }
1282
+ }
1283
+ const hour = Math.floor(clickOffsetY / hourHeight) + dayStartHour;
1284
+ return `${this.doubleDigit(hour)}:${this.doubleDigit(minutes)}`;
1285
+ }
1286
+ setSegmentOfDateTimeString(dateTimeString, segments) {
1287
+ if (segments.hour < 0 || segments.hour > 23) throw new Error("Invalid hour");
1288
+ const newHour = this.doubleDigit(segments.hour);
1289
+ dateTimeString = dateTimeString.replace(/\d{2}:/, `${newHour}:`);
1290
+ return dateTimeString;
1291
+ }
1292
+ isTrailingOrLeadingDate(date2, month) {
1293
+ const { month: dateMonth } = new EDate(date2);
1294
+ return month !== dateMonth;
1295
+ }
1296
+ static getTimePointsFromHour(boundary) {
1297
+ if (boundary < 0 || boundary > 24 || boundary % 1 !== 0) {
1298
+ throw new Error("Invalid day boundary");
1299
+ }
1300
+ if (boundary === 0) return boundary;
1301
+ return boundary * 100;
1302
+ }
1303
+ static getHourFromTimePoints(timePoints) {
1304
+ if (timePoints < 0 || timePoints > 2400 || timePoints % 100 !== 0) {
1305
+ throw new Error("Invalid time points");
1306
+ }
1307
+ if (timePoints === 0) return timePoints;
1308
+ return timePoints / 100;
1309
+ }
1310
+ getTimelineHours() {
1311
+ if (this.dayMode !== DAY_MODE.FLEXIBLE) {
1312
+ return this.ALL_HOURS.filter((hour) => {
1313
+ return hour >= this.DAY_START && hour < this.DAY_END;
1314
+ });
1315
+ }
1316
+ return [
1317
+ ...this.ALL_HOURS.filter((hour) => hour >= this.DAY_START),
1318
+ ...this.ALL_HOURS.filter((hour) => hour < this.DAY_END)
1319
+ ];
1320
+ }
1321
+ dateStringFrom(dateTimeString) {
1322
+ return dateTimeString.substring(0, 10);
1323
+ }
1324
+ timeStringFrom(dateTimeString) {
1325
+ return dateTimeString.substring(11, 16);
1326
+ }
1327
+ hourFrom(dateTimeString) {
1328
+ return +dateTimeString.substring(11, 13);
1329
+ }
1330
+ minutesFrom(dateTimeString) {
1331
+ return +dateTimeString.substring(14, 16);
1332
+ }
1333
+ areDaysConsecutive(dayOne, dayTwo) {
1334
+ const dayOnePlusOneDay = this.dateStringFrom(this.addDaysToDateTimeString(1, dayOne));
1335
+ return dayOnePlusOneDay === this.dateStringFrom(dayTwo);
1336
+ }
1337
+ setHourInDateTimeString(dateTimeString, hour) {
1338
+ const hourString = this.doubleDigit(hour);
1339
+ dateTimeString = dateTimeString.replace(/\d{2}:/, `${hourString}:`);
1340
+ return dateTimeString;
1341
+ }
1342
+ setMinutesInDateTimeString(dateTimeString, minutes) {
1343
+ const minutesString = this.doubleDigit(minutes);
1344
+ dateTimeString = dateTimeString.replace(/:\d{2}/, `:${minutesString}`);
1345
+ return dateTimeString;
1346
+ }
1347
+ getDateTimeStringDayBoundariesFrom(dateString) {
1348
+ if (this.DAY_END <= this.DAY_START) {
1349
+ const nextDay = this.addDaysToDateTimeString(1, dateString);
1350
+ const endOfDay2 = this.setHourInDateTimeString(nextDay, this.getHourAndMinutesFromTimePoints(this.DAY_END).hour);
1351
+ const startOfDay22 = this.setHourInDateTimeString(dateString, this.getHourAndMinutesFromTimePoints(this.DAY_START).hour);
1352
+ return { start: startOfDay22, end: endOfDay2 };
1353
+ }
1354
+ const startOfDay2 = this.setHourInDateTimeString(dateString, this.getHourAndMinutesFromTimePoints(this.DAY_START).hour);
1355
+ let endOfDay;
1356
+ if (this.DAY_END === DAY_TIME_POINT.TWELVE_AM) {
1357
+ endOfDay = this.setHourInDateTimeString(dateString, 23);
1358
+ endOfDay = this.setMinutesInDateTimeString(endOfDay, 59);
1359
+ } else {
1360
+ endOfDay = this.setHourInDateTimeString(dateString, this.getHourAndMinutesFromTimePoints(this.DAY_END).hour);
1361
+ }
1362
+ return { start: startOfDay2, end: endOfDay };
1363
+ }
1364
+ doubleDigit(number2) {
1365
+ if (number2 < 0 || number2 > 60) throw new Error("Invalid number. This is not a valid hour or minute");
1366
+ return number2 < 10 ? `0${number2}` : String(number2);
1367
+ }
1368
+ }
1369
+ class EventPosition extends Time {
1370
+ /**
1371
+ * Yields a full calendar week, with all full-day events positioned in it
1372
+ */
1373
+ positionFullDayEventsInWeek(weekStart, weekEnd, events) {
1374
+ const eventsWithJSDates = events.map((scheduleEvent) => {
1375
+ const { year: startYear, month: startMonth, date: startDate } = this.getAllVariablesFromDateTimeString(scheduleEvent.time.start);
1376
+ const { year: endYear, month: endMonth, date: endDate } = this.getAllVariablesFromDateTimeString(scheduleEvent.time.end);
1377
+ scheduleEvent.timeJS = {
1378
+ start: new Date(startYear, startMonth, startDate),
1379
+ end: new Date(endYear, endMonth, endDate)
1380
+ };
1381
+ return scheduleEvent;
1382
+ }).sort((a2, b2) => {
1383
+ if (a2.time.start < b2.time.start) return -1;
1384
+ if (a2.time.start > b2.time.start) return 1;
1385
+ return 0;
1386
+ });
1387
+ const allDatesOfWeek = this.getDatesBetweenTwoDates(weekStart, weekEnd);
1388
+ const week = allDatesOfWeek.map((d2) => ({ date: d2 }));
1389
+ for (const scheduleEvent of eventsWithJSDates) {
1390
+ for (const [dayIndex, day] of week.entries()) {
1391
+ const thisDayDateString = this.getDateStringFromDate(day.date);
1392
+ if (this.getDateStringFromDate(scheduleEvent.timeJS.start) <= thisDayDateString && this.getDateStringFromDate(scheduleEvent.timeJS.end) >= thisDayDateString) {
1393
+ let levelToStartOn = 1;
1394
+ while (typeof week[dayIndex][`level${levelToStartOn}`] !== "undefined") {
1395
+ levelToStartOn++;
1396
+ }
1397
+ let eventNDays = Math.ceil((scheduleEvent.timeJS.end.getTime() - day.date.getTime()) / this.MS_PER_DAY) + 1;
1398
+ const remainingDaysOfWeek = week.length - dayIndex;
1399
+ if (eventNDays > remainingDaysOfWeek) eventNDays = remainingDaysOfWeek;
1400
+ week[dayIndex][`level${levelToStartOn}`] = {
1401
+ ...scheduleEvent,
1402
+ nDays: eventNDays
1403
+ // Denotes the number of days to display in the week, not the actual number of days
1404
+ };
1405
+ for (let i2 = 1; i2 < eventNDays; i2++) {
1406
+ week[dayIndex + i2][`level${levelToStartOn}`] = "blocked";
1407
+ }
1408
+ break;
1409
+ }
1410
+ }
1411
+ }
1412
+ const weekWithSortedLevelsInDays = [];
1413
+ for (const day of week) {
1414
+ weekWithSortedLevelsInDays.push(Object.keys(day).sort().reduce(
1415
+ (obj, key) => {
1416
+ obj[key] = day[key];
1417
+ return obj;
1418
+ },
1419
+ {}
1420
+ ));
1421
+ }
1422
+ return weekWithSortedLevelsInDays;
1423
+ }
1424
+ positionFullDayEventsInMonth(calendarMonth, fullDayEvents) {
1425
+ const newMonth = [];
1426
+ const flatMonth = calendarMonth.flat();
1427
+ const monthMap = /* @__PURE__ */ new Map();
1428
+ flatMonth.forEach((day) => monthMap.set(this.dateStringFrom(day.dateTimeString), day));
1429
+ fullDayEvents = fullDayEvents.sort((a2, b2) => {
1430
+ if (a2.time.start < b2.time.start) return 1;
1431
+ if (a2.time.start > b2.time.start) return -1;
1432
+ return 0;
1433
+ });
1434
+ for (const fullDayEvent of fullDayEvents) {
1435
+ const { year: startYear, month: startMonth, date: startDate } = this.getAllVariablesFromDateTimeString(fullDayEvent.time.start);
1436
+ const { year: endYear, month: endMonth, date: endDate } = this.getAllVariablesFromDateTimeString(fullDayEvent.time.end);
1437
+ const allDatesOfEvent = this.getDatesBetweenTwoDates(
1438
+ new Date(startYear, startMonth, startDate),
1439
+ new Date(endYear, endMonth, endDate)
1440
+ );
1441
+ for (const date2 of allDatesOfEvent) {
1442
+ const dateString = this.getDateStringFromDate(date2);
1443
+ const dateInMap = monthMap.get(dateString);
1444
+ if (dateInMap) {
1445
+ monthMap.set(dateString, {
1446
+ ...dateInMap,
1447
+ // Since we're iterating over the fullDayEvents sorted backwards, the earliest events will end up first (which is the wanted behavior)
1448
+ events: [fullDayEvent, ...dateInMap.events]
1449
+ });
1450
+ }
1451
+ }
1452
+ }
1453
+ let weekIterator = 0;
1454
+ monthMap.forEach((day) => {
1455
+ if (!newMonth.length) {
1456
+ newMonth.push([day]);
1457
+ } else if (newMonth[weekIterator] && newMonth[weekIterator].length < 7) {
1458
+ newMonth[weekIterator].push(day);
1459
+ } else if (newMonth[weekIterator] && newMonth[weekIterator].length === 7) {
1460
+ newMonth.push([day]);
1461
+ weekIterator++;
1462
+ }
1463
+ });
1464
+ return newMonth;
1465
+ }
1466
+ }
1467
+ const calendarDomRectForVitest = {
1468
+ x: 8,
1469
+ y: 26,
1470
+ width: 903,
1471
+ height: 702,
1472
+ top: 26,
1473
+ right: 911,
1474
+ bottom: 728,
1475
+ left: 8
1476
+ };
1477
+ const EVENT_FLYOUT_WIDTH = 400;
1478
+ class EventFlyoutPosition {
1479
+ calculateFlyoutPosition(eventElementDOMRect, flyoutDimensions, calendarDomRectParam = null) {
1480
+ const calendarDomRect = calendarDomRectParam || calendarDomRectForVitest;
1481
+ const spaceTop = eventElementDOMRect.top - calendarDomRect.top;
1482
+ const spaceRight = calendarDomRect.right - eventElementDOMRect.right;
1483
+ const spaceBottom = calendarDomRect.bottom - eventElementDOMRect.bottom;
1484
+ const spaceLeft = eventElementDOMRect.left - calendarDomRect.left;
1485
+ const flyoutNeededWidth = flyoutDimensions.width + 10;
1486
+ const topWhenSpaceToBottomIsNegative = spaceBottom < 0 ? calendarDomRect.bottom - flyoutDimensions.height - 10 : null;
1487
+ const topWhenSpaceTopIsNegative = spaceTop < 0 ? calendarDomRect.top + 10 : null;
1488
+ if (spaceBottom > flyoutDimensions.height && spaceRight > flyoutNeededWidth) {
1489
+ return {
1490
+ top: topWhenSpaceTopIsNegative || Math.round(eventElementDOMRect.top),
1491
+ left: Math.round(eventElementDOMRect.right) + 10
1492
+ };
1493
+ }
1494
+ if (spaceTop > flyoutDimensions.height && spaceRight > flyoutNeededWidth) {
1495
+ return {
1496
+ top: topWhenSpaceToBottomIsNegative || Math.round(eventElementDOMRect.bottom) - flyoutDimensions.height,
1497
+ left: Math.round(eventElementDOMRect.right) + 10
1498
+ };
1499
+ }
1500
+ if (spaceLeft > flyoutNeededWidth && spaceBottom > flyoutDimensions.height) {
1501
+ return {
1502
+ top: topWhenSpaceTopIsNegative || eventElementDOMRect.top,
1503
+ left: Math.round(
1504
+ eventElementDOMRect.left - (flyoutDimensions.width + 10)
1505
+ )
1506
+ };
1507
+ }
1508
+ if (spaceLeft > flyoutNeededWidth && spaceTop > flyoutDimensions.height) {
1509
+ return {
1510
+ top: topWhenSpaceToBottomIsNegative || Math.round(eventElementDOMRect.bottom - flyoutDimensions.height),
1511
+ left: Math.round(
1512
+ eventElementDOMRect.left - (flyoutDimensions.width + 10)
1513
+ )
1514
+ };
1515
+ }
1516
+ if (spaceBottom < flyoutDimensions.height) {
1517
+ return { top: calendarDomRect.bottom - flyoutDimensions.height, left: null };
1518
+ }
1519
+ return { top: eventElementDOMRect.top, left: null };
1520
+ }
1521
+ }
1522
+ const _hoisted_1$11 = {
1523
+ key: 0,
1524
+ class: "event-flyout__relative-wrapper"
1525
+ };
1526
+ const _hoisted_2$M = { class: "event-flyout__menu" };
1527
+ const _hoisted_3$C = {
1528
+ key: 0,
1529
+ class: "event-flyout__menu-editable"
1530
+ };
1531
+ const _hoisted_4$p = { class: "event-flyout__menu-close" };
1532
+ const _hoisted_5$n = {
1533
+ key: 0,
1534
+ class: "event-flyout__info-wrapper"
1535
+ };
1536
+ const _hoisted_6$g = {
1537
+ key: 0,
1538
+ class: "event-flyout__row is-title"
1539
+ };
1540
+ const _hoisted_7$c = {
1541
+ key: 1,
1542
+ class: "event-flyout__row is-time"
1543
+ };
1544
+ const _hoisted_8$7 = {
1545
+ key: 2,
1546
+ class: "event-flyout__row is-location"
1547
+ };
1548
+ const _hoisted_9$5 = {
1549
+ key: 3,
1550
+ class: "event-flyout__row is-with"
1551
+ };
1552
+ const _hoisted_10$5 = {
1553
+ key: 4,
1554
+ class: "event-flyout__row is-topic"
1555
+ };
1556
+ const _hoisted_11$4 = {
1557
+ key: 5,
1558
+ class: "event-flyout__row is-description"
1559
+ };
1560
+ const _hoisted_12$4 = ["innerHTML"];
1561
+ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
1562
+ __name: "EventFlyout",
1563
+ props: {
1564
+ calendarEventProp: {
1565
+ type: Object,
1566
+ default: () => ({})
1567
+ },
1568
+ eventElement: {
1569
+ type: Object,
1570
+ default: null
1571
+ },
1572
+ time: {
1573
+ type: Object,
1574
+ required: true
1575
+ },
1576
+ config: {
1577
+ type: Object,
1578
+ required: true
1579
+ }
1580
+ },
1581
+ emits: ["hide", "editEvent", "deleteEvent"],
1582
+ setup(__props, { emit: __emit }) {
1583
+ vue.useCssVars((_ctx) => ({
1584
+ "2bf9b46b": flyoutWidth
1585
+ }));
1586
+ const props2 = __props;
1587
+ const emit2 = __emit;
1588
+ const eventFlyoutPositionHelper = new EventFlyoutPosition();
1589
+ const isVisible = vue.ref(false);
1590
+ const top2 = vue.ref(0);
1591
+ const left2 = vue.ref(0);
1592
+ const calendarEvent = vue.ref(props2.calendarEventProp);
1593
+ const flyoutWidth = `${EVENT_FLYOUT_WIDTH}px`;
1594
+ const colors = EVENT_COLORS;
1595
+ const icons = {
1596
+ clock: "clock",
1597
+ user: "user",
1598
+ description: "comment",
1599
+ trash: "delete",
1600
+ edit: "edit",
1601
+ times: "close",
1602
+ topic: "help",
1603
+ location: "location_on"
1604
+ };
1605
+ const getEventTime = vue.computed(() => {
1606
+ if (!calendarEvent.value || !calendarEvent.value.time) return null;
1607
+ const eventType = Helpers.getEventType(calendarEvent.value, props2.time);
1608
+ if (["MULTI_DAY_TIMED"].includes(eventType)) {
1609
+ const startLocalizedString = `${getDateFromDateString(
1610
+ calendarEvent.value.time.start
1611
+ )} ${props2.time.getLocalizedTime(calendarEvent.value.time.start)}`;
1612
+ const endLocalizedString = `${getDateFromDateString(
1613
+ calendarEvent.value.time.end
1614
+ )} ${props2.time.getLocalizedTime(calendarEvent.value.time.end)}`;
1615
+ return `${startLocalizedString} - ${endLocalizedString}`;
1616
+ }
1617
+ if (["SINGLE_DAY_FULL_DAY", "MULTI_DAY_FULL_DAY"].includes(eventType)) {
1618
+ const startDate = getDateFromDateString(calendarEvent.value.time.start);
1619
+ const endDate = getDateFromDateString(calendarEvent.value.time.end);
1620
+ if (startDate === endDate) return startDate;
1621
+ return `${startDate} - ${endDate}`;
1622
+ }
1623
+ const dateString = getDateFromDateString(calendarEvent.value.time.start);
1624
+ const timeString = props2.time.getLocalizedTimeRange(
1625
+ calendarEvent.value.time.start,
1626
+ calendarEvent.value.time.end
1627
+ );
1628
+ return `${dateString} ⋅ ${timeString}`;
1629
+ });
1630
+ const eventFlyoutInlineStyles = vue.computed(() => {
1631
+ if (typeof top2.value === "number" && !left2.value) {
1632
+ return {
1633
+ top: `${top2.value}px`,
1634
+ left: "50%",
1635
+ position: "fixed",
1636
+ transform: "translateX(-50%)"
1637
+ };
1638
+ }
1639
+ return {
1640
+ top: `${top2.value}px`,
1641
+ left: `${left2.value}px`,
1642
+ position: "fixed"
1643
+ };
1644
+ });
1645
+ const isEditable = vue.computed(() => {
1646
+ var _a2;
1647
+ return ((_a2 = props2.calendarEventProp) == null ? void 0 : _a2.isEditable) || false;
1648
+ });
1649
+ const eventBackgroundColor = vue.computed(() => {
1650
+ var _a2, _b, _c;
1651
+ if (((_a2 = calendarEvent.value) == null ? void 0 : _a2.colorScheme) && ((_b = props2.config.style) == null ? void 0 : _b.colorSchemes) && props2.config.style.colorSchemes[calendarEvent.value.colorScheme]) {
1652
+ return props2.config.style.colorSchemes[calendarEvent.value.colorScheme].backgroundColor;
1653
+ }
1654
+ return colors[((_c = calendarEvent.value) == null ? void 0 : _c.color) || "blue"];
1655
+ });
1656
+ function setFlyoutPosition() {
1657
+ var _a2, _b;
1658
+ const calendar = (_a2 = props2.eventElement) == null ? void 0 : _a2.closest(".calendar-root");
1659
+ const flyout = document.querySelector(".event-flyout");
1660
+ if (!props2.eventElement) return;
1661
+ const flyoutPosition = eventFlyoutPositionHelper.calculateFlyoutPosition(
1662
+ (_b = props2.eventElement) == null ? void 0 : _b.getBoundingClientRect(),
1663
+ {
1664
+ height: (flyout == null ? void 0 : flyout.clientHeight) || 300,
1665
+ width: (flyout == null ? void 0 : flyout.clientWidth) || 0
1666
+ },
1667
+ calendar ? calendar.getBoundingClientRect() : null
1668
+ );
1669
+ top2.value = typeof (flyoutPosition == null ? void 0 : flyoutPosition.top) === "number" ? flyoutPosition.top : null;
1670
+ left2.value = typeof (flyoutPosition == null ? void 0 : flyoutPosition.left) === "number" ? flyoutPosition.left : null;
1671
+ }
1672
+ function editEvent() {
1673
+ var _a2;
1674
+ emit2("editEvent", (_a2 = calendarEvent.value) == null ? void 0 : _a2.id);
1675
+ closeFlyout();
1676
+ }
1677
+ function deleteEvent() {
1678
+ var _a2;
1679
+ emit2("deleteEvent", (_a2 = calendarEvent.value) == null ? void 0 : _a2.id);
1680
+ closeFlyout();
1681
+ }
1682
+ function closeFlyout() {
1683
+ isVisible.value = false;
1684
+ setTimeout(() => {
1685
+ emit2("hide");
1686
+ }, 100);
1687
+ }
1688
+ function getDateFromDateString(dateString) {
1689
+ const { year, month, date: date2 } = props2.time.getAllVariablesFromDateTimeString(dateString);
1690
+ return new Date(year, month, date2).toLocaleDateString(
1691
+ props2.time.CALENDAR_LOCALE,
1692
+ {
1693
+ year: "numeric",
1694
+ month: "long",
1695
+ day: "numeric"
1696
+ }
1697
+ );
1698
+ }
1699
+ function closeFlyoutOnClickOutside(e) {
1700
+ var _a2;
1701
+ const flyout = document.querySelector(".event-flyout");
1702
+ if (!flyout || !isVisible.value) return;
1703
+ const isClickOutside = !flyout.contains(e.target);
1704
+ const isClickOnEvent = !!e.target.closest(".is-event");
1705
+ const closeOnClickOutside = ((_a2 = props2.config.eventDialog) == null ? void 0 : _a2.closeOnClickOutside) ?? true;
1706
+ if (isVisible.value && isClickOutside && !isClickOnEvent && closeOnClickOutside) {
1707
+ closeFlyout();
1708
+ }
1709
+ }
1710
+ vue.watch(
1711
+ () => props2.calendarEventProp,
1712
+ (value) => {
1713
+ setTimeout(() => {
1714
+ calendarEvent.value = value;
1715
+ isVisible.value = !!value;
1716
+ vue.nextTick(() => {
1717
+ setFlyoutPosition();
1718
+ });
1719
+ }, 10);
1720
+ },
1721
+ { deep: true }
1722
+ );
1723
+ vue.onMounted(() => {
1724
+ document.addEventListener("click", closeFlyoutOnClickOutside);
1725
+ });
1726
+ vue.onBeforeUnmount(() => {
1727
+ document.removeEventListener("click", closeFlyoutOnClickOutside);
1728
+ });
1729
+ return (_ctx, _cache) => {
1730
+ return vue.openBlock(), vue.createElementBlock("div", {
1731
+ class: vue.normalizeClass(["event-flyout p-05 bg-white", { "is-visible": isVisible.value, "is-not-editable": !isEditable.value }]),
1732
+ style: vue.normalizeStyle(eventFlyoutInlineStyles.value)
1733
+ }, [
1734
+ !__props.config.eventDialog || !__props.config.eventDialog.isCustom ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$11, [
1735
+ vue.createElementVNode("div", _hoisted_2$M, [
1736
+ isEditable.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$C, [
1737
+ vue.createVNode(vue.unref(_sfc_main$q), {
1738
+ class: "event-flyout__menu-item is-edit-icon",
1739
+ icon: icons.edit,
1740
+ onClick: editEvent
1741
+ }, null, 8, ["icon"]),
1742
+ vue.createVNode(vue.unref(_sfc_main$q), {
1743
+ class: "event-flyout__menu-item is-trash-icon",
1744
+ icon: icons.trash,
1745
+ onClick: deleteEvent
1746
+ }, null, 8, ["icon"])
1747
+ ])) : vue.createCommentVNode("", true),
1748
+ vue.createElementVNode("span", _hoisted_4$p, [
1749
+ vue.createVNode(vue.unref(_sfc_main$q), {
1750
+ class: "event-flyout__menu-item is-times-icon",
1751
+ icon: icons.times,
1752
+ onClick: closeFlyout
1753
+ }, null, 8, ["icon"])
1754
+ ])
1755
+ ]),
1756
+ calendarEvent.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$n, [
1757
+ calendarEvent.value.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$g, [
1758
+ vue.createElementVNode("div", {
1759
+ class: "event-flyout__color-icon",
1760
+ style: vue.normalizeStyle({ backgroundColor: eventBackgroundColor.value })
1761
+ }, null, 4),
1762
+ vue.createTextVNode(" " + vue.toDisplayString(calendarEvent.value.title), 1)
1763
+ ])) : vue.createCommentVNode("", true),
1764
+ calendarEvent.value.time ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$c, vue.toDisplayString(getEventTime.value), 1)) : vue.createCommentVNode("", true),
1765
+ calendarEvent.value.location ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$7, [
1766
+ vue.createVNode(vue.unref(_sfc_main$q), {
1767
+ icon: icons.location
1768
+ }, null, 8, ["icon"]),
1769
+ vue.createTextVNode(" " + vue.toDisplayString(calendarEvent.value.location), 1)
1770
+ ])) : vue.createCommentVNode("", true),
1771
+ calendarEvent.value.with ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$5, [
1772
+ vue.createVNode(vue.unref(_sfc_main$q), {
1773
+ icon: icons.user
1774
+ }, null, 8, ["icon"]),
1775
+ vue.createTextVNode(" " + vue.toDisplayString(calendarEvent.value.with), 1)
1776
+ ])) : vue.createCommentVNode("", true),
1777
+ calendarEvent.value.topic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$5, [
1778
+ vue.createVNode(vue.unref(_sfc_main$q), {
1779
+ icon: icons.topic
1780
+ }, null, 8, ["icon"]),
1781
+ vue.createTextVNode(" " + vue.toDisplayString(calendarEvent.value.topic), 1)
1782
+ ])) : vue.createCommentVNode("", true),
1783
+ calendarEvent.value.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$4, [
1784
+ vue.createVNode(vue.unref(_sfc_main$q), {
1785
+ icon: icons.description
1786
+ }, null, 8, ["icon"]),
1787
+ vue.createElementVNode("p", {
1788
+ innerHTML: calendarEvent.value.description
1789
+ }, null, 8, _hoisted_12$4)
1790
+ ])) : vue.createCommentVNode("", true)
1791
+ ])) : vue.createCommentVNode("", true)
1792
+ ])) : vue.renderSlot(_ctx.$slots, "default", {
1793
+ key: 1,
1794
+ eventDialogData: calendarEvent.value,
1795
+ closeEventDialog: closeFlyout
1796
+ })
1797
+ ], 6);
1798
+ };
1799
+ }
1800
+ });
1801
+ const languageKeys = {
1802
+ /** The following three keys, describe the calendar modes */
1803
+ week: {
1804
+ "it-IT": "Settimana",
1805
+ "en-US": "Week",
1806
+ "de-DE": "Woche",
1807
+ "sv-SE": "Vecka",
1808
+ "zh-CN": "周",
1809
+ "pt-BR": "Semana",
1810
+ "fr-FR": "Semaine",
1811
+ "th-TH": "สัปดาห์",
1812
+ "nl-NL": "Week",
1813
+ "ru-RU": "Неделя",
1814
+ "ar-YE": "إسبوع",
1815
+ "es-ES": "Semana",
1816
+ "ja-JP": "週",
1817
+ "pl-PL": "Tydzień",
1818
+ "hu-HU": "Hét"
1819
+ },
1820
+ month: {
1821
+ "it-IT": "Mese",
1822
+ "en-US": "Month",
1823
+ "de-DE": "Monat",
1824
+ "sv-SE": "Månad",
1825
+ "zh-CN": "月",
1826
+ "pt-BR": "Mês",
1827
+ "fr-FR": "Mois",
1828
+ "th-TH": "เดือน",
1829
+ "nl-NL": "Maand",
1830
+ "ru-RU": "Месяц",
1831
+ "ar-YE": "شهر",
1832
+ "es-ES": "Mes",
1833
+ "ja-JP": "月",
1834
+ "pl-PL": "Miesiąc",
1835
+ "hu-HU": "Hónap"
1836
+ },
1837
+ day: {
1838
+ "it-IT": "Giorno",
1839
+ "en-US": "Day",
1840
+ "de-DE": "Tag",
1841
+ "sv-SE": "Dag",
1842
+ "zh-CN": "日",
1843
+ "pt-BR": "Dia",
1844
+ "fr-FR": "Jour",
1845
+ "th-TH": "วัน",
1846
+ "nl-NL": "Dag",
1847
+ "ru-RU": "День",
1848
+ "ar-YE": "يوم",
1849
+ "es-ES": "Día",
1850
+ "ja-JP": "日",
1851
+ "pl-PL": "Dzień",
1852
+ "hu-HU": "Nap"
1853
+ },
1854
+ /** Other keys */
1855
+ moreEvents: {
1856
+ "it-IT": "+ altri eventi",
1857
+ "en-US": "+ more events",
1858
+ "de-DE": "+ weitere Ereignisse",
1859
+ "sv-SE": "+ fler event",
1860
+ "zh-CN": "列出其他结果",
1861
+ "pt-BR": "+ mais eventos",
1862
+ "fr-FR": "+ d'autres événements",
1863
+ "th-TH": "+ เหตุการณ์เพิ่มเติม",
1864
+ "nl-NL": "meer evenementen",
1865
+ "ru-RU": "+ ещё события",
1866
+ "ar-YE": "+ المزيد من الأحداث",
1867
+ "es-ES": "más eventos",
1868
+ "ja-JP": "その他イベント",
1869
+ "pl-PL": "+ więcej wydarzeń",
1870
+ "hu-HU": "További események"
1871
+ },
1872
+ noEvent: {
1873
+ "it-IT": "Nessun evento",
1874
+ "en-US": "No events",
1875
+ "de-DE": "Keine Ereignisse",
1876
+ "sv-SE": "Inga event",
1877
+ "zh-CN": "沒有活動",
1878
+ "pt-BR": "Sem eventos",
1879
+ "fr-FR": "Aucun Evènement",
1880
+ "th-TH": "ไม่มีกิจกรรม",
1881
+ "nl-NL": "Geen evenementen",
1882
+ "ru-RU": "Нет событий",
1883
+ "ar-YE": "لا أحداث",
1884
+ "es-ES": "No hay eventos",
1885
+ "ja-JP": "イベントなし",
1886
+ "pl-PL": "Brak wydarzeń",
1887
+ "hu-HU": "Nincs esemény"
1888
+ }
1889
+ };
1890
+ const localeMap = /* @__PURE__ */ new Map([
1891
+ ["de", "de-DE"],
1892
+ ["en", "en-US"],
1893
+ ["it", "it-IT"],
1894
+ ["sv", "sv-SE"],
1895
+ ["zh", "zh-CN"],
1896
+ ["pt", "pt-BR"],
1897
+ ["fr", "fr-FR"],
1898
+ ["th", "th-TH"],
1899
+ ["nl", "nl-NL"],
1900
+ ["ru", "ru-RU"],
1901
+ ["ar", "ar-YE"],
1902
+ ["es", "es-ES"],
1903
+ ["ja", "ja-JP"],
1904
+ ["pl", "pl-PL"],
1905
+ ["hu", "hu-HU"]
1906
+ ]);
1907
+ function overrideShortLocaleWithLongLocale(locale2) {
1908
+ if (localeMap.has(locale2)) {
1909
+ locale2 = localeMap.get(locale2);
1910
+ }
1911
+ return locale2;
1912
+ }
1913
+ function getLanguage(languageKeys2, locale2) {
1914
+ locale2 = overrideShortLocaleWithLongLocale(locale2);
1915
+ return languageKeys2[locale2] ? languageKeys2[locale2] : languageKeys2["en-US"];
1916
+ }
1917
+ const _hoisted_1$10 = ["id"];
1918
+ const _hoisted_2$L = {
1919
+ key: 0,
1920
+ class: "agenda__event-time"
1921
+ };
1922
+ const _hoisted_3$B = { class: "agenda__event-title" };
1923
+ const _hoisted_4$o = {
1924
+ key: 1,
1925
+ class: "agenda__event-with"
1926
+ };
1927
+ const _hoisted_5$m = {
1928
+ key: 2,
1929
+ class: "agenda__event-location"
1930
+ };
1931
+ const eventIdPrefix$1 = "agenda__event-";
1932
+ const _sfc_main$1b = /* @__PURE__ */ vue.defineComponent({
1933
+ __name: "AgendaEventTile",
1934
+ props: {
1935
+ time: {
1936
+ type: Object,
1937
+ required: true
1938
+ },
1939
+ calendarEvent: {
1940
+ type: Object,
1941
+ required: true
1942
+ },
1943
+ config: {
1944
+ type: Object,
1945
+ required: true
1946
+ }
1947
+ },
1948
+ emits: ["eventWasClicked"],
1949
+ setup(__props, { emit: __emit }) {
1950
+ vue.useCssVars((_ctx) => ({
1951
+ "6b656230": eventBackgroundColor.value,
1952
+ "2507007e": eventColor.value
1953
+ }));
1954
+ const props2 = __props;
1955
+ const emit2 = __emit;
1956
+ const icons = {
1957
+ clock: "clock",
1958
+ user: "user",
1959
+ description: "comment",
1960
+ trash: "delete",
1961
+ edit: "pen-to-square",
1962
+ times: "close",
1963
+ topic: "question-circle",
1964
+ location: "location_on"
1965
+ };
1966
+ const colors = EVENT_COLORS;
1967
+ const eventBackgroundColor = vue.ref("");
1968
+ const eventColor = vue.ref("#fff");
1969
+ const eventTime = vue.computed(() => {
1970
+ return DATE_TIME_STRING_PATTERN.test(props2.calendarEvent.time.start) ? props2.time.getLocalizedTimeRange(
1971
+ props2.calendarEvent.time.start,
1972
+ props2.calendarEvent.time.end
1973
+ ) : null;
1974
+ });
1975
+ const elementId = vue.computed(() => {
1976
+ return eventIdPrefix$1 + props2.calendarEvent.id;
1977
+ });
1978
+ function setColors() {
1979
+ var _a2;
1980
+ if (props2.calendarEvent.colorScheme && ((_a2 = props2.config.style) == null ? void 0 : _a2.colorSchemes) && props2.config.style.colorSchemes[props2.calendarEvent.colorScheme]) {
1981
+ eventColor.value = props2.config.style.colorSchemes[props2.calendarEvent.colorScheme].color;
1982
+ eventBackgroundColor.value = props2.config.style.colorSchemes[props2.calendarEvent.colorScheme].backgroundColor;
1983
+ return;
1984
+ }
1985
+ if (props2.calendarEvent.color) {
1986
+ eventBackgroundColor.value = colors[props2.calendarEvent.color];
1987
+ return;
1988
+ }
1989
+ eventBackgroundColor.value = colors.blue;
1990
+ }
1991
+ function handleClickOnEvent() {
1992
+ const eventElement = document.getElementById(elementId.value);
1993
+ emit2("eventWasClicked", {
1994
+ clickedEvent: props2.calendarEvent,
1995
+ eventElement
1996
+ });
1997
+ }
1998
+ vue.onMounted(() => {
1999
+ setColors();
2000
+ });
2001
+ return (_ctx, _cache) => {
2002
+ return vue.openBlock(), vue.createElementBlock("div", {
2003
+ id: elementId.value,
2004
+ class: "agenda__event is-event",
2005
+ onClick: vue.withModifiers(handleClickOnEvent, ["prevent"])
2006
+ }, [
2007
+ eventTime.value && !__props.calendarEvent.originalEvent ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$L, [
2008
+ vue.createVNode(vue.unref(_sfc_main$q), {
2009
+ icon: icons.clock
2010
+ }, null, 8, ["icon"]),
2011
+ vue.createTextVNode(" " + vue.toDisplayString(eventTime.value), 1)
2012
+ ])) : vue.createCommentVNode("", true),
2013
+ vue.createElementVNode("span", _hoisted_3$B, vue.toDisplayString(__props.calendarEvent.title), 1),
2014
+ __props.calendarEvent.with ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$o, [
2015
+ vue.createVNode(vue.unref(_sfc_main$q), {
2016
+ icon: icons.user
2017
+ }, null, 8, ["icon"]),
2018
+ vue.createTextVNode(" " + vue.toDisplayString(__props.calendarEvent.with), 1)
2019
+ ])) : vue.createCommentVNode("", true),
2020
+ __props.calendarEvent.location ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$m, [
2021
+ vue.createVNode(vue.unref(_sfc_main$q), {
2022
+ icon: icons.location
2023
+ }, null, 8, ["icon"]),
2024
+ vue.createTextVNode(" " + vue.toDisplayString(__props.calendarEvent.location), 1)
2025
+ ])) : vue.createCommentVNode("", true)
2026
+ ], 8, _hoisted_1$10);
2027
+ };
2028
+ }
2029
+ });
2030
+ const AgendaEventTile = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["__scopeId", "data-v-eb2ab566"]]);
2031
+ const _hoisted_1$$ = { class: "agenda__wrapper" };
2032
+ const _hoisted_2$K = { class: "agenda__header" };
2033
+ const _hoisted_3$A = { class: "agenda__header-day-name" };
2034
+ const _hoisted_4$n = { class: "agenda__header-date" };
2035
+ const _hoisted_5$l = { class: "agenda__content" };
2036
+ const _hoisted_6$f = {
2037
+ key: 0,
2038
+ class: "is-empty"
2039
+ };
2040
+ const _hoisted_7$b = {
2041
+ key: 1,
2042
+ class: "agenda__content-events-list"
2043
+ };
2044
+ const _sfc_main$1a = /* @__PURE__ */ vue.defineComponent({
2045
+ __name: "AgendaEvents",
2046
+ props: {
2047
+ config: {
2048
+ type: Object,
2049
+ required: true
2050
+ },
2051
+ time: {
2052
+ type: Object,
2053
+ required: true
2054
+ },
2055
+ day: {
2056
+ type: Object,
2057
+ required: true
2058
+ }
2059
+ },
2060
+ emits: ["eventWasClicked"],
2061
+ setup(__props, { emit: __emit }) {
2062
+ const emit2 = __emit;
2063
+ return (_ctx, _cache) => {
2064
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$$, [
2065
+ vue.createElementVNode("header", _hoisted_2$K, [
2066
+ vue.createElementVNode("div", _hoisted_3$A, vue.toDisplayString(__props.day.dayName), 1),
2067
+ vue.createElementVNode("div", _hoisted_4$n, vue.toDisplayString(__props.day.dateTimeString.substring(8, 10)), 1)
2068
+ ]),
2069
+ vue.createElementVNode("div", _hoisted_5$l, [
2070
+ __props.day.events.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$f, vue.toDisplayString(vue.unref(getLanguage)(vue.unref(languageKeys).noEvent, __props.time.CALENDAR_LOCALE)), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$b, [
2071
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.day.events, (dayEvent) => {
2072
+ return vue.openBlock(), vue.createBlock(AgendaEventTile, {
2073
+ key: `agenda_event_${dayEvent.id}`,
2074
+ day: __props.day,
2075
+ config: __props.config,
2076
+ "calendar-event": dayEvent,
2077
+ time: __props.time,
2078
+ onEventWasClicked: _cache[0] || (_cache[0] = ($event) => emit2("eventWasClicked", $event))
2079
+ }, null, 8, ["day", "config", "calendar-event", "time"]);
2080
+ }), 128))
2081
+ ]))
2082
+ ])
2083
+ ]);
2084
+ };
2085
+ }
2086
+ });
2087
+ const AgendaEvents = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-25f23df1"]]);
2088
+ const _hoisted_1$_ = {
2089
+ key: 0,
2090
+ class: "calendar-month__event"
2091
+ };
2092
+ const _hoisted_2$J = ["id", "draggable"];
2093
+ const _hoisted_3$z = ["id", "draggable"];
2094
+ const _hoisted_4$m = {
2095
+ key: 0,
2096
+ class: "calendar-month__event-time"
2097
+ };
2098
+ const _hoisted_5$k = { class: "calendar-month__event-title" };
2099
+ const eventIdPrefix = "calendar-month__event-";
2100
+ const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
2101
+ __name: "Event",
2102
+ props: {
2103
+ time: {
2104
+ type: Object,
2105
+ required: true
2106
+ },
2107
+ calendarEvent: {
2108
+ type: Object,
2109
+ required: true
2110
+ },
2111
+ config: {
2112
+ type: Object,
2113
+ required: true
2114
+ },
2115
+ day: {
2116
+ type: Object,
2117
+ required: true
2118
+ }
2119
+ },
2120
+ emits: ["eventWasClicked"],
2121
+ setup(__props, { emit: __emit }) {
2122
+ vue.useCssVars((_ctx) => ({
2123
+ "2920aa71": eventBackgroundColor.value
2124
+ }));
2125
+ const props2 = __props;
2126
+ const emit2 = __emit;
2127
+ const colors = vue.ref(EVENT_COLORS);
2128
+ const eventBackgroundColor = vue.ref("");
2129
+ const isCustomEvent = vue.computed(() => {
2130
+ if (Array.isArray(props2.calendarEvent.isCustom)) {
2131
+ return props2.calendarEvent.isCustom.includes("month");
2132
+ }
2133
+ return props2.calendarEvent.isCustom || false;
2134
+ });
2135
+ const eventTimeStart = vue.computed(() => {
2136
+ return DATE_TIME_STRING_PATTERN.test(props2.calendarEvent.time.start) ? props2.time.getLocalizedTime(props2.calendarEvent.time.start) : null;
2137
+ });
2138
+ const elementId = vue.computed(() => eventIdPrefix + props2.calendarEvent.id + props2.time.dateStringFrom(props2.day.dateTimeString));
2139
+ const elementDraggableAttribute = vue.computed(() => {
2140
+ const {
2141
+ year: startYear,
2142
+ month: startMonth,
2143
+ date: startDate
2144
+ } = props2.time.getAllVariablesFromDateTimeString(props2.calendarEvent.time.start);
2145
+ const {
2146
+ year: endYear,
2147
+ month: endMonth,
2148
+ date: endDate
2149
+ } = props2.time.getAllVariablesFromDateTimeString(props2.calendarEvent.time.end);
2150
+ const eventIsSingleDay = startYear === endYear && startMonth === endMonth && startDate === endDate;
2151
+ const dragAndDropIsDisabled = props2.calendarEvent.disableDnD && props2.calendarEvent.disableDnD.includes("month");
2152
+ return props2.calendarEvent.isEditable && eventIsSingleDay && !dragAndDropIsDisabled ? true : void 0;
2153
+ });
2154
+ function setColors() {
2155
+ var _a2;
2156
+ if (props2.calendarEvent.colorScheme && ((_a2 = props2.config.style) == null ? void 0 : _a2.colorSchemes) && props2.config.style.colorSchemes[props2.calendarEvent.colorScheme]) {
2157
+ return eventBackgroundColor.value = props2.config.style.colorSchemes[props2.calendarEvent.colorScheme].backgroundColor;
2158
+ }
2159
+ if (props2.calendarEvent.color) {
2160
+ return eventBackgroundColor.value = colors.value[props2.calendarEvent.color];
2161
+ }
2162
+ return eventBackgroundColor.value = colors.value.blue;
2163
+ }
2164
+ function handleClickOnEvent() {
2165
+ const eventElement = document.getElementById(elementId.value);
2166
+ emit2("eventWasClicked", {
2167
+ clickedEvent: props2.calendarEvent,
2168
+ eventElement
2169
+ });
2170
+ }
2171
+ function handleDragStart(dragEvent) {
2172
+ if (!dragEvent || !dragEvent.dataTransfer) return;
2173
+ dragEvent.dataTransfer.effectAllowed = "move";
2174
+ dragEvent.dataTransfer.setData("json", JSON.stringify(props2.calendarEvent));
2175
+ }
2176
+ vue.onMounted(() => {
2177
+ setColors();
2178
+ });
2179
+ return (_ctx, _cache) => {
2180
+ return __props.config.isSmall ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$_)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2181
+ isCustomEvent.value ? (vue.openBlock(), vue.createElementBlock("div", {
2182
+ key: 0,
2183
+ id: elementId.value,
2184
+ class: vue.normalizeClass(["is-event", { "is-draggable": elementDraggableAttribute.value }]),
2185
+ "data-ref": "custom-event",
2186
+ draggable: elementDraggableAttribute.value,
2187
+ onDragstart: handleDragStart,
2188
+ onClick: handleClickOnEvent
2189
+ }, [
2190
+ vue.renderSlot(_ctx.$slots, "monthEvent", { eventData: __props.calendarEvent })
2191
+ ], 42, _hoisted_2$J)) : (vue.openBlock(), vue.createElementBlock("div", {
2192
+ key: 1,
2193
+ id: elementId.value,
2194
+ "data-ref": "default-event",
2195
+ class: vue.normalizeClass(["calendar-month__event is-event", { "is-draggable": elementDraggableAttribute.value }]),
2196
+ draggable: elementDraggableAttribute.value,
2197
+ onDragstart: handleDragStart,
2198
+ onClick: handleClickOnEvent
2199
+ }, [
2200
+ _cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "calendar-month__event-color" }, null, -1)),
2201
+ eventTimeStart.value && !__props.calendarEvent.originalEvent ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$m, vue.toDisplayString(eventTimeStart.value), 1)) : vue.createCommentVNode("", true),
2202
+ vue.createElementVNode("span", _hoisted_5$k, vue.toDisplayString(__props.calendarEvent.title), 1)
2203
+ ], 42, _hoisted_3$z))
2204
+ ], 64));
2205
+ };
2206
+ }
2207
+ });
2208
+ const _hoisted_1$Z = ["id"];
2209
+ const _hoisted_2$I = { class: "calendar-month_events" };
2210
+ const _hoisted_3$y = {
2211
+ key: 1,
2212
+ class: "space-reserver"
2213
+ };
2214
+ const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
2215
+ __name: "Day",
2216
+ props: {
2217
+ config: {
2218
+ type: Object,
2219
+ required: true
2220
+ },
2221
+ time: {
2222
+ type: Object,
2223
+ required: true
2224
+ },
2225
+ day: {
2226
+ type: Object,
2227
+ required: true
2228
+ },
2229
+ isSelected: {
2230
+ type: Boolean,
2231
+ default: false
2232
+ }
2233
+ },
2234
+ emits: ["eventWasClicked", "eventWasDragged", "updatedPeriod", "dateWasClicked", "dayWasSelected"],
2235
+ setup(__props, { emit: __emit }) {
2236
+ const props2 = __props;
2237
+ const emit2 = __emit;
2238
+ const isActiveDroppable = vue.ref(false);
2239
+ const canBeDropped = vue.computed(() => isActiveDroppable.value);
2240
+ const hideLeadingAndTrailingDate = vue.computed(
2241
+ () => {
2242
+ var _a2;
2243
+ return props2.day.isTrailingOrLeadingDate === true && ((_a2 = props2.config.month) == null ? void 0 : _a2.showTrailingAndLeadingDates) === false;
2244
+ }
2245
+ );
2246
+ const isToday = vue.computed(() => {
2247
+ const { year, month, date: date2 } = props2.time.getAllVariablesFromDateTimeString(props2.day.dateTimeString);
2248
+ return props2.time.dateIsToday(new Date(year, month, date2));
2249
+ });
2250
+ function getMoreEvents() {
2251
+ const { date: date2, month, year } = props2.time.getAllVariablesFromDateTimeString(props2.day.dateTimeString);
2252
+ const selectedDate = new Date(year, month, date2);
2253
+ const week = props2.time.getCalendarWeekDateObjects(selectedDate);
2254
+ const start = week[0];
2255
+ const end = week[6];
2256
+ emit2("updatedPeriod", { start, end, selectedDate });
2257
+ }
2258
+ function handleDragLeave() {
2259
+ isActiveDroppable.value = false;
2260
+ }
2261
+ function handleDragEnd(mouseEvent) {
2262
+ isActiveDroppable.value = false;
2263
+ mouseEvent.stopPropagation();
2264
+ }
2265
+ function handleDrop(dropEvent) {
2266
+ isActiveDroppable.value = false;
2267
+ dropEvent.stopPropagation();
2268
+ if (!dropEvent || !dropEvent.dataTransfer) return;
2269
+ const calendarEvent = JSON.parse(dropEvent.dataTransfer.getData("json"));
2270
+ const eventDroppedOnSameDay = props2.time.dateStringsHaveEqualDates(
2271
+ calendarEvent.time.start,
2272
+ props2.time.dateStringFrom(props2.day.dateTimeString)
2273
+ );
2274
+ if (eventDroppedOnSameDay) return;
2275
+ calendarEvent.time.start = calendarEvent.time.start.replace(
2276
+ /^\d{4}-\d{2}-\d{2}/,
2277
+ props2.time.dateStringFrom(props2.day.dateTimeString)
2278
+ );
2279
+ calendarEvent.time.end = calendarEvent.time.end.replace(
2280
+ /^\d{4}-\d{2}-\d{2}/,
2281
+ props2.time.dateStringFrom(props2.day.dateTimeString)
2282
+ );
2283
+ emit2("eventWasDragged", calendarEvent);
2284
+ }
2285
+ function handleDragOver(e) {
2286
+ isActiveDroppable.value = true;
2287
+ e.preventDefault();
2288
+ return false;
2289
+ }
2290
+ function emitDayWasClicked() {
2291
+ emit2("dateWasClicked", props2.time.dateStringFrom(props2.day.dateTimeString));
2292
+ if (props2.config.isSmall) emit2("dayWasSelected", props2.day);
2293
+ }
2294
+ return (_ctx, _cache) => {
2295
+ return !hideLeadingAndTrailingDate.value ? (vue.openBlock(), vue.createElementBlock("div", {
2296
+ key: 0,
2297
+ id: `day-${__props.time.dateStringFrom(__props.day.dateTimeString)}`,
2298
+ class: vue.normalizeClass(["calendar-month__weekday", {
2299
+ "is-droppable": canBeDropped.value,
2300
+ "trailing-or-leading": __props.day.isTrailingOrLeadingDate,
2301
+ "is-selected": __props.isSelected,
2302
+ "is-today": isToday.value
2303
+ }]),
2304
+ onClick: vue.withModifiers(emitDayWasClicked, ["self"]),
2305
+ onDragleave: handleDragLeave,
2306
+ onDragover: handleDragOver,
2307
+ onDrop: handleDrop,
2308
+ onDragend: handleDragEnd
2309
+ }, [
2310
+ vue.renderSlot(_ctx.$slots, "dayCell", { dayData: __props.day }, () => [
2311
+ vue.createElementVNode("span", {
2312
+ class: "calendar-month__day-date",
2313
+ onClick: emitDayWasClicked
2314
+ }, vue.toDisplayString(__props.day.dateTimeString.substring(8, 10).startsWith("0") ? __props.day.dateTimeString.substring(9, 10) : __props.day.dateTimeString.substring(8, 10)), 1),
2315
+ vue.createElementVNode("div", _hoisted_2$I, [
2316
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.day.events, (calendarEvent, index2) => {
2317
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
2318
+ index2 < 3 ? (vue.openBlock(), vue.createBlock(_sfc_main$19, {
2319
+ key: calendarEvent.id,
2320
+ "calendar-event": calendarEvent,
2321
+ config: __props.config,
2322
+ time: __props.time,
2323
+ day: __props.day,
2324
+ onEventWasClicked: _cache[0] || (_cache[0] = ($event) => emit2("eventWasClicked", $event.clickedEvent))
2325
+ }, {
2326
+ monthEvent: vue.withCtx((p2) => [
2327
+ vue.renderSlot(_ctx.$slots, "monthEvent", {
2328
+ eventData: p2.eventData
2329
+ }, void 0, true)
2330
+ ]),
2331
+ _: 2
2332
+ }, 1032, ["calendar-event", "config", "time", "day"])) : vue.createCommentVNode("", true)
2333
+ ], 64);
2334
+ }), 128)),
2335
+ __props.day.events.length >= 4 ? (vue.openBlock(), vue.createElementBlock("div", {
2336
+ key: 0,
2337
+ class: "calendar-month__weekday-more",
2338
+ onClick: getMoreEvents
2339
+ }, vue.toDisplayString(vue.unref(getLanguage)(vue.unref(languageKeys).moreEvents, __props.time.CALENDAR_LOCALE)), 1)) : vue.createCommentVNode("", true)
2340
+ ])
2341
+ ], true)
2342
+ ], 42, _hoisted_1$Z)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$y));
2343
+ };
2344
+ }
2345
+ });
2346
+ const Day$1 = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["__scopeId", "data-v-057882e2"]]);
2347
+ const _hoisted_1$Y = { class: "calendar-month__day-name" };
2348
+ const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
2349
+ __name: "WeekDay",
2350
+ props: {
2351
+ day: {}
2352
+ },
2353
+ setup(__props) {
2354
+ return (_ctx, _cache) => {
2355
+ return vue.openBlock(), vue.createElementBlock("span", _hoisted_1$Y, vue.toDisplayString(_ctx.day.dayName), 1);
2356
+ };
2357
+ }
2358
+ });
2359
+ const WeekDay = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-d96cc47c"]]);
2360
+ const _hoisted_1$X = { class: "calendar-month" };
2361
+ const _hoisted_2$H = { class: "calendar-month__week-day-names" };
2362
+ const _hoisted_3$x = { class: "calendar-month__weeks" };
2363
+ const _hoisted_4$l = {
2364
+ key: 0,
2365
+ class: "calendar-month__day_events"
2366
+ };
2367
+ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
2368
+ __name: "Month",
2369
+ props: {
2370
+ config: {
2371
+ type: Object,
2372
+ required: true
2373
+ },
2374
+ time: {
2375
+ type: Object,
2376
+ required: true
2377
+ },
2378
+ period: {
2379
+ type: Object,
2380
+ required: true
2381
+ },
2382
+ eventsProp: {
2383
+ type: Array,
2384
+ default: () => []
2385
+ }
2386
+ },
2387
+ emits: ["editEvent", "deleteEvent", "updatedPeriod", "eventWasClicked", "eventWasDragged", "dateWasClicked"],
2388
+ setup(__props, { emit: __emit }) {
2389
+ const props2 = __props;
2390
+ const emit2 = __emit;
2391
+ const EventPositionHelper = new EventPosition();
2392
+ const month = vue.ref([]);
2393
+ const selectedEvent = vue.ref(null);
2394
+ const selectedEventElement = vue.ref(null);
2395
+ const events = vue.ref(props2.eventsProp);
2396
+ const fullDayEvents = vue.ref([]);
2397
+ const selectedDay = vue.ref(null);
2398
+ function initMonth() {
2399
+ month.value = [];
2400
+ sortOutFullDayEvents();
2401
+ setMonth2();
2402
+ if (props2.config.isSmall) setInitialSelectedDay();
2403
+ }
2404
+ function setMonth2() {
2405
+ const { month: currentMonth, fullYear } = new EDate(props2.period.selectedDate);
2406
+ const calendarMonth = props2.time.getCalendarMonthSplitInWeeks(
2407
+ fullYear,
2408
+ currentMonth
2409
+ );
2410
+ const monthWithEvents = calendarMonth.map((week) => {
2411
+ return week.map((day) => {
2412
+ const dateTimeString = props2.time.getDateTimeStringFromDate(day);
2413
+ const dayEvents = events.value.filter((event) => {
2414
+ return props2.time.dateStringsHaveEqualDates(event.time.start, dateTimeString);
2415
+ });
2416
+ return {
2417
+ isTrailingOrLeadingDate: props2.time.isTrailingOrLeadingDate(day, currentMonth),
2418
+ dayName: props2.time.getLocalizedNameOfWeekday(day),
2419
+ dateTimeString: props2.time.getDateTimeStringFromDate(day),
2420
+ events: dayEvents
2421
+ };
2422
+ });
2423
+ });
2424
+ month.value = EventPositionHelper.positionFullDayEventsInMonth(
2425
+ monthWithEvents,
2426
+ fullDayEvents.value
2427
+ );
2428
+ }
2429
+ function sortOutFullDayEvents() {
2430
+ const timedEvents = [];
2431
+ const fullDayEventsArray = [];
2432
+ for (const calendarEvent of events.value) {
2433
+ if (Helpers.getEventType(calendarEvent, props2.time) === "SINGLE_DAY_TIMED") {
2434
+ timedEvents.push(calendarEvent);
2435
+ } else {
2436
+ fullDayEventsArray.push(calendarEvent);
2437
+ }
2438
+ }
2439
+ events.value = timedEvents;
2440
+ fullDayEvents.value = fullDayEventsArray;
2441
+ }
2442
+ function handleClickOnEvent(event) {
2443
+ emit2("eventWasClicked", event);
2444
+ selectedEventElement.value = event.eventElement;
2445
+ selectedEvent.value = event.clickedEvent;
2446
+ }
2447
+ function handleEventWasDragged(calendarEvent) {
2448
+ emit2("eventWasDragged", calendarEvent);
2449
+ const newEvents = [...events.value, ...fullDayEvents.value].filter(
2450
+ (e) => e.id !== calendarEvent.id
2451
+ );
2452
+ newEvents.push(calendarEvent);
2453
+ events.value = [];
2454
+ fullDayEvents.value = [];
2455
+ events.value = newEvents;
2456
+ initMonth();
2457
+ }
2458
+ function setInitialSelectedDay() {
2459
+ const selectedDayDateString = props2.time.getDateStringFromDate(props2.period.selectedDate);
2460
+ selectedDay.value = month.value.flat().find((day) => {
2461
+ return props2.time.dateStringFrom(day.dateTimeString) === selectedDayDateString;
2462
+ }) || null;
2463
+ }
2464
+ vue.onMounted(() => {
2465
+ initMonth();
2466
+ });
2467
+ return (_ctx, _cache) => {
2468
+ var _a2;
2469
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, [
2470
+ vue.createElementVNode("div", _hoisted_2$H, [
2471
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(month.value[0], (day, dayIndex) => {
2472
+ return vue.openBlock(), vue.createBlock(WeekDay, {
2473
+ key: dayIndex,
2474
+ class: "calendar-month__week-day-name",
2475
+ config: __props.config,
2476
+ day,
2477
+ time: __props.time
2478
+ }, null, 8, ["config", "day", "time"]);
2479
+ }), 128))
2480
+ ]),
2481
+ vue.createElementVNode("div", _hoisted_3$x, [
2482
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(month.value, (week, weekIndex) => {
2483
+ return vue.openBlock(), vue.createElementBlock("div", {
2484
+ key: weekIndex,
2485
+ class: "calendar-month__week"
2486
+ }, [
2487
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(week, (day, dayIndex) => {
2488
+ var _a3;
2489
+ return vue.openBlock(), vue.createBlock(Day$1, {
2490
+ key: dayIndex,
2491
+ config: __props.config,
2492
+ day,
2493
+ time: __props.time,
2494
+ "is-selected": ((_a3 = selectedDay.value) == null ? void 0 : _a3.dateTimeString) === day.dateTimeString,
2495
+ onEventWasClicked: handleClickOnEvent,
2496
+ onEventWasDragged: handleEventWasDragged,
2497
+ onDateWasClicked: _cache[0] || (_cache[0] = ($event) => emit2("dateWasClicked", $event)),
2498
+ onDayWasSelected: _cache[1] || (_cache[1] = ($event) => selectedDay.value = $event),
2499
+ onUpdatedPeriod: _cache[2] || (_cache[2] = ($event) => emit2("updatedPeriod", $event))
2500
+ }, {
2501
+ monthEvent: vue.withCtx(({ eventData }) => [
2502
+ vue.renderSlot(_ctx.$slots, "monthEvent", { eventData })
2503
+ ]),
2504
+ dayCell: vue.withCtx(({ dayData }) => [
2505
+ vue.renderSlot(_ctx.$slots, "dayCell", { dayData })
2506
+ ]),
2507
+ _: 2
2508
+ }, 1032, ["config", "day", "time", "is-selected"]);
2509
+ }), 128))
2510
+ ]);
2511
+ }), 128))
2512
+ ]),
2513
+ !(((_a2 = __props.config.month) == null ? void 0 : _a2.showEventsOnMobileView) === false) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$l, [
2514
+ selectedDay.value ? (vue.openBlock(), vue.createBlock(AgendaEvents, {
2515
+ key: 0,
2516
+ config: __props.config,
2517
+ time: __props.time,
2518
+ day: selectedDay.value,
2519
+ onEventWasClicked: handleClickOnEvent
2520
+ }, null, 8, ["config", "time", "day"])) : vue.createCommentVNode("", true)
2521
+ ])) : vue.createCommentVNode("", true),
2522
+ !__props.config.eventDialog || !__props.config.eventDialog.isDisabled ? (vue.openBlock(), vue.createBlock(_sfc_main$1c, {
2523
+ key: 1,
2524
+ "calendar-event-prop": selectedEvent.value,
2525
+ "event-element": selectedEventElement.value,
2526
+ time: __props.time,
2527
+ config: __props.config,
2528
+ onHide: _cache[3] || (_cache[3] = ($event) => selectedEvent.value = null),
2529
+ onEditEvent: _cache[4] || (_cache[4] = ($event) => emit2("editEvent", $event)),
2530
+ onDeleteEvent: _cache[5] || (_cache[5] = ($event) => emit2("deleteEvent", $event))
2531
+ }, {
2532
+ default: vue.withCtx((p2) => [
2533
+ vue.renderSlot(_ctx.$slots, "eventDialog", {
2534
+ eventDialogData: p2.eventDialogData,
2535
+ closeEventDialog: p2.closeEventDialog
2536
+ })
2537
+ ]),
2538
+ _: 3
2539
+ }, 8, ["calendar-event-prop", "event-element", "time", "config"])) : vue.createCommentVNode("", true)
2540
+ ]);
2541
+ };
2542
+ }
2543
+ });
2544
+ class EventsFilter {
2545
+ constructor(events) {
2546
+ this.events = events;
2547
+ }
2548
+ getEventsForDay(timeInstance, startDateTimeString) {
2549
+ return this.events.filter((event) => this.isEventInDayBoundaries(event, timeInstance, startDateTimeString));
2550
+ }
2551
+ isEventInDayBoundaries(event, timeInstance, startDateTimeString) {
2552
+ const eventIsInDay = timeInstance.dateStringFrom(event.time.start) === timeInstance.dateStringFrom(startDateTimeString);
2553
+ if (timeInstance.dayMode === DAY_MODE.REGULAR) {
2554
+ return eventIsInDay;
2555
+ }
2556
+ if (eventIsInDay && timeInstance.dayMode === DAY_MODE.SHORTENED) {
2557
+ return this.handlePartialDayWithinOneDayBoundary(timeInstance, event);
2558
+ }
2559
+ if (timeInstance.dayMode === DAY_MODE.FLEXIBLE) {
2560
+ return this.handleDayStretchingTwoDates(timeInstance, event, startDateTimeString, eventIsInDay);
2561
+ }
2562
+ return false;
2563
+ }
2564
+ handleDayStretchingTwoDates(timeInstance, event, startDateTimeString, eventIsInDay) {
2565
+ const { hour: dayStartHour } = timeInstance.getHourAndMinutesFromTimePoints(timeInstance.DAY_START);
2566
+ const { hour: dayEndHour } = timeInstance.getHourAndMinutesFromTimePoints(timeInstance.DAY_END);
2567
+ const { hour: eventStartHour } = timeInstance.getAllVariablesFromDateTimeString(event.time.start);
2568
+ const nextDay = timeInstance.addDaysToDateTimeString(1, startDateTimeString);
2569
+ const eventStartsInNextDay = event.time.start.substring(0, 11) === nextDay.substring(0, 11);
2570
+ return eventIsInDay && eventStartHour >= dayStartHour || eventStartsInNextDay && eventStartHour < dayEndHour;
2571
+ }
2572
+ handlePartialDayWithinOneDayBoundary(timeInstance, event) {
2573
+ const { hour: dayStartHour } = timeInstance.getHourAndMinutesFromTimePoints(timeInstance.DAY_START);
2574
+ const { hour: dayEndHour } = timeInstance.getHourAndMinutesFromTimePoints(timeInstance.DAY_END);
2575
+ const { hour: eventStartHour } = timeInstance.getAllVariablesFromDateTimeString(event.time.start);
2576
+ return eventStartHour >= dayStartHour && eventStartHour < dayEndHour;
2577
+ }
2578
+ }
2579
+ class WeekHelper {
2580
+ static getNHoursIntoDayFromHour(hour, timeInstance) {
2581
+ const dayStartHour = Time.getHourFromTimePoints(timeInstance.DAY_START);
2582
+ if (timeInstance.dayMode === DAY_MODE.REGULAR) return hour;
2583
+ if (timeInstance.dayMode === DAY_MODE.SHORTENED || timeInstance.dayMode === DAY_MODE.FLEXIBLE && hour >= dayStartHour) {
2584
+ return hour - dayStartHour;
2585
+ }
2586
+ return 24 - dayStartHour + hour;
2587
+ }
2588
+ static eventSeparator(events, time) {
2589
+ const singleDayTimedEvents = [];
2590
+ const fullDayAndMultipleDayEvents = [];
2591
+ for (const scheduleEvent of events) {
2592
+ const eventType = Helpers.getEventType(scheduleEvent, time);
2593
+ if (["SINGLE_DAY_TIMED", "SINGLE_HYBRID_DAY_TIMED"].includes(eventType)) {
2594
+ singleDayTimedEvents.push(scheduleEvent);
2595
+ } else {
2596
+ fullDayAndMultipleDayEvents.push(scheduleEvent);
2597
+ }
2598
+ }
2599
+ return { fullDayAndMultipleDayEvents, singleDayTimedEvents };
2600
+ }
2601
+ }
2602
+ class DayIntervals extends Time {
2603
+ constructor(intervalMinutes, dayStartDateTimeString, hoursPerDay = 24) {
2604
+ super();
2605
+ __publicField(this, "INTERVAL_MINUTES");
2606
+ __publicField(this, "DAY_START_DATE_TIME_STRING");
2607
+ __publicField(this, "HOURS_PER_DAY", 24);
2608
+ this.INTERVAL_MINUTES = intervalMinutes;
2609
+ this.DAY_START_DATE_TIME_STRING = dayStartDateTimeString;
2610
+ this.HOURS_PER_DAY = hoursPerDay;
2611
+ }
2612
+ getIntervals() {
2613
+ const intervals = [];
2614
+ const numberOfIntervalsInDay = this.HOURS_PER_DAY * (60 / this.INTERVAL_MINUTES);
2615
+ let iteratorDateTimeString = this.DAY_START_DATE_TIME_STRING;
2616
+ while (intervals.length < numberOfIntervalsInDay) {
2617
+ const intervalEnd = this.addMinutesToDateTimeString(this.INTERVAL_MINUTES, iteratorDateTimeString);
2618
+ intervals.push({
2619
+ intervalStart: iteratorDateTimeString,
2620
+ intervalEnd,
2621
+ // Only show a border at the bottom of an interval, when the upcoming interval is not the start of a new hour.
2622
+ // This prevents double borders
2623
+ hasBorder: intervalEnd.substring(14, 16) !== "00"
2624
+ });
2625
+ iteratorDateTimeString = intervalEnd;
2626
+ }
2627
+ return intervals;
2628
+ }
2629
+ }
2630
+ class EventConcurrency {
2631
+ sortEventsAccordingToStartOfTime(events) {
2632
+ function compare2(a2, b2) {
2633
+ if (a2.time.start < b2.time.start) {
2634
+ return -1;
2635
+ }
2636
+ if (a2.time.start > b2.time.start) {
2637
+ return 1;
2638
+ }
2639
+ return 0;
2640
+ }
2641
+ return events.sort(compare2);
2642
+ }
2643
+ /**
2644
+ * Sets the "zIndex" and "nOfPreviousConcurrentEvents" properties on an event
2645
+ *
2646
+ * zIndex - lets the event know with which z-index it should be displayed
2647
+ * nOfPreviousConcurrentEvents - lets the event know, how many other, previous events, are competing for the same width
2648
+ */
2649
+ calculateConcurrencyForEvents(events) {
2650
+ const updatedEvents = this.sortEventsAccordingToStartOfTime(events);
2651
+ if (!updatedEvents.length) return [];
2652
+ for (const [index2, calendarEvent] of updatedEvents.entries()) {
2653
+ if (index2 === 0) continue;
2654
+ updatedEvents[index2 - 1];
2655
+ let iterator = 0;
2656
+ let nOfConcurrentEvents = 0;
2657
+ while (iterator < index2) {
2658
+ if (updatedEvents[iterator].time.end > calendarEvent.time.start)
2659
+ nOfConcurrentEvents++;
2660
+ iterator++;
2661
+ }
2662
+ if (nOfConcurrentEvents)
2663
+ updatedEvents[index2].nOfPreviousConcurrentEvents = nOfConcurrentEvents;
2664
+ }
2665
+ for (let index2 = updatedEvents.length - 1; index2 >= 0; index2--) {
2666
+ let nOfUpcomingConcurrentEvents = 0;
2667
+ let iterator = updatedEvents.length - 1;
2668
+ while (iterator > index2) {
2669
+ if (updatedEvents[iterator].time.start < updatedEvents[index2].time.end) {
2670
+ nOfUpcomingConcurrentEvents++;
2671
+ }
2672
+ iterator--;
2673
+ }
2674
+ const nfOfPreviousEvents = updatedEvents[index2].nOfPreviousConcurrentEvents || 0;
2675
+ updatedEvents[index2].totalConcurrentEvents = nfOfPreviousEvents + nOfUpcomingConcurrentEvents + 1;
2676
+ }
2677
+ return events;
2678
+ }
2679
+ }
2680
+ var DRAG_N_RESIZE_DIRECTION = /* @__PURE__ */ ((DRAG_N_RESIZE_DIRECTION2) => {
2681
+ DRAG_N_RESIZE_DIRECTION2["BACKWARDS"] = "backwards";
2682
+ DRAG_N_RESIZE_DIRECTION2["FORWARDS"] = "forwards";
2683
+ return DRAG_N_RESIZE_DIRECTION2;
2684
+ })(DRAG_N_RESIZE_DIRECTION || {});
2685
+ class EventChange {
2686
+ constructor(timeInstance, date2) {
2687
+ __publicField(this, "dayStart", "");
2688
+ __publicField(this, "dayEnd", "");
2689
+ this.timeInstance = timeInstance;
2690
+ this.date = date2;
2691
+ this.setDayBoundariesTimeStrings();
2692
+ }
2693
+ canEventBeMoved(event, direction) {
2694
+ if (this.timeInstance.dayMode !== DAY_MODE.FLEXIBLE) {
2695
+ return this.handleNonFlexibleDays(direction, event);
2696
+ }
2697
+ return this.handleFlexibleDays(direction, event);
2698
+ }
2699
+ handleNonFlexibleDays(direction, event) {
2700
+ if (direction === DRAG_N_RESIZE_DIRECTION.FORWARDS) {
2701
+ return this.handleForwardsMoveForNonFlexibleDays(event);
2702
+ }
2703
+ return this.handleBackwardsMoveForNonFlexibleDays(event);
2704
+ }
2705
+ handleFlexibleDays(direction, event) {
2706
+ if (direction == DRAG_N_RESIZE_DIRECTION.FORWARDS) {
2707
+ return this.handleForwardsMoveForFlexibleDays(event);
2708
+ }
2709
+ return this.handleBackwardsMoveForFlexibleDays(event);
2710
+ }
2711
+ handleForwardsMoveForNonFlexibleDays(event) {
2712
+ const endTimePlus15Minutes = this.timeInstance.addMinutesToDateTimeString(15, event.time.end);
2713
+ const endTimeString = this.timeInstance.timeStringFrom(endTimePlus15Minutes);
2714
+ const newEndDateString = this.timeInstance.dateStringFrom(endTimePlus15Minutes);
2715
+ if (newEndDateString > this.date) return false;
2716
+ return endTimeString <= this.dayEnd;
2717
+ }
2718
+ handleBackwardsMoveForNonFlexibleDays(event) {
2719
+ const startTimeMinus15Minutes = this.timeInstance.addMinutesToDateTimeString(-15, event.time.start);
2720
+ const startTimeString = this.timeInstance.timeStringFrom(startTimeMinus15Minutes);
2721
+ const newStartDateString = this.timeInstance.dateStringFrom(startTimeMinus15Minutes);
2722
+ if (newStartDateString < this.date) return false;
2723
+ return startTimeString >= this.dayStart;
2724
+ }
2725
+ handleForwardsMoveForFlexibleDays(event) {
2726
+ const endTimePlus15Minutes = this.timeInstance.addMinutesToDateTimeString(15, event.time.end);
2727
+ const endTimeString = this.timeInstance.timeStringFrom(endTimePlus15Minutes);
2728
+ const newEndDateString = this.timeInstance.dateStringFrom(endTimePlus15Minutes);
2729
+ if (newEndDateString === this.date) return true;
2730
+ return endTimeString <= this.dayEnd;
2731
+ }
2732
+ handleBackwardsMoveForFlexibleDays(event) {
2733
+ const startTimeMinus15Minutes = this.timeInstance.addMinutesToDateTimeString(-15, event.time.start);
2734
+ const startTimeString = this.timeInstance.timeStringFrom(startTimeMinus15Minutes);
2735
+ const newStartDateString = this.timeInstance.dateStringFrom(startTimeMinus15Minutes);
2736
+ if (newStartDateString > this.date) return true;
2737
+ return startTimeString >= this.dayStart;
2738
+ }
2739
+ setDayBoundariesTimeStrings() {
2740
+ const startHour = this.timeInstance.getHourAndMinutesFromTimePoints(this.timeInstance.DAY_START).hour;
2741
+ const endHour = this.timeInstance.getHourAndMinutesFromTimePoints(this.timeInstance.DAY_END).hour;
2742
+ const startHourString = this.timeInstance.doubleDigit(startHour);
2743
+ this.dayStart = `${startHourString}:00`;
2744
+ const endHourString = this.timeInstance.doubleDigit(endHour);
2745
+ this.dayEnd = `${endHourString}:00`;
2746
+ }
2747
+ }
2748
+ const _hoisted_1$W = ["data-ref"];
2749
+ const _hoisted_2$G = { class: "calendar-week__event-row is-title" };
2750
+ const _hoisted_3$w = { class: "calendar-week__event-row is-time" };
2751
+ const _hoisted_4$k = {
2752
+ key: 0,
2753
+ class: "calendar-week__event-row is-location"
2754
+ };
2755
+ const _hoisted_5$j = {
2756
+ key: 1,
2757
+ class: "calendar-week__event-row is-with"
2758
+ };
2759
+ const _hoisted_6$e = {
2760
+ key: 2,
2761
+ class: "calendar-week__event-row is-topic"
2762
+ };
2763
+ const _hoisted_7$a = {
2764
+ key: 3,
2765
+ class: "calendar-week__event-row is-description"
2766
+ };
2767
+ const _hoisted_8$6 = ["innerHTML"];
2768
+ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
2769
+ __name: "DayEvent",
2770
+ props: {
2771
+ eventProp: {
2772
+ type: Object,
2773
+ required: true
2774
+ },
2775
+ time: {
2776
+ type: Object,
2777
+ required: true
2778
+ },
2779
+ config: {
2780
+ type: Object,
2781
+ required: true
2782
+ },
2783
+ dayInfo: {
2784
+ type: Object,
2785
+ required: true
2786
+ },
2787
+ mode: {
2788
+ type: String,
2789
+ required: true
2790
+ }
2791
+ },
2792
+ emits: ["eventWasClicked", "eventWasResized", "eventWasDragged", "dragStart", "dragEnd"],
2793
+ setup(__props, { emit: __emit }) {
2794
+ const props2 = __props;
2795
+ const emit2 = __emit;
2796
+ const event = vue.ref(props2.eventProp);
2797
+ const icons = vue.ref({
2798
+ clock: "clock",
2799
+ user: "user",
2800
+ description: "description",
2801
+ location: "location_on",
2802
+ topic: "topic"
2803
+ });
2804
+ const showResizeElements = vue.ref(false);
2805
+ const eventTransformValue = vue.ref("initial");
2806
+ const eventZIndexValue = vue.ref("initial");
2807
+ const dayElement = vue.ref(null);
2808
+ const resizingStartingPoint = vue.ref(void 0);
2809
+ const resizingStartingPointEndOfTime = vue.ref(props2.eventProp.time.end);
2810
+ const resizingStartingPointStartOfTime = vue.ref(props2.eventProp.time.start);
2811
+ const resizingDirection = vue.ref("");
2812
+ const changeInQuarterHoursEventStart = vue.ref(0);
2813
+ const changeInQuarterHoursEventEnd = vue.ref(0);
2814
+ const isEditable = vue.ref(props2.eventProp.isEditable || false);
2815
+ const colors = vue.ref(EVENT_COLORS);
2816
+ const eventColor = vue.ref("#fff");
2817
+ const eventBackgroundColor = vue.ref("");
2818
+ const isResizing = vue.ref(false);
2819
+ const canDrag = vue.ref(false);
2820
+ const clientYDragStart = vue.ref(null);
2821
+ const clientXDragStart = vue.ref(null);
2822
+ const changeInQuartersOnDrag = vue.ref(0);
2823
+ const changeInDaysOnDrag = vue.ref(0);
2824
+ vue.ref(false);
2825
+ const timeStartDragStart = vue.ref(props2.eventProp.time.start);
2826
+ const timeEndDragStart = vue.ref(props2.eventProp.time.end);
2827
+ const dragMoveListenerNameAndCallbacks = [
2828
+ ["mousemove", handleDrag],
2829
+ ["touchmove", handleDrag],
2830
+ ["mouseup", onMouseUpWhenDragging],
2831
+ ["touchend", onMouseUpWhenDragging]
2832
+ ];
2833
+ const eventChangeHelper = vue.computed(() => {
2834
+ const eventCurrentDay = props2.time.addDaysToDateTimeString(changeInDaysOnDrag.value, props2.dayInfo.dateTimeString);
2835
+ return new EventChange(props2.time, props2.time.dateStringFrom(eventCurrentDay));
2836
+ });
2837
+ const isCustomEvent = vue.computed(() => {
2838
+ if (Array.isArray(props2.eventProp.isCustom)) {
2839
+ return props2.eventProp.isCustom.includes(props2.mode);
2840
+ }
2841
+ return props2.eventProp.isCustom || false;
2842
+ });
2843
+ const getEventTime = vue.computed(() => {
2844
+ return `${props2.time.getLocalizedTime(event.value.time.start)} - ${props2.time.getLocalizedTime(event.value.time.end)}`;
2845
+ });
2846
+ const timePointsInDay = vue.computed(() => props2.time.HOURS_PER_DAY * 100);
2847
+ const timePointsInOneMinute = vue.computed(() => 100 / 60);
2848
+ const getLeftRule = vue.computed(() => {
2849
+ if (!event.value.totalConcurrentEvents || !event.value.nOfPreviousConcurrentEvents) {
2850
+ return 0;
2851
+ }
2852
+ return event.value.nOfPreviousConcurrentEvents / event.value.totalConcurrentEvents * 100;
2853
+ });
2854
+ const getWidthRule = vue.computed(() => 100 - getLeftRule.value);
2855
+ const getBorderRule = vue.computed(() => !event.value.nOfPreviousConcurrentEvents ? "none" : "1px solid #fff");
2856
+ const eventIsLongerThan30Minutes = vue.computed(() => {
2857
+ const { hour: startHour, minutes: startMinutes } = props2.time.getAllVariablesFromDateTimeString(event.value.time.start);
2858
+ const { hour: endHour, minutes: endMinutes } = props2.time.getAllVariablesFromDateTimeString(event.value.time.end);
2859
+ const startDateMS = new Date(0, 0, 0, startHour, startMinutes).getTime();
2860
+ const endDateMS = new Date(0, 0, 0, endHour, endMinutes).getTime();
2861
+ return endDateMS - startDateMS >= 18e5;
2862
+ });
2863
+ const hasDisabledDragAndDrop = vue.computed(() => {
2864
+ return !!(props2.eventProp.disableDnD && props2.eventProp.disableDnD.includes(props2.mode));
2865
+ });
2866
+ const hasDisabledResize = vue.computed(() => {
2867
+ return !!(props2.eventProp.disableResize && props2.eventProp.disableResize.includes(props2.mode));
2868
+ });
2869
+ const requiredStyles = vue.computed(() => ({
2870
+ top: getPositionInDay(event.value.time.start),
2871
+ height: getLengthOfEvent(event.value.time.start, event.value.time.end),
2872
+ left: `${getLeftRule.value}%`,
2873
+ width: `${getWidthRule.value}%`,
2874
+ transform: eventTransformValue.value,
2875
+ zIndex: eventZIndexValue.value
2876
+ }));
2877
+ function getPositionInDay(dateTimeString) {
2878
+ return `${props2.time.getPercentageOfDayFromDateTimeString(dateTimeString, props2.time.DAY_START, props2.time.DAY_END).toString()}%`;
2879
+ }
2880
+ function getLengthOfEvent(start, end) {
2881
+ const startOfEvent = props2.time.getPercentageOfDayFromDateTimeString(start, props2.time.DAY_START, props2.time.DAY_END);
2882
+ const endOfEvent = props2.time.getPercentageOfDayFromDateTimeString(end, props2.time.DAY_START, props2.time.DAY_END);
2883
+ const length = Math.abs(endOfEvent - startOfEvent);
2884
+ return `${length}%`;
2885
+ }
2886
+ function handleClickOnEvent(event2) {
2887
+ const eventElement = getEventElementFromChildElement(event2);
2888
+ if (!eventElement) return;
2889
+ emit2("eventWasClicked", {
2890
+ clickedEvent: props2.eventProp,
2891
+ eventElement
2892
+ });
2893
+ }
2894
+ function getEventElementFromChildElement(event2) {
2895
+ const eventTarget = event2.target;
2896
+ if (!eventTarget || typeof eventTarget.className.includes !== "function") return null;
2897
+ if (eventTarget.className.includes(".calendar-week__event")) return event2.target;
2898
+ return eventTarget.closest(".calendar-week__event");
2899
+ }
2900
+ function onMouseMoveResize(event2) {
2901
+ const eventsContainer = document.querySelector(".calendar-week__events");
2902
+ if (!eventsContainer) return;
2903
+ if (typeof resizingStartingPoint.value === "undefined") {
2904
+ resizingStartingPoint.value = event2.clientY;
2905
+ }
2906
+ const cursorPositionY = event2.clientY;
2907
+ const nOfPixelsDistance = cursorPositionY - resizingStartingPoint.value;
2908
+ const eventsContainerHeight = eventsContainer.clientHeight;
2909
+ const percentageOfDayChanged = nOfPixelsDistance / eventsContainerHeight * 100;
2910
+ const changeInTimePoints = timePointsInDay.value / 100 * percentageOfDayChanged;
2911
+ const changeInMinutes = getMinutesFromTimePoints(changeInTimePoints);
2912
+ if (resizingDirection.value === "down") {
2913
+ changeInQuarterHoursEventEnd.value = Math.floor(changeInMinutes / 15);
2914
+ } else {
2915
+ changeInQuarterHoursEventStart.value = Math.floor(changeInMinutes / 15);
2916
+ }
2917
+ }
2918
+ function onMouseUpWhenResizing() {
2919
+ stopResizing();
2920
+ }
2921
+ function resizeEvent(direction) {
2922
+ isResizing.value = true;
2923
+ resizingDirection.value = direction;
2924
+ document.addEventListener("mousemove", onMouseMoveResize);
2925
+ document.addEventListener("mouseup", onMouseUpWhenResizing);
2926
+ }
2927
+ function stopResizing() {
2928
+ document.removeEventListener("mousemove", onMouseMoveResize);
2929
+ document.removeEventListener("mouseup", onMouseUpWhenResizing);
2930
+ resetResizingValues();
2931
+ emit2("eventWasResized", event.value);
2932
+ isResizing.value = false;
2933
+ }
2934
+ function resetResizingValues() {
2935
+ resizingStartingPoint.value = void 0;
2936
+ resizingStartingPointStartOfTime.value = props2.eventProp.time.start;
2937
+ resizingStartingPointEndOfTime.value = props2.eventProp.time.end;
2938
+ changeInQuarterHoursEventEnd.value = 0;
2939
+ }
2940
+ function getMinutesFromTimePoints(timePoints) {
2941
+ return timePoints / timePointsInOneMinute.value;
2942
+ }
2943
+ function setColors() {
2944
+ var _a2;
2945
+ if (event.value.colorScheme && ((_a2 = props2.config.style) == null ? void 0 : _a2.colorSchemes) && props2.config.style.colorSchemes[event.value.colorScheme]) {
2946
+ eventColor.value = props2.config.style.colorSchemes[event.value.colorScheme].color;
2947
+ eventBackgroundColor.value = props2.config.style.colorSchemes[event.value.colorScheme].backgroundColor;
2948
+ return;
2949
+ }
2950
+ if (event.value.color) {
2951
+ eventColor.value = "#fff";
2952
+ eventBackgroundColor.value = colors.value[event.value.color];
2953
+ return;
2954
+ }
2955
+ eventBackgroundColor.value = colors.value.blue;
2956
+ }
2957
+ function initDrag(domEvent) {
2958
+ if (!event.value.isEditable || hasDisabledDragAndDrop.value) return;
2959
+ emit2("dragStart");
2960
+ dragMoveListenerNameAndCallbacks.forEach(([name, callback]) => {
2961
+ document.addEventListener(name, callback);
2962
+ });
2963
+ if (Helpers.isUIEventTouchEvent(domEvent)) {
2964
+ setInitialDragValues(
2965
+ domEvent.touches[0].clientX,
2966
+ domEvent.touches[0].clientY
2967
+ );
2968
+ } else {
2969
+ setInitialDragValues(domEvent.clientX, domEvent.clientY);
2970
+ }
2971
+ }
2972
+ function setInitialDragValues(clientX, clientY) {
2973
+ canDrag.value = true;
2974
+ eventZIndexValue.value = 10;
2975
+ clientYDragStart.value = clientY;
2976
+ clientXDragStart.value = clientX;
2977
+ timeStartDragStart.value = event.value.time.start;
2978
+ timeEndDragStart.value = event.value.time.end;
2979
+ }
2980
+ function onMouseUpWhenDragging() {
2981
+ emit2("dragEnd");
2982
+ handleDragEnd();
2983
+ }
2984
+ function handleDragEnd() {
2985
+ canDrag.value = false;
2986
+ eventZIndexValue.value = "initial";
2987
+ dragMoveListenerNameAndCallbacks.forEach(([name, callback]) => {
2988
+ document.removeEventListener(name, callback);
2989
+ });
2990
+ const dayChanged = changeInDaysOnDrag.value <= -1 || changeInDaysOnDrag.value > 0;
2991
+ const timeChanged = changeInQuartersOnDrag.value <= -1 || changeInQuartersOnDrag.value > 0;
2992
+ if (dayChanged || timeChanged) emit2("eventWasDragged", event.value);
2993
+ }
2994
+ function handleDrag(mouseEvent) {
2995
+ if (isResizing.value || !canDrag.value || !clientYDragStart.value) return;
2996
+ if (Helpers.isUIEventTouchEvent(mouseEvent)) {
2997
+ handleVerticalDrag(mouseEvent.touches[0].clientY);
2998
+ handleHorizontalDrag(mouseEvent.touches[0].clientX);
2999
+ } else {
3000
+ handleVerticalDrag(mouseEvent.clientY);
3001
+ handleHorizontalDrag(mouseEvent.clientX);
3002
+ }
3003
+ }
3004
+ function handleVerticalDrag(clientY) {
3005
+ const eventsContainer = document.querySelector(".calendar-week__events");
3006
+ if (!eventsContainer || !clientYDragStart.value) return;
3007
+ const nOfPixelsDistance = clientY - clientYDragStart.value;
3008
+ const eventsContainerHeight = eventsContainer.clientHeight;
3009
+ const percentageOfDayChanged = nOfPixelsDistance / eventsContainerHeight * 100;
3010
+ const changeInTimePoints = timePointsInDay.value / 100 * percentageOfDayChanged;
3011
+ const changeInMinutes = getMinutesFromTimePoints(changeInTimePoints);
3012
+ changeInQuartersOnDrag.value = changeInMinutes < 0 ? Math.ceil(changeInMinutes / 15) : Math.floor(changeInMinutes / 15);
3013
+ }
3014
+ function handleHorizontalDrag(clientX) {
3015
+ if (!dayElement.value || !clientXDragStart.value) return;
3016
+ const dayWidth = dayElement.value.clientWidth;
3017
+ const changeInPixelsX = clientX - clientXDragStart.value;
3018
+ changeInDaysOnDrag.value = changeInPixelsX < 0 ? Math.ceil(changeInPixelsX / dayWidth) : Math.floor(changeInPixelsX / dayWidth);
3019
+ }
3020
+ function updatePositionOnDrag() {
3021
+ const minutesChangedVertically = changeInQuartersOnDrag.value * 15;
3022
+ const minutesChangedHorizontally = changeInDaysOnDrag.value * 1440;
3023
+ event.value.time.start = props2.time.addMinutesToDateTimeString(
3024
+ minutesChangedVertically + minutesChangedHorizontally,
3025
+ timeStartDragStart.value
3026
+ );
3027
+ event.value.time.end = props2.time.addMinutesToDateTimeString(
3028
+ minutesChangedVertically + minutesChangedHorizontally,
3029
+ timeEndDragStart.value
3030
+ );
3031
+ }
3032
+ vue.watch(changeInQuarterHoursEventStart, (newValue, oldValue) => {
3033
+ const newStartOfTimeDateTimeString = props2.time.addMinutesToDateTimeString(
3034
+ 15 * newValue,
3035
+ resizingStartingPointStartOfTime.value
3036
+ );
3037
+ const direction = newValue > oldValue ? DRAG_N_RESIZE_DIRECTION.FORWARDS : DRAG_N_RESIZE_DIRECTION.BACKWARDS;
3038
+ const eventCanBeResizedFurther = eventChangeHelper.value.canEventBeMoved(event.value, direction);
3039
+ if (newStartOfTimeDateTimeString < event.value.time.end && eventCanBeResizedFurther) {
3040
+ event.value.time.start = newStartOfTimeDateTimeString;
3041
+ }
3042
+ });
3043
+ vue.watch(changeInQuarterHoursEventEnd, (newValue, oldValue) => {
3044
+ const newEndOfTimeDateTimeString = props2.time.addMinutesToDateTimeString(
3045
+ 15 * newValue,
3046
+ resizingStartingPointEndOfTime.value
3047
+ );
3048
+ const direction = newValue > oldValue ? DRAG_N_RESIZE_DIRECTION.FORWARDS : DRAG_N_RESIZE_DIRECTION.BACKWARDS;
3049
+ const eventCanBeResizedFurther = eventChangeHelper.value.canEventBeMoved(event.value, direction);
3050
+ if (newEndOfTimeDateTimeString > event.value.time.start && eventCanBeResizedFurther) {
3051
+ event.value.time.end = newEndOfTimeDateTimeString;
3052
+ }
3053
+ });
3054
+ vue.watch(changeInQuartersOnDrag, (newValue, oldValue) => {
3055
+ const direction = newValue > oldValue ? DRAG_N_RESIZE_DIRECTION.FORWARDS : DRAG_N_RESIZE_DIRECTION.BACKWARDS;
3056
+ const eventCanBeDraggedFurther = eventChangeHelper.value.canEventBeMoved(event.value, direction);
3057
+ if (!eventCanBeDraggedFurther) return;
3058
+ updatePositionOnDrag();
3059
+ });
3060
+ vue.watch(changeInDaysOnDrag, (newValue) => {
3061
+ if (!dayElement.value) return;
3062
+ const upcomingDaysInWeek = props2.dayInfo.daysTotalN - (props2.dayInfo.thisDayIndex + 1);
3063
+ const previousDaysInWeek = 0 - props2.dayInfo.thisDayIndex;
3064
+ if (newValue > upcomingDaysInWeek || newValue < previousDaysInWeek) return;
3065
+ const pixelsToTransform = newValue * dayElement.value.clientWidth;
3066
+ eventTransformValue.value = `translateX(${pixelsToTransform}px)`;
3067
+ updatePositionOnDrag();
3068
+ });
3069
+ vue.onMounted(() => {
3070
+ dayElement.value = document.querySelector(".calendar-week__day");
3071
+ setColors();
3072
+ });
3073
+ function handleFocus() {
3074
+ if (isEditable.value && !hasDisabledResize.value) {
3075
+ showResizeElements.value = true;
3076
+ }
3077
+ }
3078
+ function handleBlur() {
3079
+ showResizeElements.value = false;
3080
+ }
3081
+ return (_ctx, _cache) => {
3082
+ return vue.openBlock(), vue.createElementBlock("div", {
3083
+ class: vue.normalizeClass(["calendar-week__event is-event", {
3084
+ "is-editable": isEditable.value,
3085
+ "has-disabled-dnd": hasDisabledDragAndDrop.value
3086
+ }]),
3087
+ style: vue.normalizeStyle({
3088
+ ...requiredStyles.value,
3089
+ border: getBorderRule.value
3090
+ }),
3091
+ "data-ref": `event-${event.value.id}`,
3092
+ tabindex: "0",
3093
+ onClick: handleClickOnEvent,
3094
+ onMouseenter: handleFocus,
3095
+ onMouseleave: handleBlur,
3096
+ onFocus: handleFocus,
3097
+ onBlur: handleBlur,
3098
+ onMousedown: initDrag,
3099
+ onTouchstart: initDrag
3100
+ }, [
3101
+ !isCustomEvent.value ? (vue.openBlock(), vue.createElementBlock("div", {
3102
+ key: 0,
3103
+ class: "calendar-week__event-info-wrapper p-05",
3104
+ style: vue.normalizeStyle({
3105
+ color: eventColor.value,
3106
+ width: "100%",
3107
+ height: "100%",
3108
+ backgroundColor: eventBackgroundColor.value
3109
+ })
3110
+ }, [
3111
+ vue.createElementVNode("div", _hoisted_2$G, vue.toDisplayString(event.value.title), 1),
3112
+ vue.createElementVNode("div", _hoisted_3$w, [
3113
+ vue.createVNode(vue.unref(_sfc_main$q), {
3114
+ icon: icons.value.clock,
3115
+ class: "calendar-week__event-icon"
3116
+ }, null, 8, ["icon"]),
3117
+ vue.createElementVNode("span", null, vue.toDisplayString(getEventTime.value), 1)
3118
+ ]),
3119
+ event.value.location ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$k, [
3120
+ vue.createVNode(vue.unref(_sfc_main$q), {
3121
+ icon: icons.value.location,
3122
+ class: "calendar-week__event-icon"
3123
+ }, null, 8, ["icon"]),
3124
+ vue.createElementVNode("span", null, vue.toDisplayString(event.value.location), 1)
3125
+ ])) : vue.createCommentVNode("", true),
3126
+ event.value.with ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$j, [
3127
+ vue.createVNode(vue.unref(_sfc_main$q), {
3128
+ icon: icons.value.user,
3129
+ class: "calendar-week__event-icon"
3130
+ }, null, 8, ["icon"]),
3131
+ vue.createElementVNode("span", null, vue.toDisplayString(event.value.with), 1)
3132
+ ])) : vue.createCommentVNode("", true),
3133
+ event.value.topic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$e, [
3134
+ vue.createVNode(vue.unref(_sfc_main$q), {
3135
+ icon: icons.value.topic,
3136
+ class: "calendar-week__event-icon"
3137
+ }, null, 8, ["icon"]),
3138
+ vue.createElementVNode("span", null, vue.toDisplayString(event.value.topic), 1)
3139
+ ])) : vue.createCommentVNode("", true),
3140
+ event.value.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$a, [
3141
+ vue.createVNode(vue.unref(_sfc_main$q), {
3142
+ icon: icons.value.description,
3143
+ class: "calendar-week__event-icon"
3144
+ }, null, 8, ["icon"]),
3145
+ vue.createElementVNode("p", {
3146
+ innerHTML: event.value.description
3147
+ }, null, 8, _hoisted_8$6)
3148
+ ])) : vue.createCommentVNode("", true),
3149
+ eventIsLongerThan30Minutes.value ? (vue.openBlock(), vue.createElementBlock("div", {
3150
+ key: 4,
3151
+ class: "calendar-week__event-blend-out",
3152
+ style: vue.normalizeStyle({
3153
+ backgroundImage: `linear-gradient(to bottom, transparent, ${eventBackgroundColor.value})`
3154
+ })
3155
+ }, null, 4)) : vue.createCommentVNode("", true)
3156
+ ], 4)) : vue.renderSlot(_ctx.$slots, "weekDayEvent", {
3157
+ key: 1,
3158
+ eventData: event.value
3159
+ }, void 0, true),
3160
+ showResizeElements.value ? (vue.openBlock(), vue.createElementBlock("div", {
3161
+ key: 2,
3162
+ class: "calendar-week__event-resize calendar-week__event-resize-up",
3163
+ onMousedown: _cache[0] || (_cache[0] = ($event) => resizeEvent("up"))
3164
+ }, null, 32)) : vue.createCommentVNode("", true),
3165
+ showResizeElements.value ? (vue.openBlock(), vue.createElementBlock("div", {
3166
+ key: 3,
3167
+ class: "calendar-week__event-resize calendar-week__event-resize-down",
3168
+ onMousedown: _cache[1] || (_cache[1] = ($event) => resizeEvent("down"))
3169
+ }, null, 32)) : vue.createCommentVNode("", true)
3170
+ ], 46, _hoisted_1$W);
3171
+ };
3172
+ }
3173
+ });
3174
+ const DayEvent = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-7f22cf49"]]);
3175
+ const _hoisted_1$V = ["id", "onClick"];
3176
+ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
3177
+ __name: "Day",
3178
+ props: {
3179
+ day: {
3180
+ type: Object,
3181
+ required: true
3182
+ },
3183
+ time: {
3184
+ type: Object,
3185
+ required: true
3186
+ },
3187
+ config: {
3188
+ type: Object,
3189
+ required: true
3190
+ },
3191
+ dayInfo: {
3192
+ type: Object,
3193
+ required: true
3194
+ },
3195
+ mode: {
3196
+ type: String,
3197
+ required: true
3198
+ },
3199
+ dayIntervals: {
3200
+ type: Object,
3201
+ required: true
3202
+ },
3203
+ weekHeight: {
3204
+ type: Number,
3205
+ required: true
3206
+ }
3207
+ },
3208
+ emits: [
3209
+ "eventWasClicked",
3210
+ "eventWasResized",
3211
+ "eventWasDragged",
3212
+ "intervalWasClicked",
3213
+ "dayWasClicked",
3214
+ "datetimeWasClicked",
3215
+ "dragStart",
3216
+ "dragEnd"
3217
+ ],
3218
+ setup(__props, { emit: __emit }) {
3219
+ const props2 = __props;
3220
+ const emit2 = __emit;
3221
+ const eventConcurrencyHelper = new EventConcurrency();
3222
+ const events = vue.ref([]);
3223
+ const intervals = vue.ref([]);
3224
+ const intervalStyles = vue.computed(() => {
3225
+ var _a2;
3226
+ return ((_a2 = props2.config.dayIntervals) == null ? void 0 : _a2.intervalStyles) ? props2.config.dayIntervals.intervalStyles : {};
3227
+ });
3228
+ function calculateEventConcurrency() {
3229
+ events.value = eventConcurrencyHelper.calculateConcurrencyForEvents(
3230
+ props2.day.events
3231
+ );
3232
+ }
3233
+ function handleEventWasResized(event) {
3234
+ emit2("eventWasResized", event);
3235
+ calculateEventConcurrency();
3236
+ }
3237
+ function handleClickOnInterval(payload) {
3238
+ const { intervalStart, intervalEnd } = payload;
3239
+ emit2("intervalWasClicked", { intervalStart, intervalEnd });
3240
+ }
3241
+ function setClickableIntervals() {
3242
+ let dayStartTimeString = props2.day.dateTimeString;
3243
+ if (props2.time.DAY_START !== 0) {
3244
+ const { hour: startHour } = props2.time.getHourAndMinutesFromTimePoints(props2.time.DAY_START);
3245
+ dayStartTimeString = props2.time.setSegmentOfDateTimeString(dayStartTimeString, { hour: startHour });
3246
+ }
3247
+ intervals.value = new DayIntervals(
3248
+ props2.dayIntervals.length || 60,
3249
+ dayStartTimeString,
3250
+ props2.time.HOURS_PER_DAY
3251
+ ).getIntervals();
3252
+ }
3253
+ function getDateStringForFlexibleDayBoundaries(dateString, timeClickedHHMM) {
3254
+ const hourTwoDigits = props2.time.doubleDigit(props2.time.DAY_START / 100);
3255
+ const dayStartTimeHHMM = `${hourTwoDigits}:00`;
3256
+ const isClickOnNextDay = timeClickedHHMM < dayStartTimeHHMM;
3257
+ if (isClickOnNextDay) {
3258
+ dateString = props2.time.dateStringFrom(
3259
+ props2.time.addDaysToDateTimeString(1, dateString)
3260
+ );
3261
+ }
3262
+ return dateString;
3263
+ }
3264
+ function handleClickOnDay(event) {
3265
+ const timeClicked = props2.time.getTimeFromClick(event.offsetY, props2.weekHeight);
3266
+ let dateString = props2.time.dateStringFrom(props2.day.dateTimeString);
3267
+ const isFlexibleDay = props2.time.DAY_END <= props2.time.DAY_START;
3268
+ if (isFlexibleDay) dateString = getDateStringForFlexibleDayBoundaries(dateString, timeClicked);
3269
+ const dateTimeString = `${dateString} ${timeClicked}`;
3270
+ emit2("dayWasClicked", dateString);
3271
+ emit2("datetimeWasClicked", dateTimeString);
3272
+ }
3273
+ vue.onMounted(() => {
3274
+ calculateEventConcurrency();
3275
+ if (props2.dayIntervals.displayClickableInterval) setClickableIntervals();
3276
+ });
3277
+ return (_ctx, _cache) => {
3278
+ return vue.openBlock(), vue.createElementBlock("div", {
3279
+ class: "calendar-week__day",
3280
+ onClick: vue.withModifiers(handleClickOnDay, ["self"])
3281
+ }, [
3282
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(events.value, (event, eventIndex) => {
3283
+ return vue.openBlock(), vue.createBlock(DayEvent, {
3284
+ key: eventIndex,
3285
+ "data-test": "day-event",
3286
+ "event-prop": event,
3287
+ day: __props.day,
3288
+ time: __props.time,
3289
+ config: __props.config,
3290
+ "day-info": __props.dayInfo,
3291
+ mode: __props.mode,
3292
+ onEventWasClicked: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("eventWasClicked", $event)),
3293
+ onEventWasDragged: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("eventWasDragged", $event)),
3294
+ onEventWasResized: handleEventWasResized,
3295
+ onDragStart: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("dragStart")),
3296
+ onDragEnd: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("dragEnd"))
3297
+ }, {
3298
+ weekDayEvent: vue.withCtx((p2) => [
3299
+ vue.renderSlot(_ctx.$slots, "weekDayEvent", {
3300
+ eventData: p2.eventData
3301
+ }, void 0, true)
3302
+ ]),
3303
+ _: 2
3304
+ }, 1032, ["event-prop", "day", "time", "config", "day-info", "mode"]);
3305
+ }), 128)),
3306
+ __props.dayIntervals && __props.dayIntervals.displayClickableInterval ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(intervals.value, (interval, intervalIndex) => {
3307
+ return vue.openBlock(), vue.createElementBlock("div", {
3308
+ id: `interval-${intervalIndex}`,
3309
+ key: interval.intervalStart,
3310
+ class: vue.normalizeClass(["calendar-week__day-interval", { "has-border": interval.hasBorder }]),
3311
+ style: vue.normalizeStyle(intervalStyles.value),
3312
+ onClick: ($event) => handleClickOnInterval(interval)
3313
+ }, vue.toDisplayString(__props.time.getLocalizedTime(interval.intervalStart)), 15, _hoisted_1$V);
3314
+ }), 128)) : vue.createCommentVNode("", true)
3315
+ ]);
3316
+ };
3317
+ }
3318
+ });
3319
+ const Day = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-12350119"]]);
3320
+ const _hoisted_1$U = { class: "day-timeline" };
3321
+ const _hoisted_2$F = { class: "day-timeline__hour-text" };
3322
+ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
3323
+ __name: "DayTimeline",
3324
+ props: {
3325
+ time: {
3326
+ type: Object,
3327
+ required: true
3328
+ },
3329
+ weekHeight: {
3330
+ type: String,
3331
+ required: true
3332
+ }
3333
+ },
3334
+ setup(__props) {
3335
+ vue.useCssVars((_ctx) => ({
3336
+ "73f3c772": __props.weekHeight
3337
+ }));
3338
+ const props2 = __props;
3339
+ const timelineHours = vue.ref([]);
3340
+ vue.onMounted(() => {
3341
+ timelineHours.value = props2.time.getTimelineHours();
3342
+ });
3343
+ function getLocaleTimeString(time) {
3344
+ const { hour } = props2.time.getHourAndMinutesFromTimePoints(time);
3345
+ return props2.time.getLocalizedHour(new Date(2100, 1, 1, hour));
3346
+ }
3347
+ return (_ctx, _cache) => {
3348
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$U, [
3349
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(timelineHours.value, (hour) => {
3350
+ return vue.openBlock(), vue.createElementBlock("div", {
3351
+ key: hour,
3352
+ class: "day-timeline__hour"
3353
+ }, [
3354
+ vue.createElementVNode("span", _hoisted_2$F, vue.toDisplayString(getLocaleTimeString(hour)), 1)
3355
+ ]);
3356
+ }), 128))
3357
+ ]);
3358
+ };
3359
+ }
3360
+ });
3361
+ const DayTimeline = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-a4d8d28d"]]);
3362
+ const _hoisted_1$T = ["id"];
3363
+ const _hoisted_2$E = {
3364
+ key: 1,
3365
+ class: "week-timeline__event"
3366
+ };
3367
+ const eventElementIdPrefix = "week-timeline__event-id-";
3368
+ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
3369
+ __name: "FullDayEvent",
3370
+ props: {
3371
+ scheduleEvent: {
3372
+ type: Object,
3373
+ default: null
3374
+ },
3375
+ config: {
3376
+ type: Object,
3377
+ required: true
3378
+ },
3379
+ mode: {
3380
+ type: String,
3381
+ required: true
3382
+ }
3383
+ },
3384
+ emits: ["eventWasClicked"],
3385
+ setup(__props, { emit: __emit }) {
3386
+ const props2 = __props;
3387
+ const emit2 = __emit;
3388
+ const colors = EVENT_COLORS;
3389
+ const eventColor = vue.ref("#fff");
3390
+ const eventBackgroundColor = vue.ref("");
3391
+ const eventWidth = vue.computed(() => {
3392
+ if (props2.mode !== "day")
3393
+ return `calc(${props2.scheduleEvent.nDays * 100}% - 6px)`;
3394
+ return "calc(100% - 6px)";
3395
+ });
3396
+ function setColors() {
3397
+ var _a2;
3398
+ if (props2.scheduleEvent.colorScheme && ((_a2 = props2.config.style) == null ? void 0 : _a2.colorSchemes) && props2.config.style.colorSchemes[props2.scheduleEvent.colorScheme]) {
3399
+ eventColor.value = props2.config.style.colorSchemes[props2.scheduleEvent.colorScheme].color;
3400
+ eventBackgroundColor.value = props2.config.style.colorSchemes[props2.scheduleEvent.colorScheme].backgroundColor;
3401
+ return;
3402
+ }
3403
+ if (props2.scheduleEvent.color) {
3404
+ eventColor.value = "#fff";
3405
+ eventBackgroundColor.value = colors[props2.scheduleEvent.color];
3406
+ return;
3407
+ }
3408
+ eventBackgroundColor.value = colors.blue;
3409
+ }
3410
+ function handleClickOnEvent() {
3411
+ const eventElement = document.getElementById(
3412
+ eventElementIdPrefix + props2.scheduleEvent.id
3413
+ );
3414
+ emit2("eventWasClicked", {
3415
+ clickedEvent: props2.scheduleEvent,
3416
+ eventElement
3417
+ });
3418
+ }
3419
+ vue.onMounted(() => {
3420
+ setColors();
3421
+ });
3422
+ return (_ctx, _cache) => {
3423
+ return __props.scheduleEvent ? (vue.openBlock(), vue.createElementBlock("div", {
3424
+ key: 0,
3425
+ id: `${eventElementIdPrefix}${__props.scheduleEvent.id}`,
3426
+ class: "week-timeline__event is-event",
3427
+ style: vue.normalizeStyle({
3428
+ width: eventWidth.value,
3429
+ color: eventColor.value,
3430
+ backgroundColor: eventBackgroundColor.value,
3431
+ zIndex: 1
3432
+ }),
3433
+ onClick: handleClickOnEvent
3434
+ }, vue.toDisplayString(__props.scheduleEvent.title), 13, _hoisted_1$T)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$E));
3435
+ };
3436
+ }
3437
+ });
3438
+ const FullDayEvent = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-511747c2"]]);
3439
+ const _hoisted_1$S = { class: "week-timeline" };
3440
+ const _hoisted_2$D = ["onClick"];
3441
+ const _hoisted_3$v = { class: "week-timeline__day-name" };
3442
+ const _hoisted_4$j = { class: "week-timeline__date" };
3443
+ const _hoisted_5$i = { class: "week-timeline__events" };
3444
+ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
3445
+ __name: "WeekTimeline",
3446
+ props: {
3447
+ days: {},
3448
+ time: {},
3449
+ fullDayEvents: {},
3450
+ config: {},
3451
+ mode: {}
3452
+ },
3453
+ emits: ["eventWasClicked", "dayWasClicked"],
3454
+ setup(__props, { emit: __emit }) {
3455
+ const props2 = __props;
3456
+ const emit2 = __emit;
3457
+ const now = vue.ref(/* @__PURE__ */ new Date());
3458
+ function getDaysDate(day) {
3459
+ const { date: date2 } = props2.time.getAllVariablesFromDateTimeString(
3460
+ day.dateTimeString
3461
+ );
3462
+ return date2;
3463
+ }
3464
+ return (_ctx, _cache) => {
3465
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$S, [
3466
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.days, (day, dayIndex) => {
3467
+ return vue.openBlock(), vue.createElementBlock("div", {
3468
+ key: dayIndex,
3469
+ class: vue.normalizeClass(["week-timeline__day", {
3470
+ "is-today": _ctx.time.getDateTimeStringFromDate(now.value, "start") === day.dateTimeString
3471
+ }]),
3472
+ onClick: ($event) => emit2("dayWasClicked", _ctx.time.dateStringFrom(day.dateTimeString))
3473
+ }, [
3474
+ vue.createElementVNode("div", _hoisted_3$v, vue.toDisplayString(day.dayName.substring(0, 2).toUpperCase()), 1),
3475
+ vue.createElementVNode("div", _hoisted_4$j, vue.toDisplayString(getDaysDate(day)), 1),
3476
+ vue.createElementVNode("div", _hoisted_5$i, [
3477
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(day.fullDayEvents, (event, key) => {
3478
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key }, [
3479
+ key !== "date" ? (vue.openBlock(), vue.createBlock(FullDayEvent, {
3480
+ key: 0,
3481
+ "schedule-event": typeof event === "object" ? event : null,
3482
+ config: _ctx.config,
3483
+ mode: _ctx.mode,
3484
+ onEventWasClicked: _cache[0] || (_cache[0] = ($event) => emit2("eventWasClicked", $event))
3485
+ }, null, 8, ["schedule-event", "config", "mode"])) : vue.createCommentVNode("", true)
3486
+ ], 64);
3487
+ }), 128))
3488
+ ])
3489
+ ], 10, _hoisted_2$D);
3490
+ }), 128))
3491
+ ]);
3492
+ };
3493
+ }
3494
+ });
3495
+ const WeekTimeline = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-0e7c9832"]]);
3496
+ const _hoisted_1$R = { class: "calendar-week__wrapper" };
3497
+ const _hoisted_2$C = { class: "calendar-week" };
3498
+ const _hoisted_3$u = { class: "calendar-week__events" };
3499
+ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
3500
+ __name: "Week",
3501
+ props: {
3502
+ config: {
3503
+ type: Object,
3504
+ required: true
3505
+ },
3506
+ eventsProp: {
3507
+ type: Array,
3508
+ default: () => []
3509
+ },
3510
+ period: {
3511
+ type: Object,
3512
+ required: true
3513
+ },
3514
+ modeProp: {
3515
+ type: String,
3516
+ default: "week"
3517
+ },
3518
+ time: {
3519
+ type: Object,
3520
+ required: true
3521
+ }
3522
+ },
3523
+ emits: [
3524
+ "eventWasClicked",
3525
+ "eventWasResized",
3526
+ "eventWasDragged",
3527
+ "editEvent",
3528
+ "deleteEvent",
3529
+ "intervalWasClicked",
3530
+ "dayWasClicked",
3531
+ "datetimeWasClicked"
3532
+ ],
3533
+ setup(__props, { emit: __emit }) {
3534
+ vue.useCssVars((_ctx) => ({
3535
+ "6f3e0f98": weekHeight.value
3536
+ }));
3537
+ const props2 = __props;
3538
+ const emit2 = __emit;
3539
+ const eventPosition = new EventPosition();
3540
+ const days = vue.ref([]);
3541
+ const mode = vue.ref(props2.modeProp);
3542
+ const selectedEvent = vue.ref(null);
3543
+ const selectedEventElement = vue.ref(null);
3544
+ const events = vue.ref(props2.eventsProp);
3545
+ const fullDayEvents = vue.ref([]);
3546
+ const weekVersion = vue.ref(0);
3547
+ const dayIntervals = vue.ref({
3548
+ length: 60,
3549
+ height: 66
3550
+ });
3551
+ const weekHeight = vue.ref("1584px");
3552
+ const currentTimePercentage = vue.ref(0);
3553
+ const showCurrentTime = vue.ref(!!props2.config.showCurrentTime);
3554
+ const hasCustomCurrentTimeSlot = vue.computed(() => {
3555
+ return Helpers.hasSlotContent(vue.useSlots().customCurrentTime);
3556
+ });
3557
+ const nDays = vue.computed(() => {
3558
+ var _a2;
3559
+ return ((_a2 = props2.config.week) == null ? void 0 : _a2.nDays) || 7;
3560
+ });
3561
+ vue.watch(() => props2.period, () => {
3562
+ setInitialEvents(mode.value);
3563
+ }, { deep: true });
3564
+ vue.watch(() => props2.modeProp, (value) => {
3565
+ mode.value = value;
3566
+ setInitialEvents(value);
3567
+ }, { deep: true });
3568
+ vue.onMounted(() => {
3569
+ setDayIntervals();
3570
+ separateFullDayEventsFromOtherEvents();
3571
+ setInitialEvents(props2.modeProp);
3572
+ if (props2.config.showCurrentTime || hasCustomCurrentTimeSlot.value) setCurrentTime();
3573
+ });
3574
+ function separateFullDayEventsFromOtherEvents() {
3575
+ const {
3576
+ singleDayTimedEvents,
3577
+ fullDayAndMultipleDayEvents
3578
+ } = WeekHelper.eventSeparator(events.value, props2.time);
3579
+ events.value = singleDayTimedEvents;
3580
+ positionFullDayEvents(fullDayAndMultipleDayEvents);
3581
+ }
3582
+ function positionFullDayEvents(fullDayAndMultipleDayEvents) {
3583
+ const weekEndDate = nDays.value === 5 ? new Date(
3584
+ props2.period.end.getFullYear(),
3585
+ props2.period.end.getMonth(),
3586
+ props2.period.end.getDate() - 2
3587
+ ) : props2.period.end;
3588
+ fullDayEvents.value = fullDayAndMultipleDayEvents.length ? eventPosition.positionFullDayEventsInWeek(
3589
+ props2.period.start,
3590
+ weekEndDate,
3591
+ fullDayAndMultipleDayEvents
3592
+ ) : [];
3593
+ }
3594
+ function setDays() {
3595
+ const daysArray = props2.time.getCalendarWeekDateObjects(props2.period.start).map((day) => {
3596
+ const dayName = props2.time.getLocalizedNameOfWeekday(day, "long");
3597
+ const dateTimeString = props2.time.getDateTimeStringFromDate(
3598
+ day,
3599
+ "start"
3600
+ );
3601
+ const dayEvents = new EventsFilter(events.value).getEventsForDay(props2.time, dateTimeString);
3602
+ return { dayName, dateTimeString, events: dayEvents };
3603
+ });
3604
+ if (nDays.value === 5 && props2.time.FIRST_DAY_OF_WEEK === WEEK_START_DAY.MONDAY) {
3605
+ daysArray.splice(5, 2);
3606
+ fullDayEvents.value.splice(5, 2);
3607
+ } else if (nDays.value === 5 && props2.time.FIRST_DAY_OF_WEEK === WEEK_START_DAY.SUNDAY) {
3608
+ daysArray.splice(6, 1);
3609
+ fullDayEvents.value.splice(6, 1);
3610
+ daysArray.splice(0, 1);
3611
+ fullDayEvents.value.splice(0, 1);
3612
+ }
3613
+ days.value = daysArray;
3614
+ }
3615
+ function mergeFullDayEventsIntoDays() {
3616
+ for (const [dayIndex] of days.value.entries()) {
3617
+ days.value[dayIndex].fullDayEvents = fullDayEvents.value[dayIndex];
3618
+ }
3619
+ }
3620
+ function setDay2() {
3621
+ const dayDateTimeString = props2.time.getDateTimeStringFromDate(
3622
+ props2.period.selectedDate
3623
+ );
3624
+ days.value = [
3625
+ {
3626
+ dayName: new Date(props2.period.selectedDate).toLocaleDateString(
3627
+ props2.time.CALENDAR_LOCALE,
3628
+ { weekday: "long" }
3629
+ ),
3630
+ dateTimeString: props2.time.getDateTimeStringFromDate(
3631
+ props2.period.selectedDate,
3632
+ "start"
3633
+ ),
3634
+ events: new EventsFilter(events.value).getEventsForDay(props2.time, dayDateTimeString)
3635
+ }
3636
+ ];
3637
+ if (!fullDayEvents.value.length) return;
3638
+ for (const day of fullDayEvents.value) {
3639
+ const dayDateString = props2.time.getDateTimeStringFromDate(day.date);
3640
+ if (dayDateString.substring(0, 11) === dayDateTimeString.substring(0, 11)) {
3641
+ fullDayEvents.value = [day];
3642
+ return;
3643
+ }
3644
+ }
3645
+ }
3646
+ function setInitialEvents(currentMode) {
3647
+ if (currentMode === "day") setDay2();
3648
+ if (currentMode === "week") setDays();
3649
+ mergeFullDayEventsIntoDays();
3650
+ }
3651
+ function handleClickOnEvent(event) {
3652
+ emit2("eventWasClicked", event);
3653
+ selectedEventElement.value = event.eventElement;
3654
+ selectedEvent.value = event.clickedEvent;
3655
+ }
3656
+ function handleEventWasDragged(event) {
3657
+ const cleanedUpEvent = event;
3658
+ delete cleanedUpEvent.totalConcurrentEvents;
3659
+ delete cleanedUpEvent.nOfPreviousConcurrentEvents;
3660
+ const filteredEvents = events.value.filter((e) => e.id !== event.id);
3661
+ events.value = [
3662
+ cleanedUpEvent,
3663
+ ...filteredEvents.map((e) => {
3664
+ delete e.nOfPreviousConcurrentEvents;
3665
+ delete e.totalConcurrentEvents;
3666
+ return e;
3667
+ })
3668
+ ];
3669
+ setInitialEvents(mode.value);
3670
+ weekVersion.value = weekVersion.value + 1;
3671
+ emit2("eventWasDragged", event);
3672
+ }
3673
+ function setDayIntervals() {
3674
+ if (props2.config.dayIntervals) {
3675
+ for (const [key, value] of Object.entries(props2.config.dayIntervals)) {
3676
+ dayIntervals.value[key] = value;
3677
+ }
3678
+ }
3679
+ setWeekHeightBasedOnIntervals();
3680
+ }
3681
+ function setWeekHeightBasedOnIntervals() {
3682
+ if (![15, 30, 60].includes(dayIntervals.value.length)) {
3683
+ dayIntervals.value.length = 60;
3684
+ dayIntervals.value.height = 66;
3685
+ console.warn(
3686
+ "The dayIntervals configuration is faulty. It has been reset to default values."
3687
+ );
3688
+ }
3689
+ let intervalMultiplier = 1;
3690
+ if (dayIntervals.value.length === 15) intervalMultiplier = 4;
3691
+ if (dayIntervals.value.length === 30) intervalMultiplier = 2;
3692
+ weekHeight.value = `${dayIntervals.value.height * intervalMultiplier * props2.time.HOURS_PER_DAY}px`;
3693
+ }
3694
+ function setCurrentTime() {
3695
+ const setTime = () => {
3696
+ const nowString = props2.time.getDateTimeStringFromDate(/* @__PURE__ */ new Date());
3697
+ const currentTimePercentage2 = props2.time.getPercentageOfDayFromDateTimeString(
3698
+ nowString,
3699
+ props2.time.DAY_START,
3700
+ props2.time.DAY_END
3701
+ );
3702
+ if (currentTimePercentage2 < 0 || currentTimePercentage2 > 100) {
3703
+ showCurrentTime.value = false;
3704
+ return;
3705
+ }
3706
+ showCurrentTime.value = true;
3707
+ currentTimePercentage2.value = currentTimePercentage2;
3708
+ };
3709
+ setTime();
3710
+ setInterval(() => {
3711
+ setTime();
3712
+ }, 6e4);
3713
+ }
3714
+ return (_ctx, _cache) => {
3715
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3716
+ vue.createVNode(WeekTimeline, {
3717
+ days: days.value,
3718
+ time: __props.time,
3719
+ "full-day-events": fullDayEvents.value,
3720
+ config: __props.config,
3721
+ mode: mode.value,
3722
+ onEventWasClicked: handleClickOnEvent,
3723
+ onDayWasClicked: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("dayWasClicked", $event))
3724
+ }, null, 8, ["days", "time", "full-day-events", "config", "mode"]),
3725
+ vue.createElementVNode("div", _hoisted_1$R, [
3726
+ !__props.config.eventDialog || !__props.config.eventDialog.isDisabled ? (vue.openBlock(), vue.createBlock(_sfc_main$1c, {
3727
+ key: 0,
3728
+ "calendar-event-prop": selectedEvent.value,
3729
+ "event-element": selectedEventElement.value,
3730
+ time: __props.time,
3731
+ config: __props.config,
3732
+ onHide: _cache[1] || (_cache[1] = ($event) => selectedEvent.value = null),
3733
+ onEditEvent: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("editEvent", $event)),
3734
+ onDeleteEvent: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("deleteEvent", $event))
3735
+ }, {
3736
+ default: vue.withCtx((p2) => [
3737
+ vue.renderSlot(_ctx.$slots, "eventDialog", {
3738
+ eventDialogData: p2.eventDialogData,
3739
+ closeEventDialog: p2.closeEventDialog
3740
+ }, void 0, true)
3741
+ ]),
3742
+ _: 3
3743
+ }, 8, ["calendar-event-prop", "event-element", "time", "config"])) : vue.createCommentVNode("", true),
3744
+ vue.createElementVNode("section", _hoisted_2$C, [
3745
+ hasCustomCurrentTimeSlot.value && showCurrentTime.value ? (vue.openBlock(), vue.createElementBlock("div", {
3746
+ key: 0,
3747
+ class: "custom-current-time",
3748
+ style: vue.normalizeStyle({ top: `${currentTimePercentage.value}%` })
3749
+ }, [
3750
+ vue.renderSlot(_ctx.$slots, "customCurrentTime", {}, void 0, true)
3751
+ ], 4)) : __props.config && __props.config.showCurrentTime && showCurrentTime.value ? (vue.openBlock(), vue.createElementBlock("div", {
3752
+ key: 1,
3753
+ class: "current-time-line",
3754
+ style: vue.normalizeStyle({ top: `${currentTimePercentage.value}%` })
3755
+ }, _cache[8] || (_cache[8] = [
3756
+ vue.createElementVNode("div", { class: "current-time-line__circle" }, null, -1)
3757
+ ]), 4)) : vue.createCommentVNode("", true),
3758
+ (vue.openBlock(), vue.createBlock(DayTimeline, {
3759
+ key: __props.period.start.getTime() + __props.period.end.getTime() + mode.value,
3760
+ time: __props.time,
3761
+ "day-intervals": dayIntervals.value,
3762
+ "week-height": weekHeight.value
3763
+ }, null, 8, ["time", "day-intervals", "week-height"])),
3764
+ vue.createElementVNode("div", _hoisted_3$u, [
3765
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(days.value, (day, dayIndex) => {
3766
+ return vue.openBlock(), vue.createBlock(Day, {
3767
+ key: day.dateTimeString + mode.value + weekVersion.value,
3768
+ day,
3769
+ time: __props.time,
3770
+ config: __props.config,
3771
+ "day-info": { daysTotalN: days.value.length, thisDayIndex: dayIndex, dateTimeString: day.dateTimeString },
3772
+ mode: mode.value,
3773
+ "day-intervals": dayIntervals.value,
3774
+ "week-height": +weekHeight.value.replace("px", ""),
3775
+ onEventWasClicked: handleClickOnEvent,
3776
+ onEventWasResized: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("eventWasResized", $event)),
3777
+ onEventWasDragged: handleEventWasDragged,
3778
+ onIntervalWasClicked: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("intervalWasClicked", $event)),
3779
+ onDayWasClicked: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("dayWasClicked", $event)),
3780
+ onDatetimeWasClicked: _cache[7] || (_cache[7] = ($event) => _ctx.$emit("datetimeWasClicked", $event))
3781
+ }, {
3782
+ weekDayEvent: vue.withCtx((p2) => [
3783
+ vue.renderSlot(_ctx.$slots, "weekDayEvent", {
3784
+ eventData: p2.eventData
3785
+ }, void 0, true)
3786
+ ]),
3787
+ _: 2
3788
+ }, 1032, ["day", "time", "config", "day-info", "mode", "day-intervals", "week-height"]);
3789
+ }), 128))
3790
+ ])
3791
+ ])
3792
+ ])
3793
+ ], 64);
3794
+ };
3795
+ }
3796
+ });
3797
+ const Week = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-21b8e443"]]);
3798
+ const _Errors = class _Errors {
3799
+ static checkEventProperties(event) {
3800
+ var _a2, _b, _c, _d;
3801
+ if (!event.id) console.warn(this.MISSING_ID_WARNING);
3802
+ if (!event.title) console.warn(this.MISSING_TITLE_WARNING);
3803
+ if (!event.time) console.warn(this.MISSING_TIME_WARNING);
3804
+ if (!((_a2 = event.time) == null ? void 0 : _a2.start)) console.warn(this.MISSING_TIME_START_WARNING);
3805
+ if (!((_b = event.time) == null ? void 0 : _b.end)) console.warn(this.MISSING_TIME_END_WARNING);
3806
+ if (((_c = event.time) == null ? void 0 : _c.start) && event.time.end && !DATE_TIME_STRING_PATTERN.test(event.time.start) && !DATE_TIME_STRING_FULL_DAY_PATTERN.test(event.time.start)) {
3807
+ console.warn(
3808
+ `${this.PREFIX} event property 'time.start' expects a string formatted like 'YYYY-MM-DD hh:mm', or 'YYYY-MM-DD', received ${event.time.start}
3809
+ ${this.SUFFIX}`
3810
+ );
3811
+ }
3812
+ if (((_d = event.time) == null ? void 0 : _d.start) && event.time.end && !DATE_TIME_STRING_PATTERN.test(event.time.end) && !DATE_TIME_STRING_FULL_DAY_PATTERN.test(event.time.end)) {
3813
+ console.warn(
3814
+ `${this.PREFIX} event property 'time.end' expects a string formatted like 'YYYY-MM-DD hh:mm', or 'YYYY-MM-DD', received ${event.time.end}
3815
+ ${this.SUFFIX}`
3816
+ );
3817
+ }
3818
+ }
3819
+ static checkConfig(config) {
3820
+ if (config.locale && !/^[a-z]{2}-[A-Z]{2}$/.test(config.locale)) {
3821
+ console.warn(
3822
+ `${this.PREFIX} config.locale expects a string of format xx-XX, received: ${config.locale}`
3823
+ );
3824
+ }
3825
+ if (config.defaultMode && !["month", "week", "day"].includes(config.defaultMode)) {
3826
+ console.warn(
3827
+ `${this.PREFIX} config.defaultMode expects either one of the values "day", "week" or "month"`
3828
+ );
3829
+ }
3830
+ }
3831
+ };
3832
+ __publicField(_Errors, "PREFIX", "[Qalendar warning]");
3833
+ // public static SUFFIX = 'This is a development warning, which will never be displayed in production environments'
3834
+ __publicField(_Errors, "SUFFIX", "");
3835
+ __publicField(_Errors, "MISSING_ID_WARNING", `${_Errors.PREFIX} required event property 'id' is missing
3836
+ ${_Errors.SUFFIX}`);
3837
+ __publicField(_Errors, "MISSING_TITLE_WARNING", `${_Errors.PREFIX} required event property 'title' is missing
3838
+ ${_Errors.SUFFIX}`);
3839
+ __publicField(_Errors, "MISSING_TIME_WARNING", `${_Errors.PREFIX} required event property 'time' is missing
3840
+ ${_Errors.SUFFIX}`);
3841
+ __publicField(_Errors, "MISSING_TIME_START_WARNING", `${_Errors.PREFIX} required event property 'time.start' is missing
3842
+ ${_Errors.SUFFIX}`);
3843
+ __publicField(_Errors, "MISSING_TIME_END_WARNING", `${_Errors.PREFIX} required event property 'time.end' is missing
3844
+ ${_Errors.SUFFIX}`);
3845
+ let Errors = _Errors;
3846
+ const _hoisted_1$Q = { class: "calendar-root-wrapper" };
3847
+ const _hoisted_2$B = ["data-lang"];
3848
+ const _hoisted_3$t = {
3849
+ key: 0,
3850
+ class: "top-bar-loader"
3851
+ };
3852
+ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
3853
+ __name: "Index",
3854
+ props: {
3855
+ config: {
3856
+ type: Object,
3857
+ default: () => ({})
3858
+ },
3859
+ events: {
3860
+ type: Array,
3861
+ default: () => []
3862
+ },
3863
+ selectedDate: {
3864
+ type: Date,
3865
+ default: /* @__PURE__ */ new Date()
3866
+ },
3867
+ isLoading: {
3868
+ type: Boolean,
3869
+ default: false
3870
+ }
3871
+ },
3872
+ emits: [
3873
+ "eventWasClicked",
3874
+ "eventWasResized",
3875
+ "eventWasDragged",
3876
+ "updatedPeriod",
3877
+ "updatedMode",
3878
+ "editEvent",
3879
+ "deleteEvent",
3880
+ "intervalWasClicked",
3881
+ "dayWasClicked",
3882
+ // TODO: remove with v4. day-was-clicked is deprecated
3883
+ "dateWasClicked",
3884
+ "datetimeWasClicked"
3885
+ ],
3886
+ setup(__props, { emit: __emit }) {
3887
+ var _a2, _b, _c;
3888
+ const props2 = __props;
3889
+ const emit2 = __emit;
3890
+ const wasInitialized = vue.ref(0);
3891
+ const period = vue.ref({
3892
+ start: /* @__PURE__ */ new Date(),
3893
+ end: /* @__PURE__ */ new Date(),
3894
+ selectedDate: props2.selectedDate
3895
+ });
3896
+ const mode = vue.ref(props2.config.defaultMode || "week");
3897
+ const time = vue.ref(new Time((_a2 = props2.config.week) == null ? void 0 : _a2.startsOn, props2.config.locale || null, {
3898
+ start: setTimePointsFromDayBoundary(((_b = props2.config.dayBoundaries) == null ? void 0 : _b.start) || 0),
3899
+ end: setTimePointsFromDayBoundary(((_c = props2.config.dayBoundaries) == null ? void 0 : _c.end) || 24)
3900
+ }));
3901
+ vue.computed(() => {
3902
+ var _a3;
3903
+ return ((_a3 = props2.config.style) == null ? void 0 : _a3.fontFamily) || "'Verdana', 'Open Sans', serif";
3904
+ });
3905
+ const eventRenderingKey = vue.ref(0);
3906
+ const eventsDataProperty = vue.ref(props2.events);
3907
+ const isSmall = vue.ref(false);
3908
+ const ErrorsHelper = Errors;
3909
+ const appHeaderRef = vue.ref();
3910
+ const enhancedConfig = vue.computed(() => {
3911
+ return { ...props2.config, isSmall: isSmall.value };
3912
+ });
3913
+ vue.watch(() => props2.events, (newVal, oldVal) => {
3914
+ if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
3915
+ eventsDataProperty.value = newVal;
3916
+ eventRenderingKey.value = eventRenderingKey.value + 1;
3917
+ }
3918
+ if (props2.config.isSilent) return;
3919
+ props2.events.forEach((e) => {
3920
+ ErrorsHelper.checkEventProperties(e);
3921
+ });
3922
+ }, { deep: true, immediate: true });
3923
+ vue.watch(() => props2.config, (value) => {
3924
+ ErrorsHelper.checkConfig(value);
3925
+ }, { deep: true, immediate: true });
3926
+ vue.onMounted(() => {
3927
+ setConfigOnMount();
3928
+ onCalendarResize();
3929
+ setPeriodOnMount();
3930
+ window.addEventListener("resize", onCalendarResize);
3931
+ });
3932
+ vue.onBeforeUnmount(() => {
3933
+ window.removeEventListener("resize", onCalendarResize);
3934
+ });
3935
+ function setConfigOnMount() {
3936
+ wasInitialized.value = 1;
3937
+ }
3938
+ function handleUpdatedPeriod(value, leaveMonthMode = false) {
3939
+ emit2("updatedPeriod", { start: value.start, end: value.end });
3940
+ period.value = value;
3941
+ if (leaveMonthMode) mode.value = "day";
3942
+ }
3943
+ function handleChangeMode(payload) {
3944
+ if (payload === "day") {
3945
+ period.value.start = period.value.selectedDate;
3946
+ period.value.end = time.value.setDateToEndOfDay(period.value.selectedDate);
3947
+ }
3948
+ if (payload === "week") {
3949
+ const week = time.value.getCalendarWeekDateObjects(period.value.selectedDate);
3950
+ period.value.start = week[0];
3951
+ period.value.end = time.value.setDateToEndOfDay(week[6]);
3952
+ }
3953
+ if (payload === "month") {
3954
+ const month = time.value.getCalendarMonthSplitInWeeks(
3955
+ period.value.selectedDate.getFullYear(),
3956
+ period.value.selectedDate.getMonth()
3957
+ );
3958
+ period.value.start = month[0][0];
3959
+ const lastWeek = month[month.length - 1];
3960
+ period.value.end = time.value.setDateToEndOfDay(lastWeek[lastWeek.length - 1]);
3961
+ }
3962
+ mode.value = payload;
3963
+ emit2("updatedMode", { mode: payload, period: period.value });
3964
+ }
3965
+ const calendarRoot = vue.ref();
3966
+ function onCalendarResize() {
3967
+ const documentRoot = document.documentElement;
3968
+ const documentFontSize = +window.getComputedStyle(documentRoot).fontSize.split("p")[0];
3969
+ const breakPointFor1RemEquals16px = 700;
3970
+ const multiplier = 16 / documentFontSize;
3971
+ const smallCalendarBreakpoint = breakPointFor1RemEquals16px / multiplier;
3972
+ if (!calendarRoot.value) return;
3973
+ isSmall.value = calendarRoot.value.clientWidth < smallCalendarBreakpoint;
3974
+ if (isSmall.value && !["day", "month"].includes(mode.value)) {
3975
+ mode.value = "day";
3976
+ }
3977
+ }
3978
+ function setPeriodOnMount() {
3979
+ if (mode.value === "week") {
3980
+ const currentWeek = time.value.getCalendarWeekDateObjects(period.value.selectedDate);
3981
+ period.value.start = currentWeek[0];
3982
+ period.value.end = currentWeek[6];
3983
+ } else if (mode.value === "month") {
3984
+ const month = time.value.getCalendarMonthSplitInWeeks(
3985
+ period.value.selectedDate.getFullYear(),
3986
+ period.value.selectedDate.getMonth()
3987
+ );
3988
+ period.value.start = month[0][0];
3989
+ const lastWeek = month[month.length - 1];
3990
+ period.value.end = lastWeek[lastWeek.length - 1];
3991
+ }
3992
+ }
3993
+ function handleEventWasUpdated(calendarEvent, eventType) {
3994
+ const newEvents = eventsDataProperty.value.filter(
3995
+ (e) => e.id !== calendarEvent.id
3996
+ );
3997
+ eventsDataProperty.value = [calendarEvent, ...newEvents];
3998
+ emit2(eventType === "dragged" ? "eventWasDragged" : "eventWasResized", calendarEvent);
3999
+ }
4000
+ function setTimePointsFromDayBoundary(boundary) {
4001
+ return Time.getTimePointsFromHour(boundary);
4002
+ }
4003
+ const day = vue.computed(() => {
4004
+ return {
4005
+ dayName: time.value.getLocalizedNameOfWeekday(period.value.selectedDate, "long"),
4006
+ dateTimeString: period.value.selectedDate.toLocaleDateString("en-US", {
4007
+ day: "2-digit",
4008
+ month: "2-digit",
4009
+ year: "numeric"
4010
+ }),
4011
+ events: eventsDataProperty.value.filter((e) => {
4012
+ const eventDate = new Date(e.time.start);
4013
+ return eventDate >= period.value.start && eventDate <= period.value.end;
4014
+ }),
4015
+ fullDayEvents: {
4016
+ date: period.value.selectedDate,
4017
+ events: eventsDataProperty.value.filter((e) => {
4018
+ const eventDate = new Date(e.time.start);
4019
+ return eventDate >= period.value.start && eventDate <= period.value.end;
4020
+ })
4021
+ }
4022
+ };
4023
+ });
4024
+ function handleDateWasClicked(payload) {
4025
+ emit2("dayWasClicked", payload);
4026
+ emit2("dateWasClicked", payload);
4027
+ }
4028
+ return (_ctx, _cache) => {
4029
+ var _a3, _b2;
4030
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Q, [
4031
+ vue.createElementVNode("div", {
4032
+ ref_key: "calendarRoot",
4033
+ ref: calendarRoot,
4034
+ class: vue.normalizeClass(["calendar-root", {
4035
+ "mode-is-day": mode.value === "day",
4036
+ "mode-is-week": mode.value === "week",
4037
+ "mode-is-month": mode.value === "month",
4038
+ "qalendar-is-small": isSmall.value
4039
+ }]),
4040
+ "data-lang": ((_b2 = (_a3 = __props.config) == null ? void 0 : _a3.locale) == null ? void 0 : _b2.substring(0, 2)) || "en"
4041
+ }, [
4042
+ vue.createVNode(vue.Transition, { name: "loading" }, {
4043
+ default: vue.withCtx(() => [
4044
+ __props.isLoading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$t)) : vue.createCommentVNode("", true)
4045
+ ]),
4046
+ _: 1
4047
+ }),
4048
+ (vue.openBlock(), vue.createBlock(AppHeader, {
4049
+ ref_key: "appHeaderRef",
4050
+ ref: appHeaderRef,
4051
+ key: wasInitialized.value + mode.value,
4052
+ config: __props.config,
4053
+ mode: mode.value,
4054
+ time: time.value,
4055
+ period: period.value,
4056
+ "is-small": isSmall.value,
4057
+ onChangeMode: handleChangeMode,
4058
+ onUpdatedPeriod: handleUpdatedPeriod
4059
+ }, null, 8, ["config", "mode", "time", "period", "is-small"])),
4060
+ mode.value === "agenda" ? (vue.openBlock(), vue.createBlock(AgendaEvents, {
4061
+ key: 0,
4062
+ "events-prop": eventsDataProperty.value,
4063
+ period: period.value,
4064
+ config: __props.config,
4065
+ time: time.value,
4066
+ day: vue.unref(day)
4067
+ }, null, 8, ["events-prop", "period", "config", "time", "day"])) : vue.createCommentVNode("", true),
4068
+ ["week", "day"].includes(mode.value) ? (vue.openBlock(), vue.createBlock(Week, {
4069
+ key: period.value.start.getTime() + period.value.end.getTime() + eventRenderingKey.value,
4070
+ "events-prop": eventsDataProperty.value,
4071
+ period: period.value,
4072
+ config: __props.config,
4073
+ "mode-prop": mode.value,
4074
+ time: time.value,
4075
+ onEventWasClicked: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("eventWasClicked", $event)),
4076
+ onEventWasResized: _cache[1] || (_cache[1] = ($event) => handleEventWasUpdated($event, "resized")),
4077
+ onEventWasDragged: _cache[2] || (_cache[2] = ($event) => handleEventWasUpdated($event, "dragged")),
4078
+ onEditEvent: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("editEvent", $event)),
4079
+ onDeleteEvent: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("deleteEvent", $event)),
4080
+ onIntervalWasClicked: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("intervalWasClicked", $event)),
4081
+ onDayWasClicked: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("dayWasClicked", $event)),
4082
+ onDatetimeWasClicked: _cache[7] || (_cache[7] = ($event) => _ctx.$emit("datetimeWasClicked", $event))
4083
+ }, {
4084
+ weekDayEvent: vue.withCtx((p2) => [
4085
+ vue.renderSlot(_ctx.$slots, "weekDayEvent", {
4086
+ eventData: p2.eventData
4087
+ })
4088
+ ]),
4089
+ eventDialog: vue.withCtx((p2) => [
4090
+ vue.renderSlot(_ctx.$slots, "eventDialog", {
4091
+ eventDialogData: p2.eventDialogData,
4092
+ closeEventDialog: p2.closeEventDialog
4093
+ })
4094
+ ]),
4095
+ customCurrentTime: vue.withCtx(() => [
4096
+ vue.renderSlot(_ctx.$slots, "customCurrentTime")
4097
+ ]),
4098
+ _: 3
4099
+ }, 8, ["events-prop", "period", "config", "mode-prop", "time"])) : vue.createCommentVNode("", true),
4100
+ mode.value === "month" ? (vue.openBlock(), vue.createBlock(_sfc_main$16, {
4101
+ key: period.value.start.getTime() + period.value.end.getTime() + eventRenderingKey.value,
4102
+ "events-prop": eventsDataProperty.value,
4103
+ time: time.value,
4104
+ config: enhancedConfig.value,
4105
+ period: period.value,
4106
+ onEventWasClicked: _cache[8] || (_cache[8] = ($event) => _ctx.$emit("eventWasClicked", $event)),
4107
+ onDateWasClicked: handleDateWasClicked,
4108
+ onEventWasDragged: _cache[9] || (_cache[9] = ($event) => handleEventWasUpdated($event, "dragged")),
4109
+ onUpdatedPeriod: _cache[10] || (_cache[10] = ($event) => handleUpdatedPeriod($event, true)),
4110
+ onEditEvent: _cache[11] || (_cache[11] = ($event) => _ctx.$emit("editEvent", $event)),
4111
+ onDeleteEvent: _cache[12] || (_cache[12] = ($event) => _ctx.$emit("deleteEvent", $event))
4112
+ }, {
4113
+ eventDialog: vue.withCtx((p2) => [
4114
+ vue.renderSlot(_ctx.$slots, "eventDialog", {
4115
+ eventDialogData: p2.eventDialogData,
4116
+ closeEventDialog: p2.closeEventDialog
4117
+ })
4118
+ ]),
4119
+ monthEvent: vue.withCtx((p2) => [
4120
+ vue.renderSlot(_ctx.$slots, "monthEvent", {
4121
+ eventData: p2.eventData
4122
+ })
4123
+ ]),
4124
+ dayCell: vue.withCtx(({ dayData }) => [
4125
+ vue.renderSlot(_ctx.$slots, "dayCell", { dayData })
4126
+ ]),
4127
+ _: 3
4128
+ }, 8, ["events-prop", "time", "config", "period"])) : vue.createCommentVNode("", true)
4129
+ ], 10, _hoisted_2$B)
4130
+ ]);
4131
+ };
4132
+ }
4133
+ });
680
4134
  const _hoisted_1$P = {
681
4135
  key: 0,
682
4136
  class: "card_label"
@@ -5506,21 +8960,21 @@ function styleInject(css2, ref) {
5506
8960
  return;
5507
8961
  }
5508
8962
  var head = document.head || document.getElementsByTagName("head")[0];
5509
- var style2 = document.createElement("style");
5510
- style2.type = "text/css";
8963
+ var style = document.createElement("style");
8964
+ style.type = "text/css";
5511
8965
  if (insertAt === "top") {
5512
8966
  if (head.firstChild) {
5513
- head.insertBefore(style2, head.firstChild);
8967
+ head.insertBefore(style, head.firstChild);
5514
8968
  } else {
5515
- head.appendChild(style2);
8969
+ head.appendChild(style);
5516
8970
  }
5517
8971
  } else {
5518
- head.appendChild(style2);
8972
+ head.appendChild(style);
5519
8973
  }
5520
- if (style2.styleSheet) {
5521
- style2.styleSheet.cssText = css2;
8974
+ if (style.styleSheet) {
8975
+ style.styleSheet.cssText = css2;
5522
8976
  } else {
5523
- style2.appendChild(document.createTextNode(css2));
8977
+ style.appendChild(document.createTextNode(css2));
5524
8978
  }
5525
8979
  }
5526
8980
  var css_248z$1 = "\n.chart {\n position: relative;\n}\n";
@@ -5694,8 +9148,8 @@ var script$9 = vue.defineComponent({
5694
9148
  }
5695
9149
  function computeDotStyle(active) {
5696
9150
  const dotStyle = props2.dotStyle;
5697
- const style2 = getStyle.value();
5698
- return Object.assign({ r: active ? 5 : 3, stroke: style2.stroke, strokeWidth: style2.strokeWidth, fill: "white" }, dotStyle);
9151
+ const style = getStyle.value();
9152
+ return Object.assign({ r: active ? 5 : 3, stroke: style.stroke, strokeWidth: style.strokeWidth, fill: "white" }, dotStyle);
5699
9153
  }
5700
9154
  const getStyle = vue.computed(() => {
5701
9155
  if (is$1(Function, props2.lineStyle)) {
@@ -5898,11 +9352,11 @@ var script$7 = vue.defineComponent({
5898
9352
  const getStyle = vue.computed(() => {
5899
9353
  return () => Object.assign({ colors: ["#4daf4a", "#377eb8", "#ff7f00", "#984ea3", "#e41a1c"], innerRadius: 2, cornerRadius: 0, padAngle: 0.01 }, props2.pieStyle);
5900
9354
  });
5901
- const style2 = getStyle.value();
9355
+ const style = getStyle.value();
5902
9356
  const arcs = vue.ref([]);
5903
9357
  const colors = ordinal(getStyle.value().colors);
5904
9358
  const arcGen = () => {
5905
- return arc().outerRadius(size2.value).innerRadius(style2.innerRadius).cornerRadius(style2.cornerRadius).padAngle(style2.padAngle);
9359
+ return arc().outerRadius(size2.value).innerRadius(style.innerRadius).cornerRadius(style.cornerRadius).padAngle(style.padAngle);
5906
9360
  };
5907
9361
  const transform = vue.ref(`translate(${size2.value + chart.canvas.x}, ${size2.value + chart.canvas.y})`);
5908
9362
  let pieSort;
@@ -6185,7 +9639,7 @@ var script$4 = vue.defineComponent({
6185
9639
  const isRight = vue.computed(() => {
6186
9640
  return position.value.x >= canvas.value.width / 4 * 3;
6187
9641
  });
6188
- const style2 = vue.computed(() => {
9642
+ const style = vue.computed(() => {
6189
9643
  if (direction.value === "vertical") {
6190
9644
  return {
6191
9645
  top: position.value.y - 0.5 + "px",
@@ -6241,7 +9695,7 @@ var script$4 = vue.defineComponent({
6241
9695
  direction.value = chart.config.direction;
6242
9696
  canvas.value = chart.canvas;
6243
9697
  });
6244
- return { el, show, canvas, direction, style: style2, styleContent, position, items, isRight };
9698
+ return { el, show, canvas, direction, style, styleContent, position, items, isRight };
6245
9699
  }
6246
9700
  });
6247
9701
  const _hoisted_1$3$1 = { key: 0 };
@@ -6981,16 +10435,16 @@ var script$1 = vue.defineComponent({
6981
10435
  }
6982
10436
  const toKebabCase = (data3) => mapKeys(kebabize, data3);
6983
10437
  const getStyle = (r2) => {
6984
- const style2 = {
10438
+ const style = {
6985
10439
  stroke: r2.color,
6986
10440
  strokeWidth: 5,
6987
10441
  fill: r2.color,
6988
10442
  fillOpacity: 0.9
6989
10443
  };
6990
10444
  if (props2.rcStyle && typeof props2.rcStyle === "function") {
6991
- return Object.assign(Object.assign({}, style2), props2.rcStyle(r2));
10445
+ return Object.assign(Object.assign({}, style), props2.rcStyle(r2));
6992
10446
  }
6993
- return style2;
10447
+ return style;
6994
10448
  };
6995
10449
  function onMouseOver(i2) {
6996
10450
  selected.value = i2;
@@ -8208,7 +11662,7 @@ const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
8208
11662
  emits: /* @__PURE__ */ vue.mergeModels(["update:selectedItems", "orderBy", "select", "lastItemVisible"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
8209
11663
  setup(__props, { emit: __emit }) {
8210
11664
  vue.useCssVars((_ctx) => ({
8211
- "0c6a620a": vue.unref(computedItemHeight)
11665
+ "3ee4947a": vue.unref(computedItemHeight)
8212
11666
  }));
8213
11667
  const props2 = __props;
8214
11668
  const emit2 = __emit;
@@ -8387,13 +11841,29 @@ const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
8387
11841
  };
8388
11842
  }
8389
11843
  });
8390
- const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-a1cf8002"]]);
11844
+ const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-3668ec69"]]);
8391
11845
  function useDraggable(options = {}) {
8392
11846
  const isDragging = vue.ref(false);
8393
11847
  const dragElement = vue.ref(null);
8394
11848
  const ghostElement = vue.ref(null);
8395
11849
  const dropIndicator = vue.ref(null);
8396
11850
  const dropTarget = vue.ref(null);
11851
+ const isBrowser = typeof window !== "undefined";
11852
+ if (isBrowser) {
11853
+ const existingStyle = document.getElementById("draggable-style");
11854
+ if (!existingStyle) {
11855
+ const style = document.createElement("style");
11856
+ style.id = "draggable-style";
11857
+ style.textContent = `
11858
+ .draggable-ghost {
11859
+ opacity: 0.5;
11860
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
11861
+ transition: transform 0.1s;
11862
+ }
11863
+ `;
11864
+ document.head.appendChild(style);
11865
+ }
11866
+ }
8397
11867
  const defaultOptions2 = {
8398
11868
  animation: 150,
8399
11869
  mode: "line",
@@ -8414,6 +11884,7 @@ function useDraggable(options = {}) {
8414
11884
  const UPDATE_THRESHOLD = 150;
8415
11885
  const POSITION_CACHE = /* @__PURE__ */ new Map();
8416
11886
  function createGhost(el) {
11887
+ if (!isBrowser) return null;
8417
11888
  const ghost = el.cloneNode(true);
8418
11889
  const rect = el.getBoundingClientRect();
8419
11890
  ghost.style.position = "fixed";
@@ -8432,6 +11903,7 @@ function useDraggable(options = {}) {
8432
11903
  return ghost;
8433
11904
  }
8434
11905
  function createDropIndicator(el) {
11906
+ if (!isBrowser) return null;
8435
11907
  const line2 = document.createElement("div");
8436
11908
  line2.classList.add(defaultOptions2.dropIndicatorClass);
8437
11909
  line2.style.position = "fixed";
@@ -8527,6 +11999,7 @@ function useDraggable(options = {}) {
8527
11999
  return dropIndex;
8528
12000
  }
8529
12001
  function cleanup() {
12002
+ if (!isBrowser) return;
8530
12003
  document.removeEventListener("mousemove", onDragMove);
8531
12004
  document.removeEventListener("mouseup", onDragEnd);
8532
12005
  document.removeEventListener("keydown", onKeyDown);
@@ -8563,9 +12036,11 @@ function useDraggable(options = {}) {
8563
12036
  }
8564
12037
  isDragging.value = false;
8565
12038
  dropTarget.value = null;
8566
- document.body.style.userSelect = "";
8567
- document.body.style.webkitUserSelect = "";
8568
- document.body.style.cursor = "";
12039
+ if (isBrowser) {
12040
+ document.body.style.userSelect = "";
12041
+ document.body.style.webkitUserSelect = "";
12042
+ document.body.style.cursor = "";
12043
+ }
8569
12044
  if (scrollRAF) {
8570
12045
  cancelAnimationFrame(scrollRAF);
8571
12046
  scrollRAF = null;
@@ -8581,7 +12056,7 @@ function useDraggable(options = {}) {
8581
12056
  }
8582
12057
  function onDragStart(e) {
8583
12058
  var _a2;
8584
- if (defaultOptions2.disabled) return;
12059
+ if (!isBrowser || defaultOptions2.disabled) return;
8585
12060
  if (e.button !== 0) return;
8586
12061
  if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;
8587
12062
  const dragEl2 = findDraggableParent(e.target);
@@ -8609,13 +12084,15 @@ function useDraggable(options = {}) {
8609
12084
  dragEl2.classList.add(defaultOptions2.dragClass);
8610
12085
  shiftAmount = defaultOptions2.mode === "ghost" ? handleGhostMode(dragEl2) : handleLineMode(dragEl2);
8611
12086
  (_a2 = defaultOptions2.onStart) == null ? void 0 : _a2.call(defaultOptions2, e);
8612
- document.body.style.userSelect = "none";
8613
- document.body.style.webkitUserSelect = "none";
8614
- document.body.style.cursor = "grabbing";
8615
- window.addEventListener("blur", cleanup);
8616
- document.addEventListener("mousemove", onDragMove);
8617
- document.addEventListener("mouseup", onDragEnd);
8618
- document.addEventListener("keydown", onKeyDown);
12087
+ if (isBrowser) {
12088
+ document.body.style.userSelect = "none";
12089
+ document.body.style.webkitUserSelect = "none";
12090
+ document.body.style.cursor = "grabbing";
12091
+ window.addEventListener("blur", cleanup);
12092
+ document.addEventListener("mousemove", onDragMove);
12093
+ document.addEventListener("mouseup", onDragEnd);
12094
+ document.addEventListener("keydown", onKeyDown);
12095
+ }
8619
12096
  }
8620
12097
  function findScrollParent(element) {
8621
12098
  let parent = element.parentElement;
@@ -8728,7 +12205,7 @@ function useDraggable(options = {}) {
8728
12205
  }
8729
12206
  function onTouchStart(e) {
8730
12207
  var _a2;
8731
- if (defaultOptions2.disabled || !e.target) return;
12208
+ if (!isBrowser || defaultOptions2.disabled || !e.target) return;
8732
12209
  const touch = e.touches[0];
8733
12210
  if (!touch) return;
8734
12211
  const target = e.target;
@@ -8755,13 +12232,15 @@ function useDraggable(options = {}) {
8755
12232
  dragElement.value.classList.add(defaultOptions2.dragClass);
8756
12233
  shiftAmount = defaultOptions2.mode === "ghost" ? handleGhostMode(dragElement.value) : handleLineMode(dragElement.value);
8757
12234
  (_a2 = defaultOptions2.onStart) == null ? void 0 : _a2.call(defaultOptions2, e);
8758
- document.body.style.userSelect = "none";
8759
- document.body.style.webkitUserSelect = "none";
8760
- document.body.style.cursor = "grabbing";
8761
- window.addEventListener("blur", cleanup);
8762
- document.addEventListener("touchmove", onTouchMove, { passive: false });
8763
- document.addEventListener("touchend", onTouchEnd);
8764
- document.addEventListener("touchcancel", onTouchEnd);
12235
+ if (isBrowser) {
12236
+ document.body.style.userSelect = "none";
12237
+ document.body.style.webkitUserSelect = "none";
12238
+ document.body.style.cursor = "grabbing";
12239
+ window.addEventListener("blur", cleanup);
12240
+ document.addEventListener("touchmove", onTouchMove, { passive: false });
12241
+ document.addEventListener("touchend", onTouchEnd);
12242
+ document.addEventListener("touchcancel", onTouchEnd);
12243
+ }
8765
12244
  }
8766
12245
  function onTouchMove(e) {
8767
12246
  e.preventDefault();
@@ -8789,6 +12268,7 @@ function useDraggable(options = {}) {
8789
12268
  document.removeEventListener("touchcancel", onTouchEnd);
8790
12269
  }
8791
12270
  function initDraggableContainer(container) {
12271
+ if (!isBrowser) return;
8792
12272
  cleanupFn == null ? void 0 : cleanupFn();
8793
12273
  isDragging.value = false;
8794
12274
  dragElement.value = null;
@@ -8836,16 +12316,6 @@ function useDraggable(options = {}) {
8836
12316
  initDraggableContainer
8837
12317
  };
8838
12318
  }
8839
- const style = document.createElement("style");
8840
- style.textContent = `
8841
- .draggable-ghost {
8842
- opacity: 0.5;
8843
- box-shadow: 0 2px 10px rgba(0,0,0,0.1);
8844
- transition: transform 0.1s;
8845
-
8846
- }
8847
- `;
8848
- document.head.appendChild(style);
8849
12319
  const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
8850
12320
  __name: "Draggable",
8851
12321
  props: {
@@ -20691,9 +24161,9 @@ const _hoisted_3$m = {
20691
24161
  class: "required"
20692
24162
  };
20693
24163
  const _hoisted_4$e = { class: "date-picker-container" };
20694
- const _hoisted_5$e = ["type", "value", "min", "max", "required", "disabled"];
24164
+ const _hoisted_5$e = ["value", "min", "max", "required", "disabled"];
20695
24165
  const _hoisted_6$a = { class: "flex gap-075 p-05 m_flex-wrap calendar-container justify-content-center h-100p" };
20696
- const _hoisted_7$7 = { class: "calendar-section border-end m_border-none pe-05 m_p-0" };
24166
+ const _hoisted_7$7 = { class: "calendar-section m_border-none pe-05 m_p-0" };
20697
24167
  const _hoisted_8$4 = { class: "flex space-between pb-1" };
20698
24168
  const _hoisted_9$3 = { class: "flex gap-05" };
20699
24169
  const _hoisted_10$3 = { class: "month-year" };
@@ -20714,7 +24184,7 @@ const _hoisted_15$2 = {
20714
24184
  const _hoisted_16$2 = ["disabled", "onClick"];
20715
24185
  const _hoisted_17$2 = {
20716
24186
  key: 0,
20717
- class: "time-picker flex column gap-1 w-120px"
24187
+ class: "time-picker border-start flex column gap-1 w-120px"
20718
24188
  };
20719
24189
  const _hoisted_18 = { class: "flex gap-025" };
20720
24190
  const _hoisted_19 = { class: "txt-center opacity-6 txt14" };
@@ -20729,7 +24199,10 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20729
24199
  modelValue: {},
20730
24200
  min: {},
20731
24201
  max: {},
20732
- timezone: { default: "UTC" }
24202
+ timezone: { default: "UTC" },
24203
+ mode: { default: "day" },
24204
+ firstDayOfWeek: { default: WEEK_START_DAY.MONDAY },
24205
+ locale: { default: "" }
20733
24206
  },
20734
24207
  emits: ["update:modelValue"],
20735
24208
  setup(__props, { emit: __emit }) {
@@ -20738,13 +24211,33 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20738
24211
  let isOpen = vue.ref(false);
20739
24212
  let currentMonth = vue.ref(/* @__PURE__ */ new Date());
20740
24213
  let currentView = vue.ref("days");
20741
- const inputType = vue.computed(() => props2.enableTime ? "datetime-local" : "date");
24214
+ const time = new Time(props2.firstDayOfWeek, props2.locale);
24215
+ function formatDisplayDate(date2) {
24216
+ if (!date2) return "";
24217
+ const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
24218
+ if (props2.enableTime) {
24219
+ return dateObj.toLocaleString(props2.locale || void 0, {
24220
+ year: "numeric",
24221
+ month: "short",
24222
+ day: "numeric",
24223
+ hour: "2-digit",
24224
+ minute: "2-digit",
24225
+ timeZone: props2.timezone
24226
+ });
24227
+ }
24228
+ return dateObj.toLocaleString(props2.locale || void 0, {
24229
+ year: "numeric",
24230
+ month: "short",
24231
+ day: "numeric",
24232
+ timeZone: props2.timezone
24233
+ });
24234
+ }
20742
24235
  function formatDate(date2) {
20743
24236
  if (!date2) return "";
20744
24237
  const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
20745
24238
  return props2.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split("T")[0];
20746
24239
  }
20747
- const formattedValue = vue.computed(() => formatDate(props2.modelValue));
24240
+ const formattedDisplayValue = vue.computed(() => formatDisplayDate(props2.modelValue));
20748
24241
  const formattedMin = vue.computed(() => formatDate(props2.min));
20749
24242
  const formattedMax = vue.computed(() => formatDate(props2.max));
20750
24243
  const selectedDate = vue.computed(() => {
@@ -20754,31 +24247,25 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20754
24247
  const currentMonthDays = vue.computed(() => {
20755
24248
  const year = currentMonth.value.getFullYear();
20756
24249
  const month = currentMonth.value.getMonth();
20757
- const firstDay = new Date(year, month, 1);
20758
- const lastDay = new Date(year, month + 1, 0);
20759
- const days = [];
20760
- for (let i2 = 0; i2 < firstDay.getDay(); i2++) days.push(null);
20761
- for (let i2 = 1; i2 <= lastDay.getDate(); i2++) days.push(new Date(year, month, i2));
20762
- return days;
24250
+ return time.getCalendarMonthSplitInWeeks(year, month).flat();
20763
24251
  });
20764
24252
  const currentMonthValue = vue.computed(() => ({
20765
24253
  month: currentMonth.value.getMonth(),
20766
24254
  year: currentMonth.value.getFullYear(),
20767
24255
  formatted: {
20768
- month: currentMonth.value.toLocaleString("default", { month: "long", timeZone: props2.timezone }),
20769
- year: currentMonth.value.toLocaleString("default", { year: "numeric", timeZone: props2.timezone })
24256
+ month: time.getLocalizedNameOfMonth(currentMonth.value, "long"),
24257
+ year: time.getLocalizedDateString(currentMonth.value).split("/").pop()
24258
+ // Get just the year part
20770
24259
  }
20771
24260
  }));
20772
- const months = vue.computed(
20773
- () => Array.from({ length: 12 }, (_2, i2) => {
20774
- const date2 = new Date(currentMonthValue.value.year, i2, 1);
20775
- return {
20776
- name: date2.toLocaleString("default", { month: "short" }),
20777
- value: i2,
20778
- disabled: isDateDisabled(date2)
20779
- };
20780
- })
20781
- );
24261
+ const months = vue.computed(() => Array.from({ length: 12 }, (_2, i2) => {
24262
+ const date2 = new Date(currentMonthValue.value.year, i2, 1);
24263
+ return {
24264
+ name: time.getLocalizedNameOfMonth(date2, "short"),
24265
+ value: i2,
24266
+ disabled: isDateDisabled(date2)
24267
+ };
24268
+ }));
20782
24269
  const years = vue.computed(() => {
20783
24270
  const startYear = currentMonthValue.value.year - 10;
20784
24271
  return Array.from({ length: 21 }, (_2, i2) => ({
@@ -20786,6 +24273,15 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20786
24273
  disabled: isYearDisabled(startYear + i2)
20787
24274
  }));
20788
24275
  });
24276
+ const weekDays = vue.computed(() => {
24277
+ const weekStart = /* @__PURE__ */ new Date();
24278
+ weekStart.setDate(weekStart.getDate() - weekStart.getDay() + (props2.firstDayOfWeek === WEEK_START_DAY.MONDAY ? 1 : 0));
24279
+ return Array.from({ length: 7 }, (_2, i2) => {
24280
+ const day = new Date(weekStart);
24281
+ day.setDate(weekStart.getDate() + i2);
24282
+ return time.getLocalizedNameOfWeekday(day, "short");
24283
+ });
24284
+ });
20789
24285
  function isDateDisabled(date2) {
20790
24286
  if (!date2) return true;
20791
24287
  const minDate = props2.min ? new Date(props2.min) : null;
@@ -20832,20 +24328,10 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20832
24328
  const currentMinutes = ((_b = selectedDate.value) == null ? void 0 : _b.getMinutes()) ?? (/* @__PURE__ */ new Date()).getMinutes();
20833
24329
  newDate.setHours(currentHours);
20834
24330
  newDate.setMinutes(currentMinutes);
20835
- emit2("update:modelValue", newDate.toISOString());
20836
24331
  } else {
20837
- emit2("update:modelValue", newDate.toISOString().split("T")[0]);
20838
24332
  isOpen.value = false;
20839
24333
  }
20840
- }
20841
- function handleInput(event) {
20842
- const input = event.target;
20843
- if (!input.value) {
20844
- emit2("update:modelValue", "");
20845
- return;
20846
- }
20847
- const date2 = new Date(input.value);
20848
- emit2("update:modelValue", props2.enableTime ? date2.toISOString() : date2.toISOString().split("T")[0]);
24334
+ emit2("update:modelValue", newDate);
20849
24335
  }
20850
24336
  const hours = vue.computed(() => {
20851
24337
  var _a2;
@@ -20873,7 +24359,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20873
24359
  }
20874
24360
  function isToday(date2) {
20875
24361
  if (!date2) return false;
20876
- return date2.toISOString().split("T")[0] === (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
24362
+ return time.dateIsToday(date2);
20877
24363
  }
20878
24364
  const timezoneDisplay = vue.computed(() => {
20879
24365
  if (!props2.enableTime) return "";
@@ -20886,6 +24372,9 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20886
24372
  return "UTC";
20887
24373
  }
20888
24374
  });
24375
+ function isNotInMonth(date2) {
24376
+ return time.isTrailingOrLeadingDate(date2, currentMonth.value.getMonth());
24377
+ }
20889
24378
  return (_ctx, _cache) => {
20890
24379
  return vue.openBlock(), vue.createElementBlock("div", {
20891
24380
  class: vue.normalizeClass(["bagel-input", { small: _ctx.small }]),
@@ -20895,15 +24384,28 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20895
24384
  vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
20896
24385
  _ctx.required ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$m, "*")) : vue.createCommentVNode("", true)
20897
24386
  ])) : vue.createCommentVNode("", true),
20898
- vue.createVNode(vue.unref(kt$1), {
24387
+ vue.createVNode(vue.unref(_sfc_main$U), {
20899
24388
  shown: vue.unref(isOpen),
20900
- triggers: [],
20901
24389
  placement: "bottom-start",
20902
- distance: 4,
20903
24390
  onApplyShow: _cache[4] || (_cache[4] = ($event) => vue.isRef(isOpen) ? isOpen.value = true : isOpen = true),
20904
24391
  onApplyHide: _cache[5] || (_cache[5] = ($event) => vue.isRef(isOpen) ? isOpen.value = false : isOpen = false)
20905
24392
  }, {
20906
- popper: vue.withCtx(() => [
24393
+ trigger: vue.withCtx(() => [
24394
+ vue.createElementVNode("div", _hoisted_4$e, [
24395
+ vue.createElementVNode("input", {
24396
+ type: "text",
24397
+ value: formattedDisplayValue.value,
24398
+ min: formattedMin.value,
24399
+ max: formattedMax.value,
24400
+ required: _ctx.required,
24401
+ disabled: !_ctx.editMode,
24402
+ class: "date-input",
24403
+ readonly: "",
24404
+ onClick: _cache[0] || (_cache[0] = ($event) => vue.isRef(isOpen) ? isOpen.value = true : isOpen = true)
24405
+ }, null, 8, _hoisted_5$e)
24406
+ ])
24407
+ ]),
24408
+ default: vue.withCtx(() => [
20907
24409
  vue.createElementVNode("div", _hoisted_6$a, [
20908
24410
  vue.createElementVNode("div", _hoisted_7$7, [
20909
24411
  vue.createElementVNode("div", _hoisted_8$4, [
@@ -20955,20 +24457,21 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
20955
24457
  ], 64))
20956
24458
  ]),
20957
24459
  vue.unref(currentView) === "days" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$3, [
20958
- (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], (day) => {
20959
- return vue.createElementVNode("div", {
24460
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(weekDays.value, (day) => {
24461
+ return vue.openBlock(), vue.createElementBlock("div", {
20960
24462
  key: day,
20961
24463
  class: "txt-center txt-12 opacity-6"
20962
24464
  }, vue.toDisplayString(day), 1);
20963
- }), 64)),
20964
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(currentMonthDays.value, (date2, index2) => {
24465
+ }), 128)),
24466
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(currentMonthDays.value, (date2) => {
20965
24467
  return vue.openBlock(), vue.createElementBlock("button", {
20966
- key: index2,
24468
+ key: date2 == null ? void 0 : date2.toISOString(),
20967
24469
  type: "button",
20968
24470
  class: vue.normalizeClass(["day aspect-ratio-1 flex align-items-center justify-content-center pointer round txt14 p-0", {
20969
- selected: isSelected(date2),
20970
- today: isToday(date2),
20971
- disabled: isDateDisabled(date2)
24471
+ "selected": isSelected(date2),
24472
+ "today": isToday(date2),
24473
+ "disabled": isDateDisabled(date2),
24474
+ "not-in-month": isNotInMonth(date2)
20972
24475
  }]),
20973
24476
  disabled: isDateDisabled(date2),
20974
24477
  onClick: ($event) => selectDate(date2)
@@ -21038,28 +24541,13 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
21038
24541
  ])) : vue.createCommentVNode("", true)
21039
24542
  ])
21040
24543
  ]),
21041
- default: vue.withCtx(() => [
21042
- vue.createElementVNode("div", _hoisted_4$e, [
21043
- vue.createElementVNode("input", {
21044
- type: inputType.value,
21045
- value: formattedValue.value,
21046
- min: formattedMin.value,
21047
- max: formattedMax.value,
21048
- required: _ctx.required,
21049
- disabled: !_ctx.editMode,
21050
- class: "date-input",
21051
- onInput: handleInput,
21052
- onClick: _cache[0] || (_cache[0] = ($event) => vue.isRef(isOpen) ? isOpen.value = true : isOpen = true)
21053
- }, null, 40, _hoisted_5$e)
21054
- ])
21055
- ]),
21056
24544
  _: 1
21057
24545
  }, 8, ["shown"])
21058
24546
  ], 10, _hoisted_1$D);
21059
24547
  };
21060
24548
  }
21061
24549
  });
21062
- const DatePick = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-8de3f3c6"]]);
24550
+ const DatePick = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-ca905332"]]);
21063
24551
  const _hoisted_1$C = { class: "datetime-wrap" };
21064
24552
  const _hoisted_2$q = { class: "date-wrap" };
21065
24553
  const _hoisted_3$l = {
@@ -21724,9 +25212,8 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
21724
25212
  let formattedValue = vue.ref("");
21725
25213
  function inputHandler() {
21726
25214
  let numeric = formattedValue.value.replace(/[^\d.-]/g, "");
21727
- if (numeric === "-." || numeric.endsWith(".")) return;
21728
25215
  const emptyValue = ["", "-", "."].includes(numeric);
21729
- if (emptyValue) numeric = `${__props.min}`;
25216
+ if (numeric === "-." || numeric.endsWith(".") || emptyValue) return;
21730
25217
  numberValue.value = Number.parseFloat(numeric);
21731
25218
  formattedValue.value = emptyValue ? "" : formatNumber2(numberValue.value);
21732
25219
  emit2("update:modelValue", numberValue.value);
@@ -21840,7 +25327,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
21840
25327
  };
21841
25328
  }
21842
25329
  });
21843
- const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-d8856711"]]);
25330
+ const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-ce1f6e76"]]);
21844
25331
  const _hoisted_1$y = ["value", "autofocus", "onKeydown", "onPaste"];
21845
25332
  const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
21846
25333
  __name: "OTP",
@@ -22592,7 +26079,7 @@ function createCommandExecutor(state2, commands) {
22592
26079
  }
22593
26080
  };
22594
26081
  }
22595
- function isStyleActive(style2, doc) {
26082
+ function isStyleActive(style, doc) {
22596
26083
  const selection = doc.getSelection();
22597
26084
  if (!selection || !selection.rangeCount) return false;
22598
26085
  const range2 = selection.getRangeAt(0);
@@ -22609,7 +26096,7 @@ function isStyleActive(style2, doc) {
22609
26096
  italic: ["em", "i"],
22610
26097
  underline: ["u"]
22611
26098
  };
22612
- return checkParent(parent, styleTags[style2] ?? [style2]);
26099
+ return checkParent(parent, styleTags[style] ?? [style]);
22613
26100
  }
22614
26101
  function analyzeSelection(doc, range2) {
22615
26102
  const container = range2.commonAncestorContainer;
@@ -23163,9 +26650,9 @@ function useEditor() {
23163
26650
  "ol",
23164
26651
  "li"
23165
26652
  ];
23166
- styleTypes.forEach((style2) => {
23167
- if (state2.doc && isStyleActive(style2, state2.doc)) {
23168
- styles.add(style2);
26653
+ styleTypes.forEach((style) => {
26654
+ if (state2.doc && isStyleActive(style, state2.doc)) {
26655
+ styles.add(style);
23169
26656
  }
23170
26657
  });
23171
26658
  state2.selectedStyles = styles;
@@ -23526,9 +27013,9 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
23526
27013
  doc.designMode = "on";
23527
27014
  doc.body.contentEditable = "true";
23528
27015
  doc.body.dir = hasRTL.value ? "rtl" : "ltr";
23529
- const style2 = doc.createElement("style");
23530
- style2.textContent = (await Promise.resolve().then(() => require("./editor-B3mMCQSg.cjs"))).default;
23531
- doc.head.appendChild(style2);
27016
+ const style = doc.createElement("style");
27017
+ style.textContent = (await Promise.resolve().then(() => require("./editor-B3mMCQSg.cjs"))).default;
27018
+ doc.head.appendChild(style);
23532
27019
  editor.init(doc);
23533
27020
  useEditorKeyboard(doc, commands.execute);
23534
27021
  if (!doc.body.firstElementChild) {
@@ -24908,8 +28395,8 @@ function toggleClass(el, name, state2) {
24908
28395
  }
24909
28396
  }
24910
28397
  function css(el, prop3, val) {
24911
- var style2 = el && el.style;
24912
- if (style2) {
28398
+ var style = el && el.style;
28399
+ if (style) {
24913
28400
  if (val === void 0) {
24914
28401
  if (document.defaultView && document.defaultView.getComputedStyle) {
24915
28402
  val = document.defaultView.getComputedStyle(el, "");
@@ -24918,10 +28405,10 @@ function css(el, prop3, val) {
24918
28405
  }
24919
28406
  return prop3 === void 0 ? val : val[prop3];
24920
28407
  } else {
24921
- if (!(prop3 in style2) && prop3.indexOf("webkit") === -1) {
28408
+ if (!(prop3 in style) && prop3.indexOf("webkit") === -1) {
24922
28409
  prop3 = "-webkit-" + prop3;
24923
28410
  }
24924
- style2[prop3] = val + (typeof val === "string" ? "" : "px");
28411
+ style[prop3] = val + (typeof val === "string" ? "" : "px");
24925
28412
  }
24926
28413
  }
24927
28414
  }
@@ -40833,19 +44320,20 @@ function timeAgo(date2, lang = "en") {
40833
44320
  }
40834
44321
  return selectedLang.justNow;
40835
44322
  }
40836
- exports.Accordion = _sfc_main$17;
44323
+ exports.Accordion = _sfc_main$1m;
40837
44324
  exports.AccordionItem = AccordionItem;
40838
- exports.AddressSearch = _sfc_main$15;
44325
+ exports.AddressSearch = _sfc_main$1k;
40839
44326
  exports.Alert = Alert;
40840
44327
  exports.Avatar = Avatar;
40841
44328
  exports.Badge = Badge;
40842
44329
  exports.BagelForm = _sfc_main$R;
40843
44330
  exports.BagelVue = BagelVue;
40844
- exports.BglComponent = _sfc_main$10;
44331
+ exports.BglComponent = _sfc_main$1f;
40845
44332
  exports.BglForm = _sfc_main$R;
40846
44333
  exports.BglVideo = BglVideo;
40847
44334
  exports.BottomMenu = BottomMenu;
40848
44335
  exports.Btn = Btn;
44336
+ exports.Calendar = _sfc_main$$;
40849
44337
  exports.Card = _sfc_main$_;
40850
44338
  exports.Carousel = Carousel;
40851
44339
  exports.CheckInput = CheckInput;