pxengine 0.1.102 → 0.1.104

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
@@ -24692,7 +24692,7 @@ var LayoutAtom = ({
24692
24692
  gapMap[gap],
24693
24693
  className
24694
24694
  );
24695
- return /* @__PURE__ */ jsx5("div", { className: classes, children: children.map((child, index) => /* @__PURE__ */ jsx5(React2.Fragment, { children: renderComponent(child, index) }, child.id || `layout-item-${index}`)) });
24695
+ return /* @__PURE__ */ jsx5("div", { className: classes, children: (Array.isArray(children) ? children : []).map((child, index) => /* @__PURE__ */ jsx5(React2.Fragment, { children: renderComponent(child, index) }, child.id || `layout-item-${index}`)) });
24696
24696
  };
24697
24697
 
24698
24698
  // src/atoms/CardAtom.tsx
@@ -24789,8 +24789,8 @@ var CardAtom = ({
24789
24789
  title && /* @__PURE__ */ jsx7(CardTitle, { className: "text-xl font-bold text-gray900", children: title }),
24790
24790
  description && /* @__PURE__ */ jsx7(CardDescription, { children: description })
24791
24791
  ] }),
24792
- /* @__PURE__ */ jsx7(CardContent, { className: "space-y-4", children: (children || []).map((child, index) => /* @__PURE__ */ jsx7(React4.Fragment, { children: renderComponent(child, index) }, child.id || `card-content-${index}`)) }),
24793
- footer && footer.length > 0 && /* @__PURE__ */ jsx7(CardFooter, { className: "bg-gray50/50 border-t border-gray200 flex flex-wrap gap-2 pt-6", children: footer.map((footerChild, index) => /* @__PURE__ */ jsx7(React4.Fragment, { children: renderComponent(footerChild, index) }, footerChild.id || `card-footer-${index}`)) })
24792
+ /* @__PURE__ */ jsx7(CardContent, { className: "space-y-4", children: (Array.isArray(children) ? children : []).map((child, index) => /* @__PURE__ */ jsx7(React4.Fragment, { children: renderComponent(child, index) }, child.id || `card-content-${index}`)) }),
24793
+ Array.isArray(footer) && footer.length > 0 && /* @__PURE__ */ jsx7(CardFooter, { className: "bg-gray50/50 border-t border-gray200 flex flex-wrap gap-2 pt-6", children: footer.map((footerChild, index) => /* @__PURE__ */ jsx7(React4.Fragment, { children: renderComponent(footerChild, index) }, footerChild.id || `card-footer-${index}`)) })
24794
24794
  ]
24795
24795
  }
24796
24796
  );
@@ -25227,7 +25227,7 @@ var InputAtom = ({
25227
25227
  children: /* @__PURE__ */ jsx17(SelectValue, { placeholder: placeholder || "Select option" })
25228
25228
  }
25229
25229
  ),
25230
- /* @__PURE__ */ jsx17(SelectContent, { className: "rounded-xl border-border shadow-xl", children: options?.map((opt) => /* @__PURE__ */ jsx17(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
25230
+ /* @__PURE__ */ jsx17(SelectContent, { className: "rounded-xl border-border shadow-xl", children: (Array.isArray(options) ? options : []).map((opt) => /* @__PURE__ */ jsx17(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
25231
25231
  ]
25232
25232
  }
25233
25233
  );
@@ -25297,7 +25297,7 @@ var InputAtom = ({
25297
25297
  className: cn("gap-2.5 bg-transparent", className),
25298
25298
  style: remainingStyle,
25299
25299
  onValueChange: isInteractive ? (val) => handleChange(val) : void 0,
25300
- children: options?.map((opt) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center space-x-3 bg-transparent", children: [
25300
+ children: (Array.isArray(options) ? options : []).map((opt) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center space-x-3 bg-transparent", children: [
25301
25301
  /* @__PURE__ */ jsx17(
25302
25302
  RadioGroupItem,
25303
25303
  {
@@ -25535,8 +25535,9 @@ var TabsAtom = ({
25535
25535
  className,
25536
25536
  renderComponent
25537
25537
  }) => {
25538
+ const safeTabs = Array.isArray(tabs) ? tabs : [];
25538
25539
  return /* @__PURE__ */ jsxs8(Tabs, { defaultValue, className: cn("w-full", className), children: [
25539
- /* @__PURE__ */ jsx23(TabsList, { className: "bg-gray-100/50 p-1 rounded-xl", children: tabs.map((tab) => /* @__PURE__ */ jsx23(
25540
+ /* @__PURE__ */ jsx23(TabsList, { className: "bg-gray-100/50 p-1 rounded-xl", children: safeTabs.map((tab) => /* @__PURE__ */ jsx23(
25540
25541
  TabsTrigger,
25541
25542
  {
25542
25543
  value: tab.value,
@@ -25545,7 +25546,7 @@ var TabsAtom = ({
25545
25546
  },
25546
25547
  tab.value
25547
25548
  )) }),
25548
- tabs.map((tab) => /* @__PURE__ */ jsx23(TabsContent, { value: tab.value, className: "mt-4", children: tab.content.map((child) => /* @__PURE__ */ jsx23(React17.Fragment, { children: renderComponent(child) }, child.id)) }, tab.value))
25549
+ safeTabs.map((tab) => /* @__PURE__ */ jsx23(TabsContent, { value: tab.value, className: "mt-4", children: (Array.isArray(tab.content) ? tab.content : []).map((child) => /* @__PURE__ */ jsx23(React17.Fragment, { children: renderComponent(child) }, child.id)) }, tab.value))
25549
25550
  ] });
25550
25551
  };
25551
25552
 
@@ -25600,14 +25601,15 @@ var AccordionAtom = ({
25600
25601
  className,
25601
25602
  renderComponent
25602
25603
  }) => {
25603
- return /* @__PURE__ */ jsx25(Accordion, { type: "single", collapsible: true, className: cn("w-full", className), children: items.map((item) => /* @__PURE__ */ jsxs10(
25604
+ const safeItems = Array.isArray(items) ? items : [];
25605
+ return /* @__PURE__ */ jsx25(Accordion, { type: "single", collapsible: true, className: cn("w-full", className), children: safeItems.map((item) => /* @__PURE__ */ jsxs10(
25604
25606
  AccordionItem,
25605
25607
  {
25606
25608
  value: item.value,
25607
25609
  className: "border-gray-100",
25608
25610
  children: [
25609
25611
  /* @__PURE__ */ jsx25(AccordionTrigger, { className: "text-sm font-semibold hover:no-underline hover:text-purple600 py-4", children: item.trigger }),
25610
- /* @__PURE__ */ jsx25(AccordionContent, { children: /* @__PURE__ */ jsx25("div", { className: "pt-2 pb-4", children: item.content.map((child) => /* @__PURE__ */ jsx25(React19.Fragment, { children: renderComponent(child) }, child.id)) }) })
25612
+ /* @__PURE__ */ jsx25(AccordionContent, { children: /* @__PURE__ */ jsx25("div", { className: "pt-2 pb-4", children: (Array.isArray(item.content) ? item.content : []).map((child) => /* @__PURE__ */ jsx25(React19.Fragment, { children: renderComponent(child) }, child.id)) }) })
25611
25613
  ]
25612
25614
  },
25613
25615
  item.value
@@ -26042,7 +26044,7 @@ var ScrollAreaAtom = ({
26042
26044
  className: cn("rounded-xl border", className),
26043
26045
  style: { height: maxHeight },
26044
26046
  children: [
26045
- /* @__PURE__ */ jsx37("div", { className: "p-4", children: children.map((child) => /* @__PURE__ */ jsx37(React25.Fragment, { children: renderComponent(child) }, child.id)) }),
26047
+ /* @__PURE__ */ jsx37("div", { className: "p-4", children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ jsx37(React25.Fragment, { children: renderComponent(child) }, child.id)) }),
26046
26048
  /* @__PURE__ */ jsx37(ScrollBar, { orientation: "vertical" })
26047
26049
  ]
26048
26050
  }
@@ -26245,8 +26247,9 @@ var CarouselAtom = ({
26245
26247
  className,
26246
26248
  renderComponent
26247
26249
  }) => {
26250
+ const safeItems = Array.isArray(items) ? items : [];
26248
26251
  return /* @__PURE__ */ jsxs16(Carousel, { className: cn("w-full max-w-xs mx-auto", className), children: [
26249
- /* @__PURE__ */ jsx39(CarouselContent, { children: items.map((slide, index) => /* @__PURE__ */ jsx39(CarouselItem, { children: /* @__PURE__ */ jsx39("div", { className: "p-1", children: slide.map((child) => /* @__PURE__ */ jsx39(React27.Fragment, { children: renderComponent(child) }, child.id)) }) }, index)) }),
26252
+ /* @__PURE__ */ jsx39(CarouselContent, { children: safeItems.map((slide, index) => /* @__PURE__ */ jsx39(CarouselItem, { children: /* @__PURE__ */ jsx39("div", { className: "p-1", children: (Array.isArray(slide) ? slide : []).map((child) => /* @__PURE__ */ jsx39(React27.Fragment, { children: renderComponent(child) }, child.id)) }) }, index)) }),
26250
26253
  /* @__PURE__ */ jsx39(CarouselPrevious, {}),
26251
26254
  /* @__PURE__ */ jsx39(CarouselNext, {})
26252
26255
  ] });
@@ -26267,7 +26270,7 @@ var AspectRatioAtom = ({
26267
26270
  className,
26268
26271
  renderComponent
26269
26272
  }) => {
26270
- return /* @__PURE__ */ jsx40("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx40(AspectRatio, { ratio, children: children.map((child) => /* @__PURE__ */ jsx40(React28.Fragment, { children: renderComponent(child) }, child.id)) }) });
26273
+ return /* @__PURE__ */ jsx40("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx40(AspectRatio, { ratio, children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ jsx40(React28.Fragment, { children: renderComponent(child) }, child.id)) }) });
26271
26274
  };
26272
26275
 
26273
26276
  // src/atoms/CollapsibleAtom.tsx
@@ -26294,8 +26297,8 @@ var CollapsibleAtom = ({
26294
26297
  defaultOpen,
26295
26298
  className: cn("w-full space-y-2", className),
26296
26299
  children: [
26297
- /* @__PURE__ */ jsx41(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsx41("div", { className: "flex items-center justify-between space-x-4 px-4 py-2 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors", children: trigger.map((child) => /* @__PURE__ */ jsx41(React29.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26298
- /* @__PURE__ */ jsx41(CollapsibleContent2, { className: "space-y-2", children: content.map((child) => /* @__PURE__ */ jsx41(React29.Fragment, { children: renderComponent(child) }, child.id)) })
26300
+ /* @__PURE__ */ jsx41(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsx41("div", { className: "flex items-center justify-between space-x-4 px-4 py-2 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors", children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ jsx41(React29.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26301
+ /* @__PURE__ */ jsx41(CollapsibleContent2, { className: "space-y-2", children: (Array.isArray(content) ? content : []).map((child) => /* @__PURE__ */ jsx41(React29.Fragment, { children: renderComponent(child) }, child.id)) })
26299
26302
  ]
26300
26303
  }
26301
26304
  );
@@ -26334,7 +26337,7 @@ var TooltipAtom = ({
26334
26337
  renderComponent
26335
26338
  }) => {
26336
26339
  return /* @__PURE__ */ jsx43(TooltipProvider, { children: /* @__PURE__ */ jsxs18(Tooltip, { children: [
26337
- /* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43("div", { className: cn("inline-block", className), children: children.map((child) => /* @__PURE__ */ jsx43(React31.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26340
+ /* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43("div", { className: cn("inline-block", className), children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ jsx43(React31.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26338
26341
  /* @__PURE__ */ jsx43(TooltipContent, { className: "bg-gray-900 text-white border-none rounded-lg shadow-xl px-3 py-1.5 text-xs", children: content })
26339
26342
  ] }) });
26340
26343
  };
@@ -26372,8 +26375,8 @@ var PopoverAtom = ({
26372
26375
  renderComponent
26373
26376
  }) => {
26374
26377
  return /* @__PURE__ */ jsxs19(Popover, { children: [
26375
- /* @__PURE__ */ jsx45(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx45("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ jsx45(React33.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26376
- /* @__PURE__ */ jsx45(PopoverContent, { className: "w-80 rounded-2xl shadow-2xl border-gray-100 p-4 bg-white/95 backdrop-blur-sm", children: content.map((child) => /* @__PURE__ */ jsx45(React33.Fragment, { children: renderComponent(child) }, child.id)) })
26378
+ /* @__PURE__ */ jsx45(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx45("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ jsx45(React33.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26379
+ /* @__PURE__ */ jsx45(PopoverContent, { className: "w-80 rounded-2xl shadow-2xl border-gray-100 p-4 bg-white/95 backdrop-blur-sm", children: (Array.isArray(content) ? content : []).map((child) => /* @__PURE__ */ jsx45(React33.Fragment, { children: renderComponent(child) }, child.id)) })
26377
26380
  ] });
26378
26381
  };
26379
26382
 
@@ -26484,14 +26487,14 @@ var DialogAtom = ({
26484
26487
  renderComponent
26485
26488
  }) => {
26486
26489
  return /* @__PURE__ */ jsxs21(Dialog, { children: [
26487
- /* @__PURE__ */ jsx47(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx47("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ jsx47(React35.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26490
+ /* @__PURE__ */ jsx47(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx47("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ jsx47(React35.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26488
26491
  /* @__PURE__ */ jsxs21(DialogContent, { className: "sm:max-w-[425px] rounded-3xl p-6 bg-white/95 backdrop-blur-md shadow-3xl border-gray-100", children: [
26489
26492
  /* @__PURE__ */ jsxs21(DialogHeader, { children: [
26490
26493
  /* @__PURE__ */ jsx47(DialogTitle, { className: "text-xl font-bold bg-gradient-to-r from-purple600 to-indigo-600 bg-clip-text text-transparent", children: title }),
26491
26494
  description && /* @__PURE__ */ jsx47(DialogDescription, { className: "text-gray-500 font-medium pt-1", children: description })
26492
26495
  ] }),
26493
- /* @__PURE__ */ jsx47("div", { className: "py-4", children: children.map((child) => /* @__PURE__ */ jsx47(React35.Fragment, { children: renderComponent(child) }, child.id)) }),
26494
- footer && /* @__PURE__ */ jsx47(DialogFooter, { className: "pt-2", children: footer.map((child) => /* @__PURE__ */ jsx47(React35.Fragment, { children: renderComponent(child) }, child.id)) })
26496
+ /* @__PURE__ */ jsx47("div", { className: "py-4", children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ jsx47(React35.Fragment, { children: renderComponent(child) }, child.id)) }),
26497
+ footer && /* @__PURE__ */ jsx47(DialogFooter, { className: "pt-2", children: (Array.isArray(footer) ? footer : []).map((child) => /* @__PURE__ */ jsx47(React35.Fragment, { children: renderComponent(child) }, child.id)) })
26495
26498
  ] })
26496
26499
  ] });
26497
26500
  };
@@ -26615,7 +26618,7 @@ var SheetAtom = ({
26615
26618
  renderComponent
26616
26619
  }) => {
26617
26620
  return /* @__PURE__ */ jsxs23(Sheet2, { children: [
26618
- /* @__PURE__ */ jsx49(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx49("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ jsx49(React37.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26621
+ /* @__PURE__ */ jsx49(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx49("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ jsx49(React37.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26619
26622
  /* @__PURE__ */ jsxs23(
26620
26623
  SheetContent,
26621
26624
  {
@@ -26626,8 +26629,8 @@ var SheetAtom = ({
26626
26629
  /* @__PURE__ */ jsx49(SheetTitle, { className: "text-xl font-bold text-gray-900", children: title }),
26627
26630
  description && /* @__PURE__ */ jsx49(SheetDescription, { className: "text-gray-500 font-medium", children: description })
26628
26631
  ] }),
26629
- /* @__PURE__ */ jsx49("div", { className: "py-8", children: children.map((child) => /* @__PURE__ */ jsx49(React37.Fragment, { children: renderComponent(child) }, child.id)) }),
26630
- footer && /* @__PURE__ */ jsx49(SheetFooter, { className: "absolute bottom-6 left-6 right-6", children: footer.map((child) => /* @__PURE__ */ jsx49(React37.Fragment, { children: renderComponent(child) }, child.id)) })
26632
+ /* @__PURE__ */ jsx49("div", { className: "py-8", children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ jsx49(React37.Fragment, { children: renderComponent(child) }, child.id)) }),
26633
+ footer && /* @__PURE__ */ jsx49(SheetFooter, { className: "absolute bottom-6 left-6 right-6", children: (Array.isArray(footer) ? footer : []).map((child) => /* @__PURE__ */ jsx49(React37.Fragment, { children: renderComponent(child) }, child.id)) })
26631
26634
  ]
26632
26635
  }
26633
26636
  )
@@ -26754,7 +26757,7 @@ var AlertDialogAtom = ({
26754
26757
  renderComponent
26755
26758
  }) => {
26756
26759
  return /* @__PURE__ */ jsxs25(AlertDialog, { children: [
26757
- /* @__PURE__ */ jsx51(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ jsx51(React39.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26760
+ /* @__PURE__ */ jsx51(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ jsx51(React39.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26758
26761
  /* @__PURE__ */ jsxs25(AlertDialogContent, { className: "rounded-3xl p-6 bg-white shadow-3xl border-gray-100", children: [
26759
26762
  /* @__PURE__ */ jsxs25(AlertDialogHeader, { children: [
26760
26763
  /* @__PURE__ */ jsx51(AlertDialogTitle, { className: "text-lg font-bold text-gray-900", children: title }),
@@ -26868,9 +26871,10 @@ var BreadcrumbAtom = ({
26868
26871
  items,
26869
26872
  className
26870
26873
  }) => {
26871
- return /* @__PURE__ */ jsx53(Breadcrumb, { className, children: /* @__PURE__ */ jsx53(BreadcrumbList, { children: items.map((item, index) => /* @__PURE__ */ jsxs27(React41.Fragment, { children: [
26874
+ const safeItems = Array.isArray(items) ? items : [];
26875
+ return /* @__PURE__ */ jsx53(Breadcrumb, { className, children: /* @__PURE__ */ jsx53(BreadcrumbList, { children: safeItems.map((item, index) => /* @__PURE__ */ jsxs27(React41.Fragment, { children: [
26872
26876
  /* @__PURE__ */ jsx53(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsx53(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx53(BreadcrumbLink, { href: item.href || "#", children: item.label }) }),
26873
- index < items.length - 1 && /* @__PURE__ */ jsx53(BreadcrumbSeparator, {})
26877
+ index < safeItems.length - 1 && /* @__PURE__ */ jsx53(BreadcrumbSeparator, {})
26874
26878
  ] }, index)) }) });
26875
26879
  };
26876
26880
 
@@ -31830,6 +31834,7 @@ var CommandAtom = ({
31830
31834
  groups,
31831
31835
  className
31832
31836
  }) => {
31837
+ const safeGroups = Array.isArray(groups) ? groups : [];
31833
31838
  return /* @__PURE__ */ jsx60(
31834
31839
  "div",
31835
31840
  {
@@ -31841,9 +31846,9 @@ var CommandAtom = ({
31841
31846
  /* @__PURE__ */ jsx60(CommandInput, { placeholder }),
31842
31847
  /* @__PURE__ */ jsxs31(CommandList, { children: [
31843
31848
  /* @__PURE__ */ jsx60(CommandEmpty, { children: "No results found." }),
31844
- groups.map((group, i) => /* @__PURE__ */ jsxs31(React72.Fragment, { children: [
31845
- /* @__PURE__ */ jsx60(CommandGroup, { heading: group.heading, children: group.items.map((item, j) => /* @__PURE__ */ jsx60(CommandItem, { value: item.value, children: /* @__PURE__ */ jsx60("span", { children: item.label }) }, j)) }),
31846
- i < groups.length - 1 && /* @__PURE__ */ jsx60(CommandSeparator, {})
31849
+ safeGroups.map((group, i) => /* @__PURE__ */ jsxs31(React72.Fragment, { children: [
31850
+ /* @__PURE__ */ jsx60(CommandGroup, { heading: group.heading, children: (Array.isArray(group.items) ? group.items : []).map((item, j) => /* @__PURE__ */ jsx60(CommandItem, { value: item.value, children: /* @__PURE__ */ jsx60("span", { children: item.label }) }, j)) }),
31851
+ i < safeGroups.length - 1 && /* @__PURE__ */ jsx60(CommandSeparator, {})
31847
31852
  ] }, i))
31848
31853
  ] })
31849
31854
  ] })
@@ -32031,7 +32036,7 @@ var FormSelectAtom = ({
32031
32036
  label && /* @__PURE__ */ jsx63(FormLabel, { children: label }),
32032
32037
  /* @__PURE__ */ jsxs33(Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
32033
32038
  /* @__PURE__ */ jsx63(FormControl, { children: /* @__PURE__ */ jsx63(SelectTrigger, { id: id || `form-select-${fieldName}`, children: /* @__PURE__ */ jsx63(SelectValue, { placeholder }) }) }),
32034
- /* @__PURE__ */ jsx63(SelectContent, { children: options.map((option) => /* @__PURE__ */ jsx63(SelectItem, { value: option.value, children: option.label }, option.value)) })
32039
+ /* @__PURE__ */ jsx63(SelectContent, { children: (Array.isArray(options) ? options : []).map((option) => /* @__PURE__ */ jsx63(SelectItem, { value: option.value, children: option.label }, option.value)) })
32035
32040
  ] }),
32036
32041
  description && /* @__PURE__ */ jsx63(FormDescription, { children: description }),
32037
32042
  /* @__PURE__ */ jsx63(FormMessage, {})
@@ -32326,6 +32331,7 @@ var SliderAtom = ({
32326
32331
  import { jsx as jsx72, jsxs as jsxs39 } from "react/jsx-runtime";
32327
32332
  var RadioGroupAtom = ({ id, label, options, defaultValue, disabled, className, style, onValueChange }) => {
32328
32333
  const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
32334
+ const safeOptions = Array.isArray(options) ? options : [];
32329
32335
  return /* @__PURE__ */ jsxs39("div", { className: "flex flex-col gap-2 w-full", children: [
32330
32336
  label && /* @__PURE__ */ jsx72(
32331
32337
  Label,
@@ -32345,7 +32351,7 @@ var RadioGroupAtom = ({ id, label, options, defaultValue, disabled, className, s
32345
32351
  className: cn("grid gap-2", className),
32346
32352
  style,
32347
32353
  "data-px-styled": hasPxVars ? "" : void 0,
32348
- children: options.map((option) => /* @__PURE__ */ jsxs39("div", { className: "flex items-center space-x-2", children: [
32354
+ children: safeOptions.map((option) => /* @__PURE__ */ jsxs39("div", { className: "flex items-center space-x-2", children: [
32349
32355
  /* @__PURE__ */ jsx72(
32350
32356
  RadioGroupItem,
32351
32357
  {
@@ -32549,6 +32555,7 @@ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
32549
32555
  // src/atoms/DropdownMenuAtom.tsx
32550
32556
  import { jsx as jsx75, jsxs as jsxs42 } from "react/jsx-runtime";
32551
32557
  var DropdownMenuAtom = ({ trigger, items, className, onAction }) => {
32558
+ const safeItems = Array.isArray(items) ? items : [];
32552
32559
  return /* @__PURE__ */ jsxs42(DropdownMenu, { children: [
32553
32560
  /* @__PURE__ */ jsx75(DropdownMenuTrigger, { asChild: true, children: trigger }),
32554
32561
  /* @__PURE__ */ jsx75(
@@ -32558,7 +32565,7 @@ var DropdownMenuAtom = ({ trigger, items, className, onAction }) => {
32558
32565
  "w-56 bg-white/80 backdrop-blur-md border-purple-100",
32559
32566
  className
32560
32567
  ),
32561
- children: items.map((item) => {
32568
+ children: safeItems.map((item) => {
32562
32569
  const Icon3 = item.icon ? lucide_react_exports[item.icon] : null;
32563
32570
  return /* @__PURE__ */ jsxs42(
32564
32571
  DropdownMenuItem,
@@ -32721,6 +32728,7 @@ ContextMenuShortcut.displayName = "ContextMenuShortcut";
32721
32728
  // src/atoms/ContextMenuAtom.tsx
32722
32729
  import { jsx as jsx77, jsxs as jsxs44 } from "react/jsx-runtime";
32723
32730
  var ContextMenuAtom = ({ trigger, items, className, onAction }) => {
32731
+ const safeItems = Array.isArray(items) ? items : [];
32724
32732
  return /* @__PURE__ */ jsxs44(ContextMenu, { children: [
32725
32733
  /* @__PURE__ */ jsx77(ContextMenuTrigger, { asChild: true, children: trigger }),
32726
32734
  /* @__PURE__ */ jsx77(
@@ -32730,7 +32738,7 @@ var ContextMenuAtom = ({ trigger, items, className, onAction }) => {
32730
32738
  "w-64 bg-white/80 backdrop-blur-md border-purple-100",
32731
32739
  className
32732
32740
  ),
32733
- children: items.map((item) => {
32741
+ children: safeItems.map((item) => {
32734
32742
  const Icon3 = item.icon ? lucide_react_exports[item.icon] : null;
32735
32743
  return /* @__PURE__ */ jsxs44(
32736
32744
  ContextMenuItem,
@@ -32912,6 +32920,7 @@ var InputOTPAtom = ({ length, className, onChange }) => {
32912
32920
  import React78 from "react";
32913
32921
  import { jsx as jsx81, jsxs as jsxs48 } from "react/jsx-runtime";
32914
32922
  var KbdAtom = ({ keys, className }) => {
32923
+ const safeKeys = Array.isArray(keys) ? keys : [];
32915
32924
  return /* @__PURE__ */ jsx81(
32916
32925
  "kbd",
32917
32926
  {
@@ -32919,9 +32928,9 @@ var KbdAtom = ({ keys, className }) => {
32919
32928
  "pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",
32920
32929
  className
32921
32930
  ),
32922
- children: keys.map((key, i) => /* @__PURE__ */ jsxs48(React78.Fragment, { children: [
32931
+ children: safeKeys.map((key, i) => /* @__PURE__ */ jsxs48(React78.Fragment, { children: [
32923
32932
  /* @__PURE__ */ jsx81("span", { className: "text-xs", children: key }),
32924
- i < keys.length - 1 && /* @__PURE__ */ jsx81("span", { children: "+" })
32933
+ i < safeKeys.length - 1 && /* @__PURE__ */ jsx81("span", { children: "+" })
32925
32934
  ] }, i))
32926
32935
  }
32927
32936
  );
@@ -32969,6 +32978,7 @@ var ResizableAtom = ({
32969
32978
  renderComponent
32970
32979
  }) => {
32971
32980
  const Group7 = ResizablePanelGroup;
32981
+ const safePanels = Array.isArray(panels) ? panels : [];
32972
32982
  return /* @__PURE__ */ jsx83(
32973
32983
  Group7,
32974
32984
  {
@@ -32977,15 +32987,15 @@ var ResizableAtom = ({
32977
32987
  "min-h-[200px] w-full rounded-lg border border-purple-100",
32978
32988
  className
32979
32989
  ),
32980
- children: panels.map((panel, i) => /* @__PURE__ */ jsxs49(React79.Fragment, { children: [
32981
- /* @__PURE__ */ jsx83(ResizablePanel, { defaultSize: panel.defaultSize, className: "p-4", children: panel.children.map((child, childIdx) => /* @__PURE__ */ jsx83(
32990
+ children: safePanels.map((panel, i) => /* @__PURE__ */ jsxs49(React79.Fragment, { children: [
32991
+ /* @__PURE__ */ jsx83(ResizablePanel, { defaultSize: panel.defaultSize, className: "p-4", children: (Array.isArray(panel.children) ? panel.children : []).map((child, childIdx) => /* @__PURE__ */ jsx83(
32982
32992
  React79.Fragment,
32983
32993
  {
32984
32994
  children: renderComponent(child)
32985
32995
  },
32986
32996
  child.id || `resizable-child-${i}-${childIdx}`
32987
32997
  )) }),
32988
- i < panels.length - 1 && /* @__PURE__ */ jsx83(ResizableHandle, { withHandle: true })
32998
+ i < safePanels.length - 1 && /* @__PURE__ */ jsx83(ResizableHandle, { withHandle: true })
32989
32999
  ] }, i))
32990
33000
  }
32991
33001
  );
@@ -33526,6 +33536,7 @@ var TimelineAtom = ({
33526
33536
  items,
33527
33537
  className
33528
33538
  }) => {
33539
+ const safeItems = Array.isArray(items) ? items : [];
33529
33540
  return /* @__PURE__ */ jsx88(
33530
33541
  "div",
33531
33542
  {
@@ -33533,7 +33544,7 @@ var TimelineAtom = ({
33533
33544
  "space-y-6 relative before:absolute before:inset-0 before:ml-5 before:-translate-x-px before:h-full before:w-0.5 before:bg-gradient-to-b before:from-purple-500 before:via-indigo-500 before:to-gray-200 before:pointer-events-none",
33534
33545
  className
33535
33546
  ),
33536
- children: items.map((item, i) => {
33547
+ children: safeItems.map((item, i) => {
33537
33548
  const Icon3 = item.icon ? lucide_react_exports[item.icon] : null;
33538
33549
  const isCompleted = item.status === "completed";
33539
33550
  const isActive = item.status === "active";
@@ -34231,7 +34242,7 @@ var EditableField = React86.memo(
34231
34242
  if (!value) {
34232
34243
  return /* @__PURE__ */ jsx94("span", { className: "opacity-0", children: "-" });
34233
34244
  }
34234
- return value.toString();
34245
+ return typeof value === "object" ? JSON.stringify(value) : String(value ?? "");
34235
34246
  };
34236
34247
  return /* @__PURE__ */ jsxs56(
34237
34248
  "div",
@@ -34340,7 +34351,7 @@ var ActionButton = React87.memo(
34340
34351
  setTimeLeft((prev) => {
34341
34352
  if (prev <= 1) {
34342
34353
  clearInterval(timer);
34343
- onProceed();
34354
+ onProceed?.();
34344
34355
  return 0;
34345
34356
  }
34346
34357
  return prev - 1;
@@ -34356,7 +34367,7 @@ var ActionButton = React87.memo(
34356
34367
  variant,
34357
34368
  size,
34358
34369
  disabled: disabled || isLoading,
34359
- onClick: onProceed,
34370
+ onClick: () => onProceed?.(),
34360
34371
  className: cn(
34361
34372
  "relative min-w-[140px] overflow-hidden group transition-all duration-300",
34362
34373
  "bg-[var(--primary-color)] hover:opacity-90 text-white font-bold rounded-full px-5 py-2.5 shadow-[0_4px_14px_0_hsl(var(--primary)/30%)] hover:shadow-[0_6px_20px_0_hsl(var(--primary)/40%)]",
@@ -34682,7 +34693,7 @@ var DynamicFormCard = React89.memo(
34682
34693
  ...rest
34683
34694
  }) => {
34684
34695
  const fields = useMemo4(
34685
- () => providedFields ?? generateFieldsFromData(data),
34696
+ () => Array.isArray(providedFields) ? providedFields : generateFieldsFromData(data),
34686
34697
  [providedFields, data]
34687
34698
  );
34688
34699
  const handleProceed = () => {
@@ -34754,7 +34765,7 @@ var StatsGrid = ({
34754
34765
  {
34755
34766
  id: `stat-label-${index}`,
34756
34767
  type: "text",
34757
- content: item.label,
34768
+ content: typeof item.label === "object" ? JSON.stringify(item.label) : String(item.label ?? ""),
34758
34769
  variant: "small",
34759
34770
  className: cn(!hasPxVars && "text-muted-foreground", "font-medium tracking-wide uppercase text-[10px]"),
34760
34771
  style: textColor ? { color: textColor } : void 0
@@ -34794,7 +34805,7 @@ var StatsGrid = ({
34794
34805
  ),
34795
34806
  children: [
34796
34807
  TrendIcon && /* @__PURE__ */ jsx98(TrendIcon, { className: "w-3 h-3 mr-0.5" }),
34797
- item.trend
34808
+ typeof item.trend === "object" ? JSON.stringify(item.trend) : String(item.trend ?? "")
34798
34809
  ]
34799
34810
  }
34800
34811
  )
@@ -34906,6 +34917,7 @@ var LoadingOverlay = ({
34906
34917
  // src/molecules/generic/FilterBar/FilterBar.tsx
34907
34918
  import { jsx as jsx101, jsxs as jsxs62 } from "react/jsx-runtime";
34908
34919
  var FilterBar = ({ filters, showSearch = true, className, onFilterToggle, onSearch }) => {
34920
+ const safeFilters = Array.isArray(filters) ? filters : [];
34909
34921
  return /* @__PURE__ */ jsxs62(
34910
34922
  "div",
34911
34923
  {
@@ -34925,7 +34937,7 @@ var FilterBar = ({ filters, showSearch = true, className, onFilterToggle, onSear
34925
34937
  }
34926
34938
  )
34927
34939
  ] }),
34928
- /* @__PURE__ */ jsx101("div", { className: "flex flex-wrap gap-2", children: filters.map((filter) => /* @__PURE__ */ jsx101(
34940
+ /* @__PURE__ */ jsx101("div", { className: "flex flex-wrap gap-2", children: safeFilters.map((filter) => /* @__PURE__ */ jsx101(
34929
34941
  Badge2,
34930
34942
  {
34931
34943
  variant: filter.active ? "default" : "outline",
@@ -35025,7 +35037,8 @@ var FileUpload = ({ title, accept, multiple, className, style, onFilesSelected }
35025
35037
  // src/molecules/generic/TagCloud/TagCloud.tsx
35026
35038
  import { jsx as jsx103, jsxs as jsxs64 } from "react/jsx-runtime";
35027
35039
  var TagCloud = ({ tags = [], className, onTagClick }) => {
35028
- const normalizedTags = tags.map(
35040
+ const safeTags = Array.isArray(tags) ? tags : [];
35041
+ const normalizedTags = safeTags.map(
35029
35042
  (t) => typeof t === "string" ? { label: t, value: t } : t
35030
35043
  );
35031
35044
  return /* @__PURE__ */ jsx103("div", { className: cn("flex flex-wrap gap-3.5", className), children: normalizedTags.map((tag) => /* @__PURE__ */ jsxs64(
@@ -35051,6 +35064,8 @@ var DataGrid = ({
35051
35064
  pageSize = 10,
35052
35065
  className
35053
35066
  }) => {
35067
+ const safeColumns = Array.isArray(columns) ? columns : [];
35068
+ const safeData = Array.isArray(data) ? data : [];
35054
35069
  const renderCell = (item, column) => {
35055
35070
  const value = item[column.accessorKey];
35056
35071
  switch (column.type) {
@@ -35060,7 +35075,7 @@ var DataGrid = ({
35060
35075
  {
35061
35076
  variant: "secondary",
35062
35077
  className: "bg-purple-50 text-purple-700 border-purple-100",
35063
- children: value
35078
+ children: typeof value === "object" ? JSON.stringify(value) : String(value ?? "")
35064
35079
  }
35065
35080
  );
35066
35081
  case "avatar":
@@ -35074,9 +35089,9 @@ var DataGrid = ({
35074
35089
  case "date":
35075
35090
  return /* @__PURE__ */ jsx104("span", { className: "text-muted-foreground", children: new Date(value).toLocaleDateString() });
35076
35091
  case "number":
35077
- return /* @__PURE__ */ jsx104("span", { className: "font-mono font-medium", children: value.toLocaleString() });
35092
+ return /* @__PURE__ */ jsx104("span", { className: "font-mono font-medium", children: Number(value ?? 0).toLocaleString() });
35078
35093
  default:
35079
- return /* @__PURE__ */ jsx104("span", { children: value });
35094
+ return /* @__PURE__ */ jsx104("span", { children: typeof value === "object" ? JSON.stringify(value) : String(value ?? "") });
35080
35095
  }
35081
35096
  };
35082
35097
  return /* @__PURE__ */ jsx104(
@@ -35087,7 +35102,7 @@ var DataGrid = ({
35087
35102
  className
35088
35103
  ),
35089
35104
  children: /* @__PURE__ */ jsxs65(Table3, { children: [
35090
- /* @__PURE__ */ jsx104(TableHeader, { className: "bg-gray-50/50", children: /* @__PURE__ */ jsx104(TableRow, { children: columns.map((col) => /* @__PURE__ */ jsx104(
35105
+ /* @__PURE__ */ jsx104(TableHeader, { className: "bg-gray-50/50", children: /* @__PURE__ */ jsx104(TableRow, { children: safeColumns.map((col) => /* @__PURE__ */ jsx104(
35091
35106
  TableHead,
35092
35107
  {
35093
35108
  className: "font-bold text-gray-900 h-12",
@@ -35095,11 +35110,11 @@ var DataGrid = ({
35095
35110
  },
35096
35111
  col.accessorKey
35097
35112
  )) }) }),
35098
- /* @__PURE__ */ jsx104(TableBody, { children: data.slice(0, pageSize).map((item, idx) => /* @__PURE__ */ jsx104(
35113
+ /* @__PURE__ */ jsx104(TableBody, { children: safeData.slice(0, pageSize).map((item, idx) => /* @__PURE__ */ jsx104(
35099
35114
  TableRow,
35100
35115
  {
35101
35116
  className: "hover:bg-purple-50/30 transition-colors border-gray-50",
35102
- children: columns.map((col) => /* @__PURE__ */ jsx104(TableCell, { className: "py-4", children: renderCell(item, col) }, col.accessorKey))
35117
+ children: safeColumns.map((col) => /* @__PURE__ */ jsx104(TableCell, { className: "py-4", children: renderCell(item, col) }, col.accessorKey))
35103
35118
  },
35104
35119
  idx
35105
35120
  )) })
@@ -35116,10 +35131,11 @@ var StepWizard = ({
35116
35131
  currentStep,
35117
35132
  className
35118
35133
  }) => {
35119
- return /* @__PURE__ */ jsx105("div", { className: cn("flex items-center w-full", className), children: steps.map((step, i) => {
35134
+ const safeSteps = Array.isArray(steps) ? steps : [];
35135
+ return /* @__PURE__ */ jsx105("div", { className: cn("flex items-center w-full", className), children: safeSteps.map((step, i) => {
35120
35136
  const isCompleted = i < currentStep;
35121
35137
  const isActive = i === currentStep;
35122
- const isLast = i === steps.length - 1;
35138
+ const isLast = i === safeSteps.length - 1;
35123
35139
  return /* @__PURE__ */ jsxs66(React91.Fragment, { children: [
35124
35140
  /* @__PURE__ */ jsxs66("div", { className: "flex flex-col items-center relative group", children: [
35125
35141
  /* @__PURE__ */ jsx105(
@@ -35162,6 +35178,7 @@ var NotificationList = ({
35162
35178
  notifications,
35163
35179
  className
35164
35180
  }) => {
35181
+ const safeNotifications = Array.isArray(notifications) ? notifications : [];
35165
35182
  const getIcon = (type) => {
35166
35183
  switch (type) {
35167
35184
  case "success":
@@ -35186,7 +35203,7 @@ var NotificationList = ({
35186
35203
  return "bg-blue-50";
35187
35204
  }
35188
35205
  };
35189
- return /* @__PURE__ */ jsx106("div", { className: cn("flex flex-col gap-2", className), children: notifications.map((n) => /* @__PURE__ */ jsxs67(
35206
+ return /* @__PURE__ */ jsx106("div", { className: cn("flex flex-col gap-2", className), children: safeNotifications.map((n) => /* @__PURE__ */ jsxs67(
35190
35207
  "div",
35191
35208
  {
35192
35209
  className: cn(
@@ -35249,15 +35266,16 @@ var PLATFORM_STYLES = {
35249
35266
  };
35250
35267
  var PlatformPost = ({ post, loading, className }) => {
35251
35268
  const [copied, setCopied] = useState8(false);
35252
- const [caption, setCaption] = useState8(post.caption);
35269
+ const [caption, setCaption] = useState8(post?.caption ?? "");
35270
+ const safeHashtags = Array.isArray(post.hashtags) ? post.hashtags : [];
35253
35271
  const style = PLATFORM_STYLES[post.platform] || PLATFORM_STYLES.twitter;
35254
35272
  const charCount = caption.length;
35255
35273
  const isOverLimit = charCount > post.character_limit;
35256
35274
  const isInstagram = post.platform === "instagram";
35257
35275
  const handleCopy = async () => {
35258
- const fullText = isInstagram ? post.hashtags.join(" ") : `${caption}
35276
+ const fullText = isInstagram ? safeHashtags.join(" ") : `${caption}
35259
35277
 
35260
- ${post.hashtags.join(" ")}`;
35278
+ ${safeHashtags.join(" ")}`;
35261
35279
  try {
35262
35280
  await navigator.clipboard.writeText(fullText);
35263
35281
  setCopied(true);
@@ -35311,7 +35329,7 @@ ${post.hashtags.join(" ")}`;
35311
35329
  }
35312
35330
  ) }),
35313
35331
  /* @__PURE__ */ jsxs68("div", { className: "px-4 pt-3 pb-4 space-y-2.5", children: [
35314
- loading ? /* @__PURE__ */ jsx107("div", { className: "h-3 w-[50%] rounded bg-[#27272a] animate-pulse" }) : post.hashtags.length > 0 ? /* @__PURE__ */ jsx107("p", { className: cn("text-xs font-medium leading-relaxed", style.hashtagColor), children: post.hashtags.join(" ") }) : null,
35332
+ loading ? /* @__PURE__ */ jsx107("div", { className: "h-3 w-[50%] rounded bg-[#27272a] animate-pulse" }) : safeHashtags.length > 0 ? /* @__PURE__ */ jsx107("p", { className: cn("text-xs font-medium leading-relaxed", style.hashtagColor), children: safeHashtags.join(" ") }) : null,
35315
35333
  !isInstagram && (loading ? /* @__PURE__ */ jsx107("div", { className: "h-2.5 w-[30%] rounded bg-[#27272a] animate-pulse" }) : /* @__PURE__ */ jsxs68(
35316
35334
  "p",
35317
35335
  {
@@ -35516,6 +35534,7 @@ var hideScrollbar = {
35516
35534
  var CIStatusSection = ({
35517
35535
  branches
35518
35536
  }) => {
35537
+ const safeBranches = Array.isArray(branches) ? branches : [];
35519
35538
  return /* @__PURE__ */ jsxs71(
35520
35539
  "div",
35521
35540
  {
@@ -35536,7 +35555,7 @@ var CIStatusSection = ({
35536
35555
  className: "space-y-1.5 max-h-[220px] overflow-y-auto slim-scrollbar",
35537
35556
  style: hideScrollbar,
35538
35557
  children: [
35539
- branches.map((branch) => {
35558
+ safeBranches.map((branch) => {
35540
35559
  const cfg = STATUS_CONFIG[branch.status] || STATUS_CONFIG.none;
35541
35560
  return /* @__PURE__ */ jsxs71(
35542
35561
  "div",
@@ -35558,7 +35577,7 @@ var CIStatusSection = ({
35558
35577
  branch.branch
35559
35578
  );
35560
35579
  }),
35561
- branches.length === 0 && /* @__PURE__ */ jsx110("p", { className: "text-xs text-gray-500 italic py-2", children: "No branches found" })
35580
+ safeBranches.length === 0 && /* @__PURE__ */ jsx110("p", { className: "text-xs text-gray-500 italic py-2", children: "No branches found" })
35562
35581
  ]
35563
35582
  }
35564
35583
  )
@@ -35599,6 +35618,7 @@ var hideScrollbar2 = {
35599
35618
  var PRListSection = ({
35600
35619
  pullRequests
35601
35620
  }) => {
35621
+ const safePullRequests = Array.isArray(pullRequests) ? pullRequests : [];
35602
35622
  return /* @__PURE__ */ jsxs72(
35603
35623
  "div",
35604
35624
  {
@@ -35619,7 +35639,7 @@ var PRListSection = ({
35619
35639
  className: "space-y-2 max-h-[220px] overflow-y-auto slim-scrollbar",
35620
35640
  style: hideScrollbar2,
35621
35641
  children: [
35622
- pullRequests.map((pr) => {
35642
+ safePullRequests.map((pr) => {
35623
35643
  const cfg = REVIEW_CONFIG[pr.review_status] || REVIEW_CONFIG.needs_review;
35624
35644
  return /* @__PURE__ */ jsxs72(
35625
35645
  "div",
@@ -35661,7 +35681,7 @@ var PRListSection = ({
35661
35681
  pr.number
35662
35682
  );
35663
35683
  }),
35664
- pullRequests.length === 0 && /* @__PURE__ */ jsx111("p", { className: "text-xs text-gray-500 italic py-2", children: "No open pull requests" })
35684
+ safePullRequests.length === 0 && /* @__PURE__ */ jsx111("p", { className: "text-xs text-gray-500 italic py-2", children: "No open pull requests" })
35665
35685
  ]
35666
35686
  }
35667
35687
  )
@@ -35725,6 +35745,7 @@ var hideScrollbar3 = {
35725
35745
  WebkitOverflowScrolling: "touch"
35726
35746
  };
35727
35747
  var StaleIssueList = ({ issues }) => {
35748
+ const safeIssues = Array.isArray(issues) ? issues : [];
35728
35749
  return /* @__PURE__ */ jsxs74(
35729
35750
  "div",
35730
35751
  {
@@ -35745,14 +35766,14 @@ var StaleIssueList = ({ issues }) => {
35745
35766
  className: "space-y-2 max-h-[220px] overflow-y-auto slim-scrollbar",
35746
35767
  style: hideScrollbar3,
35747
35768
  children: [
35748
- issues.map((issue) => /* @__PURE__ */ jsxs74(
35769
+ safeIssues.map((issue) => /* @__PURE__ */ jsxs74(
35749
35770
  "div",
35750
35771
  {
35751
35772
  className: "flex items-center justify-between rounded-lg px-3 py-2.5",
35752
35773
  style: { backgroundColor: "rgba(40, 40, 40, 0.7)" },
35753
35774
  children: [
35754
35775
  /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
35755
- /* @__PURE__ */ jsx113("div", { className: "flex shrink-0 gap-1", children: issue.labels.slice(0, 2).map((label) => /* @__PURE__ */ jsx113(
35776
+ /* @__PURE__ */ jsx113("div", { className: "flex shrink-0 gap-1", children: (Array.isArray(issue.labels) ? issue.labels : []).slice(0, 2).map((label) => /* @__PURE__ */ jsx113(
35756
35777
  "span",
35757
35778
  {
35758
35779
  className: cn(
@@ -35773,7 +35794,7 @@ var StaleIssueList = ({ issues }) => {
35773
35794
  },
35774
35795
  issue.number
35775
35796
  )),
35776
- issues.length === 0 && /* @__PURE__ */ jsx113("p", { className: "text-xs text-gray-500 italic py-2", children: "No stale issues" })
35797
+ safeIssues.length === 0 && /* @__PURE__ */ jsx113("p", { className: "text-xs text-gray-500 italic py-2", children: "No stale issues" })
35777
35798
  ]
35778
35799
  }
35779
35800
  )
@@ -35833,7 +35854,7 @@ var GitHubIssueTrackerCard = ({ owner, repo, open_bugs, velocity_per_week, stale
35833
35854
  }
35834
35855
  )
35835
35856
  ] }),
35836
- /* @__PURE__ */ jsx114(StaleIssueList, { issues: stale_issues })
35857
+ /* @__PURE__ */ jsx114(StaleIssueList, { issues: Array.isArray(stale_issues) ? stale_issues : [] })
35837
35858
  ] })
35838
35859
  ] });
35839
35860
  };
@@ -35876,6 +35897,8 @@ var DataTable = ({
35876
35897
  rows,
35877
35898
  loading
35878
35899
  }) => {
35900
+ const safeColumns = Array.isArray(columns) ? columns : [];
35901
+ const safeRows = Array.isArray(rows) ? rows : [];
35879
35902
  return /* @__PURE__ */ jsxs76(
35880
35903
  "div",
35881
35904
  {
@@ -35894,7 +35917,7 @@ var DataTable = ({
35894
35917
  }
35895
35918
  ) }),
35896
35919
  /* @__PURE__ */ jsx115("div", { className: "px-3 pb-3 overflow-x-auto", style: hideScrollbar4, children: loading ? /* @__PURE__ */ jsx115("div", { className: "space-y-3 p-2", children: [...Array(3)].map((_, i) => /* @__PURE__ */ jsx115("div", { className: "h-8 rounded bg-[#27272a] animate-pulse" }, i)) }) : /* @__PURE__ */ jsxs76("table", { className: "w-full text-sm", children: [
35897
- /* @__PURE__ */ jsx115("thead", { children: /* @__PURE__ */ jsx115("tr", { className: "border-b border-[#3f3f46]/40", children: columns.map((col) => /* @__PURE__ */ jsx115(
35920
+ /* @__PURE__ */ jsx115("thead", { children: /* @__PURE__ */ jsx115("tr", { className: "border-b border-[#3f3f46]/40", children: safeColumns.map((col) => /* @__PURE__ */ jsx115(
35898
35921
  "th",
35899
35922
  {
35900
35923
  className: cn(
@@ -35906,14 +35929,14 @@ var DataTable = ({
35906
35929
  col.key
35907
35930
  )) }) }),
35908
35931
  /* @__PURE__ */ jsxs76("tbody", { children: [
35909
- rows.map((row, rowIdx) => /* @__PURE__ */ jsx115(
35932
+ safeRows.map((row, rowIdx) => /* @__PURE__ */ jsx115(
35910
35933
  "tr",
35911
35934
  {
35912
35935
  className: cn(
35913
35936
  "transition-colors hover:bg-[#27272a]/40",
35914
- rowIdx !== rows.length - 1 && "border-b border-[#27272a]/50"
35937
+ rowIdx !== safeRows.length - 1 && "border-b border-[#27272a]/50"
35915
35938
  ),
35916
- children: columns.map((col) => {
35939
+ children: safeColumns.map((col) => {
35917
35940
  const cellColor = getCellColor(col.type, row[col.key]);
35918
35941
  return /* @__PURE__ */ jsx115(
35919
35942
  "td",
@@ -35932,10 +35955,10 @@ var DataTable = ({
35932
35955
  },
35933
35956
  rowIdx
35934
35957
  )),
35935
- rows.length === 0 && /* @__PURE__ */ jsx115("tr", { children: /* @__PURE__ */ jsx115(
35958
+ safeRows.length === 0 && /* @__PURE__ */ jsx115("tr", { children: /* @__PURE__ */ jsx115(
35936
35959
  "td",
35937
35960
  {
35938
- colSpan: columns.length,
35961
+ colSpan: safeColumns.length,
35939
35962
  className: "px-3 py-6 text-center text-xs text-gray-500 italic",
35940
35963
  children: "No data available"
35941
35964
  }
@@ -35967,7 +35990,8 @@ var AutoChart = ({
35967
35990
  type = "bar",
35968
35991
  loading
35969
35992
  }) => {
35970
- const maxValue = Math.max(...data.map((d) => d.value), 1);
35993
+ const safeData = Array.isArray(data) ? data : [];
35994
+ const maxValue = safeData.length ? Math.max(...safeData.map((d) => d.value), 1) : 1;
35971
35995
  return /* @__PURE__ */ jsxs77(
35972
35996
  "div",
35973
35997
  {
@@ -35992,7 +36016,7 @@ var AutoChart = ({
35992
36016
  style: { height: `${40 + i * 25}%` }
35993
36017
  },
35994
36018
  i
35995
- )) }) : type === "bar" ? /* @__PURE__ */ jsx116("div", { className: "flex items-end gap-3 h-[140px] w-full justify-center", children: data.map((point, idx) => {
36019
+ )) }) : type === "bar" ? /* @__PURE__ */ jsx116("div", { className: "flex items-end gap-3 h-[140px] w-full justify-center", children: safeData.map((point, idx) => {
35996
36020
  const heightPercent = point.value / maxValue * 100;
35997
36021
  const color = point.color || DEFAULT_COLORS[idx % DEFAULT_COLORS.length];
35998
36022
  return /* @__PURE__ */ jsxs77(
@@ -36018,7 +36042,7 @@ var AutoChart = ({
36018
36042
  );
36019
36043
  }) }) : (
36020
36044
  /* Horizontal bar chart */
36021
- /* @__PURE__ */ jsx116("div", { className: "flex flex-col gap-2.5 w-full", children: data.map((point, idx) => {
36045
+ /* @__PURE__ */ jsx116("div", { className: "flex flex-col gap-2.5 w-full", children: safeData.map((point, idx) => {
36022
36046
  const widthPercent = point.value / maxValue * 100;
36023
36047
  const color = point.color || DEFAULT_COLORS[idx % DEFAULT_COLORS.length];
36024
36048
  return /* @__PURE__ */ jsxs77("div", { className: "space-y-1", children: [
@@ -36112,7 +36136,7 @@ var GoogleSheetsCard = ({
36112
36136
  ] });
36113
36137
  };
36114
36138
  function autoGenerateChart(columns, rows) {
36115
- if (!rows.length || !columns.length) return null;
36139
+ if (!Array.isArray(rows) || !Array.isArray(columns) || !rows.length || !columns.length) return null;
36116
36140
  const labelCol = columns.find(
36117
36141
  (c) => c.type === "text" || c.type === void 0
36118
36142
  );
@@ -36331,6 +36355,7 @@ var GitHubReposListCard = ({
36331
36355
  className,
36332
36356
  sendMessage
36333
36357
  }) => {
36358
+ const safeRepos = Array.isArray(repos) ? repos : [];
36334
36359
  const handleRepoClick = (repo) => {
36335
36360
  sendMessage?.(`Use repo ${repo.full_name}`);
36336
36361
  };
@@ -36350,7 +36375,7 @@ var GitHubReposListCard = ({
36350
36375
  /* @__PURE__ */ jsx119("span", { className: "text-sm font-semibold text-white", children: "Your Repositories" }),
36351
36376
  /* @__PURE__ */ jsxs80("span", { className: "text-xs text-gray-500", children: [
36352
36377
  "(",
36353
- repos.length,
36378
+ safeRepos.length,
36354
36379
  ")"
36355
36380
  ] })
36356
36381
  ] }),
@@ -36364,7 +36389,7 @@ var GitHubReposListCard = ({
36364
36389
  maxHeight: 380,
36365
36390
  overflowY: "auto"
36366
36391
  },
36367
- children: repos.length === 0 ? /* @__PURE__ */ jsx119("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No repositories found." }) : /* @__PURE__ */ jsx119("div", { className: "divide-y divide-white/5 py-1", children: repos.map((repo) => /* @__PURE__ */ jsx119(
36392
+ children: safeRepos.length === 0 ? /* @__PURE__ */ jsx119("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No repositories found." }) : /* @__PURE__ */ jsx119("div", { className: "divide-y divide-white/5 py-1", children: safeRepos.map((repo) => /* @__PURE__ */ jsx119(
36368
36393
  RepoRow,
36369
36394
  {
36370
36395
  repo,
@@ -36422,6 +36447,7 @@ function timeAgo2(dateStr) {
36422
36447
  return `${months}mo ago`;
36423
36448
  }
36424
36449
  var SpreadsheetRow = ({ spreadsheet, onClick }) => {
36450
+ const safeSheets = Array.isArray(spreadsheet.sheets) ? spreadsheet.sheets : [];
36425
36451
  return /* @__PURE__ */ jsx120(
36426
36452
  "button",
36427
36453
  {
@@ -36441,7 +36467,7 @@ var SpreadsheetRow = ({ spreadsheet, onClick }) => {
36441
36467
  timeAgo2(spreadsheet.modified_time)
36442
36468
  ] })
36443
36469
  ] }),
36444
- spreadsheet.sheets.length > 0 && /* @__PURE__ */ jsx120("div", { className: "mt-1.5 flex flex-wrap gap-1", children: spreadsheet.sheets.map((tab) => /* @__PURE__ */ jsx120(
36470
+ safeSheets.length > 0 && /* @__PURE__ */ jsx120("div", { className: "mt-1.5 flex flex-wrap gap-1", children: safeSheets.map((tab) => /* @__PURE__ */ jsx120(
36445
36471
  "span",
36446
36472
  {
36447
36473
  className: "inline-block rounded px-1.5 py-0.5 text-[10px] font-medium",
@@ -36474,8 +36500,10 @@ var GoogleSheetsListCard = ({
36474
36500
  className,
36475
36501
  sendMessage
36476
36502
  }) => {
36503
+ const safeSpreadsheets = Array.isArray(spreadsheets) ? spreadsheets : [];
36477
36504
  const handleSheetClick = (spreadsheet) => {
36478
- const firstTab = spreadsheet.sheets.length > 0 ? spreadsheet.sheets[0].title : "Sheet1";
36505
+ const safeSheets = Array.isArray(spreadsheet.sheets) ? spreadsheet.sheets : [];
36506
+ const firstTab = safeSheets.length > 0 ? safeSheets[0].title : "Sheet1";
36479
36507
  sendMessage?.(
36480
36508
  `Read spreadsheet "${spreadsheet.name}" (ID: ${spreadsheet.id}), tab: ${firstTab}`
36481
36509
  );
@@ -36486,7 +36514,7 @@ var GoogleSheetsListCard = ({
36486
36514
  /* @__PURE__ */ jsx120("span", { className: "text-sm font-semibold text-white", children: "Your Spreadsheets" }),
36487
36515
  /* @__PURE__ */ jsxs81("span", { className: "text-xs text-gray-500", children: [
36488
36516
  "(",
36489
- spreadsheets.length,
36517
+ safeSpreadsheets.length,
36490
36518
  ")"
36491
36519
  ] })
36492
36520
  ] }),
@@ -36500,7 +36528,7 @@ var GoogleSheetsListCard = ({
36500
36528
  maxHeight: 380,
36501
36529
  overflowY: "auto"
36502
36530
  },
36503
- children: spreadsheets.length === 0 ? /* @__PURE__ */ jsx120("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No spreadsheets found." }) : /* @__PURE__ */ jsx120("div", { className: "divide-y divide-white/5 py-1", children: spreadsheets.map((spreadsheet) => /* @__PURE__ */ jsx120(
36531
+ children: safeSpreadsheets.length === 0 ? /* @__PURE__ */ jsx120("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No spreadsheets found." }) : /* @__PURE__ */ jsx120("div", { className: "divide-y divide-white/5 py-1", children: safeSpreadsheets.map((spreadsheet) => /* @__PURE__ */ jsx120(
36504
36532
  SpreadsheetRow,
36505
36533
  {
36506
36534
  spreadsheet,
@@ -36886,9 +36914,10 @@ var InputWidget = ({
36886
36914
  onAction,
36887
36915
  isSubmitting = false
36888
36916
  }) => {
36917
+ const safeFields = Array.isArray(fields) ? fields : [];
36889
36918
  const [values, setValues] = React96.useState(() => {
36890
36919
  const initial = {};
36891
- for (const f of fields) {
36920
+ for (const f of safeFields) {
36892
36921
  initial[f.key] = f.defaultValue ?? defaultForKind(f.kind);
36893
36922
  }
36894
36923
  return initial;
@@ -36896,7 +36925,7 @@ var InputWidget = ({
36896
36925
  const update = (key, v) => {
36897
36926
  setValues((prev) => ({ ...prev, [key]: v }));
36898
36927
  };
36899
- const buildElementsForSubmission = () => fields.map((f) => ({
36928
+ const buildElementsForSubmission = () => safeFields.map((f) => ({
36900
36929
  id: `${id}-${f.key}`,
36901
36930
  atomName: kindToAtomName(f.kind),
36902
36931
  props: {
@@ -36928,7 +36957,7 @@ var InputWidget = ({
36928
36957
  }
36929
36958
  if (action === "reset") {
36930
36959
  const reset = {};
36931
- for (const f of fields) reset[f.key] = f.defaultValue ?? defaultForKind(f.kind);
36960
+ for (const f of safeFields) reset[f.key] = f.defaultValue ?? defaultForKind(f.kind);
36932
36961
  setValues(reset);
36933
36962
  }
36934
36963
  onAction?.(action, payload);
@@ -36944,7 +36973,7 @@ var InputWidget = ({
36944
36973
  title && /* @__PURE__ */ jsx123("h3", { className: "text-base font-semibold", style: { color: "var(--px-text-color, inherit)" }, children: title }),
36945
36974
  description && /* @__PURE__ */ jsx123("p", { className: "text-sm opacity-80", style: { color: "var(--px-text-color, inherit)" }, children: description })
36946
36975
  ] }),
36947
- /* @__PURE__ */ jsx123("div", { className: "flex flex-col gap-4", children: fields.map((field) => /* @__PURE__ */ jsx123(
36976
+ /* @__PURE__ */ jsx123("div", { className: "flex flex-col gap-4", children: safeFields.map((field) => /* @__PURE__ */ jsx123(
36948
36977
  FieldRenderer,
36949
36978
  {
36950
36979
  field,
@@ -37162,7 +37191,7 @@ var TrendBadge = ({ item }) => {
37162
37191
  var KPIStatsCard = React97.memo(
37163
37192
  ({ title, subtitle, stats, items, theme, className, onAction: _onAction }) => {
37164
37193
  const s = th(theme);
37165
- const displayStats = stats || items || [];
37194
+ const displayStats = Array.isArray(stats) ? stats : Array.isArray(items) ? items : [];
37166
37195
  return /* @__PURE__ */ jsxs85(
37167
37196
  "div",
37168
37197
  {
@@ -37264,7 +37293,7 @@ var ApprovalCard = React98.memo(
37264
37293
  sendMessage?.(`${labels[next]}: ${title}`);
37265
37294
  onAction?.({ type: "approval", value: next, title });
37266
37295
  };
37267
- const config = STATUS_CONFIG2[status];
37296
+ const config = STATUS_CONFIG2[status] ?? STATUS_CONFIG2.pending;
37268
37297
  const StatusIcon = config.icon;
37269
37298
  return /* @__PURE__ */ jsxs86(
37270
37299
  "div",
@@ -37292,7 +37321,7 @@ var ApprovalCard = React98.memo(
37292
37321
  style: i < details.length - 1 ? { borderBottomColor: theme?.border } : {},
37293
37322
  children: [
37294
37323
  /* @__PURE__ */ jsx125("span", { className: "text-cardText/50", style: s.muted, children: d.label }),
37295
- /* @__PURE__ */ jsx125("span", { className: "font-medium text-cardText", style: s.text, children: d.value })
37324
+ /* @__PURE__ */ jsx125("span", { className: "font-medium text-cardText", style: s.text, children: typeof d.value === "object" ? JSON.stringify(d.value) : String(d.value ?? "") })
37296
37325
  ]
37297
37326
  },
37298
37327
  i
@@ -37356,7 +37385,7 @@ var StepDot = ({ step, accentColor }) => {
37356
37385
  var TimelineCard = React99.memo(
37357
37386
  ({ title, steps, milestones, theme, className, onAction: _onAction }) => {
37358
37387
  const s = th(theme);
37359
- const displaySteps = steps || milestones || [];
37388
+ const displaySteps = Array.isArray(steps) ? steps : Array.isArray(milestones) ? milestones : [];
37360
37389
  return /* @__PURE__ */ jsxs87("div", { className: cn("w-full rounded-[16px] border border-gray400 bg-cardSurface p-4", className), style: s.root, children: [
37361
37390
  title && /* @__PURE__ */ jsx126("h3", { className: "mb-4 text-sm font-semibold text-cardText", style: s.text, children: title }),
37362
37391
  /* @__PURE__ */ jsx126("div", { className: "space-y-0", children: displaySteps.map((step, idx) => {
@@ -37546,7 +37575,7 @@ var DataTableCard = React101.memo(
37546
37575
  className: cn("border-b border-gray400/40 transition-colors hover:bg-white/[0.02]", rowIdx === safeRows.length - 1 && "border-b-0"),
37547
37576
  style: { borderBottomColor: theme?.border },
37548
37577
  children: cols.map((col, colIdx) => {
37549
- const raw = row?.[col.key] ?? row?.[col.label];
37578
+ const raw = Array.isArray(row) ? row[colIdx] : row?.[col.key] ?? row?.[col.label];
37550
37579
  const cell = raw ?? "\u2014";
37551
37580
  const isHighlight = highlight != null && (col.key === highlight || col.label === highlight);
37552
37581
  return /* @__PURE__ */ jsx128(
@@ -37591,7 +37620,7 @@ var ChecklistCard = React102.memo(
37591
37620
  onAction
37592
37621
  }) => {
37593
37622
  const s = th(theme);
37594
- const source = items || tasks || [];
37623
+ const source = Array.isArray(items) ? items : Array.isArray(tasks) ? tasks : [];
37595
37624
  const [checked, setChecked] = React102.useState(
37596
37625
  () => new Set(source.filter((i) => i.checked).map((i) => i.id))
37597
37626
  );
@@ -37726,7 +37755,7 @@ var PollCard = React103.memo(
37726
37755
  onAction
37727
37756
  }) => {
37728
37757
  const s = th(theme);
37729
- const source = options || choices || [];
37758
+ const source = Array.isArray(options) ? options : Array.isArray(choices) ? choices : [];
37730
37759
  const [selected, setSelected] = React103.useState(/* @__PURE__ */ new Set());
37731
37760
  const [hasVoted, setHasVoted] = React103.useState(false);
37732
37761
  const [voteCounts, setVoteCounts] = React103.useState(
@@ -37773,7 +37802,9 @@ Selected: ${labels.join(", ")}`);
37773
37802
  const isSelected = selected.has(opt.id);
37774
37803
  const count = voteCounts[opt.id] ?? 0;
37775
37804
  const pct = hasVoted && displayTotal > 0 ? Math.round(count / displayTotal * 100) : 0;
37776
- const isWinner = hasVoted && count === Math.max(...Object.values(voteCounts));
37805
+ const voteCountValues = Object.values(voteCounts);
37806
+ const maxVotes = voteCountValues.length ? Math.max(...voteCountValues) : 0;
37807
+ const isWinner = hasVoted && count === maxVotes;
37777
37808
  const accentSubtleBg = theme?.accent ? withAlpha(theme.accent, 0.1) : void 0;
37778
37809
  return /* @__PURE__ */ jsxs91(
37779
37810
  "div",
@@ -37877,8 +37908,8 @@ var STATUS_STYLES = {
37877
37908
  cancelled: { label: "Cancelled", className: "text-rose-400 bg-rose-500/10 border-rose-500/20", dot: "bg-rose-400" }
37878
37909
  };
37879
37910
  function AvatarInitials({ name }) {
37880
- const initials = name.split(" ").map((p) => p[0]).slice(0, 2).join("").toUpperCase();
37881
- const hue = name.split("").reduce((acc, ch) => acc + ch.charCodeAt(0), 0) % 360;
37911
+ const initials = (name ?? "").split(" ").map((p) => p[0]).slice(0, 2).join("").toUpperCase();
37912
+ const hue = (name ?? "").split("").reduce((acc, ch) => acc + ch.charCodeAt(0), 0) % 360;
37882
37913
  return /* @__PURE__ */ jsx131(
37883
37914
  "div",
37884
37915
  {
@@ -37905,17 +37936,18 @@ var CalendarEventCard = React104.memo(
37905
37936
  onAction
37906
37937
  }) => {
37907
37938
  const s = th(theme);
37908
- const cfg = STATUS_STYLES[status];
37939
+ const cfg = STATUS_STYLES[status] ?? STATUS_STYLES.upcoming;
37909
37940
  const parsedDate = React104.useMemo(() => {
37910
37941
  try {
37911
- const d = new Date(date);
37942
+ const safeDate = date ?? "";
37943
+ const d = new Date(safeDate);
37912
37944
  if (isNaN(d.getTime())) {
37913
- const parts = date.split(/[\s,]+/);
37914
- return { day: parts[1] || date, month: parts[0] || "" };
37945
+ const parts = safeDate.split(/[\s,]+/);
37946
+ return { day: parts[1] || safeDate, month: parts[0] || "" };
37915
37947
  }
37916
37948
  return { day: d.getDate().toString(), month: d.toLocaleString("en", { month: "short" }) };
37917
37949
  } catch {
37918
- return { day: date, month: "" };
37950
+ return { day: date ?? "", month: "" };
37919
37951
  }
37920
37952
  }, [date]);
37921
37953
  const handleJoin = (e) => {
@@ -38031,13 +38063,13 @@ var BudgetAllocCard = React105.memo(
38031
38063
  onAction: _onAction
38032
38064
  }) => {
38033
38065
  const s = th(theme);
38034
- const source = items || allocations || [];
38035
- const computedTotal = total ?? source.reduce((sum, i) => sum + i.amount, 0);
38066
+ const source = Array.isArray(items) ? items : Array.isArray(allocations) ? allocations : [];
38067
+ const computedTotal = total ?? source.reduce((sum, i) => sum + (Number(i.amount) || 0), 0);
38036
38068
  const paletteWithAccent = [theme?.accent ?? PALETTE[0], ...PALETTE.slice(1)];
38037
38069
  const segments = source.map((item, idx) => ({
38038
38070
  ...item,
38039
38071
  color: item.color || paletteWithAccent[idx % paletteWithAccent.length],
38040
- pct: computedTotal > 0 ? item.amount / computedTotal * 100 : 0
38072
+ pct: computedTotal > 0 ? (Number(item.amount) || 0) / computedTotal * 100 : 0
38041
38073
  }));
38042
38074
  return /* @__PURE__ */ jsxs93(
38043
38075
  "div",
@@ -38158,6 +38190,8 @@ var ComparisonCard = React106.memo(
38158
38190
  onAction
38159
38191
  }) => {
38160
38192
  const s = th(theme);
38193
+ const safeOptions = Array.isArray(options) ? options : [];
38194
+ const safeAttributeLabels = Array.isArray(attribute_labels) ? attribute_labels : [];
38161
38195
  const [selected, setSelected] = React106.useState(null);
38162
38196
  const [isSubmitted, setIsSubmitted] = React106.useState(false);
38163
38197
  const isInteractive = isLatestMessage && !disabled && !isSubmitted;
@@ -38194,8 +38228,8 @@ var ComparisonCard = React106.memo(
38194
38228
  "div",
38195
38229
  {
38196
38230
  className: "grid gap-3",
38197
- style: { gridTemplateColumns: `repeat(${options.length}, minmax(0, 1fr))` },
38198
- children: options.map((opt) => {
38231
+ style: { gridTemplateColumns: `repeat(${safeOptions.length}, minmax(0, 1fr))` },
38232
+ children: safeOptions.map((opt) => {
38199
38233
  const isChosen = selected === opt.id;
38200
38234
  const isGoldBadge = !opt.badge_color || opt.badge_color === "gold";
38201
38235
  const badgeColor = opt.badge_color ? BADGE_COLORS[opt.badge_color] : BADGE_COLORS.gold;
@@ -38240,8 +38274,8 @@ var ComparisonCard = React106.memo(
38240
38274
  ]
38241
38275
  }
38242
38276
  ),
38243
- /* @__PURE__ */ jsx133("div", { className: "flex flex-col divide-y divide-gray400/30 flex-1", children: attribute_labels.map((attrLabel, rowIdx) => {
38244
- const attr = opt.attributes[rowIdx];
38277
+ /* @__PURE__ */ jsx133("div", { className: "flex flex-col divide-y divide-gray400/30 flex-1", children: safeAttributeLabels.map((attrLabel, rowIdx) => {
38278
+ const attr = opt.attributes?.[rowIdx];
38245
38279
  return /* @__PURE__ */ jsxs94(
38246
38280
  "div",
38247
38281
  {
@@ -38451,7 +38485,7 @@ var ResearchBriefCard = ({
38451
38485
  item.label,
38452
38486
  ": "
38453
38487
  ] }),
38454
- /* @__PURE__ */ jsx135("span", { className: "text-muted-foreground", children: item.value })
38488
+ /* @__PURE__ */ jsx135("span", { className: "text-muted-foreground", children: typeof item.value === "object" ? JSON.stringify(item.value) : String(item.value ?? "") })
38455
38489
  ] }, `${item.label}-${idx}`)) })
38456
38490
  ] })
38457
38491
  ]
@@ -38472,6 +38506,7 @@ var PriorityActionsCard = ({
38472
38506
  actions,
38473
38507
  className
38474
38508
  }) => {
38509
+ const safeActions = Array.isArray(actions) ? actions : [];
38475
38510
  return /* @__PURE__ */ jsxs97(
38476
38511
  "div",
38477
38512
  {
@@ -38482,7 +38517,7 @@ var PriorityActionsCard = ({
38482
38517
  children: [
38483
38518
  /* @__PURE__ */ jsx136("h3", { className: "text-base font-semibold text-foreground", children: title }),
38484
38519
  summary ? /* @__PURE__ */ jsx136("p", { className: "mt-2 text-sm leading-relaxed text-muted-foreground", children: summary }) : null,
38485
- /* @__PURE__ */ jsx136("div", { className: "mt-4 space-y-2.5", children: actions.map((action, idx) => /* @__PURE__ */ jsxs97(
38520
+ /* @__PURE__ */ jsx136("div", { className: "mt-4 space-y-2.5", children: safeActions.map((action, idx) => /* @__PURE__ */ jsxs97(
38486
38521
  "div",
38487
38522
  {
38488
38523
  className: "rounded-xl border border-border/70 bg-background/50 p-3",
@@ -38545,7 +38580,7 @@ var CampaignBriefCard = ({
38545
38580
  ] }),
38546
38581
  constraints.length > 0 ? /* @__PURE__ */ jsx137("ul", { className: "mt-4 space-y-1.5 text-sm text-foreground/90", children: constraints.map((item, i) => /* @__PURE__ */ jsxs98("li", { children: [
38547
38582
  "- ",
38548
- item
38583
+ typeof item === "object" ? JSON.stringify(item) : String(item ?? "")
38549
38584
  ] }, `${item}-${i}`)) }) : null
38550
38585
  ] });
38551
38586
  };
@@ -38560,16 +38595,17 @@ var DataSourceChecklistCard = ({
38560
38595
  className,
38561
38596
  onAction
38562
38597
  }) => {
38563
- const connectedCount = items.filter((i) => i.connected).length;
38598
+ const safeItems = Array.isArray(items) ? items : [];
38599
+ const connectedCount = safeItems.filter((i) => i.connected).length;
38564
38600
  return /* @__PURE__ */ jsxs99("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38565
38601
  /* @__PURE__ */ jsx138("h3", { className: "text-base font-semibold text-foreground", children: title }),
38566
38602
  /* @__PURE__ */ jsxs99("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38567
38603
  connectedCount,
38568
38604
  "/",
38569
- items.length,
38605
+ safeItems.length,
38570
38606
  " connected"
38571
38607
  ] }),
38572
- /* @__PURE__ */ jsx138("div", { className: "mt-3 space-y-2", children: items.map((item) => /* @__PURE__ */ jsxs99("div", { className: "rounded-xl border border-border/70 bg-background/60 p-3", children: [
38608
+ /* @__PURE__ */ jsx138("div", { className: "mt-3 space-y-2", children: safeItems.map((item) => /* @__PURE__ */ jsxs99("div", { className: "rounded-xl border border-border/70 bg-background/60 p-3", children: [
38573
38609
  /* @__PURE__ */ jsxs99("div", { className: "flex items-center justify-between gap-2", children: [
38574
38610
  /* @__PURE__ */ jsx138("p", { className: "text-sm font-medium text-foreground", children: item.source }),
38575
38611
  /* @__PURE__ */ jsx138("span", { className: cn("text-xs font-semibold", item.connected ? "text-emerald-600" : "text-amber-600"), children: item.connected ? "Connected" : "Pending" })
@@ -38602,7 +38638,7 @@ var GoalAlignmentCard = ({
38602
38638
  className
38603
38639
  }) => /* @__PURE__ */ jsxs100("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38604
38640
  /* @__PURE__ */ jsx139("h3", { className: "text-base font-semibold text-foreground", children: title }),
38605
- /* @__PURE__ */ jsx139("div", { className: "mt-3 space-y-2", children: goals.map((item, i) => /* @__PURE__ */ jsxs100("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38641
+ /* @__PURE__ */ jsx139("div", { className: "mt-3 space-y-2", children: (Array.isArray(goals) ? goals : []).map((item, i) => /* @__PURE__ */ jsxs100("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38606
38642
  /* @__PURE__ */ jsxs100("div", { className: "flex items-center justify-between gap-2", children: [
38607
38643
  /* @__PURE__ */ jsx139("p", { className: "text-sm font-medium text-foreground", children: item.goal }),
38608
38644
  item.status ? /* @__PURE__ */ jsx139("span", { className: cn("text-xs font-semibold", statusColor[item.status]), children: item.status }) : null
@@ -38619,7 +38655,7 @@ var AudiencePersonaCard = ({
38619
38655
  className
38620
38656
  }) => /* @__PURE__ */ jsxs101("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38621
38657
  /* @__PURE__ */ jsx140("h3", { className: "text-base font-semibold text-foreground", children: title }),
38622
- /* @__PURE__ */ jsx140("div", { className: "mt-3 space-y-2", children: segments.map((segment, i) => /* @__PURE__ */ jsxs101("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38658
+ /* @__PURE__ */ jsx140("div", { className: "mt-3 space-y-2", children: (Array.isArray(segments) ? segments : []).map((segment, i) => /* @__PURE__ */ jsxs101("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38623
38659
  /* @__PURE__ */ jsxs101("div", { className: "flex items-center justify-between gap-2", children: [
38624
38660
  /* @__PURE__ */ jsx140("p", { className: "text-sm font-medium text-foreground", children: segment.name }),
38625
38661
  segment.percentage !== void 0 ? /* @__PURE__ */ jsxs101("span", { className: "text-xs text-muted-foreground", children: [
@@ -38640,20 +38676,23 @@ var ChannelPlanCard = ({
38640
38676
  title,
38641
38677
  plans,
38642
38678
  className
38643
- }) => /* @__PURE__ */ jsxs102("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38644
- /* @__PURE__ */ jsx141("h3", { className: "text-base font-semibold text-foreground", children: title }),
38645
- /* @__PURE__ */ jsx141("div", { className: "mt-3 space-y-2", children: plans.map((plan, i) => /* @__PURE__ */ jsxs102("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38646
- /* @__PURE__ */ jsx141("p", { className: "text-sm font-medium text-foreground", children: plan.channel }),
38647
- plan.objective ? /* @__PURE__ */ jsxs102("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38648
- "Objective: ",
38649
- plan.objective
38650
- ] }) : null,
38651
- plan.cadence ? /* @__PURE__ */ jsxs102("p", { className: "text-xs text-muted-foreground", children: [
38652
- "Cadence: ",
38653
- plan.cadence
38654
- ] }) : null
38655
- ] }, `${plan.channel}-${i}`)) })
38656
- ] });
38679
+ }) => {
38680
+ const safePlans = Array.isArray(plans) ? plans : [];
38681
+ return /* @__PURE__ */ jsxs102("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38682
+ /* @__PURE__ */ jsx141("h3", { className: "text-base font-semibold text-foreground", children: title }),
38683
+ /* @__PURE__ */ jsx141("div", { className: "mt-3 space-y-2", children: safePlans.map((plan, i) => /* @__PURE__ */ jsxs102("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38684
+ /* @__PURE__ */ jsx141("p", { className: "text-sm font-medium text-foreground", children: plan.channel }),
38685
+ plan.objective ? /* @__PURE__ */ jsxs102("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38686
+ "Objective: ",
38687
+ plan.objective
38688
+ ] }) : null,
38689
+ plan.cadence ? /* @__PURE__ */ jsxs102("p", { className: "text-xs text-muted-foreground", children: [
38690
+ "Cadence: ",
38691
+ plan.cadence
38692
+ ] }) : null
38693
+ ] }, `${plan.channel}-${i}`)) })
38694
+ ] });
38695
+ };
38657
38696
 
38658
38697
  // src/molecules/generic/InsightDigestCard/InsightDigestCard.tsx
38659
38698
  import { jsx as jsx142, jsxs as jsxs103 } from "react/jsx-runtime";
@@ -38667,17 +38706,20 @@ var InsightDigestCard = ({
38667
38706
  summary,
38668
38707
  insights,
38669
38708
  className
38670
- }) => /* @__PURE__ */ jsxs103("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38671
- /* @__PURE__ */ jsx142("h3", { className: "text-base font-semibold text-foreground", children: title }),
38672
- summary ? /* @__PURE__ */ jsx142("p", { className: "mt-2 text-sm text-muted-foreground", children: summary }) : null,
38673
- /* @__PURE__ */ jsx142("div", { className: "mt-3 space-y-2", children: insights.map((item, i) => /* @__PURE__ */ jsxs103("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38674
- /* @__PURE__ */ jsxs103("div", { className: "flex items-center justify-between gap-2", children: [
38675
- /* @__PURE__ */ jsx142("p", { className: "text-sm font-medium text-foreground", children: item.label }),
38676
- item.confidence ? /* @__PURE__ */ jsx142("span", { className: cn("text-xs font-semibold", confidenceColor[item.confidence]), children: item.confidence }) : null
38677
- ] }),
38678
- /* @__PURE__ */ jsx142("p", { className: "mt-1 text-sm text-muted-foreground", children: item.detail })
38679
- ] }, `${item.label}-${i}`)) })
38680
- ] });
38709
+ }) => {
38710
+ const safeInsights = Array.isArray(insights) ? insights : [];
38711
+ return /* @__PURE__ */ jsxs103("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38712
+ /* @__PURE__ */ jsx142("h3", { className: "text-base font-semibold text-foreground", children: title }),
38713
+ summary ? /* @__PURE__ */ jsx142("p", { className: "mt-2 text-sm text-muted-foreground", children: summary }) : null,
38714
+ /* @__PURE__ */ jsx142("div", { className: "mt-3 space-y-2", children: safeInsights.map((item, i) => /* @__PURE__ */ jsxs103("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38715
+ /* @__PURE__ */ jsxs103("div", { className: "flex items-center justify-between gap-2", children: [
38716
+ /* @__PURE__ */ jsx142("p", { className: "text-sm font-medium text-foreground", children: item.label }),
38717
+ item.confidence ? /* @__PURE__ */ jsx142("span", { className: cn("text-xs font-semibold", confidenceColor[item.confidence]), children: item.confidence }) : null
38718
+ ] }),
38719
+ /* @__PURE__ */ jsx142("p", { className: "mt-1 text-sm text-muted-foreground", children: item.detail })
38720
+ ] }, `${item.label}-${i}`)) })
38721
+ ] });
38722
+ };
38681
38723
 
38682
38724
  // src/molecules/generic/ActionPriorityCard/ActionPriorityCard.tsx
38683
38725
  import { jsx as jsx143, jsxs as jsxs104 } from "react/jsx-runtime";
@@ -38690,20 +38732,23 @@ var ActionPriorityCard = ({
38690
38732
  title,
38691
38733
  actions,
38692
38734
  className
38693
- }) => /* @__PURE__ */ jsxs104("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38694
- /* @__PURE__ */ jsx143("h3", { className: "text-base font-semibold text-foreground", children: title }),
38695
- /* @__PURE__ */ jsx143("div", { className: "mt-3 space-y-2", children: actions.map((action, i) => /* @__PURE__ */ jsxs104("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38696
- /* @__PURE__ */ jsxs104("div", { className: "flex items-center justify-between gap-2", children: [
38697
- /* @__PURE__ */ jsx143("p", { className: "text-sm font-medium text-foreground", children: action.title }),
38698
- action.priority ? /* @__PURE__ */ jsx143("span", { className: cn("rounded-full px-2.5 py-1 text-[11px] font-semibold", priorityBadge[action.priority]), children: action.priority }) : null
38699
- ] }),
38700
- action.owner || action.timeline ? /* @__PURE__ */ jsxs104("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38701
- action.owner ? `Owner: ${action.owner}` : "",
38702
- action.owner && action.timeline ? " \u2022 " : "",
38703
- action.timeline ? `Timeline: ${action.timeline}` : ""
38704
- ] }) : null
38705
- ] }, `${action.title}-${i}`)) })
38706
- ] });
38735
+ }) => {
38736
+ const safeActions = Array.isArray(actions) ? actions : [];
38737
+ return /* @__PURE__ */ jsxs104("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38738
+ /* @__PURE__ */ jsx143("h3", { className: "text-base font-semibold text-foreground", children: title }),
38739
+ /* @__PURE__ */ jsx143("div", { className: "mt-3 space-y-2", children: safeActions.map((action, i) => /* @__PURE__ */ jsxs104("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38740
+ /* @__PURE__ */ jsxs104("div", { className: "flex items-center justify-between gap-2", children: [
38741
+ /* @__PURE__ */ jsx143("p", { className: "text-sm font-medium text-foreground", children: action.title }),
38742
+ action.priority ? /* @__PURE__ */ jsx143("span", { className: cn("rounded-full px-2.5 py-1 text-[11px] font-semibold", priorityBadge[action.priority]), children: action.priority }) : null
38743
+ ] }),
38744
+ action.owner || action.timeline ? /* @__PURE__ */ jsxs104("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38745
+ action.owner ? `Owner: ${action.owner}` : "",
38746
+ action.owner && action.timeline ? " \u2022 " : "",
38747
+ action.timeline ? `Timeline: ${action.timeline}` : ""
38748
+ ] }) : null
38749
+ ] }, `${action.title}-${i}`)) })
38750
+ ] });
38751
+ };
38707
38752
 
38708
38753
  // src/molecules/generic/RiskSignalCard/RiskSignalCard.tsx
38709
38754
  import { jsx as jsx144, jsxs as jsxs105 } from "react/jsx-runtime";
@@ -38716,19 +38761,22 @@ var RiskSignalCard = ({
38716
38761
  title,
38717
38762
  risks,
38718
38763
  className
38719
- }) => /* @__PURE__ */ jsxs105("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38720
- /* @__PURE__ */ jsx144("h3", { className: "text-base font-semibold text-foreground", children: title }),
38721
- /* @__PURE__ */ jsx144("div", { className: "mt-3 space-y-2", children: risks.map((risk, i) => /* @__PURE__ */ jsxs105("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38722
- /* @__PURE__ */ jsxs105("div", { className: "flex items-center justify-between gap-2", children: [
38723
- /* @__PURE__ */ jsx144("p", { className: "text-sm font-medium text-foreground", children: risk.signal }),
38724
- risk.severity ? /* @__PURE__ */ jsx144("span", { className: cn("text-xs font-semibold", severityColor[risk.severity]), children: risk.severity }) : null
38725
- ] }),
38726
- risk.impact ? /* @__PURE__ */ jsxs105("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38727
- "Impact: ",
38728
- risk.impact
38729
- ] }) : null
38730
- ] }, `${risk.signal}-${i}`)) })
38731
- ] });
38764
+ }) => {
38765
+ const safeRisks = Array.isArray(risks) ? risks : [];
38766
+ return /* @__PURE__ */ jsxs105("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38767
+ /* @__PURE__ */ jsx144("h3", { className: "text-base font-semibold text-foreground", children: title }),
38768
+ /* @__PURE__ */ jsx144("div", { className: "mt-3 space-y-2", children: safeRisks.map((risk, i) => /* @__PURE__ */ jsxs105("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38769
+ /* @__PURE__ */ jsxs105("div", { className: "flex items-center justify-between gap-2", children: [
38770
+ /* @__PURE__ */ jsx144("p", { className: "text-sm font-medium text-foreground", children: risk.signal }),
38771
+ risk.severity ? /* @__PURE__ */ jsx144("span", { className: cn("text-xs font-semibold", severityColor[risk.severity]), children: risk.severity }) : null
38772
+ ] }),
38773
+ risk.impact ? /* @__PURE__ */ jsxs105("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38774
+ "Impact: ",
38775
+ risk.impact
38776
+ ] }) : null
38777
+ ] }, `${risk.signal}-${i}`)) })
38778
+ ] });
38779
+ };
38732
38780
 
38733
38781
  // src/molecules/generic/ScoreBreakdownCard/ScoreBreakdownCard.tsx
38734
38782
  import { jsx as jsx145, jsxs as jsxs106 } from "react/jsx-runtime";
@@ -38738,24 +38786,27 @@ var ScoreBreakdownCard = ({
38738
38786
  outOf = 100,
38739
38787
  items,
38740
38788
  className
38741
- }) => /* @__PURE__ */ jsxs106("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38742
- /* @__PURE__ */ jsxs106("div", { className: "flex items-center justify-between gap-2", children: [
38743
- /* @__PURE__ */ jsx145("h3", { className: "text-base font-semibold text-foreground", children: title }),
38744
- totalScore !== void 0 ? /* @__PURE__ */ jsxs106("span", { className: "rounded-full border border-border px-2.5 py-1 text-xs text-muted-foreground", children: [
38745
- totalScore,
38746
- "/",
38747
- outOf
38748
- ] }) : null
38749
- ] }),
38750
- /* @__PURE__ */ jsx145("div", { className: "mt-3 space-y-2", children: items.map((item, i) => /* @__PURE__ */ jsx145("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: /* @__PURE__ */ jsxs106("div", { className: "flex items-center justify-between gap-2 text-sm", children: [
38751
- /* @__PURE__ */ jsx145("p", { className: "font-medium text-foreground", children: item.label }),
38752
- /* @__PURE__ */ jsxs106("p", { className: "text-muted-foreground", children: [
38753
- item.score,
38754
- "/",
38755
- item.outOf ?? outOf
38756
- ] })
38757
- ] }) }, `${item.label}-${i}`)) })
38758
- ] });
38789
+ }) => {
38790
+ const safeItems = Array.isArray(items) ? items : [];
38791
+ return /* @__PURE__ */ jsxs106("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38792
+ /* @__PURE__ */ jsxs106("div", { className: "flex items-center justify-between gap-2", children: [
38793
+ /* @__PURE__ */ jsx145("h3", { className: "text-base font-semibold text-foreground", children: title }),
38794
+ totalScore !== void 0 ? /* @__PURE__ */ jsxs106("span", { className: "rounded-full border border-border px-2.5 py-1 text-xs text-muted-foreground", children: [
38795
+ totalScore,
38796
+ "/",
38797
+ outOf
38798
+ ] }) : null
38799
+ ] }),
38800
+ /* @__PURE__ */ jsx145("div", { className: "mt-3 space-y-2", children: safeItems.map((item, i) => /* @__PURE__ */ jsx145("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: /* @__PURE__ */ jsxs106("div", { className: "flex items-center justify-between gap-2 text-sm", children: [
38801
+ /* @__PURE__ */ jsx145("p", { className: "font-medium text-foreground", children: item.label }),
38802
+ /* @__PURE__ */ jsxs106("p", { className: "text-muted-foreground", children: [
38803
+ item.score,
38804
+ "/",
38805
+ item.outOf ?? outOf
38806
+ ] })
38807
+ ] }) }, `${item.label}-${i}`)) })
38808
+ ] });
38809
+ };
38759
38810
 
38760
38811
  // src/molecules/generic/NextStepCard/NextStepCard.tsx
38761
38812
  import { jsx as jsx146, jsxs as jsxs107 } from "react/jsx-runtime";
@@ -38765,26 +38816,29 @@ var NextStepCard = ({
38765
38816
  ctaLabel = "Proceed",
38766
38817
  className,
38767
38818
  onAction
38768
- }) => /* @__PURE__ */ jsxs107("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38769
- /* @__PURE__ */ jsx146("h3", { className: "text-base font-semibold text-foreground", children: title }),
38770
- /* @__PURE__ */ jsx146("div", { className: "mt-3 space-y-2", children: steps.map((item, i) => /* @__PURE__ */ jsxs107("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3 text-sm", children: [
38771
- /* @__PURE__ */ jsx146("p", { className: "font-medium text-foreground", children: item.step }),
38772
- item.owner || item.due ? /* @__PURE__ */ jsxs107("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38773
- item.owner ? `Owner: ${item.owner}` : "",
38774
- item.owner && item.due ? " \u2022 " : "",
38775
- item.due ? `Due: ${item.due}` : ""
38776
- ] }) : null
38777
- ] }, `${item.step}-${i}`)) }),
38778
- /* @__PURE__ */ jsx146(
38779
- "button",
38780
- {
38781
- type: "button",
38782
- onClick: () => onAction?.({ type: "next_step_continue", stepsCount: steps.length }),
38783
- className: "mt-4 rounded-full border border-border px-4 py-2 text-sm text-foreground",
38784
- children: ctaLabel
38785
- }
38786
- )
38787
- ] });
38819
+ }) => {
38820
+ const safeSteps = Array.isArray(steps) ? steps : [];
38821
+ return /* @__PURE__ */ jsxs107("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38822
+ /* @__PURE__ */ jsx146("h3", { className: "text-base font-semibold text-foreground", children: title }),
38823
+ /* @__PURE__ */ jsx146("div", { className: "mt-3 space-y-2", children: safeSteps.map((item, i) => /* @__PURE__ */ jsxs107("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3 text-sm", children: [
38824
+ /* @__PURE__ */ jsx146("p", { className: "font-medium text-foreground", children: item.step }),
38825
+ item.owner || item.due ? /* @__PURE__ */ jsxs107("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38826
+ item.owner ? `Owner: ${item.owner}` : "",
38827
+ item.owner && item.due ? " \u2022 " : "",
38828
+ item.due ? `Due: ${item.due}` : ""
38829
+ ] }) : null
38830
+ ] }, `${item.step}-${i}`)) }),
38831
+ /* @__PURE__ */ jsx146(
38832
+ "button",
38833
+ {
38834
+ type: "button",
38835
+ onClick: () => onAction?.({ type: "next_step_continue", stepsCount: safeSteps.length }),
38836
+ className: "mt-4 rounded-full border border-border px-4 py-2 text-sm text-foreground",
38837
+ children: ctaLabel
38838
+ }
38839
+ )
38840
+ ] });
38841
+ };
38788
38842
 
38789
38843
  // src/molecules/generic/PresentationJobCard/PresentationJobCard.tsx
38790
38844
  import { useCallback as useCallback4, useEffect as useEffect6, useRef as useRef5, useState as useState10 } from "react";
@@ -38842,8 +38896,8 @@ var FORMATS = [
38842
38896
  }
38843
38897
  ];
38844
38898
  var ExportModal = ({ formats, title, onClose }) => {
38845
- const available = FORMATS.filter((f) => formats[f.key]);
38846
- const filename = title.replace(/[^a-z0-9]/gi, "-").toLowerCase();
38899
+ const available = FORMATS.filter((f) => (formats ?? {})[f.key]);
38900
+ const filename = (title ?? "").replace(/[^a-z0-9]/gi, "-").toLowerCase();
38847
38901
  const [downloadingKey, setDownloadingKey] = useState10(null);
38848
38902
  const handleDownload = async (fmtKey, url, ext) => {
38849
38903
  if (downloadingKey) return;
@@ -39804,7 +39858,7 @@ var ResearchReportJobCard = (props) => {
39804
39858
  }
39805
39859
  const handleDownload = async () => {
39806
39860
  if (!htmlUrl) return;
39807
- const filename = `${title.replace(/[^a-z0-9]/gi, "-").toLowerCase()}.html`;
39861
+ const filename = `${(title ?? "").replace(/[^a-z0-9]/gi, "-").toLowerCase()}.html`;
39808
39862
  const href = `/api/download?url=${encodeURIComponent(htmlUrl)}&filename=${encodeURIComponent(filename)}`;
39809
39863
  try {
39810
39864
  const response = await fetch(href);
@@ -40152,6 +40206,7 @@ var WebSearchJobCard = ({
40152
40206
  ] })
40153
40207
  ] }) }) });
40154
40208
  }
40209
+ const safeResults = Array.isArray(results) ? results : [];
40155
40210
  const displayQuery = query || initialTitle || "Web Search";
40156
40211
  const statsText = [
40157
40212
  resultCount > 0 && `${resultCount} result${resultCount !== 1 ? "s" : ""}`,
@@ -40174,7 +40229,7 @@ var WebSearchJobCard = ({
40174
40229
  ] })
40175
40230
  ] }),
40176
40231
  summary && /* @__PURE__ */ jsx149("p", { className: "mt-3 text-xs text-zinc-400 leading-relaxed line-clamp-3", children: summary }),
40177
- !compact && results.length > 0 && /* @__PURE__ */ jsx149("div", { className: "mt-4 space-y-2", children: results.map((result, i) => /* @__PURE__ */ jsxs110(
40232
+ !compact && safeResults.length > 0 && /* @__PURE__ */ jsx149("div", { className: "mt-4 space-y-2", children: safeResults.map((result, i) => /* @__PURE__ */ jsxs110(
40178
40233
  "a",
40179
40234
  {
40180
40235
  href: result.url,
@@ -41541,6 +41596,7 @@ var PlatformIconGroup = ({
41541
41596
  platforms,
41542
41597
  className
41543
41598
  }) => {
41599
+ const safePlatforms = Array.isArray(platforms) ? platforms : [];
41544
41600
  const getIcon = (platform) => {
41545
41601
  switch (platform) {
41546
41602
  case "instagram":
@@ -41569,7 +41625,7 @@ var PlatformIconGroup = ({
41569
41625
  return "text-gray-500 bg-gray-50 border-gray-100";
41570
41626
  }
41571
41627
  };
41572
- return /* @__PURE__ */ jsx154("div", { className: cn("flex gap-2", className), children: platforms.map((p, i) => {
41628
+ return /* @__PURE__ */ jsx154("div", { className: cn("flex gap-2", className), children: safePlatforms.map((p, i) => {
41573
41629
  const Icon3 = getIcon(p.platform);
41574
41630
  if (!Icon3) return null;
41575
41631
  return /* @__PURE__ */ jsx154(
@@ -41613,7 +41669,7 @@ var CreatorProfileSummary = ({
41613
41669
  id: `avatar-${name}`,
41614
41670
  type: "avatar",
41615
41671
  src: avatarSrc,
41616
- fallback: name.charAt(0),
41672
+ fallback: (name ?? "").charAt(0),
41617
41673
  className: "w-12 h-12 ring-2 ring-purple-100"
41618
41674
  }
41619
41675
  ),
@@ -41631,11 +41687,11 @@ var CreatorProfileSummary = ({
41631
41687
  /* @__PURE__ */ jsxs115("div", { className: "flex gap-3 mt-1", children: [
41632
41688
  followerCount && /* @__PURE__ */ jsxs115("div", { className: "flex flex-col", children: [
41633
41689
  /* @__PURE__ */ jsx155("span", { className: "text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: "Followers" }),
41634
- /* @__PURE__ */ jsx155("span", { className: "text-xs font-semibold text-purple-700", children: followerCount })
41690
+ /* @__PURE__ */ jsx155("span", { className: "text-xs font-semibold text-purple-700", children: String(followerCount ?? "") })
41635
41691
  ] }),
41636
41692
  engagementRate && /* @__PURE__ */ jsxs115("div", { className: "flex flex-col border-l border-purple-100 pl-3", children: [
41637
41693
  /* @__PURE__ */ jsx155("span", { className: "text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: "Engagement" }),
41638
- /* @__PURE__ */ jsx155("span", { className: "text-xs font-semibold text-indigo-600", children: engagementRate })
41694
+ /* @__PURE__ */ jsx155("span", { className: "text-xs font-semibold text-indigo-600", children: String(engagementRate ?? "") })
41639
41695
  ] })
41640
41696
  ] })
41641
41697
  ] })
@@ -41651,6 +41707,7 @@ var AudienceMetricCard = ({
41651
41707
  metrics,
41652
41708
  className
41653
41709
  }) => {
41710
+ const safeMetrics = Array.isArray(metrics) ? metrics : [];
41654
41711
  return /* @__PURE__ */ jsxs116(
41655
41712
  Card,
41656
41713
  {
@@ -41660,10 +41717,10 @@ var AudienceMetricCard = ({
41660
41717
  ),
41661
41718
  children: [
41662
41719
  /* @__PURE__ */ jsx156(CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsx156(CardTitle, { className: "text-lg font-bold text-gray-900", children: title }) }),
41663
- /* @__PURE__ */ jsx156(CardContent, { className: "space-y-4", children: metrics.map((metric, i) => /* @__PURE__ */ jsxs116("div", { className: "space-y-1.5", children: [
41720
+ /* @__PURE__ */ jsx156(CardContent, { className: "space-y-4", children: safeMetrics.map((metric, i) => /* @__PURE__ */ jsxs116("div", { className: "space-y-1.5", children: [
41664
41721
  /* @__PURE__ */ jsxs116("div", { className: "flex justify-between items-center text-sm", children: [
41665
- /* @__PURE__ */ jsx156("span", { className: "font-medium text-gray-700", children: metric.label }),
41666
- /* @__PURE__ */ jsx156("span", { className: "font-bold text-gray-900", children: metric.value })
41722
+ /* @__PURE__ */ jsx156("span", { className: "font-medium text-gray-700", children: String(metric.label ?? "") }),
41723
+ /* @__PURE__ */ jsx156("span", { className: "font-bold text-gray-900", children: String(metric.value ?? "") })
41667
41724
  ] }),
41668
41725
  metric.percentage !== void 0 && /* @__PURE__ */ jsx156(
41669
41726
  ProgressAtom,
@@ -41769,9 +41826,10 @@ var BrandAffinityGroup = ({
41769
41826
  brands,
41770
41827
  className
41771
41828
  }) => {
41829
+ const safeBrands = Array.isArray(brands) ? brands : [];
41772
41830
  return /* @__PURE__ */ jsxs118("div", { className: cn("flex flex-col gap-3", className), children: [
41773
41831
  /* @__PURE__ */ jsx158("h5", { className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Recent Collaborations" }),
41774
- /* @__PURE__ */ jsx158("div", { className: "flex flex-wrap gap-4 items-center", children: brands.map((brand, i) => /* @__PURE__ */ jsxs118("div", { className: "group relative", children: [
41832
+ /* @__PURE__ */ jsx158("div", { className: "flex flex-wrap gap-4 items-center", children: safeBrands.map((brand, i) => /* @__PURE__ */ jsxs118("div", { className: "group relative", children: [
41775
41833
  /* @__PURE__ */ jsx158("div", { className: "h-10 w-10 overflow-hidden rounded-xl bg-white border border-gray-100 p-1.5 flex items-center justify-center grayscale hover:grayscale-0 transition-all duration-300 hover:scale-110 shadow-sm hover:shadow-md", children: /* @__PURE__ */ jsx158(
41776
41834
  "img",
41777
41835
  {
@@ -41780,7 +41838,7 @@ var BrandAffinityGroup = ({
41780
41838
  className: "max-h-full max-w-full object-contain"
41781
41839
  }
41782
41840
  ) }),
41783
- /* @__PURE__ */ jsx158("div", { className: "absolute -bottom-6 left-1/2 -translate-x-1/2 px-2 py-0.5 bg-gray-900 text-white text-[10px] rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50 pointer-events-none", children: brand.name })
41841
+ /* @__PURE__ */ jsx158("div", { className: "absolute -bottom-6 left-1/2 -translate-x-1/2 px-2 py-0.5 bg-gray-900 text-white text-[10px] rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50 pointer-events-none", children: String(brand.name ?? "") })
41784
41842
  ] }, i)) })
41785
41843
  ] });
41786
41844
  };
@@ -41791,7 +41849,8 @@ var ContentPreviewGallery = ({
41791
41849
  items,
41792
41850
  className
41793
41851
  }) => {
41794
- return /* @__PURE__ */ jsx159("div", { className: cn("grid grid-cols-2 gap-2", className), children: items.map((item, i) => /* @__PURE__ */ jsxs119(
41852
+ const safeItems = Array.isArray(items) ? items : [];
41853
+ return /* @__PURE__ */ jsx159("div", { className: cn("grid grid-cols-2 gap-2", className), children: safeItems.map((item, i) => /* @__PURE__ */ jsxs119(
41795
41854
  "a",
41796
41855
  {
41797
41856
  href: item.url || "#",
@@ -41901,6 +41960,7 @@ var TopPostsGrid = ({
41901
41960
  posts,
41902
41961
  className
41903
41962
  }) => {
41963
+ const safePosts = Array.isArray(posts) ? posts : [];
41904
41964
  return /* @__PURE__ */ jsx162(
41905
41965
  "div",
41906
41966
  {
@@ -41908,7 +41968,7 @@ var TopPostsGrid = ({
41908
41968
  "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
41909
41969
  className
41910
41970
  ),
41911
- children: posts.map((post, i) => /* @__PURE__ */ jsxs122(
41971
+ children: safePosts.map((post, i) => /* @__PURE__ */ jsxs122(
41912
41972
  "div",
41913
41973
  {
41914
41974
  className: "group relative aspect-square overflow-hidden rounded-2xl bg-gray-100 border border-purple-50",
@@ -41926,20 +41986,20 @@ var TopPostsGrid = ({
41926
41986
  /* @__PURE__ */ jsxs122("span", { className: "flex items-center gap-1", children: [
41927
41987
  /* @__PURE__ */ jsx162(Heart, { className: "w-3 h-3 fill-white" }),
41928
41988
  " ",
41929
- post.likes
41989
+ String(post.likes ?? "")
41930
41990
  ] }),
41931
41991
  /* @__PURE__ */ jsxs122("span", { className: "flex items-center gap-1", children: [
41932
41992
  /* @__PURE__ */ jsx162(MessageCircle, { className: "w-3 h-3 fill-white" }),
41933
41993
  " ",
41934
- post.comments
41994
+ String(post.comments ?? "")
41935
41995
  ] }),
41936
41996
  /* @__PURE__ */ jsxs122("span", { className: "flex items-center gap-1", children: [
41937
41997
  /* @__PURE__ */ jsx162(ChartColumn, { className: "w-3 h-3" }),
41938
41998
  " ",
41939
- post.engagement
41999
+ String(post.engagement ?? "")
41940
42000
  ] })
41941
42001
  ] }),
41942
- /* @__PURE__ */ jsx162("span", { className: "text-[10px] text-gray-300 mt-2", children: post.date })
42002
+ /* @__PURE__ */ jsx162("span", { className: "text-[10px] text-gray-300 mt-2", children: String(post.date ?? "") })
41943
42003
  ] })
41944
42004
  ]
41945
42005
  },
@@ -41959,6 +42019,7 @@ var CreatorActionHeader = ({
41959
42019
  actions,
41960
42020
  className
41961
42021
  }) => {
42022
+ const safeActions = Array.isArray(actions) ? actions : [];
41962
42023
  return /* @__PURE__ */ jsxs123(
41963
42024
  "div",
41964
42025
  {
@@ -41982,17 +42043,17 @@ var CreatorActionHeader = ({
41982
42043
  /* @__PURE__ */ jsxs123("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-6", children: [
41983
42044
  /* @__PURE__ */ jsx163("div", { className: "p-2 bg-white rounded-[32px] shadow-lg", children: /* @__PURE__ */ jsxs123(Avatar, { className: "h-32 w-32 rounded-[24px] border-4 border-white", children: [
41984
42045
  /* @__PURE__ */ jsx163(AvatarImage, { src: avatarSrc, className: "rounded-[24px]" }),
41985
- /* @__PURE__ */ jsx163(AvatarFallback, { className: "rounded-[24px] bg-purple-50 text-purple-600 text-3xl font-bold", children: name.charAt(0) })
42046
+ /* @__PURE__ */ jsx163(AvatarFallback, { className: "rounded-[24px] bg-purple-50 text-purple-600 text-3xl font-bold", children: (name ?? "").charAt(0) })
41986
42047
  ] }) }),
41987
42048
  /* @__PURE__ */ jsxs123("div", { className: "mb-2", children: [
41988
- /* @__PURE__ */ jsx163("h1", { className: "text-3xl font-bold text-gray-900 tracking-tight", children: name }),
42049
+ /* @__PURE__ */ jsx163("h1", { className: "text-3xl font-bold text-gray-900 tracking-tight", children: String(name ?? "") }),
41989
42050
  /* @__PURE__ */ jsxs123("p", { className: "text-purple-600 font-medium tracking-wide", children: [
41990
42051
  "@",
41991
- handle
42052
+ String(handle ?? "")
41992
42053
  ] })
41993
42054
  ] })
41994
42055
  ] }),
41995
- /* @__PURE__ */ jsx163("div", { className: "flex items-center gap-3 mb-2", children: actions.map((action, i) => /* @__PURE__ */ jsx163(
42056
+ /* @__PURE__ */ jsx163("div", { className: "flex items-center gap-3 mb-2", children: safeActions.map((action, i) => /* @__PURE__ */ jsx163(
41996
42057
  Button,
41997
42058
  {
41998
42059
  variant: action.variant || "default",
@@ -42000,7 +42061,7 @@ var CreatorActionHeader = ({
42000
42061
  "rounded-2xl px-6 h-11 font-bold transition-all",
42001
42062
  action.variant === "default" && "bg-purple-600 hover:bg-purple-700 shadow-md hover:shadow-purple-200"
42002
42063
  ),
42003
- children: action.label
42064
+ children: String(action.label ?? "")
42004
42065
  },
42005
42066
  i
42006
42067
  )) })
@@ -42035,7 +42096,7 @@ var CreatorSearch = React113.memo(
42035
42096
  {
42036
42097
  id: `platform-${p}`,
42037
42098
  type: "badge",
42038
- label: p,
42099
+ label: String(p ?? ""),
42039
42100
  variant: "outline",
42040
42101
  className: "bg-background bg-gray200 border-gray400 text-white font-medium"
42041
42102
  },
@@ -42632,6 +42693,7 @@ function CreatorCompactView({
42632
42693
  timeDisplay,
42633
42694
  isLoading
42634
42695
  }) {
42696
+ const safeVersions = Array.isArray(versions) ? versions : [];
42635
42697
  const isComplete = versionStatus === "completed" || versionStatus === "complete";
42636
42698
  const statusTitle = isComplete ? "Creator Search Complete" : versionStatus === "failed" ? "Creator Search Failed" : "Creator Search Processing";
42637
42699
  if (isLoading) {
@@ -42643,7 +42705,7 @@ function CreatorCompactView({
42643
42705
  /* @__PURE__ */ jsx169("h4", { className: "w-fit rounded-md bg-purple200 px-2 py-[4px] text-xs font-medium text-purpleText", children: "VERIFIED CREATORS LIST" }),
42644
42706
  /* @__PURE__ */ jsx169("h3", { className: "text-gray900 md:text-lg font-bold", children: statusTitle })
42645
42707
  ] }),
42646
- versions.length > 1 && /* @__PURE__ */ jsx169("div", { className: "relative md:self-start", children: /* @__PURE__ */ jsxs129(DropdownMenu, { children: [
42708
+ safeVersions.length > 1 && /* @__PURE__ */ jsx169("div", { className: "relative md:self-start", children: /* @__PURE__ */ jsxs129(DropdownMenu, { children: [
42647
42709
  /* @__PURE__ */ jsxs129(
42648
42710
  DropdownMenuTrigger,
42649
42711
  {
@@ -42656,7 +42718,7 @@ function CreatorCompactView({
42656
42718
  ]
42657
42719
  }
42658
42720
  ),
42659
- /* @__PURE__ */ jsx169(DropdownMenuContent, { className: "bg-[var(--creator-dropdown-bg)] border-2 border-gray400 min-w-[120px] max-h-[150px] overflow-y-auto", children: versions.map((v) => /* @__PURE__ */ jsxs129(
42721
+ /* @__PURE__ */ jsx169(DropdownMenuContent, { className: "bg-[var(--creator-dropdown-bg)] border-2 border-gray400 min-w-[120px] max-h-[150px] overflow-y-auto", children: safeVersions.map((v) => /* @__PURE__ */ jsxs129(
42660
42722
  DropdownMenuItem,
42661
42723
  {
42662
42724
  onClick: () => onVersionSelect(v),
@@ -43345,8 +43407,9 @@ function filterPostsByPlatform(posts, platform) {
43345
43407
  }
43346
43408
  function PlatformMetricsBanner({
43347
43409
  platform,
43348
- metrics
43410
+ metrics: metricsProp
43349
43411
  }) {
43412
+ const metrics = metricsProp ?? {};
43350
43413
  const platformName = getPlatformName(platform);
43351
43414
  const bgColor = getPlatformBgColor(platform);
43352
43415
  const IconComponent = getPlatformIcon(platform);
@@ -43376,7 +43439,7 @@ function PlatformMetricsBanner({
43376
43439
  ] }),
43377
43440
  /* @__PURE__ */ jsxs132("div", { className: "flex flex-col items-start md:min-w-0", children: [
43378
43441
  /* @__PURE__ */ jsxs132("span", { className: "text-xs md:text-md font-semibold text-gray900", children: [
43379
- (metrics.engagementRate * 100).toFixed(2),
43442
+ ((metrics?.engagementRate ?? 0) * 100).toFixed(2),
43380
43443
  "%"
43381
43444
  ] }),
43382
43445
  /* @__PURE__ */ jsx173("span", { className: "text-xs text-gray900 opacity-80", children: "Engagement Rate" })