@algorithm-shift/design-system 1.3.106 → 1.3.108

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
@@ -797,11 +797,13 @@ var ButtonGroup = ({
797
797
  "rounded-md overflow-hidden",
798
798
  "border border-border",
799
799
  "bg-background",
800
- "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2"
800
+ "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
801
+ className,
802
+ "p-0"
801
803
  );
802
804
  const mainButtonClasses = cn(
803
805
  className,
804
- orientation === "horizontal" ? "rounded-none border-l-0 border-t-0 border-r last:border-r-0" : "rounded-none border-t-0 border-b last:border-b-0",
806
+ orientation === "horizontal" ? "rounded-none border-l-0 border-t-0 border-b-0 border-r last:border-r-0" : "rounded-none border-t-0 border-l-0 border-r-0 last:border-b-0",
805
807
  "focus:ring-0 focus-visible:ring-0"
806
808
  );
807
809
  const dropdownButtonClasses = cn(
@@ -3575,6 +3577,7 @@ import {
3575
3577
  getFilteredRowModel,
3576
3578
  useReactTable
3577
3579
  } from "@tanstack/react-table";
3580
+ import axios3 from "axios";
3578
3581
  import { ArrowDown, ArrowUp, ArrowUpDown, Search } from "lucide-react";
3579
3582
 
3580
3583
  // src/components/ui/table.tsx
@@ -4011,13 +4014,153 @@ function DataTable({
4011
4014
  onDeleteRow,
4012
4015
  rowActions,
4013
4016
  enableRowSelection = false,
4014
- getRowSelection
4017
+ getRowSelection,
4018
+ tableId,
4019
+ manageColumns = false,
4020
+ preferenceUrl,
4021
+ axiosInstance
4015
4022
  }) {
4016
4023
  const [columnFilters, setColumnFilters] = React11.useState([]);
4017
4024
  const [columnVisibility, setColumnVisibility] = React11.useState({});
4025
+ const hasLoadedInitialState = React11.useRef(false);
4026
+ const isSavingRef = React11.useRef(false);
4027
+ const isFetchingRef = React11.useRef(false);
4028
+ const transformApiToFrontend = React11.useCallback((apiSettings, allColumnIds) => {
4029
+ if (!apiSettings || !apiSettings.columns || !apiSettings.columns.visible) {
4030
+ return {};
4031
+ }
4032
+ const visibleColumns = apiSettings.columns.visible;
4033
+ const result = {};
4034
+ allColumnIds.forEach((colId) => {
4035
+ result[colId] = visibleColumns.includes(colId);
4036
+ });
4037
+ return result;
4038
+ }, []);
4039
+ const transformFrontendToApi = React11.useCallback((visibility) => {
4040
+ const visibleColumns = Object.keys(visibility).filter((colId) => visibility[colId] === true);
4041
+ return {
4042
+ columns: {
4043
+ visible: visibleColumns
4044
+ }
4045
+ };
4046
+ }, []);
4047
+ const fetchColumnPreferences = React11.useCallback(async () => {
4048
+ if (isFetchingRef.current) {
4049
+ return;
4050
+ }
4051
+ if (!tableId || !manageColumns) {
4052
+ hasLoadedInitialState.current = true;
4053
+ return;
4054
+ }
4055
+ isFetchingRef.current = true;
4056
+ try {
4057
+ const entityKey = `table:${tableId}`;
4058
+ const apiUrl = `${preferenceUrl}/${encodeURIComponent(entityKey)}`;
4059
+ const axiosClient = axiosInstance ?? axios3;
4060
+ const response = await axiosClient.get(apiUrl, {
4061
+ withCredentials: true
4062
+ });
4063
+ if (response) {
4064
+ const data2 = response.data;
4065
+ if (data2.success && data2.data && data2.data.exists && data2.data.settings) {
4066
+ let allColumnIds = [];
4067
+ if (tableRef.current) {
4068
+ allColumnIds = tableRef.current.getAllLeafColumns().map((col) => col.id).filter(Boolean);
4069
+ } else {
4070
+ allColumnIds = columns.map((col) => {
4071
+ if (typeof col.id === "string") {
4072
+ return col.id;
4073
+ }
4074
+ if (col.accessorKey) {
4075
+ return col.accessorKey;
4076
+ }
4077
+ return null;
4078
+ }).filter((id) => !!id);
4079
+ if (enableRowSelection && !allColumnIds.includes("__select__")) {
4080
+ allColumnIds.unshift("__select__");
4081
+ }
4082
+ }
4083
+ if (allColumnIds.length > 0) {
4084
+ const transformed = transformApiToFrontend(data2.data.settings, allColumnIds);
4085
+ console.log("[DataTable] Loaded column preferences:", {
4086
+ visibleColumns: data2.data.settings.columns?.visible,
4087
+ allColumnIds,
4088
+ transformed
4089
+ });
4090
+ if (Object.keys(transformed).length > 0) {
4091
+ setColumnVisibility(transformed);
4092
+ }
4093
+ }
4094
+ } else {
4095
+ console.log("[DataTable] No saved preferences found, using default visibility");
4096
+ }
4097
+ } else {
4098
+ console.warn("Failed to fetch column preferences:", response);
4099
+ }
4100
+ } catch (error) {
4101
+ console.error("Error fetching column preferences:", error);
4102
+ } finally {
4103
+ hasLoadedInitialState.current = true;
4104
+ isFetchingRef.current = false;
4105
+ }
4106
+ }, [tableId, transformApiToFrontend, manageColumns]);
4107
+ const saveColumnPreferences = React11.useCallback(async (visibility) => {
4108
+ if (!tableId || isSavingRef.current || !manageColumns) {
4109
+ return;
4110
+ }
4111
+ isSavingRef.current = true;
4112
+ try {
4113
+ const entityKey = `table:${tableId}`;
4114
+ const apiUrl = `${preferenceUrl}/${encodeURIComponent(entityKey)}`;
4115
+ const settings = transformFrontendToApi(visibility);
4116
+ const requestBody = {
4117
+ settings,
4118
+ is_default: true
4119
+ };
4120
+ const axiosClient = axiosInstance ?? axios3;
4121
+ const response = await axiosClient.post(apiUrl, requestBody, {
4122
+ withCredentials: true
4123
+ });
4124
+ if (!response) {
4125
+ console.error("Failed to save column preferences:", response);
4126
+ }
4127
+ } catch (error) {
4128
+ console.error("Error saving column preferences:", error);
4129
+ } finally {
4130
+ isSavingRef.current = false;
4131
+ }
4132
+ }, [tableId, transformFrontendToApi, manageColumns]);
4133
+ React11.useEffect(() => {
4134
+ if (hasLoadedInitialState.current || isFetchingRef.current) {
4135
+ return;
4136
+ }
4137
+ if (!tableId) {
4138
+ return;
4139
+ }
4140
+ if (manageColumns) {
4141
+ fetchColumnPreferences();
4142
+ }
4143
+ }, [tableId, manageColumns]);
4018
4144
  const [manualSort, setManualSort] = React11.useState(null);
4019
4145
  const [searchTerm, setSearchTerm] = React11.useState("");
4020
4146
  const tableData = Array.isArray(data) ? data : [];
4147
+ const filteredData = React11.useMemo(() => {
4148
+ if (paginationMode === "client" && globalSearch && searchTerm.trim()) {
4149
+ const searchLower = searchTerm.toLowerCase().trim();
4150
+ return tableData.filter((row) => {
4151
+ return columns.some((column) => {
4152
+ const columnId = typeof column.id === "string" ? column.id : column.accessorKey;
4153
+ if (!columnId) return false;
4154
+ const accessorFn = column.accessorFn;
4155
+ const cellValue = accessorFn ? accessorFn(row, 0) : row[columnId];
4156
+ const cellValueStr = cellValue != null ? String(cellValue).toLowerCase() : "";
4157
+ return cellValueStr.includes(searchLower);
4158
+ });
4159
+ });
4160
+ }
4161
+ return tableData;
4162
+ }, [tableData, searchTerm, paginationMode, globalSearch, columns]);
4163
+ const finalData = paginationMode === "client" && globalSearch ? filteredData : tableData;
4021
4164
  const finalCols = [...columns];
4022
4165
  if (enableRowSelection) {
4023
4166
  finalCols.unshift({
@@ -4044,44 +4187,89 @@ function DataTable({
4044
4187
  const dynamicCols = useDynamicColumns({ columns: finalCols, enableRowSelection });
4045
4188
  const [rowSelection, setRowSelection] = React11.useState({});
4046
4189
  const [localPageSize, setLocalPageSize] = React11.useState(pageSize);
4190
+ const [localPageIndex, setLocalPageIndex] = React11.useState(0);
4191
+ const isUpdatingPageSizeRef = React11.useRef(false);
4192
+ const tableRef = React11.useRef(null);
4193
+ React11.useEffect(() => {
4194
+ if (paginationMode === "client") {
4195
+ setLocalPageSize(pageSize);
4196
+ }
4197
+ }, [pageSize, paginationMode]);
4047
4198
  const table = useReactTable({
4048
- data: tableData,
4199
+ data: finalData,
4049
4200
  columns: dynamicCols,
4201
+ initialState: {
4202
+ pagination: {
4203
+ pageIndex: 0,
4204
+ pageSize
4205
+ }
4206
+ },
4050
4207
  state: {
4051
4208
  columnFilters,
4052
4209
  columnVisibility,
4053
4210
  rowSelection,
4054
- ...paginationMode === "server" ? {
4055
- pagination: {
4056
- pageIndex: controlledPageIndex ?? 0,
4057
- pageSize: localPageSize
4058
- }
4059
- } : {}
4211
+ pagination: {
4212
+ pageIndex: paginationMode === "server" ? controlledPageIndex ?? 0 : localPageIndex,
4213
+ pageSize: localPageSize
4214
+ }
4060
4215
  },
4061
4216
  enableRowSelection: !!enableRowSelection,
4062
4217
  onRowSelectionChange: (updater) => {
4063
4218
  setRowSelection((old) => {
4064
4219
  const newState = typeof updater === "function" ? updater(old) : updater;
4065
- const selectedData = Object.keys(newState).filter((key) => newState[key]).map((rowId) => tableData[Number(rowId)]);
4220
+ const selectedData = Object.keys(newState).filter((key) => newState[key]).map((rowId) => finalData[Number(rowId)]);
4066
4221
  getRowSelection?.({ rows: selectedData });
4067
4222
  return newState;
4068
4223
  });
4069
4224
  },
4070
4225
  onColumnFiltersChange: setColumnFilters,
4071
- onColumnVisibilityChange: setColumnVisibility,
4226
+ onColumnVisibilityChange: (updater) => {
4227
+ setColumnVisibility((old) => {
4228
+ const newState = typeof updater === "function" ? updater(old) : updater;
4229
+ setTimeout(() => {
4230
+ if (tableRef.current && tableId && hasLoadedInitialState.current) {
4231
+ try {
4232
+ const completeVisibility = {};
4233
+ tableRef.current.getAllLeafColumns().forEach((column) => {
4234
+ completeVisibility[column.id] = column.getIsVisible();
4235
+ });
4236
+ if (Object.keys(completeVisibility).length > 0) {
4237
+ saveColumnPreferences(completeVisibility);
4238
+ }
4239
+ } catch (error) {
4240
+ console.error("Error saving column visibility to API:", error);
4241
+ }
4242
+ }
4243
+ }, 0);
4244
+ return newState;
4245
+ });
4246
+ },
4072
4247
  getCoreRowModel: getCoreRowModel(),
4073
4248
  getFilteredRowModel: getFilteredRowModel(),
4074
4249
  getPaginationRowModel: pagination && paginationMode === "client" ? getPaginationRowModel() : void 0,
4075
4250
  manualPagination: paginationMode === "server",
4076
4251
  pageCount: paginationMode === "server" ? Math.ceil(totalRecords / localPageSize) : void 0,
4077
- ...paginationMode === "server" ? {
4078
- onPaginationChange: (updater) => {
4079
- const prev = table.getState().pagination;
4080
- const next = typeof updater === "function" ? updater(prev) : updater;
4252
+ onPaginationChange: (updater) => {
4253
+ if (isUpdatingPageSizeRef.current) {
4254
+ isUpdatingPageSizeRef.current = false;
4255
+ return;
4256
+ }
4257
+ const prev = table.getState().pagination;
4258
+ const next = typeof updater === "function" ? updater(prev) : updater;
4259
+ if (paginationMode === "server") {
4081
4260
  onPageChange?.(next.pageIndex, next.pageSize);
4261
+ } else {
4262
+ setLocalPageIndex(next.pageIndex);
4263
+ setLocalPageSize(next.pageSize);
4082
4264
  }
4083
- } : {}
4265
+ }
4084
4266
  });
4267
+ React11.useEffect(() => {
4268
+ tableRef.current = table;
4269
+ if (table && !hasLoadedInitialState.current && !isFetchingRef.current && tableId) {
4270
+ fetchColumnPreferences();
4271
+ }
4272
+ }, [table, tableId]);
4085
4273
  const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
4086
4274
  if (totalPages <= maxVisiblePages) {
4087
4275
  return Array.from({ length: totalPages }, (_, i) => i + 1);
@@ -4104,17 +4292,26 @@ function DataTable({
4104
4292
  const pageCount = table.getPageCount() === 0 ? 1 : table.getPageCount();
4105
4293
  const handlePageSizeChange = (e) => {
4106
4294
  const newSize = Number(e.target.value);
4107
- const currentPageIndex = table.getState().pagination.pageIndex;
4108
- onPageChange?.(currentPageIndex, newSize);
4109
- setLocalPageSize(newSize);
4295
+ if (paginationMode === "server") {
4296
+ const currentPageIndex = table.getState().pagination.pageIndex;
4297
+ onPageChange?.(currentPageIndex, newSize);
4298
+ setLocalPageSize(newSize);
4299
+ } else {
4300
+ isUpdatingPageSizeRef.current = true;
4301
+ setLocalPageSize(newSize);
4302
+ setLocalPageIndex(0);
4303
+ }
4110
4304
  };
4111
4305
  const pageSizeOptions = React11.useMemo(() => {
4306
+ if (paginationMode === "client") {
4307
+ return [5, 10, 20, 50, 100];
4308
+ }
4112
4309
  const options = [5, 10, 20, 50, 100].filter((size) => size < totalRecords);
4113
4310
  if (options.length === 0) {
4114
4311
  options.push(5);
4115
4312
  }
4116
4313
  return options;
4117
- }, [totalRecords]);
4314
+ }, [paginationMode, totalRecords]);
4118
4315
  return /* @__PURE__ */ jsxs30("div", { className: "overflow-hidden rounded-md w-full", children: [
4119
4316
  !loading && /* @__PURE__ */ jsxs30("div", { className: "flex justify-between p-2 bg-gray-50", children: [
4120
4317
  /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-4 w-full", children: [
@@ -4130,10 +4327,17 @@ function DataTable({
4130
4327
  type: "text",
4131
4328
  placeholder: "Search...",
4132
4329
  value: searchTerm,
4133
- onChange: (e) => setSearchTerm(e.target.value),
4330
+ onChange: (e) => {
4331
+ setSearchTerm(e.target.value);
4332
+ if (paginationMode === "client") {
4333
+ setLocalPageIndex(0);
4334
+ }
4335
+ },
4134
4336
  onKeyDown: (e) => {
4135
- if (e.key === "Enter" && onGlobalSearch) {
4136
- onGlobalSearch(searchTerm.trim());
4337
+ if (e.key === "Enter") {
4338
+ if (paginationMode === "server" && onGlobalSearch) {
4339
+ onGlobalSearch(searchTerm.trim());
4340
+ }
4137
4341
  }
4138
4342
  },
4139
4343
  className: "border border-gray-300 rounded-md text-sm px-3 py-2 pl-8 w-full focus:outline-none focus:ring-1 focus:ring-[#12715B]"
@@ -4141,7 +4345,7 @@ function DataTable({
4141
4345
  ),
4142
4346
  /* @__PURE__ */ jsx51(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
4143
4347
  ] }),
4144
- /* @__PURE__ */ jsx51(
4348
+ paginationMode === "server" && /* @__PURE__ */ jsx51(
4145
4349
  Button,
4146
4350
  {
4147
4351
  size: "sm",
@@ -4152,7 +4356,7 @@ function DataTable({
4152
4356
  )
4153
4357
  ] })
4154
4358
  ] }),
4155
- /* @__PURE__ */ jsxs30(Popover, { children: [
4359
+ manageColumns && /* @__PURE__ */ jsxs30(Popover, { children: [
4156
4360
  /* @__PURE__ */ jsx51(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx51(
4157
4361
  Button,
4158
4362
  {
@@ -4162,42 +4366,44 @@ function DataTable({
4162
4366
  children: "Manage Columns"
4163
4367
  }
4164
4368
  ) }),
4165
- /* @__PURE__ */ jsxs30(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
4369
+ /* @__PURE__ */ jsxs30(PopoverContent, { align: "end", className: "w-48 p-3", children: [
4166
4370
  /* @__PURE__ */ jsx51("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
4167
- /* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
4168
- /* @__PURE__ */ jsx51(
4169
- "input",
4170
- {
4171
- type: "checkbox",
4172
- checked: table.getAllLeafColumns().every((col) => col.getIsVisible()),
4173
- ref: (input) => {
4174
- if (input) {
4175
- input.indeterminate = table.getAllLeafColumns().some((col) => col.getIsVisible()) && !table.getAllLeafColumns().every((col) => col.getIsVisible());
4176
- }
4177
- },
4178
- onChange: (e) => {
4179
- table.getAllLeafColumns().forEach(
4180
- (col) => col.toggleVisibility(e.target.checked)
4181
- );
4182
- }
4183
- }
4184
- ),
4185
- "Toggle All"
4186
- ] }),
4187
- table.getAllLeafColumns().map((column) => {
4188
- const header = column.columnDef.header;
4189
- return /* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm", children: [
4371
+ /* @__PURE__ */ jsxs30("div", { className: "max-h-56 overflow-y-auto pr-1 space-y-2", children: [
4372
+ /* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
4190
4373
  /* @__PURE__ */ jsx51(
4191
4374
  "input",
4192
4375
  {
4193
4376
  type: "checkbox",
4194
- checked: column.getIsVisible(),
4195
- onChange: (e) => column.toggleVisibility(e.target.checked)
4377
+ checked: table.getAllLeafColumns().every((col) => col.getIsVisible()),
4378
+ ref: (input) => {
4379
+ if (input) {
4380
+ input.indeterminate = table.getAllLeafColumns().some((col) => col.getIsVisible()) && !table.getAllLeafColumns().every((col) => col.getIsVisible());
4381
+ }
4382
+ },
4383
+ onChange: (e) => {
4384
+ table.getAllLeafColumns().forEach(
4385
+ (col) => col.toggleVisibility(e.target.checked)
4386
+ );
4387
+ }
4196
4388
  }
4197
4389
  ),
4198
- typeof header === "function" ? header({ column, header, table }) : typeof header === "string" ? header : column.id
4199
- ] }, column.id);
4200
- })
4390
+ "Toggle All"
4391
+ ] }),
4392
+ table.getAllLeafColumns().map((column) => {
4393
+ const header = column.columnDef.header;
4394
+ return /* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm", children: [
4395
+ /* @__PURE__ */ jsx51(
4396
+ "input",
4397
+ {
4398
+ type: "checkbox",
4399
+ checked: column.getIsVisible(),
4400
+ onChange: (e) => column.toggleVisibility(e.target.checked)
4401
+ }
4402
+ ),
4403
+ typeof header === "function" ? header({ column, header, table }) : typeof header === "string" ? header : column.id
4404
+ ] }, column.id);
4405
+ })
4406
+ ] })
4201
4407
  ] })
4202
4408
  ] })
4203
4409
  ] }),
@@ -4296,7 +4502,22 @@ function DataTable({
4296
4502
  `header-${header.id}-${index}`
4297
4503
  );
4298
4504
  }) }, `header-group-${hg.id}`)) }),
4299
- /* @__PURE__ */ jsx51(TableBody, { children: loading ? /* @__PURE__ */ jsx51(Fragment21, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx51(TableRow, { children: dynamicCols.map((_2, j) => /* @__PURE__ */ jsx51(TableCell, { className: "p-3", children: /* @__PURE__ */ jsx51("span", { className: "h-4 bg-gray-200 rounded w-3/4 block animate-pulse" }) }, j)) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx51(TableRow, { children: row.getVisibleCells().map((cell, cellIndex, arr) => {
4505
+ /* @__PURE__ */ jsx51(TableBody, { children: loading ? /* @__PURE__ */ jsx51(Fragment21, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx51(TableRow, { children: table.getHeaderGroups()[0].headers.map((header, j) => {
4506
+ const column = header.column;
4507
+ return /* @__PURE__ */ jsx51(
4508
+ TableCell,
4509
+ {
4510
+ className: "p-3",
4511
+ style: {
4512
+ width: column.getSize(),
4513
+ minWidth: column.columnDef.minSize,
4514
+ maxWidth: column.columnDef.maxSize
4515
+ },
4516
+ children: /* @__PURE__ */ jsx51("span", { className: "h-4 bg-gray-200 rounded w-full block animate-pulse" })
4517
+ },
4518
+ j
4519
+ );
4520
+ }) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx51(TableRow, { children: row.getVisibleCells().map((cell, cellIndex, arr) => {
4300
4521
  const meta = cell.column.columnDef.meta || {};
4301
4522
  const isClickable = meta?.isClickable;
4302
4523
  const isLastCell = cellIndex === arr.length - 1;
@@ -4874,7 +5095,7 @@ var HistoryTimeline = ({
4874
5095
  var HistoryTimeline_default = HistoryTimeline;
4875
5096
 
4876
5097
  // src/components/Navigation/Tabs/Tabs.tsx
4877
- import { useCallback as useCallback4, useMemo as useMemo9, useState as useState12 } from "react";
5098
+ import { useCallback as useCallback5, useMemo as useMemo9, useState as useState12 } from "react";
4878
5099
  import { ChevronDown as ChevronDown2, Menu } from "lucide-react";
4879
5100
  import Link3 from "next/link";
4880
5101
  import { usePathname, useRouter } from "next/navigation";
@@ -5129,7 +5350,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
5129
5350
  const router = useRouter();
5130
5351
  const [showExitDialog, setShowExitDialog] = useState12(false);
5131
5352
  const [pendingUrl, setPendingUrl] = useState12(null);
5132
- const handleBuilderExit = useCallback4(
5353
+ const handleBuilderExit = useCallback5(
5133
5354
  (e, url) => {
5134
5355
  if (isBuilder) {
5135
5356
  e.preventDefault();
@@ -5296,7 +5517,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
5296
5517
  var Tabs_default = Tabs;
5297
5518
 
5298
5519
  // src/components/Navigation/Stages/Stages.tsx
5299
- import React12, { useEffect as useEffect26, useState as useState13 } from "react";
5520
+ import React12, { useEffect as useEffect27, useState as useState13 } from "react";
5300
5521
 
5301
5522
  // src/components/ui/tooltip.tsx
5302
5523
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
@@ -5369,7 +5590,7 @@ var StagesComponent = ({
5369
5590
  const [isCompleted, setIsCompleted] = useState13(false);
5370
5591
  const [activeChildStage, setActiveChildStage] = useState13(null);
5371
5592
  const [activeRootStage, setActiveRootStage] = useState13(null);
5372
- useEffect26(() => {
5593
+ useEffect27(() => {
5373
5594
  if (currentStage) {
5374
5595
  setActiveStage(currentStage);
5375
5596
  } else {
@@ -5429,7 +5650,7 @@ var StagesComponent = ({
5429
5650
  }
5430
5651
  return { activeRoot: null, activeChild: null };
5431
5652
  };
5432
- useEffect26(() => {
5653
+ useEffect27(() => {
5433
5654
  if (!currentStage || !Array.isArray(stages)) {
5434
5655
  setActiveRootStage(null);
5435
5656
  setActiveChildStage(null);
@@ -5560,7 +5781,7 @@ import { jsx as jsx64, jsxs as jsxs40 } from "react/jsx-runtime";
5560
5781
  import { jsx as jsx65 } from "react/jsx-runtime";
5561
5782
 
5562
5783
  // src/components/Navigation/Navbar/Navbar.tsx
5563
- import { useCallback as useCallback5, useMemo as useMemo10, useState as useState14, useEffect as useEffect27 } from "react";
5784
+ import { useCallback as useCallback6, useMemo as useMemo10, useState as useState14, useEffect as useEffect28 } from "react";
5564
5785
  import { Bell, Search as Search2, Menu as Menu2 } from "lucide-react";
5565
5786
  import Image3 from "next/image";
5566
5787
  import Link4 from "next/link";
@@ -5629,7 +5850,7 @@ function Navbar({
5629
5850
  const [screenMode, setScreenMode] = useState14(
5630
5851
  canvasMode
5631
5852
  );
5632
- useEffect27(() => {
5853
+ useEffect28(() => {
5633
5854
  const detectMode = () => {
5634
5855
  if (window.innerWidth < 640) setScreenMode("mobile");
5635
5856
  else if (window.innerWidth < 1024) setScreenMode("tablet");
@@ -5643,7 +5864,7 @@ function Navbar({
5643
5864
  const isMobile = mode === "mobile";
5644
5865
  const isTablet = mode === "tablet";
5645
5866
  const isDesktop = mode === "desktop";
5646
- const handleBuilderExit = useCallback5(
5867
+ const handleBuilderExit = useCallback6(
5647
5868
  (e, url) => {
5648
5869
  if (isBuilder) {
5649
5870
  e.preventDefault();
@@ -5736,8 +5957,8 @@ function Navbar({
5736
5957
  }
5737
5958
 
5738
5959
  // src/components/Chart/BarChart.tsx
5739
- import React14, { useEffect as useEffect28, useMemo as useMemo11, useState as useState15, useCallback as useCallback6 } from "react";
5740
- import axios3 from "axios";
5960
+ import React14, { useEffect as useEffect29, useMemo as useMemo11, useState as useState15, useCallback as useCallback7 } from "react";
5961
+ import axios4 from "axios";
5741
5962
  import {
5742
5963
  BarChart,
5743
5964
  Bar,
@@ -5814,12 +6035,12 @@ var ChartComponent = ({
5814
6035
  const [currentPage, setCurrentPage] = useState15(1);
5815
6036
  const effectiveData = apiUrl ? rawData : props.data || [];
5816
6037
  const effectiveLoading = apiUrl ? localLoading : externalLoading;
5817
- useEffect28(() => {
6038
+ useEffect29(() => {
5818
6039
  if (apiUrl) {
5819
6040
  setCurrentPage(1);
5820
6041
  }
5821
6042
  }, [apiUrl]);
5822
- const fetchData = useCallback6(async (page) => {
6043
+ const fetchData = useCallback7(async (page) => {
5823
6044
  if (!apiUrl) return;
5824
6045
  const cancelled = false;
5825
6046
  try {
@@ -5828,7 +6049,7 @@ var ChartComponent = ({
5828
6049
  page: page.toString(),
5829
6050
  limit: limit.toString()
5830
6051
  });
5831
- const axiosClient = props.axiosInstance ?? axios3;
6052
+ const axiosClient = props.axiosInstance ?? axios4;
5832
6053
  const res = await axiosClient.get(`${apiUrl}?${params.toString()}`, {
5833
6054
  withCredentials: true
5834
6055
  });
@@ -5856,7 +6077,7 @@ var ChartComponent = ({
5856
6077
  if (!cancelled) setLocalLoading(false);
5857
6078
  }
5858
6079
  }, [apiUrl, limit]);
5859
- useEffect28(() => {
6080
+ useEffect29(() => {
5860
6081
  if (!apiUrl) return;
5861
6082
  fetchData(currentPage);
5862
6083
  }, [apiUrl, currentPage, fetchData]);
@@ -6055,8 +6276,8 @@ var ChartComponent = ({
6055
6276
  var BarChart_default = React14.memo(ChartComponent);
6056
6277
 
6057
6278
  // src/components/Chart/PieChart.tsx
6058
- import React15, { useEffect as useEffect29, useMemo as useMemo12, useState as useState16 } from "react";
6059
- import axios4 from "axios";
6279
+ import React15, { useEffect as useEffect30, useMemo as useMemo12, useState as useState16 } from "react";
6280
+ import axios5 from "axios";
6060
6281
  import {
6061
6282
  PieChart,
6062
6283
  Pie,
@@ -6145,13 +6366,13 @@ var DonutChart = ({
6145
6366
  const [localLoading, setLocalLoading] = useState16(false);
6146
6367
  const effectiveData = apiUrl ? rawData : props.data || [];
6147
6368
  const effectiveLoading = apiUrl ? localLoading : externalLoading;
6148
- useEffect29(() => {
6369
+ useEffect30(() => {
6149
6370
  if (!apiUrl) return;
6150
6371
  let cancelled = false;
6151
6372
  const fetchData = async () => {
6152
6373
  try {
6153
6374
  setLocalLoading(true);
6154
- const axiosClient = props.axiosInstance ?? axios4;
6375
+ const axiosClient = props.axiosInstance ?? axios5;
6155
6376
  const res = await axiosClient.get(apiUrl, {
6156
6377
  withCredentials: true
6157
6378
  });
@@ -6227,7 +6448,7 @@ var DonutChart = ({
6227
6448
  return { inner: 70, outer: 130 };
6228
6449
  };
6229
6450
  const [mounted, setMounted] = useState16(false);
6230
- useEffect29(() => {
6451
+ useEffect30(() => {
6231
6452
  const timeout = setTimeout(() => setMounted(true), 100);
6232
6453
  return () => clearTimeout(timeout);
6233
6454
  }, []);