@algorithm-shift/design-system 1.2.71 → 1.2.73

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
@@ -28380,7 +28380,8 @@ function DataTable({
28380
28380
  onSortChange,
28381
28381
  onFilterChange,
28382
28382
  onGlobalSearch,
28383
- globalSearch
28383
+ globalSearch,
28384
+ onCellClick
28384
28385
  }) {
28385
28386
  const [columnFilters, setColumnFilters] = React7.useState([]);
28386
28387
  const [columnVisibility, setColumnVisibility] = React7.useState({});
@@ -28593,7 +28594,24 @@ function DataTable({
28593
28594
  ] })
28594
28595
  ] }) }, header.id);
28595
28596
  }) }, hg.id)) }),
28596
- /* @__PURE__ */ jsx47(TableBody, { children: loading ? /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx47(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx47(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
28597
+ /* @__PURE__ */ jsx47(TableBody, { children: loading ? /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx47(TableRow, { children: row.getVisibleCells().map((cell) => {
28598
+ const meta = cell.column.columnDef.meta || {};
28599
+ const isClickable = meta?.isClickable;
28600
+ return /* @__PURE__ */ jsx47(
28601
+ TableCell,
28602
+ {
28603
+ className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline" : ""}`,
28604
+ style: meta?.cellStyle,
28605
+ onClick: () => {
28606
+ if (isClickable && onCellClick) {
28607
+ onCellClick(cell.row.original, cell.column.id);
28608
+ }
28609
+ },
28610
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
28611
+ },
28612
+ cell.id
28613
+ );
28614
+ }) }, row.id)) : /* @__PURE__ */ jsx47(TableRow, { children: /* @__PURE__ */ jsx47(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
28597
28615
  ] }),
28598
28616
  pagination && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
28599
28617
  /* @__PURE__ */ jsxs26("div", { children: [
@@ -28897,8 +28915,126 @@ var Pagination_default = CustomPagination;
28897
28915
 
28898
28916
  // src/components/Navigation/Tabs/Tabs.tsx
28899
28917
  import Link5 from "next/link";
28918
+ import { useRouter } from "next/navigation";
28919
+
28920
+ // src/components/ui/dialog.tsx
28921
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
28900
28922
  import { jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
28901
- var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28923
+ function Dialog({
28924
+ ...props
28925
+ }) {
28926
+ return /* @__PURE__ */ jsx51(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
28927
+ }
28928
+ function DialogPortal({
28929
+ ...props
28930
+ }) {
28931
+ return /* @__PURE__ */ jsx51(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
28932
+ }
28933
+ function DialogOverlay({
28934
+ className,
28935
+ ...props
28936
+ }) {
28937
+ return /* @__PURE__ */ jsx51(
28938
+ DialogPrimitive.Overlay,
28939
+ {
28940
+ "data-slot": "dialog-overlay",
28941
+ className: cn(
28942
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
28943
+ className
28944
+ ),
28945
+ ...props
28946
+ }
28947
+ );
28948
+ }
28949
+ function DialogContent({
28950
+ className,
28951
+ children,
28952
+ showCloseButton = true,
28953
+ ...props
28954
+ }) {
28955
+ return /* @__PURE__ */ jsxs29(DialogPortal, { "data-slot": "dialog-portal", children: [
28956
+ /* @__PURE__ */ jsx51(DialogOverlay, {}),
28957
+ /* @__PURE__ */ jsxs29(
28958
+ DialogPrimitive.Content,
28959
+ {
28960
+ "data-slot": "dialog-content",
28961
+ className: cn(
28962
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
28963
+ className
28964
+ ),
28965
+ ...props,
28966
+ children: [
28967
+ children,
28968
+ showCloseButton && /* @__PURE__ */ jsxs29(
28969
+ DialogPrimitive.Close,
28970
+ {
28971
+ "data-slot": "dialog-close",
28972
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
28973
+ children: [
28974
+ /* @__PURE__ */ jsx51(X, {}),
28975
+ /* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Close" })
28976
+ ]
28977
+ }
28978
+ )
28979
+ ]
28980
+ }
28981
+ )
28982
+ ] });
28983
+ }
28984
+ function DialogHeader({ className, ...props }) {
28985
+ return /* @__PURE__ */ jsx51(
28986
+ "div",
28987
+ {
28988
+ "data-slot": "dialog-header",
28989
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
28990
+ ...props
28991
+ }
28992
+ );
28993
+ }
28994
+ function DialogFooter({ className, ...props }) {
28995
+ return /* @__PURE__ */ jsx51(
28996
+ "div",
28997
+ {
28998
+ "data-slot": "dialog-footer",
28999
+ className: cn(
29000
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
29001
+ className
29002
+ ),
29003
+ ...props
29004
+ }
29005
+ );
29006
+ }
29007
+ function DialogTitle({
29008
+ className,
29009
+ ...props
29010
+ }) {
29011
+ return /* @__PURE__ */ jsx51(
29012
+ DialogPrimitive.Title,
29013
+ {
29014
+ "data-slot": "dialog-title",
29015
+ className: cn("text-lg leading-none font-semibold", className),
29016
+ ...props
29017
+ }
29018
+ );
29019
+ }
29020
+ function DialogDescription({
29021
+ className,
29022
+ ...props
29023
+ }) {
29024
+ return /* @__PURE__ */ jsx51(
29025
+ DialogPrimitive.Description,
29026
+ {
29027
+ "data-slot": "dialog-description",
29028
+ className: cn("text-muted-foreground text-sm", className),
29029
+ ...props
29030
+ }
29031
+ );
29032
+ }
29033
+
29034
+ // src/components/Navigation/Tabs/Tabs.tsx
29035
+ import { useCallback as useCallback2, useState as useState5 } from "react";
29036
+ import { Fragment as Fragment18, jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
29037
+ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true }) => {
28902
29038
  const rawTabs = Array.isArray(tabs) ? tabs : [];
28903
29039
  const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
28904
29040
  const activeClasses = "bg-white/10 text-white";
@@ -28907,26 +29043,45 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28907
29043
  if (!path) return false;
28908
29044
  return pathname === path || path !== "/" && pathname?.startsWith(path);
28909
29045
  };
29046
+ const router = useRouter();
29047
+ const [showExitDialog, setShowExitDialog] = useState5(false);
29048
+ const [pendingUrl, setPendingUrl] = useState5(null);
29049
+ const handleBuilderExit = useCallback2(
29050
+ (e, url) => {
29051
+ if (isBuilder) {
29052
+ e.preventDefault();
29053
+ setPendingUrl(url);
29054
+ setShowExitDialog(true);
29055
+ }
29056
+ },
29057
+ [isBuilder]
29058
+ );
29059
+ const confirmExit = () => {
29060
+ if (pendingUrl) {
29061
+ setShowExitDialog(false);
29062
+ router.push(pendingUrl);
29063
+ }
29064
+ };
28910
29065
  const renderDesktopTab = (tab, index) => {
28911
29066
  const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
28912
29067
  if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
28913
- return /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
28914
- /* @__PURE__ */ jsxs29(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
29068
+ return /* @__PURE__ */ jsxs30(DropdownMenu, { children: [
29069
+ /* @__PURE__ */ jsxs30(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
28915
29070
  tab.header,
28916
- /* @__PURE__ */ jsx51(ChevronDown, { className: "h-4 w-4 opacity-80" })
29071
+ /* @__PURE__ */ jsx52(ChevronDown, { className: "h-4 w-4 opacity-80" })
28917
29072
  ] }),
28918
- /* @__PURE__ */ jsx51(
29073
+ /* @__PURE__ */ jsx52(
28919
29074
  DropdownMenuContent,
28920
29075
  {
28921
29076
  align: "start",
28922
29077
  sideOffset: 6,
28923
29078
  className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
28924
- children: tab.children.map((item) => /* @__PURE__ */ jsx51(
29079
+ children: tab.children.map((item) => /* @__PURE__ */ jsx52(
28925
29080
  DropdownMenuItem,
28926
29081
  {
28927
29082
  asChild: true,
28928
29083
  className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
28929
- children: /* @__PURE__ */ jsx51(Link5, { href: item.url || "#", children: item.header })
29084
+ children: /* @__PURE__ */ jsx52(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
28930
29085
  },
28931
29086
  item.id
28932
29087
  ))
@@ -28934,14 +29089,24 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28934
29089
  )
28935
29090
  ] }, index);
28936
29091
  }
28937
- return tab.url ? /* @__PURE__ */ jsx51(Link5, { href: tab.url, className: finalClasses, style: tab.style, children: tab.header }, index) : /* @__PURE__ */ jsx51("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
29092
+ return tab.url ? /* @__PURE__ */ jsx52(
29093
+ Link5,
29094
+ {
29095
+ href: tab.url,
29096
+ className: finalClasses,
29097
+ style: tab.style,
29098
+ onClick: (e) => handleBuilderExit(e, tab.url || "#"),
29099
+ children: tab.header
29100
+ },
29101
+ index
29102
+ ) : /* @__PURE__ */ jsx52("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
28938
29103
  };
28939
- const renderMobileMenu = () => /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
28940
- /* @__PURE__ */ jsxs29(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
28941
- /* @__PURE__ */ jsx51(Menu, { className: "h-4 w-4" }),
29104
+ const renderMobileMenu = () => /* @__PURE__ */ jsxs30(DropdownMenu, { children: [
29105
+ /* @__PURE__ */ jsxs30(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
29106
+ /* @__PURE__ */ jsx52(Menu, { className: "h-4 w-4" }),
28942
29107
  "Menu"
28943
29108
  ] }),
28944
- /* @__PURE__ */ jsx51(
29109
+ /* @__PURE__ */ jsx52(
28945
29110
  DropdownMenuContent,
28946
29111
  {
28947
29112
  align: "start",
@@ -28950,25 +29115,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28950
29115
  children: rawTabs.map((tab, i) => {
28951
29116
  const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
28952
29117
  if (hasChildren) {
28953
- return /* @__PURE__ */ jsxs29(DropdownMenuSub, { children: [
28954
- /* @__PURE__ */ jsx51(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
28955
- /* @__PURE__ */ jsx51(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx51(
29118
+ return /* @__PURE__ */ jsxs30(DropdownMenuSub, { children: [
29119
+ /* @__PURE__ */ jsx52(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
29120
+ /* @__PURE__ */ jsx52(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx52(
28956
29121
  DropdownMenuItem,
28957
29122
  {
28958
29123
  asChild: true,
28959
29124
  className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
28960
- children: /* @__PURE__ */ jsx51(Link5, { href: item.url || "#", children: item.header })
29125
+ children: /* @__PURE__ */ jsx52(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
28961
29126
  },
28962
29127
  item.id
28963
29128
  )) })
28964
29129
  ] }, i);
28965
29130
  }
28966
- return /* @__PURE__ */ jsx51(
29131
+ return /* @__PURE__ */ jsx52(
28967
29132
  DropdownMenuItem,
28968
29133
  {
28969
29134
  asChild: true,
28970
29135
  className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
28971
- children: /* @__PURE__ */ jsx51(Link5, { href: tab.url || "#", children: tab.header })
29136
+ children: /* @__PURE__ */ jsx52(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
28972
29137
  },
28973
29138
  i
28974
29139
  );
@@ -28978,55 +29143,84 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28978
29143
  ] });
28979
29144
  const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
28980
29145
  const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
28981
- return /* @__PURE__ */ jsxs29("div", { className, style, children: [
28982
- forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
28983
- forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx51("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx51("div", { className: "flex md:hidden", children: renderMobileMenu() })
29146
+ return /* @__PURE__ */ jsxs30(Fragment18, { children: [
29147
+ /* @__PURE__ */ jsxs30("div", { className, style, children: [
29148
+ forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx52("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx52("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx52("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx52("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
29149
+ forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx52("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx52("div", { className: "flex md:hidden", children: renderMobileMenu() })
29150
+ ] }),
29151
+ /* @__PURE__ */ jsx52(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs30(DialogContent, { className: "bg-[#fff]", children: [
29152
+ /* @__PURE__ */ jsxs30(DialogHeader, { children: [
29153
+ /* @__PURE__ */ jsx52(DialogTitle, { children: "Exit Builder?" }),
29154
+ /* @__PURE__ */ jsx52(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
29155
+ ] }),
29156
+ /* @__PURE__ */ jsxs30(DialogFooter, { children: [
29157
+ /* @__PURE__ */ jsx52(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
29158
+ /* @__PURE__ */ jsx52(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
29159
+ ] })
29160
+ ] }) })
28984
29161
  ] });
28985
29162
  };
28986
29163
  var Tabs_default = Tabs;
28987
29164
 
28988
29165
  // src/components/Navigation/Stages/Stages.tsx
28989
29166
  import React8 from "react";
28990
- import { jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
28991
- var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
28992
- return /* @__PURE__ */ jsx52("div", { className, style, children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
28993
- /* @__PURE__ */ jsx52("div", { className: "flex items-center", children: /* @__PURE__ */ jsx52("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx52("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx52("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
28994
- /* @__PURE__ */ jsx52("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs30(React8.Fragment, { children: [
28995
- /* @__PURE__ */ jsx52(
29167
+ import { jsx as jsx53, jsxs as jsxs31 } from "react/jsx-runtime";
29168
+ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange }) => {
29169
+ return /* @__PURE__ */ jsx53("div", { className, style, children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
29170
+ /* @__PURE__ */ jsx53("div", { className: "flex items-center", children: /* @__PURE__ */ jsx53("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx53("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx53("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
29171
+ /* @__PURE__ */ jsx53("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs31(React8.Fragment, { children: [
29172
+ /* @__PURE__ */ jsx53(
28996
29173
  "button",
28997
29174
  {
28998
29175
  className: `min-w-[120px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap ${stage.isActive ? "bg-[#034486] text-white shadow-md" : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}`,
29176
+ onClick: () => {
29177
+ if (onStageChange) {
29178
+ onStageChange(stage.id);
29179
+ }
29180
+ },
28999
29181
  children: stage.header
29000
29182
  }
29001
29183
  ),
29002
- index < stages.length - 1 && /* @__PURE__ */ jsx52("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
29184
+ index < stages.length - 1 && /* @__PURE__ */ jsx53("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
29003
29185
  ] }, stage.id)) }),
29004
- isShowBtn && /* @__PURE__ */ jsx52("div", { className: "flex items-center", children: /* @__PURE__ */ jsx52("button", { className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm", children: buttonText }) })
29186
+ isShowBtn && /* @__PURE__ */ jsx53("div", { className: "flex items-center", children: /* @__PURE__ */ jsx53(
29187
+ "button",
29188
+ {
29189
+ className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
29190
+ onClick: () => {
29191
+ const activeStage = stages?.find((stage) => stage.isActive);
29192
+ if (activeStage && onStageChange) {
29193
+ onStageChange(activeStage.id);
29194
+ }
29195
+ },
29196
+ children: buttonText
29197
+ }
29198
+ ) })
29005
29199
  ] }) });
29006
29200
  };
29007
29201
  var Stages_default = StagesComponent;
29008
29202
 
29009
29203
  // src/components/Navigation/Spacer/Spacer.tsx
29010
- import { jsx as jsx53 } from "react/jsx-runtime";
29204
+ import { jsx as jsx54 } from "react/jsx-runtime";
29011
29205
  var Spacer = ({ className, style }) => {
29012
- return /* @__PURE__ */ jsx53("div", { className: `${className}`, style });
29206
+ return /* @__PURE__ */ jsx54("div", { className: `${className}`, style });
29013
29207
  };
29014
29208
  var Spacer_default = Spacer;
29015
29209
 
29016
29210
  // src/components/Navigation/Profile/Profile.tsx
29017
- import { jsx as jsx54, jsxs as jsxs31 } from "react/jsx-runtime";
29211
+ import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
29018
29212
 
29019
29213
  // src/components/Navigation/Notification/Notification.tsx
29020
- import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
29214
+ import { jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
29021
29215
 
29022
29216
  // src/components/Navigation/Logo/Logo.tsx
29023
- import { jsx as jsx56 } from "react/jsx-runtime";
29217
+ import { jsx as jsx57 } from "react/jsx-runtime";
29024
29218
 
29025
29219
  // src/components/ui/avatar.tsx
29026
29220
  import * as React9 from "react";
29027
29221
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
29028
- import { jsx as jsx57 } from "react/jsx-runtime";
29029
- var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
29222
+ import { jsx as jsx58 } from "react/jsx-runtime";
29223
+ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
29030
29224
  AvatarPrimitive.Root,
29031
29225
  {
29032
29226
  ref,
@@ -29038,7 +29232,7 @@ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
29038
29232
  }
29039
29233
  ));
29040
29234
  Avatar.displayName = AvatarPrimitive.Root.displayName;
29041
- var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
29235
+ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
29042
29236
  AvatarPrimitive.Image,
29043
29237
  {
29044
29238
  ref,
@@ -29047,7 +29241,7 @@ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
29047
29241
  }
29048
29242
  ));
29049
29243
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
29050
- var AvatarFallback = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
29244
+ var AvatarFallback = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
29051
29245
  AvatarPrimitive.Fallback,
29052
29246
  {
29053
29247
  ref,
@@ -29063,8 +29257,10 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
29063
29257
  // src/components/Navigation/Navbar/Navbar.tsx
29064
29258
  import Link6 from "next/link";
29065
29259
  import Image3 from "next/image";
29260
+ import { useRouter as useRouter2 } from "next/navigation";
29066
29261
  import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
29067
- import { Fragment as Fragment18, jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
29262
+ import { useCallback as useCallback3, useMemo as useMemo3, useState as useState6 } from "react";
29263
+ import { Fragment as Fragment19, jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
29068
29264
  function Navbar({
29069
29265
  style,
29070
29266
  badgeType,
@@ -29077,77 +29273,131 @@ function Navbar({
29077
29273
  canvasMode = "desktop",
29078
29274
  list = [],
29079
29275
  profileMenu = [],
29080
- userName = "Guest User"
29276
+ userName = "Guest User",
29277
+ isBuilder = true,
29278
+ source,
29279
+ navList
29081
29280
  }) {
29082
29281
  const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
29083
- return /* @__PURE__ */ jsx58("nav", { className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm", style, children: /* @__PURE__ */ jsxs33("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
29084
- /* @__PURE__ */ jsx58(Link6, { href: "/", className: "flex items-center space-x-2", children: imageUrl ? /* @__PURE__ */ jsx58(Image3, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx58("span", { className: "font-semibold text-blue-700", children: "Logo" }) }),
29085
- !isMobileView && /* @__PURE__ */ jsx58("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: list.map((item) => /* @__PURE__ */ jsx58(
29086
- Link6,
29282
+ const router = useRouter2();
29283
+ const [showExitDialog, setShowExitDialog] = useState6(false);
29284
+ const [pendingUrl, setPendingUrl] = useState6(null);
29285
+ const handleBuilderExit = useCallback3(
29286
+ (e, url) => {
29287
+ if (isBuilder) {
29288
+ e.preventDefault();
29289
+ setPendingUrl(url);
29290
+ setShowExitDialog(true);
29291
+ }
29292
+ },
29293
+ [isBuilder]
29294
+ );
29295
+ const confirmExit = () => {
29296
+ if (pendingUrl) {
29297
+ setShowExitDialog(false);
29298
+ router.push(pendingUrl);
29299
+ }
29300
+ };
29301
+ const formatedMenu = useMemo3(() => {
29302
+ if (source === "state" && navList && navList.length) {
29303
+ return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
29304
+ }
29305
+ return list || [];
29306
+ }, [source, navList]);
29307
+ return /* @__PURE__ */ jsxs34(Fragment19, { children: [
29308
+ /* @__PURE__ */ jsx59(
29309
+ "nav",
29087
29310
  {
29088
- href: item.url || "#",
29089
- className: "text-sm font-medium dark:text-white text-gray-600 hover:text-gray-900 transition-colors",
29090
- children: item.header
29091
- },
29092
- item.id
29093
- )) }),
29094
- /* @__PURE__ */ jsxs33("div", { className: "flex items-center space-x-3", children: [
29095
- !isMobileView ? /* @__PURE__ */ jsx58("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs33("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
29096
- /* @__PURE__ */ jsx58(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
29097
- /* @__PURE__ */ jsx58(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
29098
- ] }) }) : /* @__PURE__ */ jsx58(
29099
- Button,
29100
- {
29101
- variant: "ghost",
29102
- size: "icon",
29103
- className: "border border-gray-400",
29104
- children: /* @__PURE__ */ jsx58(Search, { className: "h-5 w-5 text-gray-400" })
29105
- }
29106
- ),
29107
- /* @__PURE__ */ jsxs33("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
29108
- /* @__PURE__ */ jsx58(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx58(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
29109
- badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx58("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ jsx58("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
29110
- ] }),
29111
- /* @__PURE__ */ jsxs33(DropdownMenu, { children: [
29112
- /* @__PURE__ */ jsx58(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center space-x-2", children: [
29113
- !isMobileView && showName && /* @__PURE__ */ jsx58("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
29114
- !isMobileView ? /* @__PURE__ */ jsxs33(Fragment18, { children: [
29115
- /* @__PURE__ */ jsx58(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx58(
29116
- AvatarImage,
29117
- {
29118
- src: "/images/appbuilder/toolset/profile.svg",
29119
- alt: "Profile"
29120
- }
29121
- ) : /* @__PURE__ */ jsx58("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
29122
- /* @__PURE__ */ jsx58(
29123
- Button,
29124
- {
29125
- variant: "ghost",
29126
- size: "icon",
29127
- className: "text-gray-900 md:hidden dark:invert",
29128
- children: /* @__PURE__ */ jsx58(Menu, { className: "h-6 w-6" })
29129
- }
29130
- )
29131
- ] }) : /* @__PURE__ */ jsx58(
29132
- Button,
29311
+ className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
29312
+ style,
29313
+ children: /* @__PURE__ */ jsxs34("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
29314
+ /* @__PURE__ */ jsx59(
29315
+ Link6,
29133
29316
  {
29134
- variant: "ghost",
29135
- size: "icon",
29136
- className: "text-gray-900 dark:invert",
29137
- children: /* @__PURE__ */ jsx58(Menu, { className: "h-6 w-6" })
29317
+ href: "/",
29318
+ onClick: (e) => handleBuilderExit(e, "/"),
29319
+ className: "flex items-center space-x-2",
29320
+ children: imageUrl ? /* @__PURE__ */ jsx59(Image3, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx59("span", { className: "font-semibold text-blue-700", children: "Logo" })
29138
29321
  }
29139
- )
29140
- ] }) }),
29141
- /* @__PURE__ */ jsxs33(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
29142
- profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx58(Fragment18, { children: profileMenu.map((item) => /* @__PURE__ */ jsx58(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx58(Link6, { href: item.url || "#", children: item.header }) }, item.id)) }),
29143
- /* @__PURE__ */ jsxs33("div", { className: "md:hidden", children: [
29144
- /* @__PURE__ */ jsx58(DropdownMenuSeparator, {}),
29145
- list && list.length > 0 && /* @__PURE__ */ jsx58(Fragment18, { children: list.map((item) => /* @__PURE__ */ jsx58(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx58(Link6, { href: item.url || "#", children: item.header }) }, item.id)) })
29322
+ ),
29323
+ !isMobileView && /* @__PURE__ */ jsx59("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx59(
29324
+ Link6,
29325
+ {
29326
+ href: item.url || "#",
29327
+ onClick: (e) => handleBuilderExit(e, item.url),
29328
+ className: "text-sm font-medium dark:text-white text-gray-600 hover:text-gray-900 transition-colors",
29329
+ children: item.header
29330
+ },
29331
+ item.id
29332
+ )) }),
29333
+ /* @__PURE__ */ jsxs34("div", { className: "flex items-center space-x-3", children: [
29334
+ !isMobileView ? /* @__PURE__ */ jsx59("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs34("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
29335
+ /* @__PURE__ */ jsx59(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
29336
+ /* @__PURE__ */ jsx59(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
29337
+ ] }) }) : /* @__PURE__ */ jsx59(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx59(Search, { className: "h-5 w-5 text-gray-400" }) }),
29338
+ /* @__PURE__ */ jsxs34("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
29339
+ /* @__PURE__ */ jsx59(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx59(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
29340
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx59("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ jsx59("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
29341
+ ] }),
29342
+ /* @__PURE__ */ jsxs34(DropdownMenu, { children: [
29343
+ /* @__PURE__ */ jsx59(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs34("div", { className: "flex items-center space-x-2", children: [
29344
+ !isMobileView && showName && /* @__PURE__ */ jsx59("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
29345
+ !isMobileView ? /* @__PURE__ */ jsxs34(Fragment19, { children: [
29346
+ /* @__PURE__ */ jsx59(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx59(
29347
+ AvatarImage,
29348
+ {
29349
+ src: "/images/appbuilder/toolset/profile.svg",
29350
+ alt: "Profile"
29351
+ }
29352
+ ) : /* @__PURE__ */ jsx59("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
29353
+ /* @__PURE__ */ jsx59(
29354
+ Button,
29355
+ {
29356
+ variant: "ghost",
29357
+ size: "icon",
29358
+ className: "text-gray-900 md:hidden dark:invert",
29359
+ children: /* @__PURE__ */ jsx59(Menu, { className: "h-6 w-6" })
29360
+ }
29361
+ )
29362
+ ] }) : /* @__PURE__ */ jsx59(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx59(Menu, { className: "h-6 w-6" }) })
29363
+ ] }) }),
29364
+ /* @__PURE__ */ jsxs34(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
29365
+ profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx59(Fragment19, { children: profileMenu.map((item) => /* @__PURE__ */ jsx59(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx59(
29366
+ Link6,
29367
+ {
29368
+ href: item.url || "#",
29369
+ onClick: (e) => handleBuilderExit(e, item.url),
29370
+ children: item.header
29371
+ }
29372
+ ) }, item.id)) }),
29373
+ /* @__PURE__ */ jsxs34("div", { className: "md:hidden", children: [
29374
+ /* @__PURE__ */ jsx59(DropdownMenuSeparator, {}),
29375
+ formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx59(Fragment19, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx59(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx59(
29376
+ Link6,
29377
+ {
29378
+ href: item.url || "#",
29379
+ onClick: (e) => handleBuilderExit(e, item.url),
29380
+ children: item.header
29381
+ }
29382
+ ) }, item.id)) })
29383
+ ] })
29384
+ ] })
29385
+ ] })
29146
29386
  ] })
29147
29387
  ] })
29388
+ }
29389
+ ),
29390
+ /* @__PURE__ */ jsx59(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs34(DialogContent, { className: "bg-[#fff]", children: [
29391
+ /* @__PURE__ */ jsxs34(DialogHeader, { children: [
29392
+ /* @__PURE__ */ jsx59(DialogTitle, { children: "Exit Builder?" }),
29393
+ /* @__PURE__ */ jsx59(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
29394
+ ] }),
29395
+ /* @__PURE__ */ jsxs34(DialogFooter, { children: [
29396
+ /* @__PURE__ */ jsx59(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
29397
+ /* @__PURE__ */ jsx59(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
29148
29398
  ] })
29149
- ] })
29150
- ] }) });
29399
+ ] }) })
29400
+ ] });
29151
29401
  }
29152
29402
 
29153
29403
  // src/components/Chart/BarChart.tsx
@@ -29164,35 +29414,35 @@ import {
29164
29414
  ResponsiveContainer,
29165
29415
  Legend
29166
29416
  } from "recharts";
29167
- import { jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
29417
+ import { jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
29168
29418
  var ChartComponent = ({ className, style, loading, ...props }) => {
29169
29419
  const data = Array.isArray(props.data) ? props.data : [];
29170
29420
  const chartType = props.chartType || "bar";
29171
29421
  const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
29172
29422
  if (loading || data.length === 0) {
29173
- return /* @__PURE__ */ jsx59(
29423
+ return /* @__PURE__ */ jsx60(
29174
29424
  "div",
29175
29425
  {
29176
29426
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
29177
29427
  style,
29178
- children: /* @__PURE__ */ jsx59("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29428
+ children: /* @__PURE__ */ jsx60("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29179
29429
  }
29180
29430
  );
29181
29431
  }
29182
- return /* @__PURE__ */ jsx59("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx59(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs34(BarChart, { data, title: "Leads", desc: "content", children: [
29183
- /* @__PURE__ */ jsx59(CartesianGrid, { strokeDasharray: "3 3" }),
29184
- /* @__PURE__ */ jsx59(XAxis, { dataKey: "name" }),
29185
- /* @__PURE__ */ jsx59(YAxis, {}),
29186
- /* @__PURE__ */ jsx59(Tooltip, { formatter: (value) => `${value}k` }),
29187
- /* @__PURE__ */ jsx59(Legend, { verticalAlign: legendsPosition, align: "center" }),
29188
- /* @__PURE__ */ jsx59(
29432
+ return /* @__PURE__ */ jsx60("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx60(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs35(BarChart, { data, title: "Leads", desc: "content", children: [
29433
+ /* @__PURE__ */ jsx60(CartesianGrid, { strokeDasharray: "3 3" }),
29434
+ /* @__PURE__ */ jsx60(XAxis, { dataKey: "name" }),
29435
+ /* @__PURE__ */ jsx60(YAxis, {}),
29436
+ /* @__PURE__ */ jsx60(Tooltip, { formatter: (value) => `${value}k` }),
29437
+ /* @__PURE__ */ jsx60(Legend, { verticalAlign: legendsPosition, align: "center" }),
29438
+ /* @__PURE__ */ jsx60(
29189
29439
  Bar,
29190
29440
  {
29191
29441
  dataKey: "value",
29192
29442
  fill: "#00695C",
29193
29443
  radius: [6, 6, 0, 0],
29194
29444
  isAnimationActive: false,
29195
- children: data.map((entry, index) => /* @__PURE__ */ jsx59(
29445
+ children: data.map((entry, index) => /* @__PURE__ */ jsx60(
29196
29446
  "rect",
29197
29447
  {
29198
29448
  fill: entry.color || "#00695C"
@@ -29201,16 +29451,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
29201
29451
  ))
29202
29452
  }
29203
29453
  )
29204
- ] }) : /* @__PURE__ */ jsxs34(AreaChart, { data, children: [
29205
- /* @__PURE__ */ jsx59("defs", { children: /* @__PURE__ */ jsxs34("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
29206
- /* @__PURE__ */ jsx59("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
29207
- /* @__PURE__ */ jsx59("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
29454
+ ] }) : /* @__PURE__ */ jsxs35(AreaChart, { data, children: [
29455
+ /* @__PURE__ */ jsx60("defs", { children: /* @__PURE__ */ jsxs35("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
29456
+ /* @__PURE__ */ jsx60("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
29457
+ /* @__PURE__ */ jsx60("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
29208
29458
  ] }) }),
29209
- /* @__PURE__ */ jsx59(CartesianGrid, { strokeDasharray: "3 3" }),
29210
- /* @__PURE__ */ jsx59(XAxis, { dataKey: "name" }),
29211
- /* @__PURE__ */ jsx59(YAxis, {}),
29212
- /* @__PURE__ */ jsx59(Tooltip, { formatter: (value) => `${value}k` }),
29213
- /* @__PURE__ */ jsx59(
29459
+ /* @__PURE__ */ jsx60(CartesianGrid, { strokeDasharray: "3 3" }),
29460
+ /* @__PURE__ */ jsx60(XAxis, { dataKey: "name" }),
29461
+ /* @__PURE__ */ jsx60(YAxis, {}),
29462
+ /* @__PURE__ */ jsx60(Tooltip, { formatter: (value) => `${value}k` }),
29463
+ /* @__PURE__ */ jsx60(
29214
29464
  Area,
29215
29465
  {
29216
29466
  type: "monotone",
@@ -29226,7 +29476,7 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
29226
29476
  var BarChart_default = React10.memo(ChartComponent);
29227
29477
 
29228
29478
  // src/components/Chart/PieChart.tsx
29229
- import React11, { useMemo as useMemo3 } from "react";
29479
+ import React11, { useEffect as useEffect22, useMemo as useMemo4, useState as useState7 } from "react";
29230
29480
  import {
29231
29481
  PieChart,
29232
29482
  Pie,
@@ -29235,7 +29485,7 @@ import {
29235
29485
  Tooltip as Tooltip2,
29236
29486
  LabelList
29237
29487
  } from "recharts";
29238
- import { Fragment as Fragment19, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
29488
+ import { Fragment as Fragment20, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
29239
29489
  var getRandomColor = () => {
29240
29490
  const palette = [
29241
29491
  "#2563eb",
@@ -29255,51 +29505,57 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29255
29505
  const showLegends = props.showLegends ?? true;
29256
29506
  const labelType = props.labelType || "inside";
29257
29507
  const canvasMode = props.canvasMode;
29258
- const data = useMemo3(() => {
29508
+ const data = useMemo4(() => {
29259
29509
  if (!Array.isArray(props.data)) return [];
29260
29510
  return props.data.map((item) => ({ ...item, color: getRandomColor() }));
29261
29511
  }, [props.data]);
29262
- const total = useMemo3(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
29512
+ const total = useMemo4(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
29263
29513
  const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
29264
- const renderLegends = useMemo3(() => {
29514
+ const [mounted, setMounted] = useState7(false);
29515
+ useEffect22(() => {
29516
+ const timeout = setTimeout(() => setMounted(true), 100);
29517
+ return () => clearTimeout(timeout);
29518
+ }, []);
29519
+ const renderLegends = useMemo4(() => {
29265
29520
  if (!showLegends) return null;
29266
- return /* @__PURE__ */ jsx60(Fragment19, { children: data.map((d) => /* @__PURE__ */ jsxs35(
29521
+ return /* @__PURE__ */ jsx61(Fragment20, { children: data.map((d) => /* @__PURE__ */ jsxs36(
29267
29522
  "div",
29268
29523
  {
29269
29524
  className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
29270
29525
  children: [
29271
- /* @__PURE__ */ jsx60(
29526
+ /* @__PURE__ */ jsx61(
29272
29527
  "span",
29273
29528
  {
29274
29529
  className: "inline-block w-[16px] h-[16px] rounded",
29275
29530
  style: { backgroundColor: d.color }
29276
29531
  }
29277
29532
  ),
29278
- /* @__PURE__ */ jsx60("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
29533
+ /* @__PURE__ */ jsx61("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
29279
29534
  ]
29280
29535
  },
29281
29536
  d.name
29282
29537
  )) });
29283
29538
  }, [data, showLegends]);
29539
+ if (!mounted) return null;
29284
29540
  if (loading || data.length === 0) {
29285
- return /* @__PURE__ */ jsx60(
29541
+ return /* @__PURE__ */ jsx61(
29286
29542
  "div",
29287
29543
  {
29288
29544
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
29289
29545
  style,
29290
- children: /* @__PURE__ */ jsx60("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29546
+ children: /* @__PURE__ */ jsx61("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29291
29547
  }
29292
29548
  );
29293
29549
  }
29294
- return /* @__PURE__ */ jsxs35(
29550
+ return /* @__PURE__ */ jsxs36(
29295
29551
  "div",
29296
29552
  {
29297
29553
  className: `relative flex flex-col items-center ${className}`,
29298
29554
  style,
29299
29555
  children: [
29300
- /* @__PURE__ */ jsxs35("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
29301
- /* @__PURE__ */ jsx60(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs35(PieChart, { children: [
29302
- /* @__PURE__ */ jsxs35(
29556
+ /* @__PURE__ */ jsxs36("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
29557
+ /* @__PURE__ */ jsx61(ResponsiveContainer2, { width: "99%", height: "100%", children: /* @__PURE__ */ jsxs36(PieChart, { children: [
29558
+ /* @__PURE__ */ jsxs36(
29303
29559
  Pie,
29304
29560
  {
29305
29561
  data,
@@ -29311,8 +29567,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29311
29567
  labelLine: false,
29312
29568
  isAnimationActive: false,
29313
29569
  children: [
29314
- data.map((entry, index) => /* @__PURE__ */ jsx60(Cell, { fill: entry.color }, `cell-${index}`)),
29315
- /* @__PURE__ */ jsx60(
29570
+ data.map((entry, index) => /* @__PURE__ */ jsx61(Cell, { fill: entry.color }, `cell-${index}`)),
29571
+ /* @__PURE__ */ jsx61(
29316
29572
  LabelList,
29317
29573
  {
29318
29574
  dataKey: "value",
@@ -29325,14 +29581,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29325
29581
  ]
29326
29582
  }
29327
29583
  ),
29328
- /* @__PURE__ */ jsx60(
29584
+ /* @__PURE__ */ jsx61(
29329
29585
  Tooltip2,
29330
29586
  {
29331
29587
  formatter: (value, name) => [`${value}k`, name]
29332
29588
  }
29333
29589
  )
29334
29590
  ] }) }),
29335
- /* @__PURE__ */ jsxs35(
29591
+ /* @__PURE__ */ jsxs36(
29336
29592
  "div",
29337
29593
  {
29338
29594
  className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ${forceMobile ? "text-2xl" : "text-4xl"} font-bold text-[#000]`,
@@ -29343,7 +29599,7 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29343
29599
  }
29344
29600
  )
29345
29601
  ] }),
29346
- /* @__PURE__ */ jsx60("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
29602
+ /* @__PURE__ */ jsx61("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
29347
29603
  ]
29348
29604
  }
29349
29605
  );
@@ -29351,10 +29607,10 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29351
29607
  var PieChart_default = React11.memo(DonutChart);
29352
29608
 
29353
29609
  // src/components/Blocks/EmailComposer.tsx
29354
- import { jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
29610
+ import { jsx as jsx62, jsxs as jsxs37 } from "react/jsx-runtime";
29355
29611
  function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
29356
- return /* @__PURE__ */ jsx61("div", { className, style, children: /* @__PURE__ */ jsxs36("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
29357
- /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29612
+ return /* @__PURE__ */ jsx62("div", { className, style, children: /* @__PURE__ */ jsxs37("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
29613
+ /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29358
29614
  "input",
29359
29615
  {
29360
29616
  type: "email",
@@ -29363,8 +29619,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29363
29619
  required: true
29364
29620
  }
29365
29621
  ) }),
29366
- /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
29367
- /* @__PURE__ */ jsx61(
29622
+ /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2", children: [
29623
+ /* @__PURE__ */ jsx62(
29368
29624
  "input",
29369
29625
  {
29370
29626
  type: "email",
@@ -29375,7 +29631,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29375
29631
  required: true
29376
29632
  }
29377
29633
  ),
29378
- !showCc && /* @__PURE__ */ jsx61(
29634
+ !showCc && /* @__PURE__ */ jsx62(
29379
29635
  "button",
29380
29636
  {
29381
29637
  onClick: () => setShowCc?.(true),
@@ -29383,7 +29639,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29383
29639
  children: "Cc"
29384
29640
  }
29385
29641
  ),
29386
- !showBcc && /* @__PURE__ */ jsx61(
29642
+ !showBcc && /* @__PURE__ */ jsx62(
29387
29643
  "button",
29388
29644
  {
29389
29645
  onClick: () => setShowBcc?.(true),
@@ -29392,7 +29648,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29392
29648
  }
29393
29649
  )
29394
29650
  ] }) }),
29395
- showCc && /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29651
+ showCc && /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29396
29652
  "input",
29397
29653
  {
29398
29654
  type: "text",
@@ -29402,7 +29658,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29402
29658
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
29403
29659
  }
29404
29660
  ) }),
29405
- showBcc && /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29661
+ showBcc && /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29406
29662
  "input",
29407
29663
  {
29408
29664
  type: "text",
@@ -29412,7 +29668,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29412
29668
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
29413
29669
  }
29414
29670
  ) }),
29415
- /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29671
+ /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29416
29672
  "input",
29417
29673
  {
29418
29674
  type: "text",
@@ -29422,11 +29678,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29422
29678
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
29423
29679
  }
29424
29680
  ) }),
29425
- /* @__PURE__ */ jsx61("div", { className: "mb-4", children: /* @__PURE__ */ jsx61(MyEditor, { value: body, onChange: setBody }) }),
29426
- /* @__PURE__ */ jsxs36("div", { className: "flex justify-end gap-2", children: [
29427
- /* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
29428
- /* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
29429
- /* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
29681
+ /* @__PURE__ */ jsx62("div", { className: "mb-4", children: /* @__PURE__ */ jsx62(MyEditor, { value: body, onChange: setBody }) }),
29682
+ /* @__PURE__ */ jsxs37("div", { className: "flex justify-end gap-2", children: [
29683
+ /* @__PURE__ */ jsx62("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
29684
+ /* @__PURE__ */ jsx62("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
29685
+ /* @__PURE__ */ jsx62("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
29430
29686
  ] })
29431
29687
  ] }) });
29432
29688
  }
@@ -29471,10 +29727,10 @@ function showSonnerToast({
29471
29727
  // src/components/ui/sonner.tsx
29472
29728
  import { useTheme } from "next-themes";
29473
29729
  import { Toaster as Sonner } from "sonner";
29474
- import { jsx as jsx62 } from "react/jsx-runtime";
29730
+ import { jsx as jsx63 } from "react/jsx-runtime";
29475
29731
  var Toaster = ({ ...props }) => {
29476
29732
  const { theme = "system" } = useTheme();
29477
- return /* @__PURE__ */ jsx62(
29733
+ return /* @__PURE__ */ jsx63(
29478
29734
  Sonner,
29479
29735
  {
29480
29736
  theme,