dp-widgets-framework 1.7.6 → 1.7.7

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 +329 -178
  2. package/dist/index.js +328 -177
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3631,10 +3631,6 @@ const oppositeSideMap = {
3631
3631
  bottom: 'top',
3632
3632
  top: 'bottom'
3633
3633
  };
3634
- const oppositeAlignmentMap = {
3635
- start: 'end',
3636
- end: 'start'
3637
- };
3638
3634
  function clamp(start, value, end) {
3639
3635
  return max(start, min(value, end));
3640
3636
  }
@@ -3653,9 +3649,9 @@ function getOppositeAxis(axis) {
3653
3649
  function getAxisLength(axis) {
3654
3650
  return axis === 'y' ? 'height' : 'width';
3655
3651
  }
3656
- const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
3657
3652
  function getSideAxis(placement) {
3658
- return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
3653
+ const firstChar = placement[0];
3654
+ return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
3659
3655
  }
3660
3656
  function getAlignmentAxis(placement) {
3661
3657
  return getOppositeAxis(getSideAxis(placement));
@@ -3678,7 +3674,7 @@ function getExpandedPlacements(placement) {
3678
3674
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
3679
3675
  }
3680
3676
  function getOppositeAlignmentPlacement(placement) {
3681
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
3677
+ return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
3682
3678
  }
3683
3679
  const lrPlacement = ['left', 'right'];
3684
3680
  const rlPlacement = ['right', 'left'];
@@ -3709,7 +3705,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
3709
3705
  return list;
3710
3706
  }
3711
3707
  function getOppositePlacement(placement) {
3712
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
3708
+ const side = getSide(placement);
3709
+ return oppositeSideMap[side] + placement.slice(side.length);
3713
3710
  }
3714
3711
  function expandPaddingObject(padding) {
3715
3712
  return {
@@ -3868,6 +3865,9 @@ async function detectOverflow(state, options) {
3868
3865
  };
3869
3866
  }
3870
3867
 
3868
+ // Maximum number of resets that can occur before bailing to avoid infinite reset loops.
3869
+ const MAX_RESET_COUNT = 50;
3870
+
3871
3871
  /**
3872
3872
  * Computes the `x` and `y` coordinates that will place the floating element
3873
3873
  * next to a given reference element.
@@ -3882,7 +3882,10 @@ const computePosition$1 = async (reference, floating, config) => {
3882
3882
  middleware = [],
3883
3883
  platform
3884
3884
  } = config;
3885
- const validMiddleware = middleware.filter(Boolean);
3885
+ const platformWithDetectOverflow = platform.detectOverflow ? platform : {
3886
+ ...platform,
3887
+ detectOverflow
3888
+ };
3886
3889
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
3887
3890
  let rects = await platform.getElementRects({
3888
3891
  reference,
@@ -3894,14 +3897,17 @@ const computePosition$1 = async (reference, floating, config) => {
3894
3897
  y
3895
3898
  } = computeCoordsFromPlacement(rects, placement, rtl);
3896
3899
  let statefulPlacement = placement;
3897
- let middlewareData = {};
3898
3900
  let resetCount = 0;
3899
- for (let i = 0; i < validMiddleware.length; i++) {
3900
- var _platform$detectOverf;
3901
+ const middlewareData = {};
3902
+ for (let i = 0; i < middleware.length; i++) {
3903
+ const currentMiddleware = middleware[i];
3904
+ if (!currentMiddleware) {
3905
+ continue;
3906
+ }
3901
3907
  const {
3902
3908
  name,
3903
3909
  fn
3904
- } = validMiddleware[i];
3910
+ } = currentMiddleware;
3905
3911
  const {
3906
3912
  x: nextX,
3907
3913
  y: nextY,
@@ -3915,10 +3921,7 @@ const computePosition$1 = async (reference, floating, config) => {
3915
3921
  strategy,
3916
3922
  middlewareData,
3917
3923
  rects,
3918
- platform: {
3919
- ...platform,
3920
- detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
3921
- },
3924
+ platform: platformWithDetectOverflow,
3922
3925
  elements: {
3923
3926
  reference,
3924
3927
  floating
@@ -3926,14 +3929,11 @@ const computePosition$1 = async (reference, floating, config) => {
3926
3929
  });
3927
3930
  x = nextX != null ? nextX : x;
3928
3931
  y = nextY != null ? nextY : y;
3929
- middlewareData = {
3930
- ...middlewareData,
3931
- [name]: {
3932
- ...middlewareData[name],
3933
- ...data
3934
- }
3932
+ middlewareData[name] = {
3933
+ ...middlewareData[name],
3934
+ ...data
3935
3935
  };
3936
- if (reset && resetCount <= 50) {
3936
+ if (reset && resetCount < MAX_RESET_COUNT) {
3937
3937
  resetCount++;
3938
3938
  if (typeof reset === 'object') {
3939
3939
  if (reset.placement) {
@@ -4608,7 +4608,6 @@ function isShadowRoot(value) {
4608
4608
  }
4609
4609
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
4610
4610
  }
4611
- const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
4612
4611
  function isOverflowElement(element) {
4613
4612
  const {
4614
4613
  overflow,
@@ -4616,32 +4615,35 @@ function isOverflowElement(element) {
4616
4615
  overflowY,
4617
4616
  display
4618
4617
  } = getComputedStyle$2(element);
4619
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
4618
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
4620
4619
  }
4621
- const tableElements$1 = /*#__PURE__*/new Set(['table', 'td', 'th']);
4622
4620
  function isTableElement(element) {
4623
- return tableElements$1.has(getNodeName(element));
4621
+ return /^(table|td|th)$/.test(getNodeName(element));
4624
4622
  }
4625
- const topLayerSelectors = [':popover-open', ':modal'];
4626
4623
  function isTopLayer(element) {
4627
- return topLayerSelectors.some(selector => {
4628
- try {
4629
- return element.matches(selector);
4630
- } catch (_e) {
4631
- return false;
4624
+ try {
4625
+ if (element.matches(':popover-open')) {
4626
+ return true;
4632
4627
  }
4633
- });
4628
+ } catch (_e) {
4629
+ // no-op
4630
+ }
4631
+ try {
4632
+ return element.matches(':modal');
4633
+ } catch (_e) {
4634
+ return false;
4635
+ }
4634
4636
  }
4635
- const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
4636
- const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
4637
- const containValues = ['paint', 'layout', 'strict', 'content'];
4637
+ const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
4638
+ const containRe = /paint|layout|strict|content/;
4639
+ const isNotNone = value => !!value && value !== 'none';
4640
+ let isWebKitValue;
4638
4641
  function isContainingBlock(elementOrCss) {
4639
- const webkit = isWebKit();
4640
4642
  const css = isElement(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss;
4641
4643
 
4642
4644
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
4643
4645
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
4644
- return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
4646
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
4645
4647
  }
4646
4648
  function getContainingBlock(element) {
4647
4649
  let currentNode = getParentNode(element);
@@ -4656,12 +4658,13 @@ function getContainingBlock(element) {
4656
4658
  return null;
4657
4659
  }
4658
4660
  function isWebKit() {
4659
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
4660
- return CSS.supports('-webkit-backdrop-filter', 'none');
4661
+ if (isWebKitValue == null) {
4662
+ isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
4663
+ }
4664
+ return isWebKitValue;
4661
4665
  }
4662
- const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
4663
4666
  function isLastTraversableNode(node) {
4664
- return lastTraversableNodeNames.has(getNodeName(node));
4667
+ return /^(html|body|#document)$/.test(getNodeName(node));
4665
4668
  }
4666
4669
  function getComputedStyle$2(element) {
4667
4670
  return getWindow(element).getComputedStyle(element);
@@ -4717,8 +4720,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
4717
4720
  if (isBody) {
4718
4721
  const frameElement = getFrameElement(win);
4719
4722
  return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
4723
+ } else {
4724
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
4720
4725
  }
4721
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
4722
4726
  }
4723
4727
  function getFrameElement(win) {
4724
4728
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
@@ -4895,7 +4899,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
4895
4899
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
4896
4900
  scroll = getNodeScroll(offsetParent);
4897
4901
  }
4898
- if (isHTMLElement(offsetParent)) {
4902
+ if (isOffsetParentAnElement) {
4899
4903
  const offsetRect = getBoundingClientRect(offsetParent);
4900
4904
  scale = getScale(offsetParent);
4901
4905
  offsets.x = offsetRect.x + offsetParent.clientLeft;
@@ -4983,7 +4987,6 @@ function getViewportRect(element, strategy) {
4983
4987
  };
4984
4988
  }
4985
4989
 
4986
- const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
4987
4990
  // Returns the inner client rect, subtracting scrollbars if present.
4988
4991
  function getInnerBoundingClientRect(element, strategy) {
4989
4992
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -5048,7 +5051,7 @@ function getClippingElementAncestors(element, cache) {
5048
5051
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
5049
5052
  currentContainingBlockComputedStyle = null;
5050
5053
  }
5051
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
5054
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
5052
5055
  if (shouldDropCurrentNode) {
5053
5056
  // Drop non-containing blocks.
5054
5057
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -5073,20 +5076,23 @@ function getClippingRect(_ref) {
5073
5076
  } = _ref;
5074
5077
  const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
5075
5078
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
5076
- const firstClippingAncestor = clippingAncestors[0];
5077
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
5078
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
5079
- accRect.top = max(rect.top, accRect.top);
5080
- accRect.right = min(rect.right, accRect.right);
5081
- accRect.bottom = min(rect.bottom, accRect.bottom);
5082
- accRect.left = max(rect.left, accRect.left);
5083
- return accRect;
5084
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
5079
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
5080
+ let top = firstRect.top;
5081
+ let right = firstRect.right;
5082
+ let bottom = firstRect.bottom;
5083
+ let left = firstRect.left;
5084
+ for (let i = 1; i < clippingAncestors.length; i++) {
5085
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
5086
+ top = max(rect.top, top);
5087
+ right = min(rect.right, right);
5088
+ bottom = min(rect.bottom, bottom);
5089
+ left = max(rect.left, left);
5090
+ }
5085
5091
  return {
5086
- width: clippingRect.right - clippingRect.left,
5087
- height: clippingRect.bottom - clippingRect.top,
5088
- x: clippingRect.left,
5089
- y: clippingRect.top
5092
+ width: right - left,
5093
+ height: bottom - top,
5094
+ x: left,
5095
+ y: top
5090
5096
  };
5091
5097
  }
5092
5098
 
@@ -5337,7 +5343,7 @@ function autoUpdate(reference, floating, update, options) {
5337
5343
  animationFrame = false
5338
5344
  } = options;
5339
5345
  const referenceEl = unwrapElement(reference);
5340
- const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
5346
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];
5341
5347
  ancestors.forEach(ancestor => {
5342
5348
  ancestorScroll && ancestor.addEventListener('scroll', update, {
5343
5349
  passive: true
@@ -5350,7 +5356,7 @@ function autoUpdate(reference, floating, update, options) {
5350
5356
  if (elementResize) {
5351
5357
  resizeObserver = new ResizeObserver(_ref => {
5352
5358
  let [firstEntry] = _ref;
5353
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
5359
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
5354
5360
  // Prevent update loops when using the `size` middleware.
5355
5361
  // https://github.com/floating-ui/floating-ui/issues/1740
5356
5362
  resizeObserver.unobserve(floating);
@@ -5365,7 +5371,9 @@ function autoUpdate(reference, floating, update, options) {
5365
5371
  if (referenceEl && !animationFrame) {
5366
5372
  resizeObserver.observe(referenceEl);
5367
5373
  }
5368
- resizeObserver.observe(floating);
5374
+ if (floating) {
5375
+ resizeObserver.observe(floating);
5376
+ }
5369
5377
  }
5370
5378
  let frameId;
5371
5379
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
@@ -5747,28 +5755,39 @@ const arrow$1 = options => {
5747
5755
  * object may be passed.
5748
5756
  * @see https://floating-ui.com/docs/offset
5749
5757
  */
5750
- const offset = (options, deps) => ({
5751
- ...offset$1(options),
5752
- options: [options, deps]
5753
- });
5758
+ const offset = (options, deps) => {
5759
+ const result = offset$1(options);
5760
+ return {
5761
+ name: result.name,
5762
+ fn: result.fn,
5763
+ options: [options, deps]
5764
+ };
5765
+ };
5754
5766
 
5755
5767
  /**
5756
5768
  * Optimizes the visibility of the floating element by shifting it in order to
5757
5769
  * keep it in view when it will overflow the clipping boundary.
5758
5770
  * @see https://floating-ui.com/docs/shift
5759
5771
  */
5760
- const shift = (options, deps) => ({
5761
- ...shift$1(options),
5762
- options: [options, deps]
5763
- });
5772
+ const shift = (options, deps) => {
5773
+ const result = shift$1(options);
5774
+ return {
5775
+ name: result.name,
5776
+ fn: result.fn,
5777
+ options: [options, deps]
5778
+ };
5779
+ };
5764
5780
 
5765
5781
  /**
5766
5782
  * Built-in `limiter` that will stop `shift()` at a certain point.
5767
5783
  */
5768
- const limitShift = (options, deps) => ({
5769
- ...limitShift$1(options),
5770
- options: [options, deps]
5771
- });
5784
+ const limitShift = (options, deps) => {
5785
+ const result = limitShift$1(options);
5786
+ return {
5787
+ fn: result.fn,
5788
+ options: [options, deps]
5789
+ };
5790
+ };
5772
5791
 
5773
5792
  /**
5774
5793
  * Optimizes the visibility of the floating element by flipping the `placement`
@@ -5776,10 +5795,14 @@ const limitShift = (options, deps) => ({
5776
5795
  * clipping boundary. Alternative to `autoPlacement`.
5777
5796
  * @see https://floating-ui.com/docs/flip
5778
5797
  */
5779
- const flip = (options, deps) => ({
5780
- ...flip$1(options),
5781
- options: [options, deps]
5782
- });
5798
+ const flip = (options, deps) => {
5799
+ const result = flip$1(options);
5800
+ return {
5801
+ name: result.name,
5802
+ fn: result.fn,
5803
+ options: [options, deps]
5804
+ };
5805
+ };
5783
5806
 
5784
5807
  /**
5785
5808
  * Provides data that allows you to change the size of the floating element —
@@ -5787,20 +5810,28 @@ const flip = (options, deps) => ({
5787
5810
  * width of the reference element.
5788
5811
  * @see https://floating-ui.com/docs/size
5789
5812
  */
5790
- const size = (options, deps) => ({
5791
- ...size$1(options),
5792
- options: [options, deps]
5793
- });
5813
+ const size = (options, deps) => {
5814
+ const result = size$1(options);
5815
+ return {
5816
+ name: result.name,
5817
+ fn: result.fn,
5818
+ options: [options, deps]
5819
+ };
5820
+ };
5794
5821
 
5795
5822
  /**
5796
5823
  * Provides data to hide the floating element in applicable situations, such as
5797
5824
  * when it is not in the same clipping context as the reference element.
5798
5825
  * @see https://floating-ui.com/docs/hide
5799
5826
  */
5800
- const hide = (options, deps) => ({
5801
- ...hide$1(options),
5802
- options: [options, deps]
5803
- });
5827
+ const hide = (options, deps) => {
5828
+ const result = hide$1(options);
5829
+ return {
5830
+ name: result.name,
5831
+ fn: result.fn,
5832
+ options: [options, deps]
5833
+ };
5834
+ };
5804
5835
 
5805
5836
  /**
5806
5837
  * Provides data to position an inner element of the floating element so that it
@@ -5808,10 +5839,14 @@ const hide = (options, deps) => ({
5808
5839
  * This wraps the core `arrow` middleware to allow React refs as the element.
5809
5840
  * @see https://floating-ui.com/docs/arrow
5810
5841
  */
5811
- const arrow = (options, deps) => ({
5812
- ...arrow$1(options),
5813
- options: [options, deps]
5814
- });
5842
+ const arrow = (options, deps) => {
5843
+ const result = arrow$1(options);
5844
+ return {
5845
+ name: result.name,
5846
+ fn: result.fn,
5847
+ options: [options, deps]
5848
+ };
5849
+ };
5815
5850
 
5816
5851
  // src/arrow.tsx
5817
5852
  var NAME$1 = "Arrow";
@@ -20148,15 +20183,17 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
20148
20183
  afterDatasetsDraw(chart) {
20149
20184
  if (!(content == null ? void 0 : content.showLabels)) return;
20150
20185
  const { ctx } = chart;
20186
+ const chartHeight = chart.height;
20187
+ const fontSize = Math.max(11, Math.min(14, Math.floor(chartHeight * 0.025)));
20151
20188
  chart.data.datasets.forEach((dataset, i) => {
20152
20189
  const meta = chart.getDatasetMeta(i);
20153
20190
  meta.data.forEach((bar, index) => {
20154
20191
  const value = dataset.data[index];
20155
20192
  ctx.save();
20156
- ctx.font = "12px sans-serif";
20193
+ ctx.font = `bold ${fontSize}px sans-serif`;
20157
20194
  ctx.textAlign = "center";
20158
- ctx.fillStyle = "black";
20159
- ctx.fillText(value, bar.x, bar.y - 5);
20195
+ ctx.fillStyle = "#0F172A";
20196
+ ctx.fillText(value, bar.x, bar.y - 8);
20160
20197
  ctx.restore();
20161
20198
  });
20162
20199
  });
@@ -20176,10 +20213,10 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
20176
20213
  indexAxis: orientation === "horizontal" ? "y" : "x",
20177
20214
  layout: {
20178
20215
  padding: {
20179
- bottom: 0,
20180
- top: 0,
20181
- left: 0,
20182
- right: 0
20216
+ bottom: 8,
20217
+ top: 24,
20218
+ left: 4,
20219
+ right: 16
20183
20220
  }
20184
20221
  },
20185
20222
  plugins: {
@@ -20191,8 +20228,12 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
20191
20228
  return false;
20192
20229
  }),
20193
20230
  labels: {
20194
- boxWidth: 12,
20195
- boxHeight: 12
20231
+ boxWidth: 16,
20232
+ boxHeight: 16,
20233
+ padding: 16,
20234
+ font: { size: 13, weight: "normal" },
20235
+ usePointStyle: true,
20236
+ pointStyle: "rect"
20196
20237
  },
20197
20238
  position: "bottom"
20198
20239
  },
@@ -20203,12 +20244,21 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
20203
20244
  display: true,
20204
20245
  text: title,
20205
20246
  font: {
20206
- size: 18,
20247
+ size: 16,
20207
20248
  weight: "bold"
20208
20249
  },
20209
- color: "#0F172A"
20250
+ color: "#0F172A",
20251
+ padding: 16
20210
20252
  },
20211
20253
  tooltip: {
20254
+ mode: "index",
20255
+ intersect: false,
20256
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
20257
+ titleFont: { size: 13, weight: "bold" },
20258
+ bodyFont: { size: 12 },
20259
+ padding: 12,
20260
+ borderColor: "#ccc",
20261
+ borderWidth: 1,
20212
20262
  callbacks: {
20213
20263
  label: function(context) {
20214
20264
  var _a2, _b2;
@@ -20222,23 +20272,40 @@ function SeriesChart({ orientation, title, data, options, className, units, cont
20222
20272
  x: {
20223
20273
  title: {
20224
20274
  display: !!x_axis_title,
20225
- text: x_axis_title
20275
+ text: x_axis_title,
20276
+ font: { size: 13, weight: "bold" },
20277
+ padding: 8
20278
+ },
20279
+ ticks: {
20280
+ autoSkip: true,
20281
+ maxRotation: 45,
20282
+ minRotation: 0,
20283
+ font: { size: 12 },
20284
+ maxTicksLimit: 12
20226
20285
  },
20227
- ticks: { autoSkip: false, maxRotation: 45, minRotation: 0 }
20286
+ grid: {
20287
+ color: "rgba(0, 0, 0, 0.05)"
20288
+ }
20228
20289
  },
20229
20290
  y: {
20230
20291
  title: {
20231
20292
  display: true,
20232
- text: y_axis_title || ((data == null ? void 0 : data.datasets) && ((_a = data == null ? void 0 : data.datasets) == null ? void 0 : _a.length) === 1 ? (_b = data == null ? void 0 : data.datasets) == null ? void 0 : _b[0].label : getAxisLabel(units != null ? units : ""))
20293
+ text: y_axis_title || ((data == null ? void 0 : data.datasets) && ((_a = data == null ? void 0 : data.datasets) == null ? void 0 : _a.length) === 1 ? (_b = data == null ? void 0 : data.datasets) == null ? void 0 : _b[0].label : getAxisLabel(units != null ? units : "")),
20294
+ font: { size: 13, weight: "bold" },
20295
+ padding: 12
20233
20296
  },
20234
20297
  beginAtZero: true,
20235
20298
  ticks: {
20299
+ font: { size: 12 },
20236
20300
  callback: function(value) {
20237
20301
  if (units === "$") {
20238
20302
  return `${units}${formatValue(value)}`;
20239
20303
  }
20240
20304
  return units ? `${formatValue(value)} ${(units == null ? void 0 : units.length) < 3 ? units : ""}` : value;
20241
20305
  }
20306
+ },
20307
+ grid: {
20308
+ color: "rgba(0, 0, 0, 0.05)"
20242
20309
  }
20243
20310
  }
20244
20311
  }
@@ -21617,10 +21684,10 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
21617
21684
  maintainAspectRatio: false,
21618
21685
  layout: {
21619
21686
  padding: {
21620
- bottom: 0,
21621
- top: 0,
21622
- left: 0,
21623
- right: 0
21687
+ bottom: 8,
21688
+ top: 8,
21689
+ left: 4,
21690
+ right: 16
21624
21691
  }
21625
21692
  },
21626
21693
  plugins: {
@@ -21632,8 +21699,12 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
21632
21699
  return false;
21633
21700
  }),
21634
21701
  labels: {
21635
- boxWidth: 12,
21636
- boxHeight: 12
21702
+ boxWidth: 16,
21703
+ boxHeight: 16,
21704
+ padding: 16,
21705
+ font: { size: 13, weight: "normal" },
21706
+ usePointStyle: true,
21707
+ pointStyle: "circle"
21637
21708
  },
21638
21709
  position: "bottom"
21639
21710
  },
@@ -21657,12 +21728,21 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
21657
21728
  display: true,
21658
21729
  text: title,
21659
21730
  font: {
21660
- size: 18,
21731
+ size: 16,
21661
21732
  weight: "bold"
21662
21733
  },
21663
- color: "#0F172A"
21734
+ color: "#0F172A",
21735
+ padding: 16
21664
21736
  },
21665
21737
  tooltip: {
21738
+ mode: "index",
21739
+ intersect: false,
21740
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
21741
+ titleFont: { size: 13, weight: "bold" },
21742
+ bodyFont: { size: 12 },
21743
+ padding: 12,
21744
+ borderColor: "#ccc",
21745
+ borderWidth: 1,
21666
21746
  callbacks: {
21667
21747
  label: function(context) {
21668
21748
  var _a2;
@@ -21676,26 +21756,43 @@ function SeriesLineChart({ orientation, title, data, options, className, units,
21676
21756
  x: {
21677
21757
  title: {
21678
21758
  display: !!x_axis_title,
21679
- text: x_axis_title
21759
+ text: x_axis_title,
21760
+ font: { size: 13, weight: "bold" },
21761
+ padding: 8
21680
21762
  },
21681
- ticks: { autoSkip: true, maxTicksLimit: 8, maxRotation: 45, minRotation: 0 }
21763
+ ticks: {
21764
+ autoSkip: true,
21765
+ maxRotation: 45,
21766
+ minRotation: 0,
21767
+ font: { size: 12 },
21768
+ maxTicksLimit: 10
21769
+ },
21770
+ grid: {
21771
+ color: "rgba(0, 0, 0, 0.05)"
21772
+ }
21682
21773
  },
21683
21774
  y: {
21684
21775
  title: {
21685
21776
  display: true,
21686
- text: y_axis_title || ((data == null ? void 0 : data.datasets) && ((_a = data == null ? void 0 : data.datasets) == null ? void 0 : _a.length) === 1 ? (_b = data == null ? void 0 : data.datasets) == null ? void 0 : _b[0].label : getAxisLabel(units != null ? units : ""))
21777
+ text: y_axis_title || ((data == null ? void 0 : data.datasets) && ((_a = data == null ? void 0 : data.datasets) == null ? void 0 : _a.length) === 1 ? (_b = data == null ? void 0 : data.datasets) == null ? void 0 : _b[0].label : getAxisLabel(units != null ? units : "")),
21778
+ font: { size: 13, weight: "bold" },
21779
+ padding: 12
21687
21780
  },
21688
21781
  beginAtZero: true,
21689
21782
  ticks: {
21783
+ font: { size: 12 },
21690
21784
  callback: function(value) {
21691
21785
  return units ? `${formatValue(value)} ${units}` : value;
21692
21786
  }
21787
+ },
21788
+ grid: {
21789
+ color: "rgba(0, 0, 0, 0.05)"
21693
21790
  }
21694
21791
  }
21695
21792
  },
21696
21793
  elements: {
21697
21794
  line: {
21698
- tension: 0.1
21795
+ tension: 0.3
21699
21796
  },
21700
21797
  point: {
21701
21798
  radius: 4
@@ -22503,8 +22600,12 @@ const PieChart = (props) => {
22503
22600
  plugins: {
22504
22601
  legend: {
22505
22602
  labels: {
22506
- boxWidth: 4,
22507
- boxHeight: 4
22603
+ boxWidth: 16,
22604
+ boxHeight: 16,
22605
+ padding: 12,
22606
+ font: { size: 13, weight: "normal" },
22607
+ usePointStyle: true,
22608
+ pointStyle: "circle"
22508
22609
  },
22509
22610
  position: "bottom"
22510
22611
  },
@@ -22521,19 +22622,21 @@ const PieChart = (props) => {
22521
22622
  const percent = value / total * 100;
22522
22623
  return percent >= 5 ? `${(_a = ctx.chart.data.labels) == null ? void 0 : _a[ctx.dataIndex]} ${value}` : "";
22523
22624
  },
22524
- color: "black",
22525
- stretch: 15,
22625
+ color: "#0F172A",
22626
+ stretch: 25,
22627
+ padding: 4,
22526
22628
  font: {
22527
22629
  resizable: true,
22528
- minSize: 12,
22529
- maxSize: 18
22630
+ minSize: 11,
22631
+ maxSize: 14,
22632
+ weight: "bold"
22530
22633
  },
22531
22634
  backgroundColor: (ctx) => {
22532
22635
  const dataset = ctx.dataset.data;
22533
22636
  const total = dataset.reduce((a, b) => a + b, 0);
22534
22637
  const value = dataset[ctx.dataIndex];
22535
22638
  const percent = value / total * 100;
22536
- return percent >= 5 ? "rgba(255,255,255,0.7)" : "transparent";
22639
+ return percent >= 5 ? "rgba(255,255,255,0.85)" : "transparent";
22537
22640
  }
22538
22641
  },
22539
22642
  datalabels: {
@@ -22543,12 +22646,22 @@ const PieChart = (props) => {
22543
22646
  display: true,
22544
22647
  text: title,
22545
22648
  font: {
22546
- size: 18,
22649
+ size: 16,
22547
22650
  weight: "bold"
22548
22651
  },
22549
- color: "#0F172A"
22652
+ color: "#0F172A",
22653
+ padding: {
22654
+ bottom: 28,
22655
+ top: 0
22656
+ }
22550
22657
  },
22551
22658
  tooltip: {
22659
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
22660
+ titleFont: { size: 13, weight: "bold" },
22661
+ bodyFont: { size: 12 },
22662
+ padding: 12,
22663
+ borderColor: "#ccc",
22664
+ borderWidth: 1,
22552
22665
  callbacks: {
22553
22666
  label: function(context) {
22554
22667
  const value = context.parsed;
@@ -22559,10 +22672,10 @@ const PieChart = (props) => {
22559
22672
  },
22560
22673
  layout: {
22561
22674
  padding: {
22562
- bottom: 0,
22563
- top: 0,
22564
- left: 0,
22565
- right: 0
22675
+ bottom: 4,
22676
+ top: 24,
22677
+ left: 4,
22678
+ right: 4
22566
22679
  }
22567
22680
  }
22568
22681
  };
@@ -36931,7 +37044,7 @@ const own$2 = {}.hasOwnProperty;
36931
37044
  * mdast tree.
36932
37045
  */
36933
37046
  function fromMarkdown(value, encoding, options) {
36934
- if (typeof encoding !== 'string') {
37047
+ if (encoding && typeof encoding === 'object') {
36935
37048
  options = encoding;
36936
37049
  encoding = undefined;
36937
37050
  }
@@ -44662,7 +44775,9 @@ function CopilotKitChatbot({
44662
44775
  onResetReady,
44663
44776
  widgetIds,
44664
44777
  datasetId,
44665
- dashboardName
44778
+ dashboardName,
44779
+ onClearChat,
44780
+ isClearing = false
44666
44781
  }) {
44667
44782
  var _a, _b, _c, _d;
44668
44783
  const { threadId, setThreadId } = reactCore.useCopilotContext();
@@ -44771,25 +44886,46 @@ function CopilotKitChatbot({
44771
44886
  /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium", children: widget.title })
44772
44887
  ] }) }),
44773
44888
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 h-full flex flex-col", children: [
44774
- chatMessages.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-start px-4 py-2 border-b border-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
44775
- "button",
44776
- {
44777
- onClick: handleExport,
44778
- disabled: isExporting,
44779
- className: cn(
44780
- "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md",
44781
- "bg-gray-100 border border-gray-200",
44782
- "text-gray-700 hover:bg-gray-200 hover:border-gray-300",
44783
- "disabled:opacity-50 disabled:cursor-not-allowed",
44784
- "transition-colors duration-150"
44785
- ),
44786
- title: "Export conversation as PDF",
44787
- children: [
44788
- isExporting ? /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.Download, { className: "h-3.5 w-3.5" }),
44789
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Export PDF" })
44790
- ]
44791
- }
44792
- ) }),
44889
+ chatMessages.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start gap-2 px-4 py-2 border-b border-gray-100", children: [
44890
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
44891
+ "button",
44892
+ {
44893
+ onClick: handleExport,
44894
+ disabled: isExporting,
44895
+ className: cn(
44896
+ "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md",
44897
+ "bg-gray-100 border border-gray-200",
44898
+ "text-gray-700 hover:bg-gray-200 hover:border-gray-300",
44899
+ "disabled:opacity-50 disabled:cursor-not-allowed",
44900
+ "transition-colors duration-150"
44901
+ ),
44902
+ title: "Export conversation as PDF",
44903
+ children: [
44904
+ isExporting ? /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.Download, { className: "h-3.5 w-3.5" }),
44905
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Export PDF" })
44906
+ ]
44907
+ }
44908
+ ),
44909
+ onClearChat && /* @__PURE__ */ jsxRuntimeExports.jsxs(
44910
+ "button",
44911
+ {
44912
+ onClick: onClearChat,
44913
+ disabled: isClearing,
44914
+ className: cn(
44915
+ "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md",
44916
+ "bg-gray-100 border border-gray-200",
44917
+ "text-gray-700 hover:bg-gray-200 hover:border-gray-300",
44918
+ "disabled:opacity-50 disabled:cursor-not-allowed",
44919
+ "transition-colors duration-150"
44920
+ ),
44921
+ title: "Clear chat conversation",
44922
+ children: [
44923
+ isClearing ? /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.MessageCircleX, { className: "h-3.5 w-3.5" }),
44924
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Clear Chat" })
44925
+ ]
44926
+ }
44927
+ )
44928
+ ] }),
44793
44929
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto p-4 space-y-4", children: chatMessages.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-gray-500 text-xs mt-8", children: ((_b = widget.config) == null ? void 0 : _b.copilotInitialMessage) || ((_c = widget.config) == null ? void 0 : _c.placeholder) || "How can I help you today?" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
44794
44930
  chatMessages.map((message) => /* @__PURE__ */ jsxRuntimeExports.jsx(
44795
44931
  "div",
@@ -44866,7 +45002,9 @@ function ChatbotWidget({
44866
45002
  onResetReady,
44867
45003
  widgetIds,
44868
45004
  datasetId,
44869
- dashboardName
45005
+ dashboardName,
45006
+ onClearChat,
45007
+ isClearing = false
44870
45008
  }) {
44871
45009
  var _a, _b;
44872
45010
  const styles = getStyleValues$4((_a = widget.config) == null ? void 0 : _a.styles);
@@ -44891,7 +45029,9 @@ function ChatbotWidget({
44891
45029
  onResetReady,
44892
45030
  widgetIds,
44893
45031
  datasetId,
44894
- dashboardName
45032
+ dashboardName,
45033
+ onClearChat,
45034
+ isClearing
44895
45035
  }
44896
45036
  )
44897
45037
  }
@@ -45782,7 +45922,7 @@ var __spreadValues$8 = (a, b) => {
45782
45922
  };
45783
45923
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
45784
45924
  const CHART_REFRESH_TIMEOUT$3 = 3e3;
45785
- const DEFAULT_COLORS$2 = ["#E4DCB8", "#DAC46C", "#808080", "#582809", "#A3ADD0", "#398E6F", "#AF123D", "#8C99C4", "#5290AC", "#601B07", "#50649D", "#B4A8A0", "#6F2587"];
45925
+ const DEFAULT_COLORS$2 = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
45786
45926
  const clearChat$3 = async (widgetBackendUrl, widgetId) => {
45787
45927
  if (!widgetBackendUrl || !widgetId) return;
45788
45928
  console.log("clearChat called for widgetId:", widgetId);
@@ -46175,7 +46315,7 @@ var __spreadValues$7 = (a, b) => {
46175
46315
  };
46176
46316
  var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
46177
46317
  const CHART_REFRESH_TIMEOUT$2 = 3e3;
46178
- const DEFAULT_COLORS$1 = ["#E4DCB8", "#DAC46C", "#808080", "#582809", "#A3ADD0", "#398E6F", "#AF123D", "#8C99C4", "#5290AC", "#601B07", "#50649D", "#B4A8A0", "#6F2587"];
46318
+ const DEFAULT_COLORS$1 = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
46179
46319
  const clearChat$2 = async (widgetBackendUrl, widgetId) => {
46180
46320
  if (!widgetBackendUrl || !widgetId) return;
46181
46321
  console.log("clearChat called for widgetId:", widgetId);
@@ -46600,7 +46740,7 @@ var __spreadValues$6 = (a, b) => {
46600
46740
  };
46601
46741
  var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
46602
46742
  const CHART_REFRESH_TIMEOUT$1 = 3e3;
46603
- const DEFAULT_COLORS = ["#E4DCB8", "#DAC46C", "#808080", "#582809", "#A3ADD0", "#398E6F", "#AF123D", "#8C99C4", "#5290AC", "#601B07", "#50649D", "#B4A8A0", "#6F2587"];
46743
+ const DEFAULT_COLORS = ["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#06B6D4", "#F97316", "#EC4899", "#14B8A6", "#6366F1", "#84CC16", "#FB7185", "#A78BFA", "#34D399", "#FBBF24"];
46604
46744
  const clearChat$1 = async (widgetBackendUrl, widgetId) => {
46605
46745
  if (!widgetBackendUrl || !widgetId) return;
46606
46746
  console.log("clearChat called for widgetId:", widgetId);
@@ -46792,11 +46932,23 @@ function SeriesBarChartComponent({
46792
46932
  }
46793
46933
  const transformedData = {
46794
46934
  labels,
46795
- datasets: series.map((seriesItem, index) => ({
46796
- label: seriesItem.name,
46797
- data: seriesItem.values,
46798
- backgroundColor: (seriesItem == null ? void 0 : seriesItem.colors) || (seriesItem == null ? void 0 : seriesItem.color) || finalColors[index % finalColors.length]
46799
- }))
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];
46937
+ return {
46938
+ label: seriesItem.name,
46939
+ data: seriesItem.values,
46940
+ borderColor: color,
46941
+ backgroundColor: color + "26",
46942
+ // 15% opacity for subtle fill under curve
46943
+ borderWidth: 2.5,
46944
+ fill: false,
46945
+ pointRadius: 4,
46946
+ pointHoverRadius: 6,
46947
+ pointBackgroundColor: color,
46948
+ pointBorderColor: "#ffffff",
46949
+ pointBorderWidth: 2
46950
+ };
46951
+ })
46800
46952
  };
46801
46953
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
46802
46954
  SeriesLineChart,
@@ -47411,7 +47563,9 @@ function WidgetRenderer({
47411
47563
  pageId,
47412
47564
  onApplyFilters,
47413
47565
  isEditing = false,
47414
- dashboardName
47566
+ dashboardName,
47567
+ onClearChat,
47568
+ isClearing
47415
47569
  }) {
47416
47570
  const handleConfigUpdate = (config) => {
47417
47571
  if (onConfigUpdate) {
@@ -47443,7 +47597,7 @@ function WidgetRenderer({
47443
47597
  }
47444
47598
  );
47445
47599
  case "chatbot":
47446
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ChatbotWidget, { widget, showHeader: false, widgetBackendUrl, onResetReady, widgetIds, datasetId, dashboardName });
47600
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ChatbotWidget, { widget, showHeader: false, widgetBackendUrl, onResetReady, widgetIds, datasetId, dashboardName, onClearChat: onClearChat ? () => onClearChat(widget.id) : void 0, isClearing: isClearing === widget.id });
47447
47601
  case "filters":
47448
47602
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
47449
47603
  FiltersWidget,
@@ -48323,11 +48477,11 @@ function WidgetDashboard({
48323
48477
  const [internalSelectedWidget, setInternalSelectedWidget] = React.useState(selectedWidget);
48324
48478
  const [currentLayouts, setCurrentLayouts] = React.useState(defaultLayouts);
48325
48479
  const [draftLayouts, setDraftLayouts] = React.useState(defaultLayouts);
48326
- const [visibleClearButton, setVisibleClearButton] = React.useState("");
48327
48480
  const [showEditModal, setShowEditModal] = React.useState(false);
48328
48481
  const [editInitialQuery, setEditInitialQuery] = React.useState("");
48329
48482
  const [editingWidget, setEditingWidget] = React.useState(null);
48330
48483
  const [widgetResetFunctions, setWidgetResetFunctions] = React.useState(/* @__PURE__ */ new Map());
48484
+ const [clearingChatWidget, setClearingChatWidget] = React.useState("");
48331
48485
  const displayWidgets = React.useMemo(() => {
48332
48486
  if (focusWidgetId) {
48333
48487
  return widgets.filter((w) => w.id === focusWidgetId);
@@ -48493,6 +48647,7 @@ function WidgetDashboard({
48493
48647
  }, []);
48494
48648
  const handleClearChat = async (widgetId) => {
48495
48649
  try {
48650
+ setClearingChatWidget(widgetId);
48496
48651
  const response = await fetch(getApiUrl("/api/clear-chat"), {
48497
48652
  method: "POST",
48498
48653
  headers: {
@@ -48514,6 +48669,8 @@ function WidgetDashboard({
48514
48669
  }
48515
48670
  } catch (error) {
48516
48671
  console.error("Error clearing chat:", error);
48672
+ } finally {
48673
+ setClearingChatWidget("");
48517
48674
  }
48518
48675
  };
48519
48676
  const loadData = React.useCallback(async () => {
@@ -49043,10 +49200,10 @@ function WidgetDashboard({
49043
49200
  const filterStatus = w.type === "agent" ? getWidgetFilterStatus(w.id) : null;
49044
49201
  const badgeInfo = filterStatus ? getFilterStatusBadge(filterStatus.status) : null;
49045
49202
  const isFocusMode = focusWidgetId && w.id === focusWidgetId;
49046
- const widgetBaseStyles = "rounded-xl border border-gray-200 !bg-white";
49047
- const widgetHoverStyles = isEditing ? "hover:border-primary-500 hover:shadow-lg transition-all duration-200" : "";
49048
- const widgetShadow = "shadow-[0_2px_8px_-2px_rgba(0,0,0,0.15)]";
49049
- 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`, children: [
49203
+ 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";
49205
+ const widgetShadow = "shadow-[0_4px_12px_-2px_rgba(0,0,0,0.2)]";
49206
+ 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: [
49050
49207
  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: [
49051
49208
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: badgeInfo.icon }),
49052
49209
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: badgeInfo.label })
@@ -49073,13 +49230,7 @@ function WidgetDashboard({
49073
49230
  w.type !== "spacer" && w.type !== "chatbot" && /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.Edit, { onClick: () => onClickSettings && onClickSettings(w), className: "w-5 h-5 text-gray-600" })
49074
49231
  ] })
49075
49232
  ] }),
49076
- /* @__PURE__ */ jsxRuntimeExports.jsxs("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: [
49077
- (w == null ? void 0 : w.type) === "chatbot" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative z-50", children: [
49078
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: () => handleClearChat(w == null ? void 0 : w.id), onMouseOver: () => setVisibleClearButton(w == null ? void 0 : w.id), onMouseLeave: () => setVisibleClearButton(""), className: "absolute top-[12px] right-0 z-40 flex align-middle justify-center gap-2 text-sm px-4 py-2 border-primary-300 rounded-l-sm w-fit bg-primary-700 text-white cursor-pointer shadow-md transition-all", children: /* @__PURE__ */ jsxRuntimeExports.jsx(lucideReact.MessageCircleX, { className: "w-5 h-5" }) }),
49079
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `absolute top-[56px] right-[16px] z-50 w-max py-1 text-xs px-2 rounded-sm text-white bg-gray-950 ${visibleClearButton === (w == null ? void 0 : w.id) ? "block" : "hidden"}`, children: "Clear Chat" })
49080
- ] }),
49081
- /* @__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) })
49082
- ] })
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 }) })
49083
49234
  ] }, w.id);
49084
49235
  })
49085
49236
  }
@@ -49374,7 +49525,7 @@ function PresentationMode({
49374
49525
  }
49375
49526
  )
49376
49527
  ] }),
49377
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 bg-white p-6 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49528
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 bg-white p-6 min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded-xl border-2 border-gray-300 bg-white shadow-[0_4px_12px_-2px_rgba(0,0,0,0.2)] overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49378
49529
  WidgetRenderer,
49379
49530
  {
49380
49531
  widget: currentFocusWidget,