@mlw-packages/react-components 1.7.19 → 1.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1778,6 +1778,10 @@ function ModeToggleBase({
1778
1778
  ] });
1779
1779
  }
1780
1780
 
1781
+ // src/components/selects/Select.tsx
1782
+ import { useEffect as useEffect3, useMemo as useMemo4, useState as useState4 } from "react";
1783
+ import { CaretLeftIcon, CaretRightIcon as CaretRightIcon2 } from "@phosphor-icons/react";
1784
+
1781
1785
  // src/components/ui/layout/ScrollareaBase.tsx
1782
1786
  import * as React10 from "react";
1783
1787
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
@@ -1826,8 +1830,46 @@ function Select({
1826
1830
  selected,
1827
1831
  label,
1828
1832
  labelClassname,
1829
- className
1833
+ className,
1834
+ pagination
1830
1835
  }) {
1836
+ const [page, setPage] = useState4(1);
1837
+ const [animating, setAnimating] = useState4(false);
1838
+ const groupCount = groupItems ? Object.keys(groupItems).length : 0;
1839
+ useEffect3(() => {
1840
+ setPage(1);
1841
+ }, [items?.length, groupCount, pagination]);
1842
+ const paged = useMemo4(() => {
1843
+ if (!pagination || pagination <= 0) return null;
1844
+ if (groupItems) {
1845
+ const flattened = Object.keys(groupItems).flatMap(
1846
+ (g) => groupItems[g].map((it) => ({ ...it, group: g }))
1847
+ );
1848
+ const total2 = flattened.length;
1849
+ const totalPages2 = Math.max(1, Math.ceil(total2 / pagination));
1850
+ const start2 = (page - 1) * pagination;
1851
+ const pageItems2 = flattened.slice(start2, start2 + pagination);
1852
+ const grouped = {};
1853
+ pageItems2.forEach((it) => {
1854
+ if (!grouped[it.group]) grouped[it.group] = [];
1855
+ grouped[it.group].push({ label: it.label, value: it.value });
1856
+ });
1857
+ return { total: total2, totalPages: totalPages2, grouped };
1858
+ }
1859
+ const total = items.length;
1860
+ const totalPages = Math.max(1, Math.ceil(total / pagination));
1861
+ const start = (page - 1) * pagination;
1862
+ const pageItems = items.slice(start, start + pagination);
1863
+ return { total, totalPages, pageItems };
1864
+ }, [items, groupItems, page, pagination]);
1865
+ const goPrev = () => setPage((p) => Math.max(1, p - 1));
1866
+ const goNext = () => setPage((p) => paged ? Math.min(paged.totalPages, p + 1) : p + 1);
1867
+ useEffect3(() => {
1868
+ if (!pagination) return;
1869
+ setAnimating(true);
1870
+ const id = setTimeout(() => setAnimating(false), 220);
1871
+ return () => clearTimeout(id);
1872
+ }, [page, pagination]);
1831
1873
  return /* @__PURE__ */ jsxs13("div", { "data-testid": testIds.root ?? "select-root", children: [
1832
1874
  label && /* @__PURE__ */ jsx18(LabelBase_default, { className: labelClassname, children: label }),
1833
1875
  /* @__PURE__ */ jsxs13(
@@ -1856,7 +1898,80 @@ function Select({
1856
1898
  )
1857
1899
  }
1858
1900
  ),
1859
- /* @__PURE__ */ jsx18(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx18(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: groupItems ? /* @__PURE__ */ jsx18(Fragment3, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs13(
1901
+ /* @__PURE__ */ jsx18(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx18(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: pagination && pagination > 0 ? /* @__PURE__ */ jsxs13(Fragment3, { children: [
1902
+ /* @__PURE__ */ jsx18(
1903
+ "div",
1904
+ {
1905
+ className: `transition-all duration-200 ${animating ? "opacity-0 -translate-y-1" : "opacity-100 translate-y-0"}`,
1906
+ children: paged && "grouped" in paged ? Object.keys(paged.grouped).map((key) => /* @__PURE__ */ jsxs13(
1907
+ SelectGroupBase,
1908
+ {
1909
+ "data-testid": testIds.group ?? "select-group",
1910
+ children: [
1911
+ /* @__PURE__ */ jsx18(
1912
+ SelectLabelBase,
1913
+ {
1914
+ "data-testid": testIds.label ?? "select-label",
1915
+ children: key
1916
+ }
1917
+ ),
1918
+ paged.grouped[key].map((item) => /* @__PURE__ */ jsx18(
1919
+ SelectItemBase,
1920
+ {
1921
+ value: item.value,
1922
+ "data-testid": testIds.item?.(String(item.value)) ?? `select-item-${item.value}`,
1923
+ children: item.label
1924
+ },
1925
+ item.value
1926
+ ))
1927
+ ]
1928
+ },
1929
+ key
1930
+ )) : paged ? /* @__PURE__ */ jsx18(
1931
+ SelectGroupBase,
1932
+ {
1933
+ "data-testid": testIds.group ?? "select-group",
1934
+ children: paged.pageItems.map((item) => /* @__PURE__ */ jsx18(
1935
+ SelectItemBase,
1936
+ {
1937
+ value: item.value,
1938
+ "data-testid": testIds.item?.(String(item.value)) ?? `select-item-${item.value}`,
1939
+ children: item.label
1940
+ },
1941
+ item.value
1942
+ ))
1943
+ }
1944
+ ) : null
1945
+ }
1946
+ ),
1947
+ paged && paged.totalPages > 1 && /* @__PURE__ */ jsxs13("div", { className: "px-2 py-2 flex items-center justify-between", children: [
1948
+ /* @__PURE__ */ jsx18(
1949
+ "button",
1950
+ {
1951
+ type: "button",
1952
+ onClick: goPrev,
1953
+ disabled: page <= 1,
1954
+ "data-testid": testIds.paginationPrev ?? "select-pagination-prev",
1955
+ "aria-label": "Previous page",
1956
+ className: "text-xs px-2 py-1 rounded disabled:opacity-50 flex items-center gap-2 hover:scale-105 active:scale-95 transition-transform",
1957
+ children: /* @__PURE__ */ jsx18(CaretLeftIcon, { className: "h-4 w-4 opacity-80" })
1958
+ }
1959
+ ),
1960
+ /* @__PURE__ */ jsx18("div", { className: " flex items-center gap-2", children: /* @__PURE__ */ jsx18("span", { className: "px-2 py-0.5 rounded bg-gray-100 dark:bg-slate-800 text-xs", children: `${page} / ${paged.totalPages}` }) }),
1961
+ /* @__PURE__ */ jsx18(
1962
+ "button",
1963
+ {
1964
+ type: "button",
1965
+ onClick: goNext,
1966
+ disabled: page >= paged.totalPages,
1967
+ "data-testid": testIds.paginationNext ?? "select-pagination-next",
1968
+ "aria-label": "Next page",
1969
+ className: "text-xs px-2 py-1 rounded disabled:opacity-50 flex items-center gap-2 hover:scale-105 active:scale-95 transition-transform",
1970
+ children: /* @__PURE__ */ jsx18(CaretRightIcon2, { className: "h-4 w-4 opacity-80" })
1971
+ }
1972
+ )
1973
+ ] })
1974
+ ] }) : /* @__PURE__ */ jsx18(Fragment3, { children: groupItems ? /* @__PURE__ */ jsx18(Fragment3, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs13(
1860
1975
  SelectGroupBase,
1861
1976
  {
1862
1977
  "data-testid": testIds.group ?? "select-group",
@@ -1880,15 +1995,21 @@ function Select({
1880
1995
  ]
1881
1996
  },
1882
1997
  key
1883
- )) }) : /* @__PURE__ */ jsx18(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ jsx18(
1884
- SelectItemBase,
1998
+ )) }) : /* @__PURE__ */ jsx18(
1999
+ SelectGroupBase,
1885
2000
  {
1886
- value: item.value,
1887
- "data-testid": testIds.item?.(String(item.value)) ?? `select-item-${item.value}`,
1888
- children: item.label
1889
- },
1890
- item.value
1891
- )) }) }) })
2001
+ "data-testid": testIds.group ?? "select-group",
2002
+ children: items.map((item) => /* @__PURE__ */ jsx18(
2003
+ SelectItemBase,
2004
+ {
2005
+ value: item.value,
2006
+ "data-testid": testIds.item?.(String(item.value)) ?? `select-item-${item.value}`,
2007
+ children: item.label
2008
+ },
2009
+ item.value
2010
+ ))
2011
+ }
2012
+ ) }) }) })
1892
2013
  ]
1893
2014
  }
1894
2015
  ),
@@ -1897,7 +2018,7 @@ function Select({
1897
2018
  }
1898
2019
 
1899
2020
  // src/components/selects/AvatarCombobox.tsx
1900
- import { useId, useState as useState4 } from "react";
2021
+ import { useId, useState as useState5 } from "react";
1901
2022
  import { CaretDownIcon as CaretDownIcon3, CheckIcon as CheckIcon5 } from "@phosphor-icons/react";
1902
2023
  import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1903
2024
  var DEFAULT_COLORS = [
@@ -1942,7 +2063,7 @@ function AvatarCombobox({
1942
2063
  className,
1943
2064
  colors: colors2
1944
2065
  }) {
1945
- const [open, setOpen] = useState4(false);
2066
+ const [open, setOpen] = useState5(false);
1946
2067
  const id = useId();
1947
2068
  const allItems = items || (groupItems ? Object.values(groupItems).flat() : []);
1948
2069
  const selectedItem = allItems.find((item) => item.value === selected);
@@ -2052,10 +2173,10 @@ function AvatarCombobox({
2052
2173
 
2053
2174
  // src/components/charts/Chart.tsx
2054
2175
  import {
2055
- useState as useState7,
2056
- useEffect as useEffect5,
2176
+ useState as useState8,
2177
+ useEffect as useEffect6,
2057
2178
  useCallback as useCallback5,
2058
- useMemo as useMemo5,
2179
+ useMemo as useMemo6,
2059
2180
  useRef as useRef3,
2060
2181
  useLayoutEffect
2061
2182
  } from "react";
@@ -2219,7 +2340,7 @@ var resolveChartMargins = (margins, chartMargins, showLabels) => {
2219
2340
  import { toast } from "sonner";
2220
2341
 
2221
2342
  // src/components/charts/components/controls/PeriodsDropdown.tsx
2222
- import { useState as useState5, useRef, useEffect as useEffect3 } from "react";
2343
+ import { useState as useState6, useRef, useEffect as useEffect4 } from "react";
2223
2344
  import { motion as motion6, AnimatePresence as AnimatePresence5 } from "framer-motion";
2224
2345
  import { DotsThreeIcon } from "@phosphor-icons/react/dist/ssr";
2225
2346
  import { Check } from "@phosphor-icons/react/dist/ssr";
@@ -2242,11 +2363,11 @@ function PeriodsDropdown({
2242
2363
  activePeriods
2243
2364
  }) {
2244
2365
  const periods = processedData.map((d) => String(d.name));
2245
- const [open, setOpen] = useState5(false);
2366
+ const [open, setOpen] = useState6(false);
2246
2367
  const wrapperRef = useRef(null);
2247
2368
  const firstItemRef = useRef(null);
2248
2369
  const listRef = useRef(null);
2249
- useEffect3(() => {
2370
+ useEffect4(() => {
2250
2371
  const handleClickOutside = (e) => {
2251
2372
  if (!wrapperRef.current) return;
2252
2373
  if (!wrapperRef.current.contains(e.target)) setOpen(false);
@@ -2261,7 +2382,7 @@ function PeriodsDropdown({
2261
2382
  document.removeEventListener("keydown", handleEscape);
2262
2383
  };
2263
2384
  }, []);
2264
- useEffect3(() => {
2385
+ useEffect4(() => {
2265
2386
  if (open && firstItemRef.current) {
2266
2387
  firstItemRef.current.focus();
2267
2388
  }
@@ -2604,12 +2725,12 @@ var CloseAllButton = ({
2604
2725
  var CloseAllButton_default = CloseAllButton;
2605
2726
 
2606
2727
  // src/components/charts/components/tooltips/DraggableTooltip.tsx
2607
- import React12, {
2608
- useEffect as useEffect4,
2728
+ import React13, {
2729
+ useEffect as useEffect5,
2609
2730
  useRef as useRef2,
2610
- useState as useState6,
2731
+ useState as useState7,
2611
2732
  useCallback as useCallback4,
2612
- useMemo as useMemo4
2733
+ useMemo as useMemo5
2613
2734
  } from "react";
2614
2735
  import { motion as motion9, AnimatePresence as AnimatePresence7 } from "framer-motion";
2615
2736
  import { DotsSixVerticalIcon } from "@phosphor-icons/react";
@@ -2691,12 +2812,12 @@ var DraggableTooltipComponent = ({
2691
2812
  valueFormatter: valueFormatter2,
2692
2813
  categoryFormatter
2693
2814
  }) => {
2694
- const visibleKeys = useMemo4(
2815
+ const visibleKeys = useMemo5(
2695
2816
  () => showOnlyHighlighted && highlightedSeries && highlightedSeries.size > 0 ? dataKeys.filter((k) => highlightedSeries.has(k)) : dataKeys,
2696
2817
  [showOnlyHighlighted, highlightedSeries, dataKeys]
2697
2818
  );
2698
- const TotalDisplay = React12.memo(({ data: data2, visibleKeys: visibleKeys2, valueFormatter: localformatter }) => {
2699
- const total = useMemo4(() => {
2819
+ const TotalDisplay = React13.memo(({ data: data2, visibleKeys: visibleKeys2, valueFormatter: localformatter }) => {
2820
+ const total = useMemo5(() => {
2700
2821
  const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
2701
2822
  return numeric.reduce((s, v) => s + (v || 0), 0);
2702
2823
  }, [data2, visibleKeys2]);
@@ -2718,13 +2839,13 @@ var DraggableTooltipComponent = ({
2718
2839
  )
2719
2840
  ] });
2720
2841
  });
2721
- const [localPos, setLocalPos] = useState6(position);
2722
- const [dragging, setDragging] = useState6(false);
2842
+ const [localPos, setLocalPos] = useState7(position);
2843
+ const [dragging, setDragging] = useState7(false);
2723
2844
  const offsetRef = useRef2({ x: 0, y: 0 });
2724
2845
  const lastMouse = useRef2({ x: 0, y: 0 });
2725
- const [alignmentGuides, setAlignmentGuides] = useState6([]);
2726
- const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = useState6(0);
2727
- useEffect4(() => setLocalPos(position), [position]);
2846
+ const [alignmentGuides, setAlignmentGuides] = useState7([]);
2847
+ const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = useState7(0);
2848
+ useEffect5(() => setLocalPos(position), [position]);
2728
2849
  const getAllTooltips = useCallback4(() => {
2729
2850
  const response = [];
2730
2851
  const ev = new CustomEvent("requestGlobalTooltips", {
@@ -2829,7 +2950,7 @@ var DraggableTooltipComponent = ({
2829
2950
  },
2830
2951
  [alignmentGuides]
2831
2952
  );
2832
- useEffect4(() => {
2953
+ useEffect5(() => {
2833
2954
  let rafId = null;
2834
2955
  const handleMouseMove = (e) => {
2835
2956
  if (!dragging) return;
@@ -2871,7 +2992,7 @@ var DraggableTooltipComponent = ({
2871
2992
  document.body.style.userSelect = "";
2872
2993
  };
2873
2994
  }, [dragging, snapToGuides, updateAlignmentGuides, id, onPositionChange]);
2874
- useEffect4(() => {
2995
+ useEffect5(() => {
2875
2996
  const handleCloseAll = () => onClose(id);
2876
2997
  const handleRequestTooltipCount = () => {
2877
2998
  window.dispatchEvent(
@@ -2902,7 +3023,7 @@ var DraggableTooltipComponent = ({
2902
3023
  });
2903
3024
  };
2904
3025
  }, [id, localPos, onClose]);
2905
- useEffect4(() => {
3026
+ useEffect5(() => {
2906
3027
  if (dragging) return;
2907
3028
  let total = 0;
2908
3029
  const timeoutId = setTimeout(() => {
@@ -2920,7 +3041,7 @@ var DraggableTooltipComponent = ({
2920
3041
  }, 0);
2921
3042
  return () => clearTimeout(timeoutId);
2922
3043
  }, [localPos, dragging]);
2923
- useEffect4(() => {
3044
+ useEffect5(() => {
2924
3045
  const recount = () => {
2925
3046
  if (dragging) return;
2926
3047
  let total = 0;
@@ -3110,7 +3231,7 @@ var DraggableTooltipComponent = ({
3110
3231
  ] }) }),
3111
3232
  /* @__PURE__ */ jsxs19("div", { className: "p-3 pt-2 space-y-2", children: [
3112
3233
  /* @__PURE__ */ jsx24("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: dataLabel }),
3113
- useMemo4(
3234
+ useMemo5(
3114
3235
  () => visibleKeys.map((key) => {
3115
3236
  const value = data[key];
3116
3237
  if (value === void 0) return null;
@@ -3228,7 +3349,7 @@ var DraggableTooltipComponent = ({
3228
3349
  )
3229
3350
  ] });
3230
3351
  };
3231
- var DraggableTooltip = React12.memo(DraggableTooltipComponent);
3352
+ var DraggableTooltip = React13.memo(DraggableTooltipComponent);
3232
3353
  DraggableTooltip.displayName = "DraggableTooltip";
3233
3354
  var DraggableTooltip_default = DraggableTooltip;
3234
3355
 
@@ -3853,7 +3974,7 @@ var Chart = ({
3853
3974
  formatBR = false,
3854
3975
  chartMargin
3855
3976
  }) => {
3856
- const smartConfig = useMemo5(() => {
3977
+ const smartConfig = useMemo6(() => {
3857
3978
  const resolvedXAxisKey = typeof xAxis === "string" ? xAxis : xAxis && xAxis.dataKey || detectXAxis(data);
3858
3979
  const xAxisConfig2 = typeof xAxis === "string" ? {
3859
3980
  dataKey: resolvedXAxisKey,
@@ -3877,12 +3998,12 @@ var Chart = ({
3877
3998
  return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
3878
3999
  }, [data, xAxis, labelMap]);
3879
4000
  const { xAxisConfig, mapperConfig } = smartConfig;
3880
- const [activeTooltips, setActiveTooltips] = useState7([]);
3881
- const [highlightedSeries, setHighlightedSeries] = useState7(
4001
+ const [activeTooltips, setActiveTooltips] = useState8([]);
4002
+ const [highlightedSeries, setHighlightedSeries] = useState8(
3882
4003
  /* @__PURE__ */ new Set()
3883
4004
  );
3884
- const [showOnlyHighlighted, setShowOnlyHighlighted] = useState7(false);
3885
- useEffect5(() => {
4005
+ const [showOnlyHighlighted, setShowOnlyHighlighted] = useState8(false);
4006
+ useEffect6(() => {
3886
4007
  if (highlightedSeries.size === 0 && showOnlyHighlighted) {
3887
4008
  setShowOnlyHighlighted(false);
3888
4009
  }
@@ -3892,7 +4013,7 @@ var Chart = ({
3892
4013
  name: String(item[xAxisConfig.dataKey] || "N/A")
3893
4014
  }));
3894
4015
  const wrapperRef = useRef3(null);
3895
- const [measuredWidth, setMeasuredWidth] = useState7(null);
4016
+ const [measuredWidth, setMeasuredWidth] = useState8(null);
3896
4017
  useLayoutEffect(() => {
3897
4018
  const el = wrapperRef.current;
3898
4019
  if (!el) return;
@@ -3931,17 +4052,17 @@ var Chart = ({
3931
4052
  },
3932
4053
  [colors2, mapperConfig]
3933
4054
  );
3934
- const finalColors = useMemo5(
4055
+ const finalColors = useMemo6(
3935
4056
  () => generateColors(allKeys),
3936
4057
  [generateColors, allKeys]
3937
4058
  );
3938
- const biaxialConfigNormalized = useMemo5(() => {
4059
+ const biaxialConfigNormalized = useMemo6(() => {
3939
4060
  if (!biaxial) return null;
3940
4061
  if (typeof biaxial === "string") return { key: [biaxial] };
3941
4062
  if (Array.isArray(biaxial)) return { key: biaxial };
3942
4063
  return biaxial;
3943
4064
  }, [biaxial]);
3944
- useMemo5(() => {
4065
+ useMemo6(() => {
3945
4066
  if (!biaxialConfigNormalized) return;
3946
4067
  const leftLabelMissing = !yAxisLabel || String(yAxisLabel).trim() === "";
3947
4068
  const rightLabelMissing = !biaxialConfigNormalized.label || String(biaxialConfigNormalized.label).trim() === "";
@@ -3951,11 +4072,11 @@ var Chart = ({
3951
4072
  );
3952
4073
  }
3953
4074
  }, [biaxialConfigNormalized, yAxisLabel]);
3954
- const rightKeys = useMemo5(
4075
+ const rightKeys = useMemo6(
3955
4076
  () => biaxialConfigNormalized?.key ?? [],
3956
4077
  [biaxialConfigNormalized]
3957
4078
  );
3958
- const leftKeys = useMemo5(
4079
+ const leftKeys = useMemo6(
3959
4080
  () => allKeys.filter((k) => !rightKeys.includes(k)),
3960
4081
  [allKeys, rightKeys]
3961
4082
  );
@@ -3966,11 +4087,11 @@ var Chart = ({
3966
4087
  }),
3967
4088
  [xAxisConfig.dataKey]
3968
4089
  );
3969
- const activePeriods = useMemo5(
4090
+ const activePeriods = useMemo6(
3970
4091
  () => activeTooltips.map((t) => adaptDataForTooltip(t.data).name),
3971
4092
  [activeTooltips, adaptDataForTooltip]
3972
4093
  );
3973
- useEffect5(() => {
4094
+ useEffect6(() => {
3974
4095
  window.dispatchEvent(new Event("recountTooltips"));
3975
4096
  }, [activeTooltips.length]);
3976
4097
  const toggleHighlight = useCallback5((key) => {
@@ -3981,7 +4102,7 @@ var Chart = ({
3981
4102
  return next;
3982
4103
  });
3983
4104
  }, []);
3984
- const maxLeftDataValue = useMemo5(() => {
4105
+ const maxLeftDataValue = useMemo6(() => {
3985
4106
  let max = 0;
3986
4107
  const numericKeys = leftKeys.length > 0 ? leftKeys : allKeys;
3987
4108
  for (const row of processedData) {
@@ -3993,7 +4114,7 @@ var Chart = ({
3993
4114
  }
3994
4115
  return max;
3995
4116
  }, [processedData, leftKeys, allKeys]);
3996
- const minLeftDataValue = useMemo5(() => {
4117
+ const minLeftDataValue = useMemo6(() => {
3997
4118
  let min = 0;
3998
4119
  const numericKeys = leftKeys.length > 0 ? leftKeys : allKeys;
3999
4120
  for (const row of processedData) {
@@ -4006,7 +4127,7 @@ var Chart = ({
4006
4127
  }
4007
4128
  return min;
4008
4129
  }, [processedData, leftKeys, allKeys]);
4009
- const maxRightDataValue = useMemo5(() => {
4130
+ const maxRightDataValue = useMemo6(() => {
4010
4131
  let max = 0;
4011
4132
  if (rightKeys.length === 0) return max;
4012
4133
  for (const row of processedData) {
@@ -4018,7 +4139,7 @@ var Chart = ({
4018
4139
  }
4019
4140
  return max;
4020
4141
  }, [processedData, rightKeys]);
4021
- const minRightDataValue = useMemo5(() => {
4142
+ const minRightDataValue = useMemo6(() => {
4022
4143
  let min = 0;
4023
4144
  if (rightKeys.length === 0) return min;
4024
4145
  for (const row of processedData) {
@@ -4039,15 +4160,15 @@ var Chart = ({
4039
4160
  const padded = maxValue * (1 + padding);
4040
4161
  return niceCeil(padded);
4041
4162
  }, []);
4042
- const niceMaxLeft = useMemo5(
4163
+ const niceMaxLeft = useMemo6(
4043
4164
  () => computeNiceMax(maxLeftDataValue),
4044
4165
  [computeNiceMax, maxLeftDataValue]
4045
4166
  );
4046
- const niceMaxRight = useMemo5(
4167
+ const niceMaxRight = useMemo6(
4047
4168
  () => computeNiceMax(maxRightDataValue),
4048
4169
  [computeNiceMax, maxRightDataValue]
4049
4170
  );
4050
- const computedWidth = useMemo5(() => {
4171
+ const computedWidth = useMemo6(() => {
4051
4172
  if (typeof width === "number") return width;
4052
4173
  const points = Math.max(1, processedData.length);
4053
4174
  const barCount = series?.bar?.length ?? 0;
@@ -4158,11 +4279,11 @@ var Chart = ({
4158
4279
  },
4159
4280
  []
4160
4281
  );
4161
- const titleClassName = useMemo5(
4282
+ const titleClassName = useMemo6(
4162
4283
  () => "text-[1.4rem] font-semibold text-foreground mb-3",
4163
4284
  []
4164
4285
  );
4165
- const finalValueFormatter = useMemo5(() => {
4286
+ const finalValueFormatter = useMemo6(() => {
4166
4287
  const nf = new Intl.NumberFormat("pt-BR", {
4167
4288
  minimumFractionDigits: 2,
4168
4289
  maximumFractionDigits: 2
@@ -4202,7 +4323,7 @@ var Chart = ({
4202
4323
  };
4203
4324
  return builtIn;
4204
4325
  }, [valueFormatter2, formatBR]);
4205
- const yTickFormatter = useMemo5(() => {
4326
+ const yTickFormatter = useMemo6(() => {
4206
4327
  const nf = new Intl.NumberFormat("pt-BR", {
4207
4328
  minimumFractionDigits: 2,
4208
4329
  maximumFractionDigits: 2
@@ -4233,7 +4354,7 @@ var Chart = ({
4233
4354
  const containerPaddingLeft = -6;
4234
4355
  const finalChartRightMargin = chartMargin?.right ?? (rightKeys.length > 0 ? axisLabelMargin : defaultChartRightMargin);
4235
4356
  const finalChartLeftMargin = chartMargin?.left ?? (yAxisLabel ? axisLabelMargin : defaultChartLeftMargin);
4236
- const yAxisTickWidth = useMemo5(() => {
4357
+ const yAxisTickWidth = useMemo6(() => {
4237
4358
  if (typeof chartMargin?.left === "number") return chartMargin.left;
4238
4359
  if (yAxisLabel) return axisLabelMargin;
4239
4360
  const samples = [minLeftDataValue, niceMaxLeft, Math.round((minLeftDataValue + niceMaxLeft) / 2), 0];
@@ -4760,7 +4881,7 @@ var Chart = ({
4760
4881
  var Chart_default = Chart;
4761
4882
 
4762
4883
  // src/components/charts/BarChart.tsx
4763
- import { useState as useState8, useEffect as useEffect6, useCallback as useCallback6, useMemo as useMemo6 } from "react";
4884
+ import { useState as useState9, useEffect as useEffect7, useCallback as useCallback6, useMemo as useMemo7 } from "react";
4764
4885
  import {
4765
4886
  BarChart as RechartsBarChart,
4766
4887
  Bar as Bar2,
@@ -4802,7 +4923,7 @@ var BarChart = ({
4802
4923
  containerPaddingLeft,
4803
4924
  16
4804
4925
  );
4805
- const smartConfig = useMemo6(() => {
4926
+ const smartConfig = useMemo7(() => {
4806
4927
  const providedMapper = yAxis ?? mapper;
4807
4928
  if (autoDetect === true || xAxis == null || providedMapper == null) {
4808
4929
  const detectedXAxis = detectXAxis(data);
@@ -4852,14 +4973,14 @@ var BarChart = ({
4852
4973
  return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
4853
4974
  }, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
4854
4975
  const { xAxisConfig, mapperConfig } = smartConfig;
4855
- const [activeTooltips, setActiveTooltips] = useState8([]);
4856
- const [isDragging, setIsDragging] = useState8(null);
4857
- const [dragOffset, setDragOffset] = useState8({
4976
+ const [activeTooltips, setActiveTooltips] = useState9([]);
4977
+ const [isDragging, setIsDragging] = useState9(null);
4978
+ const [dragOffset, setDragOffset] = useState9({
4858
4979
  x: 0,
4859
4980
  y: 0
4860
4981
  });
4861
- const [globalTooltipCount, setGlobalTooltipCount] = useState8(0);
4862
- const [alignmentGuides, setAlignmentGuides] = useState8([]);
4982
+ const [globalTooltipCount, setGlobalTooltipCount] = useState9(0);
4983
+ const [alignmentGuides, setAlignmentGuides] = useState9([]);
4863
4984
  const processedData = data.map((item) => ({
4864
4985
  ...item,
4865
4986
  name: String(item[xAxisConfig.dataKey] || "N/A")
@@ -4882,7 +5003,7 @@ var BarChart = ({
4882
5003
  // Garantir que tem a propriedade 'name'
4883
5004
  };
4884
5005
  };
4885
- const maxDataValue = useMemo6(() => {
5006
+ const maxDataValue = useMemo7(() => {
4886
5007
  let max = 0;
4887
5008
  const keys = Object.keys(mapperConfig);
4888
5009
  for (const row of processedData) {
@@ -4895,7 +5016,7 @@ var BarChart = ({
4895
5016
  }
4896
5017
  return max;
4897
5018
  }, [processedData, mapperConfig]);
4898
- const niceMax = useMemo6(() => {
5019
+ const niceMax = useMemo7(() => {
4899
5020
  let padding2 = 0.08;
4900
5021
  if (maxDataValue > 1e6) padding2 = 0.05;
4901
5022
  if (maxDataValue > 1e7) padding2 = 0.03;
@@ -5062,7 +5183,7 @@ var BarChart = ({
5062
5183
  setIsDragging(tooltipId);
5063
5184
  setDragOffset({ x: offsetX, y: offsetY });
5064
5185
  };
5065
- useEffect6(() => {
5186
+ useEffect7(() => {
5066
5187
  let rafId;
5067
5188
  let lastMousePosition = { x: 0, y: 0 };
5068
5189
  const handleGlobalMouseMove = (e) => {
@@ -5120,7 +5241,7 @@ var BarChart = ({
5120
5241
  updateAlignmentGuides,
5121
5242
  snapToGuides
5122
5243
  ]);
5123
- useEffect6(() => {
5244
+ useEffect7(() => {
5124
5245
  const handleCloseAllTooltips = () => {
5125
5246
  setActiveTooltips([]);
5126
5247
  setGlobalTooltipCount(0);
@@ -5130,7 +5251,7 @@ var BarChart = ({
5130
5251
  window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
5131
5252
  };
5132
5253
  }, []);
5133
- useEffect6(() => {
5254
+ useEffect7(() => {
5134
5255
  const handleTooltipCountRequest = () => {
5135
5256
  window.dispatchEvent(
5136
5257
  new CustomEvent("tooltipCountResponse", {
@@ -5169,7 +5290,7 @@ var BarChart = ({
5169
5290
  );
5170
5291
  };
5171
5292
  }, [activeTooltips]);
5172
- useEffect6(() => {
5293
+ useEffect7(() => {
5173
5294
  if (isDragging) return;
5174
5295
  let totalCount = 0;
5175
5296
  const handleCountResponse = (event) => {
@@ -5435,7 +5556,7 @@ var BarChart = ({
5435
5556
  var BarChart_default = BarChart;
5436
5557
 
5437
5558
  // src/components/charts/LineChart.tsx
5438
- import { useState as useState9, useEffect as useEffect7, useCallback as useCallback7, useMemo as useMemo7 } from "react";
5559
+ import { useState as useState10, useEffect as useEffect8, useCallback as useCallback7, useMemo as useMemo8 } from "react";
5439
5560
  import {
5440
5561
  LineChart as RechartsLineChart,
5441
5562
  Line as Line2,
@@ -5478,14 +5599,14 @@ var CustomLineChart = ({
5478
5599
  containerPaddingLeft,
5479
5600
  16
5480
5601
  );
5481
- const [activeTooltips, setActiveTooltips] = useState9([]);
5482
- const [isDragging, setIsDragging] = useState9(null);
5483
- const [dragOffset, setDragOffset] = useState9({
5602
+ const [activeTooltips, setActiveTooltips] = useState10([]);
5603
+ const [isDragging, setIsDragging] = useState10(null);
5604
+ const [dragOffset, setDragOffset] = useState10({
5484
5605
  x: 0,
5485
5606
  y: 0
5486
5607
  });
5487
- const [globalTooltipCount, setGlobalTooltipCount] = useState9(0);
5488
- const [alignmentGuides, setAlignmentGuides] = useState9([]);
5608
+ const [globalTooltipCount, setGlobalTooltipCount] = useState10(0);
5609
+ const [alignmentGuides, setAlignmentGuides] = useState10([]);
5489
5610
  const generateColors = (dataKeys2) => {
5490
5611
  const colorMap = {};
5491
5612
  const allColors = generateAdditionalColors(colors2, dataKeys2.length);
@@ -5494,12 +5615,12 @@ var CustomLineChart = ({
5494
5615
  });
5495
5616
  return colorMap;
5496
5617
  };
5497
- const dataKeys = useMemo7(
5618
+ const dataKeys = useMemo8(
5498
5619
  () => data.length > 0 ? Object.keys(data[0]).filter((key) => key !== "name") : [],
5499
5620
  [data]
5500
5621
  );
5501
5622
  const finalColors = generateColors(dataKeys);
5502
- const maxDataValue = useMemo7(() => {
5623
+ const maxDataValue = useMemo8(() => {
5503
5624
  let max = 0;
5504
5625
  for (const row of data) {
5505
5626
  const r = row;
@@ -5511,7 +5632,7 @@ var CustomLineChart = ({
5511
5632
  }
5512
5633
  return max;
5513
5634
  }, [data, dataKeys]);
5514
- const niceMax = useMemo7(() => {
5635
+ const niceMax = useMemo8(() => {
5515
5636
  let padding2 = 0.08;
5516
5637
  if (maxDataValue > 1e6) padding2 = 0.05;
5517
5638
  if (maxDataValue > 1e7) padding2 = 0.03;
@@ -5699,7 +5820,7 @@ var CustomLineChart = ({
5699
5820
  setIsDragging(tooltipId);
5700
5821
  setDragOffset({ x: offsetX, y: offsetY });
5701
5822
  };
5702
- useEffect7(() => {
5823
+ useEffect8(() => {
5703
5824
  let rafId;
5704
5825
  let lastMousePosition = { x: 0, y: 0 };
5705
5826
  const handleGlobalMouseMove = (e) => {
@@ -5746,7 +5867,7 @@ var CustomLineChart = ({
5746
5867
  updateAlignmentGuides,
5747
5868
  snapToGuides
5748
5869
  ]);
5749
- useEffect7(() => {
5870
+ useEffect8(() => {
5750
5871
  const handleCloseAllTooltips2 = () => {
5751
5872
  setActiveTooltips([]);
5752
5873
  setGlobalTooltipCount(0);
@@ -5756,7 +5877,7 @@ var CustomLineChart = ({
5756
5877
  window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
5757
5878
  };
5758
5879
  }, []);
5759
- useEffect7(() => {
5880
+ useEffect8(() => {
5760
5881
  const handleTooltipCountRequest = () => {
5761
5882
  window.dispatchEvent(
5762
5883
  new CustomEvent("tooltipCountResponse", {
@@ -5800,7 +5921,7 @@ var CustomLineChart = ({
5800
5921
  );
5801
5922
  };
5802
5923
  }, [activeTooltips]);
5803
- useEffect7(() => {
5924
+ useEffect8(() => {
5804
5925
  if (isDragging) return;
5805
5926
  let totalCount = 0;
5806
5927
  const handleCountResponse = (event) => {
@@ -6129,12 +6250,12 @@ var CustomPieChart = ({
6129
6250
  var PieChart_default = CustomPieChart;
6130
6251
 
6131
6252
  // src/components/charts/hooks/useChartHighlights.tsx
6132
- import { useState as useState10, useCallback as useCallback8 } from "react";
6253
+ import { useState as useState11, useCallback as useCallback8 } from "react";
6133
6254
  var useChartHighlights = () => {
6134
- const [highlightedSeries, setHighlightedSeries] = useState10(
6255
+ const [highlightedSeries, setHighlightedSeries] = useState11(
6135
6256
  /* @__PURE__ */ new Set()
6136
6257
  );
6137
- const [showOnlyHighlighted, setShowOnlyHighlighted] = useState10(false);
6258
+ const [showOnlyHighlighted, setShowOnlyHighlighted] = useState11(false);
6138
6259
  const toggleHighlight = useCallback8((key) => {
6139
6260
  setHighlightedSeries((prev) => {
6140
6261
  const next = new Set(prev);
@@ -6202,10 +6323,10 @@ var useChartHighlights = () => {
6202
6323
  };
6203
6324
 
6204
6325
  // src/components/ui/data/AvatarBase.tsx
6205
- import * as React16 from "react";
6326
+ import * as React17 from "react";
6206
6327
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
6207
6328
  import { jsx as jsx33 } from "react/jsx-runtime";
6208
- var AvatarBase = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
6329
+ var AvatarBase = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
6209
6330
  AvatarPrimitive.Root,
6210
6331
  {
6211
6332
  ref,
@@ -6217,7 +6338,7 @@ var AvatarBase = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE
6217
6338
  }
6218
6339
  ));
6219
6340
  AvatarBase.displayName = AvatarPrimitive.Root.displayName;
6220
- var AvatarImageBase = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
6341
+ var AvatarImageBase = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
6221
6342
  AvatarPrimitive.Image,
6222
6343
  {
6223
6344
  ref,
@@ -6226,7 +6347,7 @@ var AvatarImageBase = React16.forwardRef(({ className, ...props }, ref) => /* @_
6226
6347
  }
6227
6348
  ));
6228
6349
  AvatarImageBase.displayName = AvatarPrimitive.Image.displayName;
6229
- var AvatarFallbackBase = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
6350
+ var AvatarFallbackBase = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
6230
6351
  AvatarPrimitive.Fallback,
6231
6352
  {
6232
6353
  ref,
@@ -6294,7 +6415,7 @@ function Badge({
6294
6415
  }
6295
6416
 
6296
6417
  // src/components/ui/data/CalendarBase.tsx
6297
- import { CaretLeftIcon, CaretRightIcon as CaretRightIcon2 } from "@phosphor-icons/react";
6418
+ import { CaretLeftIcon as CaretLeftIcon2, CaretRightIcon as CaretRightIcon3 } from "@phosphor-icons/react";
6298
6419
  import { DayPicker } from "react-day-picker";
6299
6420
  import { jsx as jsx35 } from "react/jsx-runtime";
6300
6421
  function CalendarBase({
@@ -6339,8 +6460,8 @@ function CalendarBase({
6339
6460
  ...classNames
6340
6461
  },
6341
6462
  components: {
6342
- IconLeft: () => /* @__PURE__ */ jsx35(CaretLeftIcon, { className: "h-4 w-4" }),
6343
- IconRight: () => /* @__PURE__ */ jsx35(CaretRightIcon2, { className: "h-4 w-4" })
6463
+ IconLeft: () => /* @__PURE__ */ jsx35(CaretLeftIcon2, { className: "h-4 w-4" }),
6464
+ IconRight: () => /* @__PURE__ */ jsx35(CaretRightIcon3, { className: "h-4 w-4" })
6344
6465
  },
6345
6466
  ...props
6346
6467
  }
@@ -6349,9 +6470,9 @@ function CalendarBase({
6349
6470
  CalendarBase.displayName = "Calendar";
6350
6471
 
6351
6472
  // src/components/ui/data/CardBase.tsx
6352
- import * as React17 from "react";
6473
+ import * as React18 from "react";
6353
6474
  import { jsx as jsx36 } from "react/jsx-runtime";
6354
- var CardBase = React17.forwardRef(({ className, testid: dataTestId = "card-base", ...props }, ref) => /* @__PURE__ */ jsx36(
6475
+ var CardBase = React18.forwardRef(({ className, testid: dataTestId = "card-base", ...props }, ref) => /* @__PURE__ */ jsx36(
6355
6476
  "div",
6356
6477
  {
6357
6478
  ref,
@@ -6364,7 +6485,7 @@ var CardBase = React17.forwardRef(({ className, testid: dataTestId = "card-base"
6364
6485
  }
6365
6486
  ));
6366
6487
  CardBase.displayName = "Card";
6367
- var CardHeaderBase = React17.forwardRef(({ className, testid: dataTestId = "card-header", ...props }, ref) => /* @__PURE__ */ jsx36(
6488
+ var CardHeaderBase = React18.forwardRef(({ className, testid: dataTestId = "card-header", ...props }, ref) => /* @__PURE__ */ jsx36(
6368
6489
  "div",
6369
6490
  {
6370
6491
  ref,
@@ -6374,7 +6495,7 @@ var CardHeaderBase = React17.forwardRef(({ className, testid: dataTestId = "card
6374
6495
  }
6375
6496
  ));
6376
6497
  CardHeaderBase.displayName = "CardHeader";
6377
- var CardTitleBase = React17.forwardRef(({ className, testid: dataTestId = "card-title", ...props }, ref) => /* @__PURE__ */ jsx36(
6498
+ var CardTitleBase = React18.forwardRef(({ className, testid: dataTestId = "card-title", ...props }, ref) => /* @__PURE__ */ jsx36(
6378
6499
  "div",
6379
6500
  {
6380
6501
  ref,
@@ -6384,7 +6505,7 @@ var CardTitleBase = React17.forwardRef(({ className, testid: dataTestId = "card-
6384
6505
  }
6385
6506
  ));
6386
6507
  CardTitleBase.displayName = "CardTitle";
6387
- var CardDescriptionBase = React17.forwardRef(({ className, testid: dataTestId = "card-description", ...props }, ref) => /* @__PURE__ */ jsx36(
6508
+ var CardDescriptionBase = React18.forwardRef(({ className, testid: dataTestId = "card-description", ...props }, ref) => /* @__PURE__ */ jsx36(
6388
6509
  "div",
6389
6510
  {
6390
6511
  ref,
@@ -6394,7 +6515,7 @@ var CardDescriptionBase = React17.forwardRef(({ className, testid: dataTestId =
6394
6515
  }
6395
6516
  ));
6396
6517
  CardDescriptionBase.displayName = "CardDescription";
6397
- var CardContentBase = React17.forwardRef(({ className, testid: dataTestId = "card-content", ...props }, ref) => /* @__PURE__ */ jsx36(
6518
+ var CardContentBase = React18.forwardRef(({ className, testid: dataTestId = "card-content", ...props }, ref) => /* @__PURE__ */ jsx36(
6398
6519
  "div",
6399
6520
  {
6400
6521
  ref,
@@ -6404,7 +6525,7 @@ var CardContentBase = React17.forwardRef(({ className, testid: dataTestId = "car
6404
6525
  }
6405
6526
  ));
6406
6527
  CardContentBase.displayName = "CardContent";
6407
- var CardFooterBase = React17.forwardRef(({ className, testid: dataTestId = "card-footer", ...props }, ref) => /* @__PURE__ */ jsx36(
6528
+ var CardFooterBase = React18.forwardRef(({ className, testid: dataTestId = "card-footer", ...props }, ref) => /* @__PURE__ */ jsx36(
6408
6529
  "div",
6409
6530
  {
6410
6531
  ref,
@@ -6416,7 +6537,7 @@ var CardFooterBase = React17.forwardRef(({ className, testid: dataTestId = "card
6416
6537
  CardFooterBase.displayName = "CardFooter";
6417
6538
 
6418
6539
  // src/components/ui/data/FileUploader.tsx
6419
- import * as React18 from "react";
6540
+ import * as React19 from "react";
6420
6541
  import { motion as motion10, AnimatePresence as AnimatePresence8 } from "framer-motion";
6421
6542
  import {
6422
6543
  CloudArrowUpIcon,
@@ -6498,7 +6619,7 @@ var createImagePreview = (file) => {
6498
6619
  reader.readAsDataURL(file);
6499
6620
  });
6500
6621
  };
6501
- var FileUploader = React18.forwardRef(
6622
+ var FileUploader = React19.forwardRef(
6502
6623
  ({
6503
6624
  className,
6504
6625
  accept,
@@ -6514,15 +6635,15 @@ var FileUploader = React18.forwardRef(
6514
6635
  animate = true,
6515
6636
  ...props
6516
6637
  }, ref) => {
6517
- const [isDragging, setIsDragging] = React18.useState(false);
6518
- const [files, setFiles] = React18.useState(value);
6519
- const inputRef = React18.useRef(null);
6520
- const dragCounterRef = React18.useRef(0);
6638
+ const [isDragging, setIsDragging] = React19.useState(false);
6639
+ const [files, setFiles] = React19.useState(value);
6640
+ const inputRef = React19.useRef(null);
6641
+ const dragCounterRef = React19.useRef(0);
6521
6642
  const multiple = maxFiles > 1;
6522
- React18.useEffect(() => {
6643
+ React19.useEffect(() => {
6523
6644
  setFiles(value);
6524
6645
  }, [value]);
6525
- React18.useEffect(() => {
6646
+ React19.useEffect(() => {
6526
6647
  return () => {
6527
6648
  files.forEach((file) => {
6528
6649
  if (file.preview) {
@@ -6872,13 +6993,13 @@ var FileUploader = React18.forwardRef(
6872
6993
  FileUploader.displayName = "FileUploader";
6873
6994
 
6874
6995
  // src/components/ui/feedback/AlertDialogBase.tsx
6875
- import * as React19 from "react";
6996
+ import * as React20 from "react";
6876
6997
  import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
6877
6998
  import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
6878
6999
  var AlertDialogBase = AlertDialogPrimitive.Root;
6879
7000
  var AlertDialogTriggerBase = AlertDialogPrimitive.Trigger;
6880
7001
  var AlertDialogPortalBase = AlertDialogPrimitive.Portal;
6881
- var AlertDialogOverlayBase = React19.forwardRef(({ className, testid = "alertdialog-overlay", ...props }, ref) => /* @__PURE__ */ jsx38(
7002
+ var AlertDialogOverlayBase = React20.forwardRef(({ className, testid = "alertdialog-overlay", ...props }, ref) => /* @__PURE__ */ jsx38(
6882
7003
  AlertDialogPrimitive.Overlay,
6883
7004
  {
6884
7005
  className: cn(
@@ -6891,7 +7012,7 @@ var AlertDialogOverlayBase = React19.forwardRef(({ className, testid = "alertdia
6891
7012
  }
6892
7013
  ));
6893
7014
  AlertDialogOverlayBase.displayName = AlertDialogPrimitive.Overlay.displayName;
6894
- var AlertDialogContentBase = React19.forwardRef(({ className, testid = "alertdialog-content", ...props }, ref) => /* @__PURE__ */ jsxs29(AlertDialogPortalBase, { children: [
7015
+ var AlertDialogContentBase = React20.forwardRef(({ className, testid = "alertdialog-content", ...props }, ref) => /* @__PURE__ */ jsxs29(AlertDialogPortalBase, { children: [
6895
7016
  /* @__PURE__ */ jsx38(AlertDialogOverlayBase, {}),
6896
7017
  /* @__PURE__ */ jsx38(
6897
7018
  AlertDialogPrimitive.Content,
@@ -6935,7 +7056,7 @@ var AlertDialogFooterBase = ({
6935
7056
  }
6936
7057
  );
6937
7058
  AlertDialogFooterBase.displayName = "AlertDialogFooterBase";
6938
- var AlertDialogTitleBase = React19.forwardRef(({ className, testid = "alertdialog-title", ...props }, ref) => /* @__PURE__ */ jsx38(
7059
+ var AlertDialogTitleBase = React20.forwardRef(({ className, testid = "alertdialog-title", ...props }, ref) => /* @__PURE__ */ jsx38(
6939
7060
  AlertDialogPrimitive.Title,
6940
7061
  {
6941
7062
  ref,
@@ -6945,7 +7066,7 @@ var AlertDialogTitleBase = React19.forwardRef(({ className, testid = "alertdialo
6945
7066
  }
6946
7067
  ));
6947
7068
  AlertDialogTitleBase.displayName = AlertDialogPrimitive.Title.displayName;
6948
- var AlertDialogDescriptionBase = React19.forwardRef(({ className, testid = "alertdialog-description", ...props }, ref) => /* @__PURE__ */ jsx38(
7069
+ var AlertDialogDescriptionBase = React20.forwardRef(({ className, testid = "alertdialog-description", ...props }, ref) => /* @__PURE__ */ jsx38(
6949
7070
  AlertDialogPrimitive.Description,
6950
7071
  {
6951
7072
  ref,
@@ -6955,7 +7076,7 @@ var AlertDialogDescriptionBase = React19.forwardRef(({ className, testid = "aler
6955
7076
  }
6956
7077
  ));
6957
7078
  AlertDialogDescriptionBase.displayName = AlertDialogPrimitive.Description.displayName;
6958
- var AlertDialogActionBase = React19.forwardRef(({ className, testid = "alertdialog-action", ...props }, ref) => /* @__PURE__ */ jsx38(
7079
+ var AlertDialogActionBase = React20.forwardRef(({ className, testid = "alertdialog-action", ...props }, ref) => /* @__PURE__ */ jsx38(
6959
7080
  AlertDialogPrimitive.Action,
6960
7081
  {
6961
7082
  ref,
@@ -6965,7 +7086,7 @@ var AlertDialogActionBase = React19.forwardRef(({ className, testid = "alertdial
6965
7086
  }
6966
7087
  ));
6967
7088
  AlertDialogActionBase.displayName = AlertDialogPrimitive.Action.displayName;
6968
- var AlertDialogCancelBase = React19.forwardRef(({ className, testid = "alertdialog-cancel", ...props }, ref) => /* @__PURE__ */ jsx38(
7089
+ var AlertDialogCancelBase = React20.forwardRef(({ className, testid = "alertdialog-cancel", ...props }, ref) => /* @__PURE__ */ jsx38(
6969
7090
  AlertDialogPrimitive.Cancel,
6970
7091
  {
6971
7092
  ref,
@@ -6977,7 +7098,7 @@ var AlertDialogCancelBase = React19.forwardRef(({ className, testid = "alertdial
6977
7098
  AlertDialogCancelBase.displayName = AlertDialogPrimitive.Cancel.displayName;
6978
7099
 
6979
7100
  // src/components/ui/feedback/DestructiveDialog.tsx
6980
- import * as React20 from "react";
7101
+ import * as React21 from "react";
6981
7102
  import { XCircleIcon } from "@phosphor-icons/react";
6982
7103
  import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
6983
7104
  var DestructiveDialog = ({
@@ -6989,7 +7110,7 @@ var DestructiveDialog = ({
6989
7110
  triggerContent,
6990
7111
  className
6991
7112
  }) => {
6992
- const triggerEl = React20.isValidElement(children) ? /* @__PURE__ */ jsx39(AlertDialogTriggerBase, { asChild: true, children }) : /* @__PURE__ */ jsx39(AlertDialogTriggerBase, { children: /* @__PURE__ */ jsx39(ButtonBase, { variant: "destructive", children: triggerContent ?? "Excluir" }) });
7113
+ const triggerEl = React21.isValidElement(children) ? /* @__PURE__ */ jsx39(AlertDialogTriggerBase, { asChild: true, children }) : /* @__PURE__ */ jsx39(AlertDialogTriggerBase, { children: /* @__PURE__ */ jsx39(ButtonBase, { variant: "destructive", children: triggerContent ?? "Excluir" }) });
6993
7114
  return /* @__PURE__ */ jsxs30(AlertDialogBase, { children: [
6994
7115
  triggerEl,
6995
7116
  /* @__PURE__ */ jsxs30(
@@ -7034,7 +7155,7 @@ var DestructiveDialog = ({
7034
7155
  };
7035
7156
 
7036
7157
  // src/components/ui/feedback/LoadingBase.tsx
7037
- import * as React21 from "react";
7158
+ import * as React22 from "react";
7038
7159
  import { cva as cva3 } from "class-variance-authority";
7039
7160
  import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
7040
7161
  var loadingVariants = cva3(
@@ -7085,9 +7206,9 @@ var dotVariants = cva3(
7085
7206
  }
7086
7207
  }
7087
7208
  );
7088
- var LoadingBase = React21.forwardRef(
7209
+ var LoadingBase = React22.forwardRef(
7089
7210
  ({ className, size, message, overlay = false, variant = "spinner", ...props }, ref) => {
7090
- React21.useEffect(() => {
7211
+ React22.useEffect(() => {
7091
7212
  const style = document.createElement("style");
7092
7213
  style.textContent = `
7093
7214
  @keyframes dotBounce {
@@ -7205,7 +7326,7 @@ var LoadingBase = React21.forwardRef(
7205
7326
  LoadingBase.displayName = "LoadingBase";
7206
7327
 
7207
7328
  // src/components/ui/feedback/ModalBase.tsx
7208
- import * as React22 from "react";
7329
+ import * as React23 from "react";
7209
7330
  import * as DialogPrimitive2 from "@radix-ui/react-dialog";
7210
7331
  import { XIcon as XIcon6 } from "@phosphor-icons/react";
7211
7332
  import { jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
@@ -7213,7 +7334,7 @@ var ModalBase = DialogPrimitive2.Root;
7213
7334
  var ModalTriggerBase = DialogPrimitive2.Trigger;
7214
7335
  var ModalPortalBase = DialogPrimitive2.Portal;
7215
7336
  var ModalCloseBase = DialogPrimitive2.Close;
7216
- var ModalOverlayBase = React22.forwardRef(({ className, testid: dataTestId = "modal-overlay", ...props }, ref) => /* @__PURE__ */ jsx41(
7337
+ var ModalOverlayBase = React23.forwardRef(({ className, testid: dataTestId = "modal-overlay", ...props }, ref) => /* @__PURE__ */ jsx41(
7217
7338
  DialogPrimitive2.Overlay,
7218
7339
  {
7219
7340
  ref,
@@ -7226,7 +7347,7 @@ var ModalOverlayBase = React22.forwardRef(({ className, testid: dataTestId = "mo
7226
7347
  }
7227
7348
  ));
7228
7349
  ModalOverlayBase.displayName = DialogPrimitive2.Overlay.displayName;
7229
- var ModalContentBase = React22.forwardRef(
7350
+ var ModalContentBase = React23.forwardRef(
7230
7351
  ({
7231
7352
  className,
7232
7353
  children,
@@ -7290,7 +7411,7 @@ var ModalContentBase = React22.forwardRef(
7290
7411
  }
7291
7412
  );
7292
7413
  ModalContentBase.displayName = DialogPrimitive2.Content.displayName;
7293
- var ModalHeaderBase = React22.forwardRef(({ className, testid: dataTestId = "modal-header", ...props }, ref) => /* @__PURE__ */ jsx41(
7414
+ var ModalHeaderBase = React23.forwardRef(({ className, testid: dataTestId = "modal-header", ...props }, ref) => /* @__PURE__ */ jsx41(
7294
7415
  "div",
7295
7416
  {
7296
7417
  ref,
@@ -7303,7 +7424,7 @@ var ModalHeaderBase = React22.forwardRef(({ className, testid: dataTestId = "mod
7303
7424
  }
7304
7425
  ));
7305
7426
  ModalHeaderBase.displayName = "ModalHeader";
7306
- var ModalFooterBase = React22.forwardRef(({ className, testid: dataTestId = "modal-footer", ...props }, ref) => /* @__PURE__ */ jsx41(
7427
+ var ModalFooterBase = React23.forwardRef(({ className, testid: dataTestId = "modal-footer", ...props }, ref) => /* @__PURE__ */ jsx41(
7307
7428
  "div",
7308
7429
  {
7309
7430
  ref,
@@ -7316,7 +7437,7 @@ var ModalFooterBase = React22.forwardRef(({ className, testid: dataTestId = "mod
7316
7437
  }
7317
7438
  ));
7318
7439
  ModalFooterBase.displayName = "ModalFooter";
7319
- var ModalTitleBase = React22.forwardRef(({ className, testid: dataTestId = "modal-title", ...props }, ref) => /* @__PURE__ */ jsx41(
7440
+ var ModalTitleBase = React23.forwardRef(({ className, testid: dataTestId = "modal-title", ...props }, ref) => /* @__PURE__ */ jsx41(
7320
7441
  DialogPrimitive2.Title,
7321
7442
  {
7322
7443
  ref,
@@ -7329,7 +7450,7 @@ var ModalTitleBase = React22.forwardRef(({ className, testid: dataTestId = "moda
7329
7450
  }
7330
7451
  ));
7331
7452
  ModalTitleBase.displayName = DialogPrimitive2.Title.displayName;
7332
- var ModalDescriptionBase = React22.forwardRef(({ className, testid: dataTestId = "modal-description", ...props }, ref) => /* @__PURE__ */ jsx41(
7453
+ var ModalDescriptionBase = React23.forwardRef(({ className, testid: dataTestId = "modal-description", ...props }, ref) => /* @__PURE__ */ jsx41(
7333
7454
  DialogPrimitive2.Description,
7334
7455
  {
7335
7456
  ref,
@@ -7341,10 +7462,10 @@ var ModalDescriptionBase = React22.forwardRef(({ className, testid: dataTestId =
7341
7462
  ModalDescriptionBase.displayName = DialogPrimitive2.Description.displayName;
7342
7463
 
7343
7464
  // src/components/ui/feedback/ProgressBase.tsx
7344
- import * as React23 from "react";
7465
+ import * as React24 from "react";
7345
7466
  import * as ProgressPrimitive from "@radix-ui/react-progress";
7346
7467
  import { jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
7347
- var ProgressBase = React23.forwardRef(
7468
+ var ProgressBase = React24.forwardRef(
7348
7469
  ({
7349
7470
  className,
7350
7471
  value: rawValue,
@@ -7526,7 +7647,7 @@ var ProgressPanelsBase = ({
7526
7647
  /* @__PURE__ */ jsx42("div", { className: "flex w-full gap-1 rounded-lg overflow-hidden", children: steps.map((step, idx) => {
7527
7648
  const isActive = idx === currentStep;
7528
7649
  const isLast = idx === steps.length - 1;
7529
- return /* @__PURE__ */ jsxs33(React23.Fragment, { children: [
7650
+ return /* @__PURE__ */ jsxs33(React24.Fragment, { children: [
7530
7651
  /* @__PURE__ */ jsxs33(
7531
7652
  "div",
7532
7653
  {
@@ -7684,17 +7805,17 @@ var toast2 = {
7684
7805
  };
7685
7806
 
7686
7807
  // src/components/ui/form/CheckBoxBase.tsx
7687
- import * as React24 from "react";
7808
+ import * as React25 from "react";
7688
7809
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
7689
7810
  import { CheckIcon as CheckIcon8, MinusIcon } from "@phosphor-icons/react";
7690
7811
  import { motion as motion11 } from "framer-motion";
7691
7812
  import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
7692
- var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", checked: checkedProp, defaultChecked, onCheckedChange, ...props }, ref) => {
7813
+ var CheckboxBase = React25.forwardRef(({ className, testid: dataTestId = "checkbox-base", checked: checkedProp, defaultChecked, onCheckedChange, ...props }, ref) => {
7693
7814
  const isControlled = checkedProp !== void 0;
7694
- const [checkedState, setCheckedState] = React24.useState(
7815
+ const [checkedState, setCheckedState] = React25.useState(
7695
7816
  isControlled ? checkedProp : defaultChecked ?? false
7696
7817
  );
7697
- React24.useEffect(() => {
7818
+ React25.useEffect(() => {
7698
7819
  if (isControlled) setCheckedState(checkedProp);
7699
7820
  }, [checkedProp, isControlled]);
7700
7821
  const handleCheckedChange = (next) => {
@@ -7736,15 +7857,15 @@ var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkb
7736
7857
  CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
7737
7858
 
7738
7859
  // src/components/ui/form/CollapsibleBase.tsx
7739
- import * as React25 from "react";
7860
+ import * as React26 from "react";
7740
7861
  import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
7741
7862
  import { CaretUpDownIcon } from "@phosphor-icons/react";
7742
7863
  import { jsx as jsx46, jsxs as jsxs35 } from "react/jsx-runtime";
7743
- var CollapsibleBase = React25.forwardRef(({ ...props }, ref) => {
7864
+ var CollapsibleBase = React26.forwardRef(({ ...props }, ref) => {
7744
7865
  return /* @__PURE__ */ jsx46(CollapsiblePrimitive.Root, { ref, "data-slot": "collapsible", ...props });
7745
7866
  });
7746
7867
  CollapsibleBase.displayName = CollapsiblePrimitive.Root.displayName;
7747
- var CollapsibleTriggerBase = React25.forwardRef(({ className, children, leftIcon, showCaret = true, ...props }, ref) => {
7868
+ var CollapsibleTriggerBase = React26.forwardRef(({ className, children, leftIcon, showCaret = true, ...props }, ref) => {
7748
7869
  return /* @__PURE__ */ jsxs35(
7749
7870
  CollapsiblePrimitive.CollapsibleTrigger,
7750
7871
  {
@@ -7766,7 +7887,7 @@ var CollapsibleTriggerBase = React25.forwardRef(({ className, children, leftIcon
7766
7887
  );
7767
7888
  });
7768
7889
  CollapsibleTriggerBase.displayName = CollapsiblePrimitive.CollapsibleTrigger.displayName;
7769
- var CollapsibleContentBase = React25.forwardRef(({ className, children, ...props }, ref) => {
7890
+ var CollapsibleContentBase = React26.forwardRef(({ className, children, ...props }, ref) => {
7770
7891
  return /* @__PURE__ */ jsx46(
7771
7892
  CollapsiblePrimitive.CollapsibleContent,
7772
7893
  {
@@ -7784,7 +7905,7 @@ var CollapsibleContentBase = React25.forwardRef(({ className, children, ...props
7784
7905
  CollapsibleContentBase.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
7785
7906
 
7786
7907
  // src/components/ui/form/HoverCardBase.tsx
7787
- import * as React26 from "react";
7908
+ import * as React27 from "react";
7788
7909
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
7789
7910
  import { jsx as jsx47, jsxs as jsxs36 } from "react/jsx-runtime";
7790
7911
  function HoverCardBase(props) {
@@ -7793,7 +7914,7 @@ function HoverCardBase(props) {
7793
7914
  function HoverCardTriggerBase(props) {
7794
7915
  return /* @__PURE__ */ jsx47(HoverCardPrimitive.Trigger, { ...props });
7795
7916
  }
7796
- var HoverCardContentBase = React26.forwardRef(
7917
+ var HoverCardContentBase = React27.forwardRef(
7797
7918
  ({ className, align = "center", sideOffset = 6, children, ...props }, ref) => {
7798
7919
  return /* @__PURE__ */ jsx47(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsxs36(
7799
7920
  HoverCardPrimitive.Content,
@@ -7839,7 +7960,7 @@ var HoverCardContentBase = React26.forwardRef(
7839
7960
  HoverCardContentBase.displayName = HoverCardPrimitive.Content.displayName;
7840
7961
 
7841
7962
  // src/components/ui/form/Input-OTP-Base.tsx
7842
- import * as React27 from "react";
7963
+ import * as React28 from "react";
7843
7964
  import { OTPInput, OTPInputContext } from "input-otp";
7844
7965
  import { MinusIcon as MinusIcon2 } from "@phosphor-icons/react";
7845
7966
  import { jsx as jsx48, jsxs as jsxs37 } from "react/jsx-runtime";
@@ -7876,7 +7997,7 @@ function InputOTPSlotBase({
7876
7997
  className,
7877
7998
  ...props
7878
7999
  }) {
7879
- const inputOTPContext = React27.useContext(OTPInputContext);
8000
+ const inputOTPContext = React28.useContext(OTPInputContext);
7880
8001
  const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
7881
8002
  return /* @__PURE__ */ jsxs37(
7882
8003
  "div",
@@ -7900,10 +8021,10 @@ function InputOTPSeparatorBase({ ...props }) {
7900
8021
  }
7901
8022
 
7902
8023
  // src/components/ui/form/SliderBase.tsx
7903
- import * as React28 from "react";
8024
+ import * as React29 from "react";
7904
8025
  import * as SliderPrimitive from "@radix-ui/react-slider";
7905
8026
  import { jsx as jsx49, jsxs as jsxs38 } from "react/jsx-runtime";
7906
- var SlideBase = React28.forwardRef(
8027
+ var SlideBase = React29.forwardRef(
7907
8028
  ({
7908
8029
  className,
7909
8030
  orientation = "horizontal",
@@ -7983,7 +8104,7 @@ var SlideBase = React28.forwardRef(
7983
8104
  SlideBase.displayName = "SlideBase";
7984
8105
 
7985
8106
  // src/components/ui/form/SmallButtons.tsx
7986
- import * as React29 from "react";
8107
+ import * as React30 from "react";
7987
8108
  import {
7988
8109
  PencilSimpleIcon,
7989
8110
  FloppyDiskIcon,
@@ -8009,7 +8130,7 @@ import {
8009
8130
  ArrowsLeftRightIcon
8010
8131
  } from "@phosphor-icons/react";
8011
8132
  import { jsx as jsx50 } from "react/jsx-runtime";
8012
- var EditButton = React29.forwardRef(
8133
+ var EditButton = React30.forwardRef(
8013
8134
  ({
8014
8135
  disabled,
8015
8136
  onClick,
@@ -8049,7 +8170,7 @@ var EditButton = React29.forwardRef(
8049
8170
  )
8050
8171
  );
8051
8172
  EditButton.displayName = "EditButton";
8052
- var ChangeButton = React29.forwardRef(
8173
+ var ChangeButton = React30.forwardRef(
8053
8174
  ({
8054
8175
  disabled,
8055
8176
  onClick,
@@ -8089,7 +8210,7 @@ var ChangeButton = React29.forwardRef(
8089
8210
  )
8090
8211
  );
8091
8212
  ChangeButton.displayName = "ChangeButton";
8092
- var SaveButton = React29.forwardRef(
8213
+ var SaveButton = React30.forwardRef(
8093
8214
  ({
8094
8215
  disabled,
8095
8216
  onClick,
@@ -8129,7 +8250,7 @@ var SaveButton = React29.forwardRef(
8129
8250
  )
8130
8251
  );
8131
8252
  SaveButton.displayName = "SaveButton";
8132
- var AddButton = React29.forwardRef(
8253
+ var AddButton = React30.forwardRef(
8133
8254
  ({
8134
8255
  disabled,
8135
8256
  onClick,
@@ -8169,7 +8290,7 @@ var AddButton = React29.forwardRef(
8169
8290
  )
8170
8291
  );
8171
8292
  AddButton.displayName = "AddButton";
8172
- var CloseButton = React29.forwardRef(
8293
+ var CloseButton = React30.forwardRef(
8173
8294
  ({
8174
8295
  disabled,
8175
8296
  onClick,
@@ -8709,10 +8830,10 @@ var LockButton = ({
8709
8830
  var UnlockButton = (props) => /* @__PURE__ */ jsx50(LockButton, { isLocked: false, testid: "button-unlock", ...props });
8710
8831
 
8711
8832
  // src/components/ui/form/SwitchBase.tsx
8712
- import * as React30 from "react";
8833
+ import * as React31 from "react";
8713
8834
  import * as SwitchPrimitives from "@radix-ui/react-switch";
8714
8835
  import { jsx as jsx51 } from "react/jsx-runtime";
8715
- var SwitchBase = React30.forwardRef(({ className, testid: dataTestId = "switch-base", ...props }, ref) => {
8836
+ var SwitchBase = React31.forwardRef(({ className, testid: dataTestId = "switch-base", ...props }, ref) => {
8716
8837
  return /* @__PURE__ */ jsx51(
8717
8838
  SwitchPrimitives.Root,
8718
8839
  {
@@ -8741,18 +8862,18 @@ var SwitchBase = React30.forwardRef(({ className, testid: dataTestId = "switch-b
8741
8862
  SwitchBase.displayName = SwitchPrimitives.Root.displayName;
8742
8863
 
8743
8864
  // src/components/ui/form/TextAreaBase.tsx
8744
- import * as React31 from "react";
8865
+ import * as React32 from "react";
8745
8866
  import { motion as motion12 } from "framer-motion";
8746
8867
  import { TrashIcon as TrashIcon2 } from "@phosphor-icons/react";
8747
8868
  import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
8748
- var TextAreaBase = React31.forwardRef(
8869
+ var TextAreaBase = React32.forwardRef(
8749
8870
  ({ className, clearable = false, onClear, ...props }, ref) => {
8750
- const [isFocused, setIsFocused] = React31.useState(false);
8751
- const [hasContent, setHasContent] = React31.useState(
8871
+ const [isFocused, setIsFocused] = React32.useState(false);
8872
+ const [hasContent, setHasContent] = React32.useState(
8752
8873
  !!props.value || !!props.defaultValue
8753
8874
  );
8754
- const [showConfirmTooltip, setShowConfirmTooltip] = React31.useState(false);
8755
- const textareaRef = React31.useRef(null);
8875
+ const [showConfirmTooltip, setShowConfirmTooltip] = React32.useState(false);
8876
+ const textareaRef = React32.useRef(null);
8756
8877
  const handleFocus = (e) => {
8757
8878
  setIsFocused(true);
8758
8879
  props.onFocus?.(e);
@@ -8788,8 +8909,8 @@ var TextAreaBase = React31.forwardRef(
8788
8909
  const handleCancelClear = () => {
8789
8910
  setShowConfirmTooltip(false);
8790
8911
  };
8791
- React31.useImperativeHandle(ref, () => textareaRef.current);
8792
- React31.useEffect(() => {
8912
+ React32.useImperativeHandle(ref, () => textareaRef.current);
8913
+ React32.useEffect(() => {
8793
8914
  setHasContent(!!props.value || !!props.defaultValue);
8794
8915
  }, [props.value, props.defaultValue]);
8795
8916
  return /* @__PURE__ */ jsxs39("div", { className: "relative", children: [
@@ -8916,13 +9037,13 @@ var TextAreaBase = React31.forwardRef(
8916
9037
  TextAreaBase.displayName = "TextAreaBase";
8917
9038
 
8918
9039
  // src/components/ui/layout/CarouselBase.tsx
8919
- import * as React32 from "react";
9040
+ import * as React33 from "react";
8920
9041
  import useEmblaCarousel from "embla-carousel-react";
8921
9042
  import { ArrowLeftIcon as ArrowLeftIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@phosphor-icons/react";
8922
9043
  import { jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
8923
- var CarouselContext = React32.createContext(null);
9044
+ var CarouselContext = React33.createContext(null);
8924
9045
  function useCarousel() {
8925
- const context = React32.useContext(CarouselContext);
9046
+ const context = React33.useContext(CarouselContext);
8926
9047
  if (!context) {
8927
9048
  throw new Error("useCarousel must be used within a <CarouselBase />");
8928
9049
  }
@@ -8944,20 +9065,20 @@ function CarouselBase({
8944
9065
  },
8945
9066
  plugins
8946
9067
  );
8947
- const [canScrollPrev, setCanScrollPrev] = React32.useState(false);
8948
- const [canScrollNext, setCanScrollNext] = React32.useState(false);
8949
- const onSelect = React32.useCallback((api2) => {
9068
+ const [canScrollPrev, setCanScrollPrev] = React33.useState(false);
9069
+ const [canScrollNext, setCanScrollNext] = React33.useState(false);
9070
+ const onSelect = React33.useCallback((api2) => {
8950
9071
  if (!api2) return;
8951
9072
  setCanScrollPrev(api2.canScrollPrev());
8952
9073
  setCanScrollNext(api2.canScrollNext());
8953
9074
  }, []);
8954
- const scrollPrev = React32.useCallback(() => {
9075
+ const scrollPrev = React33.useCallback(() => {
8955
9076
  api?.scrollPrev();
8956
9077
  }, [api]);
8957
- const scrollNext = React32.useCallback(() => {
9078
+ const scrollNext = React33.useCallback(() => {
8958
9079
  api?.scrollNext();
8959
9080
  }, [api]);
8960
- const handleKeyDown = React32.useCallback(
9081
+ const handleKeyDown = React33.useCallback(
8961
9082
  (event) => {
8962
9083
  if (event.key === "ArrowLeft") {
8963
9084
  event.preventDefault();
@@ -8969,11 +9090,11 @@ function CarouselBase({
8969
9090
  },
8970
9091
  [scrollPrev, scrollNext]
8971
9092
  );
8972
- React32.useEffect(() => {
9093
+ React33.useEffect(() => {
8973
9094
  if (!api || !setApi) return;
8974
9095
  setApi(api);
8975
9096
  }, [api, setApi]);
8976
- React32.useEffect(() => {
9097
+ React33.useEffect(() => {
8977
9098
  if (!api) return;
8978
9099
  onSelect(api);
8979
9100
  api.on("reInit", onSelect);
@@ -9062,7 +9183,7 @@ function CarouselPreviousBase({
9062
9183
  ...props
9063
9184
  }) {
9064
9185
  const { orientation, scrollPrev, canScrollPrev } = useCarousel();
9065
- const btnRef = React32.useRef(null);
9186
+ const btnRef = React33.useRef(null);
9066
9187
  return /* @__PURE__ */ jsxs40(
9067
9188
  ButtonBase,
9068
9189
  {
@@ -9092,7 +9213,7 @@ function CarouselNextBase({
9092
9213
  ...props
9093
9214
  }) {
9094
9215
  const { orientation, scrollNext, canScrollNext } = useCarousel();
9095
- const btnRef = React32.useRef(null);
9216
+ const btnRef = React33.useRef(null);
9096
9217
  return /* @__PURE__ */ jsxs40(
9097
9218
  ButtonBase,
9098
9219
  {
@@ -9117,11 +9238,11 @@ function CarouselNextBase({
9117
9238
  }
9118
9239
 
9119
9240
  // src/components/ui/layout/SeparatorBase.tsx
9120
- import * as React33 from "react";
9241
+ import * as React34 from "react";
9121
9242
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
9122
9243
  import { motion as motion13 } from "framer-motion";
9123
9244
  import { jsx as jsx54 } from "react/jsx-runtime";
9124
- var SeparatorBase = React33.forwardRef(
9245
+ var SeparatorBase = React34.forwardRef(
9125
9246
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
9126
9247
  const isHorizontal = orientation === "horizontal";
9127
9248
  return /* @__PURE__ */ jsx54(
@@ -9155,9 +9276,9 @@ var SeparatorBase = React33.forwardRef(
9155
9276
  SeparatorBase.displayName = SeparatorPrimitive.Root.displayName;
9156
9277
 
9157
9278
  // src/components/ui/layout/TableBase.tsx
9158
- import * as React34 from "react";
9279
+ import * as React35 from "react";
9159
9280
  import { jsx as jsx55 } from "react/jsx-runtime";
9160
- var TableBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx55(
9281
+ var TableBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx55(
9161
9282
  "table",
9162
9283
  {
9163
9284
  ref,
@@ -9166,9 +9287,9 @@ var TableBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE_
9166
9287
  }
9167
9288
  ) }));
9168
9289
  TableBase.displayName = "TableBase";
9169
- var TableHeaderBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
9290
+ var TableHeaderBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
9170
9291
  TableHeaderBase.displayName = "TableHeaderBase";
9171
- var TableBodyBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9292
+ var TableBodyBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9172
9293
  "tbody",
9173
9294
  {
9174
9295
  ref,
@@ -9177,7 +9298,7 @@ var TableBodyBase = React34.forwardRef(({ className, ...props }, ref) => /* @__P
9177
9298
  }
9178
9299
  ));
9179
9300
  TableBodyBase.displayName = "TableBodyBase";
9180
- var TableFooterBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9301
+ var TableFooterBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9181
9302
  "tfoot",
9182
9303
  {
9183
9304
  ref,
@@ -9189,7 +9310,7 @@ var TableFooterBase = React34.forwardRef(({ className, ...props }, ref) => /* @_
9189
9310
  }
9190
9311
  ));
9191
9312
  TableFooterBase.displayName = "TableFooterBase";
9192
- var TableRowBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9313
+ var TableRowBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9193
9314
  "tr",
9194
9315
  {
9195
9316
  ref,
@@ -9201,7 +9322,7 @@ var TableRowBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PU
9201
9322
  }
9202
9323
  ));
9203
9324
  TableRowBase.displayName = "TableRowBase";
9204
- var TableHeadBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9325
+ var TableHeadBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9205
9326
  "th",
9206
9327
  {
9207
9328
  ref,
@@ -9213,7 +9334,7 @@ var TableHeadBase = React34.forwardRef(({ className, ...props }, ref) => /* @__P
9213
9334
  }
9214
9335
  ));
9215
9336
  TableHeadBase.displayName = "TableHeadBase";
9216
- var TableCellBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9337
+ var TableCellBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9217
9338
  "td",
9218
9339
  {
9219
9340
  ref,
@@ -9225,7 +9346,7 @@ var TableCellBase = React34.forwardRef(({ className, ...props }, ref) => /* @__P
9225
9346
  }
9226
9347
  ));
9227
9348
  TableCellBase.displayName = "TableCellBase";
9228
- var TableCaptionBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9349
+ var TableCaptionBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
9229
9350
  "caption",
9230
9351
  {
9231
9352
  ref,
@@ -9236,11 +9357,11 @@ var TableCaptionBase = React34.forwardRef(({ className, ...props }, ref) => /* @
9236
9357
  TableCaptionBase.displayName = "TableCaptionBase";
9237
9358
 
9238
9359
  // src/components/ui/layout/TabsBase.tsx
9239
- import * as React35 from "react";
9360
+ import * as React36 from "react";
9240
9361
  import * as TabsPrimitive from "@radix-ui/react-tabs";
9241
9362
  import { jsx as jsx56 } from "react/jsx-runtime";
9242
9363
  var TabsBase = TabsPrimitive.Root;
9243
- var TabsListBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx56(
9364
+ var TabsListBase = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx56(
9244
9365
  TabsPrimitive.List,
9245
9366
  {
9246
9367
  ref,
@@ -9253,7 +9374,7 @@ var TabsListBase = React35.forwardRef(({ className, ...props }, ref) => /* @__PU
9253
9374
  }
9254
9375
  ));
9255
9376
  TabsListBase.displayName = TabsPrimitive.List.displayName;
9256
- var TabsTriggerBase = React35.forwardRef(({ className, animation = "default", ...props }, ref) => {
9377
+ var TabsTriggerBase = React36.forwardRef(({ className, animation = "default", ...props }, ref) => {
9257
9378
  const base = cn(
9258
9379
  "relative inline-flex items-center justify-center whitespace-nowrap px-4 py-2 text-sm font-medium",
9259
9380
  "text-muted-foreground hover:text-foreground",
@@ -9273,7 +9394,7 @@ var TabsTriggerBase = React35.forwardRef(({ className, animation = "default", ..
9273
9394
  }
9274
9395
  );
9275
9396
  });
9276
- var TabsContentBase = React35.forwardRef(({ className, animation = "default", ...props }, ref) => {
9397
+ var TabsContentBase = React36.forwardRef(({ className, animation = "default", ...props }, ref) => {
9277
9398
  const animationClasses = animation === "none" ? "" : animation === "slide" ? "animate-in slide-in-from-left-2 duration-500 ease-in-out" : "animate-in fade-in-0 duration-500 ease-in-out";
9278
9399
  return /* @__PURE__ */ jsx56(
9279
9400
  TabsPrimitive.Content,
@@ -9292,7 +9413,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
9292
9413
 
9293
9414
  // src/components/ui/navigation/BreadcrumbBase.tsx
9294
9415
  import { Slot as Slot4 } from "@radix-ui/react-slot";
9295
- import { CaretRightIcon as CaretRightIcon3, DotsThreeIcon as DotsThreeIcon3 } from "@phosphor-icons/react";
9416
+ import { CaretRightIcon as CaretRightIcon4, DotsThreeIcon as DotsThreeIcon3 } from "@phosphor-icons/react";
9296
9417
  import { jsx as jsx57, jsxs as jsxs41 } from "react/jsx-runtime";
9297
9418
  function BreadcrumbBase({ ...props }) {
9298
9419
  return /* @__PURE__ */ jsx57("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
@@ -9361,7 +9482,7 @@ function BreadcrumbSeparatorBase({
9361
9482
  "aria-hidden": "true",
9362
9483
  className: cn("[&>svg]:size-3.5", className),
9363
9484
  ...props,
9364
- children: children ?? /* @__PURE__ */ jsx57(CaretRightIcon3, {})
9485
+ children: children ?? /* @__PURE__ */ jsx57(CaretRightIcon4, {})
9365
9486
  }
9366
9487
  );
9367
9488
  }
@@ -9533,16 +9654,16 @@ function NavigationMenuIndicatorBase({
9533
9654
  }
9534
9655
 
9535
9656
  // src/components/ui/navigation/SidebarBase.tsx
9536
- import * as React38 from "react";
9657
+ import * as React39 from "react";
9537
9658
  import { Slot as Slot5 } from "@radix-ui/react-slot";
9538
9659
  import { cva as cva5 } from "class-variance-authority";
9539
9660
 
9540
9661
  // src/hooks/use-mobile.tsx
9541
- import * as React36 from "react";
9662
+ import * as React37 from "react";
9542
9663
  var MOBILE_BREAKPOINT = 768;
9543
9664
  function useIsMobile() {
9544
- const [isMobile, setIsMobile] = React36.useState(void 0);
9545
- React36.useEffect(() => {
9665
+ const [isMobile, setIsMobile] = React37.useState(void 0);
9666
+ React37.useEffect(() => {
9546
9667
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
9547
9668
  const onChange = () => {
9548
9669
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -9555,7 +9676,7 @@ function useIsMobile() {
9555
9676
  }
9556
9677
 
9557
9678
  // src/components/ui/overlays/SheetBase.tsx
9558
- import * as React37 from "react";
9679
+ import * as React38 from "react";
9559
9680
  import * as SheetPrimitive from "@radix-ui/react-dialog";
9560
9681
  import { cva as cva4 } from "class-variance-authority";
9561
9682
  import { XIcon as XIcon8 } from "@phosphor-icons/react";
@@ -9564,7 +9685,7 @@ var SheetBase = SheetPrimitive.Root;
9564
9685
  var SheetTriggerBase = SheetPrimitive.Trigger;
9565
9686
  var SheetCloseBase = SheetPrimitive.Close;
9566
9687
  var SheetPortalBase = SheetPrimitive.Portal;
9567
- var SheetOverlayBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx59(
9688
+ var SheetOverlayBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx59(
9568
9689
  SheetPrimitive.Overlay,
9569
9690
  {
9570
9691
  className: cn(
@@ -9592,7 +9713,7 @@ var sheetVariants = cva4(
9592
9713
  }
9593
9714
  }
9594
9715
  );
9595
- var SheetContentBase = React37.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs43(SheetPortalBase, { children: [
9716
+ var SheetContentBase = React38.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs43(SheetPortalBase, { children: [
9596
9717
  /* @__PURE__ */ jsx59(SheetOverlayBase, {}),
9597
9718
  /* @__PURE__ */ jsxs43(
9598
9719
  SheetPrimitive.Content,
@@ -9639,7 +9760,7 @@ var SheetFooterBase = ({
9639
9760
  }
9640
9761
  );
9641
9762
  SheetFooterBase.displayName = "SheetFooterBase";
9642
- var SheetTitleBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx59(
9763
+ var SheetTitleBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx59(
9643
9764
  SheetPrimitive.Title,
9644
9765
  {
9645
9766
  ref,
@@ -9648,7 +9769,7 @@ var SheetTitleBase = React37.forwardRef(({ className, ...props }, ref) => /* @__
9648
9769
  }
9649
9770
  ));
9650
9771
  SheetTitleBase.displayName = SheetPrimitive.Title.displayName;
9651
- var SheetDescriptionBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx59(
9772
+ var SheetDescriptionBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx59(
9652
9773
  SheetPrimitive.Description,
9653
9774
  {
9654
9775
  ref,
@@ -9667,9 +9788,9 @@ var SIDEBAR_WIDTH = "16rem";
9667
9788
  var SIDEBAR_WIDTH_MOBILE = "18rem";
9668
9789
  var SIDEBAR_WIDTH_ICON = "3rem";
9669
9790
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
9670
- var SidebarContext = React38.createContext(null);
9791
+ var SidebarContext = React39.createContext(null);
9671
9792
  function UseSideBarBase() {
9672
- const context = React38.useContext(SidebarContext);
9793
+ const context = React39.useContext(SidebarContext);
9673
9794
  if (!context) {
9674
9795
  throw new Error(
9675
9796
  "UseSideBarBase must be used within a SidebarProviderBase."
@@ -9677,7 +9798,7 @@ function UseSideBarBase() {
9677
9798
  }
9678
9799
  return context;
9679
9800
  }
9680
- var SidebarProviderBase = React38.forwardRef(
9801
+ var SidebarProviderBase = React39.forwardRef(
9681
9802
  ({
9682
9803
  defaultOpen = true,
9683
9804
  open: openProp,
@@ -9688,10 +9809,10 @@ var SidebarProviderBase = React38.forwardRef(
9688
9809
  ...props
9689
9810
  }, ref) => {
9690
9811
  const isMobile = useIsMobile();
9691
- const [openMobile, setOpenMobile] = React38.useState(false);
9692
- const [_open, _setOpen] = React38.useState(defaultOpen);
9812
+ const [openMobile, setOpenMobile] = React39.useState(false);
9813
+ const [_open, _setOpen] = React39.useState(defaultOpen);
9693
9814
  const open = openProp ?? _open;
9694
- const setOpen = React38.useCallback(
9815
+ const setOpen = React39.useCallback(
9695
9816
  (value) => {
9696
9817
  const openState = typeof value === "function" ? value(open) : value;
9697
9818
  if (setOpenProp) {
@@ -9703,10 +9824,10 @@ var SidebarProviderBase = React38.forwardRef(
9703
9824
  },
9704
9825
  [setOpenProp, open]
9705
9826
  );
9706
- const toggleSidebar = React38.useCallback(() => {
9827
+ const toggleSidebar = React39.useCallback(() => {
9707
9828
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
9708
9829
  }, [isMobile, setOpen, setOpenMobile]);
9709
- React38.useEffect(() => {
9830
+ React39.useEffect(() => {
9710
9831
  const handleKeyDown = (event) => {
9711
9832
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
9712
9833
  event.preventDefault();
@@ -9717,7 +9838,7 @@ var SidebarProviderBase = React38.forwardRef(
9717
9838
  return () => window.removeEventListener("keydown", handleKeyDown);
9718
9839
  }, [toggleSidebar]);
9719
9840
  const state = open ? "expanded" : "collapsed";
9720
- const contextValue = React38.useMemo(
9841
+ const contextValue = React39.useMemo(
9721
9842
  () => ({
9722
9843
  state,
9723
9844
  open,
@@ -9749,7 +9870,7 @@ var SidebarProviderBase = React38.forwardRef(
9749
9870
  }
9750
9871
  );
9751
9872
  SidebarProviderBase.displayName = "SidebarProviderBase";
9752
- var SidebarBase = React38.forwardRef(
9873
+ var SidebarBase = React39.forwardRef(
9753
9874
  ({
9754
9875
  side = "left",
9755
9876
  variant = "sidebar",
@@ -9836,7 +9957,7 @@ var SidebarBase = React38.forwardRef(
9836
9957
  }
9837
9958
  );
9838
9959
  SidebarBase.displayName = "SidebarBase";
9839
- var SidebarTriggerBase = React38.forwardRef(({ className, onClick, ...props }, ref) => {
9960
+ var SidebarTriggerBase = React39.forwardRef(({ className, onClick, ...props }, ref) => {
9840
9961
  const { toggleSidebar } = UseSideBarBase();
9841
9962
  return /* @__PURE__ */ jsx60("div", { children: /* @__PURE__ */ jsxs44(
9842
9963
  ButtonBase,
@@ -9859,7 +9980,7 @@ var SidebarTriggerBase = React38.forwardRef(({ className, onClick, ...props }, r
9859
9980
  ) });
9860
9981
  });
9861
9982
  SidebarTriggerBase.displayName = "SidebarTriggerBase";
9862
- var SidebarRailBase = React38.forwardRef(({ className, ...props }, ref) => {
9983
+ var SidebarRailBase = React39.forwardRef(({ className, ...props }, ref) => {
9863
9984
  const { toggleSidebar } = UseSideBarBase();
9864
9985
  return /* @__PURE__ */ jsx60(
9865
9986
  "button",
@@ -9884,7 +10005,7 @@ var SidebarRailBase = React38.forwardRef(({ className, ...props }, ref) => {
9884
10005
  );
9885
10006
  });
9886
10007
  SidebarRailBase.displayName = "SidebarRailBase";
9887
- var SidebarInsetBase = React38.forwardRef(({ className, ...props }, ref) => {
10008
+ var SidebarInsetBase = React39.forwardRef(({ className, ...props }, ref) => {
9888
10009
  return /* @__PURE__ */ jsx60(
9889
10010
  "main",
9890
10011
  {
@@ -9899,7 +10020,7 @@ var SidebarInsetBase = React38.forwardRef(({ className, ...props }, ref) => {
9899
10020
  );
9900
10021
  });
9901
10022
  SidebarInsetBase.displayName = "SidebarInsetBase";
9902
- var SidebarInputBase = React38.forwardRef(({ className, ...props }, ref) => {
10023
+ var SidebarInputBase = React39.forwardRef(({ className, ...props }, ref) => {
9903
10024
  return /* @__PURE__ */ jsx60(
9904
10025
  InputBase,
9905
10026
  {
@@ -9914,7 +10035,7 @@ var SidebarInputBase = React38.forwardRef(({ className, ...props }, ref) => {
9914
10035
  );
9915
10036
  });
9916
10037
  SidebarInputBase.displayName = "SidebarInputBase";
9917
- var SidebarHeaderBase = React38.forwardRef(({ className, ...props }, ref) => {
10038
+ var SidebarHeaderBase = React39.forwardRef(({ className, ...props }, ref) => {
9918
10039
  return /* @__PURE__ */ jsx60(
9919
10040
  "div",
9920
10041
  {
@@ -9926,7 +10047,7 @@ var SidebarHeaderBase = React38.forwardRef(({ className, ...props }, ref) => {
9926
10047
  );
9927
10048
  });
9928
10049
  SidebarHeaderBase.displayName = "SidebarHeaderBase";
9929
- var SidebarFooterBase = React38.forwardRef(({ className, ...props }, ref) => {
10050
+ var SidebarFooterBase = React39.forwardRef(({ className, ...props }, ref) => {
9930
10051
  return /* @__PURE__ */ jsx60(
9931
10052
  "div",
9932
10053
  {
@@ -9938,7 +10059,7 @@ var SidebarFooterBase = React38.forwardRef(({ className, ...props }, ref) => {
9938
10059
  );
9939
10060
  });
9940
10061
  SidebarFooterBase.displayName = "SidebarFooterBase";
9941
- var SidebarSeparatorBase = React38.forwardRef(({ className, ...props }, ref) => {
10062
+ var SidebarSeparatorBase = React39.forwardRef(({ className, ...props }, ref) => {
9942
10063
  return /* @__PURE__ */ jsx60(
9943
10064
  SeparatorBase,
9944
10065
  {
@@ -9950,7 +10071,7 @@ var SidebarSeparatorBase = React38.forwardRef(({ className, ...props }, ref) =>
9950
10071
  );
9951
10072
  });
9952
10073
  SidebarSeparatorBase.displayName = "SidebarSeparatorBase";
9953
- var SidebarContentBase = React38.forwardRef(({ className, ...props }, ref) => {
10074
+ var SidebarContentBase = React39.forwardRef(({ className, ...props }, ref) => {
9954
10075
  return /* @__PURE__ */ jsx60(
9955
10076
  "div",
9956
10077
  {
@@ -9965,7 +10086,7 @@ var SidebarContentBase = React38.forwardRef(({ className, ...props }, ref) => {
9965
10086
  );
9966
10087
  });
9967
10088
  SidebarContentBase.displayName = "SidebarContentBase";
9968
- var SidebarGroupBase = React38.forwardRef(({ className, ...props }, ref) => {
10089
+ var SidebarGroupBase = React39.forwardRef(({ className, ...props }, ref) => {
9969
10090
  return /* @__PURE__ */ jsx60(
9970
10091
  "div",
9971
10092
  {
@@ -9977,7 +10098,7 @@ var SidebarGroupBase = React38.forwardRef(({ className, ...props }, ref) => {
9977
10098
  );
9978
10099
  });
9979
10100
  SidebarGroupBase.displayName = "SidebarGroupBase";
9980
- var SidebarGroupLabelBase = React38.forwardRef(({ className, asChild = false, ...props }, ref) => {
10101
+ var SidebarGroupLabelBase = React39.forwardRef(({ className, asChild = false, ...props }, ref) => {
9981
10102
  const Comp = asChild ? Slot5 : "div";
9982
10103
  return /* @__PURE__ */ jsx60(
9983
10104
  Comp,
@@ -9994,7 +10115,7 @@ var SidebarGroupLabelBase = React38.forwardRef(({ className, asChild = false, ..
9994
10115
  );
9995
10116
  });
9996
10117
  SidebarGroupLabelBase.displayName = "SidebarGroupLabelBase";
9997
- var SidebarGroupActionBase = React38.forwardRef(({ className, asChild = false, ...props }, ref) => {
10118
+ var SidebarGroupActionBase = React39.forwardRef(({ className, asChild = false, ...props }, ref) => {
9998
10119
  const Comp = asChild ? Slot5 : "button";
9999
10120
  return /* @__PURE__ */ jsx60(
10000
10121
  Comp,
@@ -10013,7 +10134,7 @@ var SidebarGroupActionBase = React38.forwardRef(({ className, asChild = false, .
10013
10134
  );
10014
10135
  });
10015
10136
  SidebarGroupActionBase.displayName = "SidebarGroupActionBase";
10016
- var SidebarGroupContentBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10137
+ var SidebarGroupContentBase = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10017
10138
  "div",
10018
10139
  {
10019
10140
  ref,
@@ -10023,7 +10144,7 @@ var SidebarGroupContentBase = React38.forwardRef(({ className, ...props }, ref)
10023
10144
  }
10024
10145
  ));
10025
10146
  SidebarGroupContentBase.displayName = "SidebarGroupContentBase";
10026
- var SidebarMenuBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10147
+ var SidebarMenuBase = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10027
10148
  "ul",
10028
10149
  {
10029
10150
  ref,
@@ -10033,7 +10154,7 @@ var SidebarMenuBase = React38.forwardRef(({ className, ...props }, ref) => /* @_
10033
10154
  }
10034
10155
  ));
10035
10156
  SidebarMenuBase.displayName = "SidebarMenuBase";
10036
- var SidebarMenuItemBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10157
+ var SidebarMenuItemBase = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10037
10158
  "li",
10038
10159
  {
10039
10160
  ref,
@@ -10063,7 +10184,7 @@ var sidebarMenuButtonVariants = cva5(
10063
10184
  }
10064
10185
  }
10065
10186
  );
10066
- var SidebarMenuButtonBase = React38.forwardRef(
10187
+ var SidebarMenuButtonBase = React39.forwardRef(
10067
10188
  ({
10068
10189
  asChild = false,
10069
10190
  isActive = false,
@@ -10109,7 +10230,7 @@ var SidebarMenuButtonBase = React38.forwardRef(
10109
10230
  }
10110
10231
  );
10111
10232
  SidebarMenuButtonBase.displayName = "SidebarMenuButtonBase";
10112
- var SidebarMenuActionBase = React38.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
10233
+ var SidebarMenuActionBase = React39.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
10113
10234
  const Comp = asChild ? Slot5 : "button";
10114
10235
  return /* @__PURE__ */ jsx60(
10115
10236
  Comp,
@@ -10132,7 +10253,7 @@ var SidebarMenuActionBase = React38.forwardRef(({ className, asChild = false, sh
10132
10253
  );
10133
10254
  });
10134
10255
  SidebarMenuActionBase.displayName = "SidebarMenuActionBase";
10135
- var SidebarMenuBadgeBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10256
+ var SidebarMenuBadgeBase = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10136
10257
  "div",
10137
10258
  {
10138
10259
  ref,
@@ -10150,8 +10271,8 @@ var SidebarMenuBadgeBase = React38.forwardRef(({ className, ...props }, ref) =>
10150
10271
  }
10151
10272
  ));
10152
10273
  SidebarMenuBadgeBase.displayName = "SidebarMenuBadgeBase";
10153
- var SidebarMenuSkeletonBase = React38.forwardRef(({ className, showIcon = false, ...props }, ref) => {
10154
- const width = React38.useMemo(() => {
10274
+ var SidebarMenuSkeletonBase = React39.forwardRef(({ className, showIcon = false, ...props }, ref) => {
10275
+ const width = React39.useMemo(() => {
10155
10276
  return `${Math.floor(Math.random() * 40) + 50}%`;
10156
10277
  }, []);
10157
10278
  return /* @__PURE__ */ jsxs44(
@@ -10184,7 +10305,7 @@ var SidebarMenuSkeletonBase = React38.forwardRef(({ className, showIcon = false,
10184
10305
  );
10185
10306
  });
10186
10307
  SidebarMenuSkeletonBase.displayName = "SidebarMenuSkeletonBase";
10187
- var SidebarMenuSubBase = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10308
+ var SidebarMenuSubBase = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx60(
10188
10309
  "ul",
10189
10310
  {
10190
10311
  ref,
@@ -10198,9 +10319,9 @@ var SidebarMenuSubBase = React38.forwardRef(({ className, ...props }, ref) => /*
10198
10319
  }
10199
10320
  ));
10200
10321
  SidebarMenuSubBase.displayName = "SidebarMenuSubBase";
10201
- var SidebarMenuSubItemBase = React38.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx60("li", { ref, ...props }));
10322
+ var SidebarMenuSubItemBase = React39.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx60("li", { ref, ...props }));
10202
10323
  SidebarMenuSubItemBase.displayName = "SidebarMenuSubItemBase";
10203
- var SidebarMenuSubButtonBase = React38.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
10324
+ var SidebarMenuSubButtonBase = React39.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
10204
10325
  const Comp = asChild ? Slot5 : "a";
10205
10326
  return /* @__PURE__ */ jsx60(
10206
10327
  Comp,
@@ -10347,7 +10468,7 @@ function DrawerDescriptionBase({
10347
10468
  }
10348
10469
 
10349
10470
  // src/hooks/use-universal-tooltip.tsx
10350
- import { createContext as createContext4, useContext as useContext5, useState as useState17, useCallback as useCallback11, useEffect as useEffect15, useRef as useRef7 } from "react";
10471
+ import { createContext as createContext4, useContext as useContext5, useState as useState18, useCallback as useCallback11, useEffect as useEffect16, useRef as useRef7 } from "react";
10351
10472
  import { jsx as jsx62 } from "react/jsx-runtime";
10352
10473
  var UniversalTooltipContext = createContext4(null);
10353
10474
  var useUniversalTooltip = () => {
@@ -10546,11 +10667,11 @@ var UniversalTooltipRenderer = ({
10546
10667
  import { add, format } from "date-fns";
10547
10668
 
10548
10669
  // src/components/picker/calendar.tsx
10549
- import * as React40 from "react";
10670
+ import * as React41 from "react";
10550
10671
  import { DayPicker as DayPicker2 } from "react-day-picker";
10551
10672
  import {
10552
- CaretLeftIcon as CaretLeftIcon2,
10553
- CaretRightIcon as CaretRightIcon4,
10673
+ CaretLeftIcon as CaretLeftIcon3,
10674
+ CaretRightIcon as CaretRightIcon5,
10554
10675
  XIcon as XIcon10,
10555
10676
  CalendarIcon
10556
10677
  } from "@phosphor-icons/react";
@@ -10562,10 +10683,10 @@ function CalendarBase2({
10562
10683
  showOutsideDays = true,
10563
10684
  ...props
10564
10685
  }) {
10565
- const [month, setMonth] = React40.useState(
10686
+ const [month, setMonth] = React41.useState(
10566
10687
  props.month || props.defaultMonth || /* @__PURE__ */ new Date()
10567
10688
  );
10568
- const [direction, setDirection] = React40.useState(1);
10689
+ const [direction, setDirection] = React41.useState(1);
10569
10690
  const handleMonthChange = (newMonth) => {
10570
10691
  const isNext = newMonth > month ? 1 : -1;
10571
10692
  setDirection(isNext);
@@ -10630,8 +10751,8 @@ function CalendarBase2({
10630
10751
  ...classNames
10631
10752
  },
10632
10753
  components: {
10633
- IconLeft: () => /* @__PURE__ */ jsx64(CaretLeftIcon2, { className: "h-4 w-4" }),
10634
- IconRight: () => /* @__PURE__ */ jsx64(CaretRightIcon4, { className: "h-4 w-4" })
10754
+ IconLeft: () => /* @__PURE__ */ jsx64(CaretLeftIcon3, { className: "h-4 w-4" }),
10755
+ IconRight: () => /* @__PURE__ */ jsx64(CaretRightIcon5, { className: "h-4 w-4" })
10635
10756
  },
10636
10757
  ...props
10637
10758
  }
@@ -10647,15 +10768,15 @@ CalendarBase2.displayName = "CalendarBase";
10647
10768
 
10648
10769
  // src/components/picker/DateTimePicker.tsx
10649
10770
  import { ptBR } from "date-fns/locale";
10650
- import { useEffect as useEffect16, useState as useState19 } from "react";
10771
+ import { useEffect as useEffect17, useState as useState20 } from "react";
10651
10772
 
10652
10773
  // src/components/picker/TimePicker.tsx
10653
10774
  import { motion as motion14, AnimatePresence as AnimatePresence10 } from "framer-motion";
10654
- import * as React42 from "react";
10775
+ import * as React43 from "react";
10655
10776
 
10656
10777
  // src/components/picker/TimePickerInput.tsx
10657
10778
  import { CaretUpIcon as CaretUpIcon2, CaretDownIcon as CaretDownIcon5 } from "@phosphor-icons/react";
10658
- import React41 from "react";
10779
+ import React42 from "react";
10659
10780
 
10660
10781
  // src/components/picker/utils/time-picker-utils.ts
10661
10782
  function isValidHour(value) {
@@ -10798,7 +10919,7 @@ function display12HourValue(hours) {
10798
10919
 
10799
10920
  // src/components/picker/TimePickerInput.tsx
10800
10921
  import { jsx as jsx65, jsxs as jsxs48 } from "react/jsx-runtime";
10801
- var TimePickerInput = React41.forwardRef(
10922
+ var TimePickerInput = React42.forwardRef(
10802
10923
  ({
10803
10924
  className,
10804
10925
  type = "tel",
@@ -10817,10 +10938,10 @@ var TimePickerInput = React41.forwardRef(
10817
10938
  label,
10818
10939
  ...props
10819
10940
  }, ref) => {
10820
- const [flag, setFlag] = React41.useState(false);
10821
- const [prevIntKey, setPrevIntKey] = React41.useState("0");
10822
- const [isFocused, setIsFocused] = React41.useState(false);
10823
- React41.useEffect(() => {
10941
+ const [flag, setFlag] = React42.useState(false);
10942
+ const [prevIntKey, setPrevIntKey] = React42.useState("0");
10943
+ const [isFocused, setIsFocused] = React42.useState(false);
10944
+ React42.useEffect(() => {
10824
10945
  if (flag) {
10825
10946
  const timer = setTimeout(() => {
10826
10947
  setFlag(false);
@@ -10828,7 +10949,7 @@ var TimePickerInput = React41.forwardRef(
10828
10949
  return () => clearTimeout(timer);
10829
10950
  }
10830
10951
  }, [flag]);
10831
- const calculatedValue = React41.useMemo(() => {
10952
+ const calculatedValue = React42.useMemo(() => {
10832
10953
  return getDateByType(date, picker);
10833
10954
  }, [date, picker]);
10834
10955
  const calculateNewValue = (key) => {
@@ -11003,9 +11124,9 @@ function TimePicker({
11003
11124
  hideSeconds,
11004
11125
  enableButton
11005
11126
  }) {
11006
- const minuteRef = React42.useRef(null);
11007
- const hourRef = React42.useRef(null);
11008
- const secondRef = React42.useRef(null);
11127
+ const minuteRef = React43.useRef(null);
11128
+ const hourRef = React43.useRef(null);
11129
+ const secondRef = React43.useRef(null);
11009
11130
  const containerVariants = {
11010
11131
  hidden: { opacity: 0, y: 10 },
11011
11132
  visible: {
@@ -11108,9 +11229,9 @@ function DateTimePicker({
11108
11229
  className,
11109
11230
  error
11110
11231
  }) {
11111
- const [internalDate, setInternalDate] = useState19(date);
11112
- const [open, setOpen] = useState19(false);
11113
- const [timePickerOpen, setTimePickerOpen] = useState19(false);
11232
+ const [internalDate, setInternalDate] = useState20(date);
11233
+ const [open, setOpen] = useState20(false);
11234
+ const [timePickerOpen, setTimePickerOpen] = useState20(false);
11114
11235
  const handleSelect = (newDay) => {
11115
11236
  if (!newDay) return;
11116
11237
  if (!internalDate) {
@@ -11141,7 +11262,7 @@ function DateTimePicker({
11141
11262
  if (!timeFormat) return "dd MMMM yyyy";
11142
11263
  return `dd MMMM yyyy - ${timeFormat}`;
11143
11264
  };
11144
- useEffect16(() => {
11265
+ useEffect17(() => {
11145
11266
  setInternalDate(date);
11146
11267
  }, [date, open]);
11147
11268
  return /* @__PURE__ */ jsxs50("div", { className: cn("w-full sm:w-auto", className), children: [
@@ -11281,15 +11402,15 @@ function DateTimePicker({
11281
11402
  }
11282
11403
 
11283
11404
  // src/components/picker/RangePicker.tsx
11284
- import * as React43 from "react";
11405
+ import * as React44 from "react";
11285
11406
  import {
11286
11407
  DayPicker as DayPicker3
11287
11408
  } from "react-day-picker";
11288
11409
  import ptBR2 from "date-fns/locale/pt-BR";
11289
11410
  import { format as format2 } from "date-fns";
11290
11411
  import {
11291
- CaretLeftIcon as CaretLeftIcon3,
11292
- CaretRightIcon as CaretRightIcon5,
11412
+ CaretLeftIcon as CaretLeftIcon4,
11413
+ CaretRightIcon as CaretRightIcon6,
11293
11414
  CalendarBlankIcon as CalendarBlankIcon2
11294
11415
  } from "@phosphor-icons/react";
11295
11416
  import { motion as motion15, AnimatePresence as AnimatePresence11, useAnimation } from "framer-motion";
@@ -11304,10 +11425,10 @@ function RangePicker({
11304
11425
  maxDate,
11305
11426
  error
11306
11427
  }) {
11307
- const [open, setOpen] = React43.useState(false);
11308
- const [range, setRange] = React43.useState(value);
11428
+ const [open, setOpen] = React44.useState(false);
11429
+ const [range, setRange] = React44.useState(value);
11309
11430
  const controls = useAnimation();
11310
- React43.useEffect(() => {
11431
+ React44.useEffect(() => {
11311
11432
  setRange(value);
11312
11433
  }, [value]);
11313
11434
  const handleSelect = (selected) => {
@@ -11430,8 +11551,8 @@ function RangePicker({
11430
11551
  day_hidden: "invisible"
11431
11552
  },
11432
11553
  components: {
11433
- IconLeft: () => /* @__PURE__ */ jsx68(CaretLeftIcon3, { className: "h-4 w-4" }),
11434
- IconRight: () => /* @__PURE__ */ jsx68(CaretRightIcon5, { className: "h-4 w-4" })
11554
+ IconLeft: () => /* @__PURE__ */ jsx68(CaretLeftIcon4, { className: "h-4 w-4" }),
11555
+ IconRight: () => /* @__PURE__ */ jsx68(CaretRightIcon6, { className: "h-4 w-4" })
11435
11556
  }
11436
11557
  }
11437
11558
  )
@@ -11503,7 +11624,7 @@ RangePicker.displayName = "RangePicker";
11503
11624
 
11504
11625
  // src/components/ui/navigation/ContextMenuBase.tsx
11505
11626
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
11506
- import { CaretRightIcon as CaretRightIcon6, CheckIcon as CheckIcon10, CircleIcon as CircleIcon2 } from "@phosphor-icons/react";
11627
+ import { CaretRightIcon as CaretRightIcon7, CheckIcon as CheckIcon10, CircleIcon as CircleIcon2 } from "@phosphor-icons/react";
11507
11628
  import { jsx as jsx69, jsxs as jsxs52 } from "react/jsx-runtime";
11508
11629
  function ContextMenuBase(props) {
11509
11630
  return /* @__PURE__ */ jsx69(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
@@ -11545,7 +11666,7 @@ function ContextMenuSubTriggerBase({
11545
11666
  ...props,
11546
11667
  children: [
11547
11668
  children,
11548
- /* @__PURE__ */ jsx69(CaretRightIcon6, { className: "ml-auto" })
11669
+ /* @__PURE__ */ jsx69(CaretRightIcon7, { className: "ml-auto" })
11549
11670
  ]
11550
11671
  }
11551
11672
  );
@@ -11726,7 +11847,7 @@ import {
11726
11847
  GearIcon as GearIcon2,
11727
11848
  TerminalIcon
11728
11849
  } from "@phosphor-icons/react";
11729
- import React44 from "react";
11850
+ import React45 from "react";
11730
11851
  import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
11731
11852
  import { jsx as jsx70, jsxs as jsxs53 } from "react/jsx-runtime";
11732
11853
  var CodeBlock = ({
@@ -11738,11 +11859,11 @@ var CodeBlock = ({
11738
11859
  breadcrumb = [],
11739
11860
  showStats = true
11740
11861
  }) => {
11741
- const [copied, setCopied] = React44.useState(false);
11742
- const [activeTab, setActiveTab] = React44.useState(0);
11743
- const [isExpanded, setIsExpanded] = React44.useState(false);
11862
+ const [copied, setCopied] = React45.useState(false);
11863
+ const [activeTab, setActiveTab] = React45.useState(0);
11864
+ const [isExpanded, setIsExpanded] = React45.useState(false);
11744
11865
  const tabsExist = tabs.length > 0;
11745
- const cssVars = React44.useMemo(
11866
+ const cssVars = React45.useMemo(
11746
11867
  () => ({
11747
11868
  container: {
11748
11869
  backgroundColor: "hsl(var(--card))",
@@ -11838,7 +11959,7 @@ var CodeBlock = ({
11838
11959
  ] }),
11839
11960
  breadcrumb.length > 0 && /* @__PURE__ */ jsxs53("div", { className: "flex items-center min-w-0", children: [
11840
11961
  /* @__PURE__ */ jsx70(FolderIcon, { size: "1em", style: cssVars.icon }),
11841
- /* @__PURE__ */ jsx70("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ jsxs53(React44.Fragment, { children: [
11962
+ /* @__PURE__ */ jsx70("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ jsxs53(React45.Fragment, { children: [
11842
11963
  /* @__PURE__ */ jsx70(
11843
11964
  "span",
11844
11965
  {
@@ -12095,7 +12216,7 @@ function StatusIndicator({
12095
12216
  }
12096
12217
 
12097
12218
  // src/components/ui/form/DebouncedInput.tsx
12098
- import { useEffect as useEffect18, useState as useState21 } from "react";
12219
+ import { useEffect as useEffect19, useState as useState22 } from "react";
12099
12220
  import { CircleNotchIcon as CircleNotchIcon2 } from "@phosphor-icons/react";
12100
12221
  import { jsx as jsx72 } from "react/jsx-runtime";
12101
12222
  function DebouncedInput({
@@ -12111,12 +12232,12 @@ function DebouncedInput({
12111
12232
  error,
12112
12233
  ...props
12113
12234
  }) {
12114
- const [value, setValue] = useState21(initialValue);
12115
- const [isDebouncing, setIsDebouncing] = useState21(false);
12116
- useEffect18(() => {
12235
+ const [value, setValue] = useState22(initialValue);
12236
+ const [isDebouncing, setIsDebouncing] = useState22(false);
12237
+ useEffect19(() => {
12117
12238
  setValue(initialValue);
12118
12239
  }, [initialValue]);
12119
- useEffect18(() => {
12240
+ useEffect19(() => {
12120
12241
  if (value !== initialValue) {
12121
12242
  setIsDebouncing(true);
12122
12243
  }
@@ -12154,7 +12275,7 @@ function DebouncedInput({
12154
12275
  // src/components/event-calendar/AgendaView.tsx
12155
12276
  import { addDays, format as format3, isToday } from "date-fns";
12156
12277
  import { ptBR as ptBR3 } from "date-fns/locale";
12157
- import { useMemo as useMemo9 } from "react";
12278
+ import { useMemo as useMemo10 } from "react";
12158
12279
  import { CalendarIcon as CalendarIcon2 } from "@phosphor-icons/react";
12159
12280
  import { Fragment as Fragment10, jsx as jsx73, jsxs as jsxs55 } from "react/jsx-runtime";
12160
12281
  function AgendaView({
@@ -12163,7 +12284,7 @@ function AgendaView({
12163
12284
  onEventSelect,
12164
12285
  showUndatedEvents = false
12165
12286
  }) {
12166
- const isValidDate6 = (d) => {
12287
+ const isValidDate5 = (d) => {
12167
12288
  try {
12168
12289
  const t = d instanceof Date ? d.getTime() : new Date(String(d)).getTime();
12169
12290
  return !isNaN(t);
@@ -12171,15 +12292,15 @@ function AgendaView({
12171
12292
  return false;
12172
12293
  }
12173
12294
  };
12174
- const datedEvents = useMemo9(
12175
- () => events.filter((e) => isValidDate6(e.start) && isValidDate6(e.end)),
12295
+ const datedEvents = useMemo10(
12296
+ () => events.filter((e) => isValidDate5(e.start) || isValidDate5(e.end)),
12176
12297
  [events]
12177
12298
  );
12178
- const undatedEvents = useMemo9(
12179
- () => events.filter((e) => !(isValidDate6(e.start) && isValidDate6(e.end))),
12299
+ const undatedEvents = useMemo10(
12300
+ () => events.filter((e) => !(isValidDate5(e.start) || isValidDate5(e.end))),
12180
12301
  [events]
12181
12302
  );
12182
- const days = useMemo9(() => {
12303
+ const days = useMemo10(() => {
12183
12304
  console.log("Agenda view updating with date:", currentDate.toISOString());
12184
12305
  return Array.from(
12185
12306
  { length: AgendaDaysToShow },
@@ -12262,7 +12383,7 @@ import {
12262
12383
  useSensors
12263
12384
  } from "@dnd-kit/core";
12264
12385
  import { addMinutes, differenceInMinutes } from "date-fns";
12265
- import { useId as useId2, useRef as useRef9, useState as useState22 } from "react";
12386
+ import { useId as useId2, useRef as useRef9, useState as useState23 } from "react";
12266
12387
 
12267
12388
  // src/components/event-calendar/hooks.ts
12268
12389
  import { createContext as createContext5, useContext as useContext6 } from "react";
@@ -12284,16 +12405,16 @@ function CalendarDndProvider({
12284
12405
  children,
12285
12406
  onEventUpdate
12286
12407
  }) {
12287
- const [activeEvent, setActiveEvent] = useState22(null);
12288
- const [activeId, setActiveId] = useState22(null);
12289
- const [activeView, setActiveView] = useState22(
12408
+ const [activeEvent, setActiveEvent] = useState23(null);
12409
+ const [activeId, setActiveId] = useState23(null);
12410
+ const [activeView, setActiveView] = useState23(
12290
12411
  null
12291
12412
  );
12292
- const [currentTime, setCurrentTime] = useState22(null);
12293
- const [eventHeight, setEventHeight] = useState22(null);
12294
- const [isMultiDay, setIsMultiDay] = useState22(false);
12295
- const [multiDayWidth, setMultiDayWidth] = useState22(null);
12296
- const [dragHandlePosition, setDragHandlePosition] = useState22(null);
12413
+ const [currentTime, setCurrentTime] = useState23(null);
12414
+ const [eventHeight, setEventHeight] = useState23(null);
12415
+ const [isMultiDay, setIsMultiDay] = useState23(false);
12416
+ const [multiDayWidth, setMultiDayWidth] = useState23(null);
12417
+ const [dragHandlePosition, setDragHandlePosition] = useState23(null);
12297
12418
  const eventDimensions = useRef9({ height: 0 });
12298
12419
  const sensors = useSensors(
12299
12420
  useSensor(MouseSensor, {
@@ -12518,7 +12639,7 @@ import {
12518
12639
  isSameDay,
12519
12640
  startOfDay
12520
12641
  } from "date-fns";
12521
- import { useMemo as useMemo10 } from "react";
12642
+ import { useMemo as useMemo11 } from "react";
12522
12643
  import { jsx as jsx75, jsxs as jsxs57 } from "react/jsx-runtime";
12523
12644
  function DayView({
12524
12645
  currentDate,
@@ -12526,14 +12647,14 @@ function DayView({
12526
12647
  onEventSelect,
12527
12648
  onEventCreate
12528
12649
  }) {
12529
- const hours = useMemo10(() => {
12650
+ const hours = useMemo11(() => {
12530
12651
  const dayStart = startOfDay(currentDate);
12531
12652
  return eachHourOfInterval({
12532
12653
  end: addHours(dayStart, EndHour - 1),
12533
12654
  start: addHours(dayStart, StartHour)
12534
12655
  });
12535
12656
  }, [currentDate]);
12536
- const dayEvents = useMemo10(() => {
12657
+ const dayEvents = useMemo11(() => {
12537
12658
  return events.filter((event) => {
12538
12659
  const eventStart = new Date(event.start);
12539
12660
  const eventEnd = new Date(event.end);
@@ -12542,17 +12663,17 @@ function DayView({
12542
12663
  (a, b) => new Date(a.start).getTime() - new Date(b.start).getTime()
12543
12664
  );
12544
12665
  }, [currentDate, events]);
12545
- const allDayEvents = useMemo10(() => {
12666
+ const allDayEvents = useMemo11(() => {
12546
12667
  return dayEvents.filter((event) => {
12547
12668
  return event.allDay || isMultiDayEvent(event);
12548
12669
  });
12549
12670
  }, [dayEvents]);
12550
- const timeEvents = useMemo10(() => {
12671
+ const timeEvents = useMemo11(() => {
12551
12672
  return dayEvents.filter((event) => {
12552
12673
  return !event.allDay && !isMultiDayEvent(event);
12553
12674
  });
12554
12675
  }, [dayEvents]);
12555
- const positionedEvents = useMemo10(() => {
12676
+ const positionedEvents = useMemo11(() => {
12556
12677
  const result = [];
12557
12678
  const dayStart = startOfDay(currentDate);
12558
12679
  const sortedEvents = [...timeEvents].sort((a, b) => {
@@ -12733,7 +12854,7 @@ function DayView({
12733
12854
  import { useDraggable } from "@dnd-kit/core";
12734
12855
  import { CSS } from "@dnd-kit/utilities";
12735
12856
  import { differenceInDays } from "date-fns";
12736
- import { useRef as useRef10, useState as useState23 } from "react";
12857
+ import { useRef as useRef10, useState as useState24 } from "react";
12737
12858
  import { jsx as jsx76 } from "react/jsx-runtime";
12738
12859
  function DraggableEvent({
12739
12860
  event,
@@ -12749,7 +12870,7 @@ function DraggableEvent({
12749
12870
  }) {
12750
12871
  const { activeId } = useCalendarDnd();
12751
12872
  const elementRef = useRef10(null);
12752
- const [dragHandlePosition, setDragHandlePosition] = useState23(null);
12873
+ const [dragHandlePosition, setDragHandlePosition] = useState24(null);
12753
12874
  const eventStart = new Date(event.start);
12754
12875
  const eventEnd = new Date(event.end);
12755
12876
  const isMultiDayEvent2 = isMultiDay || event.allDay || differenceInDays(eventEnd, eventStart) >= 1;
@@ -12884,7 +13005,7 @@ import {
12884
13005
  subWeeks
12885
13006
  } from "date-fns";
12886
13007
  import { ptBR as ptBR4 } from "date-fns/locale";
12887
- import { useEffect as useEffect19, useMemo as useMemo11, useState as useState24, useCallback as useCallback12 } from "react";
13008
+ import { useEffect as useEffect20, useMemo as useMemo12, useState as useState25, useCallback as useCallback12 } from "react";
12888
13009
  import { toast as toast3 } from "sonner";
12889
13010
  import {
12890
13011
  ArrowDownIcon,
@@ -12902,9 +13023,9 @@ function EventCalendar({
12902
13023
  className,
12903
13024
  initialView = "month"
12904
13025
  }) {
12905
- const [currentDate, setCurrentDate] = useState24(/* @__PURE__ */ new Date());
12906
- const [view, setView] = useState24(initialView);
12907
- const [isFading, setIsFading] = useState24(false);
13026
+ const [currentDate, setCurrentDate] = useState25(/* @__PURE__ */ new Date());
13027
+ const [view, setView] = useState25(initialView);
13028
+ const [isFading, setIsFading] = useState25(false);
12908
13029
  const FADE_DURATION = 220;
12909
13030
  const changeView = useCallback12(
12910
13031
  (next) => {
@@ -12917,8 +13038,8 @@ function EventCalendar({
12917
13038
  },
12918
13039
  [view]
12919
13040
  );
12920
- const [isPaging, setIsPaging] = useState24(false);
12921
- const [pageDirection, setPageDirection] = useState24(
13041
+ const [isPaging, setIsPaging] = useState25(false);
13042
+ const [pageDirection, setPageDirection] = useState25(
12922
13043
  null
12923
13044
  );
12924
13045
  const PAGE_DURATION = 200;
@@ -12936,11 +13057,11 @@ function EventCalendar({
12936
13057
  },
12937
13058
  []
12938
13059
  );
12939
- const [isEventDialogOpen, setIsEventDialogOpen] = useState24(false);
12940
- const [selectedEvent, setSelectedEvent] = useState24(
13060
+ const [isEventDialogOpen, setIsEventDialogOpen] = useState25(false);
13061
+ const [selectedEvent, setSelectedEvent] = useState25(
12941
13062
  null
12942
13063
  );
12943
- useEffect19(() => {
13064
+ useEffect20(() => {
12944
13065
  const handleKeyDown = (e) => {
12945
13066
  if (isEventDialogOpen || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLElement && e.target.isContentEditable) {
12946
13067
  return;
@@ -13084,7 +13205,7 @@ function EventCalendar({
13084
13205
  position: "bottom-left"
13085
13206
  });
13086
13207
  };
13087
- const viewTitle = useMemo11(() => {
13208
+ const viewTitle = useMemo12(() => {
13088
13209
  const capitalize = (s) => s && s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
13089
13210
  if (view === "month") {
13090
13211
  return capitalize(format5(currentDate, "MMMM yyyy", { locale: ptBR4 }));
@@ -13339,7 +13460,7 @@ function EventCalendar({
13339
13460
 
13340
13461
  // src/components/event-calendar/EventDialog.tsx
13341
13462
  import { format as format6, isBefore } from "date-fns";
13342
- import { useCallback as useCallback13, useEffect as useEffect20, useMemo as useMemo12, useState as useState25 } from "react";
13463
+ import { useCallback as useCallback13, useEffect as useEffect21, useMemo as useMemo13, useState as useState26 } from "react";
13343
13464
  import { RadioGroup as RadioGroup3, RadioGroupItem } from "@radix-ui/react-radio-group";
13344
13465
  import { motion as motion16 } from "framer-motion";
13345
13466
  import { ptBR as ptBR5 } from "date-fns/locale";
@@ -13352,19 +13473,19 @@ function EventDialog({
13352
13473
  onSave,
13353
13474
  onDelete
13354
13475
  }) {
13355
- const [title, setTitle] = useState25("");
13356
- const [description, setDescription] = useState25("");
13357
- const [startDate, setStartDate] = useState25(/* @__PURE__ */ new Date());
13358
- const [endDate, setEndDate] = useState25(/* @__PURE__ */ new Date());
13359
- const [startTime, setStartTime] = useState25(`${DefaultStartHour}:00`);
13360
- const [endTime, setEndTime] = useState25(`${DefaultEndHour}:00`);
13361
- const [allDay, setAllDay] = useState25(false);
13362
- const [location, setLocation] = useState25("");
13363
- const [color, setColor] = useState25("sky");
13364
- const [error, setError] = useState25(null);
13365
- const [startDateOpen, setStartDateOpen] = useState25(false);
13366
- const [endDateOpen, setEndDateOpen] = useState25(false);
13367
- useEffect20(() => {
13476
+ const [title, setTitle] = useState26("");
13477
+ const [description, setDescription] = useState26("");
13478
+ const [startDate, setStartDate] = useState26(/* @__PURE__ */ new Date());
13479
+ const [endDate, setEndDate] = useState26(/* @__PURE__ */ new Date());
13480
+ const [startTime, setStartTime] = useState26(`${DefaultStartHour}:00`);
13481
+ const [endTime, setEndTime] = useState26(`${DefaultEndHour}:00`);
13482
+ const [allDay, setAllDay] = useState26(false);
13483
+ const [location, setLocation] = useState26("");
13484
+ const [color, setColor] = useState26("sky");
13485
+ const [error, setError] = useState26(null);
13486
+ const [startDateOpen, setStartDateOpen] = useState26(false);
13487
+ const [endDateOpen, setEndDateOpen] = useState26(false);
13488
+ useEffect21(() => {
13368
13489
  }, [event]);
13369
13490
  const resetForm = useCallback13(() => {
13370
13491
  setTitle("");
@@ -13383,7 +13504,7 @@ function EventDialog({
13383
13504
  const minutes = Math.floor(date.getMinutes() / 15) * 15;
13384
13505
  return `${hours}:${minutes.toString().padStart(2, "0")}`;
13385
13506
  }, []);
13386
- useEffect20(() => {
13507
+ useEffect21(() => {
13387
13508
  if (event) {
13388
13509
  setTitle(event.title || "");
13389
13510
  setDescription(event.description || "");
@@ -13401,7 +13522,7 @@ function EventDialog({
13401
13522
  resetForm();
13402
13523
  }
13403
13524
  }, [event, formatTimeForInput, resetForm]);
13404
- const timeOptions = useMemo12(() => {
13525
+ const timeOptions = useMemo13(() => {
13405
13526
  const options = [];
13406
13527
  for (let hour = StartHour; hour <= EndHour; hour++) {
13407
13528
  for (let minute = 0; minute < 60; minute += 15) {
@@ -13801,7 +13922,7 @@ function EventDialog({
13801
13922
 
13802
13923
  // src/components/event-calendar/EventItem.tsx
13803
13924
  import { differenceInMinutes as differenceInMinutes3, format as format7, isPast } from "date-fns";
13804
- import { useMemo as useMemo13 } from "react";
13925
+ import { useMemo as useMemo14 } from "react";
13805
13926
  import {
13806
13927
  ClockUserIcon
13807
13928
  } from "@phosphor-icons/react";
@@ -13888,7 +14009,7 @@ function EventItem({
13888
14009
  const eventColor = event.color;
13889
14010
  const hasValidTime = isValidDate(event.start) && isValidDate(event.end) || isValidDate(event.attend_date);
13890
14011
  const colorClasses = hasValidTime ? getEventColorClasses(eventColor) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
13891
- const displayStart = useMemo13(() => {
14012
+ const displayStart = useMemo14(() => {
13892
14013
  if (!hasValidTime) return void 0;
13893
14014
  if (isValidDate(event.start))
13894
14015
  return currentTime || new Date(event.start);
@@ -13896,7 +14017,7 @@ function EventItem({
13896
14017
  return currentTime || new Date(event.attend_date);
13897
14018
  return void 0;
13898
14019
  }, [currentTime, event.start, event.attend_date, hasValidTime]);
13899
- const displayEnd = useMemo13(() => {
14020
+ const displayEnd = useMemo14(() => {
13900
14021
  if (!hasValidTime) return void 0;
13901
14022
  if (isValidDate(event.end)) {
13902
14023
  return currentTime ? new Date(
@@ -13909,7 +14030,7 @@ function EventItem({
13909
14030
  }
13910
14031
  return void 0;
13911
14032
  }, [currentTime, event.start, event.end, event.attend_date, hasValidTime]);
13912
- const durationMinutes = useMemo13(() => {
14033
+ const durationMinutes = useMemo14(() => {
13913
14034
  if (!hasValidTime || !displayStart || !displayEnd) return 0;
13914
14035
  return differenceInMinutes3(displayEnd, displayStart);
13915
14036
  }, [displayStart, displayEnd, hasValidTime]);
@@ -14112,7 +14233,7 @@ function EventItem({
14112
14233
  // src/components/event-calendar/EventsPopUp.tsx
14113
14234
  import { format as format8, isSameDay as isSameDay2 } from "date-fns";
14114
14235
  import { ptBR as ptBR6 } from "date-fns/locale";
14115
- import { useEffect as useEffect21, useMemo as useMemo14, useRef as useRef11 } from "react";
14236
+ import { useEffect as useEffect22, useMemo as useMemo15, useRef as useRef11 } from "react";
14116
14237
  import { motion as motion17 } from "framer-motion";
14117
14238
  import { XIcon as XIcon11 } from "@phosphor-icons/react";
14118
14239
  import { jsx as jsx81, jsxs as jsxs61 } from "react/jsx-runtime";
@@ -14124,7 +14245,7 @@ function EventsPopup({
14124
14245
  onEventSelect
14125
14246
  }) {
14126
14247
  const popupRef = useRef11(null);
14127
- useEffect21(() => {
14248
+ useEffect22(() => {
14128
14249
  const handleClickOutside = (event) => {
14129
14250
  if (popupRef.current && !popupRef.current.contains(event.target)) {
14130
14251
  onClose();
@@ -14135,7 +14256,7 @@ function EventsPopup({
14135
14256
  document.removeEventListener("mousedown", handleClickOutside);
14136
14257
  };
14137
14258
  }, [onClose]);
14138
- useEffect21(() => {
14259
+ useEffect22(() => {
14139
14260
  const handleEscKey = (event) => {
14140
14261
  if (event.key === "Escape") {
14141
14262
  onClose();
@@ -14150,7 +14271,7 @@ function EventsPopup({
14150
14271
  if (onEventSelect) onEventSelect(event);
14151
14272
  onClose();
14152
14273
  };
14153
- const adjustedPosition = useMemo14(() => {
14274
+ const adjustedPosition = useMemo15(() => {
14154
14275
  const positionCopy = { ...position };
14155
14276
  if (popupRef.current) {
14156
14277
  const rect = popupRef.current.getBoundingClientRect();
@@ -14231,11 +14352,11 @@ function EventsPopup({
14231
14352
  // src/components/event-calendar/hooks/use-current-time-indicator.ts
14232
14353
  import { endOfWeek as endOfWeek2, isSameDay as isSameDay3, isWithinInterval, startOfWeek as startOfWeek2 } from "date-fns";
14233
14354
  import { ptBR as ptBR7 } from "date-fns/locale";
14234
- import { useEffect as useEffect22, useState as useState26 } from "react";
14355
+ import { useEffect as useEffect23, useState as useState27 } from "react";
14235
14356
  function useCurrentTimeIndicator(currentDate, view) {
14236
- const [currentTimePosition, setCurrentTimePosition] = useState26(0);
14237
- const [currentTimeVisible, setCurrentTimeVisible] = useState26(false);
14238
- useEffect22(() => {
14357
+ const [currentTimePosition, setCurrentTimePosition] = useState27(0);
14358
+ const [currentTimeVisible, setCurrentTimeVisible] = useState27(false);
14359
+ useEffect23(() => {
14239
14360
  const calculateTimePosition = () => {
14240
14361
  const now = /* @__PURE__ */ new Date();
14241
14362
  const hours = now.getHours();
@@ -14266,14 +14387,14 @@ function useCurrentTimeIndicator(currentDate, view) {
14266
14387
  }
14267
14388
 
14268
14389
  // src/components/event-calendar/hooks/use-event-visibility.ts
14269
- import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo15, useRef as useRef12, useState as useState27 } from "react";
14390
+ import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo16, useRef as useRef12, useState as useState28 } from "react";
14270
14391
  function useEventVisibility({
14271
14392
  eventHeight,
14272
14393
  eventGap
14273
14394
  }) {
14274
14395
  const contentRef = useRef12(null);
14275
14396
  const observerRef = useRef12(null);
14276
- const [contentHeight, setContentHeight] = useState27(null);
14397
+ const [contentHeight, setContentHeight] = useState28(null);
14277
14398
  useLayoutEffect2(() => {
14278
14399
  if (!contentRef.current) return;
14279
14400
  const updateHeight = () => {
@@ -14294,7 +14415,7 @@ function useEventVisibility({
14294
14415
  }
14295
14416
  };
14296
14417
  }, []);
14297
- const getVisibleEventCount = useMemo15(() => {
14418
+ const getVisibleEventCount = useMemo16(() => {
14298
14419
  return (totalEvents) => {
14299
14420
  if (!contentHeight) return totalEvents;
14300
14421
  const maxEvents = Math.floor(contentHeight / (eventHeight + eventGap));
@@ -14325,7 +14446,7 @@ import {
14325
14446
  startOfWeek as startOfWeek3
14326
14447
  } from "date-fns";
14327
14448
  import { ptBR as ptBR8 } from "date-fns/locale";
14328
- import { useEffect as useEffect23, useMemo as useMemo16, useState as useState28 } from "react";
14449
+ import { useEffect as useEffect24, useMemo as useMemo17, useState as useState29 } from "react";
14329
14450
  import { jsx as jsx82, jsxs as jsxs62 } from "react/jsx-runtime";
14330
14451
  function MonthView({
14331
14452
  currentDate,
@@ -14333,21 +14454,21 @@ function MonthView({
14333
14454
  onEventSelect,
14334
14455
  onEventCreate
14335
14456
  }) {
14336
- const days = useMemo16(() => {
14457
+ const days = useMemo17(() => {
14337
14458
  const monthStart = startOfMonth(currentDate);
14338
14459
  const monthEnd = endOfMonth(monthStart);
14339
14460
  const calendarStart = startOfWeek3(monthStart, { weekStartsOn: 0 });
14340
14461
  const calendarEnd = endOfWeek3(monthEnd, { weekStartsOn: 0 });
14341
14462
  return eachDayOfInterval({ end: calendarEnd, start: calendarStart });
14342
14463
  }, [currentDate]);
14343
- const weekdays = useMemo16(() => {
14464
+ const weekdays = useMemo17(() => {
14344
14465
  return Array.from({ length: 7 }).map((_, i) => {
14345
14466
  const date = addDays3(startOfWeek3(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
14346
14467
  const short = format9(date, "EEE", { locale: ptBR8 });
14347
14468
  return short.charAt(0).toUpperCase() + short.slice(1);
14348
14469
  });
14349
14470
  }, []);
14350
- const weeks = useMemo16(() => {
14471
+ const weeks = useMemo17(() => {
14351
14472
  const result = [];
14352
14473
  let week = [];
14353
14474
  for (let i = 0; i < days.length; i++) {
@@ -14363,12 +14484,12 @@ function MonthView({
14363
14484
  e.stopPropagation();
14364
14485
  onEventSelect(event);
14365
14486
  };
14366
- const [isMounted, setIsMounted] = useState28(false);
14487
+ const [isMounted, setIsMounted] = useState29(false);
14367
14488
  const { contentRef, getVisibleEventCount } = useEventVisibility({
14368
14489
  eventGap: EventGap,
14369
14490
  eventHeight: EventHeight
14370
14491
  });
14371
- useEffect23(() => {
14492
+ useEffect24(() => {
14372
14493
  setIsMounted(true);
14373
14494
  }, []);
14374
14495
  return /* @__PURE__ */ jsxs62("div", { className: "contents", "data-slot": "month-view", children: [
@@ -14659,7 +14780,7 @@ import {
14659
14780
  startOfWeek as startOfWeek4
14660
14781
  } from "date-fns";
14661
14782
  import { ptBR as ptBR9 } from "date-fns/locale";
14662
- import { useMemo as useMemo17 } from "react";
14783
+ import { useMemo as useMemo18 } from "react";
14663
14784
  import { jsx as jsx83, jsxs as jsxs63 } from "react/jsx-runtime";
14664
14785
  function WeekView({
14665
14786
  currentDate,
@@ -14667,23 +14788,23 @@ function WeekView({
14667
14788
  onEventSelect,
14668
14789
  onEventCreate
14669
14790
  }) {
14670
- const days = useMemo17(() => {
14791
+ const days = useMemo18(() => {
14671
14792
  const weekStart2 = startOfWeek4(currentDate, { weekStartsOn: 0 });
14672
14793
  const weekEnd = endOfWeek4(currentDate, { weekStartsOn: 0 });
14673
14794
  return eachDayOfInterval2({ end: weekEnd, start: weekStart2 });
14674
14795
  }, [currentDate]);
14675
- const weekStart = useMemo17(
14796
+ const weekStart = useMemo18(
14676
14797
  () => startOfWeek4(currentDate, { weekStartsOn: 0 }),
14677
14798
  [currentDate]
14678
14799
  );
14679
- const hours = useMemo17(() => {
14800
+ const hours = useMemo18(() => {
14680
14801
  const dayStart = startOfDay2(currentDate);
14681
14802
  return eachHourOfInterval2({
14682
14803
  end: addHours3(dayStart, EndHour - 1),
14683
14804
  start: addHours3(dayStart, StartHour)
14684
14805
  });
14685
14806
  }, [currentDate]);
14686
- const allDayEvents = useMemo17(() => {
14807
+ const allDayEvents = useMemo18(() => {
14687
14808
  return events.filter((event) => {
14688
14809
  return event.allDay || isMultiDayEvent(event);
14689
14810
  }).filter((event) => {
@@ -14694,7 +14815,7 @@ function WeekView({
14694
14815
  );
14695
14816
  });
14696
14817
  }, [events, days]);
14697
- const processedDayEvents = useMemo17(() => {
14818
+ const processedDayEvents = useMemo18(() => {
14698
14819
  const result = days.map((day) => {
14699
14820
  const dayEvents = events.filter((event) => {
14700
14821
  if (event.allDay || isMultiDayEvent(event)) return false;
@@ -14940,11 +15061,11 @@ function WeekView({
14940
15061
  }
14941
15062
 
14942
15063
  // src/components/ui/form/CheckBoxThree.tsx
14943
- import { useCallback as useCallback14, useMemo as useMemo18, useState as useState29, useEffect as useEffect24, useRef as useRef13 } from "react";
15064
+ import { useCallback as useCallback14, useMemo as useMemo19, useState as useState30, useEffect as useEffect25, useRef as useRef13 } from "react";
14944
15065
  import { motion as motion18, AnimatePresence as AnimatePresence12 } from "framer-motion";
14945
15066
  import { jsx as jsx84, jsxs as jsxs64 } from "react/jsx-runtime";
14946
15067
  function useCheckboxTree(initialTree) {
14947
- const initialCheckedNodes = useMemo18(() => {
15068
+ const initialCheckedNodes = useMemo19(() => {
14948
15069
  const checkedSet = /* @__PURE__ */ new Set();
14949
15070
  const initializeCheckedNodes = (node) => {
14950
15071
  if (node.defaultChecked) {
@@ -14955,7 +15076,7 @@ function useCheckboxTree(initialTree) {
14955
15076
  initializeCheckedNodes(initialTree);
14956
15077
  return checkedSet;
14957
15078
  }, [initialTree]);
14958
- const [checkedNodes, setCheckedNodes] = useState29(initialCheckedNodes);
15079
+ const [checkedNodes, setCheckedNodes] = useState30(initialCheckedNodes);
14959
15080
  const isChecked = useCallback14(
14960
15081
  (node) => {
14961
15082
  if (!node.children) {
@@ -15004,9 +15125,9 @@ function CheckboxTree({ tree, renderNode }) {
15004
15125
  onCheckedChange,
15005
15126
  children
15006
15127
  }) => {
15007
- const [open, setOpen] = useState29(() => !!node.children && status !== false);
15128
+ const [open, setOpen] = useState30(() => !!node.children && status !== false);
15008
15129
  const checkboxRef = useRef13(null);
15009
- useEffect24(() => {
15130
+ useEffect25(() => {
15010
15131
  if (checkboxRef.current) {
15011
15132
  checkboxRef.current.indeterminate = status === "indeterminate";
15012
15133
  }
@@ -15095,9 +15216,9 @@ import {
15095
15216
  createContext as createContext6,
15096
15217
  useCallback as useCallback15,
15097
15218
  useContext as useContext7,
15098
- useEffect as useEffect25,
15219
+ useEffect as useEffect26,
15099
15220
  useRef as useRef14,
15100
- useState as useState30
15221
+ useState as useState31
15101
15222
  } from "react";
15102
15223
  import { motion as motion19 } from "framer-motion";
15103
15224
  import { Fragment as Fragment13, jsx as jsx85, jsxs as jsxs65 } from "react/jsx-runtime";
@@ -15111,12 +15232,12 @@ function MultiSelectBase({
15111
15232
  empty,
15112
15233
  error
15113
15234
  }) {
15114
- const [open, setOpen] = useState30(false);
15115
- const [internalValues, setInternalValues] = useState30(
15235
+ const [open, setOpen] = useState31(false);
15236
+ const [internalValues, setInternalValues] = useState31(
15116
15237
  new Set(values ?? defaultValues)
15117
15238
  );
15118
15239
  const selectedValues = values ? new Set(values) : internalValues;
15119
- const [items, setItems] = useState30(/* @__PURE__ */ new Map());
15240
+ const [items, setItems] = useState31(/* @__PURE__ */ new Map());
15120
15241
  function toggleValue(value) {
15121
15242
  if (disabled) return;
15122
15243
  const getNewSet = (prev) => {
@@ -15182,7 +15303,7 @@ function MultiSelectTriggerBase({
15182
15303
  "aria-disabled": disabled || void 0,
15183
15304
  disabled,
15184
15305
  className: cn(
15185
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border bg-background px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 min-w-[150px]",
15306
+ "flex h-auto max-h-9 min-h-9 w-full items-center justify-between gap-2 overflow-hidden rounded-md border border-input bg-background px-3 py-1.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
15186
15307
  error ? "border-destructive focus:ring-1 focus:ring-destructive" : "border-input focus:ring-1 focus:ring-ring",
15187
15308
  className
15188
15309
  ),
@@ -15203,7 +15324,7 @@ function MultiSelectValueBase({
15203
15324
  ...props
15204
15325
  }) {
15205
15326
  const { selectedValues, toggleValue, items, open } = useMultiSelectContext();
15206
- const [overflowAmount, setOverflowAmount] = useState30(0);
15327
+ const [overflowAmount, setOverflowAmount] = useState31(0);
15207
15328
  const valueRef = useRef14(null);
15208
15329
  const overflowRef = useRef14(null);
15209
15330
  const mutationObserverRef = useRef14(null);
@@ -15267,7 +15388,10 @@ function MultiSelectValueBase({
15267
15388
  },
15268
15389
  [checkOverflow]
15269
15390
  );
15270
- if (selectedValues.size === 0 && placeholder) {
15391
+ const visibleSelected = [...selectedValues].filter(
15392
+ (value) => items.has(value)
15393
+ );
15394
+ if (visibleSelected.length === 0 && placeholder) {
15271
15395
  return /* @__PURE__ */ jsx85("span", { className: "min-w-0 overflow-hidden font-normal text-muted-foreground ", children: placeholder });
15272
15396
  }
15273
15397
  return /* @__PURE__ */ jsxs65(
@@ -15281,7 +15405,7 @@ function MultiSelectValueBase({
15281
15405
  className
15282
15406
  ),
15283
15407
  children: [
15284
- [...selectedValues].filter((value) => items.has(value)).map((value) => /* @__PURE__ */ jsxs65(
15408
+ visibleSelected.map((value) => /* @__PURE__ */ jsxs65(
15285
15409
  Badge,
15286
15410
  {
15287
15411
  "data-selected-item": true,
@@ -15353,7 +15477,7 @@ function MultiSelectItemBase({
15353
15477
  }) {
15354
15478
  const { toggleValue, selectedValues, onItemAdded } = useMultiSelectContext();
15355
15479
  const isSelected = selectedValues.has(value);
15356
- useEffect25(() => {
15480
+ useEffect26(() => {
15357
15481
  onItemAdded(value, badgeLabel ?? children);
15358
15482
  }, [value, children, onItemAdded, badgeLabel]);
15359
15483
  return /* @__PURE__ */ jsx85(
@@ -15413,7 +15537,7 @@ function debounce(func, wait) {
15413
15537
  // src/components/event-calendar-view/Agenda.tsx
15414
15538
  import { addDays as addDays4, format as format11, isToday as isToday4 } from "date-fns";
15415
15539
  import { ptBR as ptBR10 } from "date-fns/locale";
15416
- import { useMemo as useMemo19 } from "react";
15540
+ import { useMemo as useMemo20 } from "react";
15417
15541
  import { CalendarIcon as CalendarIcon5 } from "@phosphor-icons/react";
15418
15542
  import { twMerge as twMerge2 } from "tailwind-merge";
15419
15543
  import { Fragment as Fragment14, jsx as jsx86, jsxs as jsxs66 } from "react/jsx-runtime";
@@ -15423,7 +15547,7 @@ function Agenda({
15423
15547
  onEventSelect,
15424
15548
  showUndatedEvents = true
15425
15549
  }) {
15426
- const isValidDate6 = (d) => {
15550
+ const isValidDate5 = (d) => {
15427
15551
  try {
15428
15552
  const t = d instanceof Date ? d.getTime() : new Date(String(d)).getTime();
15429
15553
  return !isNaN(t);
@@ -15431,19 +15555,15 @@ function Agenda({
15431
15555
  return false;
15432
15556
  }
15433
15557
  };
15434
- const datedEvents = useMemo19(
15435
- () => events.filter(
15436
- (e) => isValidDate6(e.start) && isValidDate6(e.end) || isValidDate6(e.attend_date)
15437
- ),
15558
+ const datedEvents = useMemo20(
15559
+ () => events.filter((e) => isValidDate5(e.start) || isValidDate5(e.end)),
15438
15560
  [events]
15439
15561
  );
15440
- const undatedEvents = useMemo19(
15441
- () => events.filter(
15442
- (e) => !(isValidDate6(e.start) && isValidDate6(e.end)) && !isValidDate6(e.attend_date)
15443
- ),
15562
+ const undatedEvents = useMemo20(
15563
+ () => events.filter((e) => !(isValidDate5(e.start) || isValidDate5(e.end))),
15444
15564
  [events]
15445
15565
  );
15446
- const days = useMemo19(() => {
15566
+ const days = useMemo20(() => {
15447
15567
  console.log("Agenda view updating with date:", currentDate.toISOString());
15448
15568
  return Array.from(
15449
15569
  { length: AgendaDaysToShowAgenda },
@@ -15453,15 +15573,15 @@ function Agenda({
15453
15573
  const handleEventClick = (event, e) => {
15454
15574
  e.stopPropagation();
15455
15575
  console.log("Agenda view event clicked:", event);
15456
- if (onEventSelect) onEventSelect(event);
15576
+ if (onEventSelect) onEventSelect(event, e);
15457
15577
  };
15458
15578
  const hasEvents = days.some(
15459
15579
  (day) => getAgendaEventsForDayAgenda(datedEvents, day).length > 0
15460
15580
  );
15461
- return /* @__PURE__ */ jsx86("div", { className: "border-border/70 border-t px-4", children: !hasEvents && !(showUndatedEvents && undatedEvents.length > 0) ? /* @__PURE__ */ jsxs66("div", { className: "flex min-h-[70svh] flex-col items-center justify-center py-16 text-center", children: [
15581
+ return /* @__PURE__ */ jsx86("div", { className: "border-border/70 border-t px-4", children: !hasEvents && !(showUndatedEvents && undatedEvents.length > 0) ? /* @__PURE__ */ jsxs66("div", { className: "flex min-h-[70svh] flex-col items-center justify-center py-16 text-center px-4", children: [
15462
15582
  /* @__PURE__ */ jsx86(CalendarIcon5, { className: "mb-2 text-muted-foreground/50", size: 32 }),
15463
- /* @__PURE__ */ jsx86("h3", { className: "font-medium text-lg", children: "Nenhum evento encontrado" }),
15464
- /* @__PURE__ */ jsx86("p", { className: "text-muted-foreground", children: "N\xE3o h\xE1 eventos agendados para este per\xEDodo." })
15583
+ /* @__PURE__ */ jsx86("h3", { className: "font-semibold text-sm sm:text-base md:text-lg lg:text-xl min-w-0 truncate sm:whitespace-normal", children: "Nenhum evento encontrado" }),
15584
+ /* @__PURE__ */ jsx86("p", { className: "text-muted-foreground text-sm sm:text-base md:text-md max-w-prose", children: "N\xE3o h\xE1 eventos agendados para este per\xEDodo." })
15465
15585
  ] }) : /* @__PURE__ */ jsxs66(Fragment14, { children: [
15466
15586
  days.map((day) => {
15467
15587
  const dayEvents = getAgendaEventsForDayAgenda(datedEvents, day);
@@ -15469,12 +15589,18 @@ function Agenda({
15469
15589
  return /* @__PURE__ */ jsxs66(
15470
15590
  "div",
15471
15591
  {
15472
- className: twMerge2("relative my-12 border-border/70 border-t", isToday4(day) ? "border-blue-200" : ""),
15592
+ className: twMerge2(
15593
+ "relative my-12 border-border/70 border-t",
15594
+ isToday4(day) ? "border-blue-200" : ""
15595
+ ),
15473
15596
  children: [
15474
15597
  /* @__PURE__ */ jsx86(
15475
15598
  "span",
15476
15599
  {
15477
- className: twMerge2("-top-3 absolute left-0 flex h-6 items-center bg-background pe-4 uppercase data-today:font-extrabold sm:pe-4 text-lg font-bold", isToday4(day) ? "text-blue-500" : ""),
15600
+ className: twMerge2(
15601
+ "-top-3 absolute left-0 flex h-6 items-center bg-background pe-4 uppercase data-today:font-extrabold sm:pe-4 text-sm sm:text-base md:text-lg font-bold min-w-0",
15602
+ isToday4(day) ? "text-blue-500" : ""
15603
+ ),
15478
15604
  "data-today": isToday4(day) || void 0,
15479
15605
  children: (() => {
15480
15606
  const s = format11(day, "d MMM, EEEE", { locale: ptBR10 });
@@ -15488,7 +15614,7 @@ function Agenda({
15488
15614
  event,
15489
15615
  onClick: onEventSelect ? (e) => handleEventClick(event, e) : void 0,
15490
15616
  view: "agenda",
15491
- className: onEventSelect ? void 0 : "cursor-default hover:shadow-none hover:scale-100"
15617
+ className: onEventSelect ? void 0 : "hover:shadow-none hover:scale-100"
15492
15618
  },
15493
15619
  event.id
15494
15620
  )) })
@@ -15520,7 +15646,7 @@ import {
15520
15646
  useSensors as useSensors2
15521
15647
  } from "@dnd-kit/core";
15522
15648
  import { addMinutes as addMinutes2, differenceInMinutes as differenceInMinutes5 } from "date-fns";
15523
- import { useId as useId3, useRef as useRef15, useState as useState31 } from "react";
15649
+ import { useId as useId3, useRef as useRef15, useState as useState32 } from "react";
15524
15650
 
15525
15651
  // src/components/event-calendar-view/hooks.ts
15526
15652
  import { createContext as createContext7, useContext as useContext8 } from "react";
@@ -15542,16 +15668,18 @@ function CalendarDndProviderAgenda({
15542
15668
  children,
15543
15669
  onEventUpdate
15544
15670
  }) {
15545
- const [activeEvent, setActiveEvent] = useState31(null);
15546
- const [activeId, setActiveId] = useState31(null);
15547
- const [activeView, setActiveView] = useState31(
15671
+ const [activeEvent, setActiveEvent] = useState32(
15672
+ null
15673
+ );
15674
+ const [activeId, setActiveId] = useState32(null);
15675
+ const [activeView, setActiveView] = useState32(
15548
15676
  null
15549
15677
  );
15550
- const [currentTime, setCurrentTime] = useState31(null);
15551
- const [eventHeight, setEventHeight] = useState31(null);
15552
- const [isMultiDay, setIsMultiDay] = useState31(false);
15553
- const [multiDayWidth, setMultiDayWidth] = useState31(null);
15554
- const [dragHandlePosition, setDragHandlePosition] = useState31(null);
15678
+ const [currentTime, setCurrentTime] = useState32(null);
15679
+ const [eventHeight, setEventHeight] = useState32(null);
15680
+ const [isMultiDay, setIsMultiDay] = useState32(false);
15681
+ const [multiDayWidth, setMultiDayWidth] = useState32(null);
15682
+ const [dragHandlePosition, setDragHandlePosition] = useState32(null);
15555
15683
  const eventDimensions = useRef15({ height: 0 });
15556
15684
  const sensors = useSensors2(
15557
15685
  useSensor2(MouseSensor2, {
@@ -15592,7 +15720,7 @@ function CalendarDndProviderAgenda({
15592
15720
  setActiveEvent(calendarEvent);
15593
15721
  setActiveId(active.id);
15594
15722
  setActiveView(view);
15595
- setCurrentTime(calendarEvent.start ? new Date(calendarEvent.start) : null);
15723
+ setCurrentTime(getEventStartDate(calendarEvent) ?? null);
15596
15724
  setIsMultiDay(eventIsMultiDay || false);
15597
15725
  setMultiDayWidth(eventMultiDayWidth || null);
15598
15726
  setDragHandlePosition(eventDragHandlePosition || null);
@@ -15677,12 +15805,15 @@ function CalendarDndProviderAgenda({
15677
15805
  currentTime.getMilliseconds()
15678
15806
  );
15679
15807
  }
15680
- if (!calendarEvent.start || !calendarEvent.end) {
15681
- console.error("Cannot compute duration: event start or end is null", calendarEvent);
15808
+ const originalStart = getEventStartDate(calendarEvent);
15809
+ const originalEnd = getEventEndDate(calendarEvent);
15810
+ if (!originalStart || !originalEnd) {
15811
+ console.error(
15812
+ "Cannot compute duration: event start or end (or duration) is missing",
15813
+ calendarEvent
15814
+ );
15682
15815
  return;
15683
15816
  }
15684
- const originalStart = new Date(calendarEvent.start);
15685
- const originalEnd = new Date(calendarEvent.end);
15686
15817
  const durationMinutes = differenceInMinutes5(originalEnd, originalStart);
15687
15818
  const newEnd = addMinutes2(newStart, durationMinutes);
15688
15819
  const hasStartTimeChanged = originalStart.getFullYear() !== newStart.getFullYear() || originalStart.getMonth() !== newStart.getMonth() || originalStart.getDate() !== newStart.getDate() || originalStart.getHours() !== newStart.getHours() || originalStart.getMinutes() !== newStart.getMinutes();
@@ -15769,7 +15900,7 @@ var DefaultEndHourAgenda = 10;
15769
15900
 
15770
15901
  // src/components/event-calendar-view/DayView.tsx
15771
15902
  import {
15772
- addHours as addHours5,
15903
+ addHours as addHours4,
15773
15904
  areIntervalsOverlapping as areIntervalsOverlapping3,
15774
15905
  differenceInMinutes as differenceInMinutes7,
15775
15906
  eachHourOfInterval as eachHourOfInterval3,
@@ -15777,14 +15908,12 @@ import {
15777
15908
  getHours as getHours3,
15778
15909
  getMinutes as getMinutes3,
15779
15910
  isSameDay as isSameDay9,
15780
- startOfDay as startOfDay3,
15781
- endOfDay
15911
+ startOfDay as startOfDay3
15782
15912
  } from "date-fns";
15783
- import { useMemo as useMemo21 } from "react";
15913
+ import { useMemo as useMemo22 } from "react";
15784
15914
 
15785
15915
  // src/components/event-calendar-view/utils.ts
15786
15916
  import { isSameDay as isSameDay7 } from "date-fns";
15787
- import { addHours as addHours4 } from "date-fns";
15788
15917
  function getEventColorClassesAgenda(color) {
15789
15918
  const eventColor = color || "sky";
15790
15919
  switch (eventColor) {
@@ -15817,14 +15946,14 @@ function getBorderRadiusClassesAgenda(isFirstDay, isLastDay) {
15817
15946
  return "rounded-none";
15818
15947
  }
15819
15948
  function isMultiDayEventAgenda(event) {
15820
- const eventStart = isValidDate3(event.start) ? new Date(event.start) : void 0;
15821
- const eventEnd = isValidDate3(event.end) ? new Date(event.end) : void 0;
15949
+ const eventStart = getEventStartDate(event);
15950
+ const eventEnd = getEventEndDate(event);
15822
15951
  if (!eventStart || !eventEnd) return !!event.allDay;
15823
15952
  return event.allDay || eventStart.getDate() !== eventEnd.getDate();
15824
15953
  }
15825
15954
  function getEventsForDayAgenda(events, day) {
15826
15955
  return events.filter((event) => {
15827
- const eventStart = isValidDate3(event.start) ? new Date(event.start) : isValidDate3(event.attend_date) ? normalizeAttendDate(event.attend_date) : void 0;
15956
+ const eventStart = getEventStartDate(event);
15828
15957
  return eventStart ? isSameDay7(day, eventStart) : false;
15829
15958
  }).sort((a, b) => getEventStartTimestamp2(a) - getEventStartTimestamp2(b));
15830
15959
  }
@@ -15840,31 +15969,40 @@ function sortEventsAgenda(events) {
15840
15969
  function getSpanningEventsForDayAgenda(events, day) {
15841
15970
  return events.filter((event) => {
15842
15971
  if (!isMultiDayEventAgenda(event)) return false;
15843
- const eventStart = isValidDate3(event.start) ? new Date(event.start) : void 0;
15844
- const eventEnd = isValidDate3(event.end) ? new Date(event.end) : void 0;
15972
+ const eventStart = getEventStartDate(event);
15973
+ const eventEnd = getEventEndDate(event);
15845
15974
  if (!eventStart || !eventEnd) return false;
15846
15975
  return !isSameDay7(day, eventStart) && (isSameDay7(day, eventEnd) || day > eventStart && day < eventEnd);
15847
15976
  });
15848
15977
  }
15849
15978
  function getAllEventsForDayAgenda(events, day) {
15850
15979
  return events.filter((event) => {
15851
- const eventStart = isValidDate3(event.start) ? new Date(event.start) : void 0;
15852
- const eventEnd = isValidDate3(event.end) ? new Date(event.end) : void 0;
15980
+ const eventStart = getEventStartDate(event);
15981
+ const eventEnd = getEventEndDate(event);
15853
15982
  if (!eventStart) return false;
15854
15983
  return isSameDay7(day, eventStart) || (eventEnd ? isSameDay7(day, eventEnd) : false) || (eventEnd ? day > eventStart && day < eventEnd : false);
15855
15984
  });
15856
15985
  }
15857
15986
  function getAgendaEventsForDayAgenda(events, day) {
15858
15987
  return events.filter((event) => {
15859
- const eventStart = isValidDate3(event.start) ? new Date(event.start) : isValidDate3(event.attend_date) ? normalizeAttendDate(event.attend_date) : void 0;
15860
- const eventEnd = isValidDate3(event.end) ? new Date(event.end) : isValidDate3(event.attend_date) ? (() => {
15861
- const dt = normalizeAttendDate(event.attend_date);
15862
- return dt ? addHours4(dt, 1) : void 0;
15863
- })() : void 0;
15988
+ const eventStart = getEventStartDate(event);
15989
+ const eventEnd = getEventEndDate(event);
15864
15990
  if (!eventStart) return false;
15865
15991
  return isSameDay7(day, eventStart) || (eventEnd ? isSameDay7(day, eventEnd) : false) || (eventEnd ? day > eventStart && day < eventEnd : false);
15866
15992
  }).sort((a, b) => getEventStartTimestamp2(a) - getEventStartTimestamp2(b));
15867
15993
  }
15994
+ function getEventStartDate(event) {
15995
+ if (isValidDate3(event.start)) return new Date(event.start);
15996
+ return void 0;
15997
+ }
15998
+ function getEventEndDate(event) {
15999
+ if (isValidDate3(event.end)) return new Date(event.end);
16000
+ const start = getEventStartDate(event);
16001
+ if (start && typeof event.duration === "number" && !isNaN(event.duration)) {
16002
+ return addMinutesToDateAgenda(start, event.duration);
16003
+ }
16004
+ return void 0;
16005
+ }
15868
16006
  function isValidDate3(d) {
15869
16007
  try {
15870
16008
  const t = d instanceof Date ? d.getTime() : new Date(String(d)).getTime();
@@ -15874,9 +16012,8 @@ function isValidDate3(d) {
15874
16012
  }
15875
16013
  }
15876
16014
  function getEventStartTimestamp2(e) {
15877
- if (isValidDate3(e.start)) return new Date(e.start).getTime();
15878
- if (isValidDate3(e.attend_date))
15879
- return normalizeAttendDate(e.attend_date).getTime();
16015
+ const s = getEventStartDate(e);
16016
+ if (s) return s.getTime();
15880
16017
  return Number.MAX_SAFE_INTEGER;
15881
16018
  }
15882
16019
  function normalizeAttendDate(d) {
@@ -15892,20 +16029,23 @@ function normalizeAttendDate(d) {
15892
16029
  return void 0;
15893
16030
  }
15894
16031
  }
15895
- function addHoursToDateAgenda(date, hours) {
16032
+ function addMinutesToDateAgenda(date, minutes) {
15896
16033
  const result = new Date(date);
15897
- result.setHours(result.getHours() + hours);
16034
+ result.setMinutes(result.getMinutes() + minutes);
15898
16035
  return result;
15899
16036
  }
16037
+ function addHoursToDateAgenda(date, hours) {
16038
+ return addMinutesToDateAgenda(date, Math.round(hours * 60));
16039
+ }
15900
16040
 
15901
16041
  // src/components/event-calendar-view/hooks/use-current-time-indicator.ts
15902
16042
  import { endOfWeek as endOfWeek5, isSameDay as isSameDay8, isWithinInterval as isWithinInterval2, startOfWeek as startOfWeek5 } from "date-fns";
15903
16043
  import { ptBR as ptBR11 } from "date-fns/locale";
15904
- import { useEffect as useEffect26, useState as useState32 } from "react";
16044
+ import { useEffect as useEffect27, useState as useState33 } from "react";
15905
16045
  function useCurrentTimeIndicatorAgenda(currentDate, view) {
15906
- const [currentTimePosition, setCurrentTimePosition] = useState32(0);
15907
- const [currentTimeVisible, setCurrentTimeVisible] = useState32(false);
15908
- useEffect26(() => {
16046
+ const [currentTimePosition, setCurrentTimePosition] = useState33(0);
16047
+ const [currentTimeVisible, setCurrentTimeVisible] = useState33(false);
16048
+ useEffect27(() => {
15909
16049
  const calculateTimePosition = () => {
15910
16050
  const now = /* @__PURE__ */ new Date();
15911
16051
  const hours = now.getHours();
@@ -15937,20 +16077,11 @@ function useCurrentTimeIndicatorAgenda(currentDate, view) {
15937
16077
 
15938
16078
  // src/components/event-calendar-view/EventItemAgenda.tsx
15939
16079
  import { differenceInMinutes as differenceInMinutes6, format as format12, isPast as isPast2 } from "date-fns";
15940
- import { useMemo as useMemo20 } from "react";
15941
- import { ClockUserIcon as ClockUserIcon2 } from "@phosphor-icons/react";
16080
+ import { useMemo as useMemo21 } from "react";
15942
16081
  import { Fragment as Fragment15, jsx as jsx88, jsxs as jsxs68 } from "react/jsx-runtime";
15943
16082
  var formatTimeWithOptionalMinutes2 = (date) => {
15944
16083
  return format12(date, "HH:mm");
15945
16084
  };
15946
- var isValidDate4 = (d) => {
15947
- try {
15948
- const dt = d instanceof Date ? d : new Date(String(d));
15949
- return !isNaN(dt.getTime());
15950
- } catch {
15951
- return false;
15952
- }
15953
- };
15954
16085
  function EventWrapper2({
15955
16086
  event,
15956
16087
  isFirstDay = true,
@@ -15966,16 +16097,20 @@ function EventWrapper2({
15966
16097
  onTouchStart,
15967
16098
  ariaLabel
15968
16099
  }) {
15969
- const hasValidTimeForWrapper = isValidDate4(event.start) && isValidDate4(event.end) || isValidDate4(event.attend_date);
16100
+ const wrapperStart = getEventStartDate(event);
16101
+ const wrapperEnd = getEventEndDate(event);
16102
+ const hasValidTimeForWrapper = !!wrapperStart || !!wrapperEnd;
15970
16103
  const displayEnd = (() => {
15971
- if (isValidDate4(event.start) && isValidDate4(event.end)) {
16104
+ if (wrapperStart && wrapperEnd) {
15972
16105
  return currentTime ? new Date(
15973
- new Date(currentTime).getTime() + (new Date(event.end).getTime() - new Date(event.start).getTime())
15974
- ) : new Date(event.end);
16106
+ new Date(currentTime).getTime() + (wrapperEnd.getTime() - wrapperStart.getTime())
16107
+ ) : wrapperEnd;
16108
+ }
16109
+ if (wrapperStart && !wrapperEnd) {
16110
+ return currentTime ? new Date(currentTime) : wrapperStart;
15975
16111
  }
15976
- if (isValidDate4(event.attend_date)) {
15977
- const start = normalizeAttendDate(event.attend_date);
15978
- return start ? addHoursToDateAgenda(start, 1) : void 0;
16112
+ if (!wrapperStart && wrapperEnd) {
16113
+ return currentTime ? new Date(currentTime) : wrapperEnd;
15979
16114
  }
15980
16115
  return void 0;
15981
16116
  })();
@@ -15985,7 +16120,7 @@ function EventWrapper2({
15985
16120
  "button",
15986
16121
  {
15987
16122
  className: cn(
15988
- "flex w-full select-none overflow-hidden px-3 py-1 text-left font-medium outline-none transition-transform duration-150 ease-out backdrop-blur-sm focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-dragging:cursor-grabbing data-past-event:line-through data-dragging:shadow-lg sm:px-3 rounded-lg shadow-sm hover:shadow-md ",
16123
+ "flex w-full select-none overflow-hidden px-3 py-1 text-left font-medium outline-none transition-transform duration-150 ease-out backdrop-blur-sm focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-dragging:cursor-grabbing data-past-event:line-through data-dragging:shadow-lg sm:px-3 rounded-lg shadow-sm hover:shadow-md border",
15989
16124
  colorClasses,
15990
16125
  getBorderRadiusClassesAgenda(isFirstDay, isLastDay),
15991
16126
  className
@@ -16020,30 +16155,29 @@ function EventItemAgenda({
16020
16155
  agendaOnly = false
16021
16156
  }) {
16022
16157
  const eventColor = event.color;
16023
- const hasValidTime = isValidDate4(event.start) && isValidDate4(event.end) || isValidDate4(event.attend_date);
16158
+ const startDate = getEventStartDate(event);
16159
+ const endDate = getEventEndDate(event);
16160
+ const hasValidTime = !!startDate || !!endDate;
16024
16161
  const colorClasses = hasValidTime ? getEventColorClassesAgenda(eventColor) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
16025
- const displayStart = useMemo20(() => {
16162
+ const displayStart = useMemo21(() => {
16026
16163
  if (!hasValidTime) return void 0;
16027
- if (isValidDate4(event.start))
16028
- return currentTime || new Date(event.start);
16029
- if (isValidDate4(event.attend_date))
16030
- return currentTime || normalizeAttendDate(event.attend_date);
16164
+ if (startDate) return currentTime || startDate;
16165
+ if (endDate) return currentTime || endDate;
16031
16166
  return void 0;
16032
- }, [currentTime, event.start, event.attend_date, hasValidTime]);
16033
- const displayEnd = useMemo20(() => {
16167
+ }, [currentTime, startDate, endDate, hasValidTime]);
16168
+ const displayEnd = useMemo21(() => {
16034
16169
  if (!hasValidTime) return void 0;
16035
- if (isValidDate4(event.end)) {
16170
+ if (endDate) {
16036
16171
  return currentTime ? new Date(
16037
- new Date(currentTime).getTime() + (new Date(event.end).getTime() - new Date(event.start).getTime())
16038
- ) : new Date(event.end);
16172
+ new Date(currentTime).getTime() + (startDate ? endDate.getTime() - startDate.getTime() : 0)
16173
+ ) : endDate;
16039
16174
  }
16040
- if (isValidDate4(event.attend_date)) {
16041
- const start = normalizeAttendDate(event.attend_date);
16042
- return start ? addHoursToDateAgenda(start, 1) : void 0;
16175
+ if (startDate) {
16176
+ return currentTime ? new Date(currentTime) : startDate;
16043
16177
  }
16044
16178
  return void 0;
16045
- }, [currentTime, event.start, event.end, event.attend_date, hasValidTime]);
16046
- const durationMinutes = useMemo20(() => {
16179
+ }, [currentTime, startDate, endDate, hasValidTime]);
16180
+ const durationMinutes = useMemo21(() => {
16047
16181
  if (!hasValidTime || !displayStart || !displayEnd) return 0;
16048
16182
  return differenceInMinutes6(displayEnd, displayStart);
16049
16183
  }, [displayStart, displayEnd, hasValidTime]);
@@ -16076,7 +16210,7 @@ function EventItemAgenda({
16076
16210
  EventWrapper2,
16077
16211
  {
16078
16212
  className: cn(
16079
- "mt-[var(--event-gap)] h-[var(--event-height)] items-center text-[10px] sm:text-xs",
16213
+ "mt-[var(--event-gap)] h-[var(--event-height)] items-center sm:text-xs",
16080
16214
  className
16081
16215
  ),
16082
16216
  currentTime,
@@ -16087,14 +16221,14 @@ function EventItemAgenda({
16087
16221
  isFirstDay,
16088
16222
  isLastDay,
16089
16223
  onClick,
16090
- children: children || /* @__PURE__ */ jsxs68("span", { className: "flex items-center gap-2 truncate", children: [
16091
- !event.allDay && hasValidTime && displayStart && /* @__PURE__ */ jsx88("span", { className: "truncate font-normal opacity-80 sm:text-[11px] bg-white/10 px-2 py-0.5 rounded-full text-[11px]", children: formatTimeWithOptionalMinutes2(displayStart) }),
16224
+ children: children || /* @__PURE__ */ jsxs68("span", { className: "flex items-center gap-2 truncate min-w-0", children: [
16225
+ !event.allDay && hasValidTime && displayStart && /* @__PURE__ */ jsx88("span", { className: "truncate text-sm sm:text-base md:text-lg lg:text-xl opacity-80 bg-white/10 px-2 rounded-full min-w-0", children: formatTimeWithOptionalMinutes2(displayStart) }),
16092
16226
  /* @__PURE__ */ jsx88(
16093
16227
  "span",
16094
16228
  {
16095
16229
  className: cn(
16096
- "truncate",
16097
- agendaOnly ? "font-bold text-lg" : "font-medium"
16230
+ "truncate min-w-0",
16231
+ agendaOnly ? "font-bold text-sm sm:text-base md:text-lg" : "font-medium text-sm sm:text-base md:text-lg"
16098
16232
  ),
16099
16233
  children: event.title
16100
16234
  }
@@ -16121,11 +16255,25 @@ function EventItemAgenda({
16121
16255
  isFirstDay,
16122
16256
  isLastDay,
16123
16257
  children: durationMinutes < 45 ? /* @__PURE__ */ jsxs68("div", { className: "flex items-center justify-between w-full", children: [
16124
- /* @__PURE__ */ jsx88("div", { className: cn("truncate text-lg"), children: event.title }),
16125
- showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx88("span", { className: "ml-2 inline-block bg-white/10 px-2 py-0.5 rounded-full text-[11px] opacity-90", children: formatTimeWithOptionalMinutes2(displayStart) })
16258
+ /* @__PURE__ */ jsx88(
16259
+ "div",
16260
+ {
16261
+ className: cn("truncate text-sm sm:text-base md:text-lg min-w-0"),
16262
+ children: event.title
16263
+ }
16264
+ ),
16265
+ showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx88("span", { className: "ml-2 flex items-center gap-3 bg-white/10 py-0.5 rounded-full opacity-90 text-sm sm:text-base md:text-lg min-w-0", children: formatTimeWithOptionalMinutes2(displayStart) })
16126
16266
  ] }) : /* @__PURE__ */ jsxs68(Fragment15, { children: [
16127
- /* @__PURE__ */ jsx88("div", { className: cn("truncate font-medium text-lg"), children: event.title }),
16128
- showTime && hasValidTime && /* @__PURE__ */ jsx88("div", { className: "truncate font-normal opacity-70 sm:text-[15px]", children: /* @__PURE__ */ jsx88("span", { className: "inline-block bg-white/5 px-0.5 py-0.5 rounded-full", children: getEventTime() }) })
16267
+ /* @__PURE__ */ jsx88(
16268
+ "div",
16269
+ {
16270
+ className: cn(
16271
+ "truncate font-medium text-sm sm:text-base md:text-lg min-w-0"
16272
+ ),
16273
+ children: event.title
16274
+ }
16275
+ ),
16276
+ showTime && hasValidTime && /* @__PURE__ */ jsx88("div", { className: "truncate font-normal opacity-70 text-sm sm:text-base", children: /* @__PURE__ */ jsx88("span", { className: "inline-block bg-white/5 px-0.5 py-0.5 rounded-full", children: getEventTime() }) })
16129
16277
  ] })
16130
16278
  }
16131
16279
  );
@@ -16147,7 +16295,16 @@ function EventItemAgenda({
16147
16295
  ...dndListeners,
16148
16296
  ...dndAttributes,
16149
16297
  children: [
16150
- /* @__PURE__ */ jsx88("div", { className: cn("font-medium", agendaOnly ? "text-lg" : "text-sm"), children: event.title }),
16298
+ /* @__PURE__ */ jsx88(
16299
+ "div",
16300
+ {
16301
+ className: cn(
16302
+ "font-medium min-w-0 truncate",
16303
+ agendaOnly ? "text-sm sm:text-base md:text-lg" : "text-sm sm:text-base"
16304
+ ),
16305
+ children: event.title
16306
+ }
16307
+ ),
16151
16308
  /* @__PURE__ */ jsx88(
16152
16309
  "div",
16153
16310
  {
@@ -16155,7 +16312,7 @@ function EventItemAgenda({
16155
16312
  "opacity-70 flex items-center gap-2",
16156
16313
  agendaOnly ? "text-sm" : "text-xs"
16157
16314
  ),
16158
- children: event.location && /* @__PURE__ */ jsxs68("span", { className: "opacity-80 flex items-center gap-1", children: [
16315
+ children: event.location && /* @__PURE__ */ jsxs68("span", { className: "opacity-80 flex items-center gap-1 min-w-0", children: [
16159
16316
  "-",
16160
16317
  /* @__PURE__ */ jsx88("span", { className: "truncate", children: event.location })
16161
16318
  ] })
@@ -16166,7 +16323,7 @@ function EventItemAgenda({
16166
16323
  {
16167
16324
  className: cn(
16168
16325
  "my-1 opacity-90",
16169
- agendaOnly ? "text-md" : "text-xs"
16326
+ agendaOnly ? "text-sm sm:text-base" : "text-xs sm:text-sm"
16170
16327
  ),
16171
16328
  style: {
16172
16329
  display: "-webkit-box",
@@ -16199,27 +16356,38 @@ function EventItemAgenda({
16199
16356
  ...dndAttributes,
16200
16357
  children: [
16201
16358
  /* @__PURE__ */ jsxs68("div", { className: "flex w-full justify-between ", children: [
16202
- /* @__PURE__ */ jsx88("div", { className: cn("font-bold text-lg"), children: event.title }),
16203
- /* @__PURE__ */ jsx88("div", { className: cn("opacity-90 flex items-center gap-2 text-lg"), children: event.allDay ? /* @__PURE__ */ jsx88("span", { children: "Dia todo" }) : /* @__PURE__ */ jsxs68("span", { className: "uppercase font-semibold flex items-center gap-2", children: [
16204
- formatTimeWithOptionalMinutes2(displayStart),
16205
- /* @__PURE__ */ jsx88("span", { className: "opacity-70", children: "-" }),
16206
- formatTimeWithOptionalMinutes2(displayEnd),
16207
- /* @__PURE__ */ jsx88(ClockUserIcon2, {})
16208
- ] }) })
16209
- ] }),
16210
- event.description && /* @__PURE__ */ jsx88(
16211
- "div",
16212
- {
16213
- className: cn("my-1 opacity-90 flex text-md"),
16214
- style: {
16215
- display: "-webkit-box",
16216
- WebkitLineClamp: 2,
16217
- WebkitBoxOrient: "vertical",
16218
- overflow: "hidden"
16219
- },
16220
- children: event.description
16221
- }
16222
- )
16359
+ /* @__PURE__ */ jsx88(
16360
+ "div",
16361
+ {
16362
+ className: cn(
16363
+ "font-bold text-sm sm:text-base md:text-lg min-w-0 truncate"
16364
+ ),
16365
+ children: event.title
16366
+ }
16367
+ ),
16368
+ /* @__PURE__ */ jsx88(
16369
+ "div",
16370
+ {
16371
+ className: cn(
16372
+ "opacity-90 flex items-center gap-2 text-sm sm:text-base md:text-lg min-w-0"
16373
+ ),
16374
+ children: event.allDay ? /* @__PURE__ */ jsx88("span", { children: "Dia todo" }) : /* @__PURE__ */ jsx88("span", { className: "uppercase font-semibold flex items-center gap-2 ", children: formatTimeWithOptionalMinutes2(displayStart) })
16375
+ }
16376
+ )
16377
+ ] }),
16378
+ event.description && /* @__PURE__ */ jsx88(
16379
+ "div",
16380
+ {
16381
+ className: cn("my-1 opacity-90 flex text-sm sm:text-base"),
16382
+ style: {
16383
+ display: "-webkit-box",
16384
+ WebkitLineClamp: 2,
16385
+ WebkitBoxOrient: "vertical",
16386
+ overflow: "hidden"
16387
+ },
16388
+ children: event.description
16389
+ }
16390
+ )
16223
16391
  ]
16224
16392
  }
16225
16393
  );
@@ -16269,60 +16437,41 @@ function DayViewAgenda({
16269
16437
  onEventSelect,
16270
16438
  showUndatedEvents
16271
16439
  }) {
16272
- const hours = useMemo21(() => {
16440
+ const hours = useMemo22(() => {
16273
16441
  const dayStart = startOfDay3(currentDate);
16274
16442
  return eachHourOfInterval3({
16275
- end: addHours5(dayStart, EndHourAgenda - 1),
16276
- start: addHours5(dayStart, StartHourAgenda)
16443
+ end: addHours4(dayStart, EndHourAgenda - 1),
16444
+ start: addHours4(dayStart, StartHourAgenda)
16277
16445
  });
16278
16446
  }, [currentDate]);
16279
- const dayEvents = useMemo21(() => {
16280
- const dayStart = startOfDay3(currentDate);
16281
- const dayEnd = endOfDay(currentDate);
16282
- return events.map((event) => {
16283
- let eventStart = event.start != null ? new Date(event.start) : void 0;
16284
- let eventEnd = event.end != null ? new Date(event.end) : void 0;
16285
- if ((!eventStart || !eventEnd) && event.attend_date) {
16286
- try {
16287
- const ad = new Date(event.attend_date);
16288
- const hasTime = ad.getHours() !== 0 || ad.getMinutes() !== 0 || ad.getSeconds() !== 0 || ad.getMilliseconds() !== 0;
16289
- if (hasTime) {
16290
- if (!eventStart) eventStart = ad;
16291
- if (!eventEnd) eventEnd = addHours5(ad, 1);
16292
- }
16293
- } catch {
16294
- }
16295
- }
16296
- return { event, eventStart, eventEnd };
16297
- }).filter(({ eventStart, eventEnd }) => !!eventStart && !!eventEnd).filter(
16298
- ({ eventStart, eventEnd }) => areIntervalsOverlapping3(
16299
- { start: eventStart, end: eventEnd },
16300
- { start: dayStart, end: dayEnd }
16301
- )
16302
- ).map(({ event }) => event).sort((a, b) => {
16303
- const aStart = a.start ? new Date(a.start).getTime() : a.attend_date ? new Date(a.attend_date).getTime() : 0;
16304
- const bStart = b.start ? new Date(b.start).getTime() : b.attend_date ? new Date(b.attend_date).getTime() : 0;
16305
- return aStart - bStart;
16306
- });
16447
+ const dayEvents = useMemo22(() => {
16448
+ return events.filter((event) => {
16449
+ if (event.start == null) return false;
16450
+ const eventStart = getEventStartDate(event) ?? /* @__PURE__ */ new Date();
16451
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
16452
+ return isSameDay9(currentDate, eventStart) || isSameDay9(currentDate, eventEnd) || currentDate > eventStart && currentDate < eventEnd;
16453
+ }).sort(
16454
+ (a, b) => new Date(a.start).getTime() - new Date(b.start).getTime()
16455
+ );
16307
16456
  }, [currentDate, events]);
16308
- const allDayEvents = useMemo21(() => {
16457
+ const allDayEvents = useMemo22(() => {
16309
16458
  return dayEvents.filter((event) => {
16310
16459
  return event.allDay || isMultiDayEventAgenda(event);
16311
16460
  });
16312
16461
  }, [dayEvents]);
16313
- const timeEvents = useMemo21(() => {
16462
+ const timeEvents = useMemo22(() => {
16314
16463
  return dayEvents.filter((event) => {
16315
16464
  return !event.allDay && !isMultiDayEventAgenda(event);
16316
16465
  });
16317
16466
  }, [dayEvents]);
16318
- const positionedEvents = useMemo21(() => {
16467
+ const positionedEvents = useMemo22(() => {
16319
16468
  const result = [];
16320
16469
  const dayStart = startOfDay3(currentDate);
16321
16470
  const sortedEvents = [...timeEvents].sort((a, b) => {
16322
- const aStart = new Date(a.start);
16323
- const bStart = new Date(b.start);
16324
- const aEnd = new Date(a.end);
16325
- const bEnd = new Date(b.end);
16471
+ const aStart = getEventStartDate(a) ?? getEventEndDate(a) ?? /* @__PURE__ */ new Date();
16472
+ const bStart = getEventStartDate(b) ?? getEventEndDate(b) ?? /* @__PURE__ */ new Date();
16473
+ const aEnd = getEventEndDate(a) ?? getEventStartDate(a) ?? /* @__PURE__ */ new Date();
16474
+ const bEnd = getEventEndDate(b) ?? getEventStartDate(b) ?? /* @__PURE__ */ new Date();
16326
16475
  if (aStart < bStart) return -1;
16327
16476
  if (aStart > bStart) return 1;
16328
16477
  const aDuration = differenceInMinutes7(aEnd, aStart);
@@ -16331,22 +16480,10 @@ function DayViewAgenda({
16331
16480
  });
16332
16481
  const columns = [];
16333
16482
  for (const event of sortedEvents) {
16334
- let eventStart = event.start != null ? new Date(event.start) : void 0;
16335
- let eventEnd = event.end != null ? new Date(event.end) : void 0;
16336
- if ((!eventStart || !eventEnd) && event.attend_date) {
16337
- try {
16338
- const ad = new Date(event.attend_date);
16339
- const hasTime = ad.getHours() !== 0 || ad.getMinutes() !== 0 || ad.getSeconds() !== 0 || ad.getMilliseconds() !== 0;
16340
- if (hasTime) {
16341
- if (!eventStart) eventStart = ad;
16342
- if (!eventEnd) eventEnd = addHours5(ad, 1);
16343
- }
16344
- } catch {
16345
- }
16346
- }
16347
- if (!eventStart || !eventEnd) continue;
16483
+ const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
16484
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
16348
16485
  const adjustedStart = isSameDay9(currentDate, eventStart) ? eventStart : dayStart;
16349
- const adjustedEnd = isSameDay9(currentDate, eventEnd) ? eventEnd : addHours5(dayStart, 24);
16486
+ const adjustedEnd = isSameDay9(currentDate, eventEnd) ? eventEnd : addHours4(dayStart, 24);
16350
16487
  const startHour = getHours3(adjustedStart) + getMinutes3(adjustedStart) / 60;
16351
16488
  const endHour = getHours3(adjustedEnd) + getMinutes3(adjustedEnd) / 60;
16352
16489
  const top = (startHour - StartHourAgenda) * WeekCellsHeightAgenda;
@@ -16359,12 +16496,14 @@ function DayViewAgenda({
16359
16496
  columns[columnIndex] = col;
16360
16497
  placed = true;
16361
16498
  } else {
16362
- const overlaps = col.some(
16363
- (c) => areIntervalsOverlapping3(
16499
+ const overlaps = col.some((c) => {
16500
+ const cStart = getEventStartDate(c.event) ?? getEventEndDate(c.event) ?? /* @__PURE__ */ new Date();
16501
+ const cEnd = getEventEndDate(c.event) ?? getEventStartDate(c.event) ?? /* @__PURE__ */ new Date();
16502
+ return areIntervalsOverlapping3(
16364
16503
  { end: adjustedEnd, start: adjustedStart },
16365
- { end: c.end, start: c.start }
16366
- )
16367
- );
16504
+ { end: cEnd, start: cStart }
16505
+ );
16506
+ });
16368
16507
  if (!overlaps) {
16369
16508
  placed = true;
16370
16509
  } else {
@@ -16374,7 +16513,11 @@ function DayViewAgenda({
16374
16513
  }
16375
16514
  const currentColumn = columns[columnIndex] || [];
16376
16515
  columns[columnIndex] = currentColumn;
16377
- currentColumn.push({ start: adjustedStart, end: adjustedEnd, event });
16516
+ currentColumn.push({
16517
+ end: adjustedEnd,
16518
+ event,
16519
+ start: adjustedStart
16520
+ });
16378
16521
  const width = columnIndex === 0 ? 1 : 0.9;
16379
16522
  const left = columnIndex === 0 ? 0 : columnIndex * 0.1;
16380
16523
  result.push({
@@ -16390,25 +16533,18 @@ function DayViewAgenda({
16390
16533
  }, [currentDate, timeEvents]);
16391
16534
  const handleEventClick = (event, e) => {
16392
16535
  e.stopPropagation();
16393
- onEventSelect(event);
16536
+ onEventSelect(event, e);
16394
16537
  };
16395
16538
  const showAllDaySection = allDayEvents.length > 0;
16396
- const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(
16397
- currentDate,
16398
- "day"
16399
- );
16539
+ const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(currentDate, "day");
16400
16540
  return /* @__PURE__ */ jsxs69("div", { className: "contents", "data-slot": "day-view", children: [
16401
16541
  showAllDaySection && /* @__PURE__ */ jsx90("div", { className: "border-border/70 border-t bg-muted/50", children: /* @__PURE__ */ jsxs69("div", { className: "grid grid-cols-[3rem_1fr] sm:grid-cols-[4rem_1fr]", children: [
16402
16542
  /* @__PURE__ */ jsx90("div", { className: "relative", children: /* @__PURE__ */ jsx90("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "All day" }) }),
16403
16543
  /* @__PURE__ */ jsx90("div", { className: "relative border-border/70 border-r p-1 last:border-r-0", children: allDayEvents.map((event) => {
16404
- const eventStart = new Date(
16405
- event.start ?? event.attend_date ?? event.end ?? Date.now()
16406
- );
16407
- const eventEnd = new Date(
16408
- event.end ?? event.attend_date ?? event.start ?? Date.now()
16409
- );
16410
- const isFirstDay = isSameDay9(currentDate, eventStart);
16411
- const isLastDay = isSameDay9(currentDate, eventEnd);
16544
+ const eventStart = getEventStartDate(event);
16545
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
16546
+ const isFirstDay = eventStart ? isSameDay9(currentDate, eventStart) : false;
16547
+ const isLastDay = eventEnd ? isSameDay9(currentDate, eventEnd) : false;
16412
16548
  return /* @__PURE__ */ jsx90(
16413
16549
  EventItemAgenda,
16414
16550
  {
@@ -16435,12 +16571,8 @@ function DayViewAgenda({
16435
16571
  /* @__PURE__ */ jsxs69("div", { className: "relative", children: [
16436
16572
  positionedEvents.map((positionedEvent) => {
16437
16573
  const evt = positionedEvent.event;
16438
- const eventStart = new Date(
16439
- evt.start ?? evt.attend_date ?? evt.end ?? Date.now()
16440
- );
16441
- const eventEnd = new Date(
16442
- evt.end ?? evt.attend_date ?? evt.start ?? Date.now()
16443
- );
16574
+ const eventStart = new Date(evt.start ?? evt.end ?? Date.now());
16575
+ const eventEnd = new Date(evt.end ?? evt.start ?? Date.now());
16444
16576
  const isFirstDay = isSameDay9(currentDate, eventStart);
16445
16577
  const isLastDay = isSameDay9(currentDate, eventEnd);
16446
16578
  return /* @__PURE__ */ jsx90(
@@ -16540,393 +16672,216 @@ import {
16540
16672
  subWeeks as subWeeks2
16541
16673
  } from "date-fns";
16542
16674
  import { ptBR as ptBR12 } from "date-fns/locale";
16543
- import { useEffect as useEffect27, useMemo as useMemo22, useState as useState33, useCallback as useCallback16 } from "react";
16675
+ import React46, { useMemo as useMemo23, useState as useState34 } from "react";
16544
16676
  import { toast as toast4 } from "sonner";
16545
- import {
16546
- CalendarIcon as CalendarIcon6,
16547
- CaretDownIcon as CaretDownIcon6,
16548
- CaretLeftIcon as CaretLeftIcon4,
16549
- CaretRightIcon as CaretRightIcon7,
16550
- Check as Check2
16551
- } from "@phosphor-icons/react";
16552
- import { Fragment as Fragment16, jsx as jsx91, jsxs as jsxs70 } from "react/jsx-runtime";
16677
+ import { CaretLeftIcon as CaretLeftIcon5, CaretRightIcon as CaretRightIcon8 } from "@phosphor-icons/react";
16678
+ import { jsx as jsx91, jsxs as jsxs70 } from "react/jsx-runtime";
16553
16679
  function EventAgenda({
16554
16680
  events = [],
16555
16681
  onEventUpdate,
16556
16682
  className,
16557
16683
  initialView = "month",
16558
- mode,
16559
- initialDate
16684
+ initialDate,
16685
+ onClick
16560
16686
  }) {
16561
- const [currentDate, setCurrentDate] = useState33(
16687
+ const [currentDate, setCurrentDate] = useState34(
16562
16688
  initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
16563
16689
  );
16564
- const [view, setView] = useState33(initialView);
16565
- const [isFading, setIsFading] = useState33(false);
16566
- const FADE_DURATION = 220;
16567
- const changeView = useCallback16(
16568
- (next) => {
16569
- if (mode === "agenda-only") return;
16570
- if (next === view) return;
16571
- setIsFading(true);
16572
- window.setTimeout(() => {
16573
- setView(next);
16574
- requestAnimationFrame(() => setIsFading(false));
16575
- }, FADE_DURATION);
16576
- },
16577
- [view, mode]
16578
- );
16579
- const [isPaging, setIsPaging] = useState33(false);
16580
- const [pageDirection, setPageDirection] = useState33(
16581
- null
16582
- );
16583
- const PAGE_DURATION = 200;
16584
- const pageTransition = useCallback16(
16585
- (applyDateChange, direction) => {
16586
- setIsPaging(true);
16587
- setPageDirection(direction);
16588
- window.setTimeout(() => {
16589
- applyDateChange();
16590
- requestAnimationFrame(() => {
16591
- setIsPaging(false);
16592
- setPageDirection(null);
16593
- });
16594
- }, PAGE_DURATION);
16595
- },
16596
- []
16597
- );
16598
- const [isEventDialogOpen, setIsEventDialogOpen] = useState33(false);
16599
- useEffect27(() => {
16600
- const handleKeyDown = (e) => {
16601
- if (isEventDialogOpen || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLElement && e.target.isContentEditable) {
16690
+ const [view, setView] = useState34(initialView);
16691
+ const [selectedEvent, setSelectedEvent] = useState34(null);
16692
+ const goPrevious = () => {
16693
+ if (view === "month") setCurrentDate((d) => subMonths2(d, 1));
16694
+ else if (view === "week") setCurrentDate((d) => subWeeks2(d, 1));
16695
+ else if (view === "day") setCurrentDate((d) => addDays5(d, -1));
16696
+ else if (view === "agenda")
16697
+ setCurrentDate((d) => addDays5(d, -AgendaDaysToShowAgenda));
16698
+ };
16699
+ const goNext = () => {
16700
+ if (view === "month") setCurrentDate((d) => addMonths2(d, 1));
16701
+ else if (view === "week") setCurrentDate((d) => addWeeks2(d, 1));
16702
+ else if (view === "day") setCurrentDate((d) => addDays5(d, 1));
16703
+ else if (view === "agenda")
16704
+ setCurrentDate((d) => addDays5(d, AgendaDaysToShowAgenda));
16705
+ };
16706
+ const handleEventSelect = (event, e) => {
16707
+ try {
16708
+ if (typeof onClick === "function") {
16709
+ onClick(
16710
+ event,
16711
+ e
16712
+ );
16602
16713
  return;
16603
16714
  }
16604
- if (mode === "agenda-only") return;
16605
- switch (e.key.toLowerCase()) {
16606
- case "m":
16607
- changeView("month");
16608
- break;
16609
- case "w":
16610
- case "s":
16611
- changeView("week");
16612
- break;
16613
- case "d":
16614
- changeView("day");
16615
- break;
16616
- case "a":
16617
- changeView("agenda");
16618
- break;
16619
- }
16620
- };
16621
- window.addEventListener("keydown", handleKeyDown);
16622
- return () => {
16623
- window.removeEventListener("keydown", handleKeyDown);
16624
- };
16625
- }, [isEventDialogOpen, changeView, mode]);
16626
- useEffect27(() => {
16627
- if (mode === "agenda-only") setView("agenda");
16628
- }, [mode]);
16629
- const handlePrevious = () => {
16630
- pageTransition(() => {
16631
- if (view === "month") {
16632
- setCurrentDate(subMonths2(currentDate, 1));
16633
- } else if (view === "week") {
16634
- setCurrentDate(subWeeks2(currentDate, 1));
16635
- } else if (view === "day") {
16636
- setCurrentDate(addDays5(currentDate, -1));
16637
- } else if (view === "agenda") {
16638
- setCurrentDate(addDays5(currentDate, -AgendaDaysToShowAgenda));
16639
- }
16640
- }, "right");
16641
- };
16642
- const handleNext = () => {
16643
- pageTransition(() => {
16644
- if (view === "month") {
16645
- setCurrentDate(addMonths2(currentDate, 1));
16646
- } else if (view === "week") {
16647
- setCurrentDate(addWeeks2(currentDate, 1));
16648
- } else if (view === "day") {
16649
- setCurrentDate(addDays5(currentDate, 1));
16650
- } else if (view === "agenda") {
16651
- setCurrentDate(addDays5(currentDate, AgendaDaysToShowAgenda));
16715
+ if (React46.isValidElement(onClick)) {
16716
+ setSelectedEvent(event);
16717
+ return;
16652
16718
  }
16653
- }, "left");
16654
- };
16655
- const handleToday = () => {
16656
- setCurrentDate(/* @__PURE__ */ new Date());
16657
- };
16658
- const handleEventSelect = (event) => {
16719
+ } catch (err) {
16720
+ console.error(err);
16721
+ }
16659
16722
  console.log("Event selected:", event);
16660
- setIsEventDialogOpen(true);
16661
16723
  };
16662
16724
  const handleEventUpdate = (updatedEvent) => {
16725
+ if (updatedEvent.start == null) {
16726
+ console.warn(
16727
+ `Ignored update for event ${updatedEvent.id} because start is null`
16728
+ );
16729
+ return;
16730
+ }
16663
16731
  onEventUpdate?.(updatedEvent);
16664
- const startDate = updatedEvent.start ?? /* @__PURE__ */ new Date();
16732
+ const startDate = new Date(updatedEvent.start);
16665
16733
  toast4(`Evento "${updatedEvent.title}" movido`, {
16666
16734
  description: format14(startDate, "d 'de' MMMM 'de' yyyy", { locale: ptBR12 }),
16667
16735
  position: "bottom-left"
16668
16736
  });
16669
16737
  };
16670
- const viewTitle = useMemo22(() => {
16671
- const capitalize = (s) => s && s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
16672
- if (view === "month") {
16738
+ const viewLabel = (v, condensed = false) => {
16739
+ const labels = {
16740
+ month: { full: "M\xEAs", short: "M" },
16741
+ week: { full: "Semana", short: "S" },
16742
+ day: { full: "Dia", short: "D" },
16743
+ agenda: { full: "Agenda", short: "A" }
16744
+ };
16745
+ const entry = labels[v] || { full: v, short: v };
16746
+ return condensed ? entry.short : entry.full;
16747
+ };
16748
+ const viewTitle = useMemo23(() => {
16749
+ const capitalize = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
16750
+ if (view === "month")
16673
16751
  return capitalize(format14(currentDate, "MMMM yyyy", { locale: ptBR12 }));
16674
- }
16675
16752
  if (view === "week") {
16676
16753
  const start = startOfWeek6(currentDate, { weekStartsOn: 1 });
16677
16754
  const end = endOfWeek6(currentDate, { weekStartsOn: 1 });
16678
- if (isSameMonth3(start, end)) {
16755
+ if (isSameMonth3(start, end))
16679
16756
  return capitalize(format14(start, "MMMM yyyy", { locale: ptBR12 }));
16680
- }
16681
16757
  const s1 = capitalize(format14(start, "MMM", { locale: ptBR12 }));
16682
16758
  const s2 = capitalize(format14(end, "MMM yyyy", { locale: ptBR12 }));
16683
16759
  return `${s1} - ${s2}`;
16684
16760
  }
16685
- if (view === "day") {
16686
- const dayNum = format14(currentDate, "d", { locale: ptBR12 });
16687
- const month = capitalize(format14(currentDate, "MMMM", { locale: ptBR12 }));
16688
- const year = format14(currentDate, "yyyy", { locale: ptBR12 });
16689
- const short = `${dayNum} de ${month} de ${year}`;
16690
- return /* @__PURE__ */ jsxs70(Fragment16, { children: [
16691
- /* @__PURE__ */ jsx91("span", { "aria-hidden": "true", className: "min-[480px]:hidden", children: short }),
16692
- /* @__PURE__ */ jsx91("span", { "aria-hidden": "true", className: "max-[479px]:hidden min-md:hidden", children: short })
16693
- ] });
16694
- }
16761
+ if (view === "day")
16762
+ return format14(currentDate, "d 'de' MMMM 'de' yyyy", { locale: ptBR12 });
16695
16763
  if (view === "agenda") {
16696
16764
  const start = currentDate;
16697
16765
  const end = addDays5(currentDate, AgendaDaysToShowAgenda - 1);
16698
- if (isSameMonth3(start, end)) {
16766
+ if (isSameMonth3(start, end))
16699
16767
  return capitalize(format14(start, "MMMM yyyy", { locale: ptBR12 }));
16700
- }
16701
16768
  const s1 = capitalize(format14(start, "MMMM", { locale: ptBR12 }));
16702
16769
  const s2 = capitalize(format14(end, "MMMM yyyy", { locale: ptBR12 }));
16703
16770
  return `${s1} - ${s2}`;
16704
16771
  }
16705
16772
  return capitalize(format14(currentDate, "MMMM yyyy", { locale: ptBR12 }));
16706
16773
  }, [currentDate, view]);
16707
- const calendarContent = /* @__PURE__ */ jsxs70(Fragment16, { children: [
16708
- /* @__PURE__ */ jsxs70(
16709
- "div",
16710
- {
16711
- className: cn(
16712
- "flex items-center justify-between p-2 sm:p-4",
16713
- className
16714
- ),
16715
- children: [
16716
- /* @__PURE__ */ jsxs70("div", { className: "flex items-center gap-1 sm:gap-4", children: [
16717
- /* @__PURE__ */ jsxs70(
16718
- ButtonBase,
16719
- {
16720
- className: "max-[479px]:aspect-square max-[479px]:p-0!",
16721
- onClick: handleToday,
16722
- variant: "outline",
16723
- children: [
16724
- /* @__PURE__ */ jsx91(
16725
- CalendarIcon6,
16726
- {
16727
- "aria-hidden": "true",
16728
- className: "min-[480px]:hidden",
16729
- size: 16
16730
- }
16731
- ),
16732
- /* @__PURE__ */ jsx91("span", { className: "max-[479px]:sr-only", children: "Hoje" })
16733
- ]
16734
- }
16735
- ),
16736
- /* @__PURE__ */ jsxs70("div", { className: "flex items-center sm:gap-2", children: [
16737
- /* @__PURE__ */ jsx91(
16738
- ButtonBase,
16739
- {
16740
- "aria-label": "Anterior",
16741
- onClick: handlePrevious,
16742
- size: "icon",
16743
- variant: "ghost",
16744
- children: /* @__PURE__ */ jsx91(CaretLeftIcon4, { "aria-hidden": "true", size: 16 })
16745
- }
16746
- ),
16747
- /* @__PURE__ */ jsx91(
16748
- ButtonBase,
16749
- {
16750
- "aria-label": "Pr\xF3ximo",
16751
- onClick: handleNext,
16752
- size: "icon",
16753
- variant: "ghost",
16754
- children: /* @__PURE__ */ jsx91(CaretRightIcon7, { "aria-hidden": "true", size: 16 })
16755
- }
16756
- )
16757
- ] }),
16758
- /* @__PURE__ */ jsx91("h2", { className: "font-semibold text-xl", children: viewTitle })
16759
- ] }),
16760
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx91(Fragment16, { children: /* @__PURE__ */ jsxs70(DropDownMenuBase, { children: [
16761
- /* @__PURE__ */ jsx91(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs70(
16762
- ButtonBase,
16763
- {
16764
- className: "gap-2 px-3 py-1.5 max-[479px]:h-8",
16765
- variant: "outline",
16766
- children: [
16767
- /* @__PURE__ */ jsxs70("span", { className: "flex items-center gap-2", children: [
16768
- /* @__PURE__ */ jsx91("span", { className: "hidden min-[480px]:inline-block", children: (() => {
16769
- const labels = {
16770
- month: "M\xEAs",
16771
- week: "Semana",
16772
- day: "Dia",
16773
- agenda: "Agenda"
16774
- };
16775
- return labels[view] || view;
16776
- })() }),
16777
- /* @__PURE__ */ jsx91("span", { className: "min-[480px]:hidden", children: (() => {
16778
- const labels = {
16779
- month: "M",
16780
- week: "S",
16781
- day: "D",
16782
- agenda: "A"
16783
- };
16784
- return labels[view] || view;
16785
- })() })
16786
- ] }),
16787
- /* @__PURE__ */ jsx91(
16788
- CaretDownIcon6,
16789
- {
16790
- "aria-hidden": "true",
16791
- className: "-me-1 opacity-60",
16792
- size: 16
16793
- }
16794
- )
16795
- ]
16796
- }
16797
- ) }),
16798
- mode === "agenda-only" ? null : /* @__PURE__ */ jsxs70(
16799
- DropDownMenuContentBase,
16800
- {
16801
- align: "end",
16802
- className: "min-w-32 rounded-md p-1",
16803
- children: [
16804
- /* @__PURE__ */ jsxs70(
16805
- DropDownMenuItemBase,
16806
- {
16807
- onClick: () => changeView("month"),
16808
- className: cn(
16809
- "flex items-center justify-between gap-2 px-3 py-2 rounded",
16810
- view === "month"
16811
- ),
16812
- children: [
16813
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx91("span", { children: " M\xEAs " }) }),
16814
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: view === "month" ? /* @__PURE__ */ jsx91(Check2, { "aria-hidden": true, className: "opacity-80", size: 14 }) : /* @__PURE__ */ jsx91(DropDownMenuShortcutBase, { children: "M" }) })
16815
- ]
16816
- }
16817
- ),
16818
- /* @__PURE__ */ jsxs70(
16819
- DropDownMenuItemBase,
16820
- {
16821
- onClick: () => changeView("week"),
16822
- className: cn(
16823
- "flex items-center justify-between gap-2 px-3 py-2 rounded",
16824
- view === "week"
16825
- ),
16826
- children: [
16827
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: "Semana" }),
16828
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: view === "week" ? /* @__PURE__ */ jsx91(Check2, { "aria-hidden": true, className: "opacity-80", size: 14 }) : /* @__PURE__ */ jsx91(DropDownMenuShortcutBase, { children: "S" }) })
16829
- ]
16830
- }
16831
- ),
16832
- /* @__PURE__ */ jsxs70(
16833
- DropDownMenuItemBase,
16834
- {
16835
- onClick: () => changeView("day"),
16836
- className: cn(
16837
- "flex items-center justify-between gap-2 px-3 py-2 rounded",
16838
- view === "day"
16839
- ),
16840
- children: [
16841
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: "Dia" }),
16842
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: view === "day" ? /* @__PURE__ */ jsx91(Check2, { "aria-hidden": true, className: "opacity-80", size: 14 }) : /* @__PURE__ */ jsx91(DropDownMenuShortcutBase, { children: "D" }) })
16843
- ]
16844
- }
16845
- ),
16846
- /* @__PURE__ */ jsxs70(
16847
- DropDownMenuItemBase,
16848
- {
16849
- onClick: () => changeView("agenda"),
16850
- className: cn(
16851
- "flex items-center justify-between gap-2 px-3 py-2 rounded",
16852
- view === "agenda"
16853
- ),
16854
- children: [
16855
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: "Agenda" }),
16856
- /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: view === "agenda" ? /* @__PURE__ */ jsx91(Check2, { "aria-hidden": true, className: "opacity-80", size: 14 }) : /* @__PURE__ */ jsx91(DropDownMenuShortcutBase, { children: "A" }) })
16857
- ]
16858
- }
16859
- )
16860
- ]
16861
- }
16862
- )
16863
- ] }) }) })
16864
- ]
16865
- }
16866
- ),
16867
- /* @__PURE__ */ jsxs70(
16868
- "div",
16869
- {
16870
- className: cn(
16871
- "flex flex-1 flex-col transition-all duration-200 ease-in-out",
16872
- isFading ? "opacity-0 -translate-y-2 pointer-events-none" : isPaging ? pageDirection === "left" ? "-translate-x-4 opacity-0 pointer-events-none" : "translate-x-4 opacity-0 pointer-events-none" : "opacity-100 translate-y-0"
16873
- ),
16874
- "aria-live": "polite",
16875
- children: [
16876
- view === "month" && /* @__PURE__ */ jsx91(
16877
- MonthViewAgenda,
16878
- {
16879
- currentDate,
16880
- events,
16881
- onEventSelect: handleEventSelect
16882
- }
16883
- ),
16884
- view === "week" && /* @__PURE__ */ jsx91(
16885
- WeekViewAgenda,
16886
- {
16887
- currentDate,
16888
- events,
16889
- onEventSelect: handleEventSelect
16890
- }
16891
- ),
16892
- view === "day" && /* @__PURE__ */ jsx91(
16893
- DayViewAgenda,
16894
- {
16895
- currentDate,
16896
- events,
16897
- onEventSelect: handleEventSelect
16898
- }
16899
- ),
16900
- view === "agenda" && /* @__PURE__ */ jsx91(
16901
- Agenda,
16902
- {
16903
- currentDate,
16904
- events,
16905
- onEventSelect: handleEventSelect
16906
- }
16907
- )
16908
- ]
16909
- }
16910
- )
16911
- ] });
16912
- return /* @__PURE__ */ jsx91(
16774
+ return /* @__PURE__ */ jsxs70(
16913
16775
  "div",
16914
16776
  {
16915
- className: "flex flex-col rounded-lg border has-data-[slot=month-view]:flex-1 px-6",
16777
+ className: cn(
16778
+ "flex flex-col rounded-lg border has-data-[slot=month-view]:flex-1 px-6 py-2",
16779
+ className
16780
+ ),
16916
16781
  style: {
16917
16782
  "--event-gap": `${EventGapAgenda}px`,
16918
16783
  "--event-height": `${EventHeightAgenda}px`,
16919
16784
  "--week-cells-height": `${WeekCellsHeightAgenda}px`
16920
16785
  },
16921
- children: /* @__PURE__ */ jsx91(CalendarDndProviderAgenda, { onEventUpdate: handleEventUpdate, children: calendarContent })
16786
+ children: [
16787
+ /* @__PURE__ */ jsxs70(CalendarDndProviderAgenda, { onEventUpdate: handleEventUpdate, children: [
16788
+ /* @__PURE__ */ jsxs70("div", { className: "flex items-center justify-between p-2 sm:p-4", children: [
16789
+ /* @__PURE__ */ jsxs70("div", { className: "flex items-center gap-1 sm:gap-4 min-w-0", children: [
16790
+ /* @__PURE__ */ jsxs70("div", { className: "flex items-center sm:gap-2", children: [
16791
+ /* @__PURE__ */ jsx91(
16792
+ ButtonBase,
16793
+ {
16794
+ "aria-label": "Anterior",
16795
+ onClick: goPrevious,
16796
+ size: "icon",
16797
+ variant: "ghost",
16798
+ children: /* @__PURE__ */ jsx91(CaretLeftIcon5, { "aria-hidden": true, size: 16 })
16799
+ }
16800
+ ),
16801
+ /* @__PURE__ */ jsx91(
16802
+ ButtonBase,
16803
+ {
16804
+ "aria-label": "Pr\xF3ximo",
16805
+ onClick: goNext,
16806
+ size: "icon",
16807
+ variant: "ghost",
16808
+ children: /* @__PURE__ */ jsx91(CaretRightIcon8, { "aria-hidden": true, size: 16 })
16809
+ }
16810
+ )
16811
+ ] }),
16812
+ /* @__PURE__ */ jsx91("h2", { className: "font-semibold text-sm sm:text-base md:text-lg lg:text-xl xl:text-2xl min-w-0 truncate sm:whitespace-normal", children: viewTitle })
16813
+ ] }),
16814
+ /* @__PURE__ */ jsx91("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx91(
16815
+ Select,
16816
+ {
16817
+ selected: view,
16818
+ onChange: (v) => {
16819
+ setView(v);
16820
+ },
16821
+ items: ["month", "week", "day", "agenda"].map((v) => ({
16822
+ label: viewLabel(v),
16823
+ value: v
16824
+ })),
16825
+ className: "gap-2 px-3 py-1.5 max-[479px]:h-8",
16826
+ placeholder: viewLabel(view)
16827
+ }
16828
+ ) })
16829
+ ] }),
16830
+ /* @__PURE__ */ jsxs70(
16831
+ "div",
16832
+ {
16833
+ className: "flex flex-1 flex-col transition-all duration-200 ease-in-out",
16834
+ "aria-live": "polite",
16835
+ children: [
16836
+ view === "month" && /* @__PURE__ */ jsx91(
16837
+ MonthViewAgenda,
16838
+ {
16839
+ currentDate,
16840
+ events,
16841
+ onEventSelect: handleEventSelect
16842
+ }
16843
+ ),
16844
+ view === "week" && /* @__PURE__ */ jsx91(
16845
+ WeekViewAgenda,
16846
+ {
16847
+ currentDate,
16848
+ events,
16849
+ onEventSelect: handleEventSelect
16850
+ }
16851
+ ),
16852
+ view === "day" && /* @__PURE__ */ jsx91(
16853
+ DayViewAgenda,
16854
+ {
16855
+ currentDate,
16856
+ events,
16857
+ onEventSelect: handleEventSelect
16858
+ }
16859
+ ),
16860
+ view === "agenda" && /* @__PURE__ */ jsx91(
16861
+ Agenda,
16862
+ {
16863
+ currentDate,
16864
+ events,
16865
+ onEventSelect: handleEventSelect
16866
+ }
16867
+ )
16868
+ ]
16869
+ }
16870
+ )
16871
+ ] }),
16872
+ selectedEvent && React46.isValidElement(onClick) ? React46.cloneElement(onClick, {
16873
+ event: selectedEvent,
16874
+ onClose: () => setSelectedEvent(null)
16875
+ }) : null
16876
+ ]
16922
16877
  }
16923
16878
  );
16924
16879
  }
16925
16880
 
16926
16881
  // src/components/event-calendar-view/UndatedEvents.tsx
16927
- import { useMemo as useMemo23 } from "react";
16882
+ import { useMemo as useMemo24 } from "react";
16928
16883
  import { jsx as jsx92, jsxs as jsxs71 } from "react/jsx-runtime";
16929
- var isValidDate5 = (d) => {
16884
+ var isValidDate4 = (d) => {
16930
16885
  try {
16931
16886
  const t = d instanceof Date ? d.getTime() : new Date(String(d)).getTime();
16932
16887
  return !isNaN(t);
@@ -16941,23 +16896,21 @@ function UndatedEvents({
16941
16896
  title = "Data de Atendimento n\xE3o Prevista",
16942
16897
  show = true
16943
16898
  }) {
16944
- const undatedEvents = useMemo23(
16945
- () => events.filter(
16946
- (e) => !(isValidDate5(e.start) && isValidDate5(e.end)) && !isValidDate5(e.attend_date)
16947
- ),
16899
+ const undatedEvents = useMemo24(
16900
+ () => events.filter((e) => !(isValidDate4(e.start) || isValidDate4(e.end))),
16948
16901
  [events]
16949
16902
  );
16950
16903
  if (!show || undatedEvents.length === 0) return null;
16951
16904
  return /* @__PURE__ */ jsx92("div", { className, children: /* @__PURE__ */ jsxs71("div", { className: "relative border-border/70 border-t", children: [
16952
- /* @__PURE__ */ jsx92("span", { className: "-top-3 absolute left-0 flex h-6 items-center bg-background pe-4 uppercase sm:pe-4 text-lg", children: title }),
16905
+ /* @__PURE__ */ jsx92("span", { className: "-top-3 absolute left-0 flex h-6 items-center bg-background pe-4 uppercase sm:pe-4 text-md sm:text-lg", children: title }),
16953
16906
  /* @__PURE__ */ jsx92("div", { className: "mt-6 space-y-2", children: undatedEvents.map((event) => /* @__PURE__ */ jsx92(
16954
16907
  EventItemAgenda,
16955
16908
  {
16956
16909
  event,
16957
- onClick: onEventSelect ? () => onEventSelect(event) : void 0,
16910
+ onClick: onEventSelect ? (e) => onEventSelect(event, e) : void 0,
16958
16911
  view: "agenda",
16959
16912
  agendaOnly: true,
16960
- className: "cursor-default hover:shadow-none hover:scale-100 bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none "
16913
+ className: "hover:shadow-none hover:scale-100 bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none "
16961
16914
  },
16962
16915
  event.id
16963
16916
  )) })
@@ -16965,14 +16918,14 @@ function UndatedEvents({
16965
16918
  }
16966
16919
 
16967
16920
  // src/components/event-calendar-view/hooks/use-event-visibility.ts
16968
- import { useLayoutEffect as useLayoutEffect3, useMemo as useMemo24, useRef as useRef16, useState as useState34 } from "react";
16921
+ import { useLayoutEffect as useLayoutEffect3, useMemo as useMemo25, useRef as useRef16, useState as useState35 } from "react";
16969
16922
  function useEventVisibilityAgenda({
16970
16923
  eventHeight,
16971
16924
  eventGap
16972
16925
  }) {
16973
16926
  const contentRef = useRef16(null);
16974
16927
  const observerRef = useRef16(null);
16975
- const [contentHeight, setContentHeight] = useState34(null);
16928
+ const [contentHeight, setContentHeight] = useState35(null);
16976
16929
  useLayoutEffect3(() => {
16977
16930
  if (!contentRef.current) return;
16978
16931
  const updateHeight = () => {
@@ -16993,7 +16946,7 @@ function useEventVisibilityAgenda({
16993
16946
  }
16994
16947
  };
16995
16948
  }, []);
16996
- const getVisibleEventCount = useMemo24(() => {
16949
+ const getVisibleEventCount = useMemo25(() => {
16997
16950
  return (totalEvents) => {
16998
16951
  if (!contentHeight) return totalEvents;
16999
16952
  const maxEvents = Math.floor(contentHeight / (eventHeight + eventGap));
@@ -17024,7 +16977,7 @@ import {
17024
16977
  startOfWeek as startOfWeek7
17025
16978
  } from "date-fns";
17026
16979
  import { ptBR as ptBR13 } from "date-fns/locale";
17027
- import { useEffect as useEffect28, useMemo as useMemo25, useState as useState35 } from "react";
16980
+ import { useEffect as useEffect28, useMemo as useMemo26, useState as useState36 } from "react";
17028
16981
  import { twMerge as twMerge3 } from "tailwind-merge";
17029
16982
  import { jsx as jsx93, jsxs as jsxs72 } from "react/jsx-runtime";
17030
16983
  function MonthViewAgenda({
@@ -17033,21 +16986,21 @@ function MonthViewAgenda({
17033
16986
  onEventSelect,
17034
16987
  showUndatedEvents
17035
16988
  }) {
17036
- const days = useMemo25(() => {
16989
+ const days = useMemo26(() => {
17037
16990
  const monthStart = startOfMonth2(currentDate);
17038
16991
  const monthEnd = endOfMonth2(monthStart);
17039
16992
  const calendarStart = startOfWeek7(monthStart, { weekStartsOn: 0 });
17040
16993
  const calendarEnd = endOfWeek7(monthEnd, { weekStartsOn: 0 });
17041
16994
  return eachDayOfInterval3({ end: calendarEnd, start: calendarStart });
17042
16995
  }, [currentDate]);
17043
- const weekdays = useMemo25(() => {
16996
+ const weekdays = useMemo26(() => {
17044
16997
  return Array.from({ length: 7 }).map((_, i) => {
17045
16998
  const date = addDays6(startOfWeek7(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
17046
16999
  const short = format15(date, "EEE", { locale: ptBR13 });
17047
17000
  return short.charAt(0).toUpperCase() + short.slice(1);
17048
17001
  });
17049
17002
  }, []);
17050
- const weeks = useMemo25(() => {
17003
+ const weeks = useMemo26(() => {
17051
17004
  const result = [];
17052
17005
  let week = [];
17053
17006
  for (let i = 0; i < days.length; i++) {
@@ -17061,9 +17014,9 @@ function MonthViewAgenda({
17061
17014
  }, [days]);
17062
17015
  const handleEventClick = (event, e) => {
17063
17016
  e.stopPropagation();
17064
- onEventSelect(event);
17017
+ onEventSelect(event, e);
17065
17018
  };
17066
- const [isMounted, setIsMounted] = useState35(false);
17019
+ const [isMounted, setIsMounted] = useState36(false);
17067
17020
  const { contentRef, getVisibleEventCount } = useEventVisibilityAgenda({
17068
17021
  eventGap: EventGapAgenda,
17069
17022
  eventHeight: EventHeightAgenda
@@ -17072,11 +17025,14 @@ function MonthViewAgenda({
17072
17025
  setIsMounted(true);
17073
17026
  }, []);
17074
17027
  return /* @__PURE__ */ jsxs72("div", { className: "contents", "data-slot": "month-view", children: [
17075
- /* @__PURE__ */ jsx93("div", { className: "grid grid-cols-7 border-border/70 border-b", children: weekdays.map((day) => /* @__PURE__ */ jsx93(
17028
+ /* @__PURE__ */ jsx93("div", { className: "grid grid-cols-7 border-border/70 border-b", children: weekdays.map((day) => /* @__PURE__ */ jsxs72(
17076
17029
  "div",
17077
17030
  {
17078
- className: "py-2 text-center text-muted-foreground/70 text-sm uppercase tracking-wide bg-muted/5",
17079
- children: day
17031
+ className: "py-1 px-1 text-center text-muted-foreground/70 text-xs uppercase sm:tracking-wide bg-muted/5 leading-none",
17032
+ children: [
17033
+ /* @__PURE__ */ jsx93("span", { className: "hidden sm:inline", children: day }),
17034
+ /* @__PURE__ */ jsx93("span", { className: "inline sm:hidden", children: day.charAt(0) })
17035
+ ]
17080
17036
  },
17081
17037
  day
17082
17038
  )) }),
@@ -17086,8 +17042,20 @@ function MonthViewAgenda({
17086
17042
  className: "grid grid-cols-7 [&:last-child>*]:border-b-0",
17087
17043
  children: week.map((day, dayIndex) => {
17088
17044
  if (!day) return null;
17089
- const dayEvents = getEventsForDayAgenda(events, day);
17090
- const spanningEvents = getSpanningEventsForDayAgenda(events, day);
17045
+ const eventsWithStart = events.filter((ev) => {
17046
+ try {
17047
+ if (ev.start == null) return false;
17048
+ const t = ev.start instanceof Date ? ev.start.getTime() : new Date(String(ev.start)).getTime();
17049
+ return !isNaN(t);
17050
+ } catch {
17051
+ return false;
17052
+ }
17053
+ });
17054
+ const dayEvents = getEventsForDayAgenda(eventsWithStart, day);
17055
+ const spanningEvents = getSpanningEventsForDayAgenda(
17056
+ eventsWithStart,
17057
+ day
17058
+ );
17091
17059
  const isCurrentMonth = isSameMonth4(day, currentDate);
17092
17060
  const cellId = `month-cell-${day.toISOString()}`;
17093
17061
  const allDayEvents = [...spanningEvents, ...dayEvents];
@@ -17099,7 +17067,7 @@ function MonthViewAgenda({
17099
17067
  return /* @__PURE__ */ jsx93(
17100
17068
  "div",
17101
17069
  {
17102
- className: "group border-border/70 border-r border-b last:border-r-0 data-outside-cell:bg-muted/25 data-outside-cell:text-muted-foreground/70 hover:bg-muted/5 transition-colors p-2 ",
17070
+ className: "group border-border/70 border-r border-b last:border-r-0 data-outside-cell:bg-muted/25 data-outside-cell:text-muted-foreground/70 hover:bg-muted/5 transition-colors p-1 sm:p-2",
17103
17071
  "data-outside-cell": !isCurrentMonth || void 0,
17104
17072
  "data-today": isToday5(day) || void 0,
17105
17073
  children: /* @__PURE__ */ jsxs72(
@@ -17116,7 +17084,7 @@ function MonthViewAgenda({
17116
17084
  "div",
17117
17085
  {
17118
17086
  className: twMerge3(
17119
- `mt-1 inline-flex w-7 h-7 items-center justify-center rounded-full text-sm font-semibold text-muted-foreground`,
17087
+ `mt-1 inline-flex w-6 h-6 sm:w-7 sm:h-7 items-center justify-center rounded-full text-xs sm:text-sm font-semibold text-muted-foreground`,
17120
17088
  isToday5(day) ? "bg-blue-500 text-white" : ""
17121
17089
  ),
17122
17090
  children: format15(day, "d")
@@ -17125,16 +17093,12 @@ function MonthViewAgenda({
17125
17093
  /* @__PURE__ */ jsxs72(
17126
17094
  "div",
17127
17095
  {
17128
- className: "min-h-[calc((var(--event-height)+var(--event-gap))*2)] sm:min-h-[calc((var(--event-height)+var(--event-gap))*3)] lg:min-h-[calc((var(--event-height)+var(--event-gap))*4)] px-1 py-1",
17096
+ className: "min-h-[calc((var(--event-height)+var(--event-gap))*2)] sm:min-h-[calc((var(--event-height)+var(--event-gap))*3)] lg:min-h-[calc((var(--event-height)+var(--event-gap))*4)] px-1 py-0.5 sm:py-1",
17129
17097
  ref: isReferenceCell ? contentRef : null,
17130
17098
  children: [
17131
17099
  sortEventsAgenda(allDayEvents).map((event, index) => {
17132
- const eventStart = new Date(
17133
- event.start ?? event.attend_date ?? event.end ?? Date.now()
17134
- );
17135
- const eventEnd = new Date(
17136
- event.end ?? event.attend_date ?? event.start ?? Date.now()
17137
- );
17100
+ const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
17101
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
17138
17102
  const isFirstDay = isSameDay10(day, eventStart);
17139
17103
  const isLastDay = isSameDay10(day, eventEnd);
17140
17104
  const isHidden = isMounted && visibleCount && index >= visibleCount;
@@ -17153,12 +17117,9 @@ function MonthViewAgenda({
17153
17117
  isLastDay,
17154
17118
  onClick: (e) => handleEventClick(event, e),
17155
17119
  view: "month",
17156
- children: /* @__PURE__ */ jsxs72("div", { "aria-hidden": true, className: "invisible", children: [
17157
- !event.allDay && /* @__PURE__ */ jsxs72("span", { children: [
17158
- format15(eventStart, "HH:mm"),
17159
- " "
17160
- ] }),
17161
- event.title
17120
+ children: /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-1 truncate text-[12px] text-foreground", children: [
17121
+ /* @__PURE__ */ jsx93("span", { className: "text-[11px] opacity-80", children: "\u2192" }),
17122
+ /* @__PURE__ */ jsx93("span", { className: "truncate font-medium", children: event.title })
17162
17123
  ] })
17163
17124
  }
17164
17125
  )
@@ -17174,15 +17135,14 @@ function MonthViewAgenda({
17174
17135
  children: /* @__PURE__ */ jsx93(
17175
17136
  EventItemAgenda,
17176
17137
  {
17177
- className: "cursor-default",
17178
17138
  event,
17179
17139
  isFirstDay,
17180
17140
  isLastDay,
17181
17141
  onClick: (e) => handleEventClick(event, e),
17182
17142
  view: "month",
17183
- children: /* @__PURE__ */ jsxs72("span", { className: "flex items-center gap-2 truncate", children: [
17184
- !event.allDay && /* @__PURE__ */ jsx93("span", { className: "truncate font-normal opacity-80 sm:text-[11px] bg-white/10 px-2 py-0.5 rounded-full text-[11px]", children: format15(eventStart, "HH:mm") }),
17185
- /* @__PURE__ */ jsx93("span", { className: "truncate font-medium", children: event.title })
17143
+ children: /* @__PURE__ */ jsxs72("span", { className: "flex items-center gap-1 sm:gap-2 truncate text-[12px] text-foreground", children: [
17144
+ !event.allDay && /* @__PURE__ */ jsx93("span", { className: "truncate font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format15(eventStart, "HH:mm") }),
17145
+ /* @__PURE__ */ jsx93("span", { className: "truncate font-medium text-xs sm:text-sm", children: event.title })
17186
17146
  ] })
17187
17147
  }
17188
17148
  )
@@ -17222,12 +17182,8 @@ function MonthViewAgenda({
17222
17182
  children: /* @__PURE__ */ jsxs72("div", { className: "space-y-2", children: [
17223
17183
  /* @__PURE__ */ jsx93("div", { className: "font-medium text-sm", children: format15(day, "EEE d", { locale: ptBR13 }) }),
17224
17184
  /* @__PURE__ */ jsx93("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
17225
- const eventStart = new Date(
17226
- event.start ?? event.end ?? Date.now()
17227
- );
17228
- const eventEnd = new Date(
17229
- event.end ?? event.start ?? Date.now()
17230
- );
17185
+ const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
17186
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
17231
17187
  const isFirstDay = isSameDay10(day, eventStart);
17232
17188
  const isLastDay = isSameDay10(day, eventEnd);
17233
17189
  return /* @__PURE__ */ jsx93(
@@ -17257,7 +17213,7 @@ function MonthViewAgenda({
17257
17213
  );
17258
17214
  })
17259
17215
  },
17260
- `week-${week}`
17216
+ `week-${weekIndex}`
17261
17217
  )) }),
17262
17218
  /* @__PURE__ */ jsx93(
17263
17219
  UndatedEvents,
@@ -17273,7 +17229,7 @@ function MonthViewAgenda({
17273
17229
 
17274
17230
  // src/components/event-calendar-view/WeekView.tsx
17275
17231
  import {
17276
- addHours as addHours6,
17232
+ addHours as addHours5,
17277
17233
  areIntervalsOverlapping as areIntervalsOverlapping4,
17278
17234
  differenceInMinutes as differenceInMinutes8,
17279
17235
  eachDayOfInterval as eachDayOfInterval4,
@@ -17288,15 +17244,14 @@ import {
17288
17244
  startOfDay as startOfDay4,
17289
17245
  startOfWeek as startOfWeek8
17290
17246
  } from "date-fns";
17291
- import { endOfDay as endOfDay2 } from "date-fns";
17292
17247
  import { ptBR as ptBR14 } from "date-fns/locale";
17293
- import { useMemo as useMemo26 } from "react";
17248
+ import { useMemo as useMemo27 } from "react";
17294
17249
 
17295
17250
  // src/components/event-calendar-view/DraggablaEvent.tsx
17296
17251
  import { useDraggable as useDraggable2 } from "@dnd-kit/core";
17297
17252
  import { CSS as CSS2 } from "@dnd-kit/utilities";
17298
17253
  import { differenceInDays as differenceInDays2 } from "date-fns";
17299
- import { useRef as useRef17, useState as useState36 } from "react";
17254
+ import { useRef as useRef17, useState as useState37 } from "react";
17300
17255
  import { jsx as jsx94 } from "react/jsx-runtime";
17301
17256
  function DraggableEvent2({
17302
17257
  event,
@@ -17308,13 +17263,14 @@ function DraggableEvent2({
17308
17263
  multiDayWidth,
17309
17264
  isFirstDay = true,
17310
17265
  isLastDay = true,
17311
- "aria-hidden": ariaHidden
17266
+ "aria-hidden": ariaHidden,
17267
+ draggable = true
17312
17268
  }) {
17313
17269
  const { activeId } = useCalendarDndAgenda();
17314
17270
  const elementRef = useRef17(null);
17315
- const [dragHandlePosition, setDragHandlePosition] = useState36(null);
17316
- const eventStart = new Date(event.start ?? Date.now());
17317
- const eventEnd = new Date(event.end ?? Date.now());
17271
+ const [dragHandlePosition, setDragHandlePosition] = useState37(null);
17272
+ const eventStart = getEventStartDate(event) ?? /* @__PURE__ */ new Date();
17273
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
17318
17274
  const isMultiDayEvent2 = isMultiDay || event.allDay || differenceInDays2(eventEnd, eventStart) >= 1;
17319
17275
  const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable2({
17320
17276
  data: {
@@ -17327,6 +17283,8 @@ function DraggableEvent2({
17327
17283
  multiDayWidth,
17328
17284
  view
17329
17285
  },
17286
+ // allow callers to disable dragging
17287
+ disabled: !draggable,
17330
17288
  id: `${event.id}-${view}`
17331
17289
  });
17332
17290
  const handleMouseDown = (e) => {
@@ -17404,87 +17362,78 @@ function WeekViewAgenda({
17404
17362
  currentDate,
17405
17363
  events,
17406
17364
  onEventSelect,
17407
- onEventCreate
17365
+ onEventCreate,
17366
+ showUndatedEvents
17408
17367
  }) {
17409
- const days = useMemo26(() => {
17368
+ const days = useMemo27(() => {
17410
17369
  const weekStart2 = startOfWeek8(currentDate, { weekStartsOn: 0 });
17411
17370
  const weekEnd = endOfWeek8(currentDate, { weekStartsOn: 0 });
17412
17371
  return eachDayOfInterval4({ end: weekEnd, start: weekStart2 });
17413
17372
  }, [currentDate]);
17414
- const weekStart = useMemo26(
17373
+ const weekStart = useMemo27(
17415
17374
  () => startOfWeek8(currentDate, { weekStartsOn: 0 }),
17416
17375
  [currentDate]
17417
17376
  );
17418
- const hours = useMemo26(() => {
17377
+ const hours = useMemo27(() => {
17419
17378
  const dayStart = startOfDay4(currentDate);
17420
17379
  return eachHourOfInterval4({
17421
- end: addHours6(dayStart, EndHour - 1),
17422
- start: addHours6(dayStart, StartHour)
17380
+ end: addHours5(dayStart, EndHour - 1),
17381
+ start: addHours5(dayStart, StartHour)
17423
17382
  });
17424
17383
  }, [currentDate]);
17425
- const allDayEvents = useMemo26(() => {
17384
+ const allDayEvents = useMemo27(() => {
17385
+ const isValidStart = (ev) => {
17386
+ try {
17387
+ if (ev.start == null) return false;
17388
+ const t = ev.start instanceof Date ? ev.start.getTime() : new Date(String(ev.start)).getTime();
17389
+ return !isNaN(t);
17390
+ } catch {
17391
+ return false;
17392
+ }
17393
+ };
17426
17394
  return events.filter((event) => {
17395
+ if (!isValidStart(event)) return false;
17427
17396
  return event.allDay || isMultiDayEventAgenda(event);
17428
17397
  }).filter((event) => {
17429
- const eventStart = event.start ? new Date(event.start) : void 0;
17430
- const eventEnd = event.end ? new Date(event.end) : void 0;
17398
+ const eventStart = getEventStartDate(event);
17399
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
17431
17400
  return days.some((day) => {
17432
17401
  if (eventStart && isSameDay11(day, eventStart)) return true;
17433
17402
  if (eventEnd && isSameDay11(day, eventEnd)) return true;
17434
- if (eventStart && eventEnd && day > eventStart && day < eventEnd) return true;
17403
+ if (eventStart && eventEnd && day > eventStart && day < eventEnd)
17404
+ return true;
17435
17405
  return false;
17436
17406
  });
17437
17407
  });
17438
17408
  }, [events, days]);
17439
- const processedDayEvents = useMemo26(() => {
17409
+ const processedDayEvents = useMemo27(() => {
17440
17410
  const result = days.map((day) => {
17441
- const dayEventsWithIntervals = events.filter((event) => !event.allDay && !isMultiDayEventAgenda(event)).map((event) => {
17442
- let eventStart = event.start != null ? new Date(event.start) : void 0;
17443
- let eventEnd = event.end != null ? new Date(event.end) : void 0;
17444
- if ((!eventStart || !eventEnd) && event.attend_date) {
17445
- try {
17446
- const ad = new Date(event.attend_date);
17447
- const hasTime = ad.getHours() !== 0 || ad.getMinutes() !== 0 || ad.getSeconds() !== 0 || ad.getMilliseconds() !== 0;
17448
- if (hasTime) {
17449
- if (!eventStart) eventStart = ad;
17450
- if (!eventEnd) eventEnd = addHours6(ad, 1);
17451
- }
17452
- } catch {
17453
- }
17454
- }
17455
- return { event, eventStart, eventEnd };
17456
- }).filter(({ eventStart, eventEnd }) => !!eventStart && !!eventEnd).filter(({ eventStart, eventEnd }) => {
17457
- const dayStart2 = startOfDay4(day);
17458
- const dayEnd = endOfDay2(day);
17459
- return areIntervalsOverlapping4(
17460
- { start: eventStart, end: eventEnd },
17461
- { start: dayStart2, end: dayEnd }
17462
- );
17411
+ const dayEvents = events.filter((event) => {
17412
+ if (event.allDay || isMultiDayEventAgenda(event)) return false;
17413
+ if (event.start == null) return false;
17414
+ const eventStart = getEventStartDate(event);
17415
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
17416
+ return (eventStart ? isSameDay11(day, eventStart) : false) || (eventEnd ? isSameDay11(day, eventEnd) : false) || (eventStart && eventEnd ? eventStart < day && eventEnd > day : false);
17463
17417
  });
17464
- const sortedEvents = [...dayEventsWithIntervals].sort((a, b) => {
17465
- const aStart = a.eventStart.getTime();
17466
- const bStart = b.eventStart.getTime();
17418
+ const sortedEvents = [...dayEvents].sort((a, b) => {
17419
+ const aStart = getEventStartDate(a) ?? getEventEndDate(a) ?? /* @__PURE__ */ new Date();
17420
+ const bStart = getEventStartDate(b) ?? getEventEndDate(b) ?? /* @__PURE__ */ new Date();
17421
+ const aEnd = getEventEndDate(a) ?? getEventStartDate(a) ?? /* @__PURE__ */ new Date();
17422
+ const bEnd = getEventEndDate(b) ?? getEventStartDate(b) ?? /* @__PURE__ */ new Date();
17467
17423
  if (aStart < bStart) return -1;
17468
17424
  if (aStart > bStart) return 1;
17469
- const aDuration = differenceInMinutes8(
17470
- a.eventEnd,
17471
- a.eventStart
17472
- );
17473
- const bDuration = differenceInMinutes8(
17474
- b.eventEnd,
17475
- b.eventStart
17476
- );
17425
+ const aDuration = differenceInMinutes8(aEnd, aStart);
17426
+ const bDuration = differenceInMinutes8(bEnd, bStart);
17477
17427
  return bDuration - aDuration;
17478
17428
  });
17479
17429
  const positionedEvents = [];
17480
17430
  const dayStart = startOfDay4(day);
17481
17431
  const columns = [];
17482
- for (const item of sortedEvents) {
17483
- const event = item.event;
17484
- const eventStart = item.eventStart;
17485
- const eventEnd = item.eventEnd;
17432
+ for (const event of sortedEvents) {
17433
+ const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
17434
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
17486
17435
  const adjustedStart = isSameDay11(day, eventStart) ? eventStart : dayStart;
17487
- const adjustedEnd = isSameDay11(day, eventEnd) ? eventEnd : addHours6(dayStart, 24);
17436
+ const adjustedEnd = isSameDay11(day, eventEnd) ? eventEnd : addHours5(dayStart, 24);
17488
17437
  const startHour = getHours4(adjustedStart) + getMinutes4(adjustedStart) / 60;
17489
17438
  const endHour = getHours4(adjustedEnd) + getMinutes4(adjustedEnd) / 60;
17490
17439
  const top = (startHour - StartHour) * WeekCellsHeightAgenda;
@@ -17497,12 +17446,14 @@ function WeekViewAgenda({
17497
17446
  columns[columnIndex] = col;
17498
17447
  placed = true;
17499
17448
  } else {
17500
- const overlaps = col.some(
17501
- (c) => areIntervalsOverlapping4(
17449
+ const overlaps = col.some((c) => {
17450
+ const cStart = getEventStartDate(c.event) ?? getEventEndDate(c.event) ?? /* @__PURE__ */ new Date();
17451
+ const cEnd = getEventEndDate(c.event) ?? getEventStartDate(c.event) ?? /* @__PURE__ */ new Date();
17452
+ return areIntervalsOverlapping4(
17502
17453
  { end: adjustedEnd, start: adjustedStart },
17503
- { end: c.end, start: c.start }
17504
- )
17505
- );
17454
+ { end: cEnd, start: cStart }
17455
+ );
17456
+ });
17506
17457
  if (!overlaps) {
17507
17458
  placed = true;
17508
17459
  } else {
@@ -17512,9 +17463,9 @@ function WeekViewAgenda({
17512
17463
  }
17513
17464
  const currentColumn = columns[columnIndex] || [];
17514
17465
  columns[columnIndex] = currentColumn;
17515
- currentColumn.push({ start: adjustedStart, end: adjustedEnd, event });
17516
- const width = columnIndex === 0 ? 1 : 0.7;
17517
- const left = columnIndex === 0 ? 0 : columnIndex * 0.3;
17466
+ currentColumn.push({ end: adjustedEnd, event });
17467
+ const width = columnIndex === 0 ? 1 : 0.9;
17468
+ const left = columnIndex === 0 ? 0 : columnIndex * 0.1;
17518
17469
  positionedEvents.push({
17519
17470
  event,
17520
17471
  height,
@@ -17530,13 +17481,10 @@ function WeekViewAgenda({
17530
17481
  }, [days, events]);
17531
17482
  const handleEventClick = (event, e) => {
17532
17483
  e.stopPropagation();
17533
- onEventSelect(event);
17484
+ onEventSelect(event, e);
17534
17485
  };
17535
17486
  const showAllDaySection = allDayEvents.length > 0;
17536
- const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(
17537
- currentDate,
17538
- "week"
17539
- );
17487
+ const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(currentDate, "week");
17540
17488
  return /* @__PURE__ */ jsxs73("div", { className: "flex h-full flex-col", "data-slot": "week-view", children: [
17541
17489
  /* @__PURE__ */ jsxs73("div", { className: "sticky top-0 z-30 grid grid-cols-8 border-border/70 border-b bg-background", children: [
17542
17490
  /* @__PURE__ */ jsx95("div", { className: "py-2 text-center text-muted-foreground/70 text-sm", children: /* @__PURE__ */ jsx95("span", { className: "max-[479px]:sr-only", children: format16(/* @__PURE__ */ new Date(), "O") }) }),
@@ -17558,11 +17506,11 @@ function WeekViewAgenda({
17558
17506
  ))
17559
17507
  ] }),
17560
17508
  showAllDaySection && /* @__PURE__ */ jsx95("div", { className: "border-border/70 border-b bg-muted/50", children: /* @__PURE__ */ jsxs73("div", { className: "grid grid-cols-8", children: [
17561
- /* @__PURE__ */ jsx95("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx95("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "All day" }) }),
17509
+ /* @__PURE__ */ jsx95("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx95("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "Todo Dia" }) }),
17562
17510
  days.map((day, dayIndex) => {
17563
17511
  const dayAllDayEvents = allDayEvents.filter((event) => {
17564
- const eventStart = event.start ? new Date(event.start) : void 0;
17565
- const eventEnd = event.end ? new Date(event.end) : void 0;
17512
+ const eventStart = getEventStartDate(event);
17513
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
17566
17514
  if (!eventStart && !eventEnd) return false;
17567
17515
  return eventStart && isSameDay11(day, eventStart) || eventStart && eventEnd && day > eventStart && day < eventEnd || eventEnd && isSameDay11(day, eventEnd);
17568
17516
  });
@@ -17572,8 +17520,8 @@ function WeekViewAgenda({
17572
17520
  className: "relative border-border/70 border-r p-1 last:border-r-0",
17573
17521
  "data-today": isToday6(day) || void 0,
17574
17522
  children: dayAllDayEvents.map((event) => {
17575
- const eventStart = event.start ? new Date(event.start) : void 0;
17576
- const eventEnd = event.end ? new Date(event.end) : void 0;
17523
+ const eventStart = getEventStartDate(event);
17524
+ const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
17577
17525
  const isFirstDay = eventStart ? isSameDay11(day, eventStart) : false;
17578
17526
  const isLastDay = eventEnd ? isSameDay11(day, eventEnd) : false;
17579
17527
  const isFirstVisibleDay = eventStart ? dayIndex === 0 && isBefore3(eventStart, weekStart) : false;
@@ -17639,6 +17587,7 @@ function WeekViewAgenda({
17639
17587
  event: positionedEvent.event,
17640
17588
  height: positionedEvent.height,
17641
17589
  onClick: (e) => handleEventClick(positionedEvent.event, e),
17590
+ draggable: false,
17642
17591
  showTime: true,
17643
17592
  view: "week"
17644
17593
  }
@@ -17696,23 +17645,32 @@ function WeekViewAgenda({
17696
17645
  },
17697
17646
  day.toString()
17698
17647
  ))
17699
- ] })
17648
+ ] }),
17649
+ /* @__PURE__ */ jsx95(
17650
+ UndatedEvents,
17651
+ {
17652
+ events,
17653
+ onEventSelect,
17654
+ show: showUndatedEvents,
17655
+ className: "my-"
17656
+ }
17657
+ )
17700
17658
  ] });
17701
17659
  }
17702
17660
 
17703
17661
  // src/components/ui/data/Banner.tsx
17704
17662
  import { RocketIcon, XIcon as XIcon13 } from "@phosphor-icons/react";
17705
- import React45, { useState as useState37 } from "react";
17663
+ import React47, { useState as useState38 } from "react";
17706
17664
  import { jsx as jsx96, jsxs as jsxs74 } from "react/jsx-runtime";
17707
17665
 
17708
17666
  // src/hooks/use-drag.tsx
17709
- import { useState as useState38, useCallback as useCallback17, useRef as useRef18, useEffect as useEffect29 } from "react";
17667
+ import { useState as useState39, useCallback as useCallback16, useRef as useRef18, useEffect as useEffect29 } from "react";
17710
17668
  var useDrag = (options = {}) => {
17711
- const [isDragging, setIsDragging] = useState38(null);
17712
- const [positions, setPositions] = useState38({});
17669
+ const [isDragging, setIsDragging] = useState39(null);
17670
+ const [positions, setPositions] = useState39({});
17713
17671
  const dragStartPos = useRef18(null);
17714
17672
  const dragId = useRef18(null);
17715
- const handleMouseDown = useCallback17((id, e) => {
17673
+ const handleMouseDown = useCallback16((id, e) => {
17716
17674
  e.preventDefault();
17717
17675
  const currentPosition = positions[id] || { top: 0, left: 0 };
17718
17676
  dragStartPos.current = {
@@ -17725,7 +17683,7 @@ var useDrag = (options = {}) => {
17725
17683
  setIsDragging(id);
17726
17684
  options.onDragStart?.(id);
17727
17685
  }, [positions, options]);
17728
- const handleMouseMove = useCallback17((e) => {
17686
+ const handleMouseMove = useCallback16((e) => {
17729
17687
  if (!isDragging || !dragStartPos.current || !dragId.current) return;
17730
17688
  const deltaX = e.clientX - dragStartPos.current.x;
17731
17689
  const deltaY = e.clientY - dragStartPos.current.y;
@@ -17741,7 +17699,7 @@ var useDrag = (options = {}) => {
17741
17699
  }));
17742
17700
  options.onDrag?.(dragId.current, newPosition);
17743
17701
  }, [isDragging, options]);
17744
- const handleMouseUp = useCallback17(() => {
17702
+ const handleMouseUp = useCallback16(() => {
17745
17703
  if (dragId.current) {
17746
17704
  options.onDragEnd?.(dragId.current);
17747
17705
  }
@@ -17761,16 +17719,16 @@ var useDrag = (options = {}) => {
17761
17719
  };
17762
17720
  }
17763
17721
  }, [isDragging, handleMouseMove, handleMouseUp]);
17764
- const setPosition = useCallback17((id, position) => {
17722
+ const setPosition = useCallback16((id, position) => {
17765
17723
  setPositions((prev) => ({
17766
17724
  ...prev,
17767
17725
  [id]: position
17768
17726
  }));
17769
17727
  }, []);
17770
- const getPosition = useCallback17((id) => {
17728
+ const getPosition = useCallback16((id) => {
17771
17729
  return positions[id] || { top: 0, left: 0 };
17772
17730
  }, [positions]);
17773
- const isElementDragging = useCallback17((id) => {
17731
+ const isElementDragging = useCallback16((id) => {
17774
17732
  return isDragging === id;
17775
17733
  }, [isDragging]);
17776
17734
  return {
@@ -18083,6 +18041,7 @@ export {
18083
18041
  WeekViewAgenda,
18084
18042
  addHoursToDate,
18085
18043
  addHoursToDateAgenda,
18044
+ addMinutesToDateAgenda,
18086
18045
  badgeVariants,
18087
18046
  buttonVariantsBase,
18088
18047
  compactTick,
@@ -18102,6 +18061,8 @@ export {
18102
18061
  getDateByType,
18103
18062
  getEventColorClasses,
18104
18063
  getEventColorClassesAgenda,
18064
+ getEventEndDate,
18065
+ getEventStartDate,
18105
18066
  getEventsForDay,
18106
18067
  getEventsForDayAgenda,
18107
18068
  getSpanningEventsForDay,