@arkyn/components 3.0.1-beta.146 → 3.0.1-beta.147

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 (28) hide show
  1. package/dist/bundle.css +1 -1
  2. package/dist/bundle.js +190 -151
  3. package/dist/components/fullCalendar/_fullCalendarProvider.d.ts +9 -1
  4. package/dist/components/fullCalendar/_fullCalendarProvider.d.ts.map +1 -1
  5. package/dist/components/fullCalendar/_fullCalendarProvider.js +2 -0
  6. package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.d.ts.map +1 -1
  7. package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +16 -12
  8. package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.d.ts.map +1 -1
  9. package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +16 -1
  10. package/dist/components/fullCalendar/fullCalendarHeader/index.js +3 -3
  11. package/dist/components/fullCalendar/index.d.ts +62 -48
  12. package/dist/components/fullCalendar/index.d.ts.map +1 -1
  13. package/dist/components/fullCalendar/index.js +26 -36
  14. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.d.ts.map +1 -1
  15. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +8 -4
  16. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.d.ts.map +1 -1
  17. package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +17 -1
  18. package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.d.ts.map +1 -1
  19. package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +16 -12
  20. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.d.ts.map +1 -1
  21. package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +17 -6
  22. package/dist/components/imageUpload/index.js +1 -1
  23. package/dist/components/input/index.d.ts.map +1 -1
  24. package/dist/components/multiSelect/index.js +1 -1
  25. package/dist/components/radio/radioGroup/index.js +1 -1
  26. package/dist/components/richText/index.js +1 -1
  27. package/dist/components/select/index.js +1 -1
  28. package/package.json +7 -7
@@ -1,15 +1,20 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type FullCalendarMatrix, type FullCalendarWeekMatrix } from "./_viewService";
3
3
  type FullCalendarEvent = {
4
- date: Date;
4
+ initialDate: Date;
5
5
  endDate?: Date;
6
6
  title: string;
7
7
  data?: any;
8
8
  scheme?: "primary" | "success" | "warning" | "danger" | "info";
9
9
  onClick?: (data: any) => void;
10
10
  };
11
+ type BlockTimestamp = {
12
+ initialDate: Date;
13
+ endDate: Date;
14
+ };
11
15
  type FullCalendarContextProps = {
12
16
  events: FullCalendarEvent[];
17
+ blockedTimestamps: BlockTimestamp[];
13
18
  viewDate: Date;
14
19
  listHours: number[];
15
20
  listWeek: string[];
@@ -21,13 +26,16 @@ type FullCalendarContextProps = {
21
26
  previousMonth: () => void;
22
27
  previousWeek: () => void;
23
28
  previousDay: () => void;
29
+ onClickDate?: (date: Date) => void;
24
30
  };
25
31
  type FullCalendarProviderProps = {
26
32
  events: FullCalendarEvent[];
33
+ blockedTimestamps: BlockTimestamp[];
27
34
  children: ReactNode;
28
35
  language?: string;
29
36
  defaultValue?: Date;
30
37
  onChangeView?: (date: Date) => void;
38
+ onClickDate?: (date: Date) => void;
31
39
  };
32
40
  declare function useFullCalendar(): FullCalendarContextProps;
33
41
  declare function FullCalendarProvider(props: FullCalendarProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"_fullCalendarProvider.d.ts","sourceRoot":"","sources":["../../../src/components/fullCalendar/_fullCalendarProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AAExB,KAAK,iBAAiB,GAAG;IACvB,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cAAc,EAAE,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,iBAAS,eAAe,6BAEvB;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAkC7D;AAED,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC"}
@@ -17,6 +17,7 @@ function FullCalendarProvider(props) {
17
17
  }
18
18
  return (_jsx(FullCalendarContext.Provider, { value: {
19
19
  events: props.events,
20
+ blockedTimestamps: props.blockedTimestamps,
20
21
  viewDate,
21
22
  listHours,
22
23
  listWeek: viewService.listWeek(viewDate, language),
@@ -28,6 +29,7 @@ function FullCalendarProvider(props) {
28
29
  previousMonth: () => viewService.previousMonth(viewDate, setViewDate),
29
30
  previousWeek: () => viewService.previousWeek(viewDate, setViewDate),
30
31
  previousDay: () => viewService.previousDay(viewDate, setViewDate),
32
+ onClickDate: props.onClickDate,
31
33
  }, children: props.children }));
32
34
  }
33
35
  export { FullCalendarProvider, useFullCalendar };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/dayCalendar/dayCalendarEvent/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAKF,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,uFA2IrD;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/dayCalendar/dayCalendarEvent/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAKF,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,uFAoJrD;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -11,13 +11,13 @@ function DayCalendarEvent(props) {
11
11
  const dayEvents = events
12
12
  .map((event, sourceIndex) => ({ event, sourceIndex }))
13
13
  .filter(({ event }) => {
14
- return (event.date.getDate() === day &&
15
- event.date.getMonth() === month &&
16
- event.date.getFullYear() === year);
14
+ return (event.initialDate.getDate() === day &&
15
+ event.initialDate.getMonth() === month &&
16
+ event.initialDate.getFullYear() === year);
17
17
  })
18
18
  .sort((a, b) => {
19
- const startA = a.event.date.getTime();
20
- const startB = b.event.date.getTime();
19
+ const startA = a.event.initialDate.getTime();
20
+ const startB = b.event.initialDate.getTime();
21
21
  if (startA !== startB)
22
22
  return startA - startB;
23
23
  const endA = a.event.endDate?.getTime() ?? startA + SLOT_DURATION_MINUTES * 60_000;
@@ -31,8 +31,8 @@ function DayCalendarEvent(props) {
31
31
  const dayHour = Math.floor(props.timeInMinutes / 60);
32
32
  const dayMinute = props.timeInMinutes % 60;
33
33
  function isEventInInterval() {
34
- const eventHour = event.date.getHours();
35
- const eventMinute = event.date.getMinutes();
34
+ const eventHour = event.initialDate.getHours();
35
+ const eventMinute = event.initialDate.getMinutes();
36
36
  if (eventHour !== dayHour)
37
37
  return false;
38
38
  if (dayMinute === 0)
@@ -41,9 +41,9 @@ function DayCalendarEvent(props) {
41
41
  return eventMinute >= 30 && eventMinute < 60;
42
42
  }
43
43
  return (isEventInInterval() &&
44
- event.date.getDate() === day &&
45
- event.date.getMonth() === month &&
46
- event.date.getFullYear() === year);
44
+ event.initialDate.getDate() === day &&
45
+ event.initialDate.getMonth() === month &&
46
+ event.initialDate.getFullYear() === year);
47
47
  });
48
48
  if (filteredEvents.length === 0)
49
49
  return _jsx(_Fragment, {});
@@ -58,7 +58,7 @@ function DayCalendarEvent(props) {
58
58
  return `${hours}h${minutes}`;
59
59
  }
60
60
  function getEventRangeInMinutes(event) {
61
- const startMinutes = event.date.getHours() * 60 + event.date.getMinutes();
61
+ const startMinutes = event.initialDate.getHours() * 60 + event.initialDate.getMinutes();
62
62
  const endMinutes = event.endDate
63
63
  ? event.endDate.getHours() * 60 + event.endDate.getMinutes()
64
64
  : startMinutes + SLOT_DURATION_MINUTES;
@@ -96,6 +96,10 @@ function DayCalendarEvent(props) {
96
96
  left: `${overlapOffset}px`,
97
97
  };
98
98
  }
99
- return filteredEvents.map(({ event, sourceIndex }, index) => (_jsxs("div", { className: `arkynDayCalendarEvent ${event?.scheme || "primary"}`, style: getEventStyle(event, sourceIndex), onClick: () => event.onClick?.(event.data), children: [_jsxs("strong", { children: [makeHour(event.date), " ", event?.endDate && `- ${makeHour(event.endDate)}`] }), _jsx("p", { children: event.title })] }, makeEventKey(index, sourceIndex))));
99
+ function handleEventClick(event, eventData) {
100
+ event.stopPropagation();
101
+ eventData.onClick?.(eventData.data);
102
+ }
103
+ return filteredEvents.map(({ event, sourceIndex }, index) => (_jsxs("div", { className: `arkynDayCalendarEvent ${event?.scheme || "primary"}`, style: getEventStyle(event, sourceIndex), onClick: (e) => handleEventClick(e, event), children: [_jsxs("strong", { children: [makeHour(event.initialDate), " ", event?.endDate && `- ${makeHour(event.endDate)}`] }), _jsx("p", { children: event.title })] }, makeEventKey(index, sourceIndex))));
100
104
  }
101
105
  export { DayCalendarEvent };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/dayCalendar/dayCalendarRow/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,cAAc,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,mBAAmB,2CAYnE;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/dayCalendar/dayCalendarRow/index.tsx"],"names":[],"mappings":"AAGA,OAAO,cAAc,CAAC;AAEtB,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,cAAc,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,mBAAmB,2CAmCnE;AAED,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,CAAC"}
@@ -1,9 +1,24 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useFullCalendar } from "../../_fullCalendarProvider";
2
3
  import { ViewService } from "../../_viewService";
3
4
  import { DayCalendarEvent } from "../dayCalendarEvent";
4
5
  import "./styles.css";
5
6
  function DayCalendarRow({ hour, timeInMinutes }) {
6
7
  const viewService = new ViewService();
7
- return (_jsxs("div", { className: "arkynDayCalendarRow", "data-time": timeInMinutes, children: [_jsx("p", { children: viewService.formatHourLabel(hour) }), _jsx("div", { className: "arkynDayCalendarRowContent", children: _jsx(DayCalendarEvent, { timeInMinutes: timeInMinutes }) })] }));
8
+ const { blockedTimestamps, viewDate, onClickDate } = useFullCalendar();
9
+ function isBlocked() {
10
+ return blockedTimestamps.some((timestamp) => viewDate >= timestamp.initialDate && viewDate <= timestamp.endDate);
11
+ }
12
+ function handleClick(event) {
13
+ event.stopPropagation();
14
+ if (isBlocked())
15
+ return;
16
+ if (onClickDate) {
17
+ const date = new Date(viewDate);
18
+ date.setHours(0, timeInMinutes, 0, 0);
19
+ onClickDate(date);
20
+ }
21
+ }
22
+ return (_jsxs("div", { className: `arkynDayCalendarRow ${isBlocked() ? "blocked" : ""}`, "data-time": timeInMinutes, onClick: handleClick, children: [_jsx("p", { children: viewService.formatHourLabel(hour) }), _jsx("div", { className: "arkynDayCalendarRowContent", children: _jsx(DayCalendarEvent, { timeInMinutes: timeInMinutes }) })] }));
8
23
  }
9
24
  export { DayCalendarRow };
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronLeft, ChevronRight } from "lucide-react";
3
- import { CardTabButton } from "../../../components/cardTab/cardTabButton";
4
- import { CardTabContainer } from "../../../components/cardTab/cardTabContainer";
5
- import { IconButton } from "../../../components/iconButton";
3
+ import { CardTabButton } from "../../cardTab/cardTabButton";
4
+ import { CardTabContainer } from "../../cardTab/cardTabContainer";
5
+ import { IconButton } from "../../iconButton";
6
6
  import { useFullCalendar } from "../_fullCalendarProvider";
7
7
  import "./styles.css";
8
8
  function FullCalendarHeader(props) {
@@ -1,77 +1,91 @@
1
+ /**
2
+ * Represents a single event rendered on the calendar.
3
+ */
1
4
  type FullCalendarEvent = {
2
- /** Event label shown on the calendar chip. Required. */
5
+ /** Display label shown on the event block. */
3
6
  title: string;
4
- /** Event start date/time. Required. */
5
- date: Date;
6
- /** Event end date/time. When omitted the event is treated as a point in time. */
7
+ /** Start date and time of the event. */
8
+ initialDate: Date;
9
+ /** End date and time of the event. */
7
10
  endDate?: Date;
8
- /** Arbitrary payload forwarded to `onClick`. */
11
+ /** Arbitrary payload forwarded to the `onClick` callback. */
9
12
  data?: any;
10
- /** Color scheme for the event chip. @default "primary" */
13
+ /**
14
+ * Color scheme applied to the event block.
15
+ * - `primary`: default blue.
16
+ * - `success`: green.
17
+ * - `warning`: yellow.
18
+ * - `danger`: red.
19
+ * - `info`: light blue.
20
+ *
21
+ * @default "primary"
22
+ */
11
23
  scheme?: "primary" | "success" | "warning" | "danger" | "info";
12
- /** Callback fired when the user clicks the event chip. Receives `data`. */
24
+ /** Callback fired when the user clicks the event. Receives `data` as argument. */
13
25
  onClick?: (data: any) => void;
14
26
  };
27
+ /**
28
+ * Represents a blocked (unavailable) time range on the calendar.
29
+ */
30
+ type BlockTimestamp = {
31
+ /** Start of the blocked range. */
32
+ initialDate: Date;
33
+ /** End of the blocked range. */
34
+ endDate: Date;
35
+ };
36
+ /**
37
+ * Props for the FullCalendar component.
38
+ */
15
39
  type FullCalendarProps = {
16
- /** Initial view to render. @default "month" */
17
- defaultView?: "day" | "week" | "month";
18
- /** Initial selected date. Defaults to today. */
40
+ /** Initial focused date when the calendar mounts. */
19
41
  defaultValue?: Date;
20
- /** Array of events to display on the calendar. */
42
+ /** List of events to display across day, week, and month views. */
21
43
  events?: FullCalendarEvent[];
22
- /** Callback fired when the selected date changes. Receives the new `Date`. */
23
- onChange?: (date: Date) => void;
24
- /** Callback fired when the user navigates to a different period. Receives the current `Date`. */
44
+ /** Time ranges that should be visually marked as unavailable. */
45
+ blockedTimestamps?: BlockTimestamp[];
46
+ /** Callback fired when the user navigates to a different period. */
25
47
  onChangeView?: (date: Date) => void;
48
+ /** Callback fired when the user clicks a date cell. */
49
+ onClickDate?: (date: Date) => void;
26
50
  };
27
51
  /**
28
- * FullCalendar interactive calendar with day, week, and month views.
29
- *
30
- * Renders a navigable calendar that displays a list of events. The active view
31
- * can be switched at runtime via the built-in header controls.
52
+ * Full-featured calendar component with day, week, and month views.
32
53
  *
33
- * @param props.defaultView - Initial view to render (`"day"` | `"week"` | `"month"`). Default: `"month"`
34
- * @param props.defaultValue - Initial selected date. Defaults to today.
35
- * @param props.events - Array of events to display on the calendar.
36
- * @param props.events[].title - Event label shown on the calendar.
37
- * @param props.events[].date - Event start date/time.
38
- * @param props.events[].endDate - Event end date/time (optional).
39
- * @param props.events[].data - Arbitrary payload forwarded to `onClick`.
40
- * @param props.events[].scheme - Color scheme for the event chip (`"primary"` | `"success"` | `"warning"` | `"danger"` | `"info"`).
41
- * @param props.events[].onClick - Fires when the user clicks the event — receives `data`.
42
- * @param props.onChange - Fires when the selected date changes — receives the new `Date`.
43
- * @param props.onChangeView - Fires when the user navigates to a different period — receives the current `Date`.
54
+ * Renders a switchable calendar that supports event display, blocked time
55
+ * ranges, and date navigation. Internal state and business logic are managed
56
+ * by `FullCalendarProvider`, keeping the public API minimal.
44
57
  *
45
- * @returns FullCalendar JSX element.
58
+ * @param props FullCalendar properties.
59
+ * @returns Calendar UI with a view switcher header and the active view grid.
46
60
  *
47
61
  * @example
48
- * ```tsx
49
- * // Basic monthly calendar
50
- * <FullCalendar />
51
- *
52
- * // Start on week view with a pre-selected date
53
- * <FullCalendar defaultView="week" defaultValue={new Date("2025-06-01")} />
54
- *
55
- * // With events
62
+ * // Basic usage with events
56
63
  * <FullCalendar
64
+ * defaultValue={new Date()}
57
65
  * events={[
58
66
  * {
59
- * title: "Team meeting",
60
- * date: new Date("2025-06-13T10:00:00"),
61
- * endDate: new Date("2025-06-13T11:00:00"),
67
+ * title: "Team standup",
68
+ * initialDate: new Date(2026, 5, 22, 9, 0),
69
+ * endDate: new Date(2026, 5, 22, 9, 30),
62
70
  * scheme: "primary",
63
- * data: { meetingId: 42 },
64
- * onClick: ({ meetingId }) => openMeeting(meetingId),
71
+ * onClick: (data) => console.log("Event clicked:", data),
65
72
  * },
73
+ * ]}
74
+ * onChangeView={(date) => console.log("Viewing:", date)}
75
+ * onClickDate={(date) => console.log("Date clicked:", date)}
76
+ * />
77
+ *
78
+ * @example
79
+ * // With blocked timestamps
80
+ * <FullCalendar
81
+ * defaultValue={new Date()}
82
+ * blockedTimestamps={[
66
83
  * {
67
- * title: "Deadline",
68
- * date: new Date("2025-06-20"),
69
- * scheme: "danger",
84
+ * initialDate: new Date(2026, 5, 22, 12, 0),
85
+ * endDate: new Date(2026, 5, 22, 13, 0),
70
86
  * },
71
87
  * ]}
72
- * onChangeView={(date) => fetchEventsForMonth(date)}
73
88
  * />
74
- * ```
75
89
  */
76
90
  declare function FullCalendar(props: FullCalendarProps): import("react/jsx-runtime").JSX.Element;
77
91
  export { FullCalendar };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/fullCalendar/index.tsx"],"names":[],"mappings":"AAQA,KAAK,iBAAiB,GAAG;IACvB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,IAAI,EAAE,IAAI,CAAC;IACX,iFAAiF;IACjF,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,gDAAgD;IAChD,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,0DAA0D;IAC1D,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/D,2EAA2E;IAC3E,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACvC,gDAAgD;IAChD,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,kDAAkD;IAClD,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,iGAAiG;IACjG,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAiB7C;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/fullCalendar/index.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,EAAE,IAAI,CAAC;IAClB,sCAAsC;IACtC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,6DAA6D;IAC7D,IAAI,CAAC,EAAE,GAAG,CAAC;IACX;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/D,kFAAkF;IAClF,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB,kCAAkC;IAClC,WAAW,EAAE,IAAI,CAAC;IAClB,gCAAgC;IAChC,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,qDAAqD;IACrD,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,mEAAmE;IACnE,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAC;IACrC,oEAAoE;IACpE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,uDAAuD;IACvD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAmB7C;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -7,56 +7,46 @@ import { FullCalendarHeader } from "./fullCalendarHeader";
7
7
  import { MonthlyCalendar } from "./monthlyCalendar";
8
8
  import { WeekCalendar } from "./weekCalendar";
9
9
  /**
10
- * FullCalendar interactive calendar with day, week, and month views.
10
+ * Full-featured calendar component with day, week, and month views.
11
11
  *
12
- * Renders a navigable calendar that displays a list of events. The active view
13
- * can be switched at runtime via the built-in header controls.
12
+ * Renders a switchable calendar that supports event display, blocked time
13
+ * ranges, and date navigation. Internal state and business logic are managed
14
+ * by `FullCalendarProvider`, keeping the public API minimal.
14
15
  *
15
- * @param props.defaultView - Initial view to render (`"day"` | `"week"` | `"month"`). Default: `"month"`
16
- * @param props.defaultValue - Initial selected date. Defaults to today.
17
- * @param props.events - Array of events to display on the calendar.
18
- * @param props.events[].title - Event label shown on the calendar.
19
- * @param props.events[].date - Event start date/time.
20
- * @param props.events[].endDate - Event end date/time (optional).
21
- * @param props.events[].data - Arbitrary payload forwarded to `onClick`.
22
- * @param props.events[].scheme - Color scheme for the event chip (`"primary"` | `"success"` | `"warning"` | `"danger"` | `"info"`).
23
- * @param props.events[].onClick - Fires when the user clicks the event — receives `data`.
24
- * @param props.onChange - Fires when the selected date changes — receives the new `Date`.
25
- * @param props.onChangeView - Fires when the user navigates to a different period — receives the current `Date`.
26
- *
27
- * @returns FullCalendar JSX element.
16
+ * @param props FullCalendar properties.
17
+ * @returns Calendar UI with a view switcher header and the active view grid.
28
18
  *
29
19
  * @example
30
- * ```tsx
31
- * // Basic monthly calendar
32
- * <FullCalendar />
33
- *
34
- * // Start on week view with a pre-selected date
35
- * <FullCalendar defaultView="week" defaultValue={new Date("2025-06-01")} />
36
- *
37
- * // With events
20
+ * // Basic usage with events
38
21
  * <FullCalendar
22
+ * defaultValue={new Date()}
39
23
  * events={[
40
24
  * {
41
- * title: "Team meeting",
42
- * date: new Date("2025-06-13T10:00:00"),
43
- * endDate: new Date("2025-06-13T11:00:00"),
25
+ * title: "Team standup",
26
+ * initialDate: new Date(2026, 5, 22, 9, 0),
27
+ * endDate: new Date(2026, 5, 22, 9, 30),
44
28
  * scheme: "primary",
45
- * data: { meetingId: 42 },
46
- * onClick: ({ meetingId }) => openMeeting(meetingId),
29
+ * onClick: (data) => console.log("Event clicked:", data),
47
30
  * },
31
+ * ]}
32
+ * onChangeView={(date) => console.log("Viewing:", date)}
33
+ * onClickDate={(date) => console.log("Date clicked:", date)}
34
+ * />
35
+ *
36
+ * @example
37
+ * // With blocked timestamps
38
+ * <FullCalendar
39
+ * defaultValue={new Date()}
40
+ * blockedTimestamps={[
48
41
  * {
49
- * title: "Deadline",
50
- * date: new Date("2025-06-20"),
51
- * scheme: "danger",
42
+ * initialDate: new Date(2026, 5, 22, 12, 0),
43
+ * endDate: new Date(2026, 5, 22, 13, 0),
52
44
  * },
53
45
  * ]}
54
- * onChangeView={(date) => fetchEventsForMonth(date)}
55
46
  * />
56
- * ```
57
47
  */
58
48
  function FullCalendar(props) {
59
- const [viewType, setViewType] = useState(props.defaultView || "month");
60
- return (_jsx(FullCalendarProvider, { events: props.events || [], defaultValue: props.defaultValue, onChangeView: props.onChangeView, children: _jsxs(FullCalendarContainer, { children: [_jsx(FullCalendarHeader, { viewType: viewType, setViewType: setViewType }), viewType === "day" && _jsx(DayCalendar, {}), viewType === "month" && _jsx(MonthlyCalendar, {}), viewType === "week" && _jsx(WeekCalendar, {})] }) }));
49
+ const [viewType, setViewType] = useState("month");
50
+ return (_jsx(FullCalendarProvider, { events: props.events || [], defaultValue: props.defaultValue, onChangeView: props.onChangeView, blockedTimestamps: props.blockedTimestamps || [], onClickDate: props.onClickDate, children: _jsxs(FullCalendarContainer, { children: [_jsx(FullCalendarHeader, { viewType: viewType, setViewType: setViewType }), viewType === "day" && _jsx(DayCalendar, {}), viewType === "month" && _jsx(MonthlyCalendar, {}), viewType === "week" && _jsx(WeekCalendar, {})] }) }));
61
51
  }
62
52
  export { FullCalendar };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,yBAAyB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,iBAAS,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,uFAsC7D;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,yBAAyB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,iBAAS,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,uFA2C7D;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -4,9 +4,9 @@ import "./styles.css";
4
4
  function MonthlyCalendarEvent(props) {
5
5
  const { events } = useFullCalendar();
6
6
  const filteredEvents = events.filter((event) => {
7
- return (event.date.getDate() === props.day &&
8
- event.date.getMonth() === props.month &&
9
- event.date.getFullYear() === props.year);
7
+ return (event.initialDate.getDate() === props.day &&
8
+ event.initialDate.getMonth() === props.month &&
9
+ event.initialDate.getFullYear() === props.year);
10
10
  });
11
11
  if (filteredEvents.length === 0)
12
12
  return _jsx(_Fragment, {});
@@ -20,6 +20,10 @@ function MonthlyCalendarEvent(props) {
20
20
  return `${hours}h`;
21
21
  return `${hours}h${minutes}`;
22
22
  }
23
- return filteredEvents.map((event, index) => (_jsxs("div", { className: `arkynMonthlyCalendarEvent ${event?.scheme || "primary"}`, onClick: () => event.onClick?.(event.data), children: [_jsxs("strong", { children: [makeHour(event.date), " ", event?.endDate && `- ${makeHour(event.endDate)}`] }), _jsx("p", { children: event.title })] }, makeEventKey(index))));
23
+ function handleEventClick(event, eventData) {
24
+ event.stopPropagation();
25
+ eventData.onClick?.(eventData.data);
26
+ }
27
+ return filteredEvents.map((event, index) => (_jsxs("div", { className: `arkynMonthlyCalendarEvent ${event?.scheme || "primary"}`, onClick: (e) => handleEventClick(e, event), children: [_jsxs("strong", { children: [makeHour(event.initialDate), " ", event?.endDate && `- ${makeHour(event.endDate)}`] }), _jsx("p", { children: event.title })] }, makeEventKey(index))));
24
28
  }
25
29
  export { MonthlyCalendarEvent };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,2BAA2B,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;CAC3C,CAAC;AAEF,iBAAS,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAoBjE;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,KAAK,2BAA2B,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;CAC3C,CAAC;AAEF,iBAAS,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CA4CjE;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -1,14 +1,30 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useFullCalendar } from "../../_fullCalendarProvider";
2
3
  import { MonthlyCalendarEvent } from "../monthlyCalendarEvent";
3
4
  import "./styles.css";
4
5
  function MonthlyCalendarTableTd(props) {
5
6
  const { day, month, year, dayOwner } = props;
7
+ const { blockedTimestamps, onClickDate } = useFullCalendar();
6
8
  function isToday() {
7
9
  const today = new Date();
8
10
  return (day === today.getDate() &&
9
11
  month === today.getMonth() &&
10
12
  year === today.getFullYear());
11
13
  }
12
- return (_jsxs("td", { className: `arkynMonthlyCalendarTableTd ${dayOwner}`, children: [_jsx("p", { className: isToday() ? "today" : "", children: day }), _jsx("div", { className: "arkynMonthlyCalendarEventContainer", children: _jsx(MonthlyCalendarEvent, { day: day, month: month, year: year }) })] }));
14
+ function isBlocked() {
15
+ const currentDate = new Date(year, month, day);
16
+ return blockedTimestamps.some((timestamp) => currentDate >= timestamp.initialDate &&
17
+ currentDate <= timestamp.endDate);
18
+ }
19
+ function handleClick(event) {
20
+ event.stopPropagation();
21
+ if (isBlocked())
22
+ return;
23
+ if (onClickDate) {
24
+ const date = new Date(year, month, day);
25
+ onClickDate(date);
26
+ }
27
+ }
28
+ return (_jsxs("td", { className: `arkynMonthlyCalendarTableTd ${dayOwner} ${isBlocked() ? "blocked" : ""}`, onClick: handleClick, children: [_jsx("p", { className: isToday() ? "today" : "", children: day }), _jsx("div", { className: "arkynMonthlyCalendarEventContainer", children: _jsx(MonthlyCalendarEvent, { day: day, month: month, year: year }) })] }));
13
29
  }
14
30
  export { MonthlyCalendarTableTd };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/weekCalendar/weekCalendarEvent/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,sBAAsB,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAKF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,uFAuIvD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/weekCalendar/weekCalendarEvent/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,sBAAsB,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAKF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,uFAgJvD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -8,13 +8,13 @@ function WeekCalendarEvent(props) {
8
8
  const dayEvents = events
9
9
  .map((event, sourceIndex) => ({ event, sourceIndex }))
10
10
  .filter(({ event }) => {
11
- return (event.date.getDate() === props.day &&
12
- event.date.getMonth() === props.month &&
13
- event.date.getFullYear() === props.year);
11
+ return (event.initialDate.getDate() === props.day &&
12
+ event.initialDate.getMonth() === props.month &&
13
+ event.initialDate.getFullYear() === props.year);
14
14
  })
15
15
  .sort((a, b) => {
16
- const startA = a.event.date.getTime();
17
- const startB = b.event.date.getTime();
16
+ const startA = a.event.initialDate.getTime();
17
+ const startB = b.event.initialDate.getTime();
18
18
  if (startA !== startB)
19
19
  return startA - startB;
20
20
  const endA = a.event.endDate?.getTime() ?? startA + SLOT_DURATION_MINUTES * 60_000;
@@ -28,8 +28,8 @@ function WeekCalendarEvent(props) {
28
28
  const dayHour = Math.floor(props.timeInMinutes / 60);
29
29
  const dayMinute = props.timeInMinutes % 60;
30
30
  function isEventInInterval() {
31
- const eventHour = event.date.getHours();
32
- const eventMinute = event.date.getMinutes();
31
+ const eventHour = event.initialDate.getHours();
32
+ const eventMinute = event.initialDate.getMinutes();
33
33
  if (eventHour !== dayHour)
34
34
  return false;
35
35
  if (dayMinute === 0)
@@ -38,9 +38,9 @@ function WeekCalendarEvent(props) {
38
38
  return eventMinute >= 30 && eventMinute < 60;
39
39
  }
40
40
  return (isEventInInterval() &&
41
- event.date.getDate() === props.day &&
42
- event.date.getMonth() === props.month &&
43
- event.date.getFullYear() === props.year);
41
+ event.initialDate.getDate() === props.day &&
42
+ event.initialDate.getMonth() === props.month &&
43
+ event.initialDate.getFullYear() === props.year);
44
44
  });
45
45
  if (filteredEvents.length === 0)
46
46
  return _jsx(_Fragment, {});
@@ -55,7 +55,7 @@ function WeekCalendarEvent(props) {
55
55
  return `${hours}h${minutes}`;
56
56
  }
57
57
  function getEventRangeInMinutes(event) {
58
- const startMinutes = event.date.getHours() * 60 + event.date.getMinutes();
58
+ const startMinutes = event.initialDate.getHours() * 60 + event.initialDate.getMinutes();
59
59
  const endMinutes = event.endDate
60
60
  ? event.endDate.getHours() * 60 + event.endDate.getMinutes()
61
61
  : startMinutes + SLOT_DURATION_MINUTES;
@@ -93,6 +93,10 @@ function WeekCalendarEvent(props) {
93
93
  left: `${overlapOffset}px`,
94
94
  };
95
95
  }
96
- return filteredEvents.map(({ event, sourceIndex }, index) => (_jsxs("div", { className: `arkynWeekCalendarEvent ${event?.scheme || "primary"}`, style: getEventStyle(event, sourceIndex), onClick: () => event.onClick?.(event.data), children: [_jsxs("strong", { children: [makeHour(event.date), " ", event?.endDate && `- ${makeHour(event.endDate)}`] }), _jsx("p", { children: event.title })] }, makeEventKey(index, sourceIndex))));
96
+ function handleEventClick(event, eventData) {
97
+ event.stopPropagation();
98
+ eventData.onClick?.(eventData.data);
99
+ }
100
+ return filteredEvents.map(({ event, sourceIndex }, index) => (_jsxs("div", { className: `arkynWeekCalendarEvent ${event?.scheme || "primary"}`, style: getEventStyle(event, sourceIndex), onClick: (e) => handleEventClick(e, event), children: [_jsxs("strong", { children: [makeHour(event.initialDate), " ", event?.endDate && `- ${makeHour(event.endDate)}`] }), _jsx("p", { children: event.title })] }, makeEventKey(index, sourceIndex))));
97
101
  }
98
102
  export { WeekCalendarEvent };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,wBAAwB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA4B3D;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,KAAK,wBAAwB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA0C3D;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,14 +1,25 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useFullCalendar } from "../../_fullCalendarProvider";
2
3
  import { WeekCalendarEvent } from "../weekCalendarEvent";
3
4
  import "./styles.css";
4
5
  function WeekCalendarTableTd(props) {
5
6
  const { day, month, year, dayOwner, timeInMinutes } = props;
6
- function isToday() {
7
- const today = new Date();
8
- return (day === today.getDate() &&
9
- month === today.getMonth() &&
10
- year === today.getFullYear());
7
+ const { blockedTimestamps, onClickDate } = useFullCalendar();
8
+ function isBlocked() {
9
+ const currentDate = new Date(year, month, day);
10
+ return blockedTimestamps.some((timestamp) => currentDate >= timestamp.initialDate &&
11
+ currentDate <= timestamp.endDate);
11
12
  }
12
- return (_jsx("td", { className: `arkynWeekCalendarTableTd ${dayOwner} ${isToday() ? "today" : ""}`, "data-day": day, "data-time": timeInMinutes, children: _jsx("div", { className: "arkynWeekCalendarTableTdContent", children: _jsx(WeekCalendarEvent, { day: day, month: month, year: year, timeInMinutes: timeInMinutes }) }) }));
13
+ function handleClick(event) {
14
+ event.stopPropagation();
15
+ if (isBlocked())
16
+ return;
17
+ if (onClickDate) {
18
+ const date = new Date(year, month, day);
19
+ date.setHours(0, timeInMinutes, 0, 0);
20
+ onClickDate(date);
21
+ }
22
+ }
23
+ return (_jsx("td", { className: `arkynWeekCalendarTableTd ${dayOwner} ${isBlocked() ? "blocked" : ""}`, "data-day": day, "data-time": timeInMinutes, onClick: handleClick, children: _jsx("div", { className: "arkynWeekCalendarTableTdContent", children: _jsx(WeekCalendarEvent, { day: day, month: month, year: year, timeInMinutes: timeInMinutes }) }) }));
13
24
  }
14
25
  export { WeekCalendarTableTd };
@@ -55,7 +55,7 @@ import "./styles.css";
55
55
  * ```
56
56
  */
57
57
  function ImageUpload(props) {
58
- const { name, defaultValue = "", label, showAsterisk = false, action, fileName = "file", className: wrapperClassName = "", method = "POST", acceptImage = "image/*", fileResponseName = "url", changeImageButtonText = "Alterar imagem", selectImageButtonText = "Selecionar imagem", dropImageText = "Ou arraste e solte a imagem aqui", onChange, disabled = false, unShowFieldTemplate = false, orientation = "horizontal", } = props;
58
+ const { name, defaultValue = "", label, showAsterisk = false, action, fileName = "file", className: wrapperClassName = "", method = "POST", acceptImage = "image/*", fileResponseName = "url", changeImageButtonText = "Alterar imagem", selectImageButtonText = "Selecionar imagem", dropImageText = "Ou arraste e solte a imagem aqui", onChange, disabled = false, unShowFieldTemplate = false, orientation = "vertical", } = props;
59
59
  const { fieldErrors } = useForm();
60
60
  const fieldError = fieldErrors?.[name];
61
61
  const [value, setValue] = useState(defaultValue);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,mBAAmB,EAKp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