@industry-theme/backlogmd-kanban-panel 1.0.33 → 1.0.35

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.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
3
3
  var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
4
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
4
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
5
5
  import * as React2 from "react";
6
6
  import React2__default, { useLayoutEffect, useEffect, useRef, useMemo, useCallback, useState, createContext, memo, useReducer, useContext, forwardRef, cloneElement, createElement, useImperativeHandle } from "react";
7
7
  import { unstable_batchedUpdates, createPortal } from "react-dom";
@@ -33,7 +33,7 @@ function isDocument(node2) {
33
33
  } = getWindow(node2);
34
34
  return node2 instanceof Document;
35
35
  }
36
- function isHTMLElement(node2) {
36
+ function isHTMLElement$1(node2) {
37
37
  if (isWindow(node2)) {
38
38
  return false;
39
39
  }
@@ -55,15 +55,15 @@ function getOwnerDocument(target) {
55
55
  if (isDocument(target)) {
56
56
  return target;
57
57
  }
58
- if (isHTMLElement(target) || isSVGElement(target)) {
58
+ if (isHTMLElement$1(target) || isSVGElement(target)) {
59
59
  return target.ownerDocument;
60
60
  }
61
61
  return document;
62
62
  }
63
- const useIsomorphicLayoutEffect$1 = canUseDOM ? useLayoutEffect : useEffect;
63
+ const useIsomorphicLayoutEffect$2 = canUseDOM ? useLayoutEffect : useEffect;
64
64
  function useEvent(handler) {
65
65
  const handlerRef = useRef(handler);
66
- useIsomorphicLayoutEffect$1(() => {
66
+ useIsomorphicLayoutEffect$2(() => {
67
67
  handlerRef.current = handler;
68
68
  });
69
69
  return useCallback(function() {
@@ -91,7 +91,7 @@ function useLatestValue(value, dependencies) {
91
91
  dependencies = [value];
92
92
  }
93
93
  const valueRef = useRef(value);
94
- useIsomorphicLayoutEffect$1(() => {
94
+ useIsomorphicLayoutEffect$2(() => {
95
95
  if (valueRef.current !== value) {
96
96
  valueRef.current = value;
97
97
  }
@@ -133,7 +133,7 @@ function usePrevious(value) {
133
133
  return ref.current;
134
134
  }
135
135
  let ids = {};
136
- function useUniqueId$1(prefix, value) {
136
+ function useUniqueId$2(prefix, value) {
137
137
  return useMemo(() => {
138
138
  if (value) {
139
139
  return value;
@@ -396,7 +396,7 @@ function Accessibility(_ref) {
396
396
  announce,
397
397
  announcement
398
398
  } = useAnnouncement();
399
- const liveRegionId = useUniqueId$1("DndLiveRegion");
399
+ const liveRegionId = useUniqueId$2("DndLiveRegion");
400
400
  const [mounted, setMounted] = useState(false);
401
401
  useEffect(() => {
402
402
  setMounted(true);
@@ -731,7 +731,7 @@ function getScrollableAncestors(element2, limit) {
731
731
  scrollParents.push(node2.scrollingElement);
732
732
  return scrollParents;
733
733
  }
734
- if (!isHTMLElement(node2) || isSVGElement(node2)) {
734
+ if (!isHTMLElement$1(node2) || isSVGElement(node2)) {
735
735
  return scrollParents;
736
736
  }
737
737
  if (scrollParents.includes(node2)) {
@@ -770,7 +770,7 @@ function getScrollableElement(element2) {
770
770
  if (isDocument(element2) || element2 === getOwnerDocument(element2).scrollingElement) {
771
771
  return window;
772
772
  }
773
- if (isHTMLElement(element2)) {
773
+ if (isHTMLElement$1(element2)) {
774
774
  return element2;
775
775
  }
776
776
  return null;
@@ -2015,7 +2015,7 @@ function useRect(element2, measure, fallbackRect) {
2015
2015
  const resizeObserver = useResizeObserver({
2016
2016
  callback: measureRect
2017
2017
  });
2018
- useIsomorphicLayoutEffect$1(() => {
2018
+ useIsomorphicLayoutEffect$2(() => {
2019
2019
  measureRect();
2020
2020
  if (element2) {
2021
2021
  resizeObserver == null ? void 0 : resizeObserver.observe(element2);
@@ -2189,7 +2189,7 @@ function useRects(elements, measure) {
2189
2189
  const resizeObserver = useResizeObserver({
2190
2190
  callback: measureRects
2191
2191
  });
2192
- useIsomorphicLayoutEffect$1(() => {
2192
+ useIsomorphicLayoutEffect$2(() => {
2193
2193
  resizeObserver == null ? void 0 : resizeObserver.disconnect();
2194
2194
  measureRects();
2195
2195
  elements.forEach((element2) => resizeObserver == null ? void 0 : resizeObserver.observe(element2));
@@ -2204,7 +2204,7 @@ function getMeasurableNode(node2) {
2204
2204
  return node2;
2205
2205
  }
2206
2206
  const firstChild = node2.children[0];
2207
- return isHTMLElement(firstChild) ? firstChild : node2;
2207
+ return isHTMLElement$1(firstChild) ? firstChild : node2;
2208
2208
  }
2209
2209
  function useDragOverlayMeasuring(_ref) {
2210
2210
  let {
@@ -2215,7 +2215,7 @@ function useDragOverlayMeasuring(_ref) {
2215
2215
  for (const {
2216
2216
  target
2217
2217
  } of entries) {
2218
- if (isHTMLElement(target)) {
2218
+ if (isHTMLElement$1(target)) {
2219
2219
  setRect((rect2) => {
2220
2220
  const newRect = measure(target);
2221
2221
  return rect2 ? {
@@ -2551,7 +2551,7 @@ function useLayoutShiftScrollCompensation(_ref) {
2551
2551
  x: config,
2552
2552
  y: config
2553
2553
  } : config;
2554
- useIsomorphicLayoutEffect$1(() => {
2554
+ useIsomorphicLayoutEffect$2(() => {
2555
2555
  const disabled = !x && !y;
2556
2556
  if (disabled || !activeNode) {
2557
2557
  initialized.current = false;
@@ -2641,7 +2641,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
2641
2641
  const [activeSensor, setActiveSensor] = useState(null);
2642
2642
  const [activatorEvent, setActivatorEvent] = useState(null);
2643
2643
  const latestProps = useLatestValue(props, Object.values(props));
2644
- const draggableDescribedById = useUniqueId$1("DndDescribedBy", id);
2644
+ const draggableDescribedById = useUniqueId$2("DndDescribedBy", id);
2645
2645
  const enabledDroppableContainers = useMemo(() => droppableContainers.getEnabled(), [droppableContainers]);
2646
2646
  const measuringConfiguration = useMeasuringConfiguration(measuring);
2647
2647
  const {
@@ -2912,7 +2912,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
2912
2912
  }, [draggableNodes, instantiateSensor]);
2913
2913
  const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
2914
2914
  useSensorSetup(sensors);
2915
- useIsomorphicLayoutEffect$1(() => {
2915
+ useIsomorphicLayoutEffect$2(() => {
2916
2916
  if (activeNodeRect && status === Status.Initializing) {
2917
2917
  setStatus(Status.Initialized);
2918
2918
  }
@@ -2996,7 +2996,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
2996
2996
  // eslint-disable-next-line react-hooks/exhaustive-deps
2997
2997
  [overId]
2998
2998
  );
2999
- useIsomorphicLayoutEffect$1(() => {
2999
+ useIsomorphicLayoutEffect$2(() => {
3000
3000
  sensorContext.current = {
3001
3001
  activatorEvent,
3002
3002
  active,
@@ -3102,7 +3102,7 @@ function useDraggable(_ref) {
3102
3102
  disabled = false,
3103
3103
  attributes
3104
3104
  } = _ref;
3105
- const key2 = useUniqueId$1(ID_PREFIX);
3105
+ const key2 = useUniqueId$2(ID_PREFIX);
3106
3106
  const {
3107
3107
  activators,
3108
3108
  activatorEvent,
@@ -3123,7 +3123,7 @@ function useDraggable(_ref) {
3123
3123
  const [activatorNode, setActivatorNodeRef] = useNodeRef();
3124
3124
  const listeners = useSyntheticListeners(activators, id);
3125
3125
  const dataRef = useLatestValue(data);
3126
- useIsomorphicLayoutEffect$1(
3126
+ useIsomorphicLayoutEffect$2(
3127
3127
  () => {
3128
3128
  draggableNodes.set(id, {
3129
3129
  id,
@@ -3178,7 +3178,7 @@ function useDroppable(_ref) {
3178
3178
  id,
3179
3179
  resizeObserverConfig
3180
3180
  } = _ref;
3181
- const key2 = useUniqueId$1(ID_PREFIX$1);
3181
+ const key2 = useUniqueId$2(ID_PREFIX$1);
3182
3182
  const {
3183
3183
  active,
3184
3184
  dispatch,
@@ -3296,7 +3296,7 @@ function AnimationManager(_ref) {
3296
3296
  if (!children2 && !clonedChildren && previousChildren) {
3297
3297
  setClonedChildren(previousChildren);
3298
3298
  }
3299
- useIsomorphicLayoutEffect$1(() => {
3299
+ useIsomorphicLayoutEffect$2(() => {
3300
3300
  if (!element2) {
3301
3301
  return;
3302
3302
  }
@@ -3635,382 +3635,2471 @@ const DragOverlay = /* @__PURE__ */ React2__default.memo((_ref) => {
3635
3635
  transform: modifiedTransform
3636
3636
  }, children2) : null));
3637
3637
  });
3638
- /**
3639
- * @license lucide-react v0.552.0 - ISC
3640
- *
3641
- * This source code is licensed under the ISC license.
3642
- * See the LICENSE file in the root directory of this source tree.
3643
- */
3644
- const toKebabCase = (string2) => string2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3645
- const toCamelCase = (string2) => string2.replace(
3646
- /^([A-Z])|[\s-_]+(\w)/g,
3647
- (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
3648
- );
3649
- const toPascalCase = (string2) => {
3650
- const camelCase = toCamelCase(string2);
3651
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
3652
- };
3653
- const mergeClasses = (...classes) => classes.filter((className, index2, array) => {
3654
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
3655
- }).join(" ").trim();
3656
- const hasA11yProp = (props) => {
3657
- for (const prop in props) {
3658
- if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
3659
- return true;
3638
+ /**
3639
+ * @license lucide-react v0.552.0 - ISC
3640
+ *
3641
+ * This source code is licensed under the ISC license.
3642
+ * See the LICENSE file in the root directory of this source tree.
3643
+ */
3644
+ const toKebabCase = (string2) => string2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3645
+ const toCamelCase = (string2) => string2.replace(
3646
+ /^([A-Z])|[\s-_]+(\w)/g,
3647
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
3648
+ );
3649
+ const toPascalCase = (string2) => {
3650
+ const camelCase = toCamelCase(string2);
3651
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
3652
+ };
3653
+ const mergeClasses = (...classes) => classes.filter((className, index2, array) => {
3654
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
3655
+ }).join(" ").trim();
3656
+ const hasA11yProp = (props) => {
3657
+ for (const prop in props) {
3658
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
3659
+ return true;
3660
+ }
3661
+ }
3662
+ };
3663
+ /**
3664
+ * @license lucide-react v0.552.0 - ISC
3665
+ *
3666
+ * This source code is licensed under the ISC license.
3667
+ * See the LICENSE file in the root directory of this source tree.
3668
+ */
3669
+ var defaultAttributes = {
3670
+ xmlns: "http://www.w3.org/2000/svg",
3671
+ width: 24,
3672
+ height: 24,
3673
+ viewBox: "0 0 24 24",
3674
+ fill: "none",
3675
+ stroke: "currentColor",
3676
+ strokeWidth: 2,
3677
+ strokeLinecap: "round",
3678
+ strokeLinejoin: "round"
3679
+ };
3680
+ /**
3681
+ * @license lucide-react v0.552.0 - ISC
3682
+ *
3683
+ * This source code is licensed under the ISC license.
3684
+ * See the LICENSE file in the root directory of this source tree.
3685
+ */
3686
+ const Icon = forwardRef(
3687
+ ({
3688
+ color: color2 = "currentColor",
3689
+ size = 24,
3690
+ strokeWidth = 2,
3691
+ absoluteStrokeWidth,
3692
+ className = "",
3693
+ children: children2,
3694
+ iconNode,
3695
+ ...rest
3696
+ }, ref) => createElement(
3697
+ "svg",
3698
+ {
3699
+ ref,
3700
+ ...defaultAttributes,
3701
+ width: size,
3702
+ height: size,
3703
+ stroke: color2,
3704
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
3705
+ className: mergeClasses("lucide", className),
3706
+ ...!children2 && !hasA11yProp(rest) && { "aria-hidden": "true" },
3707
+ ...rest
3708
+ },
3709
+ [
3710
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
3711
+ ...Array.isArray(children2) ? children2 : [children2]
3712
+ ]
3713
+ )
3714
+ );
3715
+ /**
3716
+ * @license lucide-react v0.552.0 - ISC
3717
+ *
3718
+ * This source code is licensed under the ISC license.
3719
+ * See the LICENSE file in the root directory of this source tree.
3720
+ */
3721
+ const createLucideIcon = (iconName, iconNode) => {
3722
+ const Component = forwardRef(
3723
+ ({ className, ...props }, ref) => createElement(Icon, {
3724
+ ref,
3725
+ iconNode,
3726
+ className: mergeClasses(
3727
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
3728
+ `lucide-${iconName}`,
3729
+ className
3730
+ ),
3731
+ ...props
3732
+ })
3733
+ );
3734
+ Component.displayName = toPascalCase(iconName);
3735
+ return Component;
3736
+ };
3737
+ /**
3738
+ * @license lucide-react v0.552.0 - ISC
3739
+ *
3740
+ * This source code is licensed under the ISC license.
3741
+ * See the LICENSE file in the root directory of this source tree.
3742
+ */
3743
+ const __iconNode$l = [
3744
+ ["path", { d: "M12 8V4H8", key: "hb8ula" }],
3745
+ ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
3746
+ ["path", { d: "M2 14h2", key: "vft8re" }],
3747
+ ["path", { d: "M20 14h2", key: "4cs60a" }],
3748
+ ["path", { d: "M15 13v2", key: "1xurst" }],
3749
+ ["path", { d: "M9 13v2", key: "rq6x2g" }]
3750
+ ];
3751
+ const Bot = createLucideIcon("bot", __iconNode$l);
3752
+ /**
3753
+ * @license lucide-react v0.552.0 - ISC
3754
+ *
3755
+ * This source code is licensed under the ISC license.
3756
+ * See the LICENSE file in the root directory of this source tree.
3757
+ */
3758
+ const __iconNode$k = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
3759
+ const Check = createLucideIcon("check", __iconNode$k);
3760
+ /**
3761
+ * @license lucide-react v0.552.0 - ISC
3762
+ *
3763
+ * This source code is licensed under the ISC license.
3764
+ * See the LICENSE file in the root directory of this source tree.
3765
+ */
3766
+ const __iconNode$j = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
3767
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$j);
3768
+ /**
3769
+ * @license lucide-react v0.552.0 - ISC
3770
+ *
3771
+ * This source code is licensed under the ISC license.
3772
+ * See the LICENSE file in the root directory of this source tree.
3773
+ */
3774
+ const __iconNode$i = [
3775
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
3776
+ ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
3777
+ ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
3778
+ ];
3779
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$i);
3780
+ /**
3781
+ * @license lucide-react v0.552.0 - ISC
3782
+ *
3783
+ * This source code is licensed under the ISC license.
3784
+ * See the LICENSE file in the root directory of this source tree.
3785
+ */
3786
+ const __iconNode$h = [
3787
+ ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
3788
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
3789
+ ];
3790
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$h);
3791
+ /**
3792
+ * @license lucide-react v0.552.0 - ISC
3793
+ *
3794
+ * This source code is licensed under the ISC license.
3795
+ * See the LICENSE file in the root directory of this source tree.
3796
+ */
3797
+ const __iconNode$g = [
3798
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
3799
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
3800
+ ];
3801
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$g);
3802
+ /**
3803
+ * @license lucide-react v0.552.0 - ISC
3804
+ *
3805
+ * This source code is licensed under the ISC license.
3806
+ * See the LICENSE file in the root directory of this source tree.
3807
+ */
3808
+ const __iconNode$f = [
3809
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
3810
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
3811
+ ];
3812
+ const Copy = createLucideIcon("copy", __iconNode$f);
3813
+ /**
3814
+ * @license lucide-react v0.552.0 - ISC
3815
+ *
3816
+ * This source code is licensed under the ISC license.
3817
+ * See the LICENSE file in the root directory of this source tree.
3818
+ */
3819
+ const __iconNode$e = [
3820
+ ["path", { d: "m15 15 6 6", key: "1s409w" }],
3821
+ ["path", { d: "m15 9 6-6", key: "ko1vev" }],
3822
+ ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
3823
+ ["path", { d: "M21 8V3h-5", key: "1qoq8a" }],
3824
+ ["path", { d: "M3 16v5h5", key: "1t08am" }],
3825
+ ["path", { d: "m3 21 6-6", key: "wwnumi" }],
3826
+ ["path", { d: "M3 8V3h5", key: "1ln10m" }],
3827
+ ["path", { d: "M9 9 3 3", key: "v551iv" }]
3828
+ ];
3829
+ const Expand = createLucideIcon("expand", __iconNode$e);
3830
+ /**
3831
+ * @license lucide-react v0.552.0 - ISC
3832
+ *
3833
+ * This source code is licensed under the ISC license.
3834
+ * See the LICENSE file in the root directory of this source tree.
3835
+ */
3836
+ const __iconNode$d = [
3837
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
3838
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
3839
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
3840
+ ];
3841
+ const ExternalLink = createLucideIcon("external-link", __iconNode$d);
3842
+ /**
3843
+ * @license lucide-react v0.552.0 - ISC
3844
+ *
3845
+ * This source code is licensed under the ISC license.
3846
+ * See the LICENSE file in the root directory of this source tree.
3847
+ */
3848
+ const __iconNode$c = [
3849
+ [
3850
+ "path",
3851
+ {
3852
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
3853
+ key: "1oefj6"
3854
+ }
3855
+ ],
3856
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
3857
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
3858
+ ["path", { d: "M16 13H8", key: "t4e002" }],
3859
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
3860
+ ];
3861
+ const FileText = createLucideIcon("file-text", __iconNode$c);
3862
+ /**
3863
+ * @license lucide-react v0.552.0 - ISC
3864
+ *
3865
+ * This source code is licensed under the ISC license.
3866
+ * See the LICENSE file in the root directory of this source tree.
3867
+ */
3868
+ const __iconNode$b = [
3869
+ ["path", { d: "M12 10v6", key: "1bos4e" }],
3870
+ ["path", { d: "M9 13h6", key: "1uhe8q" }],
3871
+ [
3872
+ "path",
3873
+ {
3874
+ d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
3875
+ key: "1kt360"
3876
+ }
3877
+ ]
3878
+ ];
3879
+ const FolderPlus = createLucideIcon("folder-plus", __iconNode$b);
3880
+ /**
3881
+ * @license lucide-react v0.552.0 - ISC
3882
+ *
3883
+ * This source code is licensed under the ISC license.
3884
+ * See the LICENSE file in the root directory of this source tree.
3885
+ */
3886
+ const __iconNode$a = [
3887
+ ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
3888
+ ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
3889
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
3890
+ ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
3891
+ ];
3892
+ const GitBranch = createLucideIcon("git-branch", __iconNode$a);
3893
+ /**
3894
+ * @license lucide-react v0.552.0 - ISC
3895
+ *
3896
+ * This source code is licensed under the ISC license.
3897
+ * See the LICENSE file in the root directory of this source tree.
3898
+ */
3899
+ const __iconNode$9 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
3900
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$9);
3901
+ /**
3902
+ * @license lucide-react v0.552.0 - ISC
3903
+ *
3904
+ * This source code is licensed under the ISC license.
3905
+ * See the LICENSE file in the root directory of this source tree.
3906
+ */
3907
+ const __iconNode$8 = [
3908
+ ["path", { d: "M12 13v8", key: "1l5pq0" }],
3909
+ ["path", { d: "M12 3v3", key: "1n5kay" }],
3910
+ [
3911
+ "path",
3912
+ {
3913
+ d: "M4 6a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h13a2 2 0 0 0 1.152-.365l3.424-2.317a1 1 0 0 0 0-1.635l-3.424-2.318A2 2 0 0 0 17 6z",
3914
+ key: "1btarq"
3915
+ }
3916
+ ]
3917
+ ];
3918
+ const Milestone = createLucideIcon("milestone", __iconNode$8);
3919
+ /**
3920
+ * @license lucide-react v0.552.0 - ISC
3921
+ *
3922
+ * This source code is licensed under the ISC license.
3923
+ * See the LICENSE file in the root directory of this source tree.
3924
+ */
3925
+ const __iconNode$7 = [
3926
+ ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
3927
+ ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
3928
+ ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
3929
+ ];
3930
+ const Monitor = createLucideIcon("monitor", __iconNode$7);
3931
+ /**
3932
+ * @license lucide-react v0.552.0 - ISC
3933
+ *
3934
+ * This source code is licensed under the ISC license.
3935
+ * See the LICENSE file in the root directory of this source tree.
3936
+ */
3937
+ const __iconNode$6 = [
3938
+ ["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
3939
+ ["path", { d: "M2 12H22", key: "1m8cig" }]
3940
+ ];
3941
+ const MoveRight = createLucideIcon("move-right", __iconNode$6);
3942
+ /**
3943
+ * @license lucide-react v0.552.0 - ISC
3944
+ *
3945
+ * This source code is licensed under the ISC license.
3946
+ * See the LICENSE file in the root directory of this source tree.
3947
+ */
3948
+ const __iconNode$5 = [
3949
+ [
3950
+ "path",
3951
+ {
3952
+ d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
3953
+ key: "10ikf1"
3954
+ }
3955
+ ]
3956
+ ];
3957
+ const Play = createLucideIcon("play", __iconNode$5);
3958
+ /**
3959
+ * @license lucide-react v0.552.0 - ISC
3960
+ *
3961
+ * This source code is licensed under the ISC license.
3962
+ * See the LICENSE file in the root directory of this source tree.
3963
+ */
3964
+ const __iconNode$4 = [
3965
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
3966
+ ["path", { d: "M12 5v14", key: "s699le" }]
3967
+ ];
3968
+ const Plus = createLucideIcon("plus", __iconNode$4);
3969
+ /**
3970
+ * @license lucide-react v0.552.0 - ISC
3971
+ *
3972
+ * This source code is licensed under the ISC license.
3973
+ * See the LICENSE file in the root directory of this source tree.
3974
+ */
3975
+ const __iconNode$3 = [
3976
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
3977
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
3978
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
3979
+ ["path", { d: "M8 16H3v5", key: "1cv678" }]
3980
+ ];
3981
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$3);
3982
+ /**
3983
+ * @license lucide-react v0.552.0 - ISC
3984
+ *
3985
+ * This source code is licensed under the ISC license.
3986
+ * See the LICENSE file in the root directory of this source tree.
3987
+ */
3988
+ const __iconNode$2 = [
3989
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
3990
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
3991
+ ];
3992
+ const Search = createLucideIcon("search", __iconNode$2);
3993
+ /**
3994
+ * @license lucide-react v0.552.0 - ISC
3995
+ *
3996
+ * This source code is licensed under the ISC license.
3997
+ * See the LICENSE file in the root directory of this source tree.
3998
+ */
3999
+ const __iconNode$1 = [
4000
+ ["path", { d: "M10 11v6", key: "nco0om" }],
4001
+ ["path", { d: "M14 11v6", key: "outv1u" }],
4002
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
4003
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
4004
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
4005
+ ];
4006
+ const Trash2 = createLucideIcon("trash-2", __iconNode$1);
4007
+ /**
4008
+ * @license lucide-react v0.552.0 - ISC
4009
+ *
4010
+ * This source code is licensed under the ISC license.
4011
+ * See the LICENSE file in the root directory of this source tree.
4012
+ */
4013
+ const __iconNode = [
4014
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
4015
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
4016
+ ];
4017
+ const X = createLucideIcon("x", __iconNode);
4018
+ var ThemeContext$1;
4019
+ var getThemeContext$1 = () => {
4020
+ if (typeof window !== "undefined") {
4021
+ const globalWindow = window;
4022
+ if (!globalWindow.__principlemd_theme_context__) {
4023
+ globalWindow.__principlemd_theme_context__ = createContext(void 0);
4024
+ }
4025
+ return globalWindow.__principlemd_theme_context__;
4026
+ } else {
4027
+ if (!ThemeContext$1) {
4028
+ ThemeContext$1 = createContext(void 0);
4029
+ }
4030
+ return ThemeContext$1;
4031
+ }
4032
+ };
4033
+ var ThemeContextSingleton = getThemeContext$1();
4034
+ var useTheme = () => {
4035
+ const context = useContext(ThemeContextSingleton);
4036
+ if (!context) {
4037
+ throw new Error("useTheme must be used within a ThemeProvider");
4038
+ }
4039
+ return context;
4040
+ };
4041
+ const PanelGroupContext$1 = createContext(null);
4042
+ PanelGroupContext$1.displayName = "PanelGroupContext";
4043
+ const DATA_ATTRIBUTES$1 = {
4044
+ group: "data-panel-group",
4045
+ groupDirection: "data-panel-group-direction",
4046
+ groupId: "data-panel-group-id",
4047
+ panel: "data-panel",
4048
+ panelCollapsible: "data-panel-collapsible",
4049
+ panelId: "data-panel-id",
4050
+ panelSize: "data-panel-size",
4051
+ resizeHandleId: "data-panel-resize-handle-id"
4052
+ };
4053
+ const PRECISION$1 = 10;
4054
+ const useIsomorphicLayoutEffect$1 = useLayoutEffect;
4055
+ const useId$1 = React2["useId".toString()];
4056
+ const wrappedUseId$1 = typeof useId$1 === "function" ? useId$1 : () => null;
4057
+ let counter$1 = 0;
4058
+ function useUniqueId$1(idFromParams = null) {
4059
+ const idFromUseId = wrappedUseId$1();
4060
+ const idRef = useRef(idFromParams || idFromUseId || null);
4061
+ if (idRef.current === null) {
4062
+ idRef.current = "" + counter$1++;
4063
+ }
4064
+ return idFromParams !== null && idFromParams !== void 0 ? idFromParams : idRef.current;
4065
+ }
4066
+ function PanelWithForwardedRef$1({
4067
+ children: children2,
4068
+ className: classNameFromProps = "",
4069
+ collapsedSize,
4070
+ collapsible,
4071
+ defaultSize,
4072
+ forwardedRef,
4073
+ id: idFromProps,
4074
+ maxSize,
4075
+ minSize,
4076
+ onCollapse,
4077
+ onExpand,
4078
+ onResize,
4079
+ order: order2,
4080
+ style: styleFromProps,
4081
+ tagName: Type = "div",
4082
+ ...rest
4083
+ }) {
4084
+ const context = useContext(PanelGroupContext$1);
4085
+ if (context === null) {
4086
+ throw Error(`Panel components must be rendered within a PanelGroup container`);
4087
+ }
4088
+ const {
4089
+ collapsePanel,
4090
+ expandPanel,
4091
+ getPanelSize,
4092
+ getPanelStyle,
4093
+ groupId,
4094
+ isPanelCollapsed,
4095
+ reevaluatePanelConstraints,
4096
+ registerPanel,
4097
+ resizePanel: resizePanel2,
4098
+ unregisterPanel
4099
+ } = context;
4100
+ const panelId = useUniqueId$1(idFromProps);
4101
+ const panelDataRef = useRef({
4102
+ callbacks: {
4103
+ onCollapse,
4104
+ onExpand,
4105
+ onResize
4106
+ },
4107
+ constraints: {
4108
+ collapsedSize,
4109
+ collapsible,
4110
+ defaultSize,
4111
+ maxSize,
4112
+ minSize
4113
+ },
4114
+ id: panelId,
4115
+ idIsFromProps: idFromProps !== void 0,
4116
+ order: order2
4117
+ });
4118
+ useRef({
4119
+ didLogMissingDefaultSizeWarning: false
4120
+ });
4121
+ useIsomorphicLayoutEffect$1(() => {
4122
+ const {
4123
+ callbacks,
4124
+ constraints
4125
+ } = panelDataRef.current;
4126
+ const prevConstraints = {
4127
+ ...constraints
4128
+ };
4129
+ panelDataRef.current.id = panelId;
4130
+ panelDataRef.current.idIsFromProps = idFromProps !== void 0;
4131
+ panelDataRef.current.order = order2;
4132
+ callbacks.onCollapse = onCollapse;
4133
+ callbacks.onExpand = onExpand;
4134
+ callbacks.onResize = onResize;
4135
+ constraints.collapsedSize = collapsedSize;
4136
+ constraints.collapsible = collapsible;
4137
+ constraints.defaultSize = defaultSize;
4138
+ constraints.maxSize = maxSize;
4139
+ constraints.minSize = minSize;
4140
+ if (prevConstraints.collapsedSize !== constraints.collapsedSize || prevConstraints.collapsible !== constraints.collapsible || prevConstraints.maxSize !== constraints.maxSize || prevConstraints.minSize !== constraints.minSize) {
4141
+ reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
4142
+ }
4143
+ });
4144
+ useIsomorphicLayoutEffect$1(() => {
4145
+ const panelData = panelDataRef.current;
4146
+ registerPanel(panelData);
4147
+ return () => {
4148
+ unregisterPanel(panelData);
4149
+ };
4150
+ }, [order2, panelId, registerPanel, unregisterPanel]);
4151
+ useImperativeHandle(forwardedRef, () => ({
4152
+ collapse: () => {
4153
+ collapsePanel(panelDataRef.current);
4154
+ },
4155
+ expand: (minSize2) => {
4156
+ expandPanel(panelDataRef.current, minSize2);
4157
+ },
4158
+ getId() {
4159
+ return panelId;
4160
+ },
4161
+ getSize() {
4162
+ return getPanelSize(panelDataRef.current);
4163
+ },
4164
+ isCollapsed() {
4165
+ return isPanelCollapsed(panelDataRef.current);
4166
+ },
4167
+ isExpanded() {
4168
+ return !isPanelCollapsed(panelDataRef.current);
4169
+ },
4170
+ resize: (size) => {
4171
+ resizePanel2(panelDataRef.current, size);
4172
+ }
4173
+ }), [collapsePanel, expandPanel, getPanelSize, isPanelCollapsed, panelId, resizePanel2]);
4174
+ const style2 = getPanelStyle(panelDataRef.current, defaultSize);
4175
+ return createElement(Type, {
4176
+ ...rest,
4177
+ children: children2,
4178
+ className: classNameFromProps,
4179
+ id: panelId,
4180
+ style: {
4181
+ ...style2,
4182
+ ...styleFromProps
4183
+ },
4184
+ // CSS selectors
4185
+ [DATA_ATTRIBUTES$1.groupId]: groupId,
4186
+ [DATA_ATTRIBUTES$1.panel]: "",
4187
+ [DATA_ATTRIBUTES$1.panelCollapsible]: collapsible || void 0,
4188
+ [DATA_ATTRIBUTES$1.panelId]: panelId,
4189
+ [DATA_ATTRIBUTES$1.panelSize]: parseFloat("" + style2.flexGrow).toFixed(1)
4190
+ });
4191
+ }
4192
+ const Panel$1 = forwardRef((props, ref) => createElement(PanelWithForwardedRef$1, {
4193
+ ...props,
4194
+ forwardedRef: ref
4195
+ }));
4196
+ PanelWithForwardedRef$1.displayName = "Panel";
4197
+ Panel$1.displayName = "forwardRef(Panel)";
4198
+ function isKeyDown$1(event) {
4199
+ return event.type === "keydown";
4200
+ }
4201
+ function isPointerEvent$1(event) {
4202
+ return event.type.startsWith("pointer");
4203
+ }
4204
+ function isMouseEvent$1(event) {
4205
+ return event.type.startsWith("mouse");
4206
+ }
4207
+ function getResizeEventCoordinates$1(event) {
4208
+ if (isPointerEvent$1(event)) {
4209
+ if (event.isPrimary) {
4210
+ return {
4211
+ x: event.clientX,
4212
+ y: event.clientY
4213
+ };
4214
+ }
4215
+ } else if (isMouseEvent$1(event)) {
4216
+ return {
4217
+ x: event.clientX,
4218
+ y: event.clientY
4219
+ };
4220
+ }
4221
+ return {
4222
+ x: Infinity,
4223
+ y: Infinity
4224
+ };
4225
+ }
4226
+ function getInputType$1() {
4227
+ if (typeof matchMedia === "function") {
4228
+ return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
4229
+ }
4230
+ }
4231
+ const EXCEEDED_HORIZONTAL_MIN$1 = 1;
4232
+ const EXCEEDED_HORIZONTAL_MAX$1 = 2;
4233
+ const EXCEEDED_VERTICAL_MIN$1 = 4;
4234
+ const EXCEEDED_VERTICAL_MAX$1 = 8;
4235
+ getInputType$1() === "coarse";
4236
+ let panelConstraintFlags$1 = /* @__PURE__ */ new Map();
4237
+ function reportConstraintsViolation$1(resizeHandleId, flag) {
4238
+ panelConstraintFlags$1.set(resizeHandleId, flag);
4239
+ }
4240
+ function useForceUpdate$1() {
4241
+ const [_, setCount] = useState(0);
4242
+ return useCallback(() => setCount((prevCount) => prevCount + 1), []);
4243
+ }
4244
+ function assert$1(expectedCondition, message) {
4245
+ if (!expectedCondition) {
4246
+ console.error(message);
4247
+ throw Error(message);
4248
+ }
4249
+ }
4250
+ function fuzzyCompareNumbers$1(actual, expected, fractionDigits = PRECISION$1) {
4251
+ if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) {
4252
+ return 0;
4253
+ } else {
4254
+ return actual > expected ? 1 : -1;
4255
+ }
4256
+ }
4257
+ function fuzzyNumbersEqual$1$1(actual, expected, fractionDigits = PRECISION$1) {
4258
+ return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
4259
+ }
4260
+ function fuzzyNumbersEqual$2(actual, expected, fractionDigits) {
4261
+ return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
4262
+ }
4263
+ function fuzzyLayoutsEqual$1(actual, expected, fractionDigits) {
4264
+ if (actual.length !== expected.length) {
4265
+ return false;
4266
+ }
4267
+ for (let index2 = 0; index2 < actual.length; index2++) {
4268
+ const actualSize = actual[index2];
4269
+ const expectedSize = expected[index2];
4270
+ if (!fuzzyNumbersEqual$2(actualSize, expectedSize, fractionDigits)) {
4271
+ return false;
4272
+ }
4273
+ }
4274
+ return true;
4275
+ }
4276
+ function resizePanel$1({
4277
+ panelConstraints: panelConstraintsArray,
4278
+ panelIndex,
4279
+ size
4280
+ }) {
4281
+ const panelConstraints = panelConstraintsArray[panelIndex];
4282
+ assert$1(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
4283
+ let {
4284
+ collapsedSize = 0,
4285
+ collapsible,
4286
+ maxSize = 100,
4287
+ minSize = 0
4288
+ } = panelConstraints;
4289
+ if (fuzzyCompareNumbers$1(size, minSize) < 0) {
4290
+ if (collapsible) {
4291
+ const halfwayPoint = (collapsedSize + minSize) / 2;
4292
+ if (fuzzyCompareNumbers$1(size, halfwayPoint) < 0) {
4293
+ size = collapsedSize;
4294
+ } else {
4295
+ size = minSize;
4296
+ }
4297
+ } else {
4298
+ size = minSize;
4299
+ }
4300
+ }
4301
+ size = Math.min(maxSize, size);
4302
+ size = parseFloat(size.toFixed(PRECISION$1));
4303
+ return size;
4304
+ }
4305
+ function adjustLayoutByDelta$1({
4306
+ delta,
4307
+ initialLayout,
4308
+ panelConstraints: panelConstraintsArray,
4309
+ pivotIndices,
4310
+ prevLayout,
4311
+ trigger
4312
+ }) {
4313
+ if (fuzzyNumbersEqual$2(delta, 0)) {
4314
+ return initialLayout;
4315
+ }
4316
+ const nextLayout = [...initialLayout];
4317
+ const [firstPivotIndex, secondPivotIndex] = pivotIndices;
4318
+ assert$1(firstPivotIndex != null, "Invalid first pivot index");
4319
+ assert$1(secondPivotIndex != null, "Invalid second pivot index");
4320
+ let deltaApplied = 0;
4321
+ {
4322
+ if (trigger === "keyboard") {
4323
+ {
4324
+ const index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
4325
+ const panelConstraints = panelConstraintsArray[index2];
4326
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
4327
+ const {
4328
+ collapsedSize = 0,
4329
+ collapsible,
4330
+ minSize = 0
4331
+ } = panelConstraints;
4332
+ if (collapsible) {
4333
+ const prevSize = initialLayout[index2];
4334
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4335
+ if (fuzzyNumbersEqual$2(prevSize, collapsedSize)) {
4336
+ const localDelta = minSize - prevSize;
4337
+ if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
4338
+ delta = delta < 0 ? 0 - localDelta : localDelta;
4339
+ }
4340
+ }
4341
+ }
4342
+ }
4343
+ {
4344
+ const index2 = delta < 0 ? firstPivotIndex : secondPivotIndex;
4345
+ const panelConstraints = panelConstraintsArray[index2];
4346
+ assert$1(panelConstraints, `No panel constraints found for index ${index2}`);
4347
+ const {
4348
+ collapsedSize = 0,
4349
+ collapsible,
4350
+ minSize = 0
4351
+ } = panelConstraints;
4352
+ if (collapsible) {
4353
+ const prevSize = initialLayout[index2];
4354
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4355
+ if (fuzzyNumbersEqual$2(prevSize, minSize)) {
4356
+ const localDelta = prevSize - collapsedSize;
4357
+ if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
4358
+ delta = delta < 0 ? 0 - localDelta : localDelta;
4359
+ }
4360
+ }
4361
+ }
4362
+ }
4363
+ }
4364
+ }
4365
+ {
4366
+ const increment2 = delta < 0 ? 1 : -1;
4367
+ let index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
4368
+ let maxAvailableDelta = 0;
4369
+ while (true) {
4370
+ const prevSize = initialLayout[index2];
4371
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4372
+ const maxSafeSize = resizePanel$1({
4373
+ panelConstraints: panelConstraintsArray,
4374
+ panelIndex: index2,
4375
+ size: 100
4376
+ });
4377
+ const delta2 = maxSafeSize - prevSize;
4378
+ maxAvailableDelta += delta2;
4379
+ index2 += increment2;
4380
+ if (index2 < 0 || index2 >= panelConstraintsArray.length) {
4381
+ break;
4382
+ }
4383
+ }
4384
+ const minAbsDelta = Math.min(Math.abs(delta), Math.abs(maxAvailableDelta));
4385
+ delta = delta < 0 ? 0 - minAbsDelta : minAbsDelta;
4386
+ }
4387
+ {
4388
+ const pivotIndex = delta < 0 ? firstPivotIndex : secondPivotIndex;
4389
+ let index2 = pivotIndex;
4390
+ while (index2 >= 0 && index2 < panelConstraintsArray.length) {
4391
+ const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
4392
+ const prevSize = initialLayout[index2];
4393
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4394
+ const unsafeSize = prevSize - deltaRemaining;
4395
+ const safeSize = resizePanel$1({
4396
+ panelConstraints: panelConstraintsArray,
4397
+ panelIndex: index2,
4398
+ size: unsafeSize
4399
+ });
4400
+ if (!fuzzyNumbersEqual$2(prevSize, safeSize)) {
4401
+ deltaApplied += prevSize - safeSize;
4402
+ nextLayout[index2] = safeSize;
4403
+ if (deltaApplied.toFixed(3).localeCompare(Math.abs(delta).toFixed(3), void 0, {
4404
+ numeric: true
4405
+ }) >= 0) {
4406
+ break;
4407
+ }
4408
+ }
4409
+ if (delta < 0) {
4410
+ index2--;
4411
+ } else {
4412
+ index2++;
4413
+ }
4414
+ }
4415
+ }
4416
+ if (fuzzyLayoutsEqual$1(prevLayout, nextLayout)) {
4417
+ return prevLayout;
4418
+ }
4419
+ {
4420
+ const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
4421
+ const prevSize = initialLayout[pivotIndex];
4422
+ assert$1(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
4423
+ const unsafeSize = prevSize + deltaApplied;
4424
+ const safeSize = resizePanel$1({
4425
+ panelConstraints: panelConstraintsArray,
4426
+ panelIndex: pivotIndex,
4427
+ size: unsafeSize
4428
+ });
4429
+ nextLayout[pivotIndex] = safeSize;
4430
+ if (!fuzzyNumbersEqual$2(safeSize, unsafeSize)) {
4431
+ let deltaRemaining = unsafeSize - safeSize;
4432
+ const pivotIndex2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
4433
+ let index2 = pivotIndex2;
4434
+ while (index2 >= 0 && index2 < panelConstraintsArray.length) {
4435
+ const prevSize2 = nextLayout[index2];
4436
+ assert$1(prevSize2 != null, `Previous layout not found for panel index ${index2}`);
4437
+ const unsafeSize2 = prevSize2 + deltaRemaining;
4438
+ const safeSize2 = resizePanel$1({
4439
+ panelConstraints: panelConstraintsArray,
4440
+ panelIndex: index2,
4441
+ size: unsafeSize2
4442
+ });
4443
+ if (!fuzzyNumbersEqual$2(prevSize2, safeSize2)) {
4444
+ deltaRemaining -= safeSize2 - prevSize2;
4445
+ nextLayout[index2] = safeSize2;
4446
+ }
4447
+ if (fuzzyNumbersEqual$2(deltaRemaining, 0)) {
4448
+ break;
4449
+ }
4450
+ if (delta > 0) {
4451
+ index2--;
4452
+ } else {
4453
+ index2++;
4454
+ }
4455
+ }
4456
+ }
4457
+ }
4458
+ const totalSize = nextLayout.reduce((total, size) => size + total, 0);
4459
+ if (!fuzzyNumbersEqual$2(totalSize, 100)) {
4460
+ return prevLayout;
4461
+ }
4462
+ return nextLayout;
4463
+ }
4464
+ function calculateAriaValues$1({
4465
+ layout,
4466
+ panelsArray,
4467
+ pivotIndices
4468
+ }) {
4469
+ let currentMinSize = 0;
4470
+ let currentMaxSize = 100;
4471
+ let totalMinSize = 0;
4472
+ let totalMaxSize = 0;
4473
+ const firstIndex = pivotIndices[0];
4474
+ assert$1(firstIndex != null, "No pivot index found");
4475
+ panelsArray.forEach((panelData, index2) => {
4476
+ const {
4477
+ constraints
4478
+ } = panelData;
4479
+ const {
4480
+ maxSize = 100,
4481
+ minSize = 0
4482
+ } = constraints;
4483
+ if (index2 === firstIndex) {
4484
+ currentMinSize = minSize;
4485
+ currentMaxSize = maxSize;
4486
+ } else {
4487
+ totalMinSize += minSize;
4488
+ totalMaxSize += maxSize;
4489
+ }
4490
+ });
4491
+ const valueMax = Math.min(currentMaxSize, 100 - totalMinSize);
4492
+ const valueMin = Math.max(currentMinSize, 100 - totalMaxSize);
4493
+ const valueNow = layout[firstIndex];
4494
+ return {
4495
+ valueMax,
4496
+ valueMin,
4497
+ valueNow
4498
+ };
4499
+ }
4500
+ function getResizeHandleElementsForGroup$1(groupId, scope = document) {
4501
+ return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES$1.resizeHandleId}][data-panel-group-id="${groupId}"]`));
4502
+ }
4503
+ function getResizeHandleElementIndex$1(groupId, id, scope = document) {
4504
+ const handles = getResizeHandleElementsForGroup$1(groupId, scope);
4505
+ const index2 = handles.findIndex((handle2) => handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId) === id);
4506
+ return index2 !== null && index2 !== void 0 ? index2 : null;
4507
+ }
4508
+ function determinePivotIndices$1(groupId, dragHandleId, panelGroupElement) {
4509
+ const index2 = getResizeHandleElementIndex$1(groupId, dragHandleId, panelGroupElement);
4510
+ return index2 != null ? [index2, index2 + 1] : [-1, -1];
4511
+ }
4512
+ function isHTMLElement(target) {
4513
+ if (target instanceof HTMLElement) {
4514
+ return true;
4515
+ }
4516
+ return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
4517
+ }
4518
+ function getPanelGroupElement$1(id, rootElement = document) {
4519
+ if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
4520
+ return rootElement;
4521
+ }
4522
+ const element2 = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
4523
+ if (element2) {
4524
+ return element2;
4525
+ }
4526
+ return null;
4527
+ }
4528
+ function getResizeHandleElement$1(id, scope = document) {
4529
+ const element2 = scope.querySelector(`[${DATA_ATTRIBUTES$1.resizeHandleId}="${id}"]`);
4530
+ if (element2) {
4531
+ return element2;
4532
+ }
4533
+ return null;
4534
+ }
4535
+ function getResizeHandlePanelIds$1(groupId, handleId, panelsArray, scope = document) {
4536
+ var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
4537
+ const handle2 = getResizeHandleElement$1(handleId, scope);
4538
+ const handles = getResizeHandleElementsForGroup$1(groupId, scope);
4539
+ const index2 = handle2 ? handles.indexOf(handle2) : -1;
4540
+ const idBefore = (_panelsArray$index$id = (_panelsArray$index = panelsArray[index2]) === null || _panelsArray$index === void 0 ? void 0 : _panelsArray$index.id) !== null && _panelsArray$index$id !== void 0 ? _panelsArray$index$id : null;
4541
+ const idAfter = (_panelsArray$id = (_panelsArray = panelsArray[index2 + 1]) === null || _panelsArray === void 0 ? void 0 : _panelsArray.id) !== null && _panelsArray$id !== void 0 ? _panelsArray$id : null;
4542
+ return [idBefore, idAfter];
4543
+ }
4544
+ function useWindowSplitterPanelGroupBehavior$1({
4545
+ committedValuesRef,
4546
+ eagerValuesRef,
4547
+ groupId,
4548
+ layout,
4549
+ panelDataArray,
4550
+ panelGroupElement,
4551
+ setLayout
4552
+ }) {
4553
+ useRef({
4554
+ didWarnAboutMissingResizeHandle: false
4555
+ });
4556
+ useIsomorphicLayoutEffect$1(() => {
4557
+ if (!panelGroupElement) {
4558
+ return;
4559
+ }
4560
+ const resizeHandleElements = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
4561
+ for (let index2 = 0; index2 < panelDataArray.length - 1; index2++) {
4562
+ const {
4563
+ valueMax,
4564
+ valueMin,
4565
+ valueNow
4566
+ } = calculateAriaValues$1({
4567
+ layout,
4568
+ panelsArray: panelDataArray,
4569
+ pivotIndices: [index2, index2 + 1]
4570
+ });
4571
+ const resizeHandleElement = resizeHandleElements[index2];
4572
+ if (resizeHandleElement == null) ;
4573
+ else {
4574
+ const panelData = panelDataArray[index2];
4575
+ assert$1(panelData, `No panel data found for index "${index2}"`);
4576
+ resizeHandleElement.setAttribute("aria-controls", panelData.id);
4577
+ resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
4578
+ resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
4579
+ resizeHandleElement.setAttribute("aria-valuenow", valueNow != null ? "" + Math.round(valueNow) : "");
4580
+ }
4581
+ }
4582
+ return () => {
4583
+ resizeHandleElements.forEach((resizeHandleElement, index2) => {
4584
+ resizeHandleElement.removeAttribute("aria-controls");
4585
+ resizeHandleElement.removeAttribute("aria-valuemax");
4586
+ resizeHandleElement.removeAttribute("aria-valuemin");
4587
+ resizeHandleElement.removeAttribute("aria-valuenow");
4588
+ });
4589
+ };
4590
+ }, [groupId, layout, panelDataArray, panelGroupElement]);
4591
+ useEffect(() => {
4592
+ if (!panelGroupElement) {
4593
+ return;
4594
+ }
4595
+ const eagerValues = eagerValuesRef.current;
4596
+ assert$1(eagerValues, `Eager values not found`);
4597
+ const {
4598
+ panelDataArray: panelDataArray2
4599
+ } = eagerValues;
4600
+ const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
4601
+ assert$1(groupElement != null, `No group found for id "${groupId}"`);
4602
+ const handles = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
4603
+ assert$1(handles, `No resize handles found for group id "${groupId}"`);
4604
+ const cleanupFunctions = handles.map((handle2) => {
4605
+ const handleId = handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId);
4606
+ assert$1(handleId, `Resize handle element has no handle id attribute`);
4607
+ const [idBefore, idAfter] = getResizeHandlePanelIds$1(groupId, handleId, panelDataArray2, panelGroupElement);
4608
+ if (idBefore == null || idAfter == null) {
4609
+ return () => {
4610
+ };
4611
+ }
4612
+ const onKeyDown = (event) => {
4613
+ if (event.defaultPrevented) {
4614
+ return;
4615
+ }
4616
+ switch (event.key) {
4617
+ case "Enter": {
4618
+ event.preventDefault();
4619
+ const index2 = panelDataArray2.findIndex((panelData) => panelData.id === idBefore);
4620
+ if (index2 >= 0) {
4621
+ const panelData = panelDataArray2[index2];
4622
+ assert$1(panelData, `No panel data found for index ${index2}`);
4623
+ const size = layout[index2];
4624
+ const {
4625
+ collapsedSize = 0,
4626
+ collapsible,
4627
+ minSize = 0
4628
+ } = panelData.constraints;
4629
+ if (size != null && collapsible) {
4630
+ const nextLayout = adjustLayoutByDelta$1({
4631
+ delta: fuzzyNumbersEqual$2(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
4632
+ initialLayout: layout,
4633
+ panelConstraints: panelDataArray2.map((panelData2) => panelData2.constraints),
4634
+ pivotIndices: determinePivotIndices$1(groupId, handleId, panelGroupElement),
4635
+ prevLayout: layout,
4636
+ trigger: "keyboard"
4637
+ });
4638
+ if (layout !== nextLayout) {
4639
+ setLayout(nextLayout);
4640
+ }
4641
+ }
4642
+ }
4643
+ break;
4644
+ }
4645
+ }
4646
+ };
4647
+ handle2.addEventListener("keydown", onKeyDown);
4648
+ return () => {
4649
+ handle2.removeEventListener("keydown", onKeyDown);
4650
+ };
4651
+ });
4652
+ return () => {
4653
+ cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
4654
+ };
4655
+ }, [panelGroupElement, committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, setLayout]);
4656
+ }
4657
+ function areEqual$1(arrayA, arrayB) {
4658
+ if (arrayA.length !== arrayB.length) {
4659
+ return false;
4660
+ }
4661
+ for (let index2 = 0; index2 < arrayA.length; index2++) {
4662
+ if (arrayA[index2] !== arrayB[index2]) {
4663
+ return false;
4664
+ }
4665
+ }
4666
+ return true;
4667
+ }
4668
+ function getResizeEventCursorPosition$1(direction, event) {
4669
+ const isHorizontal = direction === "horizontal";
4670
+ const {
4671
+ x,
4672
+ y
4673
+ } = getResizeEventCoordinates$1(event);
4674
+ return isHorizontal ? x : y;
4675
+ }
4676
+ function calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement) {
4677
+ const isHorizontal = direction === "horizontal";
4678
+ const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElement);
4679
+ assert$1(handleElement, `No resize handle element found for id "${dragHandleId}"`);
4680
+ const groupId = handleElement.getAttribute(DATA_ATTRIBUTES$1.groupId);
4681
+ assert$1(groupId, `Resize handle element has no group id attribute`);
4682
+ let {
4683
+ initialCursorPosition
4684
+ } = initialDragState;
4685
+ const cursorPosition = getResizeEventCursorPosition$1(direction, event);
4686
+ const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
4687
+ assert$1(groupElement, `No group element found for id "${groupId}"`);
4688
+ const groupRect = groupElement.getBoundingClientRect();
4689
+ const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
4690
+ const offsetPixels = cursorPosition - initialCursorPosition;
4691
+ const offsetPercentage = offsetPixels / groupSizeInPixels * 100;
4692
+ return offsetPercentage;
4693
+ }
4694
+ function calculateDeltaPercentage$1(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
4695
+ if (isKeyDown$1(event)) {
4696
+ const isHorizontal = direction === "horizontal";
4697
+ let delta = 0;
4698
+ if (event.shiftKey) {
4699
+ delta = 100;
4700
+ } else if (keyboardResizeBy != null) {
4701
+ delta = keyboardResizeBy;
4702
+ } else {
4703
+ delta = 10;
4704
+ }
4705
+ let movement = 0;
4706
+ switch (event.key) {
4707
+ case "ArrowDown":
4708
+ movement = isHorizontal ? 0 : delta;
4709
+ break;
4710
+ case "ArrowLeft":
4711
+ movement = isHorizontal ? -delta : 0;
4712
+ break;
4713
+ case "ArrowRight":
4714
+ movement = isHorizontal ? delta : 0;
4715
+ break;
4716
+ case "ArrowUp":
4717
+ movement = isHorizontal ? 0 : -delta;
4718
+ break;
4719
+ case "End":
4720
+ movement = 100;
4721
+ break;
4722
+ case "Home":
4723
+ movement = -100;
4724
+ break;
4725
+ }
4726
+ return movement;
4727
+ } else {
4728
+ if (initialDragState == null) {
4729
+ return 0;
4730
+ }
4731
+ return calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement);
4732
+ }
4733
+ }
4734
+ function calculateUnsafeDefaultLayout$1({
4735
+ panelDataArray
4736
+ }) {
4737
+ const layout = Array(panelDataArray.length);
4738
+ const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
4739
+ let numPanelsWithSizes = 0;
4740
+ let remainingSize = 100;
4741
+ for (let index2 = 0; index2 < panelDataArray.length; index2++) {
4742
+ const panelConstraints = panelConstraintsArray[index2];
4743
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
4744
+ const {
4745
+ defaultSize
4746
+ } = panelConstraints;
4747
+ if (defaultSize != null) {
4748
+ numPanelsWithSizes++;
4749
+ layout[index2] = defaultSize;
4750
+ remainingSize -= defaultSize;
4751
+ }
4752
+ }
4753
+ for (let index2 = 0; index2 < panelDataArray.length; index2++) {
4754
+ const panelConstraints = panelConstraintsArray[index2];
4755
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
4756
+ const {
4757
+ defaultSize
4758
+ } = panelConstraints;
4759
+ if (defaultSize != null) {
4760
+ continue;
4761
+ }
4762
+ const numRemainingPanels = panelDataArray.length - numPanelsWithSizes;
4763
+ const size = remainingSize / numRemainingPanels;
4764
+ numPanelsWithSizes++;
4765
+ layout[index2] = size;
4766
+ remainingSize -= size;
4767
+ }
4768
+ return layout;
4769
+ }
4770
+ function callPanelCallbacks$1(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
4771
+ layout.forEach((size, index2) => {
4772
+ const panelData = panelsArray[index2];
4773
+ assert$1(panelData, `Panel data not found for index ${index2}`);
4774
+ const {
4775
+ callbacks,
4776
+ constraints,
4777
+ id: panelId
4778
+ } = panelData;
4779
+ const {
4780
+ collapsedSize = 0,
4781
+ collapsible
4782
+ } = constraints;
4783
+ const lastNotifiedSize = panelIdToLastNotifiedSizeMap[panelId];
4784
+ if (lastNotifiedSize == null || size !== lastNotifiedSize) {
4785
+ panelIdToLastNotifiedSizeMap[panelId] = size;
4786
+ const {
4787
+ onCollapse,
4788
+ onExpand,
4789
+ onResize
4790
+ } = callbacks;
4791
+ if (onResize) {
4792
+ onResize(size, lastNotifiedSize);
4793
+ }
4794
+ if (collapsible && (onCollapse || onExpand)) {
4795
+ if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1$1(size, collapsedSize)) {
4796
+ onExpand();
4797
+ }
4798
+ if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1$1(size, collapsedSize)) {
4799
+ onCollapse();
4800
+ }
4801
+ }
4802
+ }
4803
+ });
4804
+ }
4805
+ function compareLayouts$1(a, b) {
4806
+ if (a.length !== b.length) {
4807
+ return false;
4808
+ } else {
4809
+ for (let index2 = 0; index2 < a.length; index2++) {
4810
+ if (a[index2] != b[index2]) {
4811
+ return false;
4812
+ }
4813
+ }
4814
+ }
4815
+ return true;
4816
+ }
4817
+ function computePanelFlexBoxStyle$1({
4818
+ defaultSize,
4819
+ dragState,
4820
+ layout,
4821
+ panelData,
4822
+ panelIndex,
4823
+ precision = 3
4824
+ }) {
4825
+ const size = layout[panelIndex];
4826
+ let flexGrow;
4827
+ if (size == null) {
4828
+ flexGrow = defaultSize != void 0 ? defaultSize.toFixed(precision) : "1";
4829
+ } else if (panelData.length === 1) {
4830
+ flexGrow = "1";
4831
+ } else {
4832
+ flexGrow = size.toFixed(precision);
4833
+ }
4834
+ return {
4835
+ flexBasis: 0,
4836
+ flexGrow,
4837
+ flexShrink: 1,
4838
+ // Without this, Panel sizes may be unintentionally overridden by their content
4839
+ overflow: "hidden",
4840
+ // Disable pointer events inside of a panel during resize
4841
+ // This avoid edge cases like nested iframes
4842
+ pointerEvents: dragState !== null ? "none" : void 0
4843
+ };
4844
+ }
4845
+ function debounce$1(callback, durationMs = 10) {
4846
+ let timeoutId = null;
4847
+ let callable = (...args) => {
4848
+ if (timeoutId !== null) {
4849
+ clearTimeout(timeoutId);
4850
+ }
4851
+ timeoutId = setTimeout(() => {
4852
+ callback(...args);
4853
+ }, durationMs);
4854
+ };
4855
+ return callable;
4856
+ }
4857
+ function initializeDefaultStorage$1(storageObject) {
4858
+ try {
4859
+ if (typeof localStorage !== "undefined") {
4860
+ storageObject.getItem = (name2) => {
4861
+ return localStorage.getItem(name2);
4862
+ };
4863
+ storageObject.setItem = (name2, value) => {
4864
+ localStorage.setItem(name2, value);
4865
+ };
4866
+ } else {
4867
+ throw new Error("localStorage not supported in this environment");
4868
+ }
4869
+ } catch (error) {
4870
+ console.error(error);
4871
+ storageObject.getItem = () => null;
4872
+ storageObject.setItem = () => {
4873
+ };
4874
+ }
4875
+ }
4876
+ function getPanelGroupKey$1(autoSaveId) {
4877
+ return `react-resizable-panels:${autoSaveId}`;
4878
+ }
4879
+ function getPanelKey$1(panels2) {
4880
+ return panels2.map((panel) => {
4881
+ const {
4882
+ constraints,
4883
+ id,
4884
+ idIsFromProps,
4885
+ order: order2
4886
+ } = panel;
4887
+ if (idIsFromProps) {
4888
+ return id;
4889
+ } else {
4890
+ return order2 ? `${order2}:${JSON.stringify(constraints)}` : JSON.stringify(constraints);
4891
+ }
4892
+ }).sort((a, b) => a.localeCompare(b)).join(",");
4893
+ }
4894
+ function loadSerializedPanelGroupState$1(autoSaveId, storage) {
4895
+ try {
4896
+ const panelGroupKey = getPanelGroupKey$1(autoSaveId);
4897
+ const serialized = storage.getItem(panelGroupKey);
4898
+ if (serialized) {
4899
+ const parsed = JSON.parse(serialized);
4900
+ if (typeof parsed === "object" && parsed != null) {
4901
+ return parsed;
4902
+ }
4903
+ }
4904
+ } catch (error) {
4905
+ }
4906
+ return null;
4907
+ }
4908
+ function loadPanelGroupState$1(autoSaveId, panels2, storage) {
4909
+ var _loadSerializedPanelG, _state$panelKey;
4910
+ const state = (_loadSerializedPanelG = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {};
4911
+ const panelKey = getPanelKey$1(panels2);
4912
+ return (_state$panelKey = state[panelKey]) !== null && _state$panelKey !== void 0 ? _state$panelKey : null;
4913
+ }
4914
+ function savePanelGroupState$1(autoSaveId, panels2, panelSizesBeforeCollapse, sizes, storage) {
4915
+ var _loadSerializedPanelG2;
4916
+ const panelGroupKey = getPanelGroupKey$1(autoSaveId);
4917
+ const panelKey = getPanelKey$1(panels2);
4918
+ const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
4919
+ state[panelKey] = {
4920
+ expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
4921
+ layout: sizes
4922
+ };
4923
+ try {
4924
+ storage.setItem(panelGroupKey, JSON.stringify(state));
4925
+ } catch (error) {
4926
+ console.error(error);
4927
+ }
4928
+ }
4929
+ function validatePanelGroupLayout$1({
4930
+ layout: prevLayout,
4931
+ panelConstraints
4932
+ }) {
4933
+ const nextLayout = [...prevLayout];
4934
+ const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
4935
+ if (nextLayout.length !== panelConstraints.length) {
4936
+ throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
4937
+ } else if (!fuzzyNumbersEqual$2(nextLayoutTotalSize, 100) && nextLayout.length > 0) {
4938
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
4939
+ const unsafeSize = nextLayout[index2];
4940
+ assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
4941
+ const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
4942
+ nextLayout[index2] = safeSize;
4943
+ }
4944
+ }
4945
+ let remainingSize = 0;
4946
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
4947
+ const unsafeSize = nextLayout[index2];
4948
+ assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
4949
+ const safeSize = resizePanel$1({
4950
+ panelConstraints,
4951
+ panelIndex: index2,
4952
+ size: unsafeSize
4953
+ });
4954
+ if (unsafeSize != safeSize) {
4955
+ remainingSize += unsafeSize - safeSize;
4956
+ nextLayout[index2] = safeSize;
4957
+ }
4958
+ }
4959
+ if (!fuzzyNumbersEqual$2(remainingSize, 0)) {
4960
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
4961
+ const prevSize = nextLayout[index2];
4962
+ assert$1(prevSize != null, `No layout data found for index ${index2}`);
4963
+ const unsafeSize = prevSize + remainingSize;
4964
+ const safeSize = resizePanel$1({
4965
+ panelConstraints,
4966
+ panelIndex: index2,
4967
+ size: unsafeSize
4968
+ });
4969
+ if (prevSize !== safeSize) {
4970
+ remainingSize -= safeSize - prevSize;
4971
+ nextLayout[index2] = safeSize;
4972
+ if (fuzzyNumbersEqual$2(remainingSize, 0)) {
4973
+ break;
4974
+ }
4975
+ }
4976
+ }
4977
+ }
4978
+ return nextLayout;
4979
+ }
4980
+ const LOCAL_STORAGE_DEBOUNCE_INTERVAL$1 = 100;
4981
+ const defaultStorage$1 = {
4982
+ getItem: (name2) => {
4983
+ initializeDefaultStorage$1(defaultStorage$1);
4984
+ return defaultStorage$1.getItem(name2);
4985
+ },
4986
+ setItem: (name2, value) => {
4987
+ initializeDefaultStorage$1(defaultStorage$1);
4988
+ defaultStorage$1.setItem(name2, value);
4989
+ }
4990
+ };
4991
+ const debounceMap$1 = {};
4992
+ function PanelGroupWithForwardedRef$1({
4993
+ autoSaveId = null,
4994
+ children: children2,
4995
+ className: classNameFromProps = "",
4996
+ direction,
4997
+ forwardedRef,
4998
+ id: idFromProps = null,
4999
+ onLayout = null,
5000
+ keyboardResizeBy = null,
5001
+ storage = defaultStorage$1,
5002
+ style: styleFromProps,
5003
+ tagName: Type = "div",
5004
+ ...rest
5005
+ }) {
5006
+ const groupId = useUniqueId$1(idFromProps);
5007
+ const panelGroupElementRef = useRef(null);
5008
+ const [dragState, setDragState] = useState(null);
5009
+ const [layout, setLayout] = useState([]);
5010
+ const forceUpdate = useForceUpdate$1();
5011
+ const panelIdToLastNotifiedSizeMapRef = useRef({});
5012
+ const panelSizeBeforeCollapseRef = useRef(/* @__PURE__ */ new Map());
5013
+ const prevDeltaRef = useRef(0);
5014
+ const committedValuesRef = useRef({
5015
+ autoSaveId,
5016
+ direction,
5017
+ dragState,
5018
+ id: groupId,
5019
+ keyboardResizeBy,
5020
+ onLayout,
5021
+ storage
5022
+ });
5023
+ const eagerValuesRef = useRef({
5024
+ layout,
5025
+ panelDataArray: [],
5026
+ panelDataArrayChanged: false
5027
+ });
5028
+ useRef({
5029
+ didLogIdAndOrderWarning: false,
5030
+ didLogPanelConstraintsWarning: false,
5031
+ prevPanelIds: []
5032
+ });
5033
+ useImperativeHandle(forwardedRef, () => ({
5034
+ getId: () => committedValuesRef.current.id,
5035
+ getLayout: () => {
5036
+ const {
5037
+ layout: layout2
5038
+ } = eagerValuesRef.current;
5039
+ return layout2;
5040
+ },
5041
+ setLayout: (unsafeLayout) => {
5042
+ const {
5043
+ onLayout: onLayout2
5044
+ } = committedValuesRef.current;
5045
+ const {
5046
+ layout: prevLayout,
5047
+ panelDataArray
5048
+ } = eagerValuesRef.current;
5049
+ const safeLayout = validatePanelGroupLayout$1({
5050
+ layout: unsafeLayout,
5051
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
5052
+ });
5053
+ if (!areEqual$1(prevLayout, safeLayout)) {
5054
+ setLayout(safeLayout);
5055
+ eagerValuesRef.current.layout = safeLayout;
5056
+ if (onLayout2) {
5057
+ onLayout2(safeLayout);
5058
+ }
5059
+ callPanelCallbacks$1(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
5060
+ }
5061
+ }
5062
+ }), []);
5063
+ useIsomorphicLayoutEffect$1(() => {
5064
+ committedValuesRef.current.autoSaveId = autoSaveId;
5065
+ committedValuesRef.current.direction = direction;
5066
+ committedValuesRef.current.dragState = dragState;
5067
+ committedValuesRef.current.id = groupId;
5068
+ committedValuesRef.current.onLayout = onLayout;
5069
+ committedValuesRef.current.storage = storage;
5070
+ });
5071
+ useWindowSplitterPanelGroupBehavior$1({
5072
+ committedValuesRef,
5073
+ eagerValuesRef,
5074
+ groupId,
5075
+ layout,
5076
+ panelDataArray: eagerValuesRef.current.panelDataArray,
5077
+ setLayout,
5078
+ panelGroupElement: panelGroupElementRef.current
5079
+ });
5080
+ useEffect(() => {
5081
+ const {
5082
+ panelDataArray
5083
+ } = eagerValuesRef.current;
5084
+ if (autoSaveId) {
5085
+ if (layout.length === 0 || layout.length !== panelDataArray.length) {
5086
+ return;
5087
+ }
5088
+ let debouncedSave = debounceMap$1[autoSaveId];
5089
+ if (debouncedSave == null) {
5090
+ debouncedSave = debounce$1(savePanelGroupState$1, LOCAL_STORAGE_DEBOUNCE_INTERVAL$1);
5091
+ debounceMap$1[autoSaveId] = debouncedSave;
5092
+ }
5093
+ const clonedPanelDataArray = [...panelDataArray];
5094
+ const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
5095
+ debouncedSave(autoSaveId, clonedPanelDataArray, clonedPanelSizesBeforeCollapse, layout, storage);
5096
+ }
5097
+ }, [autoSaveId, layout, storage]);
5098
+ useEffect(() => {
5099
+ });
5100
+ const collapsePanel = useCallback((panelData) => {
5101
+ const {
5102
+ onLayout: onLayout2
5103
+ } = committedValuesRef.current;
5104
+ const {
5105
+ layout: prevLayout,
5106
+ panelDataArray
5107
+ } = eagerValuesRef.current;
5108
+ if (panelData.constraints.collapsible) {
5109
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5110
+ const {
5111
+ collapsedSize = 0,
5112
+ panelSize,
5113
+ pivotIndices
5114
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
5115
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5116
+ if (!fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
5117
+ panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
5118
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
5119
+ const delta = isLastPanel ? panelSize - collapsedSize : collapsedSize - panelSize;
5120
+ const nextLayout = adjustLayoutByDelta$1({
5121
+ delta,
5122
+ initialLayout: prevLayout,
5123
+ panelConstraints: panelConstraintsArray,
5124
+ pivotIndices,
5125
+ prevLayout,
5126
+ trigger: "imperative-api"
5127
+ });
5128
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
5129
+ setLayout(nextLayout);
5130
+ eagerValuesRef.current.layout = nextLayout;
5131
+ if (onLayout2) {
5132
+ onLayout2(nextLayout);
5133
+ }
5134
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5135
+ }
5136
+ }
5137
+ }
5138
+ }, []);
5139
+ const expandPanel = useCallback((panelData, minSizeOverride) => {
5140
+ const {
5141
+ onLayout: onLayout2
5142
+ } = committedValuesRef.current;
5143
+ const {
5144
+ layout: prevLayout,
5145
+ panelDataArray
5146
+ } = eagerValuesRef.current;
5147
+ if (panelData.constraints.collapsible) {
5148
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5149
+ const {
5150
+ collapsedSize = 0,
5151
+ panelSize = 0,
5152
+ minSize: minSizeFromProps = 0,
5153
+ pivotIndices
5154
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
5155
+ const minSize = minSizeOverride !== null && minSizeOverride !== void 0 ? minSizeOverride : minSizeFromProps;
5156
+ if (fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
5157
+ const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
5158
+ const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
5159
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
5160
+ const delta = isLastPanel ? panelSize - baseSize : baseSize - panelSize;
5161
+ const nextLayout = adjustLayoutByDelta$1({
5162
+ delta,
5163
+ initialLayout: prevLayout,
5164
+ panelConstraints: panelConstraintsArray,
5165
+ pivotIndices,
5166
+ prevLayout,
5167
+ trigger: "imperative-api"
5168
+ });
5169
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
5170
+ setLayout(nextLayout);
5171
+ eagerValuesRef.current.layout = nextLayout;
5172
+ if (onLayout2) {
5173
+ onLayout2(nextLayout);
5174
+ }
5175
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5176
+ }
5177
+ }
5178
+ }
5179
+ }, []);
5180
+ const getPanelSize = useCallback((panelData) => {
5181
+ const {
5182
+ layout: layout2,
5183
+ panelDataArray
5184
+ } = eagerValuesRef.current;
5185
+ const {
5186
+ panelSize
5187
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5188
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5189
+ return panelSize;
5190
+ }, []);
5191
+ const getPanelStyle = useCallback((panelData, defaultSize) => {
5192
+ const {
5193
+ panelDataArray
5194
+ } = eagerValuesRef.current;
5195
+ const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
5196
+ return computePanelFlexBoxStyle$1({
5197
+ defaultSize,
5198
+ dragState,
5199
+ layout,
5200
+ panelData: panelDataArray,
5201
+ panelIndex
5202
+ });
5203
+ }, [dragState, layout]);
5204
+ const isPanelCollapsed = useCallback((panelData) => {
5205
+ const {
5206
+ layout: layout2,
5207
+ panelDataArray
5208
+ } = eagerValuesRef.current;
5209
+ const {
5210
+ collapsedSize = 0,
5211
+ collapsible,
5212
+ panelSize
5213
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5214
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5215
+ return collapsible === true && fuzzyNumbersEqual$1$1(panelSize, collapsedSize);
5216
+ }, []);
5217
+ const isPanelExpanded = useCallback((panelData) => {
5218
+ const {
5219
+ layout: layout2,
5220
+ panelDataArray
5221
+ } = eagerValuesRef.current;
5222
+ const {
5223
+ collapsedSize = 0,
5224
+ collapsible,
5225
+ panelSize
5226
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5227
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5228
+ return !collapsible || fuzzyCompareNumbers$1(panelSize, collapsedSize) > 0;
5229
+ }, []);
5230
+ const registerPanel = useCallback((panelData) => {
5231
+ const {
5232
+ panelDataArray
5233
+ } = eagerValuesRef.current;
5234
+ panelDataArray.push(panelData);
5235
+ panelDataArray.sort((panelA, panelB) => {
5236
+ const orderA = panelA.order;
5237
+ const orderB = panelB.order;
5238
+ if (orderA == null && orderB == null) {
5239
+ return 0;
5240
+ } else if (orderA == null) {
5241
+ return -1;
5242
+ } else if (orderB == null) {
5243
+ return 1;
5244
+ } else {
5245
+ return orderA - orderB;
5246
+ }
5247
+ });
5248
+ eagerValuesRef.current.panelDataArrayChanged = true;
5249
+ forceUpdate();
5250
+ }, [forceUpdate]);
5251
+ useIsomorphicLayoutEffect$1(() => {
5252
+ if (eagerValuesRef.current.panelDataArrayChanged) {
5253
+ eagerValuesRef.current.panelDataArrayChanged = false;
5254
+ const {
5255
+ autoSaveId: autoSaveId2,
5256
+ onLayout: onLayout2,
5257
+ storage: storage2
5258
+ } = committedValuesRef.current;
5259
+ const {
5260
+ layout: prevLayout,
5261
+ panelDataArray
5262
+ } = eagerValuesRef.current;
5263
+ let unsafeLayout = null;
5264
+ if (autoSaveId2) {
5265
+ const state = loadPanelGroupState$1(autoSaveId2, panelDataArray, storage2);
5266
+ if (state) {
5267
+ panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
5268
+ unsafeLayout = state.layout;
5269
+ }
5270
+ }
5271
+ if (unsafeLayout == null) {
5272
+ unsafeLayout = calculateUnsafeDefaultLayout$1({
5273
+ panelDataArray
5274
+ });
5275
+ }
5276
+ const nextLayout = validatePanelGroupLayout$1({
5277
+ layout: unsafeLayout,
5278
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
5279
+ });
5280
+ if (!areEqual$1(prevLayout, nextLayout)) {
5281
+ setLayout(nextLayout);
5282
+ eagerValuesRef.current.layout = nextLayout;
5283
+ if (onLayout2) {
5284
+ onLayout2(nextLayout);
5285
+ }
5286
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5287
+ }
5288
+ }
5289
+ });
5290
+ useIsomorphicLayoutEffect$1(() => {
5291
+ const eagerValues = eagerValuesRef.current;
5292
+ return () => {
5293
+ eagerValues.layout = [];
5294
+ };
5295
+ }, []);
5296
+ const registerResizeHandle = useCallback((dragHandleId) => {
5297
+ let isRTL = false;
5298
+ const panelGroupElement = panelGroupElementRef.current;
5299
+ if (panelGroupElement) {
5300
+ const style3 = window.getComputedStyle(panelGroupElement, null);
5301
+ if (style3.getPropertyValue("direction") === "rtl") {
5302
+ isRTL = true;
5303
+ }
5304
+ }
5305
+ return function resizeHandler(event) {
5306
+ event.preventDefault();
5307
+ const panelGroupElement2 = panelGroupElementRef.current;
5308
+ if (!panelGroupElement2) {
5309
+ return () => null;
5310
+ }
5311
+ const {
5312
+ direction: direction2,
5313
+ dragState: dragState2,
5314
+ id: groupId2,
5315
+ keyboardResizeBy: keyboardResizeBy2,
5316
+ onLayout: onLayout2
5317
+ } = committedValuesRef.current;
5318
+ const {
5319
+ layout: prevLayout,
5320
+ panelDataArray
5321
+ } = eagerValuesRef.current;
5322
+ const {
5323
+ initialLayout
5324
+ } = dragState2 !== null && dragState2 !== void 0 ? dragState2 : {};
5325
+ const pivotIndices = determinePivotIndices$1(groupId2, dragHandleId, panelGroupElement2);
5326
+ let delta = calculateDeltaPercentage$1(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
5327
+ const isHorizontal = direction2 === "horizontal";
5328
+ if (isHorizontal && isRTL) {
5329
+ delta = -delta;
5330
+ }
5331
+ const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
5332
+ const nextLayout = adjustLayoutByDelta$1({
5333
+ delta,
5334
+ initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
5335
+ panelConstraints,
5336
+ pivotIndices,
5337
+ prevLayout,
5338
+ trigger: isKeyDown$1(event) ? "keyboard" : "mouse-or-touch"
5339
+ });
5340
+ const layoutChanged = !compareLayouts$1(prevLayout, nextLayout);
5341
+ if (isPointerEvent$1(event) || isMouseEvent$1(event)) {
5342
+ if (prevDeltaRef.current != delta) {
5343
+ prevDeltaRef.current = delta;
5344
+ if (!layoutChanged && delta !== 0) {
5345
+ if (isHorizontal) {
5346
+ reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN$1 : EXCEEDED_HORIZONTAL_MAX$1);
5347
+ } else {
5348
+ reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN$1 : EXCEEDED_VERTICAL_MAX$1);
5349
+ }
5350
+ } else {
5351
+ reportConstraintsViolation$1(dragHandleId, 0);
5352
+ }
5353
+ }
5354
+ }
5355
+ if (layoutChanged) {
5356
+ setLayout(nextLayout);
5357
+ eagerValuesRef.current.layout = nextLayout;
5358
+ if (onLayout2) {
5359
+ onLayout2(nextLayout);
5360
+ }
5361
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5362
+ }
5363
+ };
5364
+ }, []);
5365
+ const resizePanel2 = useCallback((panelData, unsafePanelSize) => {
5366
+ const {
5367
+ onLayout: onLayout2
5368
+ } = committedValuesRef.current;
5369
+ const {
5370
+ layout: prevLayout,
5371
+ panelDataArray
5372
+ } = eagerValuesRef.current;
5373
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5374
+ const {
5375
+ panelSize,
5376
+ pivotIndices
5377
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
5378
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5379
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
5380
+ const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
5381
+ const nextLayout = adjustLayoutByDelta$1({
5382
+ delta,
5383
+ initialLayout: prevLayout,
5384
+ panelConstraints: panelConstraintsArray,
5385
+ pivotIndices,
5386
+ prevLayout,
5387
+ trigger: "imperative-api"
5388
+ });
5389
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
5390
+ setLayout(nextLayout);
5391
+ eagerValuesRef.current.layout = nextLayout;
5392
+ if (onLayout2) {
5393
+ onLayout2(nextLayout);
5394
+ }
5395
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5396
+ }
5397
+ }, []);
5398
+ const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
5399
+ const {
5400
+ layout: layout2,
5401
+ panelDataArray
5402
+ } = eagerValuesRef.current;
5403
+ const {
5404
+ collapsedSize: prevCollapsedSize = 0,
5405
+ collapsible: prevCollapsible
5406
+ } = prevConstraints;
5407
+ const {
5408
+ collapsedSize: nextCollapsedSize = 0,
5409
+ collapsible: nextCollapsible,
5410
+ maxSize: nextMaxSize = 100,
5411
+ minSize: nextMinSize = 0
5412
+ } = panelData.constraints;
5413
+ const {
5414
+ panelSize: prevPanelSize
5415
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5416
+ if (prevPanelSize == null) {
5417
+ return;
5418
+ }
5419
+ if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1$1(prevPanelSize, prevCollapsedSize)) {
5420
+ if (!fuzzyNumbersEqual$1$1(prevCollapsedSize, nextCollapsedSize)) {
5421
+ resizePanel2(panelData, nextCollapsedSize);
5422
+ }
5423
+ } else if (prevPanelSize < nextMinSize) {
5424
+ resizePanel2(panelData, nextMinSize);
5425
+ } else if (prevPanelSize > nextMaxSize) {
5426
+ resizePanel2(panelData, nextMaxSize);
5427
+ }
5428
+ }, [resizePanel2]);
5429
+ const startDragging = useCallback((dragHandleId, event) => {
5430
+ const {
5431
+ direction: direction2
5432
+ } = committedValuesRef.current;
5433
+ const {
5434
+ layout: layout2
5435
+ } = eagerValuesRef.current;
5436
+ if (!panelGroupElementRef.current) {
5437
+ return;
5438
+ }
5439
+ const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElementRef.current);
5440
+ assert$1(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
5441
+ const initialCursorPosition = getResizeEventCursorPosition$1(direction2, event);
5442
+ setDragState({
5443
+ dragHandleId,
5444
+ dragHandleRect: handleElement.getBoundingClientRect(),
5445
+ initialCursorPosition,
5446
+ initialLayout: layout2
5447
+ });
5448
+ }, []);
5449
+ const stopDragging = useCallback(() => {
5450
+ setDragState(null);
5451
+ }, []);
5452
+ const unregisterPanel = useCallback((panelData) => {
5453
+ const {
5454
+ panelDataArray
5455
+ } = eagerValuesRef.current;
5456
+ const index2 = findPanelDataIndex$1(panelDataArray, panelData);
5457
+ if (index2 >= 0) {
5458
+ panelDataArray.splice(index2, 1);
5459
+ delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
5460
+ eagerValuesRef.current.panelDataArrayChanged = true;
5461
+ forceUpdate();
5462
+ }
5463
+ }, [forceUpdate]);
5464
+ const context = useMemo(() => ({
5465
+ collapsePanel,
5466
+ direction,
5467
+ dragState,
5468
+ expandPanel,
5469
+ getPanelSize,
5470
+ getPanelStyle,
5471
+ groupId,
5472
+ isPanelCollapsed,
5473
+ isPanelExpanded,
5474
+ reevaluatePanelConstraints,
5475
+ registerPanel,
5476
+ registerResizeHandle,
5477
+ resizePanel: resizePanel2,
5478
+ startDragging,
5479
+ stopDragging,
5480
+ unregisterPanel,
5481
+ panelGroupElement: panelGroupElementRef.current
5482
+ }), [collapsePanel, dragState, direction, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, isPanelExpanded, reevaluatePanelConstraints, registerPanel, registerResizeHandle, resizePanel2, startDragging, stopDragging, unregisterPanel]);
5483
+ const style2 = {
5484
+ display: "flex",
5485
+ flexDirection: direction === "horizontal" ? "row" : "column",
5486
+ height: "100%",
5487
+ overflow: "hidden",
5488
+ width: "100%"
5489
+ };
5490
+ return createElement(PanelGroupContext$1.Provider, {
5491
+ value: context
5492
+ }, createElement(Type, {
5493
+ ...rest,
5494
+ children: children2,
5495
+ className: classNameFromProps,
5496
+ id: idFromProps,
5497
+ ref: panelGroupElementRef,
5498
+ style: {
5499
+ ...style2,
5500
+ ...styleFromProps
5501
+ },
5502
+ // CSS selectors
5503
+ [DATA_ATTRIBUTES$1.group]: "",
5504
+ [DATA_ATTRIBUTES$1.groupDirection]: direction,
5505
+ [DATA_ATTRIBUTES$1.groupId]: groupId
5506
+ }));
5507
+ }
5508
+ const PanelGroup$1 = forwardRef((props, ref) => createElement(PanelGroupWithForwardedRef$1, {
5509
+ ...props,
5510
+ forwardedRef: ref
5511
+ }));
5512
+ PanelGroupWithForwardedRef$1.displayName = "PanelGroup";
5513
+ PanelGroup$1.displayName = "forwardRef(PanelGroup)";
5514
+ function findPanelDataIndex$1(panelDataArray, panelData) {
5515
+ return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
5516
+ }
5517
+ function panelDataHelper$1(panelDataArray, panelData, layout) {
5518
+ const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
5519
+ const isLastPanel = panelIndex === panelDataArray.length - 1;
5520
+ const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
5521
+ const panelSize = layout[panelIndex];
5522
+ return {
5523
+ ...panelData.constraints,
5524
+ panelSize,
5525
+ pivotIndices
5526
+ };
5527
+ }
5528
+ function C(e) {
5529
+ return { "--panel-background": e.colors.background, "--panel-border": e.colors.border, "--panel-handle": e.colors.backgroundSecondary, "--panel-handle-hover": e.colors.backgroundHover, "--panel-handle-active": e.colors.primary, "--panel-button-bg": e.colors.surface, "--panel-button-hover": e.colors.backgroundHover, "--panel-button-border": e.colors.border, "--panel-button-icon": e.colors.textSecondary, "--panel-accent-bg": e.colors.primary + "15" };
5530
+ }
5531
+ const z = forwardRef(({ panels: o, className: a = "", style: s2, theme: d, minPanelWidth: u = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m, preventKeyboardScroll: f = true, disableSwipe: g = false }, v) => {
5532
+ const b = useRef(null), y = C(d);
5533
+ useImperativeHandle(v, () => ({ scrollToPanel: (e) => {
5534
+ if (!b.current) return;
5535
+ const t = b.current, n = t.children[e];
5536
+ if (n) {
5537
+ const e2 = n.offsetLeft;
5538
+ t.scrollTo({ left: e2, behavior: "smooth" });
5539
+ }
5540
+ }, getCurrentPanel: () => {
5541
+ if (!b.current || 0 === b.current.children.length) return 0;
5542
+ const e = b.current, t = e.getBoundingClientRect().left;
5543
+ let n = 0, r2 = 1 / 0;
5544
+ for (let o2 = 0; o2 < e.children.length; o2++) {
5545
+ const i = e.children[o2].getBoundingClientRect(), a2 = Math.abs(i.left - t);
5546
+ a2 < r2 && (r2 = a2, n = o2);
5547
+ }
5548
+ return n;
5549
+ } }));
5550
+ useEffect(() => {
5551
+ if (!f || !b.current) return;
5552
+ const e = b.current, t = (e2) => {
5553
+ const t2 = e2.target;
5554
+ if ("INPUT" === t2.tagName || "TEXTAREA" === t2.tagName || "SELECT" === t2.tagName || t2.isContentEditable || null !== t2.closest(".xterm") || null !== t2.closest('[contenteditable="true"]')) return;
5555
+ [" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e2.key) && e2.preventDefault();
5556
+ };
5557
+ return e.addEventListener("keydown", t), () => {
5558
+ e.removeEventListener("keydown", t);
5559
+ };
5560
+ }, [f]);
5561
+ const w = o.length, x = 2 * u;
5562
+ let S2;
5563
+ S2 = 1 === w || 2 === w ? "100%" : `max(${u}px, ${100 * p2}%)`;
5564
+ const R = React2__default.useId().replace(/:/g, "_");
5565
+ return jsxs(Fragment, { children: [
5566
+ 2 === w && /* @__PURE__ */ jsx("style", { children: `
5567
+ .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
5568
+ width: 100%;
5569
+ }
5570
+ @container (min-width: ${x}px) {
5571
+ .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
5572
+ width: 50%;
5573
+ }
5574
+ }
5575
+ ` }),
5576
+ /* @__PURE__ */ jsx("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a}`, style: { ...y, ...s2, "--snap-carousel-min-width": `${u}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": S2, "--snap-carousel-panel-count": w, "--snap-carousel-two-panel-threshold": `${x}px` }, onScroll: (e) => {
5577
+ if (!m || !b.current || 0 === b.current.children.length) return;
5578
+ const t = b.current, n = t.getBoundingClientRect().left;
5579
+ let r2 = 0, o2 = 1 / 0;
5580
+ for (let i = 0; i < t.children.length; i++) {
5581
+ const e2 = t.children[i].getBoundingClientRect(), a2 = Math.abs(e2.left - n);
5582
+ a2 < o2 && (o2 = a2, r2 = i);
5583
+ }
5584
+ m(r2);
5585
+ }, "data-panel-count": w, "data-carousel-id": R, children: o.map((t, n) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t }, n)) })
5586
+ ] });
5587
+ });
5588
+ z.displayName = "SnapCarousel";
5589
+ var le$1, se$1;
5590
+ (se$1 = le$1 || (le$1 = {})).DragStart = "dragStart", se$1.DragMove = "dragMove", se$1.DragEnd = "dragEnd", se$1.DragCancel = "dragCancel", se$1.DragOver = "dragOver", se$1.RegisterDroppable = "registerDroppable", se$1.SetDroppableDisabled = "setDroppableDisabled", se$1.UnregisterDroppable = "unregisterDroppable";
5591
+ const de = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
5592
+ var Te$1, Ae;
5593
+ (Ae = Te$1 || (Te$1 = {}))[Ae.Forward = 1] = "Forward", Ae[Ae.Backward = -1] = "Backward";
5594
+ var _e$1, je$1, He$1, Ke$1;
5595
+ (je$1 = _e$1 || (_e$1 = {})).Click = "click", je$1.DragStart = "dragstart", je$1.Keydown = "keydown", je$1.ContextMenu = "contextmenu", je$1.Resize = "resize", je$1.SelectionChange = "selectionchange", je$1.VisibilityChange = "visibilitychange", (Ke$1 = He$1 || (He$1 = {})).Space = "Space", Ke$1.Down = "ArrowDown", Ke$1.Right = "ArrowRight", Ke$1.Left = "ArrowLeft", Ke$1.Up = "ArrowUp", Ke$1.Esc = "Escape", Ke$1.Enter = "Enter", Ke$1.Tab = "Tab";
5596
+ ({ start: [He$1.Space, He$1.Enter], cancel: [He$1.Esc], end: [He$1.Space, He$1.Enter, He$1.Tab] });
5597
+ var rt, ot$1;
5598
+ (ot$1 = rt || (rt = {}))[ot$1.RightClick = 2] = "RightClick";
5599
+ var at, lt$1, st$1, ct$1;
5600
+ (lt$1 = at || (at = {}))[lt$1.Pointer = 0] = "Pointer", lt$1[lt$1.DraggableRect = 1] = "DraggableRect", (ct$1 = st$1 || (st$1 = {}))[ct$1.TreeOrder = 0] = "TreeOrder", ct$1[ct$1.ReversedTreeOrder = 1] = "ReversedTreeOrder";
5601
+ ({ x: { [Te$1.Backward]: false, [Te$1.Forward]: false }, y: { [Te$1.Backward]: false, [Te$1.Forward]: false } });
5602
+ var pt, ht$1, mt$1;
5603
+ (ht$1 = pt || (pt = {}))[ht$1.Always = 0] = "Always", ht$1[ht$1.BeforeDragging = 1] = "BeforeDragging", ht$1[ht$1.WhileDragging = 2] = "WhileDragging", (mt$1 || (mt$1 = {})).Optimized = "optimized";
5604
+ ({ droppable: { strategy: pt.WhileDragging, frequency: mt$1.Optimized } });
5605
+ /* @__PURE__ */ createContext({ ...de, scaleX: 1, scaleY: 1 });
5606
+ var $t, Bt$1;
5607
+ (Bt$1 = $t || ($t = {}))[Bt$1.Uninitialized = 0] = "Uninitialized", Bt$1[Bt$1.Initializing = 1] = "Initializing", Bt$1[Bt$1.Initialized = 2] = "Initialized";
5608
+ var Ut;
5609
+ (() => {
5610
+ if ("undefined" != typeof window) {
5611
+ const e = window;
5612
+ return e.__principlemd_theme_context__ || (e.__principlemd_theme_context__ = createContext(void 0)), e.__principlemd_theme_context__;
5613
+ }
5614
+ return Ut || (Ut = createContext(void 0)), Ut;
5615
+ })();
5616
+ var _e = Object.defineProperty;
5617
+ var Ee = (o, e, t) => e in o ? _e(o, e, { enumerable: true, configurable: true, writable: true, value: t }) : o[e] = t;
5618
+ var le = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
5619
+ class De {
5620
+ constructor() {
5621
+ le(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
5622
+ le(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
5623
+ }
5624
+ /**
5625
+ * Load all user-created workspace presets
5626
+ */
5627
+ async loadWorkspacePresets() {
5628
+ try {
5629
+ const e = localStorage.getItem(this.PRESETS_KEY);
5630
+ return e ? JSON.parse(e) : {};
5631
+ } catch (e) {
5632
+ return console.error("Failed to load workspace presets:", e), {};
3660
5633
  }
3661
5634
  }
3662
- };
3663
- /**
3664
- * @license lucide-react v0.552.0 - ISC
3665
- *
3666
- * This source code is licensed under the ISC license.
3667
- * See the LICENSE file in the root directory of this source tree.
3668
- */
3669
- var defaultAttributes = {
3670
- xmlns: "http://www.w3.org/2000/svg",
3671
- width: 24,
3672
- height: 24,
3673
- viewBox: "0 0 24 24",
3674
- fill: "none",
3675
- stroke: "currentColor",
3676
- strokeWidth: 2,
3677
- strokeLinecap: "round",
3678
- strokeLinejoin: "round"
3679
- };
3680
- /**
3681
- * @license lucide-react v0.552.0 - ISC
3682
- *
3683
- * This source code is licensed under the ISC license.
3684
- * See the LICENSE file in the root directory of this source tree.
3685
- */
3686
- const Icon = forwardRef(
3687
- ({
3688
- color: color2 = "currentColor",
3689
- size = 24,
3690
- strokeWidth = 2,
3691
- absoluteStrokeWidth,
3692
- className = "",
3693
- children: children2,
3694
- iconNode,
3695
- ...rest
3696
- }, ref) => createElement(
3697
- "svg",
3698
- {
3699
- ref,
3700
- ...defaultAttributes,
3701
- width: size,
3702
- height: size,
3703
- stroke: color2,
3704
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
3705
- className: mergeClasses("lucide", className),
3706
- ...!children2 && !hasA11yProp(rest) && { "aria-hidden": "true" },
3707
- ...rest
3708
- },
3709
- [
3710
- ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
3711
- ...Array.isArray(children2) ? children2 : [children2]
3712
- ]
3713
- )
3714
- );
3715
- /**
3716
- * @license lucide-react v0.552.0 - ISC
3717
- *
3718
- * This source code is licensed under the ISC license.
3719
- * See the LICENSE file in the root directory of this source tree.
3720
- */
3721
- const createLucideIcon = (iconName, iconNode) => {
3722
- const Component = forwardRef(
3723
- ({ className, ...props }, ref) => createElement(Icon, {
3724
- ref,
3725
- iconNode,
3726
- className: mergeClasses(
3727
- `lucide-${toKebabCase(toPascalCase(iconName))}`,
3728
- `lucide-${iconName}`,
3729
- className
3730
- ),
3731
- ...props
3732
- })
3733
- );
3734
- Component.displayName = toPascalCase(iconName);
3735
- return Component;
3736
- };
3737
- /**
3738
- * @license lucide-react v0.552.0 - ISC
3739
- *
3740
- * This source code is licensed under the ISC license.
3741
- * See the LICENSE file in the root directory of this source tree.
3742
- */
3743
- const __iconNode$j = [
3744
- ["path", { d: "M12 8V4H8", key: "hb8ula" }],
3745
- ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
3746
- ["path", { d: "M2 14h2", key: "vft8re" }],
3747
- ["path", { d: "M20 14h2", key: "4cs60a" }],
3748
- ["path", { d: "M15 13v2", key: "1xurst" }],
3749
- ["path", { d: "M9 13v2", key: "rq6x2g" }]
3750
- ];
3751
- const Bot = createLucideIcon("bot", __iconNode$j);
3752
- /**
3753
- * @license lucide-react v0.552.0 - ISC
3754
- *
3755
- * This source code is licensed under the ISC license.
3756
- * See the LICENSE file in the root directory of this source tree.
3757
- */
3758
- const __iconNode$i = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
3759
- const Check = createLucideIcon("check", __iconNode$i);
3760
- /**
3761
- * @license lucide-react v0.552.0 - ISC
3762
- *
3763
- * This source code is licensed under the ISC license.
3764
- * See the LICENSE file in the root directory of this source tree.
3765
- */
3766
- const __iconNode$h = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
3767
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$h);
3768
- /**
3769
- * @license lucide-react v0.552.0 - ISC
3770
- *
3771
- * This source code is licensed under the ISC license.
3772
- * See the LICENSE file in the root directory of this source tree.
3773
- */
3774
- const __iconNode$g = [
3775
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
3776
- ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
3777
- ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
3778
- ];
3779
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$g);
3780
- /**
3781
- * @license lucide-react v0.552.0 - ISC
3782
- *
3783
- * This source code is licensed under the ISC license.
3784
- * See the LICENSE file in the root directory of this source tree.
3785
- */
3786
- const __iconNode$f = [
3787
- ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
3788
- ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
3789
- ];
3790
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$f);
3791
- /**
3792
- * @license lucide-react v0.552.0 - ISC
3793
- *
3794
- * This source code is licensed under the ISC license.
3795
- * See the LICENSE file in the root directory of this source tree.
3796
- */
3797
- const __iconNode$e = [
3798
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
3799
- ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
3800
- ];
3801
- const CircleCheck = createLucideIcon("circle-check", __iconNode$e);
3802
- /**
3803
- * @license lucide-react v0.552.0 - ISC
3804
- *
3805
- * This source code is licensed under the ISC license.
3806
- * See the LICENSE file in the root directory of this source tree.
3807
- */
3808
- const __iconNode$d = [
3809
- ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
3810
- ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
3811
- ];
3812
- const Copy = createLucideIcon("copy", __iconNode$d);
3813
- /**
3814
- * @license lucide-react v0.552.0 - ISC
3815
- *
3816
- * This source code is licensed under the ISC license.
3817
- * See the LICENSE file in the root directory of this source tree.
3818
- */
3819
- const __iconNode$c = [
3820
- ["path", { d: "m15 15 6 6", key: "1s409w" }],
3821
- ["path", { d: "m15 9 6-6", key: "ko1vev" }],
3822
- ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
3823
- ["path", { d: "M21 8V3h-5", key: "1qoq8a" }],
3824
- ["path", { d: "M3 16v5h5", key: "1t08am" }],
3825
- ["path", { d: "m3 21 6-6", key: "wwnumi" }],
3826
- ["path", { d: "M3 8V3h5", key: "1ln10m" }],
3827
- ["path", { d: "M9 9 3 3", key: "v551iv" }]
3828
- ];
3829
- const Expand = createLucideIcon("expand", __iconNode$c);
3830
- /**
3831
- * @license lucide-react v0.552.0 - ISC
3832
- *
3833
- * This source code is licensed under the ISC license.
3834
- * See the LICENSE file in the root directory of this source tree.
3835
- */
3836
- const __iconNode$b = [
3837
- ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
3838
- ["path", { d: "M10 14 21 3", key: "gplh6r" }],
3839
- ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
3840
- ];
3841
- const ExternalLink = createLucideIcon("external-link", __iconNode$b);
3842
- /**
3843
- * @license lucide-react v0.552.0 - ISC
3844
- *
3845
- * This source code is licensed under the ISC license.
3846
- * See the LICENSE file in the root directory of this source tree.
3847
- */
3848
- const __iconNode$a = [
3849
- [
3850
- "path",
3851
- {
3852
- d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
3853
- key: "1oefj6"
5635
+ /**
5636
+ * Save workspace presets
5637
+ */
5638
+ async saveWorkspacePresets(e) {
5639
+ try {
5640
+ localStorage.setItem(this.PRESETS_KEY, JSON.stringify(e));
5641
+ } catch (t) {
5642
+ throw console.error("Failed to save workspace presets:", t), t;
3854
5643
  }
3855
- ],
3856
- ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
3857
- ["path", { d: "M10 9H8", key: "b1mrlr" }],
3858
- ["path", { d: "M16 13H8", key: "t4e002" }],
3859
- ["path", { d: "M16 17H8", key: "z1uh3a" }]
3860
- ];
3861
- const FileText = createLucideIcon("file-text", __iconNode$a);
3862
- /**
3863
- * @license lucide-react v0.552.0 - ISC
3864
- *
3865
- * This source code is licensed under the ISC license.
3866
- * See the LICENSE file in the root directory of this source tree.
3867
- */
3868
- const __iconNode$9 = [
3869
- ["path", { d: "M12 10v6", key: "1bos4e" }],
3870
- ["path", { d: "M9 13h6", key: "1uhe8q" }],
3871
- [
3872
- "path",
3873
- {
3874
- d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
3875
- key: "1kt360"
5644
+ }
5645
+ /**
5646
+ * Load repository-specific workspace state
5647
+ */
5648
+ async loadRepositoryState(e) {
5649
+ try {
5650
+ const t = `${this.REPO_STATE_PREFIX}${e}`, r2 = localStorage.getItem(t);
5651
+ return r2 ? JSON.parse(r2) : null;
5652
+ } catch (t) {
5653
+ return console.error(
5654
+ `Failed to load repository state for ${e}:`,
5655
+ t
5656
+ ), null;
3876
5657
  }
3877
- ]
3878
- ];
3879
- const FolderPlus = createLucideIcon("folder-plus", __iconNode$9);
3880
- /**
3881
- * @license lucide-react v0.552.0 - ISC
3882
- *
3883
- * This source code is licensed under the ISC license.
3884
- * See the LICENSE file in the root directory of this source tree.
3885
- */
3886
- const __iconNode$8 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
3887
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$8);
3888
- /**
3889
- * @license lucide-react v0.552.0 - ISC
3890
- *
3891
- * This source code is licensed under the ISC license.
3892
- * See the LICENSE file in the root directory of this source tree.
3893
- */
3894
- const __iconNode$7 = [
3895
- ["path", { d: "M12 13v8", key: "1l5pq0" }],
3896
- ["path", { d: "M12 3v3", key: "1n5kay" }],
3897
- [
3898
- "path",
3899
- {
3900
- d: "M4 6a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h13a2 2 0 0 0 1.152-.365l3.424-2.317a1 1 0 0 0 0-1.635l-3.424-2.318A2 2 0 0 0 17 6z",
3901
- key: "1btarq"
5658
+ }
5659
+ /**
5660
+ * Save repository-specific workspace state
5661
+ */
5662
+ async saveRepositoryState(e, t) {
5663
+ try {
5664
+ const r2 = `${this.REPO_STATE_PREFIX}${e}`;
5665
+ localStorage.setItem(r2, JSON.stringify(t));
5666
+ } catch (r2) {
5667
+ throw console.error(
5668
+ `Failed to save repository state for ${e}:`,
5669
+ r2
5670
+ ), r2;
3902
5671
  }
3903
- ]
3904
- ];
3905
- const Milestone = createLucideIcon("milestone", __iconNode$7);
3906
- /**
3907
- * @license lucide-react v0.552.0 - ISC
3908
- *
3909
- * This source code is licensed under the ISC license.
3910
- * See the LICENSE file in the root directory of this source tree.
3911
- */
3912
- const __iconNode$6 = [
3913
- ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
3914
- ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
3915
- ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
3916
- ];
3917
- const Monitor = createLucideIcon("monitor", __iconNode$6);
3918
- /**
3919
- * @license lucide-react v0.552.0 - ISC
3920
- *
3921
- * This source code is licensed under the ISC license.
3922
- * See the LICENSE file in the root directory of this source tree.
3923
- */
3924
- const __iconNode$5 = [
3925
- ["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
3926
- ["path", { d: "M2 12H22", key: "1m8cig" }]
3927
- ];
3928
- const MoveRight = createLucideIcon("move-right", __iconNode$5);
3929
- /**
3930
- * @license lucide-react v0.552.0 - ISC
3931
- *
3932
- * This source code is licensed under the ISC license.
3933
- * See the LICENSE file in the root directory of this source tree.
3934
- */
3935
- const __iconNode$4 = [
3936
- [
3937
- "path",
3938
- {
3939
- d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
3940
- key: "10ikf1"
5672
+ }
5673
+ /**
5674
+ * Load all repository states
5675
+ */
5676
+ async loadAllRepositoryStates() {
5677
+ try {
5678
+ const e = {};
5679
+ for (let t = 0; t < localStorage.length; t++) {
5680
+ const r2 = localStorage.key(t);
5681
+ if (r2 && r2.startsWith(this.REPO_STATE_PREFIX)) {
5682
+ const s2 = r2.substring(this.REPO_STATE_PREFIX.length), i = localStorage.getItem(r2);
5683
+ if (i)
5684
+ try {
5685
+ e[s2] = JSON.parse(i);
5686
+ } catch (l) {
5687
+ console.error(
5688
+ `Failed to parse repository state for ${s2}:`,
5689
+ l
5690
+ );
5691
+ }
5692
+ }
5693
+ }
5694
+ return e;
5695
+ } catch (e) {
5696
+ return console.error("Failed to load all repository states:", e), {};
3941
5697
  }
3942
- ]
3943
- ];
3944
- const Play = createLucideIcon("play", __iconNode$4);
3945
- /**
3946
- * @license lucide-react v0.552.0 - ISC
3947
- *
3948
- * This source code is licensed under the ISC license.
3949
- * See the LICENSE file in the root directory of this source tree.
3950
- */
3951
- const __iconNode$3 = [
3952
- ["path", { d: "M5 12h14", key: "1ays0h" }],
3953
- ["path", { d: "M12 5v14", key: "s699le" }]
3954
- ];
3955
- const Plus = createLucideIcon("plus", __iconNode$3);
3956
- /**
3957
- * @license lucide-react v0.552.0 - ISC
3958
- *
3959
- * This source code is licensed under the ISC license.
3960
- * See the LICENSE file in the root directory of this source tree.
3961
- */
3962
- const __iconNode$2 = [
3963
- ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
3964
- ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
3965
- ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
3966
- ["path", { d: "M8 16H3v5", key: "1cv678" }]
3967
- ];
3968
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$2);
3969
- /**
3970
- * @license lucide-react v0.552.0 - ISC
3971
- *
3972
- * This source code is licensed under the ISC license.
3973
- * See the LICENSE file in the root directory of this source tree.
3974
- */
3975
- const __iconNode$1 = [
3976
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
3977
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
3978
- ];
3979
- const Search = createLucideIcon("search", __iconNode$1);
3980
- /**
3981
- * @license lucide-react v0.552.0 - ISC
3982
- *
3983
- * This source code is licensed under the ISC license.
3984
- * See the LICENSE file in the root directory of this source tree.
3985
- */
3986
- const __iconNode = [
3987
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
3988
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
3989
- ];
3990
- const X = createLucideIcon("x", __iconNode);
3991
- var ThemeContext$1;
3992
- var getThemeContext$1 = () => {
3993
- if (typeof window !== "undefined") {
3994
- const globalWindow = window;
3995
- if (!globalWindow.__principlemd_theme_context__) {
3996
- globalWindow.__principlemd_theme_context__ = createContext(void 0);
5698
+ }
5699
+ }
5700
+ class O {
5701
+ /**
5702
+ * Configure a custom storage adapter (for Electron IPC or remote storage)
5703
+ */
5704
+ static setAdapter(e) {
5705
+ this.adapter = e;
5706
+ }
5707
+ /**
5708
+ * Get all workspace layouts (including built-in)
5709
+ */
5710
+ static async getWorkspaceLayouts() {
5711
+ const e = this.getBuiltInWorkspaceLayouts();
5712
+ return {
5713
+ ...await this.adapter.loadWorkspacePresets(),
5714
+ ...e
5715
+ };
5716
+ }
5717
+ /**
5718
+ * Get a specific workspace layout by ID
5719
+ */
5720
+ static async getWorkspaceLayout(e) {
5721
+ return (await this.getWorkspaceLayouts())[e] || null;
5722
+ }
5723
+ /**
5724
+ * Create a new workspace layout
5725
+ */
5726
+ static async createWorkspaceLayout(e) {
5727
+ const t = await this.adapter.loadWorkspacePresets(), r2 = this.generateWorkspaceId(e.name), s2 = {
5728
+ id: r2,
5729
+ name: e.name,
5730
+ description: e.description,
5731
+ layout: e.layout,
5732
+ defaultSizes: e.defaultSizes,
5733
+ defaultCollapsed: e.defaultCollapsed,
5734
+ createdAt: Date.now(),
5735
+ updatedAt: Date.now(),
5736
+ isBuiltIn: false
5737
+ }, i = {
5738
+ ...t,
5739
+ [r2]: s2
5740
+ };
5741
+ return await this.adapter.saveWorkspacePresets(i), s2;
5742
+ }
5743
+ /**
5744
+ * Update an existing workspace layout
5745
+ */
5746
+ static async updateWorkspaceLayout(e, t) {
5747
+ const r2 = await this.adapter.loadWorkspacePresets(), s2 = r2[e];
5748
+ if (!s2)
5749
+ return console.error(`Workspace layout ${e} not found`), null;
5750
+ if (s2.isBuiltIn)
5751
+ return console.error(`Cannot update built-in workspace layout ${e}`), null;
5752
+ const i = {
5753
+ ...s2,
5754
+ ...t,
5755
+ id: e,
5756
+ // Preserve ID
5757
+ createdAt: s2.createdAt,
5758
+ // Preserve creation time
5759
+ updatedAt: Date.now()
5760
+ }, l = {
5761
+ ...r2,
5762
+ [e]: i
5763
+ };
5764
+ return await this.adapter.saveWorkspacePresets(l), i;
5765
+ }
5766
+ /**
5767
+ * Delete a workspace layout
5768
+ */
5769
+ static async deleteWorkspaceLayout(e) {
5770
+ const t = await this.adapter.loadWorkspacePresets(), r2 = t[e];
5771
+ if (!r2)
5772
+ return console.error(`Workspace layout ${e} not found`), false;
5773
+ if (r2.isBuiltIn)
5774
+ return console.error(`Cannot delete built-in workspace layout ${e}`), false;
5775
+ const s2 = { ...t };
5776
+ return delete s2[e], await this.adapter.saveWorkspacePresets(s2), true;
5777
+ }
5778
+ /**
5779
+ * Get repository state (which workspace + current sizes/collapsed)
5780
+ */
5781
+ static async getRepositoryState(e) {
5782
+ return await this.adapter.loadRepositoryState(e);
5783
+ }
5784
+ /**
5785
+ * Set repository state (which workspace + current sizes/collapsed/layout)
5786
+ */
5787
+ static async setRepositoryState(e, t) {
5788
+ await this.adapter.saveRepositoryState(e, t);
5789
+ }
5790
+ /**
5791
+ * Update only sizes in repository state
5792
+ */
5793
+ static async updateRepositorySizes(e, t) {
5794
+ const r2 = await this.getRepositoryState(e);
5795
+ r2 && await this.setRepositoryState(e, {
5796
+ ...r2,
5797
+ sizes: t
5798
+ });
5799
+ }
5800
+ /**
5801
+ * Update only collapsed state in repository state
5802
+ */
5803
+ static async updateRepositoryCollapsed(e, t) {
5804
+ const r2 = await this.getRepositoryState(e);
5805
+ r2 && await this.setRepositoryState(e, {
5806
+ ...r2,
5807
+ collapsed: t
5808
+ });
5809
+ }
5810
+ /**
5811
+ * Check if repository state differs from workspace defaults
5812
+ */
5813
+ static hasStateDeviation(e, t) {
5814
+ const r2 = t.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(t.defaultSizes) : false, s2 = t.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(t.defaultCollapsed) : false;
5815
+ return { hasSizeDeviation: r2, hasCollapsedDeviation: s2 };
5816
+ }
5817
+ /**
5818
+ * Update workspace defaults from repository state
5819
+ */
5820
+ static async updateWorkspaceFromRepositoryState(e, t) {
5821
+ const r2 = await this.getWorkspaceLayout(e), s2 = await this.getRepositoryState(t);
5822
+ if (!r2 || !s2 || r2.isBuiltIn) {
5823
+ console.error(
5824
+ "Cannot update built-in workspace or workspace/state not found"
5825
+ );
5826
+ return;
3997
5827
  }
3998
- return globalWindow.__principlemd_theme_context__;
3999
- } else {
4000
- if (!ThemeContext$1) {
4001
- ThemeContext$1 = createContext(void 0);
5828
+ await this.updateWorkspaceLayout(e, {
5829
+ defaultSizes: s2.sizes,
5830
+ defaultCollapsed: s2.collapsed
5831
+ });
5832
+ }
5833
+ /**
5834
+ * Reset repository state to workspace defaults
5835
+ */
5836
+ static async resetRepositoryToWorkspaceDefaults(e, t) {
5837
+ const r2 = await this.getWorkspaceLayout(t);
5838
+ if (!r2) {
5839
+ console.error(`Workspace ${t} not found`);
5840
+ return;
4002
5841
  }
4003
- return ThemeContext$1;
5842
+ const s2 = await this.getRepositoryState(e);
5843
+ s2 && await this.setRepositoryState(e, {
5844
+ ...s2,
5845
+ sizes: r2.defaultSizes || { left: 20, middle: 45, right: 35 },
5846
+ collapsed: r2.defaultCollapsed || { left: false, right: false }
5847
+ });
4004
5848
  }
4005
- };
4006
- var ThemeContextSingleton = getThemeContext$1();
4007
- var useTheme = () => {
4008
- const context = useContext(ThemeContextSingleton);
4009
- if (!context) {
4010
- throw new Error("useTheme must be used within a ThemeProvider");
5849
+ /**
5850
+ * Check if a layout matches a workspace layout
5851
+ */
5852
+ static isLayoutMatchingWorkspace(e, t) {
5853
+ return this.areLayoutsEqual(e, t.layout);
4011
5854
  }
4012
- return context;
4013
- };
5855
+ /**
5856
+ * Find workspace ID that matches the given layout
5857
+ */
5858
+ static async findMatchingWorkspace(e) {
5859
+ const t = await this.getWorkspaceLayouts();
5860
+ for (const [r2, s2] of Object.entries(t))
5861
+ if (this.isLayoutMatchingWorkspace(e, s2))
5862
+ return r2;
5863
+ return null;
5864
+ }
5865
+ /**
5866
+ * Deep comparison of two panel layouts
5867
+ */
5868
+ static areLayoutsEqual(e, t) {
5869
+ return JSON.stringify(e) === JSON.stringify(t);
5870
+ }
5871
+ /**
5872
+ * Generate a unique ID from a workspace name
5873
+ */
5874
+ static generateWorkspaceId(e) {
5875
+ return `${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}-${Date.now()}`;
5876
+ }
5877
+ /**
5878
+ * Get built-in workspace layouts
5879
+ */
5880
+ static getBuiltInWorkspaceLayouts() {
5881
+ const e = Date.now();
5882
+ return {
5883
+ "project-management": {
5884
+ id: "project-management",
5885
+ name: "Project Management",
5886
+ description: "Tasks, dependencies, issues, file tree, docs, drawings, multi terminal, city visualization, code viewer, markdown slides, and excalidraw",
5887
+ layout: {
5888
+ left: {
5889
+ type: "tabs",
5890
+ panels: [
5891
+ "tasks",
5892
+ "dependencies",
5893
+ "gitIssues",
5894
+ "fileTree",
5895
+ "docs",
5896
+ "drawings"
5897
+ ],
5898
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5899
+ },
5900
+ middle: "multiTerminal",
5901
+ right: {
5902
+ type: "tabs",
5903
+ panels: [
5904
+ "cityVisualization",
5905
+ "codeViewer",
5906
+ "markdownViewer",
5907
+ "excalidrawDiagram"
5908
+ ],
5909
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5910
+ }
5911
+ },
5912
+ defaultSizes: { left: 20, middle: 45, right: 35 },
5913
+ defaultCollapsed: { left: false, right: false },
5914
+ createdAt: e,
5915
+ updatedAt: e,
5916
+ isBuiltIn: true
5917
+ },
5918
+ "code-review": {
5919
+ id: "code-review",
5920
+ name: "Code Review",
5921
+ description: "Git changes, pull requests, and file tree on left, git diff and code viewer in middle, city map on right",
5922
+ layout: {
5923
+ left: {
5924
+ type: "tabs",
5925
+ panels: ["gitChanges", "gitPullRequests", "fileTree"],
5926
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5927
+ },
5928
+ middle: {
5929
+ type: "tabs",
5930
+ panels: ["gitDiff", "codeViewer"],
5931
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5932
+ },
5933
+ right: "cityVisualization"
5934
+ },
5935
+ defaultSizes: { left: 20, middle: 50, right: 30 },
5936
+ defaultCollapsed: { left: false, right: false },
5937
+ createdAt: e,
5938
+ updatedAt: e,
5939
+ isBuiltIn: true
5940
+ },
5941
+ documentation: {
5942
+ id: "documentation",
5943
+ name: "Documentation",
5944
+ description: "Docs, markdown viewer, and code viewer",
5945
+ layout: {
5946
+ left: "docs",
5947
+ middle: "markdownViewer",
5948
+ right: "codeViewer"
5949
+ },
5950
+ defaultSizes: { left: 20, middle: 50, right: 30 },
5951
+ defaultCollapsed: { left: false, right: true },
5952
+ createdAt: e,
5953
+ updatedAt: e,
5954
+ isBuiltIn: true
5955
+ },
5956
+ "agent-work": {
5957
+ id: "agent-work",
5958
+ name: "Agent Work",
5959
+ description: "Tasks, agent sessions, file tree, agent context, git changes, docs, multi terminal, city map, agent events, code viewer, and markdown slides",
5960
+ layout: {
5961
+ left: {
5962
+ type: "tabs",
5963
+ panels: [
5964
+ "tasks",
5965
+ "agentSessions",
5966
+ "fileTree",
5967
+ "agentContext",
5968
+ "gitChanges",
5969
+ "docs"
5970
+ ],
5971
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5972
+ },
5973
+ middle: "multiTerminal",
5974
+ right: {
5975
+ type: "tabs",
5976
+ panels: [
5977
+ "cityVisualization",
5978
+ "agentEvents",
5979
+ "codeViewer",
5980
+ "markdownViewer"
5981
+ ],
5982
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5983
+ }
5984
+ },
5985
+ defaultSizes: { left: 20, middle: 45, right: 35 },
5986
+ defaultCollapsed: { left: false, right: false },
5987
+ createdAt: e,
5988
+ updatedAt: e,
5989
+ isBuiltIn: true
5990
+ },
5991
+ "quality-check": {
5992
+ id: "quality-check",
5993
+ name: "Quality Check",
5994
+ description: "Package information, tools, and dependencies on left; city visualization map in middle; multi terminal and code viewer on right (collapsed)",
5995
+ layout: {
5996
+ left: {
5997
+ type: "tabs",
5998
+ panels: ["packageInfo", "tools", "dependencies"],
5999
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6000
+ },
6001
+ middle: "cityVisualization",
6002
+ right: {
6003
+ type: "tabs",
6004
+ panels: ["multiTerminal", "codeViewer"],
6005
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6006
+ }
6007
+ },
6008
+ defaultSizes: { left: 20, middle: 45, right: 35 },
6009
+ defaultCollapsed: { left: false, right: true },
6010
+ createdAt: e,
6011
+ updatedAt: e,
6012
+ isBuiltIn: true
6013
+ },
6014
+ drawing: {
6015
+ id: "drawing",
6016
+ name: "Drawing",
6017
+ description: "Drawings and docs, excalidraw diagram, multi terminal and markdown viewer",
6018
+ layout: {
6019
+ left: {
6020
+ type: "tabs",
6021
+ panels: ["drawings", "docs"],
6022
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6023
+ },
6024
+ middle: "excalidrawDiagram",
6025
+ right: {
6026
+ type: "tabs",
6027
+ panels: ["multiTerminal", "markdownViewer"],
6028
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6029
+ }
6030
+ },
6031
+ defaultSizes: { left: 20, middle: 50, right: 30 },
6032
+ defaultCollapsed: { left: false, right: true },
6033
+ createdAt: e,
6034
+ updatedAt: e,
6035
+ isBuiltIn: true
6036
+ },
6037
+ "old-school": {
6038
+ id: "old-school",
6039
+ name: "Old School",
6040
+ description: "File tree, search, git changes, and docs on left; code viewer and markdown viewer in middle; multi terminal and city map on right (collapsed)",
6041
+ layout: {
6042
+ left: {
6043
+ type: "tabs",
6044
+ panels: ["fileTree", "search", "gitChanges", "docs"],
6045
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6046
+ },
6047
+ middle: {
6048
+ type: "tabs",
6049
+ panels: ["codeViewer", "markdownViewer"],
6050
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6051
+ },
6052
+ right: {
6053
+ type: "tabs",
6054
+ panels: ["multiTerminal", "cityVisualization"],
6055
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6056
+ }
6057
+ },
6058
+ defaultSizes: { left: 20, middle: 50, right: 30 },
6059
+ defaultCollapsed: { left: false, right: true },
6060
+ createdAt: e,
6061
+ updatedAt: e,
6062
+ isBuiltIn: true
6063
+ },
6064
+ "principal-office": {
6065
+ id: "principal-office",
6066
+ name: "Principal Office",
6067
+ description: "Alexandria docs on left, MDX editor in middle, multi terminal on right",
6068
+ layout: {
6069
+ left: "docs",
6070
+ middle: "mdxEditor",
6071
+ right: "multiTerminal"
6072
+ },
6073
+ defaultSizes: { left: 20, middle: 50, right: 30 },
6074
+ defaultCollapsed: { left: false, right: false },
6075
+ createdAt: e,
6076
+ updatedAt: e,
6077
+ isBuiltIn: true
6078
+ }
6079
+ };
6080
+ }
6081
+ /**
6082
+ * Initialize workspace layouts with built-in defaults if none exist
6083
+ */
6084
+ static async initializeWorkspaceLayouts() {
6085
+ const e = await this.adapter.loadWorkspacePresets();
6086
+ Object.keys(e).length;
6087
+ }
6088
+ }
6089
+ le(O, "adapter", new De());
6090
+ function gt(o, e, t, r2) {
6091
+ useEffect(() => {
6092
+ const s2 = e.on(
6093
+ "panel:focus",
6094
+ (l) => {
6095
+ l.payload.panelId === o && t();
6096
+ }
6097
+ );
6098
+ return () => {
6099
+ s2();
6100
+ };
6101
+ }, [o, e, t, r2]);
6102
+ }
4014
6103
  function parseTaskMarkdown(content2, filePath) {
4015
6104
  const { frontmatter, title, rawContent, acceptanceCriteria, description } = parseMarkdownContent(content2);
4016
6105
  const id = extractIdFromPath(filePath);
@@ -6216,18 +8305,40 @@ const TaskCard = ({
6216
8305
  }
6217
8306
  },
6218
8307
  children: [
6219
- /* @__PURE__ */ jsx(
6220
- "h4",
6221
- {
6222
- style: {
6223
- margin: "0 0 8px 0",
6224
- fontSize: theme2.fontSizes[2],
6225
- color: isSelected ? getPriorityColor(task.priority) : theme2.colors.text,
6226
- fontWeight: theme2.fontWeights.medium
6227
- },
6228
- children: displayTitle
6229
- }
6230
- ),
8308
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", marginBottom: "8px" }, children: [
8309
+ /* @__PURE__ */ jsx(
8310
+ "h4",
8311
+ {
8312
+ style: {
8313
+ margin: 0,
8314
+ fontSize: theme2.fontSizes[2],
8315
+ color: isSelected ? getPriorityColor(task.priority) : theme2.colors.text,
8316
+ fontWeight: theme2.fontWeights.medium,
8317
+ flex: 1
8318
+ },
8319
+ children: displayTitle
8320
+ }
8321
+ ),
8322
+ getGitHubIssueFromRefs$1(task.references) && /* @__PURE__ */ jsx(
8323
+ "div",
8324
+ {
8325
+ style: {
8326
+ display: "flex",
8327
+ alignItems: "center",
8328
+ gap: "3px",
8329
+ padding: "2px 6px",
8330
+ borderRadius: theme2.radii[1],
8331
+ background: `${theme2.colors.success}20`,
8332
+ color: theme2.colors.success,
8333
+ fontSize: theme2.fontSizes[0],
8334
+ fontWeight: theme2.fontWeights.medium,
8335
+ flexShrink: 0
8336
+ },
8337
+ title: "Assigned to Claude",
8338
+ children: /* @__PURE__ */ jsx(GitBranch, { size: 10 })
8339
+ }
8340
+ )
8341
+ ] }),
6231
8342
  task.description && /* @__PURE__ */ jsx(
6232
8343
  "p",
6233
8344
  {
@@ -7812,7 +9923,7 @@ const KanbanPanel = ({
7812
9923
  const [selectedTaskId, setSelectedTaskId] = useState(null);
7813
9924
  const [selectedTab, setSelectedTab] = useState("todo");
7814
9925
  const [isNarrowView, setIsNarrowView] = useState(false);
7815
- const containerRef = useRef(null);
9926
+ const kanbanPanelRef = useRef(null);
7816
9927
  const [viewMode, setViewMode] = useState("board");
7817
9928
  const [activeTask, setActiveTask] = useState(null);
7818
9929
  const [isTaskModalOpen, setIsTaskModalOpen] = useState(false);
@@ -7837,7 +9948,7 @@ const KanbanPanel = ({
7837
9948
  }
7838
9949
  };
7839
9950
  useLayoutEffect(() => {
7840
- const container = containerRef.current;
9951
+ const container = kanbanPanelRef.current;
7841
9952
  if (!container) return;
7842
9953
  const observer = new ResizeObserver((entries) => {
7843
9954
  for (const entry of entries) {
@@ -7847,6 +9958,14 @@ const KanbanPanel = ({
7847
9958
  observer.observe(container);
7848
9959
  return () => observer.disconnect();
7849
9960
  }, []);
9961
+ gt(
9962
+ "backlog-kanban",
9963
+ events2,
9964
+ () => {
9965
+ var _a2;
9966
+ return (_a2 = kanbanPanelRef.current) == null ? void 0 : _a2.focus();
9967
+ }
9968
+ );
7850
9969
  useEffect(() => {
7851
9970
  if (!events2) return;
7852
9971
  const unsubscribe = events2.on("task:selected", (event) => {
@@ -8068,7 +10187,8 @@ const KanbanPanel = ({
8068
10187
  return /* @__PURE__ */ jsxs(
8069
10188
  "div",
8070
10189
  {
8071
- ref: containerRef,
10190
+ ref: kanbanPanelRef,
10191
+ tabIndex: -1,
8072
10192
  style: {
8073
10193
  padding: "clamp(12px, 3vw, 20px)",
8074
10194
  // Responsive padding for mobile
@@ -8082,7 +10202,9 @@ const KanbanPanel = ({
8082
10202
  overflow: "hidden",
8083
10203
  // Prevent outer scrolling
8084
10204
  backgroundColor: theme2.colors.background,
8085
- color: theme2.colors.text
10205
+ color: theme2.colors.text,
10206
+ outline: "none"
10207
+ // Remove default focus outline
8086
10208
  },
8087
10209
  children: [
8088
10210
  /* @__PURE__ */ jsxs(
@@ -45777,20 +47899,20 @@ class EditMap {
45777
47899
  this.map.length = 0;
45778
47900
  }
45779
47901
  }
45780
- function addImplementation(editMap, at, remove, add2) {
47902
+ function addImplementation(editMap, at2, remove, add2) {
45781
47903
  let index2 = 0;
45782
47904
  if (remove === 0 && add2.length === 0) {
45783
47905
  return;
45784
47906
  }
45785
47907
  while (index2 < editMap.map.length) {
45786
- if (editMap.map[index2][0] === at) {
47908
+ if (editMap.map[index2][0] === at2) {
45787
47909
  editMap.map[index2][1] += remove;
45788
47910
  editMap.map[index2][2].push(...add2);
45789
47911
  return;
45790
47912
  }
45791
47913
  index2 += 1;
45792
47914
  }
45793
- editMap.map.push([at, remove, add2]);
47915
+ editMap.map.push([at2, remove, add2]);
45794
47916
  }
45795
47917
  function gfmTableAlign(events2, index2) {
45796
47918
  let inDelimiterRow = false;
@@ -47947,7 +50069,7 @@ var css_248z = ".transform-component-module_wrapper__SPB86 {\n position: relati
47947
50069
  var styles = { "wrapper": "transform-component-module_wrapper__SPB86", "content": "transform-component-module_content__FBWxo" };
47948
50070
  styleInject(css_248z);
47949
50071
  var TransformComponent = function(_a) {
47950
- var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e = _a.contentProps, contentProps = _e === void 0 ? {} : _e;
50072
+ var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e2 = _a.contentProps, contentProps = _e2 === void 0 ? {} : _e2;
47951
50073
  var _f = useContext(Context), init = _f.init, cleanupWindowEvents = _f.cleanupWindowEvents;
47952
50074
  var wrapperRef = useRef(null);
47953
50075
  var contentRef = useRef(null);
@@ -49443,7 +51565,7 @@ var createIndustryMarkdownComponents = ({
49443
51565
  ...props
49444
51566
  }, children2),
49445
51567
  li: ({ children: children2, ...props }) => {
49446
- var _a, _b, _c, _d, _e, _f, _g, _h;
51568
+ var _a, _b, _c, _d, _e2, _f, _g, _h;
49447
51569
  const isTaskListItem = Array.isArray(children2) && children2.length > 0 && React2__default.isValidElement(children2[0]) && ((_b = (_a = children2[0]) == null ? void 0 : _a.props) == null ? void 0 : _b.type) === "checkbox";
49448
51570
  if (isTaskListItem) {
49449
51571
  const checkbox = children2[0];
@@ -49458,7 +51580,7 @@ var createIndustryMarkdownComponents = ({
49458
51580
  }
49459
51581
  });
49460
51582
  const checked = ((_c = checkbox == null ? void 0 : checkbox.props) == null ? void 0 : _c.checked) || false;
49461
- const lineNumber = ((_e = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
51583
+ const lineNumber = ((_e2 = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e2.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
49462
51584
  const id = `${slideIdPrefix}-checkbox-${lineNumber}`;
49463
51585
  const isChecked = checkedItems[id] ?? checked;
49464
51586
  const handleChange = (e) => {
@@ -49603,7 +51725,7 @@ var createIndustryMarkdownComponents = ({
49603
51725
  });
49604
51726
  },
49605
51727
  code: ({ node: node2, className, children: children2, ...props }) => {
49606
- var _a, _b, _c, _d, _e, _f;
51728
+ var _a, _b, _c, _d, _e2, _f;
49607
51729
  const hasLanguageClass = className && (className.includes("language-") || className.includes("hljs"));
49608
51730
  const codeString = extractTextFromChildren(children2);
49609
51731
  const matchLang = /language-(\w+)/.exec(className || "");
@@ -49815,7 +51937,7 @@ var createIndustryMarkdownComponents = ({
49815
51937
  ...props
49816
51938
  }, children2)));
49817
51939
  }
49818
- const cleanClassName = (_f = (_e = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
51940
+ const cleanClassName = (_f = (_e2 = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e2.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
49819
51941
  return /* @__PURE__ */ React2__default.createElement("code", {
49820
51942
  style: {
49821
51943
  color: theme2.colors.accent,
@@ -50854,7 +52976,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
50854
52976
  }
50855
52977
  }, [slideIndex]);
50856
52978
  const sanitizeSchema = useMemo(() => {
50857
- 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, _E, _F, _G, _H, _I, _J;
52979
+ var _a, _b, _c, _d, _e2, _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, _E, _F, _G, _H, _I, _J;
50858
52980
  return {
50859
52981
  ...defaultSchema,
50860
52982
  tagNames: [...defaultSchema.tagNames || [], "picture", "source", "mark"],
@@ -50865,7 +52987,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
50865
52987
  span: [...((_b = defaultSchema.attributes) == null ? void 0 : _b.span) || [], "className", "style"],
50866
52988
  pre: [...((_c = defaultSchema.attributes) == null ? void 0 : _c.pre) || [], "className", "style"],
50867
52989
  div: [...((_d = defaultSchema.attributes) == null ? void 0 : _d.div) || [], "style", "className", "id"],
50868
- p: [...((_e = defaultSchema.attributes) == null ? void 0 : _e.p) || [], "style", "className", "id"],
52990
+ p: [...((_e2 = defaultSchema.attributes) == null ? void 0 : _e2.p) || [], "style", "className", "id"],
50869
52991
  h1: [...((_f = defaultSchema.attributes) == null ? void 0 : _f.h1) || [], "style", "className", "id"],
50870
52992
  h2: [...((_g = defaultSchema.attributes) == null ? void 0 : _g.h2) || [], "style", "className", "id"],
50871
52993
  h3: [...((_h = defaultSchema.attributes) == null ? void 0 : _h.h3) || [], "style", "className", "id"],
@@ -52680,14 +54802,14 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
52680
54802
  const y2 = o2.length, w2 = 2 * u2;
52681
54803
  let x2;
52682
54804
  x2 = y2 === 1 || y2 === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
52683
- const C = React2__default.useId().replace(/:/g, "_");
54805
+ const C2 = React2__default.useId().replace(/:/g, "_");
52684
54806
  return jsxs(Fragment, { children: [
52685
54807
  y2 === 2 && /* @__PURE__ */ jsx("style", { children: `
52686
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
54808
+ .snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
52687
54809
  width: 100%;
52688
54810
  }
52689
54811
  @container (min-width: ${w2}px) {
52690
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
54812
+ .snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
52691
54813
  width: 50%;
52692
54814
  }
52693
54815
  }
@@ -52702,7 +54824,7 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
52702
54824
  a3 < o3 && (o3 = a3, r2 = i2);
52703
54825
  }
52704
54826
  m2(r2);
52705
- }, "data-panel-count": y2, "data-carousel-id": C, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
54827
+ }, "data-panel-count": y2, "data-carousel-id": C2, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
52706
54828
  ] });
52707
54829
  });
52708
54830
  M.displayName = "SnapCarousel";
@@ -52889,7 +55011,18 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
52889
55011
  const { theme: theme2 } = useTheme();
52890
55012
  const [selectedTask, setSelectedTask] = useState(null);
52891
55013
  const [claudeAssignment, setClaudeAssignment] = useState({ status: "idle" });
55014
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
55015
+ const [deleteState, setDeleteState] = useState({ status: "idle" });
55016
+ const panelRef = useRef(null);
52892
55017
  const { editable = false } = config ?? {};
55018
+ gt(
55019
+ "task-detail",
55020
+ events2,
55021
+ () => {
55022
+ var _a2;
55023
+ return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
55024
+ }
55025
+ );
52893
55026
  const repoCapabilities = context.getRepositorySlice("repoCapabilities");
52894
55027
  const hasClaudeWorkflow = ((_a = repoCapabilities == null ? void 0 : repoCapabilities.data) == null ? void 0 : _a.hasClaudeWorkflow) ?? false;
52895
55028
  const handleAssignToClaude = useCallback(() => {
@@ -52918,6 +55051,19 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
52918
55051
  }
52919
55052
  });
52920
55053
  }, [events2, selectedTask]);
55054
+ const handleDeleteConfirm = useCallback(() => {
55055
+ if (!events2 || !selectedTask) return;
55056
+ setDeleteState({ status: "loading" });
55057
+ events2.emit({
55058
+ type: "task:delete-requested",
55059
+ source: "task-detail-panel",
55060
+ timestamp: Date.now(),
55061
+ payload: {
55062
+ taskId: selectedTask.id,
55063
+ task: selectedTask
55064
+ }
55065
+ });
55066
+ }, [events2, selectedTask]);
52921
55067
  useEffect(() => {
52922
55068
  if (!events2) return;
52923
55069
  const handleTaskSelected = (event) => {
@@ -52960,8 +55106,46 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
52960
55106
  });
52961
55107
  };
52962
55108
  }, [events2, selectedTask == null ? void 0 : selectedTask.id]);
55109
+ useEffect(() => {
55110
+ if (!events2) return;
55111
+ const unsubscribers = [
55112
+ events2.on("task:deleted:success", (event) => {
55113
+ const payload = event.payload;
55114
+ if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
55115
+ setDeleteState({ status: "success" });
55116
+ setIsDeleteModalOpen(false);
55117
+ setTimeout(() => {
55118
+ events2.emit({
55119
+ type: "task:deleted",
55120
+ source: "task-detail-panel",
55121
+ timestamp: Date.now(),
55122
+ payload: { taskId: payload.taskId }
55123
+ });
55124
+ setSelectedTask(null);
55125
+ setDeleteState({ status: "idle" });
55126
+ }, 2e3);
55127
+ }
55128
+ }),
55129
+ events2.on("task:deleted:error", (event) => {
55130
+ const payload = event.payload;
55131
+ if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
55132
+ setDeleteState({
55133
+ status: "error",
55134
+ error: payload.error
55135
+ });
55136
+ }
55137
+ })
55138
+ ];
55139
+ return () => {
55140
+ unsubscribers.forEach((unsub) => {
55141
+ if (typeof unsub === "function") unsub();
55142
+ });
55143
+ };
55144
+ }, [events2, selectedTask == null ? void 0 : selectedTask.id]);
52963
55145
  const handleBack = () => {
52964
55146
  setSelectedTask(null);
55147
+ setDeleteState({ status: "idle" });
55148
+ setIsDeleteModalOpen(false);
52965
55149
  if (events2) {
52966
55150
  events2.emit({
52967
55151
  type: "task:deselected",
@@ -53021,13 +55205,16 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
53021
55205
  return /* @__PURE__ */ jsxs(
53022
55206
  "div",
53023
55207
  {
55208
+ ref: panelRef,
55209
+ tabIndex: -1,
53024
55210
  style: {
53025
55211
  height: "100%",
53026
55212
  display: "flex",
53027
55213
  flexDirection: "column",
53028
55214
  backgroundColor: theme2.colors.background,
53029
55215
  color: theme2.colors.text,
53030
- overflow: "hidden"
55216
+ overflow: "hidden",
55217
+ outline: "none"
53031
55218
  },
53032
55219
  children: [
53033
55220
  /* @__PURE__ */ jsxs(
@@ -53065,194 +55252,262 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
53065
55252
  selectedTask.priority && /* @__PURE__ */ jsx("span", { style: getPriorityStyles(theme2, selectedTask.priority), children: selectedTask.priority }),
53066
55253
  /* @__PURE__ */ jsx(StatusBadge, { status: selectedTask.status })
53067
55254
  ] }),
53068
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
53069
- hasClaudeWorkflow && claudeAssignment.status === "idle" && !getGitHubIssueFromRefs(selectedTask.references) && /* @__PURE__ */ jsxs(
53070
- "button",
53071
- {
53072
- onClick: handleAssignToClaude,
53073
- style: {
53074
- display: "flex",
53075
- alignItems: "center",
53076
- gap: "6px",
53077
- padding: "6px 12px",
53078
- border: `1px solid ${theme2.colors.primary}`,
53079
- borderRadius: theme2.radii[1],
53080
- background: "transparent",
53081
- cursor: "pointer",
53082
- color: theme2.colors.primary,
53083
- fontSize: theme2.fontSizes[1],
53084
- fontWeight: theme2.fontWeights.medium,
53085
- transition: "all 0.2s ease"
53086
- },
53087
- onMouseEnter: (e) => {
53088
- e.currentTarget.style.background = theme2.colors.primary;
53089
- e.currentTarget.style.color = theme2.colors.background;
53090
- },
53091
- onMouseLeave: (e) => {
53092
- e.currentTarget.style.background = "transparent";
53093
- e.currentTarget.style.color = theme2.colors.primary;
53094
- },
53095
- title: "Assign to Claude",
53096
- children: [
53097
- /* @__PURE__ */ jsx(Bot, { size: 14 }),
53098
- "Assign to Claude"
53099
- ]
53100
- }
53101
- ),
53102
- (() => {
53103
- const existingIssue = getGitHubIssueFromRefs(selectedTask.references);
53104
- if (!existingIssue || claudeAssignment.status !== "idle") return null;
53105
- return /* @__PURE__ */ jsxs(
53106
- "a",
53107
- {
53108
- href: existingIssue.url,
53109
- target: "_blank",
53110
- rel: "noopener noreferrer",
53111
- style: {
53112
- display: "flex",
53113
- alignItems: "center",
53114
- gap: "6px",
53115
- padding: "6px 12px",
53116
- border: `1px solid ${theme2.colors.primary}`,
53117
- borderRadius: theme2.radii[1],
53118
- background: "transparent",
53119
- color: theme2.colors.primary,
53120
- fontSize: theme2.fontSizes[1],
53121
- fontWeight: theme2.fontWeights.medium,
53122
- textDecoration: "none",
53123
- transition: "all 0.2s ease"
53124
- },
53125
- onMouseEnter: (e) => {
53126
- e.currentTarget.style.background = theme2.colors.primary;
53127
- e.currentTarget.style.color = theme2.colors.background;
53128
- },
53129
- onMouseLeave: (e) => {
53130
- e.currentTarget.style.background = "transparent";
53131
- e.currentTarget.style.color = theme2.colors.primary;
53132
- },
53133
- title: `View issue #${existingIssue.number} on GitHub`,
53134
- children: [
53135
- /* @__PURE__ */ jsx(Bot, { size: 14 }),
53136
- "View Progress",
53137
- /* @__PURE__ */ jsx(ExternalLink, { size: 12 })
53138
- ]
53139
- }
53140
- );
53141
- })(),
53142
- claudeAssignment.status === "loading" && /* @__PURE__ */ jsxs(
53143
- "div",
53144
- {
53145
- style: {
53146
- display: "flex",
53147
- alignItems: "center",
53148
- gap: "6px",
53149
- padding: "6px 12px",
53150
- color: theme2.colors.textSecondary,
53151
- fontSize: theme2.fontSizes[1]
53152
- },
53153
- children: [
53154
- /* @__PURE__ */ jsx(LoaderCircle, { size: 14, style: { animation: "spin 1s linear infinite" } }),
53155
- "Assigning..."
53156
- ]
53157
- }
53158
- ),
53159
- claudeAssignment.status === "success" && /* @__PURE__ */ jsxs(
53160
- "a",
53161
- {
53162
- href: claudeAssignment.issueUrl,
53163
- target: "_blank",
53164
- rel: "noopener noreferrer",
53165
- style: {
53166
- display: "flex",
53167
- alignItems: "center",
53168
- gap: "6px",
53169
- padding: "6px 12px",
53170
- border: `1px solid ${theme2.colors.success}`,
53171
- borderRadius: theme2.radii[1],
53172
- background: `${theme2.colors.success}15`,
53173
- color: theme2.colors.success,
53174
- fontSize: theme2.fontSizes[1],
53175
- fontWeight: theme2.fontWeights.medium,
53176
- textDecoration: "none",
53177
- transition: "all 0.2s ease"
53178
- },
53179
- children: [
53180
- /* @__PURE__ */ jsx(CircleCheckBig, { size: 14 }),
53181
- "Issue #",
53182
- claudeAssignment.issueNumber
53183
- ]
53184
- }
53185
- ),
53186
- claudeAssignment.status === "error" && /* @__PURE__ */ jsxs(
53187
- "div",
53188
- {
53189
- style: {
53190
- display: "flex",
53191
- alignItems: "center",
53192
- gap: "6px",
53193
- padding: "6px 12px",
53194
- border: `1px solid ${theme2.colors.error}`,
53195
- borderRadius: theme2.radii[1],
53196
- background: `${theme2.colors.error}15`,
53197
- color: theme2.colors.error,
53198
- fontSize: theme2.fontSizes[1]
53199
- },
53200
- title: claudeAssignment.error,
53201
- children: [
53202
- /* @__PURE__ */ jsx(CircleAlert, { size: 14 }),
53203
- "Failed",
53204
- /* @__PURE__ */ jsx(
53205
- "button",
53206
- {
53207
- onClick: () => setClaudeAssignment({ status: "idle" }),
53208
- style: {
53209
- background: "none",
53210
- border: "none",
53211
- color: theme2.colors.error,
53212
- cursor: "pointer",
53213
- padding: "0 0 0 4px",
53214
- fontSize: theme2.fontSizes[0],
53215
- textDecoration: "underline"
53216
- },
53217
- children: "Retry"
53218
- }
53219
- )
53220
- ]
53221
- }
53222
- ),
55255
+ /* @__PURE__ */ jsx(
55256
+ "button",
55257
+ {
55258
+ onClick: handleBack,
55259
+ style: {
55260
+ display: "flex",
55261
+ alignItems: "center",
55262
+ justifyContent: "center",
55263
+ width: "32px",
55264
+ height: "32px",
55265
+ border: `1px solid ${theme2.colors.border}`,
55266
+ borderRadius: theme2.radii[1],
55267
+ background: theme2.colors.surface,
55268
+ cursor: "pointer",
55269
+ color: theme2.colors.textSecondary,
55270
+ transition: "all 0.2s ease"
55271
+ },
55272
+ onMouseEnter: (e) => {
55273
+ e.currentTarget.style.background = theme2.colors.backgroundSecondary;
55274
+ e.currentTarget.style.color = theme2.colors.text;
55275
+ },
55276
+ onMouseLeave: (e) => {
55277
+ e.currentTarget.style.background = theme2.colors.surface;
55278
+ e.currentTarget.style.color = theme2.colors.textSecondary;
55279
+ },
55280
+ title: "Close",
55281
+ children: /* @__PURE__ */ jsx(X, { size: 16 })
55282
+ }
55283
+ )
55284
+ ]
55285
+ }
55286
+ ),
55287
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "12px" }, children: [
55288
+ hasClaudeWorkflow && claudeAssignment.status === "idle" && !getGitHubIssueFromRefs(selectedTask.references) && /* @__PURE__ */ jsxs(
55289
+ "button",
55290
+ {
55291
+ onClick: handleAssignToClaude,
55292
+ style: {
55293
+ flex: 1,
55294
+ display: "flex",
55295
+ alignItems: "center",
55296
+ justifyContent: "center",
55297
+ gap: "6px",
55298
+ padding: "6px 12px",
55299
+ border: `1px solid ${theme2.colors.primary}`,
55300
+ borderRadius: theme2.radii[1],
55301
+ background: "transparent",
55302
+ cursor: "pointer",
55303
+ color: theme2.colors.primary,
55304
+ fontSize: theme2.fontSizes[1],
55305
+ fontWeight: theme2.fontWeights.medium,
55306
+ transition: "all 0.2s ease"
55307
+ },
55308
+ onMouseEnter: (e) => {
55309
+ e.currentTarget.style.background = theme2.colors.primary;
55310
+ e.currentTarget.style.color = theme2.colors.background;
55311
+ },
55312
+ onMouseLeave: (e) => {
55313
+ e.currentTarget.style.background = "transparent";
55314
+ e.currentTarget.style.color = theme2.colors.primary;
55315
+ },
55316
+ title: "Assign to Claude",
55317
+ children: [
55318
+ /* @__PURE__ */ jsx(Bot, { size: 14 }),
55319
+ "Assign to Claude"
55320
+ ]
55321
+ }
55322
+ ),
55323
+ (() => {
55324
+ const existingIssue = getGitHubIssueFromRefs(selectedTask.references);
55325
+ if (!existingIssue || claudeAssignment.status !== "idle") return null;
55326
+ return /* @__PURE__ */ jsxs(
55327
+ "a",
55328
+ {
55329
+ href: existingIssue.url,
55330
+ target: "_blank",
55331
+ rel: "noopener noreferrer",
55332
+ style: {
55333
+ flex: 1,
55334
+ display: "flex",
55335
+ alignItems: "center",
55336
+ justifyContent: "center",
55337
+ gap: "6px",
55338
+ padding: "6px 12px",
55339
+ border: `1px solid ${theme2.colors.primary}`,
55340
+ borderRadius: theme2.radii[1],
55341
+ background: "transparent",
55342
+ color: theme2.colors.primary,
55343
+ fontSize: theme2.fontSizes[1],
55344
+ fontWeight: theme2.fontWeights.medium,
55345
+ textDecoration: "none",
55346
+ transition: "all 0.2s ease"
55347
+ },
55348
+ onMouseEnter: (e) => {
55349
+ e.currentTarget.style.background = theme2.colors.primary;
55350
+ e.currentTarget.style.color = theme2.colors.background;
55351
+ },
55352
+ onMouseLeave: (e) => {
55353
+ e.currentTarget.style.background = "transparent";
55354
+ e.currentTarget.style.color = theme2.colors.primary;
55355
+ },
55356
+ title: `View issue #${existingIssue.number} on GitHub`,
55357
+ children: [
55358
+ /* @__PURE__ */ jsx(Bot, { size: 14 }),
55359
+ "View Progress",
55360
+ /* @__PURE__ */ jsx(ExternalLink, { size: 12 })
55361
+ ]
55362
+ }
55363
+ );
55364
+ })(),
55365
+ claudeAssignment.status === "loading" && /* @__PURE__ */ jsxs(
55366
+ "div",
55367
+ {
55368
+ style: {
55369
+ flex: 1,
55370
+ display: "flex",
55371
+ alignItems: "center",
55372
+ justifyContent: "center",
55373
+ gap: "6px",
55374
+ padding: "6px 12px",
55375
+ color: theme2.colors.textSecondary,
55376
+ fontSize: theme2.fontSizes[1]
55377
+ },
55378
+ children: [
55379
+ /* @__PURE__ */ jsx(LoaderCircle, { size: 14, style: { animation: "spin 1s linear infinite" } }),
55380
+ "Assigning..."
55381
+ ]
55382
+ }
55383
+ ),
55384
+ claudeAssignment.status === "success" && /* @__PURE__ */ jsxs(
55385
+ "a",
55386
+ {
55387
+ href: claudeAssignment.issueUrl,
55388
+ target: "_blank",
55389
+ rel: "noopener noreferrer",
55390
+ style: {
55391
+ flex: 1,
55392
+ display: "flex",
55393
+ alignItems: "center",
55394
+ justifyContent: "center",
55395
+ gap: "6px",
55396
+ padding: "6px 12px",
55397
+ border: `1px solid ${theme2.colors.success}`,
55398
+ borderRadius: theme2.radii[1],
55399
+ background: `${theme2.colors.success}15`,
55400
+ color: theme2.colors.success,
55401
+ fontSize: theme2.fontSizes[1],
55402
+ fontWeight: theme2.fontWeights.medium,
55403
+ textDecoration: "none",
55404
+ transition: "all 0.2s ease"
55405
+ },
55406
+ children: [
55407
+ /* @__PURE__ */ jsx(CircleCheckBig, { size: 14 }),
55408
+ "Issue #",
55409
+ claudeAssignment.issueNumber
55410
+ ]
55411
+ }
55412
+ ),
55413
+ claudeAssignment.status === "error" && /* @__PURE__ */ jsxs(
55414
+ "div",
55415
+ {
55416
+ style: {
55417
+ flex: 1,
55418
+ display: "flex",
55419
+ alignItems: "center",
55420
+ justifyContent: "center",
55421
+ gap: "6px",
55422
+ padding: "6px 12px",
55423
+ border: `1px solid ${theme2.colors.error}`,
55424
+ borderRadius: theme2.radii[1],
55425
+ background: `${theme2.colors.error}15`,
55426
+ color: theme2.colors.error,
55427
+ fontSize: theme2.fontSizes[1]
55428
+ },
55429
+ title: claudeAssignment.error,
55430
+ children: [
55431
+ /* @__PURE__ */ jsx(CircleAlert, { size: 14 }),
55432
+ "Failed",
53223
55433
  /* @__PURE__ */ jsx(
53224
55434
  "button",
53225
55435
  {
53226
- onClick: handleBack,
55436
+ onClick: () => setClaudeAssignment({ status: "idle" }),
53227
55437
  style: {
53228
- display: "flex",
53229
- alignItems: "center",
53230
- justifyContent: "center",
53231
- width: "32px",
53232
- height: "32px",
53233
- border: `1px solid ${theme2.colors.border}`,
53234
- borderRadius: theme2.radii[1],
53235
- background: theme2.colors.surface,
55438
+ background: "none",
55439
+ border: "none",
55440
+ color: theme2.colors.error,
53236
55441
  cursor: "pointer",
53237
- color: theme2.colors.textSecondary,
53238
- transition: "all 0.2s ease"
53239
- },
53240
- onMouseEnter: (e) => {
53241
- e.currentTarget.style.background = theme2.colors.backgroundSecondary;
53242
- e.currentTarget.style.color = theme2.colors.text;
53243
- },
53244
- onMouseLeave: (e) => {
53245
- e.currentTarget.style.background = theme2.colors.surface;
53246
- e.currentTarget.style.color = theme2.colors.textSecondary;
55442
+ padding: "0 0 0 4px",
55443
+ fontSize: theme2.fontSizes[0],
55444
+ textDecoration: "underline"
53247
55445
  },
53248
- title: "Close",
53249
- children: /* @__PURE__ */ jsx(X, { size: 16 })
55446
+ children: "Retry"
53250
55447
  }
53251
55448
  )
53252
- ] })
53253
- ]
53254
- }
53255
- ),
55449
+ ]
55450
+ }
55451
+ ),
55452
+ deleteState.status === "idle" && /* @__PURE__ */ jsxs(
55453
+ "button",
55454
+ {
55455
+ onClick: () => setIsDeleteModalOpen(true),
55456
+ style: {
55457
+ flex: 1,
55458
+ display: "flex",
55459
+ alignItems: "center",
55460
+ justifyContent: "center",
55461
+ gap: "6px",
55462
+ padding: "6px 12px",
55463
+ border: `1px solid ${theme2.colors.error}`,
55464
+ borderRadius: theme2.radii[1],
55465
+ background: "transparent",
55466
+ cursor: "pointer",
55467
+ color: theme2.colors.error,
55468
+ fontSize: theme2.fontSizes[1],
55469
+ fontWeight: theme2.fontWeights.medium,
55470
+ transition: "all 0.2s ease"
55471
+ },
55472
+ onMouseEnter: (e) => {
55473
+ e.currentTarget.style.background = theme2.colors.error;
55474
+ e.currentTarget.style.color = theme2.colors.background;
55475
+ },
55476
+ onMouseLeave: (e) => {
55477
+ e.currentTarget.style.background = "transparent";
55478
+ e.currentTarget.style.color = theme2.colors.error;
55479
+ },
55480
+ title: "Delete task",
55481
+ children: [
55482
+ /* @__PURE__ */ jsx(Trash2, { size: 14 }),
55483
+ "Delete"
55484
+ ]
55485
+ }
55486
+ ),
55487
+ deleteState.status === "success" && /* @__PURE__ */ jsxs(
55488
+ "div",
55489
+ {
55490
+ style: {
55491
+ flex: 1,
55492
+ display: "flex",
55493
+ alignItems: "center",
55494
+ justifyContent: "center",
55495
+ gap: "6px",
55496
+ padding: "6px 12px",
55497
+ border: `1px solid ${theme2.colors.success}`,
55498
+ borderRadius: theme2.radii[1],
55499
+ background: `${theme2.colors.success}15`,
55500
+ color: theme2.colors.success,
55501
+ fontSize: theme2.fontSizes[1],
55502
+ fontWeight: theme2.fontWeights.medium
55503
+ },
55504
+ children: [
55505
+ /* @__PURE__ */ jsx(CircleCheckBig, { size: 14 }),
55506
+ "Task deleted"
55507
+ ]
55508
+ }
55509
+ )
55510
+ ] }),
53256
55511
  /* @__PURE__ */ jsx("style", { children: `
53257
55512
  @keyframes spin {
53258
55513
  to { transform: rotate(360deg); }
@@ -53308,6 +55563,193 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
53308
55563
  }
53309
55564
  )
53310
55565
  }
55566
+ ),
55567
+ isDeleteModalOpen && createPortal(
55568
+ /* @__PURE__ */ jsxs(
55569
+ "div",
55570
+ {
55571
+ style: {
55572
+ position: "fixed",
55573
+ inset: 0,
55574
+ zIndex: 9999,
55575
+ display: "flex",
55576
+ alignItems: "center",
55577
+ justifyContent: "center",
55578
+ padding: "16px"
55579
+ },
55580
+ children: [
55581
+ /* @__PURE__ */ jsx(
55582
+ "div",
55583
+ {
55584
+ onClick: () => setIsDeleteModalOpen(false),
55585
+ style: {
55586
+ position: "absolute",
55587
+ inset: 0,
55588
+ backgroundColor: "rgba(0, 0, 0, 0.5)"
55589
+ }
55590
+ }
55591
+ ),
55592
+ /* @__PURE__ */ jsxs(
55593
+ "div",
55594
+ {
55595
+ style: {
55596
+ position: "relative",
55597
+ width: "100%",
55598
+ maxWidth: "400px",
55599
+ backgroundColor: theme2.colors.background,
55600
+ borderRadius: theme2.radii[3],
55601
+ boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
55602
+ border: `1px solid ${theme2.colors.border}`
55603
+ },
55604
+ children: [
55605
+ /* @__PURE__ */ jsxs(
55606
+ "div",
55607
+ {
55608
+ style: {
55609
+ display: "flex",
55610
+ alignItems: "center",
55611
+ justifyContent: "space-between",
55612
+ padding: "16px 20px",
55613
+ borderBottom: `1px solid ${theme2.colors.border}`
55614
+ },
55615
+ children: [
55616
+ /* @__PURE__ */ jsx(
55617
+ "h2",
55618
+ {
55619
+ style: {
55620
+ margin: 0,
55621
+ fontSize: theme2.fontSizes[4],
55622
+ fontWeight: 600,
55623
+ color: theme2.colors.text
55624
+ },
55625
+ children: "Delete Task?"
55626
+ }
55627
+ ),
55628
+ /* @__PURE__ */ jsx(
55629
+ "button",
55630
+ {
55631
+ onClick: () => setIsDeleteModalOpen(false),
55632
+ style: {
55633
+ background: "none",
55634
+ border: "none",
55635
+ cursor: "pointer",
55636
+ padding: "4px",
55637
+ display: "flex",
55638
+ alignItems: "center",
55639
+ justifyContent: "center",
55640
+ borderRadius: theme2.radii[1],
55641
+ color: theme2.colors.textMuted
55642
+ },
55643
+ children: /* @__PURE__ */ jsx(X, { size: 20 })
55644
+ }
55645
+ )
55646
+ ]
55647
+ }
55648
+ ),
55649
+ /* @__PURE__ */ jsxs("div", { style: { padding: "20px" }, children: [
55650
+ /* @__PURE__ */ jsxs(
55651
+ "p",
55652
+ {
55653
+ style: {
55654
+ margin: 0,
55655
+ fontSize: theme2.fontSizes[2],
55656
+ color: theme2.colors.text,
55657
+ lineHeight: 1.5
55658
+ },
55659
+ children: [
55660
+ "Are you sure you want to delete ",
55661
+ /* @__PURE__ */ jsxs("strong", { children: [
55662
+ '"',
55663
+ selectedTask.title,
55664
+ '"'
55665
+ ] }),
55666
+ "? This action cannot be undone."
55667
+ ]
55668
+ }
55669
+ ),
55670
+ deleteState.status === "error" && /* @__PURE__ */ jsx(
55671
+ "div",
55672
+ {
55673
+ style: {
55674
+ marginTop: "16px",
55675
+ padding: "10px 12px",
55676
+ backgroundColor: `${theme2.colors.error}15`,
55677
+ border: `1px solid ${theme2.colors.error}`,
55678
+ borderRadius: theme2.radii[2],
55679
+ color: theme2.colors.error,
55680
+ fontSize: theme2.fontSizes[1]
55681
+ },
55682
+ children: deleteState.error || "Failed to delete task"
55683
+ }
55684
+ )
55685
+ ] }),
55686
+ /* @__PURE__ */ jsxs(
55687
+ "div",
55688
+ {
55689
+ style: {
55690
+ display: "flex",
55691
+ justifyContent: "flex-end",
55692
+ gap: "12px",
55693
+ padding: "16px 20px",
55694
+ borderTop: `1px solid ${theme2.colors.border}`
55695
+ },
55696
+ children: [
55697
+ /* @__PURE__ */ jsx(
55698
+ "button",
55699
+ {
55700
+ type: "button",
55701
+ onClick: () => setIsDeleteModalOpen(false),
55702
+ disabled: deleteState.status === "loading",
55703
+ style: {
55704
+ padding: "10px 20px",
55705
+ fontSize: theme2.fontSizes[2],
55706
+ fontWeight: 500,
55707
+ border: `1px solid ${theme2.colors.border}`,
55708
+ borderRadius: theme2.radii[2],
55709
+ backgroundColor: "transparent",
55710
+ color: theme2.colors.text,
55711
+ cursor: deleteState.status === "loading" ? "not-allowed" : "pointer",
55712
+ opacity: deleteState.status === "loading" ? 0.5 : 1
55713
+ },
55714
+ children: "Cancel"
55715
+ }
55716
+ ),
55717
+ /* @__PURE__ */ jsxs(
55718
+ "button",
55719
+ {
55720
+ type: "button",
55721
+ onClick: handleDeleteConfirm,
55722
+ disabled: deleteState.status === "loading",
55723
+ style: {
55724
+ display: "flex",
55725
+ alignItems: "center",
55726
+ gap: "8px",
55727
+ padding: "10px 20px",
55728
+ fontSize: theme2.fontSizes[2],
55729
+ fontWeight: 500,
55730
+ border: "none",
55731
+ borderRadius: theme2.radii[2],
55732
+ backgroundColor: theme2.colors.error,
55733
+ color: theme2.colors.background,
55734
+ cursor: deleteState.status === "loading" ? "wait" : "pointer",
55735
+ opacity: deleteState.status === "loading" ? 0.7 : 1
55736
+ },
55737
+ children: [
55738
+ deleteState.status === "loading" && /* @__PURE__ */ jsx(LoaderCircle, { size: 16, style: { animation: "spin 1s linear infinite" } }),
55739
+ "Delete"
55740
+ ]
55741
+ }
55742
+ )
55743
+ ]
55744
+ }
55745
+ )
55746
+ ]
55747
+ }
55748
+ )
55749
+ ]
55750
+ }
55751
+ ),
55752
+ document.body
53311
55753
  )
53312
55754
  ]
53313
55755
  }