@algorithm-shift/design-system 1.2.995 → 1.2.996

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
@@ -3164,7 +3164,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
3164
3164
  var TextInputGroup_default = TextInputGroup;
3165
3165
 
3166
3166
  // src/components/Inputs/Multiselect/MultiSelect.tsx
3167
- import { useState as useState10, useRef as useRef7, useEffect as useEffect25, useMemo as useMemo5 } from "react";
3167
+ import { useState as useState10, useRef as useRef7, useEffect as useEffect25, useMemo as useMemo5, useCallback as useCallback3 } from "react";
3168
3168
  import { XIcon, XSquareIcon as XSquareIcon3 } from "lucide-react";
3169
3169
  import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
3170
3170
  function LazyMultiSelectDropdown({
@@ -3187,6 +3187,7 @@ function LazyMultiSelectDropdown({
3187
3187
  }) {
3188
3188
  const [isOpen, setIsOpen] = useState10(false);
3189
3189
  const [searchTerm, setSearchTerm] = useState10("");
3190
+ const [selectedDetails, setSelectedDetails] = useState10({});
3190
3191
  const dropdownRef = useRef7(null);
3191
3192
  const observerTarget = useRef7(null);
3192
3193
  const ensureUnique = (arr) => {
@@ -3238,8 +3239,28 @@ function LazyMultiSelectDropdown({
3238
3239
  }
3239
3240
  };
3240
3241
  const selectedOptions = useMemo5(() => {
3241
- return lazyOptions.filter((opt) => normalizedValue.includes(opt.value));
3242
- }, [lazyOptions, normalizedValue]);
3242
+ return normalizedValue.map((id2) => {
3243
+ const fromLazy = lazyOptions.find((opt) => opt.value === id2);
3244
+ if (fromLazy) return fromLazy;
3245
+ if (selectedDetails[id2]) return selectedDetails[id2];
3246
+ return { value: id2, label: id2 };
3247
+ });
3248
+ }, [normalizedValue, lazyOptions, selectedDetails]);
3249
+ useEffect25(() => {
3250
+ const newDetails = { ...selectedDetails };
3251
+ normalizedValue.forEach((id2) => {
3252
+ const option = lazyOptions.find((opt) => opt.value === id2);
3253
+ if (option && !newDetails[id2]) {
3254
+ newDetails[id2] = option;
3255
+ }
3256
+ });
3257
+ Object.keys(newDetails).forEach((key) => {
3258
+ if (!normalizedValue.includes(key)) {
3259
+ delete newDetails[key];
3260
+ }
3261
+ });
3262
+ setSelectedDetails(newDetails);
3263
+ }, [normalizedValue, lazyOptions]);
3243
3264
  useEffect25(() => {
3244
3265
  const handleClick = (e) => {
3245
3266
  if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
@@ -3265,7 +3286,7 @@ function LazyMultiSelectDropdown({
3265
3286
  setSearchTerm(term);
3266
3287
  search(term);
3267
3288
  };
3268
- const toggleSelect = (val) => {
3289
+ const toggleSelect = useCallback3((val) => {
3269
3290
  let updated;
3270
3291
  if (normalizedValue.includes(val)) {
3271
3292
  updated = normalizedValue.filter((v) => v !== val);
@@ -3273,14 +3294,18 @@ function LazyMultiSelectDropdown({
3273
3294
  updated = ensureUnique([...normalizedValue, val]);
3274
3295
  }
3275
3296
  onChange?.(convertOutput(updated), id);
3276
- };
3297
+ }, [normalizedValue, onChange, id, convertOutput]);
3277
3298
  const removeTag = (val) => {
3278
3299
  const updated = normalizedValue.filter((v) => v !== val);
3279
3300
  onChange?.(convertOutput(updated), id);
3280
3301
  };
3281
3302
  const handleFocus = () => {
3282
- if (!disabled) setIsOpen(true);
3283
- if (lazyOptions.length === 0) loadPage(1, "");
3303
+ if (!disabled) {
3304
+ setIsOpen(true);
3305
+ if (lazyOptions.length === 0) {
3306
+ loadPage(1, "");
3307
+ }
3308
+ }
3284
3309
  };
3285
3310
  return /* @__PURE__ */ jsxs28("div", { ref: dropdownRef, className: "relative w-full", children: [
3286
3311
  /* @__PURE__ */ jsxs28(
@@ -3923,9 +3948,9 @@ function DataTable({
3923
3948
  setLocalPageSize(newSize);
3924
3949
  };
3925
3950
  const pageSizeOptions = React10.useMemo(() => {
3926
- const options = [10, 20, 50, 100].filter((size) => size < totalRecords);
3951
+ const options = [5, 10, 20, 50, 100].filter((size) => size < totalRecords);
3927
3952
  if (options.length === 0) {
3928
- options.push(10);
3953
+ options.push(5);
3929
3954
  }
3930
3955
  return options;
3931
3956
  }, [totalRecords]);
@@ -4688,7 +4713,7 @@ var HistoryTimeline = ({
4688
4713
  var HistoryTimeline_default = HistoryTimeline;
4689
4714
 
4690
4715
  // src/components/Navigation/Tabs/Tabs.tsx
4691
- import { useCallback as useCallback3, useMemo as useMemo8, useState as useState12 } from "react";
4716
+ import { useCallback as useCallback4, useMemo as useMemo8, useState as useState12 } from "react";
4692
4717
  import { ChevronDown as ChevronDown2, Menu } from "lucide-react";
4693
4718
  import Link3 from "next/link";
4694
4719
  import { usePathname, useRouter } from "next/navigation";
@@ -4915,7 +4940,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
4915
4940
  const router = useRouter();
4916
4941
  const [showExitDialog, setShowExitDialog] = useState12(false);
4917
4942
  const [pendingUrl, setPendingUrl] = useState12(null);
4918
- const handleBuilderExit = useCallback3(
4943
+ const handleBuilderExit = useCallback4(
4919
4944
  (e, url) => {
4920
4945
  if (isBuilder) {
4921
4946
  e.preventDefault();
@@ -5083,7 +5108,59 @@ var Tabs_default = Tabs;
5083
5108
 
5084
5109
  // src/components/Navigation/Stages/Stages.tsx
5085
5110
  import React11, { useEffect as useEffect26, useState as useState13 } from "react";
5111
+
5112
+ // src/components/ui/tooltip.tsx
5113
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
5086
5114
  import { jsx as jsx60, jsxs as jsxs37 } from "react/jsx-runtime";
5115
+ function TooltipProvider({
5116
+ delayDuration = 0,
5117
+ ...props
5118
+ }) {
5119
+ return /* @__PURE__ */ jsx60(
5120
+ TooltipPrimitive.Provider,
5121
+ {
5122
+ "data-slot": "tooltip-provider",
5123
+ delayDuration,
5124
+ ...props
5125
+ }
5126
+ );
5127
+ }
5128
+ function Tooltip({
5129
+ ...props
5130
+ }) {
5131
+ return /* @__PURE__ */ jsx60(TooltipProvider, { children: /* @__PURE__ */ jsx60(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
5132
+ }
5133
+ function TooltipTrigger({
5134
+ ...props
5135
+ }) {
5136
+ return /* @__PURE__ */ jsx60(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
5137
+ }
5138
+ function TooltipContent({
5139
+ className,
5140
+ sideOffset = 0,
5141
+ children,
5142
+ ...props
5143
+ }) {
5144
+ return /* @__PURE__ */ jsx60(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs37(
5145
+ TooltipPrimitive.Content,
5146
+ {
5147
+ "data-slot": "tooltip-content",
5148
+ sideOffset,
5149
+ className: cn(
5150
+ "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
5151
+ className
5152
+ ),
5153
+ ...props,
5154
+ children: [
5155
+ children,
5156
+ /* @__PURE__ */ jsx60(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
5157
+ ]
5158
+ }
5159
+ ) });
5160
+ }
5161
+
5162
+ // src/components/Navigation/Stages/Stages.tsx
5163
+ import { jsx as jsx61, jsxs as jsxs38 } from "react/jsx-runtime";
5087
5164
  var StagesComponent = ({
5088
5165
  stages,
5089
5166
  isShowBtn,
@@ -5101,6 +5178,8 @@ var StagesComponent = ({
5101
5178
  }) => {
5102
5179
  const [activeStage, setActiveStage] = useState13("");
5103
5180
  const [isCompleted, setIsCompleted] = useState13(false);
5181
+ const [activeChildStage, setActiveChildStage] = useState13(null);
5182
+ const [activeRootStage, setActiveRootStage] = useState13(null);
5104
5183
  useEffect26(() => {
5105
5184
  if (currentStage) {
5106
5185
  setActiveStage(currentStage);
@@ -5111,6 +5190,9 @@ var StagesComponent = ({
5111
5190
  const updateStage = (stageKey) => {
5112
5191
  setActiveStage(stageKey);
5113
5192
  onStageChange?.(stageKey);
5193
+ const { activeRoot, activeChild } = findStageContext(stages, stageKey);
5194
+ setActiveRootStage(activeRoot);
5195
+ setActiveChildStage(activeChild);
5114
5196
  };
5115
5197
  const nextStage = () => {
5116
5198
  if (!stages || stages.length === 0) return;
@@ -5136,9 +5218,41 @@ var StagesComponent = ({
5136
5218
  onStageChange?.(stageKey);
5137
5219
  }
5138
5220
  };
5139
- const isAllStagesCompleted = isCompleted || currentStage === lastStage;
5221
+ const findStageContext = (nodes, curr, root = null) => {
5222
+ if (!nodes || nodes.length === 0) {
5223
+ return { activeRoot: null, activeChild: null };
5224
+ }
5225
+ if (!Array.isArray(nodes)) {
5226
+ return { activeRoot: null, activeChild: null };
5227
+ }
5228
+ for (const node of nodes) {
5229
+ const currentRoot = root ?? node;
5230
+ if (node?.[dataKey] === curr) {
5231
+ return {
5232
+ activeRoot: root ?? node,
5233
+ activeChild: node
5234
+ };
5235
+ }
5236
+ const result = findStageContext(node?.children, curr, currentRoot);
5237
+ if (result.activeChild) {
5238
+ return result;
5239
+ }
5240
+ }
5241
+ return { activeRoot: null, activeChild: null };
5242
+ };
5243
+ useEffect26(() => {
5244
+ if (!currentStage || !Array.isArray(stages)) {
5245
+ setActiveRootStage(null);
5246
+ setActiveChildStage(null);
5247
+ return;
5248
+ }
5249
+ const { activeRoot, activeChild } = findStageContext(stages, currentStage);
5250
+ setActiveRootStage(activeRoot);
5251
+ setActiveChildStage(activeChild);
5252
+ }, [currentStage, stages]);
5253
+ const isAllStagesCompleted = isCompleted || activeRootStage?.[dataKey] === lastStage;
5140
5254
  const disabled = isAllStagesCompleted || loading || saving;
5141
- return /* @__PURE__ */ jsx60("div", { className, style, children: /* @__PURE__ */ jsxs37(
5255
+ return /* @__PURE__ */ jsx61("div", { className, style, children: /* @__PURE__ */ jsxs38(
5142
5256
  "div",
5143
5257
  {
5144
5258
  className: `
@@ -5148,8 +5262,8 @@ var StagesComponent = ({
5148
5262
  ${isMobile ? "p-3 sm:p-4" : "p-2"}
5149
5263
  `,
5150
5264
  children: [
5151
- /* @__PURE__ */ jsx60("div", { className: "flex items-center flex-shrink-0 order-1 lg:order-1", children: /* @__PURE__ */ jsx60("button", { className: "p-2 hover:bg-gray-100 rounded flex-shrink-0", children: /* @__PURE__ */ jsx60("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx60("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
5152
- /* @__PURE__ */ jsx60(
5265
+ /* @__PURE__ */ jsx61("div", { className: "flex items-center flex-shrink-0 order-1 lg:order-1", children: /* @__PURE__ */ jsx61("button", { className: "p-2 hover:bg-gray-100 rounded flex-shrink-0", children: /* @__PURE__ */ jsx61("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx61("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
5266
+ /* @__PURE__ */ jsx61(
5153
5267
  "div",
5154
5268
  {
5155
5269
  className: `
@@ -5157,7 +5271,7 @@ var StagesComponent = ({
5157
5271
  flex-wrap gap-2 sm:gap-2 lg:gap-3 w-full lg:w-auto
5158
5272
  ${isMobile ? "order-2 mt-2 lg:mt-0" : "order-2"}
5159
5273
  `,
5160
- children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ jsx60(
5274
+ children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ jsx61(
5161
5275
  "button",
5162
5276
  {
5163
5277
  className: `
@@ -5171,41 +5285,49 @@ var StagesComponent = ({
5171
5285
  disabled: true
5172
5286
  },
5173
5287
  index
5174
- )) : stages?.length > 0 && stages?.map((stage, index) => {
5288
+ )) : (stages || [])?.length > 0 && stages?.map((stage, index) => {
5175
5289
  const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
5176
5290
  const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
5177
5291
  const isActive = !isAllStagesCompleted && index === currentIndex;
5178
- return /* @__PURE__ */ jsxs37(React11.Fragment, { children: [
5179
- /* @__PURE__ */ jsx60(
5292
+ let stageColor = !stage.isSuccess ? "bg-red-50 text-red-700 border-2 border-red-700" : "bg-green-50 text-green-700 border-2 border-green-700";
5293
+ let stageLabel = stage[dataLabel];
5294
+ if (stage[dataKey] !== activeChildStage?.[dataKey] && activeRootStage?.[dataKey] === stage[dataKey]) {
5295
+ stageLabel = activeChildStage?.[dataLabel] || stageLabel;
5296
+ stageColor = activeChildStage?.isSuccess ? "bg-green-50 text-green-700 border-2 border-green-700" : "bg-red-50 text-red-700 border-2 border-red-700";
5297
+ }
5298
+ const stageKey = typeof stage[dataKey] === "string" ? stage[dataKey] : JSON.stringify(stage[dataKey]);
5299
+ return /* @__PURE__ */ jsx61(React11.Fragment, { children: /* @__PURE__ */ jsxs38(Tooltip, { delayDuration: 500, disableHoverableContent: true, children: [
5300
+ /* @__PURE__ */ jsx61(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx61(
5180
5301
  "button",
5181
5302
  {
5182
5303
  className: `
5183
5304
  min-w-[70px] sm:min-w-[80px] w-full sm:w-auto px-3 sm:px-4 py-1.5 sm:py-2
5184
5305
  rounded-full text-xs sm:text-sm font-medium transition-colors duration-200
5185
- whitespace-normal sm:whitespace-nowrap flex-shrink-0
5186
- ${isActive ? "bg-green-700 text-white shadow-md" : isCompletedStage ? "bg-green-50 text-green-700 border-2 border-green-700" : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}
5306
+ whitespace-normal sm:whitespace-nowrap flex-shrink-0 max-w-[150px] text-ellipsis overflow-hidden
5307
+ ${isActive ? "bg-green-700 text-white shadow-md" : isCompletedStage ? stageColor : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}
5187
5308
  ${isMobile ? "flex-1 text-center py-2.5" : ""}
5188
5309
  `,
5189
5310
  onClick: () => {
5190
5311
  if (isAllStagesCompleted) return;
5191
5312
  onStageClick(stage[dataKey]);
5192
5313
  },
5193
- children: stage[dataLabel]
5314
+ children: stageLabel
5194
5315
  }
5195
- ),
5196
- !isMobile && index < stages.length - 1 && /* @__PURE__ */ jsx60("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
5197
- ] }, stage.id);
5316
+ ) }),
5317
+ /* @__PURE__ */ jsx61(TooltipContent, { className: "max-w-[400px] p-3 text-xs text-muted-foreground space-y-2", children: /* @__PURE__ */ jsx61("span", { children: /* @__PURE__ */ jsx61("b", { children: stageLabel }) }) }),
5318
+ !isMobile && index < stages.length - 1 && /* @__PURE__ */ jsx61("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
5319
+ ] }, stageKey) }, stageKey);
5198
5320
  })
5199
5321
  }
5200
5322
  ),
5201
- isShowBtn && /* @__PURE__ */ jsx60(
5323
+ isShowBtn && /* @__PURE__ */ jsx61(
5202
5324
  "div",
5203
5325
  {
5204
5326
  className: `
5205
5327
  flex items-center flex-shrink-0 w-full lg:w-auto
5206
5328
  ${isMobile ? "order-3 mt-3 lg:mt-0" : "order-3"}
5207
5329
  `,
5208
- children: /* @__PURE__ */ jsx60(
5330
+ children: /* @__PURE__ */ jsx61(
5209
5331
  "button",
5210
5332
  {
5211
5333
  className: `
@@ -5227,23 +5349,23 @@ var StagesComponent = ({
5227
5349
  var Stages_default = StagesComponent;
5228
5350
 
5229
5351
  // src/components/Navigation/Spacer/Spacer.tsx
5230
- import { jsx as jsx61 } from "react/jsx-runtime";
5352
+ import { jsx as jsx62 } from "react/jsx-runtime";
5231
5353
  var Spacer = ({ className, style }) => {
5232
- return /* @__PURE__ */ jsx61("div", { className: `${className}`, style });
5354
+ return /* @__PURE__ */ jsx62("div", { className: `${className}`, style });
5233
5355
  };
5234
5356
  var Spacer_default = Spacer;
5235
5357
 
5236
5358
  // src/components/Navigation/Profile/Profile.tsx
5237
- import { jsx as jsx62, jsxs as jsxs38 } from "react/jsx-runtime";
5359
+ import { jsx as jsx63, jsxs as jsxs39 } from "react/jsx-runtime";
5238
5360
 
5239
5361
  // src/components/Navigation/Notification/Notification.tsx
5240
- import { jsx as jsx63, jsxs as jsxs39 } from "react/jsx-runtime";
5362
+ import { jsx as jsx64, jsxs as jsxs40 } from "react/jsx-runtime";
5241
5363
 
5242
5364
  // src/components/Navigation/Logo/Logo.tsx
5243
- import { jsx as jsx64 } from "react/jsx-runtime";
5365
+ import { jsx as jsx65 } from "react/jsx-runtime";
5244
5366
 
5245
5367
  // src/components/Navigation/Navbar/Navbar.tsx
5246
- import { useCallback as useCallback4, useMemo as useMemo9, useState as useState14, useEffect as useEffect27 } from "react";
5368
+ import { useCallback as useCallback5, useMemo as useMemo9, useState as useState14, useEffect as useEffect27 } from "react";
5247
5369
  import { Bell, Search as Search2, Menu as Menu2 } from "lucide-react";
5248
5370
  import Image3 from "next/image";
5249
5371
  import Link4 from "next/link";
@@ -5252,8 +5374,8 @@ import { useRouter as useRouter2 } from "next/navigation";
5252
5374
  // src/components/ui/avatar.tsx
5253
5375
  import * as React12 from "react";
5254
5376
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
5255
- import { jsx as jsx65 } from "react/jsx-runtime";
5256
- var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
5377
+ import { jsx as jsx66 } from "react/jsx-runtime";
5378
+ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66(
5257
5379
  AvatarPrimitive.Root,
5258
5380
  {
5259
5381
  ref,
@@ -5265,7 +5387,7 @@ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
5265
5387
  }
5266
5388
  ));
5267
5389
  Avatar.displayName = AvatarPrimitive.Root.displayName;
5268
- var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
5390
+ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66(
5269
5391
  AvatarPrimitive.Image,
5270
5392
  {
5271
5393
  ref,
@@ -5274,7 +5396,7 @@ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
5274
5396
  }
5275
5397
  ));
5276
5398
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
5277
- var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
5399
+ var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66(
5278
5400
  AvatarPrimitive.Fallback,
5279
5401
  {
5280
5402
  ref,
@@ -5288,7 +5410,7 @@ var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__
5288
5410
  AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
5289
5411
 
5290
5412
  // src/components/Navigation/Navbar/Navbar.tsx
5291
- import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs40 } from "react/jsx-runtime";
5413
+ import { Fragment as Fragment23, jsx as jsx67, jsxs as jsxs41 } from "react/jsx-runtime";
5292
5414
  function Navbar({
5293
5415
  style,
5294
5416
  badgeType,
@@ -5326,7 +5448,7 @@ function Navbar({
5326
5448
  const isMobile = mode === "mobile";
5327
5449
  const isTablet = mode === "tablet";
5328
5450
  const isDesktop = mode === "desktop";
5329
- const handleBuilderExit = useCallback4(
5451
+ const handleBuilderExit = useCallback5(
5330
5452
  (e, url) => {
5331
5453
  if (isBuilder) {
5332
5454
  e.preventDefault();
@@ -5346,9 +5468,9 @@ function Navbar({
5346
5468
  }
5347
5469
  return list;
5348
5470
  }, [source, navList, list]);
5349
- const RenderSearchInput = () => /* @__PURE__ */ jsx66("div", { className: "flex-1 px-2", children: /* @__PURE__ */ jsxs40("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
5350
- /* @__PURE__ */ jsx66(Search2, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
5351
- /* @__PURE__ */ jsx66(
5471
+ const RenderSearchInput = () => /* @__PURE__ */ jsx67("div", { className: "flex-1 px-2", children: /* @__PURE__ */ jsxs41("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
5472
+ /* @__PURE__ */ jsx67(Search2, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
5473
+ /* @__PURE__ */ jsx67(
5352
5474
  Input,
5353
5475
  {
5354
5476
  placeholder: "Search",
@@ -5364,23 +5486,23 @@ function Navbar({
5364
5486
  }
5365
5487
  )
5366
5488
  ] }) });
5367
- return /* @__PURE__ */ jsxs40(Fragment23, { children: [
5368
- /* @__PURE__ */ jsx66(
5489
+ return /* @__PURE__ */ jsxs41(Fragment23, { children: [
5490
+ /* @__PURE__ */ jsx67(
5369
5491
  "nav",
5370
5492
  {
5371
5493
  className: "w-full min-h-[75px] border-b border-gray-200 dark:border-gray-800 dark:bg-gray-800 bg-white shadow-sm",
5372
5494
  style,
5373
- children: /* @__PURE__ */ jsxs40("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
5374
- /* @__PURE__ */ jsx66(
5495
+ children: /* @__PURE__ */ jsxs41("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
5496
+ /* @__PURE__ */ jsx67(
5375
5497
  Link4,
5376
5498
  {
5377
5499
  href: "/",
5378
5500
  onClick: (e) => handleBuilderExit(e, "/"),
5379
5501
  className: "flex items-center space-x-2",
5380
- children: imageUrl ? /* @__PURE__ */ jsx66(Image3, { src: imageUrl, alt: altText, width: 180, height: 40 }) : /* @__PURE__ */ jsx66("span", { className: "font-semibold text-blue-700", children: "Logo" })
5502
+ children: imageUrl ? /* @__PURE__ */ jsx67(Image3, { src: imageUrl, alt: altText, width: 180, height: 40 }) : /* @__PURE__ */ jsx67("span", { className: "font-semibold text-blue-700", children: "Logo" })
5381
5503
  }
5382
5504
  ),
5383
- isDesktop && /* @__PURE__ */ jsx66("div", { className: "hidden md:flex items-center space-x-6", children: formattedMenu.map((item) => /* @__PURE__ */ jsx66(
5505
+ isDesktop && /* @__PURE__ */ jsx67("div", { className: "hidden md:flex items-center space-x-6", children: formattedMenu.map((item) => /* @__PURE__ */ jsx67(
5384
5506
  Link4,
5385
5507
  {
5386
5508
  href: item.url,
@@ -5390,23 +5512,23 @@ function Navbar({
5390
5512
  },
5391
5513
  item.id
5392
5514
  )) }),
5393
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-3", children: [
5394
- (isDesktop || isTablet) && /* @__PURE__ */ jsx66(RenderSearchInput, {}),
5395
- /* @__PURE__ */ jsxs40("div", { className: "relative bg-gray-200 dark:bg-gray-700 rounded-md", children: [
5396
- /* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx66(Bell, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }) }),
5397
- badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx66("span", { className: "absolute -top-1 -right-1 h-4 w-4 flex items-center justify-center bg-red-500 rounded-full text-white text-[10px]", children: badgeCount }) : !hideBadgeWhenZero && /* @__PURE__ */ jsx66("span", { className: "absolute -top-1 -right-1 h-2 w-2 bg-red-500 rounded-full" })
5515
+ /* @__PURE__ */ jsxs41("div", { className: "flex items-center space-x-3", children: [
5516
+ (isDesktop || isTablet) && /* @__PURE__ */ jsx67(RenderSearchInput, {}),
5517
+ /* @__PURE__ */ jsxs41("div", { className: "relative bg-gray-200 dark:bg-gray-700 rounded-md", children: [
5518
+ /* @__PURE__ */ jsx67(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx67(Bell, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }) }),
5519
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx67("span", { className: "absolute -top-1 -right-1 h-4 w-4 flex items-center justify-center bg-red-500 rounded-full text-white text-[10px]", children: badgeCount }) : !hideBadgeWhenZero && /* @__PURE__ */ jsx67("span", { className: "absolute -top-1 -right-1 h-2 w-2 bg-red-500 rounded-full" })
5398
5520
  ] }),
5399
- /* @__PURE__ */ jsxs40(DropdownMenu, { children: [
5400
- /* @__PURE__ */ jsx66(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
5401
- !isMobile && showName && /* @__PURE__ */ jsx66("h4", { className: "text-gray-900 dark:text-gray-300 text-sm", children: userName }),
5402
- /* @__PURE__ */ jsx66(Avatar, { className: "h-8 w-8", children: profileType === "avatar" ? /* @__PURE__ */ jsx66(AvatarImage, { src: "/images/appbuilder/toolset/profile.svg", alt: "profile" }) : /* @__PURE__ */ jsx66("div", { className: "bg-green-700 text-white h-full w-full rounded-full flex items-center justify-center text-xs", children: getInitials(userName) }) }),
5403
- (isMobile || isTablet) && /* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx66(Menu2, { className: "h-6 w-6" }) })
5521
+ /* @__PURE__ */ jsxs41(DropdownMenu, { children: [
5522
+ /* @__PURE__ */ jsx67(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
5523
+ !isMobile && showName && /* @__PURE__ */ jsx67("h4", { className: "text-gray-900 dark:text-gray-300 text-sm", children: userName }),
5524
+ /* @__PURE__ */ jsx67(Avatar, { className: "h-8 w-8", children: profileType === "avatar" ? /* @__PURE__ */ jsx67(AvatarImage, { src: "/images/appbuilder/toolset/profile.svg", alt: "profile" }) : /* @__PURE__ */ jsx67("div", { className: "bg-green-700 text-white h-full w-full rounded-full flex items-center justify-center text-xs", children: getInitials(userName) }) }),
5525
+ (isMobile || isTablet) && /* @__PURE__ */ jsx67(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx67(Menu2, { className: "h-6 w-6" }) })
5404
5526
  ] }) }),
5405
- /* @__PURE__ */ jsxs40(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
5406
- profileMenu.map((item) => /* @__PURE__ */ jsx66(DropdownMenuItem, { children: /* @__PURE__ */ jsx66(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id)),
5407
- (isMobile || isTablet) && /* @__PURE__ */ jsxs40(Fragment23, { children: [
5408
- /* @__PURE__ */ jsx66(DropdownMenuSeparator, {}),
5409
- formattedMenu.map((item) => /* @__PURE__ */ jsx66(DropdownMenuItem, { children: /* @__PURE__ */ jsx66(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id))
5527
+ /* @__PURE__ */ jsxs41(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
5528
+ profileMenu.map((item) => /* @__PURE__ */ jsx67(DropdownMenuItem, { children: /* @__PURE__ */ jsx67(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id)),
5529
+ (isMobile || isTablet) && /* @__PURE__ */ jsxs41(Fragment23, { children: [
5530
+ /* @__PURE__ */ jsx67(DropdownMenuSeparator, {}),
5531
+ formattedMenu.map((item) => /* @__PURE__ */ jsx67(DropdownMenuItem, { children: /* @__PURE__ */ jsx67(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id))
5410
5532
  ] })
5411
5533
  ] })
5412
5534
  ] })
@@ -5414,12 +5536,12 @@ function Navbar({
5414
5536
  ] })
5415
5537
  }
5416
5538
  ),
5417
- isMobile && /* @__PURE__ */ jsx66("div", { className: "p-3", children: /* @__PURE__ */ jsx66(RenderSearchInput, {}) })
5539
+ isMobile && /* @__PURE__ */ jsx67("div", { className: "p-3", children: /* @__PURE__ */ jsx67(RenderSearchInput, {}) })
5418
5540
  ] });
5419
5541
  }
5420
5542
 
5421
5543
  // src/components/Chart/BarChart.tsx
5422
- import React13, { useEffect as useEffect28, useMemo as useMemo10, useState as useState15, useCallback as useCallback5 } from "react";
5544
+ import React13, { useEffect as useEffect28, useMemo as useMemo10, useState as useState15, useCallback as useCallback6 } from "react";
5423
5545
  import axios3 from "axios";
5424
5546
  import {
5425
5547
  BarChart,
@@ -5429,11 +5551,11 @@ import {
5429
5551
  XAxis,
5430
5552
  YAxis,
5431
5553
  CartesianGrid,
5432
- Tooltip,
5554
+ Tooltip as Tooltip2,
5433
5555
  ResponsiveContainer,
5434
5556
  Legend
5435
5557
  } from "recharts";
5436
- import { jsx as jsx67, jsxs as jsxs41 } from "react/jsx-runtime";
5558
+ import { jsx as jsx68, jsxs as jsxs42 } from "react/jsx-runtime";
5437
5559
  var getRandomColor = () => {
5438
5560
  const palette = [
5439
5561
  "#2563eb",
@@ -5502,7 +5624,7 @@ var ChartComponent = ({
5502
5624
  setCurrentPage(1);
5503
5625
  }
5504
5626
  }, [apiUrl]);
5505
- const fetchData = useCallback5(async (page) => {
5627
+ const fetchData = useCallback6(async (page) => {
5506
5628
  if (!apiUrl) return;
5507
5629
  const cancelled = false;
5508
5630
  try {
@@ -5560,27 +5682,27 @@ var ChartComponent = ({
5560
5682
  const chartType = props.chartType || "bar";
5561
5683
  const legendsPosition = ["middle", "bottom"].includes(props.legendsPosition) ? props.legendsPosition : "top";
5562
5684
  if (effectiveLoading || data.length === 0) {
5563
- return /* @__PURE__ */ jsxs41(
5685
+ return /* @__PURE__ */ jsxs42(
5564
5686
  "div",
5565
5687
  {
5566
5688
  className: `relative flex flex-col w-full h-[300px] md:h-[400px] bg-gradient-to-br from-gray-50 to-gray-100 rounded-xl p-6 ${className}`,
5567
5689
  style,
5568
5690
  children: [
5569
- /* @__PURE__ */ jsx67("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsxs41("div", { className: "inline-flex items-center space-x-2 bg-white/90 px-6 py-2.5 rounded-xl backdrop-blur-sm border border-gray-200 shadow-lg", children: [
5570
- /* @__PURE__ */ jsx67("div", { className: "w-5 h-5 border-2 border-gray-400 border-t-blue-500 rounded-full animate-spin" }),
5571
- /* @__PURE__ */ jsx67("span", { className: "text-sm font-medium text-gray-700 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
5691
+ /* @__PURE__ */ jsx68("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsxs42("div", { className: "inline-flex items-center space-x-2 bg-white/90 px-6 py-2.5 rounded-xl backdrop-blur-sm border border-gray-200 shadow-lg", children: [
5692
+ /* @__PURE__ */ jsx68("div", { className: "w-5 h-5 border-2 border-gray-400 border-t-blue-500 rounded-full animate-spin" }),
5693
+ /* @__PURE__ */ jsx68("span", { className: "text-sm font-medium text-gray-700 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
5572
5694
  ] }) }),
5573
- /* @__PURE__ */ jsx67("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
5574
- /* @__PURE__ */ jsx67("div", { className: "flex-1 relative w-full h-full min-h-[240px] md:min-h-[320px] bg-white/80 rounded-lg border border-gray-200/50 shadow-sm", children: /* @__PURE__ */ jsx67("div", { className: "absolute bottom-0 left-4 right-4 flex gap-2 h-[200px] md:h-[280px] justify-center items-end", children: [...Array(20)].map((_, idx) => {
5695
+ /* @__PURE__ */ jsx68("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
5696
+ /* @__PURE__ */ jsx68("div", { className: "flex-1 relative w-full h-full min-h-[240px] md:min-h-[320px] bg-white/80 rounded-lg border border-gray-200/50 shadow-sm", children: /* @__PURE__ */ jsx68("div", { className: "absolute bottom-0 left-4 right-4 flex gap-2 h-[200px] md:h-[280px] justify-center items-end", children: [...Array(20)].map((_, idx) => {
5575
5697
  const randomHeight = `${Math.floor(Math.random() * 76) + 20}%`;
5576
- return /* @__PURE__ */ jsxs41(
5698
+ return /* @__PURE__ */ jsxs42(
5577
5699
  "div",
5578
5700
  {
5579
5701
  className: `relative w-10 md:w-12 flex-1 max-w-[48px] rounded-t-lg bg-gradient-to-t from-gray-100 via-gray-200 to-transparent shadow-lg border border-gray-200/50 animate-slide-up stagger-${idx} overflow-hidden`,
5580
5702
  style: { height: randomHeight, animationDelay: `${idx * 0.08}s` },
5581
5703
  children: [
5582
- /* @__PURE__ */ jsx67("div", { className: "absolute inset-0 bg-gradient-to-r from-white/40 via-transparent to-white/40 animate-shimmer-bar" }),
5583
- /* @__PURE__ */ jsx67("div", { className: "absolute bottom-1 left-1/2 w-4 h-1 rounded-full transform -translate-x-1/2 blur-sm" })
5704
+ /* @__PURE__ */ jsx68("div", { className: "absolute inset-0 bg-gradient-to-r from-white/40 via-transparent to-white/40 animate-shimmer-bar" }),
5705
+ /* @__PURE__ */ jsx68("div", { className: "absolute bottom-1 left-1/2 w-4 h-1 rounded-full transform -translate-x-1/2 blur-sm" })
5584
5706
  ]
5585
5707
  },
5586
5708
  `bar-${idx}`
@@ -5590,9 +5712,9 @@ var ChartComponent = ({
5590
5712
  }
5591
5713
  );
5592
5714
  }
5593
- return /* @__PURE__ */ jsxs41("div", { className: `${className} h-[450px]`, style, children: [
5594
- isPaginationEnabled && rawMeta && /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between mb-4 px-2", children: [
5595
- /* @__PURE__ */ jsxs41("div", { className: "text-sm text-gray-600 hidden sm:block", children: [
5715
+ return /* @__PURE__ */ jsxs42("div", { className: `${className} h-[450px]`, style, children: [
5716
+ isPaginationEnabled && rawMeta && /* @__PURE__ */ jsxs42("div", { className: "flex items-center justify-between mb-4 px-2", children: [
5717
+ /* @__PURE__ */ jsxs42("div", { className: "text-sm text-gray-600 hidden sm:block", children: [
5596
5718
  "Page ",
5597
5719
  rawMeta.page,
5598
5720
  " of ",
@@ -5601,52 +5723,52 @@ var ChartComponent = ({
5601
5723
  rawMeta.total.toLocaleString(),
5602
5724
  " total records)"
5603
5725
  ] }),
5604
- /* @__PURE__ */ jsxs41("div", { className: "flex items-center space-x-2 sm:hidden w-full justify-center", children: [
5605
- /* @__PURE__ */ jsx67(
5726
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-center space-x-2 sm:hidden w-full justify-center", children: [
5727
+ /* @__PURE__ */ jsx68(
5606
5728
  "button",
5607
5729
  {
5608
5730
  onClick: () => handlePageChange(currentPage - 1),
5609
5731
  disabled: currentPage === 1 || localLoading,
5610
5732
  className: "flex-1 px-3 py-2 text-xs font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center justify-center space-x-1 min-w-0",
5611
- children: /* @__PURE__ */ jsx67("span", { children: "\u2190 Prev" })
5733
+ children: /* @__PURE__ */ jsx68("span", { children: "\u2190 Prev" })
5612
5734
  }
5613
5735
  ),
5614
- /* @__PURE__ */ jsx67("span", { className: "px-2 py-2 text-xs font-semibold text-gray-700 min-w-[36px] text-center flex-shrink-0", children: currentPage }),
5615
- /* @__PURE__ */ jsx67(
5736
+ /* @__PURE__ */ jsx68("span", { className: "px-2 py-2 text-xs font-semibold text-gray-700 min-w-[36px] text-center flex-shrink-0", children: currentPage }),
5737
+ /* @__PURE__ */ jsx68(
5616
5738
  "button",
5617
5739
  {
5618
5740
  onClick: () => handlePageChange(currentPage + 1),
5619
5741
  disabled: currentPage >= rawMeta.pages || localLoading,
5620
5742
  className: "flex-1 px-3 py-2 text-xs font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center justify-center space-x-1 min-w-0",
5621
- children: /* @__PURE__ */ jsx67("span", { children: "Next \u2192" })
5743
+ children: /* @__PURE__ */ jsx68("span", { children: "Next \u2192" })
5622
5744
  }
5623
5745
  )
5624
5746
  ] }),
5625
- /* @__PURE__ */ jsxs41("div", { className: "flex items-center space-x-2 hidden sm:flex", children: [
5626
- /* @__PURE__ */ jsx67(
5747
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-center space-x-2 hidden sm:flex", children: [
5748
+ /* @__PURE__ */ jsx68(
5627
5749
  "button",
5628
5750
  {
5629
5751
  onClick: () => handlePageChange(currentPage - 1),
5630
5752
  disabled: currentPage === 1 || localLoading,
5631
5753
  className: "px-3 py-1.5 text-sm font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center space-x-1",
5632
- children: /* @__PURE__ */ jsx67("span", { children: "\u2190 Prev" })
5754
+ children: /* @__PURE__ */ jsx68("span", { children: "\u2190 Prev" })
5633
5755
  }
5634
5756
  ),
5635
- /* @__PURE__ */ jsx67("span", { className: "px-3 py-1 text-sm font-medium text-gray-700", children: currentPage }),
5636
- /* @__PURE__ */ jsx67(
5757
+ /* @__PURE__ */ jsx68("span", { className: "px-3 py-1 text-sm font-medium text-gray-700", children: currentPage }),
5758
+ /* @__PURE__ */ jsx68(
5637
5759
  "button",
5638
5760
  {
5639
5761
  onClick: () => handlePageChange(currentPage + 1),
5640
5762
  disabled: currentPage >= rawMeta.pages || localLoading,
5641
5763
  className: "px-3 py-1.5 text-sm font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center space-x-1",
5642
- children: /* @__PURE__ */ jsx67("span", { children: "Next \u2192" })
5764
+ children: /* @__PURE__ */ jsx68("span", { children: "Next \u2192" })
5643
5765
  }
5644
5766
  )
5645
5767
  ] })
5646
5768
  ] }),
5647
- /* @__PURE__ */ jsx67(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs41(BarChart, { data, children: [
5648
- /* @__PURE__ */ jsx67(CartesianGrid, { strokeDasharray: "3 3" }),
5649
- /* @__PURE__ */ jsx67(
5769
+ /* @__PURE__ */ jsx68(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs42(BarChart, { data, children: [
5770
+ /* @__PURE__ */ jsx68(CartesianGrid, { strokeDasharray: "3 3" }),
5771
+ /* @__PURE__ */ jsx68(
5650
5772
  XAxis,
5651
5773
  {
5652
5774
  dataKey: dataLabel,
@@ -5664,7 +5786,7 @@ var ChartComponent = ({
5664
5786
  className: "hidden sm:block"
5665
5787
  }
5666
5788
  ),
5667
- /* @__PURE__ */ jsx67(
5789
+ /* @__PURE__ */ jsx68(
5668
5790
  YAxis,
5669
5791
  {
5670
5792
  tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
@@ -5677,9 +5799,9 @@ var ChartComponent = ({
5677
5799
  width: 60
5678
5800
  }
5679
5801
  ),
5680
- /* @__PURE__ */ jsx67(Tooltip, { formatter: (value) => [`${value}`, "Count"] }),
5681
- /* @__PURE__ */ jsx67(Legend, { verticalAlign: legendsPosition, align: "center" }),
5682
- /* @__PURE__ */ jsx67(
5802
+ /* @__PURE__ */ jsx68(Tooltip2, { formatter: (value) => [`${value}`, "Count"] }),
5803
+ /* @__PURE__ */ jsx68(Legend, { verticalAlign: legendsPosition, align: "center" }),
5804
+ /* @__PURE__ */ jsx68(
5683
5805
  Bar,
5684
5806
  {
5685
5807
  dataKey,
@@ -5687,13 +5809,13 @@ var ChartComponent = ({
5687
5809
  isAnimationActive: false
5688
5810
  }
5689
5811
  )
5690
- ] }) : /* @__PURE__ */ jsxs41(AreaChart, { data, children: [
5691
- /* @__PURE__ */ jsx67("defs", { children: /* @__PURE__ */ jsxs41("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
5692
- /* @__PURE__ */ jsx67("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
5693
- /* @__PURE__ */ jsx67("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
5812
+ ] }) : /* @__PURE__ */ jsxs42(AreaChart, { data, children: [
5813
+ /* @__PURE__ */ jsx68("defs", { children: /* @__PURE__ */ jsxs42("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
5814
+ /* @__PURE__ */ jsx68("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
5815
+ /* @__PURE__ */ jsx68("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
5694
5816
  ] }) }),
5695
- /* @__PURE__ */ jsx67(CartesianGrid, { strokeDasharray: "3 3" }),
5696
- /* @__PURE__ */ jsx67(
5817
+ /* @__PURE__ */ jsx68(CartesianGrid, { strokeDasharray: "3 3" }),
5818
+ /* @__PURE__ */ jsx68(
5697
5819
  XAxis,
5698
5820
  {
5699
5821
  dataKey: dataLabel,
@@ -5707,7 +5829,7 @@ var ChartComponent = ({
5707
5829
  }
5708
5830
  }
5709
5831
  ),
5710
- /* @__PURE__ */ jsx67(
5832
+ /* @__PURE__ */ jsx68(
5711
5833
  YAxis,
5712
5834
  {
5713
5835
  tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
@@ -5720,8 +5842,8 @@ var ChartComponent = ({
5720
5842
  width: 60
5721
5843
  }
5722
5844
  ),
5723
- /* @__PURE__ */ jsx67(Tooltip, { formatter: (value) => `${value}k` }),
5724
- /* @__PURE__ */ jsx67(
5845
+ /* @__PURE__ */ jsx68(Tooltip2, { formatter: (value) => `${value}k` }),
5846
+ /* @__PURE__ */ jsx68(
5725
5847
  Area,
5726
5848
  {
5727
5849
  type: "monotone",
@@ -5745,9 +5867,9 @@ import {
5745
5867
  Pie,
5746
5868
  Cell,
5747
5869
  ResponsiveContainer as ResponsiveContainer2,
5748
- Tooltip as Tooltip2
5870
+ Tooltip as Tooltip3
5749
5871
  } from "recharts";
5750
- import { jsx as jsx68, jsxs as jsxs42 } from "react/jsx-runtime";
5872
+ import { jsx as jsx69, jsxs as jsxs43 } from "react/jsx-runtime";
5751
5873
  var getRandomColor2 = () => {
5752
5874
  const palette = [
5753
5875
  "#2563eb",
@@ -5916,32 +6038,32 @@ var DonutChart = ({
5916
6038
  }, []);
5917
6039
  const renderLegends = useMemo11(() => {
5918
6040
  if (!showLegends) return null;
5919
- return /* @__PURE__ */ jsx68("div", { className: "flex flex-wrap justify-center gap-2 mt-4 w-full max-w-4xl", children: chartData.map((d, index) => {
6041
+ return /* @__PURE__ */ jsx69("div", { className: "flex flex-wrap justify-center gap-2 mt-4 w-full max-w-4xl", children: chartData.map((d, index) => {
5920
6042
  const actualValue = data.find(
5921
6043
  (item) => item[dataLabel] === d[dataLabel]
5922
6044
  )?.[dataKey] ?? d[dataKey];
5923
6045
  const displayValue = actualValue >= 1e3 ? `${(actualValue / 1e3).toFixed(0)}k` : actualValue.toLocaleString();
5924
- return /* @__PURE__ */ jsxs42(
6046
+ return /* @__PURE__ */ jsxs43(
5925
6047
  "div",
5926
6048
  {
5927
6049
  className: "flex items-center space-x-2 rounded-lg border border-gray-200/50 px-3 py-1.5 w-[48%] sm:w-[32%] md:w-auto bg-white/80 backdrop-blur-sm shadow-sm hover:shadow-md transition-all",
5928
6050
  children: [
5929
- /* @__PURE__ */ jsx68(
6051
+ /* @__PURE__ */ jsx69(
5930
6052
  "span",
5931
6053
  {
5932
6054
  className: "inline-block w-[12px] h-[12px] rounded-full shrink-0 border-2 border-white/50",
5933
6055
  style: { backgroundColor: d.color }
5934
6056
  }
5935
6057
  ),
5936
- /* @__PURE__ */ jsxs42("div", { className: "min-w-0 flex-1", children: [
5937
- /* @__PURE__ */ jsx68("span", { className: "text-gray-900 text-[11px] md:text-[13px] font-semibold block truncate leading-tight", children: d[dataLabel] }),
5938
- /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-1 text-xs text-gray-600 font-medium", children: [
5939
- /* @__PURE__ */ jsx68("span", { children: displayValue }),
5940
- /* @__PURE__ */ jsxs42("span", { children: [
6058
+ /* @__PURE__ */ jsxs43("div", { className: "min-w-0 flex-1", children: [
6059
+ /* @__PURE__ */ jsx69("span", { className: "text-gray-900 text-[11px] md:text-[13px] font-semibold block truncate leading-tight", children: d[dataLabel] }),
6060
+ /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-1 text-xs text-gray-600 font-medium", children: [
6061
+ /* @__PURE__ */ jsx69("span", { children: displayValue }),
6062
+ /* @__PURE__ */ jsxs43("span", { children: [
5941
6063
  (actualValue / total * 100).toFixed(1),
5942
6064
  "%"
5943
6065
  ] }),
5944
- d.isBoosted && /* @__PURE__ */ jsx68("span", { className: "text-[9px] px-1 py-0.5 bg-blue-100 text-blue-700 rounded-full", children: "min" })
6066
+ d.isBoosted && /* @__PURE__ */ jsx69("span", { className: "text-[9px] px-1 py-0.5 bg-blue-100 text-blue-700 rounded-full", children: "min" })
5945
6067
  ] })
5946
6068
  ] })
5947
6069
  ]
@@ -5952,26 +6074,26 @@ var DonutChart = ({
5952
6074
  }, [chartData, data, dataLabel, dataKey, total, showLegends]);
5953
6075
  if (!mounted) return null;
5954
6076
  if (effectiveLoading || data.length === 0) {
5955
- return /* @__PURE__ */ jsxs42(
6077
+ return /* @__PURE__ */ jsxs43(
5956
6078
  "div",
5957
6079
  {
5958
6080
  className: `relative flex flex-col items-center w-full h-[300px] md:h-[400px] bg-gradient-to-br from-gray-50 to-gray-100 rounded-xl p-6 ${className}`,
5959
6081
  style,
5960
6082
  children: [
5961
- /* @__PURE__ */ jsx68("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
5962
- /* @__PURE__ */ jsx68("div", { className: "mt-6 text-center", children: /* @__PURE__ */ jsxs42("div", { className: "inline-flex items-center space-x-2 bg-white/80 px-6 py-2 rounded-full backdrop-blur-sm border border-gray-200 shadow-lg", children: [
5963
- /* @__PURE__ */ jsx68("div", { className: "w-5 h-5 border-2 border-gray-300 border-t-blue-400 rounded-full animate-spin" }),
5964
- /* @__PURE__ */ jsx68("span", { className: "text-sm font-medium text-gray-600 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
6083
+ /* @__PURE__ */ jsx69("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
6084
+ /* @__PURE__ */ jsx69("div", { className: "mt-6 text-center", children: /* @__PURE__ */ jsxs43("div", { className: "inline-flex items-center space-x-2 bg-white/80 px-6 py-2 rounded-full backdrop-blur-sm border border-gray-200 shadow-lg", children: [
6085
+ /* @__PURE__ */ jsx69("div", { className: "w-5 h-5 border-2 border-gray-300 border-t-blue-400 rounded-full animate-spin" }),
6086
+ /* @__PURE__ */ jsx69("span", { className: "text-sm font-medium text-gray-600 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
5965
6087
  ] }) }),
5966
- /* @__PURE__ */ jsx68("div", { className: "flex flex-wrap justify-center gap-3 mt-8 w-full max-w-4xl", children: [...Array(18)].map((_, idx) => /* @__PURE__ */ jsxs42(
6088
+ /* @__PURE__ */ jsx69("div", { className: "flex flex-wrap justify-center gap-3 mt-8 w-full max-w-4xl", children: [...Array(18)].map((_, idx) => /* @__PURE__ */ jsxs43(
5967
6089
  "div",
5968
6090
  {
5969
6091
  className: `h-10 w-[48%] sm:w-[32%] md:w-32 rounded-xl bg-gradient-to-r from-gray-200 via-gray-300/50 to-gray-200 p-3 flex items-center space-x-3 animate-slide-up stagger-${idx} shadow-sm border border-gray-200/50`,
5970
6092
  children: [
5971
- /* @__PURE__ */ jsx68("div", { className: "w-4 h-4 rounded-full bg-gradient-to-r from-blue-300 to-purple-300 animate-pulse" }),
5972
- /* @__PURE__ */ jsxs42("div", { className: "flex-1 space-y-1", children: [
5973
- /* @__PURE__ */ jsx68("div", { className: "h-3 w-20 bg-gray-300 rounded animate-pulse" }),
5974
- /* @__PURE__ */ jsx68("div", { className: "h-2.5 w-16 bg-gray-200/60 rounded animate-pulse-delayed" })
6093
+ /* @__PURE__ */ jsx69("div", { className: "w-4 h-4 rounded-full bg-gradient-to-r from-blue-300 to-purple-300 animate-pulse" }),
6094
+ /* @__PURE__ */ jsxs43("div", { className: "flex-1 space-y-1", children: [
6095
+ /* @__PURE__ */ jsx69("div", { className: "h-3 w-20 bg-gray-300 rounded animate-pulse" }),
6096
+ /* @__PURE__ */ jsx69("div", { className: "h-2.5 w-16 bg-gray-200/60 rounded animate-pulse-delayed" })
5975
6097
  ] })
5976
6098
  ]
5977
6099
  },
@@ -5984,10 +6106,10 @@ var DonutChart = ({
5984
6106
  const { inner, outer } = getDynamicRadius();
5985
6107
  const innerRadius = inner;
5986
6108
  const outerRadius = outer;
5987
- return /* @__PURE__ */ jsxs42("div", { className: `relative flex flex-col items-center ${className}`, style, children: [
5988
- /* @__PURE__ */ jsxs42("div", { className: "relative w-full md:w-[75%] h-[280px] md:h-[380px] flex items-center justify-center mb-2", children: [
5989
- /* @__PURE__ */ jsx68(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs42(PieChart, { children: [
5990
- /* @__PURE__ */ jsx68(
6109
+ return /* @__PURE__ */ jsxs43("div", { className: `relative flex flex-col items-center ${className}`, style, children: [
6110
+ /* @__PURE__ */ jsxs43("div", { className: "relative w-full md:w-[75%] h-[280px] md:h-[380px] flex items-center justify-center mb-2", children: [
6111
+ /* @__PURE__ */ jsx69(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs43(PieChart, { children: [
6112
+ /* @__PURE__ */ jsx69(
5991
6113
  Pie,
5992
6114
  {
5993
6115
  data: chartData,
@@ -6000,7 +6122,7 @@ var DonutChart = ({
6000
6122
  isAnimationActive: true,
6001
6123
  animationDuration: 800,
6002
6124
  minAngle: 3,
6003
- children: chartData.map((entry, index) => /* @__PURE__ */ jsx68(
6125
+ children: chartData.map((entry, index) => /* @__PURE__ */ jsx69(
6004
6126
  Cell,
6005
6127
  {
6006
6128
  fill: entry.color,
@@ -6011,8 +6133,8 @@ var DonutChart = ({
6011
6133
  ))
6012
6134
  }
6013
6135
  ),
6014
- /* @__PURE__ */ jsx68(
6015
- Tooltip2,
6136
+ /* @__PURE__ */ jsx69(
6137
+ Tooltip3,
6016
6138
  {
6017
6139
  formatter: (value, name, payload) => {
6018
6140
  const label = payload && payload.payload ? payload.payload[dataLabel] : name;
@@ -6034,9 +6156,9 @@ var DonutChart = ({
6034
6156
  }
6035
6157
  )
6036
6158
  ] }) }),
6037
- total > 0 && /* @__PURE__ */ jsx68("div", { className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center pointer-events-none ${forceMobile ? "text-xl px-2" : "text-3xl px-4"} font-bold bg-white/90 backdrop-blur-sm rounded-full py-1 shadow-lg`, children: /* @__PURE__ */ jsxs42("div", { className: "text-[#1f2937] leading-tight", children: [
6159
+ total > 0 && /* @__PURE__ */ jsx69("div", { className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center pointer-events-none ${forceMobile ? "text-xl px-2" : "text-3xl px-4"} font-bold bg-white/90 backdrop-blur-sm rounded-full py-1 shadow-lg`, children: /* @__PURE__ */ jsxs43("div", { className: "text-[#1f2937] leading-tight", children: [
6038
6160
  formattedTotal,
6039
- /* @__PURE__ */ jsx68("span", { className: "text-sm md:text-base font-normal text-gray-600 block md:inline-block md:ml-1", children: "total" })
6161
+ /* @__PURE__ */ jsx69("span", { className: "text-sm md:text-base font-normal text-gray-600 block md:inline-block md:ml-1", children: "total" })
6040
6162
  ] }) })
6041
6163
  ] }),
6042
6164
  renderLegends
@@ -6045,10 +6167,10 @@ var DonutChart = ({
6045
6167
  var PieChart_default = React14.memo(DonutChart);
6046
6168
 
6047
6169
  // src/components/Blocks/EmailComposer.tsx
6048
- import { jsx as jsx69, jsxs as jsxs43 } from "react/jsx-runtime";
6170
+ import { jsx as jsx70, jsxs as jsxs44 } from "react/jsx-runtime";
6049
6171
  function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
6050
- return /* @__PURE__ */ jsx69("div", { className, style, children: /* @__PURE__ */ jsxs43("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
6051
- /* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
6172
+ return /* @__PURE__ */ jsx70("div", { className, style, children: /* @__PURE__ */ jsxs44("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
6173
+ /* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
6052
6174
  "input",
6053
6175
  {
6054
6176
  type: "email",
@@ -6057,8 +6179,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6057
6179
  required: true
6058
6180
  }
6059
6181
  ) }),
6060
- /* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
6061
- /* @__PURE__ */ jsx69(
6182
+ /* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-2", children: [
6183
+ /* @__PURE__ */ jsx70(
6062
6184
  "input",
6063
6185
  {
6064
6186
  type: "email",
@@ -6069,7 +6191,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6069
6191
  required: true
6070
6192
  }
6071
6193
  ),
6072
- !showCc && /* @__PURE__ */ jsx69(
6194
+ !showCc && /* @__PURE__ */ jsx70(
6073
6195
  "button",
6074
6196
  {
6075
6197
  onClick: () => setShowCc?.(true),
@@ -6077,7 +6199,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6077
6199
  children: "Cc"
6078
6200
  }
6079
6201
  ),
6080
- !showBcc && /* @__PURE__ */ jsx69(
6202
+ !showBcc && /* @__PURE__ */ jsx70(
6081
6203
  "button",
6082
6204
  {
6083
6205
  onClick: () => setShowBcc?.(true),
@@ -6086,7 +6208,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6086
6208
  }
6087
6209
  )
6088
6210
  ] }) }),
6089
- showCc && /* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
6211
+ showCc && /* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
6090
6212
  "input",
6091
6213
  {
6092
6214
  type: "text",
@@ -6096,7 +6218,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6096
6218
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
6097
6219
  }
6098
6220
  ) }),
6099
- showBcc && /* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
6221
+ showBcc && /* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
6100
6222
  "input",
6101
6223
  {
6102
6224
  type: "text",
@@ -6106,7 +6228,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6106
6228
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
6107
6229
  }
6108
6230
  ) }),
6109
- /* @__PURE__ */ jsx69("div", { className: "mb-3", children: /* @__PURE__ */ jsx69(
6231
+ /* @__PURE__ */ jsx70("div", { className: "mb-3", children: /* @__PURE__ */ jsx70(
6110
6232
  "input",
6111
6233
  {
6112
6234
  type: "text",
@@ -6116,11 +6238,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6116
6238
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
6117
6239
  }
6118
6240
  ) }),
6119
- /* @__PURE__ */ jsx69("div", { className: "mb-4", children: /* @__PURE__ */ jsx69(MyEditor, { value: body, onChange: setBody }) }),
6120
- /* @__PURE__ */ jsxs43("div", { className: "flex justify-end gap-2", children: [
6121
- /* @__PURE__ */ jsx69("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
6122
- /* @__PURE__ */ jsx69("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
6123
- /* @__PURE__ */ jsx69("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
6241
+ /* @__PURE__ */ jsx70("div", { className: "mb-4", children: /* @__PURE__ */ jsx70(MyEditor, { value: body, onChange: setBody }) }),
6242
+ /* @__PURE__ */ jsxs44("div", { className: "flex justify-end gap-2", children: [
6243
+ /* @__PURE__ */ jsx70("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
6244
+ /* @__PURE__ */ jsx70("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
6245
+ /* @__PURE__ */ jsx70("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
6124
6246
  ] })
6125
6247
  ] }) });
6126
6248
  }
@@ -6128,10 +6250,10 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
6128
6250
  // src/components/ui/sonner.tsx
6129
6251
  import { useTheme } from "next-themes";
6130
6252
  import { Toaster as Sonner } from "sonner";
6131
- import { jsx as jsx70 } from "react/jsx-runtime";
6253
+ import { jsx as jsx71 } from "react/jsx-runtime";
6132
6254
  var Toaster = ({ ...props }) => {
6133
6255
  const { theme = "system" } = useTheme();
6134
- return /* @__PURE__ */ jsx70(
6256
+ return /* @__PURE__ */ jsx71(
6135
6257
  Sonner,
6136
6258
  {
6137
6259
  theme,