dp-widgets-framework 1.7.7 → 1.7.9

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.
Files changed (3) hide show
  1. package/dist/index.esm.js +1717 -727
  2. package/dist/index.js +1718 -727
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var runtimeClientGql = require('@copilotkit/runtime-client-gql');
20
20
  var reactCore = require('@copilotkit/react-core');
21
21
  var jsPDF = require('jspdf');
22
22
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
23
+ var SliderPrimitive = require('@radix-ui/react-slider');
23
24
  var DialogPrimitive = require('@radix-ui/react-dialog');
24
25
  var dateFns = require('date-fns');
25
26
 
@@ -48,6 +49,7 @@ var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(SelectPri
48
49
  var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(ScrollAreaPrimitive);
49
50
  var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
50
51
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(CheckboxPrimitive);
52
+ var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(SliderPrimitive);
51
53
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DialogPrimitive);
52
54
 
53
55
  function getDefaultExportFromCjs (x) {
@@ -1457,40 +1459,40 @@ const KEYS = {
1457
1459
  ESCAPE: "Escape",
1458
1460
  TAB: "Tab"};
1459
1461
 
1460
- var __defProp$q = Object.defineProperty;
1461
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
1462
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
1463
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
1464
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1465
- var __spreadValues$q = (a, b) => {
1462
+ var __defProp$u = Object.defineProperty;
1463
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
1464
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
1465
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
1466
+ var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1467
+ var __spreadValues$u = (a, b) => {
1466
1468
  for (var prop in b || (b = {}))
1467
- if (__hasOwnProp$q.call(b, prop))
1468
- __defNormalProp$q(a, prop, b[prop]);
1469
- if (__getOwnPropSymbols$q)
1470
- for (var prop of __getOwnPropSymbols$q(b)) {
1471
- if (__propIsEnum$q.call(b, prop))
1472
- __defNormalProp$q(a, prop, b[prop]);
1469
+ if (__hasOwnProp$u.call(b, prop))
1470
+ __defNormalProp$u(a, prop, b[prop]);
1471
+ if (__getOwnPropSymbols$u)
1472
+ for (var prop of __getOwnPropSymbols$u(b)) {
1473
+ if (__propIsEnum$u.call(b, prop))
1474
+ __defNormalProp$u(a, prop, b[prop]);
1473
1475
  }
1474
1476
  return a;
1475
1477
  };
1476
- var __objRest$d = (source, exclude) => {
1478
+ var __objRest$e = (source, exclude) => {
1477
1479
  var target = {};
1478
1480
  for (var prop in source)
1479
- if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
1481
+ if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
1480
1482
  target[prop] = source[prop];
1481
- if (source != null && __getOwnPropSymbols$q)
1482
- for (var prop of __getOwnPropSymbols$q(source)) {
1483
- if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
1483
+ if (source != null && __getOwnPropSymbols$u)
1484
+ for (var prop of __getOwnPropSymbols$u(source)) {
1485
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$u.call(source, prop))
1484
1486
  target[prop] = source[prop];
1485
1487
  }
1486
1488
  return target;
1487
1489
  };
1488
1490
  const Tabs = TabsPrimitive__namespace.Root;
1489
1491
  const TabsList = React__namespace.forwardRef((_a, ref) => {
1490
- var _b = _a, { className } = _b, props = __objRest$d(_b, ["className"]);
1492
+ var _b = _a, { className } = _b, props = __objRest$e(_b, ["className"]);
1491
1493
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1492
1494
  TabsPrimitive__namespace.List,
1493
- __spreadValues$q({
1495
+ __spreadValues$u({
1494
1496
  ref,
1495
1497
  className: cn(
1496
1498
  "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
@@ -1501,10 +1503,10 @@ const TabsList = React__namespace.forwardRef((_a, ref) => {
1501
1503
  });
1502
1504
  TabsList.displayName = TabsPrimitive__namespace.List.displayName;
1503
1505
  const TabsTrigger = React__namespace.forwardRef((_c, ref) => {
1504
- var _d = _c, { className } = _d, props = __objRest$d(_d, ["className"]);
1506
+ var _d = _c, { className } = _d, props = __objRest$e(_d, ["className"]);
1505
1507
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1506
1508
  TabsPrimitive__namespace.Trigger,
1507
- __spreadValues$q({
1509
+ __spreadValues$u({
1508
1510
  ref,
1509
1511
  className: cn(
1510
1512
  "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
@@ -1515,10 +1517,10 @@ const TabsTrigger = React__namespace.forwardRef((_c, ref) => {
1515
1517
  });
1516
1518
  TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
1517
1519
  const TabsContent = React__namespace.forwardRef((_e, ref) => {
1518
- var _f = _e, { className } = _f, props = __objRest$d(_f, ["className"]);
1520
+ var _f = _e, { className } = _f, props = __objRest$e(_f, ["className"]);
1519
1521
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1520
1522
  TabsPrimitive__namespace.Content,
1521
- __spreadValues$q({
1523
+ __spreadValues$u({
1522
1524
  ref,
1523
1525
  className: cn(
1524
1526
  "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
@@ -1529,40 +1531,40 @@ const TabsContent = React__namespace.forwardRef((_e, ref) => {
1529
1531
  });
1530
1532
  TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
1531
1533
 
1532
- var __defProp$p = Object.defineProperty;
1533
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
1534
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
1535
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
1536
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1537
- var __spreadValues$p = (a, b) => {
1534
+ var __defProp$t = Object.defineProperty;
1535
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
1536
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
1537
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
1538
+ var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1539
+ var __spreadValues$t = (a, b) => {
1538
1540
  for (var prop in b || (b = {}))
1539
- if (__hasOwnProp$p.call(b, prop))
1540
- __defNormalProp$p(a, prop, b[prop]);
1541
- if (__getOwnPropSymbols$p)
1542
- for (var prop of __getOwnPropSymbols$p(b)) {
1543
- if (__propIsEnum$p.call(b, prop))
1544
- __defNormalProp$p(a, prop, b[prop]);
1541
+ if (__hasOwnProp$t.call(b, prop))
1542
+ __defNormalProp$t(a, prop, b[prop]);
1543
+ if (__getOwnPropSymbols$t)
1544
+ for (var prop of __getOwnPropSymbols$t(b)) {
1545
+ if (__propIsEnum$t.call(b, prop))
1546
+ __defNormalProp$t(a, prop, b[prop]);
1545
1547
  }
1546
1548
  return a;
1547
1549
  };
1548
- var __objRest$c = (source, exclude) => {
1550
+ var __objRest$d = (source, exclude) => {
1549
1551
  var target = {};
1550
1552
  for (var prop in source)
1551
- if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
1553
+ if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
1552
1554
  target[prop] = source[prop];
1553
- if (source != null && __getOwnPropSymbols$p)
1554
- for (var prop of __getOwnPropSymbols$p(source)) {
1555
- if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
1555
+ if (source != null && __getOwnPropSymbols$t)
1556
+ for (var prop of __getOwnPropSymbols$t(source)) {
1557
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
1556
1558
  target[prop] = source[prop];
1557
1559
  }
1558
1560
  return target;
1559
1561
  };
1560
1562
  const Input = React__namespace.forwardRef(
1561
1563
  (_a, ref) => {
1562
- var _b = _a, { className, type } = _b, props = __objRest$c(_b, ["className", "type"]);
1564
+ var _b = _a, { className, type } = _b, props = __objRest$d(_b, ["className", "type"]);
1563
1565
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1564
1566
  "input",
1565
- __spreadValues$p({
1567
+ __spreadValues$t({
1566
1568
  type,
1567
1569
  className: cn(
1568
1570
  "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
@@ -1575,30 +1577,30 @@ const Input = React__namespace.forwardRef(
1575
1577
  );
1576
1578
  Input.displayName = "Input";
1577
1579
 
1578
- var __defProp$o = Object.defineProperty;
1579
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
1580
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
1581
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
1582
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1583
- var __spreadValues$o = (a, b) => {
1580
+ var __defProp$s = Object.defineProperty;
1581
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
1582
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
1583
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
1584
+ var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1585
+ var __spreadValues$s = (a, b) => {
1584
1586
  for (var prop in b || (b = {}))
1585
- if (__hasOwnProp$o.call(b, prop))
1586
- __defNormalProp$o(a, prop, b[prop]);
1587
- if (__getOwnPropSymbols$o)
1588
- for (var prop of __getOwnPropSymbols$o(b)) {
1589
- if (__propIsEnum$o.call(b, prop))
1590
- __defNormalProp$o(a, prop, b[prop]);
1587
+ if (__hasOwnProp$s.call(b, prop))
1588
+ __defNormalProp$s(a, prop, b[prop]);
1589
+ if (__getOwnPropSymbols$s)
1590
+ for (var prop of __getOwnPropSymbols$s(b)) {
1591
+ if (__propIsEnum$s.call(b, prop))
1592
+ __defNormalProp$s(a, prop, b[prop]);
1591
1593
  }
1592
1594
  return a;
1593
1595
  };
1594
- var __objRest$b = (source, exclude) => {
1596
+ var __objRest$c = (source, exclude) => {
1595
1597
  var target = {};
1596
1598
  for (var prop in source)
1597
- if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
1599
+ if (__hasOwnProp$s.call(source, prop) && exclude.indexOf(prop) < 0)
1598
1600
  target[prop] = source[prop];
1599
- if (source != null && __getOwnPropSymbols$o)
1600
- for (var prop of __getOwnPropSymbols$o(source)) {
1601
- if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
1601
+ if (source != null && __getOwnPropSymbols$s)
1602
+ for (var prop of __getOwnPropSymbols$s(source)) {
1603
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$s.call(source, prop))
1602
1604
  target[prop] = source[prop];
1603
1605
  }
1604
1606
  return target;
@@ -1607,10 +1609,10 @@ const labelVariants = classVarianceAuthority.cva(
1607
1609
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1608
1610
  );
1609
1611
  const Label$1 = React__namespace.forwardRef((_a, ref) => {
1610
- var _b = _a, { className } = _b, props = __objRest$b(_b, ["className"]);
1612
+ var _b = _a, { className } = _b, props = __objRest$c(_b, ["className"]);
1611
1613
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1612
1614
  LabelPrimitive__namespace.Root,
1613
- __spreadValues$o({
1615
+ __spreadValues$s({
1614
1616
  ref,
1615
1617
  className: cn(labelVariants(), className)
1616
1618
  }, props)
@@ -1618,42 +1620,42 @@ const Label$1 = React__namespace.forwardRef((_a, ref) => {
1618
1620
  });
1619
1621
  Label$1.displayName = LabelPrimitive__namespace.Root.displayName;
1620
1622
 
1621
- var __defProp$n = Object.defineProperty;
1622
- var __defProps$g = Object.defineProperties;
1623
- var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
1624
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
1625
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
1626
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
1627
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1628
- var __spreadValues$n = (a, b) => {
1623
+ var __defProp$r = Object.defineProperty;
1624
+ var __defProps$k = Object.defineProperties;
1625
+ var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
1626
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
1627
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
1628
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
1629
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1630
+ var __spreadValues$r = (a, b) => {
1629
1631
  for (var prop in b || (b = {}))
1630
- if (__hasOwnProp$n.call(b, prop))
1631
- __defNormalProp$n(a, prop, b[prop]);
1632
- if (__getOwnPropSymbols$n)
1633
- for (var prop of __getOwnPropSymbols$n(b)) {
1634
- if (__propIsEnum$n.call(b, prop))
1635
- __defNormalProp$n(a, prop, b[prop]);
1632
+ if (__hasOwnProp$r.call(b, prop))
1633
+ __defNormalProp$r(a, prop, b[prop]);
1634
+ if (__getOwnPropSymbols$r)
1635
+ for (var prop of __getOwnPropSymbols$r(b)) {
1636
+ if (__propIsEnum$r.call(b, prop))
1637
+ __defNormalProp$r(a, prop, b[prop]);
1636
1638
  }
1637
1639
  return a;
1638
1640
  };
1639
- var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
1640
- var __objRest$a = (source, exclude) => {
1641
+ var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
1642
+ var __objRest$b = (source, exclude) => {
1641
1643
  var target = {};
1642
1644
  for (var prop in source)
1643
- if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
1645
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
1644
1646
  target[prop] = source[prop];
1645
- if (source != null && __getOwnPropSymbols$n)
1646
- for (var prop of __getOwnPropSymbols$n(source)) {
1647
- if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
1647
+ if (source != null && __getOwnPropSymbols$r)
1648
+ for (var prop of __getOwnPropSymbols$r(source)) {
1649
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
1648
1650
  target[prop] = source[prop];
1649
1651
  }
1650
1652
  return target;
1651
1653
  };
1652
1654
  const Switch = React__namespace.forwardRef((_a, ref) => {
1653
- var _b = _a, { className } = _b, props = __objRest$a(_b, ["className"]);
1655
+ var _b = _a, { className } = _b, props = __objRest$b(_b, ["className"]);
1654
1656
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1655
1657
  SwitchPrimitives__namespace.Root,
1656
- __spreadProps$g(__spreadValues$n({
1658
+ __spreadProps$k(__spreadValues$r({
1657
1659
  className: cn(
1658
1660
  "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
1659
1661
  className
@@ -1673,33 +1675,33 @@ const Switch = React__namespace.forwardRef((_a, ref) => {
1673
1675
  });
1674
1676
  Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
1675
1677
 
1676
- var __defProp$m = Object.defineProperty;
1677
- var __defProps$f = Object.defineProperties;
1678
- var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
1679
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
1680
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
1681
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
1682
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1683
- var __spreadValues$m = (a, b) => {
1678
+ var __defProp$q = Object.defineProperty;
1679
+ var __defProps$j = Object.defineProperties;
1680
+ var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
1681
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
1682
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
1683
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
1684
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1685
+ var __spreadValues$q = (a, b) => {
1684
1686
  for (var prop in b || (b = {}))
1685
- if (__hasOwnProp$m.call(b, prop))
1686
- __defNormalProp$m(a, prop, b[prop]);
1687
- if (__getOwnPropSymbols$m)
1688
- for (var prop of __getOwnPropSymbols$m(b)) {
1689
- if (__propIsEnum$m.call(b, prop))
1690
- __defNormalProp$m(a, prop, b[prop]);
1687
+ if (__hasOwnProp$q.call(b, prop))
1688
+ __defNormalProp$q(a, prop, b[prop]);
1689
+ if (__getOwnPropSymbols$q)
1690
+ for (var prop of __getOwnPropSymbols$q(b)) {
1691
+ if (__propIsEnum$q.call(b, prop))
1692
+ __defNormalProp$q(a, prop, b[prop]);
1691
1693
  }
1692
1694
  return a;
1693
1695
  };
1694
- var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
1695
- var __objRest$9 = (source, exclude) => {
1696
+ var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
1697
+ var __objRest$a = (source, exclude) => {
1696
1698
  var target = {};
1697
1699
  for (var prop in source)
1698
- if (__hasOwnProp$m.call(source, prop) && exclude.indexOf(prop) < 0)
1700
+ if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
1699
1701
  target[prop] = source[prop];
1700
- if (source != null && __getOwnPropSymbols$m)
1701
- for (var prop of __getOwnPropSymbols$m(source)) {
1702
- if (exclude.indexOf(prop) < 0 && __propIsEnum$m.call(source, prop))
1702
+ if (source != null && __getOwnPropSymbols$q)
1703
+ for (var prop of __getOwnPropSymbols$q(source)) {
1704
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
1703
1705
  target[prop] = source[prop];
1704
1706
  }
1705
1707
  return target;
@@ -1707,10 +1709,10 @@ var __objRest$9 = (source, exclude) => {
1707
1709
  const Select = SelectPrimitive__namespace.Root;
1708
1710
  const SelectValue = SelectPrimitive__namespace.Value;
1709
1711
  const SelectTrigger = React__namespace.forwardRef((_a, ref) => {
1710
- var _b = _a, { className, children } = _b, props = __objRest$9(_b, ["className", "children"]);
1712
+ var _b = _a, { className, children } = _b, props = __objRest$a(_b, ["className", "children"]);
1711
1713
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1712
1714
  SelectPrimitive__namespace.Trigger,
1713
- __spreadProps$f(__spreadValues$m({
1715
+ __spreadProps$j(__spreadValues$q({
1714
1716
  ref,
1715
1717
  className: cn(
1716
1718
  "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
@@ -1726,10 +1728,10 @@ const SelectTrigger = React__namespace.forwardRef((_a, ref) => {
1726
1728
  });
1727
1729
  SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
1728
1730
  const SelectScrollUpButton = React__namespace.forwardRef((_c, ref) => {
1729
- var _d = _c, { className } = _d, props = __objRest$9(_d, ["className"]);
1731
+ var _d = _c, { className } = _d, props = __objRest$a(_d, ["className"]);
1730
1732
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1731
1733
  SelectPrimitive__namespace.ScrollUpButton,
1732
- __spreadProps$f(__spreadValues$m({
1734
+ __spreadProps$j(__spreadValues$q({
1733
1735
  ref,
1734
1736
  className: cn(
1735
1737
  "flex cursor-default items-center justify-center py-1",
@@ -1742,10 +1744,10 @@ const SelectScrollUpButton = React__namespace.forwardRef((_c, ref) => {
1742
1744
  });
1743
1745
  SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
1744
1746
  const SelectScrollDownButton = React__namespace.forwardRef((_e, ref) => {
1745
- var _f = _e, { className } = _f, props = __objRest$9(_f, ["className"]);
1747
+ var _f = _e, { className } = _f, props = __objRest$a(_f, ["className"]);
1746
1748
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1747
1749
  SelectPrimitive__namespace.ScrollDownButton,
1748
- __spreadProps$f(__spreadValues$m({
1750
+ __spreadProps$j(__spreadValues$q({
1749
1751
  ref,
1750
1752
  className: cn(
1751
1753
  "flex cursor-default items-center justify-center py-1",
@@ -1758,10 +1760,10 @@ const SelectScrollDownButton = React__namespace.forwardRef((_e, ref) => {
1758
1760
  });
1759
1761
  SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
1760
1762
  const SelectContent = React__namespace.forwardRef((_g, ref) => {
1761
- var _h = _g, { className, children, position = "popper" } = _h, props = __objRest$9(_h, ["className", "children", "position"]);
1763
+ var _h = _g, { className, children, position = "popper" } = _h, props = __objRest$a(_h, ["className", "children", "position"]);
1762
1764
  return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1763
1765
  SelectPrimitive__namespace.Content,
1764
- __spreadProps$f(__spreadValues$m({
1766
+ __spreadProps$j(__spreadValues$q({
1765
1767
  ref,
1766
1768
  className: cn(
1767
1769
  "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
@@ -1789,10 +1791,10 @@ const SelectContent = React__namespace.forwardRef((_g, ref) => {
1789
1791
  });
1790
1792
  SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
1791
1793
  const SelectLabel = React__namespace.forwardRef((_i, ref) => {
1792
- var _j = _i, { className } = _j, props = __objRest$9(_j, ["className"]);
1794
+ var _j = _i, { className } = _j, props = __objRest$a(_j, ["className"]);
1793
1795
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1794
1796
  SelectPrimitive__namespace.Label,
1795
- __spreadValues$m({
1797
+ __spreadValues$q({
1796
1798
  ref,
1797
1799
  className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)
1798
1800
  }, props)
@@ -1800,10 +1802,10 @@ const SelectLabel = React__namespace.forwardRef((_i, ref) => {
1800
1802
  });
1801
1803
  SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
1802
1804
  const SelectItem = React__namespace.forwardRef((_k, ref) => {
1803
- var _l = _k, { className, children } = _l, props = __objRest$9(_l, ["className", "children"]);
1805
+ var _l = _k, { className, children } = _l, props = __objRest$a(_l, ["className", "children"]);
1804
1806
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1805
1807
  SelectPrimitive__namespace.Item,
1806
- __spreadProps$f(__spreadValues$m({
1808
+ __spreadProps$j(__spreadValues$q({
1807
1809
  ref,
1808
1810
  className: cn(
1809
1811
  "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
@@ -1819,10 +1821,10 @@ const SelectItem = React__namespace.forwardRef((_k, ref) => {
1819
1821
  });
1820
1822
  SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
1821
1823
  const SelectSeparator = React__namespace.forwardRef((_m, ref) => {
1822
- var _n = _m, { className } = _n, props = __objRest$9(_n, ["className"]);
1824
+ var _n = _m, { className } = _n, props = __objRest$a(_n, ["className"]);
1823
1825
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1824
1826
  SelectPrimitive__namespace.Separator,
1825
- __spreadValues$m({
1827
+ __spreadValues$q({
1826
1828
  ref,
1827
1829
  className: cn("-mx-1 my-1 h-px bg-muted", className)
1828
1830
  }, props)
@@ -1830,42 +1832,42 @@ const SelectSeparator = React__namespace.forwardRef((_m, ref) => {
1830
1832
  });
1831
1833
  SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
1832
1834
 
1833
- var __defProp$l = Object.defineProperty;
1834
- var __defProps$e = Object.defineProperties;
1835
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
1836
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
1837
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
1838
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
1839
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1840
- var __spreadValues$l = (a, b) => {
1835
+ var __defProp$p = Object.defineProperty;
1836
+ var __defProps$i = Object.defineProperties;
1837
+ var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
1838
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
1839
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
1840
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
1841
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1842
+ var __spreadValues$p = (a, b) => {
1841
1843
  for (var prop in b || (b = {}))
1842
- if (__hasOwnProp$l.call(b, prop))
1843
- __defNormalProp$l(a, prop, b[prop]);
1844
- if (__getOwnPropSymbols$l)
1845
- for (var prop of __getOwnPropSymbols$l(b)) {
1846
- if (__propIsEnum$l.call(b, prop))
1847
- __defNormalProp$l(a, prop, b[prop]);
1844
+ if (__hasOwnProp$p.call(b, prop))
1845
+ __defNormalProp$p(a, prop, b[prop]);
1846
+ if (__getOwnPropSymbols$p)
1847
+ for (var prop of __getOwnPropSymbols$p(b)) {
1848
+ if (__propIsEnum$p.call(b, prop))
1849
+ __defNormalProp$p(a, prop, b[prop]);
1848
1850
  }
1849
1851
  return a;
1850
1852
  };
1851
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
1852
- var __objRest$8 = (source, exclude) => {
1853
+ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
1854
+ var __objRest$9 = (source, exclude) => {
1853
1855
  var target = {};
1854
1856
  for (var prop in source)
1855
- if (__hasOwnProp$l.call(source, prop) && exclude.indexOf(prop) < 0)
1857
+ if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
1856
1858
  target[prop] = source[prop];
1857
- if (source != null && __getOwnPropSymbols$l)
1858
- for (var prop of __getOwnPropSymbols$l(source)) {
1859
- if (exclude.indexOf(prop) < 0 && __propIsEnum$l.call(source, prop))
1859
+ if (source != null && __getOwnPropSymbols$p)
1860
+ for (var prop of __getOwnPropSymbols$p(source)) {
1861
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
1860
1862
  target[prop] = source[prop];
1861
1863
  }
1862
1864
  return target;
1863
1865
  };
1864
1866
  const ScrollArea = React__namespace.forwardRef((_a, ref) => {
1865
- var _b = _a, { className, children } = _b, props = __objRest$8(_b, ["className", "children"]);
1867
+ var _b = _a, { className, children } = _b, props = __objRest$9(_b, ["className", "children"]);
1866
1868
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1867
1869
  ScrollAreaPrimitive__namespace.Root,
1868
- __spreadProps$e(__spreadValues$l({
1870
+ __spreadProps$i(__spreadValues$p({
1869
1871
  ref,
1870
1872
  className: cn("relative overflow-hidden", className)
1871
1873
  }, props), {
@@ -1879,10 +1881,10 @@ const ScrollArea = React__namespace.forwardRef((_a, ref) => {
1879
1881
  });
1880
1882
  ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
1881
1883
  const ScrollBar = React__namespace.forwardRef((_c, ref) => {
1882
- var _d = _c, { className, orientation = "vertical" } = _d, props = __objRest$8(_d, ["className", "orientation"]);
1884
+ var _d = _c, { className, orientation = "vertical" } = _d, props = __objRest$9(_d, ["className", "orientation"]);
1883
1885
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1884
1886
  ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
1885
- __spreadProps$e(__spreadValues$l({
1887
+ __spreadProps$i(__spreadValues$p({
1886
1888
  ref,
1887
1889
  orientation,
1888
1890
  className: cn(
@@ -1898,30 +1900,30 @@ const ScrollBar = React__namespace.forwardRef((_c, ref) => {
1898
1900
  });
1899
1901
  ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
1900
1902
 
1901
- var __defProp$k = Object.defineProperty;
1902
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
1903
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
1904
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
1905
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1906
- var __spreadValues$k = (a, b) => {
1903
+ var __defProp$o = Object.defineProperty;
1904
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
1905
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
1906
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
1907
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1908
+ var __spreadValues$o = (a, b) => {
1907
1909
  for (var prop in b || (b = {}))
1908
- if (__hasOwnProp$k.call(b, prop))
1909
- __defNormalProp$k(a, prop, b[prop]);
1910
- if (__getOwnPropSymbols$k)
1911
- for (var prop of __getOwnPropSymbols$k(b)) {
1912
- if (__propIsEnum$k.call(b, prop))
1913
- __defNormalProp$k(a, prop, b[prop]);
1910
+ if (__hasOwnProp$o.call(b, prop))
1911
+ __defNormalProp$o(a, prop, b[prop]);
1912
+ if (__getOwnPropSymbols$o)
1913
+ for (var prop of __getOwnPropSymbols$o(b)) {
1914
+ if (__propIsEnum$o.call(b, prop))
1915
+ __defNormalProp$o(a, prop, b[prop]);
1914
1916
  }
1915
1917
  return a;
1916
1918
  };
1917
- var __objRest$7 = (source, exclude) => {
1919
+ var __objRest$8 = (source, exclude) => {
1918
1920
  var target = {};
1919
1921
  for (var prop in source)
1920
- if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
1922
+ if (__hasOwnProp$o.call(source, prop) && exclude.indexOf(prop) < 0)
1921
1923
  target[prop] = source[prop];
1922
- if (source != null && __getOwnPropSymbols$k)
1923
- for (var prop of __getOwnPropSymbols$k(source)) {
1924
- if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
1924
+ if (source != null && __getOwnPropSymbols$o)
1925
+ for (var prop of __getOwnPropSymbols$o(source)) {
1926
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$o.call(source, prop))
1925
1927
  target[prop] = source[prop];
1926
1928
  }
1927
1929
  return target;
@@ -1953,11 +1955,11 @@ const buttonVariants = classVarianceAuthority.cva(
1953
1955
  );
1954
1956
  const Button = React__namespace.forwardRef(
1955
1957
  (_a, ref) => {
1956
- var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest$7(_b, ["className", "variant", "size", "asChild"]);
1958
+ var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest$8(_b, ["className", "variant", "size", "asChild"]);
1957
1959
  const Comp = asChild ? reactSlot.Slot : "button";
1958
1960
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1959
1961
  Comp,
1960
- __spreadValues$k({
1962
+ __spreadValues$o({
1961
1963
  className: cn(buttonVariants({ variant, size, className })),
1962
1964
  ref
1963
1965
  }, props)
@@ -1966,30 +1968,30 @@ const Button = React__namespace.forwardRef(
1966
1968
  );
1967
1969
  Button.displayName = "Button";
1968
1970
 
1969
- var __defProp$j = Object.defineProperty;
1970
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
1971
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
1972
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
1973
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1974
- var __spreadValues$j = (a, b) => {
1971
+ var __defProp$n = Object.defineProperty;
1972
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
1973
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
1974
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
1975
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1976
+ var __spreadValues$n = (a, b) => {
1975
1977
  for (var prop in b || (b = {}))
1976
- if (__hasOwnProp$j.call(b, prop))
1977
- __defNormalProp$j(a, prop, b[prop]);
1978
- if (__getOwnPropSymbols$j)
1979
- for (var prop of __getOwnPropSymbols$j(b)) {
1980
- if (__propIsEnum$j.call(b, prop))
1981
- __defNormalProp$j(a, prop, b[prop]);
1978
+ if (__hasOwnProp$n.call(b, prop))
1979
+ __defNormalProp$n(a, prop, b[prop]);
1980
+ if (__getOwnPropSymbols$n)
1981
+ for (var prop of __getOwnPropSymbols$n(b)) {
1982
+ if (__propIsEnum$n.call(b, prop))
1983
+ __defNormalProp$n(a, prop, b[prop]);
1982
1984
  }
1983
1985
  return a;
1984
1986
  };
1985
- var __objRest$6 = (source, exclude) => {
1987
+ var __objRest$7 = (source, exclude) => {
1986
1988
  var target = {};
1987
1989
  for (var prop in source)
1988
- if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
1990
+ if (__hasOwnProp$n.call(source, prop) && exclude.indexOf(prop) < 0)
1989
1991
  target[prop] = source[prop];
1990
- if (source != null && __getOwnPropSymbols$j)
1991
- for (var prop of __getOwnPropSymbols$j(source)) {
1992
- if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
1992
+ if (source != null && __getOwnPropSymbols$n)
1993
+ for (var prop of __getOwnPropSymbols$n(source)) {
1994
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$n.call(source, prop))
1993
1995
  target[prop] = source[prop];
1994
1996
  }
1995
1997
  return target;
@@ -2009,10 +2011,10 @@ const alertVariants = classVarianceAuthority.cva(
2009
2011
  }
2010
2012
  );
2011
2013
  const Alert = React__namespace.forwardRef((_a, ref) => {
2012
- var _b = _a, { className, variant } = _b, props = __objRest$6(_b, ["className", "variant"]);
2014
+ var _b = _a, { className, variant } = _b, props = __objRest$7(_b, ["className", "variant"]);
2013
2015
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
2014
2016
  "div",
2015
- __spreadValues$j({
2017
+ __spreadValues$n({
2016
2018
  ref,
2017
2019
  role: "alert",
2018
2020
  className: cn(alertVariants({ variant }), className)
@@ -2021,10 +2023,10 @@ const Alert = React__namespace.forwardRef((_a, ref) => {
2021
2023
  });
2022
2024
  Alert.displayName = "Alert";
2023
2025
  const AlertTitle = React__namespace.forwardRef((_c, ref) => {
2024
- var _d = _c, { className } = _d, props = __objRest$6(_d, ["className"]);
2026
+ var _d = _c, { className } = _d, props = __objRest$7(_d, ["className"]);
2025
2027
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
2026
2028
  "h5",
2027
- __spreadValues$j({
2029
+ __spreadValues$n({
2028
2030
  ref,
2029
2031
  className: cn("mb-1 font-medium leading-none tracking-tight", className)
2030
2032
  }, props)
@@ -2032,10 +2034,10 @@ const AlertTitle = React__namespace.forwardRef((_c, ref) => {
2032
2034
  });
2033
2035
  AlertTitle.displayName = "AlertTitle";
2034
2036
  const AlertDescription = React__namespace.forwardRef((_e, ref) => {
2035
- var _f = _e, { className } = _f, props = __objRest$6(_f, ["className"]);
2037
+ var _f = _e, { className } = _f, props = __objRest$7(_f, ["className"]);
2036
2038
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
2037
2039
  "div",
2038
- __spreadValues$j({
2040
+ __spreadValues$n({
2039
2041
  ref,
2040
2042
  className: cn("text-sm [&_p]:leading-relaxed", className)
2041
2043
  }, props)
@@ -2068,25 +2070,25 @@ function CodeEditor({
2068
2070
  );
2069
2071
  }
2070
2072
 
2071
- var __defProp$i = Object.defineProperty;
2072
- var __defProps$d = Object.defineProperties;
2073
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
2074
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
2075
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
2076
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
2077
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2078
- var __spreadValues$i = (a, b) => {
2073
+ var __defProp$m = Object.defineProperty;
2074
+ var __defProps$h = Object.defineProperties;
2075
+ var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
2076
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
2077
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
2078
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
2079
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2080
+ var __spreadValues$m = (a, b) => {
2079
2081
  for (var prop in b || (b = {}))
2080
- if (__hasOwnProp$i.call(b, prop))
2081
- __defNormalProp$i(a, prop, b[prop]);
2082
- if (__getOwnPropSymbols$i)
2083
- for (var prop of __getOwnPropSymbols$i(b)) {
2084
- if (__propIsEnum$i.call(b, prop))
2085
- __defNormalProp$i(a, prop, b[prop]);
2082
+ if (__hasOwnProp$m.call(b, prop))
2083
+ __defNormalProp$m(a, prop, b[prop]);
2084
+ if (__getOwnPropSymbols$m)
2085
+ for (var prop of __getOwnPropSymbols$m(b)) {
2086
+ if (__propIsEnum$m.call(b, prop))
2087
+ __defNormalProp$m(a, prop, b[prop]);
2086
2088
  }
2087
2089
  return a;
2088
2090
  };
2089
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
2091
+ var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
2090
2092
  function SearchWidgetFacetSettings({
2091
2093
  value = [],
2092
2094
  onChange,
@@ -2127,14 +2129,14 @@ function SearchWidgetFacetSettings({
2127
2129
  };
2128
2130
  const removeFacet = (index) => {
2129
2131
  const newFields = value.filter((_, i) => i !== index);
2130
- const reorderedFields = newFields.map((field, idx) => __spreadProps$d(__spreadValues$i({}, field), {
2132
+ const reorderedFields = newFields.map((field, idx) => __spreadProps$h(__spreadValues$m({}, field), {
2131
2133
  order: idx
2132
2134
  }));
2133
2135
  onChange(reorderedFields);
2134
2136
  };
2135
2137
  const updateFacet = (index, updates) => {
2136
2138
  const newFields = value.map(
2137
- (field, i) => i === index ? __spreadValues$i(__spreadValues$i({}, field), updates) : field
2139
+ (field, i) => i === index ? __spreadValues$m(__spreadValues$m({}, field), updates) : field
2138
2140
  );
2139
2141
  onChange(newFields);
2140
2142
  };
@@ -2145,8 +2147,8 @@ function SearchWidgetFacetSettings({
2145
2147
  const newFields = [...value];
2146
2148
  const newIndex = direction === "up" ? index - 1 : index + 1;
2147
2149
  [newFields[index], newFields[newIndex]] = [
2148
- __spreadProps$d(__spreadValues$i({}, newFields[newIndex]), { order: index }),
2149
- __spreadProps$d(__spreadValues$i({}, newFields[index]), { order: newIndex })
2150
+ __spreadProps$h(__spreadValues$m({}, newFields[newIndex]), { order: index }),
2151
+ __spreadProps$h(__spreadValues$m({}, newFields[index]), { order: newIndex })
2150
2152
  ];
2151
2153
  onChange(newFields);
2152
2154
  };
@@ -2232,25 +2234,25 @@ function SearchWidgetFacetSettings({
2232
2234
  ] });
2233
2235
  }
2234
2236
 
2235
- var __defProp$h = Object.defineProperty;
2236
- var __defProps$c = Object.defineProperties;
2237
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
2238
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
2239
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
2240
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
2241
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2242
- var __spreadValues$h = (a, b) => {
2237
+ var __defProp$l = Object.defineProperty;
2238
+ var __defProps$g = Object.defineProperties;
2239
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
2240
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
2241
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
2242
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
2243
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2244
+ var __spreadValues$l = (a, b) => {
2243
2245
  for (var prop in b || (b = {}))
2244
- if (__hasOwnProp$h.call(b, prop))
2245
- __defNormalProp$h(a, prop, b[prop]);
2246
- if (__getOwnPropSymbols$h)
2247
- for (var prop of __getOwnPropSymbols$h(b)) {
2248
- if (__propIsEnum$h.call(b, prop))
2249
- __defNormalProp$h(a, prop, b[prop]);
2246
+ if (__hasOwnProp$l.call(b, prop))
2247
+ __defNormalProp$l(a, prop, b[prop]);
2248
+ if (__getOwnPropSymbols$l)
2249
+ for (var prop of __getOwnPropSymbols$l(b)) {
2250
+ if (__propIsEnum$l.call(b, prop))
2251
+ __defNormalProp$l(a, prop, b[prop]);
2250
2252
  }
2251
2253
  return a;
2252
2254
  };
2253
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
2255
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
2254
2256
  function WidgetSettingsPanel({
2255
2257
  pageId,
2256
2258
  widget,
@@ -2276,14 +2278,14 @@ function WidgetSettingsPanel({
2276
2278
  }
2277
2279
  const pageData = await pageResponse.json();
2278
2280
  const updatedWidgets = pageData.widgets.map(
2279
- (w) => w.id === widgetId ? __spreadValues$h(__spreadValues$h({}, w), updates) : w
2281
+ (w) => w.id === widgetId ? __spreadValues$l(__spreadValues$l({}, w), updates) : w
2280
2282
  );
2281
2283
  const response = await fetch(getApiUrl(`/api/pages/${pageId}`), {
2282
2284
  method: "PUT",
2283
2285
  headers: {
2284
2286
  "Content-Type": "application/json"
2285
2287
  },
2286
- body: JSON.stringify(__spreadProps$c(__spreadValues$h({}, pageData), {
2288
+ body: JSON.stringify(__spreadProps$g(__spreadValues$l({}, pageData), {
2287
2289
  widgets: updatedWidgets
2288
2290
  }))
2289
2291
  });
@@ -2342,12 +2344,12 @@ function WidgetSettingsPanel({
2342
2344
  }
2343
2345
  };
2344
2346
  const updateWidget = (updates) => {
2345
- const updatedWidget = __spreadValues$h(__spreadValues$h({}, localWidget), updates);
2347
+ const updatedWidget = __spreadValues$l(__spreadValues$l({}, localWidget), updates);
2346
2348
  setLocalWidget(updatedWidget);
2347
2349
  };
2348
2350
  const updateConfig = (updates) => {
2349
2351
  console.log("Updating config with:", updates);
2350
- const newConfig = __spreadValues$h(__spreadValues$h({}, localWidget.config), updates);
2352
+ const newConfig = __spreadValues$l(__spreadValues$l({}, localWidget.config), updates);
2351
2353
  console.log("New config will be:", newConfig);
2352
2354
  updateWidget({
2353
2355
  config: newConfig
@@ -2356,8 +2358,8 @@ function WidgetSettingsPanel({
2356
2358
  const updateStyle = (updates) => {
2357
2359
  var _a;
2358
2360
  updateWidget({
2359
- config: __spreadProps$c(__spreadValues$h({}, localWidget.config), {
2360
- styles: __spreadValues$h(__spreadValues$h({}, ((_a = localWidget.config) == null ? void 0 : _a.styles) || {}), updates)
2361
+ config: __spreadProps$g(__spreadValues$l({}, localWidget.config), {
2362
+ styles: __spreadValues$l(__spreadValues$l({}, ((_a = localWidget.config) == null ? void 0 : _a.styles) || {}), updates)
2361
2363
  })
2362
2364
  });
2363
2365
  };
@@ -2624,8 +2626,8 @@ function WidgetSettingsPanel({
2624
2626
  checked: (_k = (_j = (_i = widget.config) == null ? void 0 : _i.facets) == null ? void 0 : _j.enabled) != null ? _k : false,
2625
2627
  onCheckedChange: (checked) => {
2626
2628
  var _a2, _b2, _c2;
2627
- const newConfig = __spreadProps$c(__spreadValues$h({}, widget.config), {
2628
- facets: __spreadProps$c(__spreadValues$h({}, ((_a2 = widget.config) == null ? void 0 : _a2.facets) || {}), {
2629
+ const newConfig = __spreadProps$g(__spreadValues$l({}, widget.config), {
2630
+ facets: __spreadProps$g(__spreadValues$l({}, ((_a2 = widget.config) == null ? void 0 : _a2.facets) || {}), {
2629
2631
  enabled: checked,
2630
2632
  fields: ((_c2 = (_b2 = widget.config) == null ? void 0 : _b2.facets) == null ? void 0 : _c2.fields) || []
2631
2633
  })
@@ -2641,8 +2643,8 @@ function WidgetSettingsPanel({
2641
2643
  placeHolder: "Select facet field",
2642
2644
  value: widget.config.facets.fields || [],
2643
2645
  onChange: (fields) => {
2644
- const newConfig = __spreadProps$c(__spreadValues$h({}, widget.config), {
2645
- facets: __spreadProps$c(__spreadValues$h({}, widget.config.facets), {
2646
+ const newConfig = __spreadProps$g(__spreadValues$l({}, widget.config), {
2647
+ facets: __spreadProps$g(__spreadValues$l({}, widget.config.facets), {
2646
2648
  fields
2647
2649
  })
2648
2650
  });
@@ -2666,7 +2668,7 @@ function WidgetSettingsPanel({
2666
2668
  onValueChange: (value) => {
2667
2669
  var _a2;
2668
2670
  return updateConfig({
2669
- layout: __spreadProps$c(__spreadValues$h({}, (_a2 = localWidget.config) == null ? void 0 : _a2.layout), { type: value })
2671
+ layout: __spreadProps$g(__spreadValues$l({}, (_a2 = localWidget.config) == null ? void 0 : _a2.layout), { type: value })
2670
2672
  });
2671
2673
  },
2672
2674
  children: [
@@ -2689,7 +2691,7 @@ function WidgetSettingsPanel({
2689
2691
  onValueChange: (value) => {
2690
2692
  var _a2;
2691
2693
  return updateConfig({
2692
- layout: __spreadProps$c(__spreadValues$h({}, (_a2 = localWidget.config) == null ? void 0 : _a2.layout), {
2694
+ layout: __spreadProps$g(__spreadValues$l({}, (_a2 = localWidget.config) == null ? void 0 : _a2.layout), {
2693
2695
  itemsPerPage: parseInt(value)
2694
2696
  })
2695
2697
  });
@@ -2713,7 +2715,7 @@ function WidgetSettingsPanel({
2713
2715
  onCheckedChange: (checked) => {
2714
2716
  var _a2;
2715
2717
  return updateConfig({
2716
- layout: __spreadProps$c(__spreadValues$h({}, (_a2 = localWidget.config) == null ? void 0 : _a2.layout), {
2718
+ layout: __spreadProps$g(__spreadValues$l({}, (_a2 = localWidget.config) == null ? void 0 : _a2.layout), {
2717
2719
  infiniteScroll: checked
2718
2720
  })
2719
2721
  });
@@ -2765,8 +2767,8 @@ function WidgetSettingsPanel({
2765
2767
  placeHolder: "Select metadata field",
2766
2768
  value: ((_l = (_k = widget.config) == null ? void 0 : _k.metadata) == null ? void 0 : _l.fields) || [],
2767
2769
  onChange: (fields) => {
2768
- const newConfig = __spreadProps$c(__spreadValues$h({}, widget.config), {
2769
- metadata: __spreadProps$c(__spreadValues$h({}, widget.config.metadata), {
2770
+ const newConfig = __spreadProps$g(__spreadValues$l({}, widget.config), {
2771
+ metadata: __spreadProps$g(__spreadValues$l({}, widget.config.metadata), {
2770
2772
  fields
2771
2773
  })
2772
2774
  });
@@ -2842,8 +2844,8 @@ function WidgetSettingsPanel({
2842
2844
  checked: (_f = (_e = (_d = widget.config) == null ? void 0 : _d.facets) == null ? void 0 : _e.enabled) != null ? _f : false,
2843
2845
  onCheckedChange: (checked) => {
2844
2846
  var _a2, _b2, _c2;
2845
- const newConfig = __spreadProps$c(__spreadValues$h({}, widget.config), {
2846
- facets: __spreadProps$c(__spreadValues$h({}, ((_a2 = widget.config) == null ? void 0 : _a2.facets) || {}), {
2847
+ const newConfig = __spreadProps$g(__spreadValues$l({}, widget.config), {
2848
+ facets: __spreadProps$g(__spreadValues$l({}, ((_a2 = widget.config) == null ? void 0 : _a2.facets) || {}), {
2847
2849
  enabled: checked,
2848
2850
  fields: ((_c2 = (_b2 = widget.config) == null ? void 0 : _b2.facets) == null ? void 0 : _c2.fields) || []
2849
2851
  })
@@ -2860,8 +2862,8 @@ function WidgetSettingsPanel({
2860
2862
  placeHolder: "Select facet field",
2861
2863
  value: widget.config.facets.fields || [],
2862
2864
  onChange: (fields) => {
2863
- const newConfig = __spreadProps$c(__spreadValues$h({}, widget.config), {
2864
- facets: __spreadProps$c(__spreadValues$h({}, widget.config.facets), {
2865
+ const newConfig = __spreadProps$g(__spreadValues$l({}, widget.config), {
2866
+ facets: __spreadProps$g(__spreadValues$l({}, widget.config.facets), {
2865
2867
  fields
2866
2868
  })
2867
2869
  });
@@ -2979,39 +2981,39 @@ function WidgetSettingsPanel({
2979
2981
  ] });
2980
2982
  }
2981
2983
 
2982
- var __defProp$g = Object.defineProperty;
2983
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
2984
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
2985
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
2986
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2987
- var __spreadValues$g = (a, b) => {
2984
+ var __defProp$k = Object.defineProperty;
2985
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
2986
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
2987
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
2988
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2989
+ var __spreadValues$k = (a, b) => {
2988
2990
  for (var prop in b || (b = {}))
2989
- if (__hasOwnProp$g.call(b, prop))
2990
- __defNormalProp$g(a, prop, b[prop]);
2991
- if (__getOwnPropSymbols$g)
2992
- for (var prop of __getOwnPropSymbols$g(b)) {
2993
- if (__propIsEnum$g.call(b, prop))
2994
- __defNormalProp$g(a, prop, b[prop]);
2991
+ if (__hasOwnProp$k.call(b, prop))
2992
+ __defNormalProp$k(a, prop, b[prop]);
2993
+ if (__getOwnPropSymbols$k)
2994
+ for (var prop of __getOwnPropSymbols$k(b)) {
2995
+ if (__propIsEnum$k.call(b, prop))
2996
+ __defNormalProp$k(a, prop, b[prop]);
2995
2997
  }
2996
2998
  return a;
2997
2999
  };
2998
- var __objRest$5 = (source, exclude) => {
3000
+ var __objRest$6 = (source, exclude) => {
2999
3001
  var target = {};
3000
3002
  for (var prop in source)
3001
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
3003
+ if (__hasOwnProp$k.call(source, prop) && exclude.indexOf(prop) < 0)
3002
3004
  target[prop] = source[prop];
3003
- if (source != null && __getOwnPropSymbols$g)
3004
- for (var prop of __getOwnPropSymbols$g(source)) {
3005
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
3005
+ if (source != null && __getOwnPropSymbols$k)
3006
+ for (var prop of __getOwnPropSymbols$k(source)) {
3007
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$k.call(source, prop))
3006
3008
  target[prop] = source[prop];
3007
3009
  }
3008
3010
  return target;
3009
3011
  };
3010
3012
  const Card = React__namespace.forwardRef((_a, ref) => {
3011
- var _b = _a, { className } = _b, props = __objRest$5(_b, ["className"]);
3013
+ var _b = _a, { className } = _b, props = __objRest$6(_b, ["className"]);
3012
3014
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
3013
3015
  "div",
3014
- __spreadValues$g({
3016
+ __spreadValues$k({
3015
3017
  ref,
3016
3018
  className: cn(
3017
3019
  "rounded-lg border bg-card text-card-foreground shadow-sm",
@@ -3022,10 +3024,10 @@ const Card = React__namespace.forwardRef((_a, ref) => {
3022
3024
  });
3023
3025
  Card.displayName = "Card";
3024
3026
  const CardHeader = React__namespace.forwardRef((_c, ref) => {
3025
- var _d = _c, { className } = _d, props = __objRest$5(_d, ["className"]);
3027
+ var _d = _c, { className } = _d, props = __objRest$6(_d, ["className"]);
3026
3028
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
3027
3029
  "div",
3028
- __spreadValues$g({
3030
+ __spreadValues$k({
3029
3031
  ref,
3030
3032
  className: cn("flex flex-col space-y-1.5 p-6", className)
3031
3033
  }, props)
@@ -3033,10 +3035,10 @@ const CardHeader = React__namespace.forwardRef((_c, ref) => {
3033
3035
  });
3034
3036
  CardHeader.displayName = "CardHeader";
3035
3037
  const CardTitle = React__namespace.forwardRef((_e, ref) => {
3036
- var _f = _e, { className } = _f, props = __objRest$5(_f, ["className"]);
3038
+ var _f = _e, { className } = _f, props = __objRest$6(_f, ["className"]);
3037
3039
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
3038
3040
  "div",
3039
- __spreadValues$g({
3041
+ __spreadValues$k({
3040
3042
  ref,
3041
3043
  className: cn(
3042
3044
  "text-2xl font-semibold leading-none tracking-tight",
@@ -3047,10 +3049,10 @@ const CardTitle = React__namespace.forwardRef((_e, ref) => {
3047
3049
  });
3048
3050
  CardTitle.displayName = "CardTitle";
3049
3051
  const CardDescription = React__namespace.forwardRef((_g, ref) => {
3050
- var _h = _g, { className } = _h, props = __objRest$5(_h, ["className"]);
3052
+ var _h = _g, { className } = _h, props = __objRest$6(_h, ["className"]);
3051
3053
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
3052
3054
  "div",
3053
- __spreadValues$g({
3055
+ __spreadValues$k({
3054
3056
  ref,
3055
3057
  className: cn("text-sm text-muted-foreground", className)
3056
3058
  }, props)
@@ -3058,15 +3060,15 @@ const CardDescription = React__namespace.forwardRef((_g, ref) => {
3058
3060
  });
3059
3061
  CardDescription.displayName = "CardDescription";
3060
3062
  const CardContent = React__namespace.forwardRef((_i, ref) => {
3061
- var _j = _i, { className } = _j, props = __objRest$5(_j, ["className"]);
3062
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadValues$g({ ref, className: cn("p-6 pt-0", className) }, props));
3063
+ var _j = _i, { className } = _j, props = __objRest$6(_j, ["className"]);
3064
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadValues$k({ ref, className: cn("p-6 pt-0", className) }, props));
3063
3065
  });
3064
3066
  CardContent.displayName = "CardContent";
3065
3067
  const CardFooter = React__namespace.forwardRef((_k, ref) => {
3066
- var _l = _k, { className } = _l, props = __objRest$5(_l, ["className"]);
3068
+ var _l = _k, { className } = _l, props = __objRest$6(_l, ["className"]);
3067
3069
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
3068
3070
  "div",
3069
- __spreadValues$g({
3071
+ __spreadValues$k({
3070
3072
  ref,
3071
3073
  className: cn("flex items-center p-6 pt-0", className)
3072
3074
  }, props)
@@ -3175,30 +3177,141 @@ function WidgetPalette({ widgetBackendUrl } = {}) {
3175
3177
  ] });
3176
3178
  }
3177
3179
 
3178
- var __defProp$f = Object.defineProperty;
3179
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
3180
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
3181
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
3182
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3183
- var __spreadValues$f = (a, b) => {
3180
+ class WidgetService {
3181
+ constructor() {
3182
+ this.baseUrl = "/api/widgets";
3183
+ }
3184
+ async getWidgetTypes() {
3185
+ try {
3186
+ const response = await fetch(`${this.baseUrl}/types`);
3187
+ if (!response.ok) {
3188
+ throw new Error(`Failed to fetch widget types: ${response.statusText}`);
3189
+ }
3190
+ const data = await response.json();
3191
+ return data;
3192
+ } catch (error) {
3193
+ console.error("Error fetching widget types:", error);
3194
+ throw error;
3195
+ }
3196
+ }
3197
+ async getWidgetTemplates() {
3198
+ try {
3199
+ const response = await fetch(`${this.baseUrl}/templates`);
3200
+ if (!response.ok) {
3201
+ throw new Error(
3202
+ `Failed to fetch widget templates: ${response.statusText}`
3203
+ );
3204
+ }
3205
+ return await response.json();
3206
+ } catch (error) {
3207
+ console.error("Error fetching widget templates:", error);
3208
+ throw error;
3209
+ }
3210
+ }
3211
+ async getWidgetCategories() {
3212
+ try {
3213
+ const response = await fetch(`${this.baseUrl}/categories`);
3214
+ if (!response.ok) {
3215
+ throw new Error(
3216
+ `Failed to fetch widget categories: ${response.statusText}`
3217
+ );
3218
+ }
3219
+ return await response.json();
3220
+ } catch (error) {
3221
+ console.error("Error fetching widget categories:", error);
3222
+ throw error;
3223
+ }
3224
+ }
3225
+ async getPageWidgets(pageId) {
3226
+ try {
3227
+ const response = await fetch(`${this.baseUrl}/page/${pageId}`);
3228
+ if (!response.ok) {
3229
+ throw new Error(`Failed to fetch page widgets: ${response.statusText}`);
3230
+ }
3231
+ return await response.json();
3232
+ } catch (error) {
3233
+ console.error("Error fetching page widgets:", error);
3234
+ throw error;
3235
+ }
3236
+ }
3237
+ async saveWidget(widget) {
3238
+ try {
3239
+ const response = await fetch(this.baseUrl, {
3240
+ method: widget.id ? "PUT" : "POST",
3241
+ headers: {
3242
+ "Content-Type": "application/json"
3243
+ },
3244
+ body: JSON.stringify(widget)
3245
+ });
3246
+ if (!response.ok) {
3247
+ throw new Error(`Failed to save widget: ${response.statusText}`);
3248
+ }
3249
+ return await response.json();
3250
+ } catch (error) {
3251
+ console.error("Error saving widget:", error);
3252
+ throw error;
3253
+ }
3254
+ }
3255
+ async deleteWidget(widgetId) {
3256
+ try {
3257
+ const response = await fetch(`${this.baseUrl}/${widgetId}`, {
3258
+ method: "DELETE"
3259
+ });
3260
+ if (!response.ok) {
3261
+ throw new Error(`Failed to delete widget: ${response.statusText}`);
3262
+ }
3263
+ return true;
3264
+ } catch (error) {
3265
+ console.error("Error deleting widget:", error);
3266
+ throw error;
3267
+ }
3268
+ }
3269
+ async updateWidgetPositions(widgets) {
3270
+ try {
3271
+ const response = await fetch(`${this.baseUrl}/positions`, {
3272
+ method: "PUT",
3273
+ headers: {
3274
+ "Content-Type": "application/json"
3275
+ },
3276
+ body: JSON.stringify(widgets)
3277
+ });
3278
+ if (!response.ok) {
3279
+ throw new Error(
3280
+ `Failed to update widget positions: ${response.statusText}`
3281
+ );
3282
+ }
3283
+ return await response.json();
3284
+ } catch (error) {
3285
+ console.error("Error updating widget positions:", error);
3286
+ throw error;
3287
+ }
3288
+ }
3289
+ }
3290
+
3291
+ var __defProp$j = Object.defineProperty;
3292
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
3293
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
3294
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
3295
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3296
+ var __spreadValues$j = (a, b) => {
3184
3297
  for (var prop in b || (b = {}))
3185
- if (__hasOwnProp$f.call(b, prop))
3186
- __defNormalProp$f(a, prop, b[prop]);
3187
- if (__getOwnPropSymbols$f)
3188
- for (var prop of __getOwnPropSymbols$f(b)) {
3189
- if (__propIsEnum$f.call(b, prop))
3190
- __defNormalProp$f(a, prop, b[prop]);
3298
+ if (__hasOwnProp$j.call(b, prop))
3299
+ __defNormalProp$j(a, prop, b[prop]);
3300
+ if (__getOwnPropSymbols$j)
3301
+ for (var prop of __getOwnPropSymbols$j(b)) {
3302
+ if (__propIsEnum$j.call(b, prop))
3303
+ __defNormalProp$j(a, prop, b[prop]);
3191
3304
  }
3192
3305
  return a;
3193
3306
  };
3194
- var __objRest$4 = (source, exclude) => {
3307
+ var __objRest$5 = (source, exclude) => {
3195
3308
  var target = {};
3196
3309
  for (var prop in source)
3197
- if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
3310
+ if (__hasOwnProp$j.call(source, prop) && exclude.indexOf(prop) < 0)
3198
3311
  target[prop] = source[prop];
3199
- if (source != null && __getOwnPropSymbols$f)
3200
- for (var prop of __getOwnPropSymbols$f(source)) {
3201
- if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
3312
+ if (source != null && __getOwnPropSymbols$j)
3313
+ for (var prop of __getOwnPropSymbols$j(source)) {
3314
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$j.call(source, prop))
3202
3315
  target[prop] = source[prop];
3203
3316
  }
3204
3317
  return target;
@@ -3225,8 +3338,8 @@ const badgeVariants = classVarianceAuthority.cva(
3225
3338
  }
3226
3339
  );
3227
3340
  function Badge(_a) {
3228
- var _b = _a, { className, variant } = _b, props = __objRest$4(_b, ["className", "variant"]);
3229
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadValues$f({ className: cn(badgeVariants({ variant }), className) }, props));
3341
+ var _b = _a, { className, variant } = _b, props = __objRest$5(_b, ["className", "variant"]);
3342
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadValues$j({ className: cn(badgeVariants({ variant }), className) }, props));
3230
3343
  }
3231
3344
 
3232
3345
  // src/primitive.tsx
@@ -6862,30 +6975,30 @@ var Root3 = Tooltip$2;
6862
6975
  var Trigger = TooltipTrigger$1;
6863
6976
  var Content2 = TooltipContent$1;
6864
6977
 
6865
- var __defProp$e = Object.defineProperty;
6866
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
6867
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
6868
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
6869
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6870
- var __spreadValues$e = (a, b) => {
6978
+ var __defProp$i = Object.defineProperty;
6979
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
6980
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
6981
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
6982
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6983
+ var __spreadValues$i = (a, b) => {
6871
6984
  for (var prop in b || (b = {}))
6872
- if (__hasOwnProp$e.call(b, prop))
6873
- __defNormalProp$e(a, prop, b[prop]);
6874
- if (__getOwnPropSymbols$e)
6875
- for (var prop of __getOwnPropSymbols$e(b)) {
6876
- if (__propIsEnum$e.call(b, prop))
6877
- __defNormalProp$e(a, prop, b[prop]);
6985
+ if (__hasOwnProp$i.call(b, prop))
6986
+ __defNormalProp$i(a, prop, b[prop]);
6987
+ if (__getOwnPropSymbols$i)
6988
+ for (var prop of __getOwnPropSymbols$i(b)) {
6989
+ if (__propIsEnum$i.call(b, prop))
6990
+ __defNormalProp$i(a, prop, b[prop]);
6878
6991
  }
6879
6992
  return a;
6880
6993
  };
6881
- var __objRest$3 = (source, exclude) => {
6994
+ var __objRest$4 = (source, exclude) => {
6882
6995
  var target = {};
6883
6996
  for (var prop in source)
6884
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
6997
+ if (__hasOwnProp$i.call(source, prop) && exclude.indexOf(prop) < 0)
6885
6998
  target[prop] = source[prop];
6886
- if (source != null && __getOwnPropSymbols$e)
6887
- for (var prop of __getOwnPropSymbols$e(source)) {
6888
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
6999
+ if (source != null && __getOwnPropSymbols$i)
7000
+ for (var prop of __getOwnPropSymbols$i(source)) {
7001
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$i.call(source, prop))
6889
7002
  target[prop] = source[prop];
6890
7003
  }
6891
7004
  return target;
@@ -6894,10 +7007,10 @@ const TooltipProvider = Provider;
6894
7007
  const Tooltip$1 = Root3;
6895
7008
  const TooltipTrigger = Trigger;
6896
7009
  const TooltipContent = React__namespace.forwardRef((_a, ref) => {
6897
- var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest$3(_b, ["className", "sideOffset"]);
7010
+ var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest$4(_b, ["className", "sideOffset"]);
6898
7011
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
6899
7012
  Content2,
6900
- __spreadValues$e({
7013
+ __spreadValues$i({
6901
7014
  ref,
6902
7015
  sideOffset,
6903
7016
  className: cn(
@@ -7059,11 +7172,16 @@ function getWidgetStyles(widget) {
7059
7172
  };
7060
7173
  }
7061
7174
  function shuffleColors(colors, count) {
7062
- const shuffled = [...colors].sort(() => Math.random() - 0.5);
7063
- while (shuffled.length < count) {
7064
- shuffled.push(...[...colors].sort(() => Math.random() - 0.5));
7175
+ const shuffled = [...colors];
7176
+ for (let i = shuffled.length - 1; i > 0; i--) {
7177
+ const j = Math.floor(Math.random() * (i + 1));
7178
+ [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
7065
7179
  }
7066
- return shuffled.slice(0, count);
7180
+ let result = [...shuffled];
7181
+ while (result.length < count) {
7182
+ result.push(...shuffled);
7183
+ }
7184
+ return result.slice(0, count);
7067
7185
  }
7068
7186
  function getBorderRadiusValue(value) {
7069
7187
  switch (value) {
@@ -7094,25 +7212,25 @@ function getPaddingValue(value) {
7094
7212
  }
7095
7213
  }
7096
7214
 
7097
- var __defProp$d = Object.defineProperty;
7098
- var __defProps$b = Object.defineProperties;
7099
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
7100
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
7101
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
7102
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
7103
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7104
- var __spreadValues$d = (a, b) => {
7215
+ var __defProp$h = Object.defineProperty;
7216
+ var __defProps$f = Object.defineProperties;
7217
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
7218
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
7219
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
7220
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
7221
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7222
+ var __spreadValues$h = (a, b) => {
7105
7223
  for (var prop in b || (b = {}))
7106
- if (__hasOwnProp$d.call(b, prop))
7107
- __defNormalProp$d(a, prop, b[prop]);
7108
- if (__getOwnPropSymbols$d)
7109
- for (var prop of __getOwnPropSymbols$d(b)) {
7110
- if (__propIsEnum$d.call(b, prop))
7111
- __defNormalProp$d(a, prop, b[prop]);
7224
+ if (__hasOwnProp$h.call(b, prop))
7225
+ __defNormalProp$h(a, prop, b[prop]);
7226
+ if (__getOwnPropSymbols$h)
7227
+ for (var prop of __getOwnPropSymbols$h(b)) {
7228
+ if (__propIsEnum$h.call(b, prop))
7229
+ __defNormalProp$h(a, prop, b[prop]);
7112
7230
  }
7113
7231
  return a;
7114
7232
  };
7115
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
7233
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
7116
7234
  function FacetWidget({
7117
7235
  widget,
7118
7236
  showHeader = true,
@@ -7171,7 +7289,7 @@ function FacetWidget({
7171
7289
  };
7172
7290
  const updateConfig = (newFields) => {
7173
7291
  if (onConfigUpdate) {
7174
- onConfigUpdate(__spreadProps$b(__spreadValues$d({}, widget.config), {
7292
+ onConfigUpdate(__spreadProps$f(__spreadValues$h({}, widget.config), {
7175
7293
  fields: newFields
7176
7294
  }));
7177
7295
  }
@@ -20168,9 +20286,28 @@ function BarChart({ orientation, title, data, options, className, units, content
20168
20286
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { data, options: options != null ? options : defaultOptions, plugins: [barValuePlugin] });
20169
20287
  }
20170
20288
 
20289
+ var __defProp$g = Object.defineProperty;
20290
+ var __defProps$e = Object.defineProperties;
20291
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
20292
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
20293
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
20294
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
20295
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20296
+ var __spreadValues$g = (a, b) => {
20297
+ for (var prop in b || (b = {}))
20298
+ if (__hasOwnProp$g.call(b, prop))
20299
+ __defNormalProp$g(a, prop, b[prop]);
20300
+ if (__getOwnPropSymbols$g)
20301
+ for (var prop of __getOwnPropSymbols$g(b)) {
20302
+ if (__propIsEnum$g.call(b, prop))
20303
+ __defNormalProp$g(a, prop, b[prop]);
20304
+ }
20305
+ return a;
20306
+ };
20307
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
20171
20308
  Chart$1.register(CategoryScale, LinearScale, BarElement, plugin_title, plugin_tooltip, plugin_legend);
20172
- function SeriesChart({ orientation, title, data, options, className, units, content, x_axis_title, y_axis_title }) {
20173
- var _a, _b;
20309
+ function SeriesChart({ orientation, title, data, options, className, units, content, x_axis_title, y_axis_title, chartSettings }) {
20310
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
20174
20311
  const formatValue = (value) => {
20175
20312
  const numValue = typeof value === "string" ? parseFloat(value) : value;
20176
20313
  if (!isNaN(numValue)) {
@@ -20240,16 +20377,6 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
20240
20377
  datalabels: {
20241
20378
  display: false
20242
20379
  },
20243
- title: {
20244
- display: true,
20245
- text: title,
20246
- font: {
20247
- size: 16,
20248
- weight: "bold"
20249
- },
20250
- color: "#0F172A",
20251
- padding: 16
20252
- },
20253
20380
  tooltip: {
20254
20381
  mode: "index",
20255
20382
  intersect: false,
@@ -20310,7 +20437,53 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
20310
20437
  }
20311
20438
  }
20312
20439
  };
20313
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { data, options: options != null ? options : defaultOptions, plugins: [barValuePlugin] });
20440
+ const mergedOptions = chartSettings ? __spreadProps$e(__spreadValues$g({}, defaultOptions), {
20441
+ plugins: __spreadProps$e(__spreadValues$g({}, defaultOptions.plugins), {
20442
+ legend: __spreadProps$e(__spreadValues$g({}, (_c = defaultOptions.plugins) == null ? void 0 : _c.legend), {
20443
+ display: chartSettings.showLegend !== false,
20444
+ labels: __spreadProps$e(__spreadValues$g({}, (_e = (_d = defaultOptions.plugins) == null ? void 0 : _d.legend) == null ? void 0 : _e.labels), {
20445
+ boxWidth: (_f = chartSettings.legendBoxSize) != null ? _f : 16,
20446
+ boxHeight: (_g = chartSettings.legendBoxSize) != null ? _g : 16,
20447
+ font: { size: (_h = chartSettings.legendFontSize) != null ? _h : 13 }
20448
+ })
20449
+ }),
20450
+ tooltip: __spreadProps$e(__spreadValues$g({}, (_i = defaultOptions.plugins) == null ? void 0 : _i.tooltip), {
20451
+ bodyFont: { size: (_j = chartSettings.tooltipFontSize) != null ? _j : 12 },
20452
+ titleFont: { size: (_k = chartSettings.tooltipFontSize) != null ? _k : 12 }
20453
+ })
20454
+ }),
20455
+ scales: __spreadProps$e(__spreadValues$g({}, defaultOptions.scales), {
20456
+ x: __spreadProps$e(__spreadValues$g({}, (_l = defaultOptions.scales) == null ? void 0 : _l.x), {
20457
+ title: __spreadProps$e(__spreadValues$g({}, (_n = (_m = defaultOptions.scales) == null ? void 0 : _m.x) == null ? void 0 : _n.title), {
20458
+ font: { size: (_o = chartSettings.xAxisTitleFontSize) != null ? _o : 13, weight: "bold" }
20459
+ }),
20460
+ ticks: __spreadProps$e(__spreadValues$g({}, (_q = (_p = defaultOptions.scales) == null ? void 0 : _p.x) == null ? void 0 : _q.ticks), {
20461
+ font: { size: (_r = chartSettings.xAxisTickFontSize) != null ? _r : 12 }
20462
+ })
20463
+ }),
20464
+ y: __spreadProps$e(__spreadValues$g({}, (_s = defaultOptions.scales) == null ? void 0 : _s.y), {
20465
+ title: __spreadProps$e(__spreadValues$g({}, (_u = (_t = defaultOptions.scales) == null ? void 0 : _t.y) == null ? void 0 : _u.title), {
20466
+ font: { size: (_v = chartSettings.yAxisTitleFontSize) != null ? _v : 13, weight: "bold" }
20467
+ }),
20468
+ ticks: __spreadProps$e(__spreadValues$g({}, (_x = (_w = defaultOptions.scales) == null ? void 0 : _w.y) == null ? void 0 : _x.ticks), {
20469
+ font: { size: (_y = chartSettings.yAxisTickFontSize) != null ? _y : 12 }
20470
+ })
20471
+ })
20472
+ })
20473
+ }) : defaultOptions;
20474
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col h-full", children: [
20475
+ ((chartSettings == null ? void 0 : chartSettings.titleText) || title) && (chartSettings == null ? void 0 : chartSettings.showTitle) !== false && /* @__PURE__ */ jsxRuntimeExports.jsx(
20476
+ "p",
20477
+ {
20478
+ style: {
20479
+ fontSize: `${(_z = chartSettings == null ? void 0 : chartSettings.titleFontSize) != null ? _z : 16}px`
20480
+ },
20481
+ className: "font-bold text-slate-900 text-center px-2 pt-4 pb-2 select-text cursor-text shrink-0",
20482
+ children: (chartSettings == null ? void 0 : chartSettings.titleText) || title
20483
+ }
20484
+ ),
20485
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { data, options: options != null ? options : mergedOptions, plugins: [barValuePlugin] }) })
20486
+ ] });
20314
20487
  }
20315
20488
 
20316
20489
  /*!
@@ -21661,9 +21834,28 @@ var plugin$1 = {
21661
21834
  }
21662
21835
  };
21663
21836
 
21664
- Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend);
21665
- function SeriesLineChart({ orientation, title, data, options, className, units, content, x_axis_title, y_axis_title }) {
21666
- var _a, _b;
21837
+ var __defProp$f = Object.defineProperty;
21838
+ var __defProps$d = Object.defineProperties;
21839
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
21840
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
21841
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
21842
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
21843
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21844
+ var __spreadValues$f = (a, b) => {
21845
+ for (var prop in b || (b = {}))
21846
+ if (__hasOwnProp$f.call(b, prop))
21847
+ __defNormalProp$f(a, prop, b[prop]);
21848
+ if (__getOwnPropSymbols$f)
21849
+ for (var prop of __getOwnPropSymbols$f(b)) {
21850
+ if (__propIsEnum$f.call(b, prop))
21851
+ __defNormalProp$f(a, prop, b[prop]);
21852
+ }
21853
+ return a;
21854
+ };
21855
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
21856
+ Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_tooltip, plugin_legend);
21857
+ function SeriesLineChart({ orientation, title, data, options, className, units, content, x_axis_title, y_axis_title, chartSettings }) {
21858
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
21667
21859
  const formatValue = (value) => {
21668
21860
  const numValue = typeof value === "string" ? parseFloat(value) : value;
21669
21861
  if (!isNaN(numValue)) {
@@ -21724,16 +21916,6 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
21724
21916
  },
21725
21917
  formatter: (value) => value
21726
21918
  },
21727
- title: {
21728
- display: true,
21729
- text: title,
21730
- font: {
21731
- size: 16,
21732
- weight: "bold"
21733
- },
21734
- color: "#0F172A",
21735
- padding: 16
21736
- },
21737
21919
  tooltip: {
21738
21920
  mode: "index",
21739
21921
  intersect: false,
@@ -21799,7 +21981,68 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
21799
21981
  }
21800
21982
  }
21801
21983
  };
21802
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Line, { data, options: options != null ? options : defaultOptions, plugins: [plugin$1] });
21984
+ const mergedOptions = chartSettings ? __spreadProps$d(__spreadValues$f({}, defaultOptions), {
21985
+ plugins: __spreadProps$d(__spreadValues$f({}, defaultOptions.plugins), {
21986
+ legend: __spreadProps$d(__spreadValues$f({}, (_c = defaultOptions.plugins) == null ? void 0 : _c.legend), {
21987
+ display: chartSettings.showLegend !== false,
21988
+ labels: __spreadProps$d(__spreadValues$f({}, (_e = (_d = defaultOptions.plugins) == null ? void 0 : _d.legend) == null ? void 0 : _e.labels), {
21989
+ boxWidth: (_f = chartSettings.legendBoxSize) != null ? _f : 16,
21990
+ boxHeight: (_g = chartSettings.legendBoxSize) != null ? _g : 16,
21991
+ font: { size: (_h = chartSettings.legendFontSize) != null ? _h : 13 }
21992
+ })
21993
+ }),
21994
+ datalabels: __spreadProps$d(__spreadValues$f({}, (_i = defaultOptions.plugins) == null ? void 0 : _i.datalabels), {
21995
+ display: (context) => {
21996
+ var _a2;
21997
+ return context.dataset.data[context.dataIndex] !== null && ((_a2 = chartSettings.showLabels) != null ? _a2 : false);
21998
+ },
21999
+ font: { size: (_j = chartSettings.dataLabelsFontSize) != null ? _j : 12 }
22000
+ }),
22001
+ tooltip: __spreadProps$d(__spreadValues$f({}, (_k = defaultOptions.plugins) == null ? void 0 : _k.tooltip), {
22002
+ bodyFont: { size: (_l = chartSettings.tooltipFontSize) != null ? _l : 12 },
22003
+ titleFont: { size: (_m = chartSettings.tooltipFontSize) != null ? _m : 12 }
22004
+ })
22005
+ }),
22006
+ scales: __spreadProps$d(__spreadValues$f({}, defaultOptions.scales), {
22007
+ x: __spreadProps$d(__spreadValues$f({}, (_n = defaultOptions.scales) == null ? void 0 : _n.x), {
22008
+ title: __spreadProps$d(__spreadValues$f({}, (_p = (_o = defaultOptions.scales) == null ? void 0 : _o.x) == null ? void 0 : _p.title), {
22009
+ font: { size: (_q = chartSettings.xAxisTitleFontSize) != null ? _q : 13, weight: "bold" }
22010
+ }),
22011
+ ticks: __spreadProps$d(__spreadValues$f({}, (_s = (_r = defaultOptions.scales) == null ? void 0 : _r.x) == null ? void 0 : _s.ticks), {
22012
+ font: { size: (_t = chartSettings.xAxisTickFontSize) != null ? _t : 12 }
22013
+ })
22014
+ }),
22015
+ y: __spreadProps$d(__spreadValues$f({}, (_u = defaultOptions.scales) == null ? void 0 : _u.y), {
22016
+ title: __spreadProps$d(__spreadValues$f({}, (_w = (_v = defaultOptions.scales) == null ? void 0 : _v.y) == null ? void 0 : _w.title), {
22017
+ font: { size: (_x = chartSettings.yAxisTitleFontSize) != null ? _x : 13, weight: "bold" }
22018
+ }),
22019
+ ticks: __spreadProps$d(__spreadValues$f({}, (_z = (_y = defaultOptions.scales) == null ? void 0 : _y.y) == null ? void 0 : _z.ticks), {
22020
+ font: { size: (_A = chartSettings.yAxisTickFontSize) != null ? _A : 12 }
22021
+ })
22022
+ })
22023
+ }),
22024
+ elements: {
22025
+ line: {
22026
+ tension: (_B = chartSettings.lineTension) != null ? _B : 0.3
22027
+ },
22028
+ point: {
22029
+ radius: (_C = chartSettings.pointRadius) != null ? _C : 4
22030
+ }
22031
+ }
22032
+ }) : defaultOptions;
22033
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col h-full", children: [
22034
+ ((chartSettings == null ? void 0 : chartSettings.titleText) || title) && (chartSettings == null ? void 0 : chartSettings.showTitle) !== false && /* @__PURE__ */ jsxRuntimeExports.jsx(
22035
+ "p",
22036
+ {
22037
+ style: {
22038
+ fontSize: `${(_D = chartSettings == null ? void 0 : chartSettings.titleFontSize) != null ? _D : 16}px`
22039
+ },
22040
+ className: "font-bold text-slate-900 text-center px-2 pt-4 pb-2 select-text cursor-text shrink-0",
22041
+ children: (chartSettings == null ? void 0 : chartSettings.titleText) || title
22042
+ }
22043
+ ),
22044
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Line, { data, options: options != null ? options : mergedOptions, plugins: [plugin$1] }) })
22045
+ ] });
21803
22046
  }
21804
22047
 
21805
22048
  /*!
@@ -22584,9 +22827,29 @@ var plugin = {
22584
22827
  },
22585
22828
  };
22586
22829
 
22830
+ var __defProp$e = Object.defineProperty;
22831
+ var __defProps$c = Object.defineProperties;
22832
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
22833
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
22834
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
22835
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
22836
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22837
+ var __spreadValues$e = (a, b) => {
22838
+ for (var prop in b || (b = {}))
22839
+ if (__hasOwnProp$e.call(b, prop))
22840
+ __defNormalProp$e(a, prop, b[prop]);
22841
+ if (__getOwnPropSymbols$e)
22842
+ for (var prop of __getOwnPropSymbols$e(b)) {
22843
+ if (__propIsEnum$e.call(b, prop))
22844
+ __defNormalProp$e(a, prop, b[prop]);
22845
+ }
22846
+ return a;
22847
+ };
22848
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
22587
22849
  Chart$1.register(ArcElement, plugin_tooltip, plugin_legend);
22588
22850
  const PieChart = (props) => {
22589
- const { data, title, options, units, content } = props;
22851
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
22852
+ const { data, title, options, units, content, chartSettings } = props;
22590
22853
  const formatValue = (value) => {
22591
22854
  const numValue = typeof value === "string" ? parseFloat(value) : value;
22592
22855
  if (units === "$" && !isNaN(numValue)) {
@@ -22611,16 +22874,16 @@ const PieChart = (props) => {
22611
22874
  },
22612
22875
  outlabels: {
22613
22876
  display: (context) => {
22614
- var _a;
22615
- return context.dataset.data[context.dataIndex] !== null && ((_a = content == null ? void 0 : content.showLabels) != null ? _a : false);
22877
+ var _a2;
22878
+ return context.dataset.data[context.dataIndex] !== null && ((_a2 = content == null ? void 0 : content.showLabels) != null ? _a2 : false);
22616
22879
  },
22617
22880
  text: (ctx) => {
22618
- var _a;
22881
+ var _a2;
22619
22882
  const dataset = ctx.dataset.data;
22620
22883
  const total = dataset.reduce((a, b) => a + b, 0);
22621
22884
  const value = dataset[ctx.dataIndex];
22622
22885
  const percent = value / total * 100;
22623
- return percent >= 5 ? `${(_a = ctx.chart.data.labels) == null ? void 0 : _a[ctx.dataIndex]} ${value}` : "";
22886
+ return percent >= 5 ? `${(_a2 = ctx.chart.data.labels) == null ? void 0 : _a2[ctx.dataIndex]} ${value}` : "";
22624
22887
  },
22625
22888
  color: "#0F172A",
22626
22889
  stretch: 25,
@@ -22642,19 +22905,6 @@ const PieChart = (props) => {
22642
22905
  datalabels: {
22643
22906
  display: false
22644
22907
  },
22645
- title: {
22646
- display: true,
22647
- text: title,
22648
- font: {
22649
- size: 16,
22650
- weight: "bold"
22651
- },
22652
- color: "#0F172A",
22653
- padding: {
22654
- bottom: 28,
22655
- top: 0
22656
- }
22657
- },
22658
22908
  tooltip: {
22659
22909
  backgroundColor: "rgba(0, 0, 0, 0.8)",
22660
22910
  titleFont: { size: 13, weight: "bold" },
@@ -22679,7 +22929,41 @@ const PieChart = (props) => {
22679
22929
  }
22680
22930
  }
22681
22931
  };
22682
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Pie, { data, options: options != null ? options : defaultOptions, plugins: [plugin] });
22932
+ const mergedOptions = chartSettings ? __spreadProps$c(__spreadValues$e({}, defaultOptions), {
22933
+ plugins: __spreadProps$c(__spreadValues$e({}, defaultOptions.plugins), {
22934
+ legend: __spreadProps$c(__spreadValues$e({}, (_a = defaultOptions.plugins) == null ? void 0 : _a.legend), {
22935
+ display: chartSettings.showLegend !== false,
22936
+ labels: __spreadProps$c(__spreadValues$e({}, (_c = (_b = defaultOptions.plugins) == null ? void 0 : _b.legend) == null ? void 0 : _c.labels), {
22937
+ boxWidth: (_d = chartSettings.legendBoxSize) != null ? _d : 16,
22938
+ boxHeight: (_e = chartSettings.legendBoxSize) != null ? _e : 16,
22939
+ font: { size: (_f = chartSettings.legendFontSize) != null ? _f : 13 }
22940
+ })
22941
+ }),
22942
+ outlabels: __spreadProps$c(__spreadValues$e({}, (_g = defaultOptions.plugins) == null ? void 0 : _g.outlabels), {
22943
+ font: __spreadProps$c(__spreadValues$e({}, (_i = (_h = defaultOptions.plugins) == null ? void 0 : _h.outlabels) == null ? void 0 : _i.font), {
22944
+ minSize: (_j = chartSettings.dataLabelsFontSize) != null ? _j : 11,
22945
+ maxSize: ((_k = chartSettings.dataLabelsFontSize) != null ? _k : 12) + 2
22946
+ })
22947
+ }),
22948
+ tooltip: __spreadProps$c(__spreadValues$e({}, (_l = defaultOptions.plugins) == null ? void 0 : _l.tooltip), {
22949
+ bodyFont: { size: (_m = chartSettings.tooltipFontSize) != null ? _m : 12 },
22950
+ titleFont: { size: (_n = chartSettings.tooltipFontSize) != null ? _n : 12 }
22951
+ })
22952
+ })
22953
+ }) : defaultOptions;
22954
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col h-full", children: [
22955
+ ((chartSettings == null ? void 0 : chartSettings.titleText) || title) && (chartSettings == null ? void 0 : chartSettings.showTitle) !== false && /* @__PURE__ */ jsxRuntimeExports.jsx(
22956
+ "p",
22957
+ {
22958
+ style: {
22959
+ fontSize: `${(_o = chartSettings == null ? void 0 : chartSettings.titleFontSize) != null ? _o : 16}px`
22960
+ },
22961
+ className: "font-bold text-slate-900 text-center px-2 pt-4 pb-2 select-text cursor-text shrink-0",
22962
+ children: (chartSettings == null ? void 0 : chartSettings.titleText) || title
22963
+ }
22964
+ ),
22965
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Pie, { data, options: options != null ? options : mergedOptions, plugins: [plugin] }) })
22966
+ ] });
22683
22967
  };
22684
22968
 
22685
22969
  Chart$1.register(CategoryScale, LinearScale, PointElement, LineElement, plugin_title, plugin_tooltip, plugin_legend);
@@ -43604,27 +43888,27 @@ function SummaryWidget({ title, data, metadata, className }) {
43604
43888
  ] });
43605
43889
  }
43606
43890
 
43607
- var __defProp$c = Object.defineProperty;
43608
- var __defProps$a = Object.defineProperties;
43609
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
43610
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
43611
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
43612
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
43613
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
43614
- var __spreadValues$c = (a, b) => {
43891
+ var __defProp$d = Object.defineProperty;
43892
+ var __defProps$b = Object.defineProperties;
43893
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
43894
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
43895
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
43896
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
43897
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
43898
+ var __spreadValues$d = (a, b) => {
43615
43899
  for (var prop in b || (b = {}))
43616
- if (__hasOwnProp$c.call(b, prop))
43617
- __defNormalProp$c(a, prop, b[prop]);
43618
- if (__getOwnPropSymbols$c)
43619
- for (var prop of __getOwnPropSymbols$c(b)) {
43620
- if (__propIsEnum$c.call(b, prop))
43621
- __defNormalProp$c(a, prop, b[prop]);
43900
+ if (__hasOwnProp$d.call(b, prop))
43901
+ __defNormalProp$d(a, prop, b[prop]);
43902
+ if (__getOwnPropSymbols$d)
43903
+ for (var prop of __getOwnPropSymbols$d(b)) {
43904
+ if (__propIsEnum$d.call(b, prop))
43905
+ __defNormalProp$d(a, prop, b[prop]);
43622
43906
  }
43623
43907
  return a;
43624
43908
  };
43625
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
43909
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
43626
43910
  const CHART_REFRESH_TIMEOUT$4 = 3e3;
43627
- const DEFAULT_COLORS$3 = ["#E4DCB8", "#DAC46C", "#808080", "#582809", "#A3ADD0", "#398E6F", "#AF123D", "#8C99C4", "#5290AC", "#601B07", "#50649D", "#B4A8A0", "#6F2587"];
43911
+ const DEFAULT_COLORS$4 = ["#E4DCB8", "#DAC46C", "#808080", "#582809", "#A3ADD0", "#398E6F", "#AF123D", "#8C99C4", "#5290AC", "#601B07", "#50649D", "#B4A8A0", "#6F2587"];
43628
43912
  const LINE_COLORS = ["#243D84", "#69238B", "#4A959F", "#D0A677", "#B31E47", "#396431"];
43629
43913
  const clearChat$5 = async (widgetBackendUrl, widgetId) => {
43630
43914
  if (!widgetBackendUrl || !widgetId) return;
@@ -43654,7 +43938,7 @@ const createInitialChartState$4 = (agentType, widgetIds, datasetId) => {
43654
43938
  const baseState = { dataset_id: datasetId || "home_generation_dataset" };
43655
43939
  switch (agentType) {
43656
43940
  case "Pie Chart Agent":
43657
- return __spreadValues$c({
43941
+ return __spreadValues$d({
43658
43942
  pie_chart_data: {
43659
43943
  title: "",
43660
43944
  type: "pie",
@@ -43665,7 +43949,7 @@ const createInitialChartState$4 = (agentType, widgetIds, datasetId) => {
43665
43949
  }, baseState);
43666
43950
  case "Line Chart Agent":
43667
43951
  case "Bar Chart Agent":
43668
- return __spreadValues$c({
43952
+ return __spreadValues$d({
43669
43953
  bar_chart_data: {
43670
43954
  title: "",
43671
43955
  type: agentType === "Line Chart Agent" ? "line" : "bar",
@@ -43677,7 +43961,7 @@ const createInitialChartState$4 = (agentType, widgetIds, datasetId) => {
43677
43961
  }, baseState);
43678
43962
  case "Series Bar Chart Agent":
43679
43963
  case "Series Line Chart Agent":
43680
- return __spreadValues$c({
43964
+ return __spreadValues$d({
43681
43965
  series_bar_chart_data: {
43682
43966
  title: "",
43683
43967
  type: "series_bar",
@@ -43703,7 +43987,7 @@ const createInitialChartState$4 = (agentType, widgetIds, datasetId) => {
43703
43987
  }
43704
43988
  }, baseState);
43705
43989
  case "Data Grid Agent":
43706
- return __spreadValues$c({
43990
+ return __spreadValues$d({
43707
43991
  matrix_grid_data: {
43708
43992
  title: "",
43709
43993
  type: "data_grid",
@@ -43714,7 +43998,7 @@ const createInitialChartState$4 = (agentType, widgetIds, datasetId) => {
43714
43998
  }
43715
43999
  }, baseState);
43716
44000
  case "Summary Agent":
43717
- return __spreadValues$c({
44001
+ return __spreadValues$d({
43718
44002
  summary_data: {
43719
44003
  title: "",
43720
44004
  type: "summary",
@@ -43723,7 +44007,7 @@ const createInitialChartState$4 = (agentType, widgetIds, datasetId) => {
43723
44007
  }
43724
44008
  }, baseState);
43725
44009
  default:
43726
- return __spreadValues$c({ widget_ids: widgetIds }, baseState);
44010
+ return __spreadValues$d({ widget_ids: widgetIds }, baseState);
43727
44011
  }
43728
44012
  };
43729
44013
  const loadAgentState$5 = async (widgetBackendUrl, threadId, agentName) => {
@@ -43763,7 +44047,7 @@ const parseAndUpdateChartState$4 = (apiResponse, setChartState) => {
43763
44047
  if (parsedState.state) {
43764
44048
  const chartData = parsedState.state;
43765
44049
  setChartState((prevState) => {
43766
- const newChartState = __spreadValues$c({}, prevState);
44050
+ const newChartState = __spreadValues$d({}, prevState);
43767
44051
  if (chartData.bar_chart_data) {
43768
44052
  newChartState.bar_chart_data = chartData.bar_chart_data;
43769
44053
  }
@@ -43862,7 +44146,7 @@ function BarChartComponent({
43862
44146
  }
43863
44147
  }, [isEmpty, startLoadingTimeout, clearLoadingTimeout]);
43864
44148
  const finalColors = React.useMemo(() => {
43865
- return shuffleColors(DEFAULT_COLORS$3, labels == null ? void 0 : labels.length);
44149
+ return shuffleColors(DEFAULT_COLORS$4, labels == null ? void 0 : labels.length);
43866
44150
  }, [labels.length]);
43867
44151
  if (isEmpty) {
43868
44152
  return createLoadingComponent$5();
@@ -43928,7 +44212,7 @@ function SeriesBarChartComponent$2({
43928
44212
  }
43929
44213
  }, [isEmpty, startLoadingTimeout, clearLoadingTimeout]);
43930
44214
  const finalColors = React.useMemo(() => {
43931
- return shuffleColors(DEFAULT_COLORS$3, series == null ? void 0 : series.length);
44215
+ return shuffleColors(DEFAULT_COLORS$4, series == null ? void 0 : series.length);
43932
44216
  }, [series.length]);
43933
44217
  if (isEmpty) {
43934
44218
  return createLoadingComponent$5();
@@ -43992,7 +44276,7 @@ function SeriesLineChartComponent({
43992
44276
  }
43993
44277
  }, [isEmpty, startLoadingTimeout, clearLoadingTimeout]);
43994
44278
  const finalColors = React.useMemo(() => {
43995
- return shuffleColors([...LINE_COLORS, ...DEFAULT_COLORS$3], series == null ? void 0 : series.length);
44279
+ return shuffleColors([...LINE_COLORS, ...DEFAULT_COLORS$4], series == null ? void 0 : series.length);
43996
44280
  }, [series.length]);
43997
44281
  if (isEmpty) {
43998
44282
  return createLoadingComponent$5();
@@ -44061,7 +44345,7 @@ function PieChartComponent$1({
44061
44345
  }
44062
44346
  }, [isEmpty, startLoadingTimeout, clearLoadingTimeout]);
44063
44347
  const backgroundColors = React.useMemo(() => {
44064
- return shuffleColors(DEFAULT_COLORS$3, labels.length);
44348
+ return shuffleColors(DEFAULT_COLORS$4, labels.length);
44065
44349
  }, [labels.length]);
44066
44350
  if (isEmpty) {
44067
44351
  return createLoadingComponent$5();
@@ -44240,7 +44524,7 @@ function SummaryComponent({
44240
44524
  React.useEffect(() => {
44241
44525
  if (isEmpty && query && isFirstLoad && !(summaryState == null ? void 0 : summaryState.agent_message) && !hasCalledRef.current) {
44242
44526
  hasCalledRef.current = true;
44243
- setChartState(__spreadProps$a(__spreadValues$c({}, summaryState), {
44527
+ setChartState(__spreadProps$b(__spreadValues$d({}, summaryState), {
44244
44528
  widget_ids
44245
44529
  }));
44246
44530
  setTimeout(() => {
@@ -44317,7 +44601,7 @@ function CopilotKitAgent({
44317
44601
  if (apiCallCount >= 10) {
44318
44602
  console.log("API call limit reached for widget:", widget.id);
44319
44603
  setHasTimeoutError(true);
44320
- setChartState((prevState) => __spreadProps$a(__spreadValues$c({}, prevState), {
44604
+ setChartState((prevState) => __spreadProps$b(__spreadValues$d({}, prevState), {
44321
44605
  agent_message: "Timeout: Unable to load data after multiple attempts. Please try refreshing the widget."
44322
44606
  }));
44323
44607
  return;
@@ -44726,25 +45010,25 @@ function exportChatToPDF(options) {
44726
45010
  doc.save(filename);
44727
45011
  }
44728
45012
 
44729
- var __defProp$b = Object.defineProperty;
44730
- var __defProps$9 = Object.defineProperties;
44731
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
44732
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
44733
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
44734
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
44735
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
44736
- var __spreadValues$b = (a, b) => {
45013
+ var __defProp$c = Object.defineProperty;
45014
+ var __defProps$a = Object.defineProperties;
45015
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
45016
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
45017
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
45018
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
45019
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
45020
+ var __spreadValues$c = (a, b) => {
44737
45021
  for (var prop in b || (b = {}))
44738
- if (__hasOwnProp$b.call(b, prop))
44739
- __defNormalProp$b(a, prop, b[prop]);
44740
- if (__getOwnPropSymbols$b)
44741
- for (var prop of __getOwnPropSymbols$b(b)) {
44742
- if (__propIsEnum$b.call(b, prop))
44743
- __defNormalProp$b(a, prop, b[prop]);
45022
+ if (__hasOwnProp$c.call(b, prop))
45023
+ __defNormalProp$c(a, prop, b[prop]);
45024
+ if (__getOwnPropSymbols$c)
45025
+ for (var prop of __getOwnPropSymbols$c(b)) {
45026
+ if (__propIsEnum$c.call(b, prop))
45027
+ __defNormalProp$c(a, prop, b[prop]);
44744
45028
  }
44745
45029
  return a;
44746
45030
  };
44747
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
45031
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
44748
45032
  const getStyleValues$4 = (styles = {}) => {
44749
45033
  const borderRadiusMap = {
44750
45034
  none: "0px",
@@ -44864,7 +45148,7 @@ function CopilotKitChatbot({
44864
45148
  const handleSubmit = (e) => {
44865
45149
  e.preventDefault();
44866
45150
  if (!inputValue.trim()) return;
44867
- setChatbotState((prevState) => __spreadProps$9(__spreadValues$b({}, prevState), {
45151
+ setChatbotState((prevState) => __spreadProps$a(__spreadValues$c({}, prevState), {
44868
45152
  widget_ids: widgetIds,
44869
45153
  dataset_id: datasetId
44870
45154
  }));
@@ -45038,42 +45322,42 @@ function ChatbotWidget({
45038
45322
  );
45039
45323
  }
45040
45324
 
45041
- var __defProp$a = Object.defineProperty;
45042
- var __defProps$8 = Object.defineProperties;
45043
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
45044
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
45045
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
45046
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
45047
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
45048
- var __spreadValues$a = (a, b) => {
45325
+ var __defProp$b = Object.defineProperty;
45326
+ var __defProps$9 = Object.defineProperties;
45327
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
45328
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
45329
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
45330
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
45331
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
45332
+ var __spreadValues$b = (a, b) => {
45049
45333
  for (var prop in b || (b = {}))
45050
- if (__hasOwnProp$a.call(b, prop))
45051
- __defNormalProp$a(a, prop, b[prop]);
45052
- if (__getOwnPropSymbols$a)
45053
- for (var prop of __getOwnPropSymbols$a(b)) {
45054
- if (__propIsEnum$a.call(b, prop))
45055
- __defNormalProp$a(a, prop, b[prop]);
45334
+ if (__hasOwnProp$b.call(b, prop))
45335
+ __defNormalProp$b(a, prop, b[prop]);
45336
+ if (__getOwnPropSymbols$b)
45337
+ for (var prop of __getOwnPropSymbols$b(b)) {
45338
+ if (__propIsEnum$b.call(b, prop))
45339
+ __defNormalProp$b(a, prop, b[prop]);
45056
45340
  }
45057
45341
  return a;
45058
45342
  };
45059
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
45060
- var __objRest$2 = (source, exclude) => {
45343
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
45344
+ var __objRest$3 = (source, exclude) => {
45061
45345
  var target = {};
45062
45346
  for (var prop in source)
45063
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
45347
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
45064
45348
  target[prop] = source[prop];
45065
- if (source != null && __getOwnPropSymbols$a)
45066
- for (var prop of __getOwnPropSymbols$a(source)) {
45067
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
45349
+ if (source != null && __getOwnPropSymbols$b)
45350
+ for (var prop of __getOwnPropSymbols$b(source)) {
45351
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
45068
45352
  target[prop] = source[prop];
45069
45353
  }
45070
45354
  return target;
45071
45355
  };
45072
45356
  const Checkbox = React__namespace.forwardRef((_a, ref) => {
45073
- var _b = _a, { className } = _b, props = __objRest$2(_b, ["className"]);
45357
+ var _b = _a, { className } = _b, props = __objRest$3(_b, ["className"]);
45074
45358
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
45075
45359
  CheckboxPrimitive__namespace.Root,
45076
- __spreadProps$8(__spreadValues$a({
45360
+ __spreadProps$9(__spreadValues$b({
45077
45361
  ref,
45078
45362
  className: cn(
45079
45363
  "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
@@ -45092,25 +45376,25 @@ const Checkbox = React__namespace.forwardRef((_a, ref) => {
45092
45376
  });
45093
45377
  Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
45094
45378
 
45095
- var __defProp$9 = Object.defineProperty;
45096
- var __defProps$7 = Object.defineProperties;
45097
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
45098
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
45099
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
45100
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
45101
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
45102
- var __spreadValues$9 = (a, b) => {
45379
+ var __defProp$a = Object.defineProperty;
45380
+ var __defProps$8 = Object.defineProperties;
45381
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
45382
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
45383
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
45384
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
45385
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
45386
+ var __spreadValues$a = (a, b) => {
45103
45387
  for (var prop in b || (b = {}))
45104
- if (__hasOwnProp$9.call(b, prop))
45105
- __defNormalProp$9(a, prop, b[prop]);
45106
- if (__getOwnPropSymbols$9)
45107
- for (var prop of __getOwnPropSymbols$9(b)) {
45108
- if (__propIsEnum$9.call(b, prop))
45109
- __defNormalProp$9(a, prop, b[prop]);
45388
+ if (__hasOwnProp$a.call(b, prop))
45389
+ __defNormalProp$a(a, prop, b[prop]);
45390
+ if (__getOwnPropSymbols$a)
45391
+ for (var prop of __getOwnPropSymbols$a(b)) {
45392
+ if (__propIsEnum$a.call(b, prop))
45393
+ __defNormalProp$a(a, prop, b[prop]);
45110
45394
  }
45111
45395
  return a;
45112
45396
  };
45113
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
45397
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
45114
45398
  const FILTER_REFRESH_TIMEOUT = 3e3;
45115
45399
  const clearChat$4 = async (widgetBackendUrl, widgetId) => {
45116
45400
  if (!widgetBackendUrl || !widgetId) return;
@@ -45179,7 +45463,7 @@ const parseAndUpdateFilterState = (apiResponse, setFilterState) => {
45179
45463
  if (parsedState.state) {
45180
45464
  const filterData = parsedState.state;
45181
45465
  setFilterState((prevState) => {
45182
- const newFilterState = __spreadValues$9({}, prevState);
45466
+ const newFilterState = __spreadValues$a({}, prevState);
45183
45467
  if (filterData.column_values) {
45184
45468
  newFilterState.column_values = filterData.column_values;
45185
45469
  }
@@ -45268,7 +45552,7 @@ function TableSelectionConfirmation({
45268
45552
  {
45269
45553
  value: selectedTables[col.column] || "",
45270
45554
  onChange: (e) => {
45271
- setSelectedTables((prev) => __spreadProps$7(__spreadValues$9({}, prev), {
45555
+ setSelectedTables((prev) => __spreadProps$8(__spreadValues$a({}, prev), {
45272
45556
  [col.column]: e.target.value
45273
45557
  }));
45274
45558
  },
@@ -45384,7 +45668,7 @@ function FiltersContent({
45384
45668
  }
45385
45669
  }, [(_a = widget.config) == null ? void 0 : _a.filters, filterGroups]);
45386
45670
  const toggleGroup = (groupId) => {
45387
- setExpandedGroups((prev) => __spreadProps$7(__spreadValues$9({}, prev), {
45671
+ setExpandedGroups((prev) => __spreadProps$8(__spreadValues$a({}, prev), {
45388
45672
  [groupId]: !prev[groupId]
45389
45673
  }));
45390
45674
  };
@@ -45397,7 +45681,7 @@ function FiltersContent({
45397
45681
  } else {
45398
45682
  newGroupFilters = groupFilters.filter((id) => id !== optionId);
45399
45683
  }
45400
- const newFilters = __spreadProps$7(__spreadValues$9({}, prev), {
45684
+ const newFilters = __spreadProps$8(__spreadValues$a({}, prev), {
45401
45685
  [groupId]: newGroupFilters
45402
45686
  });
45403
45687
  if (onFilterChange) {
@@ -45407,7 +45691,7 @@ function FiltersContent({
45407
45691
  });
45408
45692
  };
45409
45693
  const handleSearchChange = (groupId, query2) => {
45410
- setSearchQueries((prev) => __spreadProps$7(__spreadValues$9({}, prev), {
45694
+ setSearchQueries((prev) => __spreadProps$8(__spreadValues$a({}, prev), {
45411
45695
  [groupId]: query2
45412
45696
  }));
45413
45697
  };
@@ -45425,7 +45709,7 @@ function FiltersContent({
45425
45709
  };
45426
45710
  const clearGroupFilters = (groupId) => {
45427
45711
  setSelectedFilters((prev) => {
45428
- const newFilters = __spreadProps$7(__spreadValues$9({}, prev), { [groupId]: [] });
45712
+ const newFilters = __spreadProps$8(__spreadValues$a({}, prev), { [groupId]: [] });
45429
45713
  if (onFilterChange) {
45430
45714
  onFilterChange(newFilters);
45431
45715
  }
@@ -45587,7 +45871,7 @@ function FiltersContent({
45587
45871
  "Content-Type": "application/json"
45588
45872
  },
45589
45873
  body: JSON.stringify({
45590
- config: __spreadProps$7(__spreadValues$9({}, widget.config), {
45874
+ config: __spreadProps$8(__spreadValues$a({}, widget.config), {
45591
45875
  filters: filtersWithLabels
45592
45876
  })
45593
45877
  })
@@ -45667,7 +45951,7 @@ function CopilotKitFilters({
45667
45951
  if (apiCallCount >= 30) {
45668
45952
  console.log("API call limit reached for widget:", widget.id);
45669
45953
  setHasTimeoutError(true);
45670
- setFilterState((prevState) => __spreadProps$7(__spreadValues$9({}, prevState), {
45954
+ setFilterState((prevState) => __spreadProps$8(__spreadValues$a({}, prevState), {
45671
45955
  agent_message: "Timeout: Unable to load filter data after multiple attempts. Please try refreshing the widget."
45672
45956
  }));
45673
45957
  return;
@@ -45808,7 +46092,7 @@ function CopilotKitFilters({
45808
46092
  startLoadingTimeout();
45809
46093
  }, [filterState.filter_columns, filterState.ambiguous_columns, (_f = widget.config) == null ? void 0 : _f.query, datasetId, appendMessage, setFilterState, setAgentState, startLoadingTimeout, setApiCallCount, setHasTimeoutError]);
45810
46094
  const handleCancelConfirmation = React.useCallback(() => {
45811
- setFilterState((prev) => __spreadProps$7(__spreadValues$9({}, prev), {
46095
+ setFilterState((prev) => __spreadProps$8(__spreadValues$a({}, prev), {
45812
46096
  status: void 0,
45813
46097
  ambiguous_columns: void 0,
45814
46098
  message: void 0
@@ -45902,27 +46186,27 @@ function FiltersWidget({
45902
46186
  );
45903
46187
  }
45904
46188
 
45905
- var __defProp$8 = Object.defineProperty;
45906
- var __defProps$6 = Object.defineProperties;
45907
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
45908
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
45909
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
45910
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
45911
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
45912
- var __spreadValues$8 = (a, b) => {
46189
+ var __defProp$9 = Object.defineProperty;
46190
+ var __defProps$7 = Object.defineProperties;
46191
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
46192
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
46193
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
46194
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
46195
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
46196
+ var __spreadValues$9 = (a, b) => {
45913
46197
  for (var prop in b || (b = {}))
45914
- if (__hasOwnProp$8.call(b, prop))
45915
- __defNormalProp$8(a, prop, b[prop]);
45916
- if (__getOwnPropSymbols$8)
45917
- for (var prop of __getOwnPropSymbols$8(b)) {
45918
- if (__propIsEnum$8.call(b, prop))
45919
- __defNormalProp$8(a, prop, b[prop]);
46198
+ if (__hasOwnProp$9.call(b, prop))
46199
+ __defNormalProp$9(a, prop, b[prop]);
46200
+ if (__getOwnPropSymbols$9)
46201
+ for (var prop of __getOwnPropSymbols$9(b)) {
46202
+ if (__propIsEnum$9.call(b, prop))
46203
+ __defNormalProp$9(a, prop, b[prop]);
45920
46204
  }
45921
46205
  return a;
45922
46206
  };
45923
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
46207
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
45924
46208
  const CHART_REFRESH_TIMEOUT$3 = 3e3;
45925
- const DEFAULT_COLORS$2 = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
46209
+ const DEFAULT_COLORS$3 = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
45926
46210
  const clearChat$3 = async (widgetBackendUrl, widgetId) => {
45927
46211
  if (!widgetBackendUrl || !widgetId) return;
45928
46212
  console.log("clearChat called for widgetId:", widgetId);
@@ -45996,7 +46280,7 @@ const parseAndUpdateChartState$3 = (apiResponse, setChartState) => {
45996
46280
  if (parsedState.state) {
45997
46281
  const chartData = parsedState.state;
45998
46282
  setChartState((prevState) => {
45999
- const newChartState = __spreadValues$8({}, prevState);
46283
+ const newChartState = __spreadValues$9({}, prevState);
46000
46284
  if (chartData.pie_chart_data) {
46001
46285
  newChartState.pie_chart_data = chartData.pie_chart_data;
46002
46286
  }
@@ -46045,9 +46329,11 @@ function PieChartComponent({
46045
46329
  startLoadingTimeout,
46046
46330
  clearLoadingTimeout,
46047
46331
  content,
46048
- hasWidgetData
46332
+ hasWidgetData,
46333
+ chartSettings,
46334
+ onConfigUpdate
46049
46335
  }) {
46050
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
46336
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
46051
46337
  const hasCalledRef = React.useRef(false);
46052
46338
  const labels = ((_b = (_a = pieChartState == null ? void 0 : pieChartState.pie_chart_data) == null ? void 0 : _a.data) == null ? void 0 : _b.labels) || [];
46053
46339
  const values = ((_d = (_c = pieChartState == null ? void 0 : pieChartState.pie_chart_data) == null ? void 0 : _c.data) == null ? void 0 : _d.values) || [];
@@ -46055,6 +46341,10 @@ function PieChartComponent({
46055
46341
  const chartTitle = ((_g = pieChartState == null ? void 0 : pieChartState.pie_chart_data) == null ? void 0 : _g.title) || "";
46056
46342
  const units = ((_h = pieChartState == null ? void 0 : pieChartState.pie_chart_data) == null ? void 0 : _h.units) || "";
46057
46343
  const isEmpty = labels.length === 0 || values.length === 0;
46344
+ React.useEffect(() => {
46345
+ console.log("[PieChartComponent] chartSettings:", chartSettings);
46346
+ console.log("[PieChartComponent] seriesColors:", chartSettings == null ? void 0 : chartSettings.seriesColors);
46347
+ }, [chartSettings]);
46058
46348
  const handleRefresh = async () => {
46059
46349
  if (query) {
46060
46350
  await clearChat$3(widgetBackendUrl, widgetId);
@@ -46084,24 +46374,49 @@ function PieChartComponent({
46084
46374
  }
46085
46375
  }, [isEmpty, startLoadingTimeout, clearLoadingTimeout, pieChartState]);
46086
46376
  const backgroundColors = React.useMemo(() => {
46087
- return shuffleColors(DEFAULT_COLORS$2, labels.length);
46377
+ return shuffleColors(DEFAULT_COLORS$3, labels.length);
46088
46378
  }, [labels.length]);
46379
+ const sortedIndices = React.useMemo(() => {
46380
+ return labels.map((label, index) => ({ label, index, value: values[index] })).sort((a, b) => a.label.localeCompare(b.label)).map((item) => item.index);
46381
+ }, [labels, values]);
46382
+ const sortedLabels = React.useMemo(() => {
46383
+ return sortedIndices.map((i) => labels[i]);
46384
+ }, [sortedIndices, labels]);
46385
+ const sortedValues = React.useMemo(() => {
46386
+ return sortedIndices.map((i) => values[i]);
46387
+ }, [sortedIndices, values]);
46388
+ const colors = React.useMemo(() => {
46389
+ var _a2, _b2;
46390
+ if ((chartSettings == null ? void 0 : chartSettings.seriesColors) && chartSettings.seriesColors.length > 0) {
46391
+ return chartSettings.seriesColors.slice(0, sortedLabels.length);
46392
+ }
46393
+ return ((_b2 = (_a2 = pieChartState == null ? void 0 : pieChartState.pie_chart_data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.colors) || sortedLabels.map((_, index) => backgroundColors[index % backgroundColors.length]);
46394
+ }, [chartSettings == null ? void 0 : chartSettings.seriesColors, sortedLabels, (_j = (_i = pieChartState == null ? void 0 : pieChartState.pie_chart_data) == null ? void 0 : _i.data) == null ? void 0 : _j.colors]);
46395
+ React.useEffect(() => {
46396
+ var _a2;
46397
+ if (!isEmpty && colors.length > 0 && !((_a2 = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _a2.length) && onConfigUpdate && widgetId) {
46398
+ onConfigUpdate(widgetId, {
46399
+ chartSettings: __spreadProps$7(__spreadValues$9({}, chartSettings), {
46400
+ seriesColors: colors
46401
+ })
46402
+ });
46403
+ }
46404
+ }, [sortedLabels.length, (_k = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _k.length, onConfigUpdate, widgetId, isEmpty]);
46089
46405
  if (isEmpty) {
46090
46406
  return createLoadingComponent$3();
46091
46407
  }
46092
- const colors = ((_j = (_i = pieChartState == null ? void 0 : pieChartState.pie_chart_data) == null ? void 0 : _i.data) == null ? void 0 : _j.colors) || labels.map((_, index) => backgroundColors[index % backgroundColors.length]);
46093
46408
  const transformedData = {
46094
- labels,
46409
+ labels: sortedLabels,
46095
46410
  datasets: [
46096
46411
  {
46097
46412
  label: chartTitle || "Data",
46098
- data: values,
46413
+ data: sortedValues,
46099
46414
  backgroundColor: colors,
46100
46415
  borderWidth: 0
46101
46416
  }
46102
46417
  ]
46103
46418
  };
46104
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PieChart, { title: chartTitle, data: transformedData, units, content });
46419
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PieChart, { title: chartTitle, data: transformedData, units, content, chartSettings });
46105
46420
  }
46106
46421
  function CopilotKitPieChart({
46107
46422
  widget,
@@ -46110,9 +46425,10 @@ function CopilotKitPieChart({
46110
46425
  onResetReady,
46111
46426
  widgetBackendUrl,
46112
46427
  datasetId,
46113
- widgetData
46428
+ widgetData,
46429
+ onConfigUpdate
46114
46430
  }) {
46115
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
46431
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
46116
46432
  const isFirstLoad = (_a = widget.config) == null ? void 0 : _a.isFirstLoad;
46117
46433
  const content = (_b = widget.config) == null ? void 0 : _b.content;
46118
46434
  const widget_data = (_c = widget.widget_data) == null ? void 0 : _c.pie_chart_data;
@@ -46152,7 +46468,7 @@ function CopilotKitPieChart({
46152
46468
  if (apiCallCount >= 30) {
46153
46469
  console.log("API call limit reached for widget:", widget.id);
46154
46470
  setHasTimeoutError(true);
46155
- setChartState((prevState) => __spreadProps$6(__spreadValues$8({}, prevState), {
46471
+ setChartState((prevState) => __spreadProps$7(__spreadValues$9({}, prevState), {
46156
46472
  agent_message: "Timeout: Unable to load data after multiple attempts. Please try refreshing the widget."
46157
46473
  }));
46158
46474
  return;
@@ -46252,7 +46568,9 @@ function CopilotKitPieChart({
46252
46568
  widgetId: widget.id,
46253
46569
  startLoadingTimeout,
46254
46570
  clearLoadingTimeout,
46255
- hasWidgetData: !!(((_o = (_n = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _n.labels) == null ? void 0 : _o.length) && ((_q = (_p = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _p.values) == null ? void 0 : _q.length))
46571
+ hasWidgetData: !!(((_o = (_n = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _n.labels) == null ? void 0 : _o.length) && ((_q = (_p = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _p.values) == null ? void 0 : _q.length)),
46572
+ chartSettings: (_r = widget.config) == null ? void 0 : _r.chartSettings,
46573
+ onConfigUpdate
46256
46574
  }
46257
46575
  ) })
46258
46576
  ] });
@@ -46264,7 +46582,8 @@ function PieChartWidget({
46264
46582
  onResetReady,
46265
46583
  widgetIds,
46266
46584
  datasetId,
46267
- widgetData
46585
+ widgetData,
46586
+ onConfigUpdate
46268
46587
  }) {
46269
46588
  var _a, _b;
46270
46589
  const styles = getStyleValues$3((_a = widget.config) == null ? void 0 : _a.styles);
@@ -46288,34 +46607,35 @@ function PieChartWidget({
46288
46607
  styles,
46289
46608
  onResetReady,
46290
46609
  widgetBackendUrl,
46291
- datasetId
46610
+ datasetId,
46611
+ onConfigUpdate
46292
46612
  }
46293
46613
  )
46294
46614
  }
46295
46615
  );
46296
46616
  }
46297
46617
 
46298
- var __defProp$7 = Object.defineProperty;
46299
- var __defProps$5 = Object.defineProperties;
46300
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
46301
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
46302
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
46303
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
46304
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
46305
- var __spreadValues$7 = (a, b) => {
46618
+ var __defProp$8 = Object.defineProperty;
46619
+ var __defProps$6 = Object.defineProperties;
46620
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
46621
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
46622
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
46623
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
46624
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
46625
+ var __spreadValues$8 = (a, b) => {
46306
46626
  for (var prop in b || (b = {}))
46307
- if (__hasOwnProp$7.call(b, prop))
46308
- __defNormalProp$7(a, prop, b[prop]);
46309
- if (__getOwnPropSymbols$7)
46310
- for (var prop of __getOwnPropSymbols$7(b)) {
46311
- if (__propIsEnum$7.call(b, prop))
46312
- __defNormalProp$7(a, prop, b[prop]);
46627
+ if (__hasOwnProp$8.call(b, prop))
46628
+ __defNormalProp$8(a, prop, b[prop]);
46629
+ if (__getOwnPropSymbols$8)
46630
+ for (var prop of __getOwnPropSymbols$8(b)) {
46631
+ if (__propIsEnum$8.call(b, prop))
46632
+ __defNormalProp$8(a, prop, b[prop]);
46313
46633
  }
46314
46634
  return a;
46315
46635
  };
46316
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
46636
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
46317
46637
  const CHART_REFRESH_TIMEOUT$2 = 3e3;
46318
- const DEFAULT_COLORS$1 = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
46638
+ const DEFAULT_COLORS$2 = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
46319
46639
  const clearChat$2 = async (widgetBackendUrl, widgetId) => {
46320
46640
  if (!widgetBackendUrl || !widgetId) return;
46321
46641
  console.log("clearChat called for widgetId:", widgetId);
@@ -46410,7 +46730,7 @@ const parseAndUpdateChartState$2 = (apiResponse, setChartState) => {
46410
46730
  if (parsedState.state) {
46411
46731
  const chartData = parsedState.state;
46412
46732
  setChartState((prevState) => {
46413
- const newChartState = __spreadValues$7({}, prevState);
46733
+ const newChartState = __spreadValues$8({}, prevState);
46414
46734
  if (chartData.series_bar_chart_data) {
46415
46735
  newChartState.series_bar_chart_data = chartData.series_bar_chart_data;
46416
46736
  }
@@ -46460,9 +46780,11 @@ function SeriesBarChartComponent$1({
46460
46780
  startLoadingTimeout,
46461
46781
  clearLoadingTimeout,
46462
46782
  content,
46463
- hasWidgetData
46783
+ hasWidgetData,
46784
+ chartSettings,
46785
+ onConfigUpdate
46464
46786
  }) {
46465
- var _a, _b, _c, _d, _e, _f, _g, _h;
46787
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
46466
46788
  const hasCalledRef = React.useRef(false);
46467
46789
  const labels = ((_b = (_a = seriesBarChartState == null ? void 0 : seriesBarChartState.series_bar_chart_data) == null ? void 0 : _a.data) == null ? void 0 : _b.labels) || [];
46468
46790
  const series = ((_d = (_c = seriesBarChartState == null ? void 0 : seriesBarChartState.series_bar_chart_data) == null ? void 0 : _c.data) == null ? void 0 : _d.series) || [];
@@ -46500,18 +46822,40 @@ function SeriesBarChartComponent$1({
46500
46822
  }
46501
46823
  }, [isEmpty, startLoadingTimeout, clearLoadingTimeout, seriesBarChartState]);
46502
46824
  const finalColors = React.useMemo(() => {
46503
- return shuffleColors(DEFAULT_COLORS$1, series.length);
46825
+ return shuffleColors(DEFAULT_COLORS$2, series.length);
46504
46826
  }, [series.length]);
46827
+ const sortedSeries = React.useMemo(() => {
46828
+ return [...series].sort(
46829
+ (a, b) => (a.name || "").localeCompare(b.name || "")
46830
+ );
46831
+ }, [series]);
46832
+ const colors = React.useMemo(() => {
46833
+ return sortedSeries.map((_, index) => finalColors[index % finalColors.length]);
46834
+ }, [sortedSeries, finalColors]);
46835
+ React.useEffect(() => {
46836
+ var _a2;
46837
+ if (!isEmpty && colors.length > 0 && !((_a2 = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _a2.length) && onConfigUpdate && widgetId) {
46838
+ onConfigUpdate(widgetId, {
46839
+ chartSettings: __spreadProps$6(__spreadValues$8({}, chartSettings), {
46840
+ seriesColors: colors
46841
+ })
46842
+ });
46843
+ }
46844
+ }, [series.length, (_i = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _i.length, onConfigUpdate, widgetId, isEmpty]);
46505
46845
  if (isEmpty) {
46506
46846
  return createLoadingComponent$2();
46507
46847
  }
46508
46848
  const transformedData = {
46509
46849
  labels,
46510
- datasets: series.map((seriesItem, index) => ({
46511
- label: seriesItem.name,
46512
- data: seriesItem.values,
46513
- backgroundColor: (seriesItem == null ? void 0 : seriesItem.colors) || (seriesItem == null ? void 0 : seriesItem.color) || finalColors[index % finalColors.length]
46514
- }))
46850
+ datasets: sortedSeries.map((seriesItem, index) => {
46851
+ var _a2;
46852
+ const color = ((_a2 = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _a2[index]) || (seriesItem == null ? void 0 : seriesItem.colors) || (seriesItem == null ? void 0 : seriesItem.color) || finalColors[index % finalColors.length];
46853
+ return {
46854
+ label: seriesItem.name,
46855
+ data: seriesItem.values,
46856
+ backgroundColor: color
46857
+ };
46858
+ })
46515
46859
  };
46516
46860
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
46517
46861
  SeriesChart,
@@ -46522,7 +46866,8 @@ function SeriesBarChartComponent$1({
46522
46866
  units,
46523
46867
  content,
46524
46868
  x_axis_title,
46525
- y_axis_title
46869
+ y_axis_title,
46870
+ chartSettings
46526
46871
  }
46527
46872
  );
46528
46873
  }
@@ -46533,9 +46878,10 @@ function CopilotKitSeriesBarChart$1({
46533
46878
  onResetReady,
46534
46879
  widgetBackendUrl,
46535
46880
  datasetId,
46536
- widgetData
46881
+ widgetData,
46882
+ onConfigUpdate
46537
46883
  }) {
46538
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
46884
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
46539
46885
  const orientation = ((_a = widget.config) == null ? void 0 : _a.orientation) || "vertical";
46540
46886
  const isFirstLoad = (_b = widget.config) == null ? void 0 : _b.isFirstLoad;
46541
46887
  const content = (_c = widget.config) == null ? void 0 : _c.content;
@@ -46576,7 +46922,7 @@ function CopilotKitSeriesBarChart$1({
46576
46922
  if (apiCallCount >= 30) {
46577
46923
  console.log("API call limit reached for widget:", widget.id);
46578
46924
  setHasTimeoutError(true);
46579
- setChartState((prevState) => __spreadProps$5(__spreadValues$7({}, prevState), {
46925
+ setChartState((prevState) => __spreadProps$6(__spreadValues$8({}, prevState), {
46580
46926
  agent_message: "Timeout: Unable to load data after multiple attempts. Please try refreshing the widget."
46581
46927
  }));
46582
46928
  return;
@@ -46677,7 +47023,9 @@ function CopilotKitSeriesBarChart$1({
46677
47023
  widgetId: widget.id,
46678
47024
  startLoadingTimeout,
46679
47025
  clearLoadingTimeout,
46680
- hasWidgetData: !!(((_p = (_o = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _o.labels) == null ? void 0 : _p.length) && ((_r = (_q = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _q.series) == null ? void 0 : _r.length))
47026
+ hasWidgetData: !!(((_p = (_o = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _o.labels) == null ? void 0 : _p.length) && ((_r = (_q = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _q.series) == null ? void 0 : _r.length)),
47027
+ chartSettings: (_s = widget.config) == null ? void 0 : _s.chartSettings,
47028
+ onConfigUpdate
46681
47029
  }
46682
47030
  ) })
46683
47031
  ] });
@@ -46689,7 +47037,8 @@ function SeriesBarChartWidget({
46689
47037
  onResetReady,
46690
47038
  widgetIds,
46691
47039
  datasetId,
46692
- widgetData
47040
+ widgetData,
47041
+ onConfigUpdate
46693
47042
  }) {
46694
47043
  var _a, _b;
46695
47044
  const styles = getStyleValues$2((_a = widget.config) == null ? void 0 : _a.styles);
@@ -46713,34 +47062,35 @@ function SeriesBarChartWidget({
46713
47062
  styles,
46714
47063
  onResetReady,
46715
47064
  widgetBackendUrl,
46716
- datasetId
47065
+ datasetId,
47066
+ onConfigUpdate
46717
47067
  }
46718
47068
  )
46719
47069
  }
46720
47070
  );
46721
47071
  }
46722
47072
 
46723
- var __defProp$6 = Object.defineProperty;
46724
- var __defProps$4 = Object.defineProperties;
46725
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
46726
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
46727
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
46728
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
46729
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
46730
- var __spreadValues$6 = (a, b) => {
47073
+ var __defProp$7 = Object.defineProperty;
47074
+ var __defProps$5 = Object.defineProperties;
47075
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
47076
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
47077
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
47078
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
47079
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
47080
+ var __spreadValues$7 = (a, b) => {
46731
47081
  for (var prop in b || (b = {}))
46732
- if (__hasOwnProp$6.call(b, prop))
46733
- __defNormalProp$6(a, prop, b[prop]);
46734
- if (__getOwnPropSymbols$6)
46735
- for (var prop of __getOwnPropSymbols$6(b)) {
46736
- if (__propIsEnum$6.call(b, prop))
46737
- __defNormalProp$6(a, prop, b[prop]);
47082
+ if (__hasOwnProp$7.call(b, prop))
47083
+ __defNormalProp$7(a, prop, b[prop]);
47084
+ if (__getOwnPropSymbols$7)
47085
+ for (var prop of __getOwnPropSymbols$7(b)) {
47086
+ if (__propIsEnum$7.call(b, prop))
47087
+ __defNormalProp$7(a, prop, b[prop]);
46738
47088
  }
46739
47089
  return a;
46740
47090
  };
46741
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
47091
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
46742
47092
  const CHART_REFRESH_TIMEOUT$1 = 3e3;
46743
- const DEFAULT_COLORS = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
47093
+ const DEFAULT_COLORS$1 = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
46744
47094
  const clearChat$1 = async (widgetBackendUrl, widgetId) => {
46745
47095
  if (!widgetBackendUrl || !widgetId) return;
46746
47096
  console.log("clearChat called for widgetId:", widgetId);
@@ -46835,7 +47185,7 @@ const parseAndUpdateChartState$1 = (apiResponse, setChartState) => {
46835
47185
  if (parsedState.state) {
46836
47186
  const chartData = parsedState.state;
46837
47187
  setChartState((prevState) => {
46838
- const newChartState = __spreadValues$6({}, prevState);
47188
+ const newChartState = __spreadValues$7({}, prevState);
46839
47189
  if (chartData.series_bar_chart_data) {
46840
47190
  newChartState.series_bar_chart_data = chartData.series_bar_chart_data;
46841
47191
  }
@@ -46885,9 +47235,11 @@ function SeriesBarChartComponent({
46885
47235
  startLoadingTimeout,
46886
47236
  clearLoadingTimeout,
46887
47237
  content,
46888
- hasWidgetData
47238
+ hasWidgetData,
47239
+ chartSettings,
47240
+ onConfigUpdate
46889
47241
  }) {
46890
- var _a, _b, _c, _d, _e, _f, _g, _h;
47242
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
46891
47243
  const hasCalledRef = React.useRef(false);
46892
47244
  const labels = ((_b = (_a = seriesBarChartState == null ? void 0 : seriesBarChartState.series_bar_chart_data) == null ? void 0 : _a.data) == null ? void 0 : _b.labels) || [];
46893
47245
  const series = ((_d = (_c = seriesBarChartState == null ? void 0 : seriesBarChartState.series_bar_chart_data) == null ? void 0 : _c.data) == null ? void 0 : _d.series) || [];
@@ -46925,24 +47277,43 @@ function SeriesBarChartComponent({
46925
47277
  }
46926
47278
  }, [isEmpty, startLoadingTimeout, clearLoadingTimeout, seriesBarChartState]);
46927
47279
  const finalColors = React.useMemo(() => {
46928
- return shuffleColors(DEFAULT_COLORS, series.length);
47280
+ return shuffleColors(DEFAULT_COLORS$1, series.length);
46929
47281
  }, [series.length]);
47282
+ const sortedSeries = React.useMemo(() => {
47283
+ return [...series].sort(
47284
+ (a, b) => (a.name || "").localeCompare(b.name || "")
47285
+ );
47286
+ }, [series]);
47287
+ const colors = React.useMemo(() => {
47288
+ return sortedSeries.map((_, index) => finalColors[index % finalColors.length]);
47289
+ }, [sortedSeries, finalColors]);
47290
+ React.useEffect(() => {
47291
+ var _a2;
47292
+ if (!isEmpty && colors.length > 0 && !((_a2 = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _a2.length) && onConfigUpdate && widgetId) {
47293
+ onConfigUpdate(widgetId, {
47294
+ chartSettings: __spreadProps$5(__spreadValues$7({}, chartSettings), {
47295
+ seriesColors: colors
47296
+ })
47297
+ });
47298
+ }
47299
+ }, [series.length, (_i = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _i.length, onConfigUpdate, widgetId, isEmpty]);
46930
47300
  if (isEmpty) {
46931
47301
  return createLoadingComponent$1();
46932
47302
  }
46933
47303
  const transformedData = {
46934
47304
  labels,
46935
- datasets: series.map((seriesItem, index) => {
46936
- const color = (seriesItem == null ? void 0 : seriesItem.colors) || (seriesItem == null ? void 0 : seriesItem.color) || finalColors[index % finalColors.length];
47305
+ datasets: sortedSeries.map((seriesItem, index) => {
47306
+ var _a2, _b2, _c2;
47307
+ const color = ((_a2 = chartSettings == null ? void 0 : chartSettings.seriesColors) == null ? void 0 : _a2[index]) || (seriesItem == null ? void 0 : seriesItem.colors) || (seriesItem == null ? void 0 : seriesItem.color) || finalColors[index % finalColors.length];
46937
47308
  return {
46938
47309
  label: seriesItem.name,
46939
47310
  data: seriesItem.values,
46940
47311
  borderColor: color,
46941
47312
  backgroundColor: color + "26",
46942
47313
  // 15% opacity for subtle fill under curve
46943
- borderWidth: 2.5,
47314
+ borderWidth: (_b2 = chartSettings == null ? void 0 : chartSettings.lineWidth) != null ? _b2 : 2.5,
46944
47315
  fill: false,
46945
- pointRadius: 4,
47316
+ pointRadius: (_c2 = chartSettings == null ? void 0 : chartSettings.pointRadius) != null ? _c2 : 4,
46946
47317
  pointHoverRadius: 6,
46947
47318
  pointBackgroundColor: color,
46948
47319
  pointBorderColor: "#ffffff",
@@ -46959,7 +47330,8 @@ function SeriesBarChartComponent({
46959
47330
  units,
46960
47331
  content,
46961
47332
  x_axis_title,
46962
- y_axis_title
47333
+ y_axis_title,
47334
+ chartSettings
46963
47335
  }
46964
47336
  );
46965
47337
  }
@@ -46970,9 +47342,10 @@ function CopilotKitSeriesBarChart({
46970
47342
  onResetReady,
46971
47343
  widgetBackendUrl,
46972
47344
  datasetId,
46973
- widgetData
47345
+ widgetData,
47346
+ onConfigUpdate
46974
47347
  }) {
46975
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
47348
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
46976
47349
  const orientation = ((_a = widget.config) == null ? void 0 : _a.orientation) || "vertical";
46977
47350
  const isFirstLoad = (_b = widget.config) == null ? void 0 : _b.isFirstLoad;
46978
47351
  const content = (_c = widget.config) == null ? void 0 : _c.content;
@@ -47013,7 +47386,7 @@ function CopilotKitSeriesBarChart({
47013
47386
  if (apiCallCount >= 30) {
47014
47387
  console.log("API call limit reached for widget:", widget.id);
47015
47388
  setHasTimeoutError(true);
47016
- setChartState((prevState) => __spreadProps$4(__spreadValues$6({}, prevState), {
47389
+ setChartState((prevState) => __spreadProps$5(__spreadValues$7({}, prevState), {
47017
47390
  agent_message: "Timeout: Unable to load data after multiple attempts. Please try refreshing the widget."
47018
47391
  }));
47019
47392
  return;
@@ -47114,7 +47487,9 @@ function CopilotKitSeriesBarChart({
47114
47487
  widgetId: widget.id,
47115
47488
  startLoadingTimeout,
47116
47489
  clearLoadingTimeout,
47117
- hasWidgetData: !!(((_p = (_o = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _o.labels) == null ? void 0 : _p.length) && ((_r = (_q = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _q.series) == null ? void 0 : _r.length))
47490
+ hasWidgetData: !!(((_p = (_o = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _o.labels) == null ? void 0 : _p.length) && ((_r = (_q = widget_data == null ? void 0 : widget_data.data) == null ? void 0 : _q.series) == null ? void 0 : _r.length)),
47491
+ chartSettings: (_s = widget.config) == null ? void 0 : _s.chartSettings,
47492
+ onConfigUpdate
47118
47493
  }
47119
47494
  ) })
47120
47495
  ] });
@@ -47126,7 +47501,8 @@ function SeriesLineChartWidget({
47126
47501
  onResetReady,
47127
47502
  widgetIds,
47128
47503
  datasetId,
47129
- widgetData
47504
+ widgetData,
47505
+ onConfigUpdate
47130
47506
  }) {
47131
47507
  var _a, _b;
47132
47508
  const styles = getStyleValues$1((_a = widget.config) == null ? void 0 : _a.styles);
@@ -47150,32 +47526,33 @@ function SeriesLineChartWidget({
47150
47526
  styles,
47151
47527
  onResetReady,
47152
47528
  widgetBackendUrl,
47153
- datasetId
47529
+ datasetId,
47530
+ onConfigUpdate
47154
47531
  }
47155
47532
  )
47156
47533
  }
47157
47534
  );
47158
47535
  }
47159
47536
 
47160
- var __defProp$5 = Object.defineProperty;
47161
- var __defProps$3 = Object.defineProperties;
47162
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
47163
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
47164
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
47165
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
47166
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
47167
- var __spreadValues$5 = (a, b) => {
47537
+ var __defProp$6 = Object.defineProperty;
47538
+ var __defProps$4 = Object.defineProperties;
47539
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
47540
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
47541
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
47542
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
47543
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
47544
+ var __spreadValues$6 = (a, b) => {
47168
47545
  for (var prop in b || (b = {}))
47169
- if (__hasOwnProp$5.call(b, prop))
47170
- __defNormalProp$5(a, prop, b[prop]);
47171
- if (__getOwnPropSymbols$5)
47172
- for (var prop of __getOwnPropSymbols$5(b)) {
47173
- if (__propIsEnum$5.call(b, prop))
47174
- __defNormalProp$5(a, prop, b[prop]);
47546
+ if (__hasOwnProp$6.call(b, prop))
47547
+ __defNormalProp$6(a, prop, b[prop]);
47548
+ if (__getOwnPropSymbols$6)
47549
+ for (var prop of __getOwnPropSymbols$6(b)) {
47550
+ if (__propIsEnum$6.call(b, prop))
47551
+ __defNormalProp$6(a, prop, b[prop]);
47175
47552
  }
47176
47553
  return a;
47177
47554
  };
47178
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
47555
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
47179
47556
  const CHART_REFRESH_TIMEOUT = 3e3;
47180
47557
  const clearChat = async (widgetBackendUrl, widgetId) => {
47181
47558
  if (!widgetBackendUrl || !widgetId) return;
@@ -47262,7 +47639,7 @@ const parseAndUpdateChartState = (apiResponse, setChartState) => {
47262
47639
  if (parsedState.state) {
47263
47640
  const chartData = parsedState.state;
47264
47641
  setChartState((prevState) => {
47265
- const newChartState = __spreadValues$5({}, prevState);
47642
+ const newChartState = __spreadValues$6({}, prevState);
47266
47643
  if (chartData.matrix_grid_data) {
47267
47644
  newChartState.matrix_grid_data = chartData.matrix_grid_data;
47268
47645
  }
@@ -47409,7 +47786,7 @@ function CopilotKitDataGrid({
47409
47786
  if (apiCallCount >= 30) {
47410
47787
  console.log("API call limit reached for widget:", widget.id);
47411
47788
  setHasTimeoutError(true);
47412
- setChartState((prevState) => __spreadProps$3(__spreadValues$5({}, prevState), {
47789
+ setChartState((prevState) => __spreadProps$4(__spreadValues$6({}, prevState), {
47413
47790
  agent_message: "Timeout: Unable to load data after multiple attempts. Please try refreshing the widget."
47414
47791
  }));
47415
47792
  return;
@@ -47621,7 +47998,8 @@ function WidgetRenderer({
47621
47998
  widgetBackendUrl,
47622
47999
  onResetReady,
47623
48000
  widgetIds,
47624
- datasetId
48001
+ datasetId,
48002
+ onConfigUpdate
47625
48003
  }
47626
48004
  ) : widget.config.agentType === "Series Bar Chart Agent" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
47627
48005
  SeriesBarChartWidget,
@@ -47631,7 +48009,8 @@ function WidgetRenderer({
47631
48009
  widgetBackendUrl,
47632
48010
  onResetReady,
47633
48011
  widgetIds,
47634
- datasetId
48012
+ datasetId,
48013
+ onConfigUpdate
47635
48014
  }
47636
48015
  ) : widget.config.agentType === "Series Line Chart Agent" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
47637
48016
  SeriesLineChartWidget,
@@ -47641,7 +48020,8 @@ function WidgetRenderer({
47641
48020
  widgetBackendUrl,
47642
48021
  onResetReady,
47643
48022
  widgetIds,
47644
- datasetId
48023
+ datasetId,
48024
+ onConfigUpdate
47645
48025
  }
47646
48026
  ) : widget.config.agentType === "Data Grid Agent" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
47647
48027
  DatagridWidget,
@@ -47674,39 +48054,39 @@ function WidgetRenderer({
47674
48054
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${(widget == null ? void 0 : widget.type) === "text" ? "" : "h-full"}`, children: renderWidget() });
47675
48055
  }
47676
48056
 
47677
- var __defProp$4 = Object.defineProperty;
47678
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
47679
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
47680
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
47681
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
47682
- var __spreadValues$4 = (a, b) => {
48057
+ var __defProp$5 = Object.defineProperty;
48058
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
48059
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
48060
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
48061
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
48062
+ var __spreadValues$5 = (a, b) => {
47683
48063
  for (var prop in b || (b = {}))
47684
- if (__hasOwnProp$4.call(b, prop))
47685
- __defNormalProp$4(a, prop, b[prop]);
47686
- if (__getOwnPropSymbols$4)
47687
- for (var prop of __getOwnPropSymbols$4(b)) {
47688
- if (__propIsEnum$4.call(b, prop))
47689
- __defNormalProp$4(a, prop, b[prop]);
48064
+ if (__hasOwnProp$5.call(b, prop))
48065
+ __defNormalProp$5(a, prop, b[prop]);
48066
+ if (__getOwnPropSymbols$5)
48067
+ for (var prop of __getOwnPropSymbols$5(b)) {
48068
+ if (__propIsEnum$5.call(b, prop))
48069
+ __defNormalProp$5(a, prop, b[prop]);
47690
48070
  }
47691
48071
  return a;
47692
48072
  };
47693
- var __objRest$1 = (source, exclude) => {
48073
+ var __objRest$2 = (source, exclude) => {
47694
48074
  var target = {};
47695
48075
  for (var prop in source)
47696
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
48076
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
47697
48077
  target[prop] = source[prop];
47698
- if (source != null && __getOwnPropSymbols$4)
47699
- for (var prop of __getOwnPropSymbols$4(source)) {
47700
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
48078
+ if (source != null && __getOwnPropSymbols$5)
48079
+ for (var prop of __getOwnPropSymbols$5(source)) {
48080
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
47701
48081
  target[prop] = source[prop];
47702
48082
  }
47703
48083
  return target;
47704
48084
  };
47705
48085
  const Textarea = React__namespace.forwardRef((_a, ref) => {
47706
- var _b = _a, { className } = _b, props = __objRest$1(_b, ["className"]);
48086
+ var _b = _a, { className } = _b, props = __objRest$2(_b, ["className"]);
47707
48087
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
47708
48088
  "textarea",
47709
- __spreadValues$4({
48089
+ __spreadValues$5({
47710
48090
  className: cn(
47711
48091
  "flex min-h-[120px] w-full rounded-md border border-gray-300 bg-transparent px-3 py-2 text-base ring-offset-gray-300 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
47712
48092
  className
@@ -47827,6 +48207,57 @@ function Modal({
47827
48207
  );
47828
48208
  }
47829
48209
 
48210
+ var __defProp$4 = Object.defineProperty;
48211
+ var __defProps$3 = Object.defineProperties;
48212
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
48213
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
48214
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
48215
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
48216
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
48217
+ var __spreadValues$4 = (a, b) => {
48218
+ for (var prop in b || (b = {}))
48219
+ if (__hasOwnProp$4.call(b, prop))
48220
+ __defNormalProp$4(a, prop, b[prop]);
48221
+ if (__getOwnPropSymbols$4)
48222
+ for (var prop of __getOwnPropSymbols$4(b)) {
48223
+ if (__propIsEnum$4.call(b, prop))
48224
+ __defNormalProp$4(a, prop, b[prop]);
48225
+ }
48226
+ return a;
48227
+ };
48228
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
48229
+ var __objRest$1 = (source, exclude) => {
48230
+ var target = {};
48231
+ for (var prop in source)
48232
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
48233
+ target[prop] = source[prop];
48234
+ if (source != null && __getOwnPropSymbols$4)
48235
+ for (var prop of __getOwnPropSymbols$4(source)) {
48236
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
48237
+ target[prop] = source[prop];
48238
+ }
48239
+ return target;
48240
+ };
48241
+ const Slider = React__namespace.forwardRef((_a, ref) => {
48242
+ var _b = _a, { className } = _b, props = __objRest$1(_b, ["className"]);
48243
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
48244
+ SliderPrimitive__namespace.Root,
48245
+ __spreadProps$3(__spreadValues$4({
48246
+ ref,
48247
+ className: cn(
48248
+ "relative flex w-full touch-none select-none items-center",
48249
+ className
48250
+ )
48251
+ }, props), {
48252
+ children: [
48253
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SliderPrimitive__namespace.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-[#f1f5f9]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SliderPrimitive__namespace.Range, { className: "absolute h-full bg-primary" }) }),
48254
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SliderPrimitive__namespace.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })
48255
+ ]
48256
+ })
48257
+ );
48258
+ });
48259
+ Slider.displayName = SliderPrimitive__namespace.Root.displayName;
48260
+
47830
48261
  var __defProp$3 = Object.defineProperty;
47831
48262
  var __defProps$2 = Object.defineProperties;
47832
48263
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
@@ -47846,9 +48277,63 @@ var __spreadValues$3 = (a, b) => {
47846
48277
  return a;
47847
48278
  };
47848
48279
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
48280
+ const isChartWidget = (agentType) => {
48281
+ if (!agentType) return false;
48282
+ return agentType === "Pie Chart Agent" || agentType === "Line Chart Agent" || agentType === "Series Line Chart Agent" || agentType === "Bar Chart Agent" || agentType === "Series Bar Chart Agent";
48283
+ };
48284
+ const isLineChart = (agentType) => {
48285
+ if (!agentType) return false;
48286
+ return agentType === "Line Chart Agent" || agentType === "Series Line Chart Agent";
48287
+ };
48288
+ const DEFAULT_COLORS = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
48289
+ const getSeriesNames = (widget) => {
48290
+ var _a, _b, _c, _d;
48291
+ const data = widget == null ? void 0 : widget.widget_data;
48292
+ if (!data) return [];
48293
+ if (((_b = (_a = data == null ? void 0 : data.pie_chart_data) == null ? void 0 : _a.data) == null ? void 0 : _b.labels) && Array.isArray(data.pie_chart_data.data.labels)) {
48294
+ return data.pie_chart_data.data.labels.sort();
48295
+ }
48296
+ if (((_d = (_c = data == null ? void 0 : data.series_bar_chart_data) == null ? void 0 : _c.data) == null ? void 0 : _d.series) && Array.isArray(data.series_bar_chart_data.data.series)) {
48297
+ return data.series_bar_chart_data.data.series.map((item) => item.name || item.label || "").filter((name) => name !== "").sort();
48298
+ }
48299
+ if (Array.isArray(data)) {
48300
+ const names = /* @__PURE__ */ new Set();
48301
+ data.forEach((item) => {
48302
+ if (item.series_name) names.add(item.series_name);
48303
+ if (item.label) names.add(item.label);
48304
+ });
48305
+ return Array.from(names).sort();
48306
+ }
48307
+ return [];
48308
+ };
48309
+ const getDefaultSeriesColors = (widget) => {
48310
+ var _a, _b, _c, _d;
48311
+ const data = widget == null ? void 0 : widget.widget_data;
48312
+ if (!data) return [];
48313
+ if (((_b = (_a = data == null ? void 0 : data.pie_chart_data) == null ? void 0 : _a.data) == null ? void 0 : _b.labels) && Array.isArray(data.pie_chart_data.data.labels)) {
48314
+ const labels = data.pie_chart_data.data.labels;
48315
+ return shuffleColors(DEFAULT_COLORS, labels.length);
48316
+ }
48317
+ if (((_d = (_c = data == null ? void 0 : data.series_bar_chart_data) == null ? void 0 : _c.data) == null ? void 0 : _d.series) && Array.isArray(data.series_bar_chart_data.data.series)) {
48318
+ const series = data.series_bar_chart_data.data.series;
48319
+ return shuffleColors(DEFAULT_COLORS, series.length);
48320
+ }
48321
+ if (Array.isArray(data)) {
48322
+ const series = /* @__PURE__ */ new Set();
48323
+ data.forEach((item) => {
48324
+ if (item.series_name) series.add(item.series_name);
48325
+ if (item.label) series.add(item.label);
48326
+ });
48327
+ const seriesArray = Array.from(series).sort();
48328
+ return shuffleColors(DEFAULT_COLORS, seriesArray.length);
48329
+ }
48330
+ return [];
48331
+ };
47849
48332
  function EditWidgetDialog({ editingWidget, setWidgets, initialText, isOpen, onClose, onSubmit }) {
47850
- var _a;
48333
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
47851
48334
  const agentType = (_a = editingWidget == null ? void 0 : editingWidget.config) == null ? void 0 : _a.agentType;
48335
+ const isChart = isChartWidget(agentType);
48336
+ const isLine = isLineChart(agentType);
47852
48337
  const [query, setQuery] = React.useState("");
47853
48338
  const [displayText, setDisplayText] = React.useState("");
47854
48339
  const [blockType, setBlockType] = React.useState("");
@@ -47856,13 +48341,42 @@ function EditWidgetDialog({ editingWidget, setWidgets, initialText, isOpen, onCl
47856
48341
  const [divider, setDivider] = React.useState("no");
47857
48342
  const [showLabels, setShowLabels] = React.useState(false);
47858
48343
  const [styles, setStyles] = React.useState("");
48344
+ const [chartSettings, setChartSettings] = React.useState({
48345
+ showLegend: true,
48346
+ legendBoxSize: 16,
48347
+ legendFontSize: 13,
48348
+ lineWidth: 2.5,
48349
+ lineTension: 0.3,
48350
+ pointRadius: 4,
48351
+ showLabels: false,
48352
+ seriesColors: [],
48353
+ dataLabelsFontSize: 12,
48354
+ showTitle: true,
48355
+ titleText: "",
48356
+ titleFontSize: 16,
48357
+ xAxisTitleFontSize: 13,
48358
+ yAxisTitleFontSize: 13,
48359
+ xAxisTickFontSize: 12,
48360
+ yAxisTickFontSize: 12,
48361
+ tooltipFontSize: 12
48362
+ });
48363
+ const seriesNames = getSeriesNames(editingWidget);
48364
+ const defaultSeriesColors = getDefaultSeriesColors(editingWidget);
48365
+ const colorCount = seriesNames.length || ((_b = chartSettings.seriesColors) == null ? void 0 : _b.length) || defaultSeriesColors.length || 0;
48366
+ const displaySeriesNames = seriesNames.length > 0 ? seriesNames : Array.from({ length: colorCount }, (_, i) => `Series ${i + 1}`);
48367
+ React.useEffect(() => {
48368
+ console.log("[EditWidgetDialog] Series names:", seriesNames);
48369
+ console.log("[EditWidgetDialog] Default colors:", defaultSeriesColors);
48370
+ console.log("[EditWidgetDialog] Display series names:", displaySeriesNames);
48371
+ }, [seriesNames, defaultSeriesColors, displaySeriesNames]);
47859
48372
  React.useEffect(() => {
47860
48373
  setQuery(initialText);
47861
48374
  }, [initialText]);
47862
48375
  React.useEffect(() => {
47863
- var _a2, _b;
48376
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q, _r, _s, _t;
47864
48377
  const content = (_a2 = editingWidget == null ? void 0 : editingWidget.config) == null ? void 0 : _a2.content;
47865
- const cssStyles = (_b = editingWidget == null ? void 0 : editingWidget.config) == null ? void 0 : _b.styles;
48378
+ const cssStyles = (_b2 = editingWidget == null ? void 0 : editingWidget.config) == null ? void 0 : _b2.styles;
48379
+ const savedChartSettings = (_c2 = editingWidget == null ? void 0 : editingWidget.config) == null ? void 0 : _c2.chartSettings;
47866
48380
  const text = content == null ? void 0 : content.displayText;
47867
48381
  if (text == null ? void 0 : text.length) {
47868
48382
  setDisplayText(text);
@@ -47883,63 +48397,114 @@ function EditWidgetDialog({ editingWidget, setWidgets, initialText, isOpen, onCl
47883
48397
  if (hasShowLabel !== void 0) {
47884
48398
  setShowLabels(hasShowLabel);
47885
48399
  }
48400
+ if (savedChartSettings) {
48401
+ setChartSettings({
48402
+ showLegend: (_d2 = savedChartSettings.showLegend) != null ? _d2 : true,
48403
+ legendBoxSize: (_e2 = savedChartSettings.legendBoxSize) != null ? _e2 : 16,
48404
+ legendFontSize: (_f2 = savedChartSettings.legendFontSize) != null ? _f2 : 13,
48405
+ lineWidth: (_g2 = savedChartSettings.lineWidth) != null ? _g2 : 2.5,
48406
+ lineTension: (_h2 = savedChartSettings.lineTension) != null ? _h2 : 0.3,
48407
+ pointRadius: (_i2 = savedChartSettings.pointRadius) != null ? _i2 : 4,
48408
+ showLabels: (_j2 = savedChartSettings.showLabels) != null ? _j2 : false,
48409
+ seriesColors: (_k2 = savedChartSettings.seriesColors) != null ? _k2 : defaultSeriesColors,
48410
+ dataLabelsFontSize: (_l2 = savedChartSettings.dataLabelsFontSize) != null ? _l2 : 12,
48411
+ showTitle: (_m2 = savedChartSettings.showTitle) != null ? _m2 : true,
48412
+ titleText: (_n2 = savedChartSettings.titleText) != null ? _n2 : "",
48413
+ titleFontSize: (_o2 = savedChartSettings.titleFontSize) != null ? _o2 : 16,
48414
+ xAxisTitleFontSize: (_p2 = savedChartSettings.xAxisTitleFontSize) != null ? _p2 : 13,
48415
+ yAxisTitleFontSize: (_q = savedChartSettings.yAxisTitleFontSize) != null ? _q : 13,
48416
+ xAxisTickFontSize: (_r = savedChartSettings.xAxisTickFontSize) != null ? _r : 12,
48417
+ yAxisTickFontSize: (_s = savedChartSettings.yAxisTickFontSize) != null ? _s : 12,
48418
+ tooltipFontSize: (_t = savedChartSettings.tooltipFontSize) != null ? _t : 12
48419
+ });
48420
+ } else {
48421
+ setChartSettings({
48422
+ showLegend: true,
48423
+ legendBoxSize: 16,
48424
+ legendFontSize: 13,
48425
+ lineWidth: 2.5,
48426
+ lineTension: 0.3,
48427
+ pointRadius: 4,
48428
+ showLabels: hasShowLabel != null ? hasShowLabel : false,
48429
+ seriesColors: defaultSeriesColors,
48430
+ dataLabelsFontSize: 12,
48431
+ showTitle: true,
48432
+ titleText: "",
48433
+ titleFontSize: 16,
48434
+ xAxisTitleFontSize: 13,
48435
+ yAxisTitleFontSize: 13,
48436
+ xAxisTickFontSize: 12,
48437
+ yAxisTickFontSize: 12,
48438
+ tooltipFontSize: 12
48439
+ });
48440
+ }
47886
48441
  }, [editingWidget]);
47887
48442
  const handleSubmit = () => {
48443
+ var _a2;
47888
48444
  if (onSubmit && query.trim()) {
47889
- onSubmit(query, showLabels);
48445
+ if (isChart) {
48446
+ onSubmit(query, (_a2 = chartSettings.showLabels) != null ? _a2 : false, chartSettings);
48447
+ } else {
48448
+ onSubmit(query, showLabels);
48449
+ }
47890
48450
  }
47891
48451
  if (editingWidget.type === "text") {
47892
48452
  const widgetId = editingWidget == null ? void 0 : editingWidget.id;
47893
- setWidgets && setWidgets((prev) => prev.map((w) => {
47894
- if (w.id === widgetId) {
47895
- return __spreadProps$2(__spreadValues$3({}, w), {
47896
- config: __spreadProps$2(__spreadValues$3({}, w.config), {
47897
- content: __spreadProps$2(__spreadValues$3({}, w.config.content), {
47898
- displayText,
47899
- blockType,
47900
- divider
47901
- }),
47902
- styles: __spreadValues$3(__spreadValues$3({}, w.config.styles), alignment && alignment.length > 0 ? { textAlign: alignment } : {})
47903
- })
47904
- });
47905
- }
47906
- return w;
47907
- }));
48453
+ setWidgets && setWidgets(
48454
+ (prev) => prev.map((w) => {
48455
+ if (w.id === widgetId) {
48456
+ return __spreadProps$2(__spreadValues$3({}, w), {
48457
+ config: __spreadProps$2(__spreadValues$3({}, w.config), {
48458
+ content: __spreadProps$2(__spreadValues$3({}, w.config.content), {
48459
+ displayText,
48460
+ blockType,
48461
+ divider
48462
+ }),
48463
+ styles: __spreadValues$3(__spreadValues$3({}, w.config.styles), alignment && alignment.length > 0 ? { textAlign: alignment } : {})
48464
+ })
48465
+ });
48466
+ }
48467
+ return w;
48468
+ })
48469
+ );
47908
48470
  onClose && onClose();
47909
48471
  }
47910
48472
  };
47911
48473
  if (!isOpen) return null;
47912
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
48474
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
47913
48475
  Modal,
47914
48476
  {
47915
48477
  isOpen,
47916
48478
  onClose,
47917
48479
  title: "Edit Widget",
47918
- size: "lg",
48480
+ size: "xl",
47919
48481
  noOverflowHidden: true,
47920
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
47921
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700", children: "Customize the widget\u2019s appearance" }),
47922
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pt-7", children: [
47923
- (agentType === "Pie Chart Agent" || agentType === "Line Chart Agent" || agentType === "Series Line Chart Agent" || agentType === "Bar Chart Agent" || agentType === "Series Bar Chart Agent") && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 mb-4", children: [
47924
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold", children: "Data Labels:" }),
47925
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
47926
- Select,
47927
- {
47928
- value: showLabels ? "yes" : "no",
47929
- onValueChange: (value) => setShowLabels(value === "yes"),
47930
- children: [
47931
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Visible data labels?" }) }),
47932
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
47933
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "no", children: "No" }),
47934
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "yes", children: "Yes" })
47935
- ] })
47936
- ]
47937
- }
47938
- )
47939
- ] }),
47940
- (editingWidget == null ? void 0 : editingWidget.type) === "text" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-5", children: [
47941
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
47942
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold", children: "Display text:" }),
48482
+ children: [
48483
+ /* @__PURE__ */ jsxRuntimeExports.jsx("style", { children: `
48484
+ .dialog-scrollable::-webkit-scrollbar {
48485
+ width: 6px;
48486
+ }
48487
+ .dialog-scrollable::-webkit-scrollbar-track {
48488
+ background: #f1f5f9;
48489
+ border-radius: 3px;
48490
+ }
48491
+ .dialog-scrollable::-webkit-scrollbar-thumb {
48492
+ background: #cbd5e1;
48493
+ border-radius: 3px;
48494
+ }
48495
+ .dialog-scrollable::-webkit-scrollbar-thumb:hover {
48496
+ background: #94a3b8;
48497
+ }
48498
+ .dialog-scrollable {
48499
+ scrollbar-width: thin;
48500
+ scrollbar-color: #cbd5e1 #f1f5f9;
48501
+ }
48502
+ ` }),
48503
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col h-[calc(100vh-260px)] bg-white rounded-lg", children: [
48504
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 py-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-700 font-medium", children: "Customize your widget settings" }) }),
48505
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto dialog-scrollable px-6 py-4 flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: (editingWidget == null ? void 0 : editingWidget.type) === "text" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-5", children: [
48506
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
48507
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "font-semibold text-sm", children: "Display text" }),
47943
48508
  /* @__PURE__ */ jsxRuntimeExports.jsx(
47944
48509
  Input,
47945
48510
  {
@@ -47949,88 +48514,463 @@ function EditWidgetDialog({ editingWidget, setWidgets, initialText, isOpen, onCl
47949
48514
  }
47950
48515
  )
47951
48516
  ] }),
47952
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
47953
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold", children: "Block type:" }),
47954
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
47955
- Select,
47956
- {
47957
- value: blockType,
47958
- onValueChange: (value) => setBlockType(value),
47959
- children: [
47960
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select block type" }) }),
47961
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
47962
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "heading-1", children: "Heading 1" }),
47963
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "heading-2", children: "Heading 2" }),
47964
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "heading-3", children: "Heading 3" }),
47965
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "paragraph", children: "Paragraph" })
47966
- ] })
47967
- ]
47968
- }
47969
- )
48517
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
48518
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "font-semibold text-sm", children: "Block type" }),
48519
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: blockType, onValueChange: (value) => setBlockType(value), children: [
48520
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select block type" }) }),
48521
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
48522
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "heading-1", children: "Heading 1" }),
48523
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "heading-2", children: "Heading 2" }),
48524
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "heading-3", children: "Heading 3" }),
48525
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "paragraph", children: "Paragraph" })
48526
+ ] })
48527
+ ] })
47970
48528
  ] }),
47971
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
47972
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold", children: "Align:" }),
47973
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
47974
- Select,
47975
- {
47976
- value: alignment,
47977
- onValueChange: (value) => setAlignment(value),
47978
- children: [
47979
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select block type" }) }),
47980
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
47981
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "left", children: "Left" }),
47982
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "center", children: "Center" }),
47983
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "right", children: "Right" }),
47984
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "justify", children: "Justify" })
47985
- ] })
47986
- ]
47987
- }
47988
- )
48529
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
48530
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "font-semibold text-sm", children: "Alignment" }),
48531
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: alignment, onValueChange: (value) => setAlignment(value), children: [
48532
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select alignment" }) }),
48533
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
48534
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "left", children: "Left" }),
48535
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "center", children: "Center" }),
48536
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "right", children: "Right" }),
48537
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "justify", children: "Justify" })
48538
+ ] })
48539
+ ] })
47989
48540
  ] }),
47990
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
47991
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold", children: "Divider:" }),
47992
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
47993
- Select,
48541
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
48542
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "font-semibold text-sm", children: "Divider" }),
48543
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: divider, onValueChange: (value) => setDivider(value), children: [
48544
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "No" }) }),
48545
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
48546
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "yes", children: "Yes" }),
48547
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "no", children: "No" })
48548
+ ] })
48549
+ ] })
48550
+ ] })
48551
+ ] }) : isChart ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
48552
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 pb-4 border-b", children: [
48553
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Query" }),
48554
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48555
+ Textarea,
47994
48556
  {
47995
- value: divider,
47996
- onValueChange: (value) => setDivider(value),
47997
- children: [
47998
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "No" }) }),
47999
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
48000
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "yes", children: "Yes" }),
48001
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "no", children: "No" })
48002
- ] })
48003
- ]
48557
+ className: "w-full p-2 min-h-[120px]",
48558
+ value: query,
48559
+ onChange: (e) => {
48560
+ var _a2;
48561
+ return setQuery((_a2 = e == null ? void 0 : e.target) == null ? void 0 : _a2.value);
48562
+ }
48004
48563
  }
48005
- )
48006
- ] }),
48007
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48008
- "button",
48009
- {
48010
- onClick: handleSubmit,
48011
- className: "font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none bg-primary-600 text-white hover:bg-primary-700 focus:ring-primary-500 px-6 py-2 text-sm flex items-center gap-2",
48012
- children: "Submit"
48013
- }
48014
- ) })
48015
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48016
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
48017
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold", children: "Query:" }),
48018
- /* @__PURE__ */ jsxRuntimeExports.jsx(Textarea, { className: "w-full p-2", value: query, onChange: (e) => {
48019
- var _a2;
48020
- return setQuery((_a2 = e == null ? void 0 : e.target) == null ? void 0 : _a2.value);
48021
- } })
48564
+ ) })
48022
48565
  ] }),
48023
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end pt-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48024
- "button",
48566
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
48567
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 pb-4 border-b", children: [
48568
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Legend" }),
48569
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
48570
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48571
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Show Legend" }) }),
48572
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
48573
+ Select,
48574
+ {
48575
+ value: chartSettings.showLegend !== false ? "yes" : "no",
48576
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48577
+ showLegend: value === "yes"
48578
+ })),
48579
+ children: [
48580
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Show legend?" }) }),
48581
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
48582
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "no", children: "No" }),
48583
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "yes", children: "Yes" })
48584
+ ] })
48585
+ ]
48586
+ }
48587
+ )
48588
+ ] }),
48589
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48590
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48591
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Box Size" }),
48592
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48593
+ chartSettings.legendBoxSize,
48594
+ "px"
48595
+ ] })
48596
+ ] }),
48597
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48598
+ Slider,
48599
+ {
48600
+ min: 8,
48601
+ max: 32,
48602
+ step: 1,
48603
+ value: [(_c = chartSettings.legendBoxSize) != null ? _c : 16],
48604
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48605
+ legendBoxSize: value[0]
48606
+ })),
48607
+ className: "w-full"
48608
+ }
48609
+ )
48610
+ ] }),
48611
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48612
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48613
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Font Size" }),
48614
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48615
+ chartSettings.legendFontSize,
48616
+ "px"
48617
+ ] })
48618
+ ] }),
48619
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48620
+ Slider,
48621
+ {
48622
+ min: 10,
48623
+ max: 18,
48624
+ step: 1,
48625
+ value: [(_d = chartSettings.legendFontSize) != null ? _d : 13],
48626
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48627
+ legendFontSize: value[0]
48628
+ })),
48629
+ className: "w-full"
48630
+ }
48631
+ )
48632
+ ] })
48633
+ ] })
48634
+ ] }),
48635
+ displaySeriesNames.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 pb-4 border-b", children: [
48636
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Series Colors" }),
48637
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: displaySeriesNames.map((seriesName, index) => {
48638
+ var _a2;
48639
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
48640
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium flex-1 truncate", children: seriesName }),
48641
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48642
+ "input",
48643
+ {
48644
+ type: "color",
48645
+ value: ((_a2 = chartSettings.seriesColors) == null ? void 0 : _a2[index]) || defaultSeriesColors[index] || "#3B82F6",
48646
+ onChange: (e) => {
48647
+ const newColors = [...chartSettings.seriesColors || []];
48648
+ newColors[index] = e.target.value;
48649
+ setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48650
+ seriesColors: newColors
48651
+ }));
48652
+ },
48653
+ className: "w-10 h-10 rounded cursor-pointer border border-gray-300"
48654
+ }
48655
+ )
48656
+ ] }, index);
48657
+ }) })
48658
+ ] }),
48659
+ isLine && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 pb-4 border-b", children: [
48660
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Line Style" }),
48661
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
48662
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48663
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48664
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Line Width" }),
48665
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600", children: chartSettings.lineWidth })
48666
+ ] }),
48667
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48668
+ Slider,
48669
+ {
48670
+ min: 1,
48671
+ max: 5,
48672
+ step: 0.5,
48673
+ value: [(_e = chartSettings.lineWidth) != null ? _e : 2.5],
48674
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48675
+ lineWidth: value[0]
48676
+ })),
48677
+ className: "w-full"
48678
+ }
48679
+ )
48680
+ ] }),
48681
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48682
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48683
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Tension" }),
48684
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600", children: ((_f = chartSettings.lineTension) != null ? _f : 0.3).toFixed(2) })
48685
+ ] }),
48686
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48687
+ Slider,
48688
+ {
48689
+ min: 0,
48690
+ max: 0.8,
48691
+ step: 0.05,
48692
+ value: [(_g = chartSettings.lineTension) != null ? _g : 0.3],
48693
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48694
+ lineTension: value[0]
48695
+ })),
48696
+ className: "w-full"
48697
+ }
48698
+ )
48699
+ ] }),
48700
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48701
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48702
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Point Size" }),
48703
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48704
+ chartSettings.pointRadius,
48705
+ "px"
48706
+ ] })
48707
+ ] }),
48708
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48709
+ Slider,
48710
+ {
48711
+ min: 0,
48712
+ max: 8,
48713
+ step: 0.5,
48714
+ value: [(_h = chartSettings.pointRadius) != null ? _h : 4],
48715
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48716
+ pointRadius: value[0]
48717
+ })),
48718
+ className: "w-full"
48719
+ }
48720
+ )
48721
+ ] })
48722
+ ] })
48723
+ ] }),
48724
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 pb-4 border-b", children: [
48725
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Chart Title" }),
48726
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
48727
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48728
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Show Title" }) }),
48729
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
48730
+ Select,
48731
+ {
48732
+ value: chartSettings.showTitle !== false ? "yes" : "no",
48733
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48734
+ showTitle: value === "yes"
48735
+ })),
48736
+ children: [
48737
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Show title?" }) }),
48738
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
48739
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "no", children: "No" }),
48740
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "yes", children: "Yes" })
48741
+ ] })
48742
+ ]
48743
+ }
48744
+ )
48745
+ ] }),
48746
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48747
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Title Text" }) }),
48748
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48749
+ "input",
48750
+ {
48751
+ type: "text",
48752
+ placeholder: "Enter custom title (optional)",
48753
+ value: (_i = chartSettings.titleText) != null ? _i : "",
48754
+ onChange: (e) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48755
+ titleText: e.target.value
48756
+ })),
48757
+ className: "w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
48758
+ }
48759
+ )
48760
+ ] }),
48761
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48762
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48763
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Font Size" }),
48764
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48765
+ chartSettings.titleFontSize,
48766
+ "px"
48767
+ ] })
48768
+ ] }),
48769
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48770
+ Slider,
48771
+ {
48772
+ min: 12,
48773
+ max: 28,
48774
+ step: 1,
48775
+ value: [(_j = chartSettings.titleFontSize) != null ? _j : 16],
48776
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48777
+ titleFontSize: value[0]
48778
+ })),
48779
+ className: "w-full"
48780
+ }
48781
+ )
48782
+ ] })
48783
+ ] })
48784
+ ] }),
48785
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 pb-4 border-b", children: [
48786
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Data Labels" }),
48787
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
48788
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48789
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Show Labels" }) }),
48790
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
48791
+ Select,
48792
+ {
48793
+ value: chartSettings.showLabels ? "yes" : "no",
48794
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48795
+ showLabels: value === "yes"
48796
+ })),
48797
+ children: [
48798
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Show data labels?" }) }),
48799
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
48800
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "no", children: "No" }),
48801
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "yes", children: "Yes" })
48802
+ ] })
48803
+ ]
48804
+ }
48805
+ )
48806
+ ] }),
48807
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48808
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48809
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Font Size" }),
48810
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48811
+ chartSettings.dataLabelsFontSize,
48812
+ "px"
48813
+ ] })
48814
+ ] }),
48815
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48816
+ Slider,
48817
+ {
48818
+ min: 10,
48819
+ max: 18,
48820
+ step: 1,
48821
+ value: [(_k = chartSettings.dataLabelsFontSize) != null ? _k : 12],
48822
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48823
+ dataLabelsFontSize: value[0]
48824
+ })),
48825
+ className: "w-full"
48826
+ }
48827
+ )
48828
+ ] })
48829
+ ] })
48830
+ ] }),
48831
+ (agentType === "Series Bar Chart Agent" || agentType === "Bar Chart Agent" || agentType === "Series Line Chart Agent" || agentType === "Line Chart Agent") && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 pb-4 border-b", children: [
48832
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Axes" }),
48833
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
48834
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48835
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48836
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "X-Axis Title Font Size" }),
48837
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48838
+ chartSettings.xAxisTitleFontSize,
48839
+ "px"
48840
+ ] })
48841
+ ] }),
48842
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48843
+ Slider,
48844
+ {
48845
+ min: 10,
48846
+ max: 18,
48847
+ step: 1,
48848
+ value: [(_l = chartSettings.xAxisTitleFontSize) != null ? _l : 13],
48849
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48850
+ xAxisTitleFontSize: value[0]
48851
+ })),
48852
+ className: "w-full"
48853
+ }
48854
+ )
48855
+ ] }),
48856
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48857
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48858
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "X-Axis Tick Font Size" }),
48859
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48860
+ chartSettings.xAxisTickFontSize,
48861
+ "px"
48862
+ ] })
48863
+ ] }),
48864
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48865
+ Slider,
48866
+ {
48867
+ min: 10,
48868
+ max: 14,
48869
+ step: 1,
48870
+ value: [(_m = chartSettings.xAxisTickFontSize) != null ? _m : 12],
48871
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48872
+ xAxisTickFontSize: value[0]
48873
+ })),
48874
+ className: "w-full"
48875
+ }
48876
+ )
48877
+ ] }),
48878
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48879
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48880
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Y-Axis Title Font Size" }),
48881
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48882
+ chartSettings.yAxisTitleFontSize,
48883
+ "px"
48884
+ ] })
48885
+ ] }),
48886
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48887
+ Slider,
48888
+ {
48889
+ min: 10,
48890
+ max: 18,
48891
+ step: 1,
48892
+ value: [(_n = chartSettings.yAxisTitleFontSize) != null ? _n : 13],
48893
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48894
+ yAxisTitleFontSize: value[0]
48895
+ })),
48896
+ className: "w-full"
48897
+ }
48898
+ )
48899
+ ] }),
48900
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48901
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48902
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Y-Axis Tick Font Size" }),
48903
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48904
+ chartSettings.yAxisTickFontSize,
48905
+ "px"
48906
+ ] })
48907
+ ] }),
48908
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48909
+ Slider,
48910
+ {
48911
+ min: 10,
48912
+ max: 14,
48913
+ step: 1,
48914
+ value: [(_o = chartSettings.yAxisTickFontSize) != null ? _o : 12],
48915
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48916
+ yAxisTickFontSize: value[0]
48917
+ })),
48918
+ className: "w-full"
48919
+ }
48920
+ )
48921
+ ] })
48922
+ ] })
48923
+ ] }),
48924
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
48925
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: "Tooltip" }),
48926
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
48927
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-2", children: [
48928
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "text-sm font-medium", children: "Font Size" }),
48929
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
48930
+ chartSettings.tooltipFontSize,
48931
+ "px"
48932
+ ] })
48933
+ ] }),
48934
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48935
+ Slider,
48936
+ {
48937
+ min: 10,
48938
+ max: 16,
48939
+ step: 1,
48940
+ value: [(_p = chartSettings.tooltipFontSize) != null ? _p : 12],
48941
+ onValueChange: (value) => setChartSettings(__spreadProps$2(__spreadValues$3({}, chartSettings), {
48942
+ tooltipFontSize: value[0]
48943
+ })),
48944
+ className: "w-full"
48945
+ }
48946
+ )
48947
+ ] }) })
48948
+ ] })
48949
+ ] })
48950
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
48951
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "font-semibold text-sm", children: "Query" }),
48952
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
48953
+ Textarea,
48025
48954
  {
48026
- onClick: handleSubmit,
48027
- className: "font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none bg-primary-600 text-white hover:bg-primary-700 focus:ring-primary-500 px-6 py-2 text-sm flex items-center gap-2",
48028
- children: "Submit"
48955
+ className: "w-full p-2 min-h-[120px]",
48956
+ value: query,
48957
+ onChange: (e) => {
48958
+ var _a2;
48959
+ return setQuery((_a2 = e == null ? void 0 : e.target) == null ? void 0 : _a2.value);
48960
+ }
48029
48961
  }
48030
- ) })
48031
- ] })
48962
+ )
48963
+ ] }) }) }) }),
48964
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 px-6 py-4 border-t border-gray-200 bg-gradient-to-b from-white to-gray-50 flex justify-end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48965
+ "button",
48966
+ {
48967
+ onClick: handleSubmit,
48968
+ className: "font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none bg-primary text-primary-foreground hover:bg-primary/80 focus:ring-primary px-6 py-2 text-sm flex items-center gap-2",
48969
+ children: "Submit"
48970
+ }
48971
+ ) })
48032
48972
  ] })
48033
- ] })
48973
+ ]
48034
48974
  }
48035
48975
  );
48036
48976
  }
@@ -48534,20 +49474,52 @@ function WidgetDashboard({
48534
49474
  };
48535
49475
  const onClickSettings = (widget) => {
48536
49476
  var _a;
49477
+ const currentWidget = widgets.find((w) => w.id === widget.id) || widget;
48537
49478
  setShowEditModal(true);
48538
- setEditingWidget(widget);
48539
- let query = (_a = widget == null ? void 0 : widget.config) == null ? void 0 : _a.query;
49479
+ setEditingWidget(currentWidget);
49480
+ let query = (_a = currentWidget == null ? void 0 : currentWidget.config) == null ? void 0 : _a.query;
48540
49481
  if (query) {
48541
49482
  setEditInitialQuery(query);
48542
49483
  } else {
48543
49484
  setEditInitialQuery("");
48544
49485
  }
48545
49486
  };
48546
- const handleEditSubmit = async (newQuery, showLabels) => {
49487
+ const saveWidgetConfigToBackend = React.useCallback(
49488
+ lodash.debounce(async (widget) => {
49489
+ try {
49490
+ const widgetService = new WidgetService();
49491
+ await widgetService.saveWidget(widget);
49492
+ console.log(`[WidgetDashboard] Widget ${widget.id} config saved to backend`);
49493
+ } catch (error) {
49494
+ console.error(`[WidgetDashboard] Failed to save widget config:`, error);
49495
+ }
49496
+ }, 1e3),
49497
+ []
49498
+ );
49499
+ const handleConfigUpdate = (widgetId, config) => {
49500
+ setWidgets((prevWidgets) => {
49501
+ const updatedWidgets = prevWidgets.map(
49502
+ (w) => w.id === widgetId ? __spreadProps$1(__spreadValues$1({}, w), {
49503
+ config: __spreadValues$1(__spreadValues$1({}, w.config), config)
49504
+ }) : w
49505
+ );
49506
+ const updatedWidget = updatedWidgets.find((w) => w.id === widgetId);
49507
+ if (updatedWidget) {
49508
+ saveWidgetConfigToBackend(updatedWidget);
49509
+ }
49510
+ return updatedWidgets;
49511
+ });
49512
+ };
49513
+ const handleEditSubmit = async (newQuery, showLabels, chartSettings) => {
48547
49514
  var _a, _b;
48548
49515
  if (!editingWidget) return;
48549
49516
  const updatedWidgets = widgets.map(
48550
- (w) => w.id === editingWidget.id ? __spreadProps$1(__spreadValues$1({}, w), { config: __spreadProps$1(__spreadValues$1({}, w.config), { query: newQuery, content: __spreadProps$1(__spreadValues$1({}, w.config.content), { showLabels }) }) }) : w
49517
+ (w) => w.id === editingWidget.id ? __spreadProps$1(__spreadValues$1({}, w), {
49518
+ config: __spreadValues$1(__spreadProps$1(__spreadValues$1({}, w.config), {
49519
+ query: newQuery,
49520
+ content: __spreadProps$1(__spreadValues$1({}, w.config.content), { showLabels })
49521
+ }), chartSettings && { chartSettings })
49522
+ }) : w
48551
49523
  );
48552
49524
  setWidgets(updatedWidgets);
48553
49525
  setShowEditModal(false);
@@ -48637,6 +49609,11 @@ function WidgetDashboard({
48637
49609
  setTimeout(() => pollForSqlQuery(), 2e3);
48638
49610
  }
48639
49611
  }
49612
+ try {
49613
+ await stableSaveLayout();
49614
+ } catch (error) {
49615
+ console.error("Failed to save widget configuration:", error);
49616
+ }
48640
49617
  };
48641
49618
  const handleResetReady = React.useCallback((widgetId, resetFn) => {
48642
49619
  setWidgetResetFunctions((prev) => {
@@ -48674,6 +49651,7 @@ function WidgetDashboard({
48674
49651
  }
48675
49652
  };
48676
49653
  const loadData = React.useCallback(async () => {
49654
+ var _a;
48677
49655
  if (!pageId) {
48678
49656
  setIsLoading(false);
48679
49657
  return;
@@ -48694,6 +49672,12 @@ function WidgetDashboard({
48694
49672
  setPageData(data);
48695
49673
  setWidgets(data.widgets || []);
48696
49674
  setDatasetId(data == null ? void 0 : data.dataset_id);
49675
+ (_a = data.widgets) == null ? void 0 : _a.forEach((w) => {
49676
+ var _a2;
49677
+ if ((_a2 = w.config) == null ? void 0 : _a2.chartSettings) {
49678
+ console.log(`[WidgetDashboard] Widget ${w.id} has chartSettings:`, w.config.chartSettings);
49679
+ }
49680
+ });
48697
49681
  } catch (err) {
48698
49682
  console.error("Error loading page data:", err);
48699
49683
  } finally {
@@ -48739,6 +49723,23 @@ function WidgetDashboard({
48739
49723
  const newAgentWidgetIds = widgets.filter((w) => w.type === "agent" && !originalWidgetIdsRef.current.has(w.id)).map((w) => w.id);
48740
49724
  const hasFilterWidget = widgets.some((w) => w.type === "filters");
48741
49725
  try {
49726
+ const widgetsToSave = widgets.map((widget) => __spreadProps$1(__spreadValues$1({}, widget), {
49727
+ config: __spreadProps$1(__spreadValues$1({}, widget.config), {
49728
+ isFirstLoad: false
49729
+ }),
49730
+ position: {
49731
+ x: widget.position_x,
49732
+ y: widget.position_y,
49733
+ width: widget.width,
49734
+ height: widget.height
49735
+ }
49736
+ }));
49737
+ widgetsToSave.forEach((w) => {
49738
+ var _a;
49739
+ if ((_a = w.config) == null ? void 0 : _a.chartSettings) {
49740
+ console.log(`[WidgetDashboard] Saving widget ${w.id} with chartSettings:`, w.config.chartSettings);
49741
+ }
49742
+ });
48742
49743
  const response = await fetch(getApiUrl(`/api/pages/${pageId}`), {
48743
49744
  method: "PUT",
48744
49745
  headers: {
@@ -48747,17 +49748,7 @@ function WidgetDashboard({
48747
49748
  body: JSON.stringify(__spreadProps$1(__spreadValues$1({
48748
49749
  id: pageId
48749
49750
  }, pageData), {
48750
- widgets: widgets.map((widget) => __spreadProps$1(__spreadValues$1({}, widget), {
48751
- config: __spreadProps$1(__spreadValues$1({}, widget.config), {
48752
- isFirstLoad: false
48753
- }),
48754
- position: {
48755
- x: widget.position_x,
48756
- y: widget.position_y,
48757
- width: widget.width,
48758
- height: widget.height
48759
- }
48760
- }))
49751
+ widgets: widgetsToSave
48761
49752
  }))
48762
49753
  });
48763
49754
  if (!response.ok) {
@@ -49201,7 +50192,7 @@ function WidgetDashboard({
49201
50192
  const badgeInfo = filterStatus ? getFilterStatusBadge(filterStatus.status) : null;
49202
50193
  const isFocusMode = focusWidgetId && w.id === focusWidgetId;
49203
50194
  const widgetBaseStyles = "rounded-xl border-2 border-gray-300 !bg-white";
49204
- const widgetHoverStyles = "hover:border-primary-500 hover:shadow-lg transition-all duration-200 cursor-pointer";
50195
+ const widgetHoverStyles = isEditing ? "hover:border-primary-500 hover:shadow-lg transition-all duration-200 cursor-pointer" : "";
49205
50196
  const widgetShadow = "shadow-[0_4px_12px_-2px_rgba(0,0,0,0.2)]";
49206
50197
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-widget-id": w.id, className: `${w.type === "text" || w.type === "spacer" ? `${((_b = (_a = w == null ? void 0 : w.config) == null ? void 0 : _a.content) == null ? void 0 : _b.divider) === "yes" && "border-b border-gray-300"} ${isEditing ? `${widgetBaseStyles} ${widgetShadow} ${widgetHoverStyles}` : "flex items-center"}` : `${widgetBaseStyles} ${widgetShadow} ${widgetHoverStyles} p-4 ${isEditing ? "pb-14" : "pb-5"}`} ${isFocusMode ? "h-full" : ""} relative overflow-hidden`, children: [
49207
50198
  w.type === "agent" && badgeInfo && !isApplyingFilters && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-2 right-2 z-10", title: (filterStatus == null ? void 0 : filterStatus.reason) || (filterStatus == null ? void 0 : filterStatus.error) || "", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, { variant: badgeInfo.variant, className: "text-[10px] px-2 py-0.5 gap-1", children: [
@@ -49230,7 +50221,7 @@ function WidgetDashboard({
49230
50221
  w.type !== "spacer" && w.type !== "chatbot" && /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.Edit, { onClick: () => onClickSettings && onClickSettings(w), className: "w-5 h-5 text-gray-600" })
49231
50222
  ] })
49232
50223
  ] }),
49233
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${(w == null ? void 0 : w.type) === "text" || (w == null ? void 0 : w.type) === "spacer" ? `${isEditing ? "px-4" : ""}` : "h-full"} w-full relative`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetRenderer, { widget: w, widgetBackendUrl, onResetReady: handleResetReady, widgetIds: widgets.filter((widget) => widget.type !== "chatbot").map((widget) => widget.id), datasetId, pageId, onApplyFilters, isEditing, dashboardName: ((_c = pageData == null ? void 0 : pageData.basic) == null ? void 0 : _c.title) || (pageData == null ? void 0 : pageData.name) || (pageData == null ? void 0 : pageData.title), onClearChat: handleClearChat, isClearing: clearingChatWidget }) })
50224
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${(w == null ? void 0 : w.type) === "text" || (w == null ? void 0 : w.type) === "spacer" ? `${isEditing ? "px-4" : ""}` : "h-full"} w-full relative`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetRenderer, { widget: w, widgetBackendUrl, onResetReady: handleResetReady, widgetIds: widgets.filter((widget) => widget.type !== "chatbot").map((widget) => widget.id), datasetId, pageId, onApplyFilters, isEditing, dashboardName: ((_c = pageData == null ? void 0 : pageData.basic) == null ? void 0 : _c.title) || (pageData == null ? void 0 : pageData.name) || (pageData == null ? void 0 : pageData.title), onClearChat: handleClearChat, isClearing: clearingChatWidget, onConfigUpdate: handleConfigUpdate }) })
49234
50225
  ] }, w.id);
49235
50226
  })
49236
50227
  }