@mlw-packages/react-components 1.10.1 → 1.10.2

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
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
  import * as React32 from 'react';
3
- import React32__default, { forwardRef, useState, useEffect, createContext, useMemo, useRef, useCallback, useContext, useId, useLayoutEffect } from 'react';
3
+ import React32__default, { forwardRef, useState, useEffect, createContext, useMemo, useRef, useCallback, useId, useContext, useLayoutEffect } from 'react';
4
4
  import { Slot } from '@radix-ui/react-slot';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import { clsx } from 'clsx';
@@ -35,7 +35,7 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
35
35
  import { Drawer } from 'vaul';
36
36
  import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
37
37
  import { Prism } from 'react-syntax-highlighter';
38
- import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday, isSameDay, differenceInCalendarDays, differenceInMinutes, isPast, startOfDay, eachHourOfInterval, addHours, getHours, getMinutes, areIntervalsOverlapping, startOfWeek, endOfWeek, isSameMonth, addDays, differenceInDays, isBefore, addMinutes, subMonths, subWeeks, addMonths, addWeeks, isWithinInterval, add, max, min } from 'date-fns';
38
+ import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday, isSameDay, differenceInCalendarDays, differenceInMinutes, isPast, startOfDay, eachHourOfInterval, addHours, getHours, getMinutes, areIntervalsOverlapping, startOfWeek, endOfWeek, isSameMonth, addDays, startOfYear, endOfYear, eachMonthOfInterval, differenceInDays, isBefore, addMinutes, subMonths, subWeeks, subYears, addMonths, addWeeks, addYears, isWithinInterval, add, max, min } from 'date-fns';
39
39
  import { ptBR } from 'date-fns/locale';
40
40
  import ptBR3 from 'date-fns/locale/pt-BR';
41
41
  import { useSensors, useSensor, MouseSensor, TouchSensor, PointerSensor, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
@@ -9698,7 +9698,7 @@ function DayViewAgenda({
9698
9698
  const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(currentDate, "day");
9699
9699
  return /* @__PURE__ */ jsxs("div", { className: "contents", "data-slot": "day-view", children: [
9700
9700
  showAllDaySection && /* @__PURE__ */ jsx("div", { className: "border-border/70 border-t bg-muted/50", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[3rem_1fr] sm:grid-cols-[4rem_1fr]", children: [
9701
- /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx("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" }) }),
9701
+ /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r flex items-center justify-center p-1", children: /* @__PURE__ */ jsx("span", { className: "text-center text-[10px] text-muted-foreground/70 sm:text-xs", children: "Todo Dia" }) }),
9702
9702
  /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r p-1 last:border-r-0", children: allDayEvents.map((event) => {
9703
9703
  const eventStart = getEventStartDate(event);
9704
9704
  const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
@@ -10086,7 +10086,8 @@ function EventAgenda({
10086
10086
  className,
10087
10087
  initialView = "month",
10088
10088
  initialDate,
10089
- onClick
10089
+ onClick,
10090
+ showYearView = false
10090
10091
  }) {
10091
10092
  const [currentDate, setCurrentDate] = useState(
10092
10093
  initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
@@ -10099,6 +10100,7 @@ function EventAgenda({
10099
10100
  else if (view === "day") setCurrentDate((d) => addDays(d, -1));
10100
10101
  else if (view === "agenda")
10101
10102
  setCurrentDate((d) => addDays(d, -AgendaDaysToShowAgenda));
10103
+ else if (view === "year") setCurrentDate((d) => subYears(d, 1));
10102
10104
  };
10103
10105
  const goNext = () => {
10104
10106
  if (view === "month") setCurrentDate((d) => addMonths(d, 1));
@@ -10106,6 +10108,7 @@ function EventAgenda({
10106
10108
  else if (view === "day") setCurrentDate((d) => addDays(d, 1));
10107
10109
  else if (view === "agenda")
10108
10110
  setCurrentDate((d) => addDays(d, AgendaDaysToShowAgenda));
10111
+ else if (view === "year") setCurrentDate((d) => addYears(d, 1));
10109
10112
  };
10110
10113
  const handleEventSelect = (event, e) => {
10111
10114
  try {
@@ -10143,7 +10146,8 @@ function EventAgenda({
10143
10146
  month: { full: "M\xEAs", short: "M" },
10144
10147
  week: { full: "Semana", short: "S" },
10145
10148
  day: { full: "Dia", short: "D" },
10146
- agenda: { full: "Agenda", short: "A" }
10149
+ agenda: { full: "Agenda", short: "A" },
10150
+ year: { full: "Ano", short: "An" }
10147
10151
  };
10148
10152
  const entry = labels[v] || { full: v, short: v };
10149
10153
  return condensed ? entry.short : entry.full;
@@ -10167,12 +10171,18 @@ function EventAgenda({
10167
10171
  const start = currentDate;
10168
10172
  return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
10169
10173
  }
10174
+ if (view === "year") {
10175
+ return format(currentDate, "yyyy");
10176
+ }
10170
10177
  return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
10171
10178
  }, [currentDate, view]);
10172
- const selectItems = ["month", "week", "day", "agenda"].map((v) => ({
10173
- label: viewLabel(v),
10174
- value: v
10175
- }));
10179
+ const availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
10180
+ const selectItems = availableViews.map(
10181
+ (v) => ({
10182
+ label: viewLabel(v),
10183
+ value: v
10184
+ })
10185
+ );
10176
10186
  return /* @__PURE__ */ jsxs(
10177
10187
  "div",
10178
10188
  {
@@ -10227,46 +10237,51 @@ function EventAgenda({
10227
10237
  }
10228
10238
  ) })
10229
10239
  ] }),
10230
- /* @__PURE__ */ jsxs(
10231
- "div",
10232
- {
10233
- className: "flex flex-col transition-all duration-200 ease-in-out",
10234
- children: [
10235
- view === "month" && /* @__PURE__ */ jsx(
10236
- MonthViewAgenda,
10237
- {
10238
- currentDate,
10239
- events,
10240
- onEventSelect: handleEventSelect
10241
- }
10242
- ),
10243
- view === "week" && /* @__PURE__ */ jsx(
10244
- WeekViewAgenda,
10245
- {
10246
- currentDate,
10247
- events,
10248
- onEventSelect: handleEventSelect
10249
- }
10250
- ),
10251
- view === "day" && /* @__PURE__ */ jsx(
10252
- DayViewAgenda,
10253
- {
10254
- currentDate,
10255
- events,
10256
- onEventSelect: handleEventSelect
10257
- }
10258
- ),
10259
- view === "agenda" && /* @__PURE__ */ jsx(
10260
- Agenda,
10261
- {
10262
- currentDate,
10263
- events,
10264
- onEventSelect: handleEventSelect
10265
- }
10266
- )
10267
- ]
10268
- }
10269
- )
10240
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col transition-all duration-200 ease-in-out", children: [
10241
+ view === "month" && /* @__PURE__ */ jsx(
10242
+ MonthViewAgenda,
10243
+ {
10244
+ currentDate,
10245
+ events,
10246
+ onEventSelect: handleEventSelect
10247
+ }
10248
+ ),
10249
+ view === "week" && /* @__PURE__ */ jsx(
10250
+ WeekViewAgenda,
10251
+ {
10252
+ currentDate,
10253
+ events,
10254
+ onEventSelect: handleEventSelect
10255
+ }
10256
+ ),
10257
+ view === "day" && /* @__PURE__ */ jsx(
10258
+ DayViewAgenda,
10259
+ {
10260
+ currentDate,
10261
+ events,
10262
+ onEventSelect: handleEventSelect
10263
+ }
10264
+ ),
10265
+ view === "agenda" && /* @__PURE__ */ jsx(
10266
+ Agenda,
10267
+ {
10268
+ currentDate,
10269
+ events,
10270
+ onEventSelect: handleEventSelect
10271
+ }
10272
+ ),
10273
+ view === "year" && /* @__PURE__ */ jsx(
10274
+ YearViewAgenda,
10275
+ {
10276
+ currentDate,
10277
+ events,
10278
+ onMonthSelect: (monthDate) => {
10279
+ setCurrentDate(monthDate);
10280
+ setView("month");
10281
+ }
10282
+ }
10283
+ )
10284
+ ] })
10270
10285
  ] }),
10271
10286
  selectedEvent && React32__default.isValidElement(onClick) ? React32__default.cloneElement(onClick, {
10272
10287
  event: selectedEvent,
@@ -10341,11 +10356,13 @@ function useEventVisibilityAgenda({
10341
10356
  const getVisibleEventCount = useMemo(() => {
10342
10357
  return (totalEvents) => {
10343
10358
  if (!contentHeight) return totalEvents;
10344
- const maxEvents = Math.floor(contentHeight / (eventHeight + eventGap));
10345
- if (totalEvents <= maxEvents) {
10359
+ const availableHeight = contentHeight + eventGap + 4;
10360
+ const slotHeight = eventHeight + eventGap;
10361
+ const maxSlots = Math.floor(availableHeight / slotHeight);
10362
+ if (totalEvents <= maxSlots) {
10346
10363
  return totalEvents;
10347
10364
  }
10348
- return maxEvents > 0 ? maxEvents - 1 : 0;
10365
+ return maxSlots > 0 ? maxSlots - 1 : 0;
10349
10366
  };
10350
10367
  }, [contentHeight, eventHeight, eventGap]);
10351
10368
  return {
@@ -10662,7 +10679,7 @@ function MonthViewAgenda({
10662
10679
  "div",
10663
10680
  {
10664
10681
  ref: isReferenceCell ? contentRef : null,
10665
- 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",
10682
+ className: "flex-1 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",
10666
10683
  children: [
10667
10684
  Array.from({ length: dayMultiDayRowCount }).map(
10668
10685
  (_, si) => /* @__PURE__ */ jsx(
@@ -10723,7 +10740,7 @@ function MonthViewAgenda({
10723
10740
  type: "button",
10724
10741
  onClick: (e) => e.stopPropagation(),
10725
10742
  "aria-label": `Mostrar mais ${remainingCount} eventos`,
10726
- className: "mt-[var(--event-gap)] flex h-[var(--event-height)] w-full select-none items-center overflow-hidden px-2 text-left text-[10px] text-muted-foreground outline-none rounded-md transition hover:bg-muted/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-xs",
10743
+ className: "mt-auto flex h-[var(--event-height)] w-full select-none items-center overflow-hidden px-2 text-left text-[10px] text-muted-foreground outline-none rounded-md transition hover:bg-muted/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-xs",
10727
10744
  children: /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
10728
10745
  "+ ",
10729
10746
  remainingCount,
@@ -11066,7 +11083,7 @@ function WeekViewAgenda({
11066
11083
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", "data-slot": "week-view", children: [
11067
11084
  /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "min-w-[600px] sm:min-w-full flex flex-col h-full", children: [
11068
11085
  /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-30 grid grid-cols-8 border-border/70 border-b bg-background", children: [
11069
- /* @__PURE__ */ jsx("div", { className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm", children: /* @__PURE__ */ jsx("span", { className: "max-[479px]:sr-only", children: format(/* @__PURE__ */ new Date(), "O") }) }),
11086
+ /* @__PURE__ */ jsx("div", { className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm", children: /* @__PURE__ */ jsx("span", { className: "", children: "Hor\xE1rios" }) }),
11070
11087
  days.map((day) => /* @__PURE__ */ jsxs(
11071
11088
  "div",
11072
11089
  {
@@ -11079,7 +11096,7 @@ function WeekViewAgenda({
11079
11096
  format(day, "d", { locale: ptBR })
11080
11097
  ] }),
11081
11098
  /* @__PURE__ */ jsx("span", { className: "hidden sm:inline md:hidden", children: format(day, "EEE d", { locale: ptBR }) }),
11082
- /* @__PURE__ */ jsx("span", { className: "max-md:hidden", children: format(day, "EEE dd", { locale: ptBR }) })
11099
+ /* @__PURE__ */ jsx("span", { className: "hidden md:inline", children: format(day, "EEE dd", { locale: ptBR }) })
11083
11100
  ]
11084
11101
  },
11085
11102
  day.toString()
@@ -11087,7 +11104,7 @@ function WeekViewAgenda({
11087
11104
  ] }),
11088
11105
  showAllDaySection && /* @__PURE__ */ jsxs("div", { className: "border-border/70 border-b bg-muted/50", children: [
11089
11106
  trueAllDayEvents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-8", children: [
11090
- /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("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" }) }),
11107
+ /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r flex items-center justify-center p-1", children: /* @__PURE__ */ jsx("span", { className: "text-center text-[10px] text-muted-foreground/70 sm:text-xs", children: "Todo dia" }) }),
11091
11108
  /* @__PURE__ */ jsxs(
11092
11109
  "div",
11093
11110
  {
@@ -11167,7 +11184,7 @@ function WeekViewAgenda({
11167
11184
  trueAllDayEvents.length > 0 && "border-t border-border/40"
11168
11185
  ),
11169
11186
  children: [
11170
- /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full px-1 text-muted-foreground/70 sm:text-xs", children: "Evento" }) }),
11187
+ /* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r flex items-center justify-center p-1", children: /* @__PURE__ */ jsx("span", { className: "text-center text-[10px] text-muted-foreground/70 sm:text-xs", children: "Evento" }) }),
11171
11188
  /* @__PURE__ */ jsxs(
11172
11189
  "div",
11173
11190
  {
@@ -11386,6 +11403,86 @@ function WeekViewAgenda({
11386
11403
  )
11387
11404
  ] });
11388
11405
  }
11406
+ function YearViewAgenda({
11407
+ currentDate,
11408
+ events,
11409
+ onMonthSelect
11410
+ }) {
11411
+ const start = startOfYear(currentDate);
11412
+ const end = endOfYear(currentDate);
11413
+ const months = useMemo(() => {
11414
+ return eachMonthOfInterval({ start, end });
11415
+ }, [start, end]);
11416
+ const eventDates = useMemo(() => {
11417
+ return new Set(
11418
+ events.map((e) => getEventStartDate(e)).filter((d) => !!d).map((d) => format(d, "yyyy-MM-dd"))
11419
+ );
11420
+ }, [events]);
11421
+ return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-1 overflow-y-auto max-h-[calc(100vh-200px)] lg:max-h-[750px] scrollbar-thin scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent", children: months.map((month) => /* @__PURE__ */ jsxs(
11422
+ "div",
11423
+ {
11424
+ className: "flex flex-col p-4 rounded-lg border border-border/70 bg-card hover:bg-muted/5 transition-colors cursor-pointer group",
11425
+ onClick: () => onMonthSelect(month),
11426
+ children: [
11427
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
11428
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm capitalize text-foreground group-hover:text-primary transition-colors", children: format(month, "MMMM", { locale: ptBR }) }),
11429
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground/50 uppercase tracking-wider opacity-0 group-hover:opacity-100 transition-opacity", children: "Detalhes" })
11430
+ ] }),
11431
+ /* @__PURE__ */ jsx(MonthMiniGrid, { month, eventDates })
11432
+ ]
11433
+ },
11434
+ month.toString()
11435
+ )) });
11436
+ }
11437
+ function MonthMiniGrid({
11438
+ month,
11439
+ eventDates
11440
+ }) {
11441
+ const days = useMemo(() => {
11442
+ const monthStart = startOfMonth(month);
11443
+ const calendarStart = startOfWeek(monthStart, { weekStartsOn: 0 });
11444
+ const daysArr = [];
11445
+ const curr = new Date(calendarStart);
11446
+ for (let i = 0; i < 42; i++) {
11447
+ daysArr.push(new Date(curr));
11448
+ curr.setDate(curr.getDate() + 1);
11449
+ }
11450
+ return daysArr;
11451
+ }, [month]);
11452
+ const weekdays = ["D", "S", "T", "Q", "Q", "S", "S"];
11453
+ return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 gap-y-1 text-[11px]", children: [
11454
+ weekdays.map((wd, i) => /* @__PURE__ */ jsx(
11455
+ "div",
11456
+ {
11457
+ className: "text-center font-medium text-muted-foreground/70 py-1",
11458
+ children: wd
11459
+ },
11460
+ `${wd}-${i}`
11461
+ )),
11462
+ days.map((day) => {
11463
+ const isCurrentMonth = day.getMonth() === month.getMonth();
11464
+ const dateStr = format(day, "yyyy-MM-dd");
11465
+ const hasEvent = eventDates.has(dateStr);
11466
+ const isDayToday = isToday(day);
11467
+ return /* @__PURE__ */ jsxs(
11468
+ "div",
11469
+ {
11470
+ className: cn(
11471
+ "relative flex items-center justify-center p-1 rounded-sm aspect-square transition-colors",
11472
+ !isCurrentMonth && "opacity-0 pointer-events-none",
11473
+ isDayToday && "bg-blue-500 text-white font-semibold rounded-lg",
11474
+ isCurrentMonth && !isDayToday && "hover:bg-muted/50 text-foreground"
11475
+ ),
11476
+ children: [
11477
+ isCurrentMonth && format(day, "d"),
11478
+ isCurrentMonth && hasEvent && !isDayToday && /* @__PURE__ */ jsx("div", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-blue-500" })
11479
+ ]
11480
+ },
11481
+ day.toString()
11482
+ );
11483
+ })
11484
+ ] });
11485
+ }
11389
11486
  var colorBannerMap = {
11390
11487
  sky: "from-sky-400 via-sky-500 to-cyan-500",
11391
11488
  amber: "from-amber-400 via-amber-500 to-orange-400",
@@ -14759,8 +14856,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
14759
14856
  });
14760
14857
  const prefixFormats = ["R$", "$", "\u20AC", "\xA3"];
14761
14858
  const suffixFormats = ["%", "kg", "km", "m", "L", "un", "t", "h", "min", "s"];
14762
- const getFormattedValue = (baseValue, format20) => {
14763
- const trimmedFormat = format20.trim();
14859
+ const getFormattedValue = (baseValue, format21) => {
14860
+ const trimmedFormat = format21.trim();
14764
14861
  if (prefixFormats.includes(trimmedFormat)) {
14765
14862
  return `${trimmedFormat} ${baseValue}`;
14766
14863
  }
@@ -14785,8 +14882,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
14785
14882
  num = Number.isNaN(parsed) ? NaN : parsed;
14786
14883
  }
14787
14884
  const baseFormatted = formatBR && !Number.isNaN(num) ? nf.format(num) : String(formattedValue ?? value ?? "");
14788
- const format20 = propsDataKey && formatterMap[propsDataKey] ? formatterMap[propsDataKey] : "";
14789
- return format20 ? getFormattedValue(baseFormatted, format20) : baseFormatted;
14885
+ const format21 = propsDataKey && formatterMap[propsDataKey] ? formatterMap[propsDataKey] : "";
14886
+ return format21 ? getFormattedValue(baseFormatted, format21) : baseFormatted;
14790
14887
  };
14791
14888
  }
14792
14889
  if (typeof customFormatter === "function") {
@@ -16438,8 +16535,578 @@ var SystemTooltip = ({
16438
16535
  ) });
16439
16536
  };
16440
16537
  var SystemTooltip_default = SystemTooltip;
16538
+ var useIsTruncated = (ref) => {
16539
+ const [truncated, setTruncated] = useState(false);
16540
+ useEffect(() => {
16541
+ const el = ref.current;
16542
+ if (!el) return;
16543
+ const check = () => setTruncated(el.scrollWidth > el.offsetWidth);
16544
+ check();
16545
+ const ro = new ResizeObserver(check);
16546
+ ro.observe(el);
16547
+ return () => ro.disconnect();
16548
+ }, [ref]);
16549
+ return truncated;
16550
+ };
16551
+ var NameTooltip = ({
16552
+ name,
16553
+ description
16554
+ }) => {
16555
+ const nameRef = useRef(null);
16556
+ const descRef = useRef(null);
16557
+ const isNameTruncated = useIsTruncated(nameRef);
16558
+ const isDescTruncated = useIsTruncated(descRef);
16559
+ const showTooltip = isNameTruncated || isDescTruncated;
16560
+ return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16561
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "cursor-default", children: [
16562
+ /* @__PURE__ */ jsx(
16563
+ "h3",
16564
+ {
16565
+ ref: nameRef,
16566
+ className: "text-xl font-bold text-foreground tracking-tight truncate",
16567
+ children: name
16568
+ }
16569
+ ),
16570
+ description && /* @__PURE__ */ jsx(
16571
+ "p",
16572
+ {
16573
+ ref: descRef,
16574
+ className: "text-xs text-foreground/70 truncate mt-0.5",
16575
+ children: description
16576
+ }
16577
+ )
16578
+ ] }) }),
16579
+ showTooltip && /* @__PURE__ */ jsxs(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: [
16580
+ /* @__PURE__ */ jsx("p", { className: "font-semibold", children: name }),
16581
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-foreground/70 mt-0.5", children: description })
16582
+ ] })
16583
+ ] }) });
16584
+ };
16585
+ var SystemNode = ({ label }) => {
16586
+ const truncated = label.length > 9 ? label.substring(0, 9) + "\u2026" : label;
16587
+ const needsTooltip = label.length > 9;
16588
+ const circle = /* @__PURE__ */ jsx("div", { className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default", children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated }) });
16589
+ if (!needsTooltip) return circle;
16590
+ return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16591
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: circle }),
16592
+ /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: label })
16593
+ ] }) });
16594
+ };
16595
+ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
16596
+ const gradientId = useId();
16597
+ const [pathD, setPathD] = useState("");
16598
+ const [svgSize, setSvgSize] = useState({ w: 0, h: 0 });
16599
+ useEffect(() => {
16600
+ let rafId;
16601
+ const update = () => {
16602
+ const container = containerRef.current;
16603
+ const left = leftRef.current;
16604
+ const right = rightRef.current;
16605
+ if (!container || !left || !right) return;
16606
+ const cr = container.getBoundingClientRect();
16607
+ const lr = left.getBoundingClientRect();
16608
+ const rr = right.getBoundingClientRect();
16609
+ const cx1 = lr.left - cr.left + lr.width / 2;
16610
+ const cy1 = lr.top - cr.top + lr.height / 2;
16611
+ const cx2 = rr.left - cr.left + rr.width / 2;
16612
+ const cy2 = rr.top - cr.top + rr.height / 2;
16613
+ const dx = cx2 - cx1, dy = cy2 - cy1;
16614
+ const dist = Math.sqrt(dx * dx + dy * dy);
16615
+ if (dist === 0) return;
16616
+ const ux = dx / dist, uy = dy / dist;
16617
+ const r1 = lr.width / 2;
16618
+ const r2 = rr.width / 2;
16619
+ setSvgSize({ w: cr.width, h: cr.height });
16620
+ setPathD(
16621
+ `M ${cx1 + ux * r1},${cy1 + uy * r1} L ${cx2 - ux * r2},${cy2 - uy * r2}`
16622
+ );
16623
+ };
16624
+ const schedule = () => {
16625
+ cancelAnimationFrame(rafId);
16626
+ rafId = requestAnimationFrame(update);
16627
+ };
16628
+ requestAnimationFrame(() => requestAnimationFrame(update));
16629
+ schedule();
16630
+ const ro = new ResizeObserver(schedule);
16631
+ if (containerRef.current) ro.observe(containerRef.current);
16632
+ if (leftRef.current) ro.observe(leftRef.current);
16633
+ if (rightRef.current) ro.observe(rightRef.current);
16634
+ const mo = new MutationObserver(schedule);
16635
+ mo.observe(document.documentElement, {
16636
+ attributes: true,
16637
+ attributeFilter: ["class", "style"]
16638
+ });
16639
+ mo.observe(document.body, {
16640
+ attributes: true,
16641
+ attributeFilter: ["class", "style"]
16642
+ });
16643
+ return () => {
16644
+ cancelAnimationFrame(rafId);
16645
+ ro.disconnect();
16646
+ mo.disconnect();
16647
+ };
16648
+ }, [containerRef, leftRef, rightRef]);
16649
+ const animX1 = isInput ? ["90%", "-10%"] : ["10%", "110%"];
16650
+ const animX2 = isInput ? ["100%", "0%"] : ["0%", "100%"];
16651
+ if (!pathD) return null;
16652
+ return /* @__PURE__ */ jsxs(
16653
+ "svg",
16654
+ {
16655
+ className: "pointer-events-none absolute left-0 top-0",
16656
+ width: svgSize.w,
16657
+ height: svgSize.h,
16658
+ fill: "none",
16659
+ children: [
16660
+ /* @__PURE__ */ jsx(
16661
+ "path",
16662
+ {
16663
+ d: pathD,
16664
+ className: "stroke-primary",
16665
+ strokeWidth: 2,
16666
+ strokeOpacity: 0.2,
16667
+ strokeLinecap: "round"
16668
+ }
16669
+ ),
16670
+ /* @__PURE__ */ jsx(
16671
+ motion.path,
16672
+ {
16673
+ d: pathD,
16674
+ stroke: `url(#${gradientId})`,
16675
+ strokeWidth: 2,
16676
+ strokeLinecap: "round",
16677
+ initial: { strokeOpacity: 0 },
16678
+ animate: { strokeOpacity: 1 },
16679
+ transition: { duration: 1 }
16680
+ }
16681
+ ),
16682
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
16683
+ motion.linearGradient,
16684
+ {
16685
+ id: gradientId,
16686
+ gradientUnits: "userSpaceOnUse",
16687
+ initial: { x1: "0%", x2: "0%", y1: "0%", y2: "0%" },
16688
+ animate: {
16689
+ x1: animX1,
16690
+ x2: animX2,
16691
+ y1: ["0%", "0%"],
16692
+ y2: ["0%", "0%"]
16693
+ },
16694
+ transition: {
16695
+ duration: 4,
16696
+ ease: [0.16, 1, 0.3, 1],
16697
+ repeat: Infinity,
16698
+ repeatDelay: 0
16699
+ },
16700
+ children: [
16701
+ /* @__PURE__ */ jsx("stop", { stopColor: "hsl(var(--primary))", stopOpacity: "0" }),
16702
+ /* @__PURE__ */ jsx("stop", { stopColor: "hsl(var(--primary))" }),
16703
+ /* @__PURE__ */ jsx("stop", { offset: "32.5%", stopColor: "hsl(var(--primary))" }),
16704
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "hsl(var(--primary))", stopOpacity: "0" })
16705
+ ]
16706
+ }
16707
+ ) })
16708
+ ]
16709
+ }
16710
+ );
16711
+ };
16712
+ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
16713
+ const containerRef = useRef(null);
16714
+ const leftRef = useRef(null);
16715
+ const rightRef = useRef(null);
16716
+ return /* @__PURE__ */ jsxs(
16717
+ "div",
16718
+ {
16719
+ ref: containerRef,
16720
+ className: "relative flex items-center justify-between py-1 px-3",
16721
+ children: [
16722
+ /* @__PURE__ */ jsx("div", { ref: leftRef, children: /* @__PURE__ */ jsx(SystemNode, { label: isInput ? externalSystem : currentSystem }) }),
16723
+ /* @__PURE__ */ jsx("div", { ref: rightRef, children: /* @__PURE__ */ jsx(SystemNode, { label: isInput ? currentSystem : externalSystem }) }),
16724
+ /* @__PURE__ */ jsx(
16725
+ Beam,
16726
+ {
16727
+ isInput,
16728
+ containerRef,
16729
+ leftRef,
16730
+ rightRef
16731
+ }
16732
+ )
16733
+ ]
16734
+ }
16735
+ );
16736
+ };
16737
+ var CopyData = ({ value }) => {
16738
+ const [copied, setCopied] = useState(false);
16739
+ const handleCopy = useCallback(() => {
16740
+ navigator.clipboard.writeText(value).then(() => {
16741
+ setCopied(true);
16742
+ setTimeout(() => setCopied(false), 1500);
16743
+ });
16744
+ }, [value]);
16745
+ return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16746
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
16747
+ "button",
16748
+ {
16749
+ onClick: handleCopy,
16750
+ className: "shrink-0 p-0.5 rounded transition-colors text-muted-foreground/40 hover:text-foreground hover:bg-muted",
16751
+ style: { cursor: "pointer" },
16752
+ children: copied ? /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx(
16753
+ "path",
16754
+ {
16755
+ d: "M3 8l3.5 3.5L13 4.5",
16756
+ stroke: "currentColor",
16757
+ strokeWidth: "2",
16758
+ strokeLinecap: "round",
16759
+ strokeLinejoin: "round"
16760
+ }
16761
+ ) }) : /* @__PURE__ */ jsxs("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", children: [
16762
+ /* @__PURE__ */ jsx(
16763
+ "rect",
16764
+ {
16765
+ x: "5",
16766
+ y: "5",
16767
+ width: "8",
16768
+ height: "9",
16769
+ rx: "1.5",
16770
+ stroke: "currentColor",
16771
+ strokeWidth: "1.5"
16772
+ }
16773
+ ),
16774
+ /* @__PURE__ */ jsx(
16775
+ "path",
16776
+ {
16777
+ d: "M3 11V3.5A1.5 1.5 0 0 1 4.5 2H11",
16778
+ stroke: "currentColor",
16779
+ strokeWidth: "1.5",
16780
+ strokeLinecap: "round"
16781
+ }
16782
+ )
16783
+ ] })
16784
+ }
16785
+ ) }),
16786
+ /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: copied ? "Copiado!" : "Copiar" })
16787
+ ] }) });
16788
+ };
16789
+ var propertyLabels = {
16790
+ Nome: "Nome",
16791
+ tipo: "Tipo",
16792
+ Tipo: "Tipo",
16793
+ Protocolos: "Protocolos",
16794
+ Ambiente: "Ambiente",
16795
+ Setor: "Setor",
16796
+ Contato: "Contato",
16797
+ Sustentacao: "Sustenta\xE7\xE3o",
16798
+ Destino: "Destino",
16799
+ Origem: "Origem"
16800
+ };
16801
+ var IntegrationCard = ({ title, details }) => {
16802
+ const titleRef = useRef(null);
16803
+ const isTitleTruncated = useIsTruncated(titleRef);
16804
+ const blackList = ["id", "elementId", "identity"];
16805
+ const entries = details ? Object.entries(details).filter(
16806
+ ([key, value]) => value !== void 0 && value !== null && value !== "" && !blackList.includes(key)
16807
+ ) : [];
16808
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-sm border border-border/40 bg-muted/20 overflow-hidden", children: [
16809
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border/30", children: [
16810
+ /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
16811
+ /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
16812
+ "span",
16813
+ {
16814
+ ref: titleRef,
16815
+ className: "text-sm font-bold text-foreground truncate flex-1 cursor-default",
16816
+ children: title
16817
+ }
16818
+ ) }),
16819
+ isTitleTruncated && /* @__PURE__ */ jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: title })
16820
+ ] }) }),
16821
+ entries.length > 0 && /* @__PURE__ */ jsx(
16822
+ CopyData,
16823
+ {
16824
+ value: entries.map(([k, v]) => `${propertyLabels[k] || k}: ${String(v)}`).join("\n")
16825
+ }
16826
+ )
16827
+ ] }),
16828
+ entries.length > 0 && /* @__PURE__ */ jsx("div", { className: "divide-y divide-border/20", children: entries.map(([key, value]) => {
16829
+ const label = propertyLabels[key] || key;
16830
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
16831
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-semibold text-muted-foreground shrink-0 w-[40%] sm:w-[38%]", children: [
16832
+ label,
16833
+ ":"
16834
+ ] }),
16835
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-foreground break-all flex-1", children: String(value) })
16836
+ ] }, key);
16837
+ }) })
16838
+ ] });
16839
+ };
16840
+ var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxs("div", { className: "px-3 py-3 space-y-3 overflow-y-auto flex-1 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: [
16841
+ isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
16842
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "h-6 w-3/4" }),
16843
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
16844
+ ] }) : /* @__PURE__ */ jsx(NameTooltip, { name: data.name, description: data.description }),
16845
+ /* @__PURE__ */ jsx("div", { className: "border-t border-border/20" }),
16846
+ isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
16847
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1", children: [
16848
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" }),
16849
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" })
16850
+ ] }),
16851
+ /* @__PURE__ */ jsx("div", { className: "border-t border-border/20" }),
16852
+ [1, 2].map((i) => /* @__PURE__ */ jsxs(
16853
+ "div",
16854
+ {
16855
+ className: "rounded-lg border border-border/20 overflow-hidden",
16856
+ children: [
16857
+ /* @__PURE__ */ jsx(SkeletonBase, { className: "h-8 w-full" }),
16858
+ [1, 2, 3].map((j) => /* @__PURE__ */ jsx(SkeletonBase, { className: "h-7 w-full mt-px" }, j))
16859
+ ]
16860
+ },
16861
+ i
16862
+ ))
16863
+ ] }) : connections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center py-4", children: "Nenhuma conex\xE3o encontrada" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
16864
+ /* @__PURE__ */ jsx(
16865
+ SystemsDiagram,
16866
+ {
16867
+ isInput,
16868
+ currentSystem: data.name,
16869
+ externalSystem
16870
+ }
16871
+ ),
16872
+ /* @__PURE__ */ jsx("div", { className: "border-t border-border/20" }),
16873
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-", children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase", children: isInput ? "Informa\xE7\xF5es de Entrada" : "Informa\xE7\xF5es de Sa\xEDda" }) }),
16874
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: connections.map((conn) => /* @__PURE__ */ jsx(
16875
+ IntegrationCard,
16876
+ {
16877
+ title: conn.name,
16878
+ details: conn.integration
16879
+ },
16880
+ conn.id
16881
+ )) })
16882
+ ] })
16883
+ ] });
16884
+ var TooltipBody = React32__default.memo(TooltipBodyComponent);
16885
+ var tooltipVariants3 = {
16886
+ hidden: {
16887
+ opacity: 0,
16888
+ scale: 0.96,
16889
+ transition: { type: "spring", stiffness: 400, damping: 28 }
16890
+ },
16891
+ visible: {
16892
+ opacity: 1,
16893
+ scale: 1,
16894
+ transition: { type: "spring", stiffness: 300, damping: 28 }
16895
+ },
16896
+ exit: {
16897
+ opacity: 0,
16898
+ scale: 0.96,
16899
+ transition: { type: "spring", stiffness: 400, damping: 28 }
16900
+ }
16901
+ };
16902
+ var IntegrationTooltip = ({
16903
+ id,
16904
+ data,
16905
+ position,
16906
+ title = "Conex\xF5es",
16907
+ isLoading = false,
16908
+ systemName,
16909
+ onMouseDown,
16910
+ onClose,
16911
+ onPositionChange
16912
+ }) => {
16913
+ const isMobile = useIsMobile();
16914
+ const [localPos, setLocalPos] = useState(position);
16915
+ const [dragging, setDragging] = useState(false);
16916
+ const offsetRef = useRef({ x: 0, y: 0 });
16917
+ const lastMouse = useRef({ x: 0, y: 0 });
16918
+ useEffect(() => setLocalPos(position), [position]);
16919
+ useEffect(() => {
16920
+ let rafId = null;
16921
+ const handleMouseMove = (e) => {
16922
+ if (!dragging) return;
16923
+ lastMouse.current = { x: e.clientX, y: e.clientY };
16924
+ if (rafId) cancelAnimationFrame(rafId);
16925
+ rafId = requestAnimationFrame(() => {
16926
+ const newLeft = lastMouse.current.x - offsetRef.current.x;
16927
+ const newTop = lastMouse.current.y - offsetRef.current.y;
16928
+ const p = {
16929
+ top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
16930
+ left: Math.max(0, Math.min(newLeft, window.innerWidth - 320))
16931
+ };
16932
+ setLocalPos(p);
16933
+ onPositionChange?.(id, p);
16934
+ });
16935
+ };
16936
+ const handleMouseUp = () => {
16937
+ if (dragging) {
16938
+ setDragging(false);
16939
+ if (rafId) cancelAnimationFrame(rafId);
16940
+ }
16941
+ };
16942
+ if (dragging) {
16943
+ document.addEventListener("mousemove", handleMouseMove, {
16944
+ passive: true
16945
+ });
16946
+ document.addEventListener("mouseup", handleMouseUp);
16947
+ document.body.style.cursor = "grabbing";
16948
+ document.body.style.userSelect = "none";
16949
+ }
16950
+ return () => {
16951
+ if (rafId) cancelAnimationFrame(rafId);
16952
+ document.removeEventListener("mousemove", handleMouseMove);
16953
+ document.removeEventListener("mouseup", handleMouseUp);
16954
+ document.body.style.cursor = "";
16955
+ document.body.style.userSelect = "";
16956
+ };
16957
+ }, [dragging, id, onPositionChange]);
16958
+ const handleMouseDownLocal = useCallback(
16959
+ (e) => {
16960
+ e.preventDefault();
16961
+ e.stopPropagation();
16962
+ const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16963
+ if (!rect) return;
16964
+ offsetRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
16965
+ setDragging(true);
16966
+ onMouseDown?.(id, e);
16967
+ },
16968
+ [id, onMouseDown]
16969
+ );
16970
+ const handleTouchStartLocal = useCallback(
16971
+ (e) => {
16972
+ e.stopPropagation();
16973
+ const touch = e.touches[0];
16974
+ if (!touch) return;
16975
+ const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
16976
+ if (!rect) return;
16977
+ offsetRef.current = {
16978
+ x: touch.clientX - rect.left,
16979
+ y: touch.clientY - rect.top
16980
+ };
16981
+ setDragging(true);
16982
+ onMouseDown?.(id, e);
16983
+ },
16984
+ [id, onMouseDown]
16985
+ );
16986
+ const inputConnections = useMemo(
16987
+ () => data.connections.filter((c) => c.type === "entrada"),
16988
+ [data.connections]
16989
+ );
16990
+ const outputConnections = useMemo(
16991
+ () => data.connections.filter((c) => c.type === "saida"),
16992
+ [data.connections]
16993
+ );
16994
+ const isInput = inputConnections.length > 0;
16995
+ const connections = isInput ? inputConnections : outputConnections;
16996
+ const externalSystem = systemName ?? connections[0]?.name ?? "Sistema";
16997
+ const header = /* @__PURE__ */ jsxs(
16998
+ "div",
16999
+ {
17000
+ className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30 shrink-0",
17001
+ onMouseDown: handleMouseDownLocal,
17002
+ onTouchStart: handleTouchStartLocal,
17003
+ style: {
17004
+ touchAction: "none",
17005
+ cursor: dragging ? "grabbing" : "grab"
17006
+ },
17007
+ children: [
17008
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3", children: [
17009
+ /* @__PURE__ */ jsx(DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
17010
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title })
17011
+ ] }),
17012
+ /* @__PURE__ */ jsx(
17013
+ ButtonBase,
17014
+ {
17015
+ variant: "ghost",
17016
+ size: "icon",
17017
+ onClick: () => onClose(id),
17018
+ className: "text-muted-foreground hover:text-destructive transition-colors hover:bg-destructive/10 mr-1",
17019
+ style: { cursor: "pointer" },
17020
+ children: /* @__PURE__ */ jsx(XIcon, { size: 16 })
17021
+ }
17022
+ )
17023
+ ]
17024
+ }
17025
+ );
17026
+ const bodyProps = { data, isLoading, connections, isInput, externalSystem };
17027
+ if (isMobile) {
17028
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
17029
+ /* @__PURE__ */ jsx(
17030
+ motion.div,
17031
+ {
17032
+ className: "fixed inset-0 z-[9999] bg-black/40 backdrop-blur-[2px]",
17033
+ initial: { opacity: 0 },
17034
+ animate: { opacity: 1 },
17035
+ exit: { opacity: 0 },
17036
+ onClick: () => onClose(id)
17037
+ },
17038
+ `overlay-${id}`
17039
+ ),
17040
+ /* @__PURE__ */ jsxs(
17041
+ motion.div,
17042
+ {
17043
+ className: "fixed bottom-0 left-0 right-0 z-[10000] bg-card border-t border-border/50 rounded-t-2xl shadow-2xl flex flex-col",
17044
+ style: { maxHeight: "85dvh" },
17045
+ initial: { y: "100%" },
17046
+ animate: { y: 0 },
17047
+ exit: { y: "100%" },
17048
+ transition: { type: "spring", stiffness: 320, damping: 36 },
17049
+ onClick: (e) => e.stopPropagation(),
17050
+ children: [
17051
+ /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-2.5 pb-1 shrink-0", children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-border" }) }),
17052
+ header,
17053
+ /* @__PURE__ */ jsx("div", { className: "overflow-y-auto flex-1 pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ jsx(TooltipBody, { ...bodyProps }) })
17054
+ ]
17055
+ },
17056
+ `sheet-${id}`
17057
+ )
17058
+ ] }) });
17059
+ }
17060
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(
17061
+ motion.div,
17062
+ {
17063
+ className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-lg shadow-2xl z-[10000] w-[calc(100vw-32px)] max-w-sm sm:w-80 overflow-hidden flex flex-col",
17064
+ variants: tooltipVariants3,
17065
+ initial: "hidden",
17066
+ animate: "visible",
17067
+ exit: "exit",
17068
+ style: { top: localPos.top, left: localPos.left },
17069
+ onClick: (e) => e.stopPropagation(),
17070
+ children: [
17071
+ header,
17072
+ /* @__PURE__ */ jsx("div", { className: "max-h-[60vh] sm:max-h-[520px] overflow-hidden flex flex-col", children: /* @__PURE__ */ jsx(TooltipBody, { ...bodyProps }) })
17073
+ ]
17074
+ },
17075
+ id
17076
+ ) });
17077
+ };
17078
+ var IntegrationTooltip_default = IntegrationTooltip;
17079
+
17080
+ // src/components/ui/charts/components/tooltips/utils/integrationTooltipUtils.ts
17081
+ function processIntegrationData(integrations, targetSystemName) {
17082
+ const connections = [];
17083
+ integrations.forEach((integration) => {
17084
+ const origemNome = integration.origem.properties.nome;
17085
+ const destinoNome = integration.destino.properties.nome;
17086
+ if (origemNome === targetSystemName) {
17087
+ connections.push({
17088
+ id: integration.r.elementId,
17089
+ name: destinoNome,
17090
+ type: "saida",
17091
+ integration: integration.r.properties
17092
+ });
17093
+ }
17094
+ if (destinoNome === targetSystemName) {
17095
+ connections.push({
17096
+ id: integration.r.elementId,
17097
+ name: origemNome,
17098
+ type: "entrada",
17099
+ integration: integration.r.properties
17100
+ });
17101
+ }
17102
+ });
17103
+ return {
17104
+ name: targetSystemName,
17105
+ connections
17106
+ };
17107
+ }
16441
17108
 
16442
- // src/components/ui/charts/components/tooltips/systemTooltipUtils.ts
17109
+ // src/components/ui/charts/components/tooltips/utils/systemTooltipUtils.ts
16443
17110
  function processNeo4jData(integrations, targetSystemName) {
16444
17111
  const connections = [];
16445
17112
  integrations.forEach((integration) => {
@@ -20320,4 +20987,4 @@ function ControlledCombobox({
20320
20987
  );
20321
20988
  }
20322
20989
 
20323
- export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, Brush_default as Brush, ButtonBase, ButtonGroupBase, CENTER_INDEX, CalendarBase, CalendarDndProvider, CalendarDndProviderAgenda, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, CarouselBase, ChangeButton, Chart_default as Chart, ChartControls, ChartHeader, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDebouncedInputBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, ControlledCombobox, CopyButton, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDetailModalAgenda, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileUploader, FilterButton, HideButton, Highlights_default as Highlights, HorizontalChart_default as HorizontalChart, HorizontalLegend_default as HorizontalLegend, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiDayOverlay, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RadialMenu, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectEmpty, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemTooltip_default as SystemTooltip, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatDurationAgenda, formatDurationAgendaDays, formatFieldName, formatLinePercentage, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getAutoColorAgenda, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normalizeAttendDate, processNeo4jData, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };
20990
+ export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge, Beam, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, Brush_default as Brush, ButtonBase, ButtonGroupBase, CENTER_INDEX, CalendarBase, CalendarDndProvider, CalendarDndProviderAgenda, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, CarouselBase, ChangeButton, Chart_default as Chart, ChartControls, ChartHeader, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDebouncedInputBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, ControlledCombobox, CopyButton, CopyData, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDetailModalAgenda, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileUploader, FilterButton, HideButton, Highlights_default as Highlights, HorizontalChart_default as HorizontalChart, HorizontalLegend_default as HorizontalLegend, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, IntegrationCard, IntegrationTooltip_default as IntegrationTooltip, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiDayOverlay, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NameTooltip, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RadialMenu, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectEmpty, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemNode, SystemTooltip_default as SystemTooltip, SystemsDiagram, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipBody, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, YearViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatDurationAgenda, formatDurationAgendaDays, formatFieldName, formatLinePercentage, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getAutoColorAgenda, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normalizeAttendDate, processIntegrationData, processNeo4jData, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useIsTruncated, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };