@interopio/groups-ui-react 2.7.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cjs/defaultComponents/buttons/StandardButton.d.ts +4 -0
  2. package/dist/cjs/defaultComponents/hooks/useExternalWindowPopup.d.ts +2 -0
  3. package/dist/cjs/defaultComponents/hooks/useExternalWindowPopupClosed.d.ts +1 -0
  4. package/dist/cjs/defaultComponents/hooks/useExternalWindowPopupHidden.d.ts +1 -0
  5. package/dist/cjs/defaultComponents/hooks/useMoveResizeWindow.d.ts +2 -0
  6. package/dist/cjs/defaultComponents/hooks/useShowPopupWindow.d.ts +2 -0
  7. package/dist/cjs/defaultComponents/utils/common.d.ts +3 -0
  8. package/dist/cjs/defaultComponents/utils/useDragMove.d.ts +6 -0
  9. package/dist/cjs/index.d.ts +3 -1
  10. package/dist/cjs/index.js +494 -622
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/types/api.d.ts +38 -1
  13. package/dist/cjs/types/defaultComponents.d.ts +10 -1
  14. package/dist/cjs/types/internal.d.ts +39 -45
  15. package/dist/cjs/webGroupsManager.d.ts +4 -1
  16. package/dist/cjs/webGroupsStore.d.ts +3 -0
  17. package/dist/esm/defaultComponents/buttons/StandardButton.d.ts +4 -0
  18. package/dist/esm/defaultComponents/hooks/useExternalWindowPopup.d.ts +2 -0
  19. package/dist/esm/defaultComponents/hooks/useExternalWindowPopupClosed.d.ts +1 -0
  20. package/dist/esm/defaultComponents/hooks/useExternalWindowPopupHidden.d.ts +1 -0
  21. package/dist/esm/defaultComponents/hooks/useMoveResizeWindow.d.ts +2 -0
  22. package/dist/esm/defaultComponents/hooks/useShowPopupWindow.d.ts +2 -0
  23. package/dist/esm/defaultComponents/utils/common.d.ts +3 -0
  24. package/dist/esm/defaultComponents/utils/useDragMove.d.ts +6 -0
  25. package/dist/esm/index.d.ts +3 -1
  26. package/dist/esm/index.js +618 -765
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/types/api.d.ts +38 -1
  29. package/dist/esm/types/defaultComponents.d.ts +10 -1
  30. package/dist/esm/types/internal.d.ts +39 -45
  31. package/dist/esm/webGroupsManager.d.ts +4 -1
  32. package/dist/esm/webGroupsStore.d.ts +3 -0
  33. package/dist/styles/groups.css +195 -101
  34. package/dist/styles/vars.css +865 -78
  35. package/package.json +6 -5
package/dist/cjs/index.js CHANGED
@@ -1,13 +1,33 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('@interopio/react-hooks')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', '@interopio/react-hooks'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["groups-ui-react"] = {}, global.React, global.ReactDOM, global["interopio-hooks"]));
5
- })(this, (function (exports, React, ReactDOM, reactHooks) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('@interopio/react-hooks'), require('react/jsx-runtime')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', '@interopio/react-hooks', 'react/jsx-runtime'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["groups-ui-react"] = {}, global.React, global.ReactDOM, global["interopio-hooks"], global.jsxRuntime));
5
+ })(this, (function (exports, React, ReactDOM, reactHooks, jsxRuntime) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
9
27
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
10
29
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
30
+ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
11
31
 
12
32
  /******************************************************************************
13
33
  Copyright (c) Microsoft Corporation.
@@ -63,11 +83,54 @@
63
83
  return t;
64
84
  }
65
85
 
86
+ function __awaiter(thisArg, _arguments, P, generator) {
87
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
88
+ return new (P || (P = Promise))(function (resolve, reject) {
89
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
90
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
91
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
93
+ });
94
+ }
95
+
96
+ function __generator(thisArg, body) {
97
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
98
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
99
+ function verb(n) { return function (v) { return step([n, v]); }; }
100
+ function step(op) {
101
+ if (f) throw new TypeError("Generator is already executing.");
102
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
103
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
104
+ if (y = 0, t) op = [op[0] & 2, t.value];
105
+ switch (op[0]) {
106
+ case 0: case 1: t = op; break;
107
+ case 4: _.label++; return { value: op[1], done: false };
108
+ case 5: _.label++; y = op[1]; op = [0]; continue;
109
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
110
+ default:
111
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
112
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
113
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
114
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
115
+ if (t[2]) _.ops.pop();
116
+ _.trys.pop(); continue;
117
+ }
118
+ op = body.call(thisArg, _);
119
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
120
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
121
+ }
122
+ }
123
+
66
124
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
67
125
  var e = new Error(message);
68
126
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
69
127
  };
70
128
 
129
+ var StandardButtonTarget;
130
+ (function (StandardButtonTarget) {
131
+ StandardButtonTarget["Default"] = "default";
132
+ StandardButtonTarget["Frame"] = "frame";
133
+ })(StandardButtonTarget || (StandardButtonTarget = {}));
71
134
  var TargetType;
72
135
  (function (TargetType) {
73
136
  TargetType["Group"] = "group";
@@ -306,6 +369,20 @@
306
369
  }
307
370
  window.webGroupsManager.externalLibraryFactory.onCaptionTextBoundsChanged(targetType, targetId, bounds);
308
371
  };
372
+ WebGroupsManagerDecorator.prototype.startDragMove = function () {
373
+ if (typeof window.webGroupsManager.externalLibraryFactory.startDragMove !== "function") {
374
+ // Handling the case when a new library is used with an older version of io.Connect Desktop
375
+ return;
376
+ }
377
+ window.webGroupsManager.externalLibraryFactory.startDragMove();
378
+ };
379
+ WebGroupsManagerDecorator.prototype.showCaptionEditor = function (targetType, targetId, text) {
380
+ if (typeof window.webGroupsManager.externalLibraryFactory.showCaptionEditor !== "function") {
381
+ // Handling the case when a new library is used with an older version of io.Connect Desktop
382
+ return;
383
+ }
384
+ window.webGroupsManager.externalLibraryFactory.showCaptionEditor(targetType, targetId, text);
385
+ };
309
386
  WebGroupsManagerDecorator.prototype.onCaptionEditorVisibleChanged = function (targetType, targetId, visible) {
310
387
  if (typeof window.webGroupsManager.externalLibraryFactory.onCaptionEditorVisibleChanged !== "function") {
311
388
  // Handling the case when a new library is used with an older version of io.Connect Desktop
@@ -366,6 +443,13 @@
366
443
  }
367
444
  window.webGroupsManager.externalLibraryFactory.openTabOverflowPopup(frameId, location);
368
445
  };
446
+ WebGroupsManagerDecorator.prototype.resizeTabOverflowPopup = function (frameId, size) {
447
+ if (typeof window.webGroupsManager.externalLibraryFactory.resizeTabOverflowPopup !== "function") {
448
+ console.warn("The method resizeTabOverflowPopup is not supported by the current version of the library");
449
+ return;
450
+ }
451
+ window.webGroupsManager.externalLibraryFactory.resizeTabOverflowPopup(frameId, size);
452
+ };
369
453
  return WebGroupsManagerDecorator;
370
454
  }());
371
455
  var webGroupsManager = new WebGroupsManagerDecorator();
@@ -376,9 +460,31 @@
376
460
  React__default["default"].createElement("div", __assign({}, innerElement)));
377
461
  };
378
462
 
379
- var CloseButton = function (_a) {
380
- var onClick = _a.onClick, tooltip = _a.tooltip;
381
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-close" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-close", title: tooltip, onClick: onClick } });
463
+ function getStandardButtonInnerClassName(buttonId, target) {
464
+ var classNames = "t42-standard-button t42-standard-button-" + buttonId;
465
+ if (target && target !== StandardButtonTarget.Default) {
466
+ classNames = classNames.concat(" t42-standard-button-" + target + "-" + buttonId);
467
+ }
468
+ return classNames;
469
+ }
470
+ function getStandardButtonOuterClassName(buttonId, target, isPressed) {
471
+ var classNames = "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-" + buttonId;
472
+ if (isPressed === true) {
473
+ classNames = classNames.concat(" active");
474
+ }
475
+ if (target && target !== StandardButtonTarget.Default) {
476
+ classNames = classNames.concat(" t42-caption-bar-button-" + target + "-" + buttonId);
477
+ }
478
+ return classNames;
479
+ }
480
+
481
+ var StandardButton = function (_a) {
482
+ var buttonId = _a.buttonId, target = _a.target, isPressed = _a.isPressed, tooltip = _a.tooltip, onClick = _a.onClick;
483
+ return React__default["default"].createElement(BaseButton, { innerElement: { className: getStandardButtonInnerClassName(buttonId, target) }, outerElement: { className: getStandardButtonOuterClassName(buttonId, target, isPressed), title: tooltip, onClick: onClick } });
484
+ };
485
+
486
+ var CloseButton = function (props) {
487
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Close }, props));
382
488
  };
383
489
 
384
490
  /**
@@ -412,7 +518,7 @@
412
518
  const reducedHexMatch = reducedHexRegex.exec(normalizedColor);
413
519
  if (reducedHexMatch) {
414
520
  const arr = Array.from(reducedHexMatch).slice(1);
415
- return [...arr.slice(0, 3).map(x => parseInt(r$1(x, 2), 16)), parseInt(r$1(arr[3] || 'f', 2), 16) / 255];
521
+ return [...arr.slice(0, 3).map(x => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || 'f', 2), 16) / 255];
416
522
  }
417
523
  const hexMatch = hexRegex.exec(normalizedColor);
418
524
  if (hexMatch) {
@@ -469,10 +575,10 @@
469
575
  if (!result) throw new ColorError$1(color);
470
576
  return `#${result}`;
471
577
  }
472
- const r$1 = (str, amount) => Array.from(Array(amount)).map(() => str).join('');
473
- const reducedHexRegex = new RegExp(`^#${r$1('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');
474
- const hexRegex = new RegExp(`^#${r$1('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');
475
- const rgbaRegex = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$1(',\\s*(\\d+)\\s*', 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, 'i');
578
+ const r = (str, amount) => Array.from(Array(amount)).map(() => str).join('');
579
+ const reducedHexRegex = new RegExp(`^#${r('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');
580
+ const hexRegex = new RegExp(`^#${r('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');
581
+ const rgbaRegex = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r(',\\s*(\\d+)\\s*', 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, 'i');
476
582
  const hslaRegex = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;
477
583
  const namedColorRegex = /^[a-z]+$/i;
478
584
  const roundColor = color => {
@@ -549,11 +655,8 @@
549
655
  var r = rgba[0];
550
656
  var g = rgba[1];
551
657
  var b = rgba[2];
552
- var displayGamma = 2.2;
553
- var backgroundWeight = 0.2126 * Math.pow(r / 255.0, displayGamma) +
554
- 0.7152 * Math.pow(g / 255.0, displayGamma) +
555
- 0.0722 * Math.pow(b / 255.0, displayGamma);
556
- return backgroundWeight > Math.pow(0.5, displayGamma);
658
+ var backgroundWeight = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
659
+ return backgroundWeight > 0.5;
557
660
  }
558
661
  catch (_a) {
559
662
  // Fallback to other implementation
@@ -631,50 +734,40 @@
631
734
  return React__default["default"].createElement(BaseChannelSelector, { outsideClass: channelLabel ? "t42-frame-caption-bar-element t42-frame-channel-selector t42-channel-selector-direction" : "t42-frame-caption-bar-element t42-frame-channel-selector", contentClass: !channelLabel ? "t42-frame-channel-selector-content" : "", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor, direction: getChannelDirection(channelRestrictions), channelLabel: channelLabel });
632
735
  };
633
736
 
634
- var ExtractButton = function (_a) {
635
- var onClick = _a.onClick, tooltip = _a.tooltip;
636
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-extract" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-extract", title: tooltip, onClick: onClick } });
737
+ var ExtractButton = function (props) {
738
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Extract }, props));
637
739
  };
638
740
 
639
- var FeedbackButton = function (_a) {
640
- var onClick = _a.onClick, tooltip = _a.tooltip;
641
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-feedback" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-feedback", title: tooltip, onClick: onClick } });
741
+ var FeedbackButton = function (props) {
742
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Feedback }, props));
642
743
  };
643
744
 
644
- var CloneButton = function (_a) {
645
- var onClick = _a.onClick, tooltip = _a.tooltip;
646
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-clone" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-clone", title: tooltip, onClick: onClick } });
745
+ var CloneButton = function (props) {
746
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Clone }, props));
647
747
  };
648
748
 
649
- var StickyButton = function (_a) {
650
- var onClick = _a.onClick, tooltip = _a.tooltip, isPressed = _a.isPressed;
651
- var outerElementClassName = "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-sticky";
652
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-sticky" }, outerElement: { className: isPressed ? outerElementClassName + " active" : outerElementClassName, title: tooltip, onClick: onClick } });
749
+ var StickyButton = function (props) {
750
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Sticky }, props));
653
751
  };
654
752
 
655
- var LockButton = function (_a) {
656
- var tooltip = _a.tooltip, onClick = _a.onClick;
657
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-lock" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-lock", title: tooltip, onClick: onClick } });
753
+ var LockButton = function (props) {
754
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Lock }, props));
658
755
  };
659
756
 
660
- var MaximizeButton = function (_a) {
661
- var tooltip = _a.tooltip, onClick = _a.onClick;
662
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-maximize" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-maximize", title: tooltip, onClick: onClick } });
757
+ var MaximizeButton = function (props) {
758
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Maximize }, props));
663
759
  };
664
760
 
665
- var MinimizeButton = function (_a) {
666
- var onClick = _a.onClick, tooltip = _a.tooltip;
667
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-minimize" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-minimize", title: tooltip, onClick: onClick } });
761
+ var MinimizeButton = function (props) {
762
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Minimize }, props));
668
763
  };
669
764
 
670
- var RestoreButton = function (_a) {
671
- var tooltip = _a.tooltip, onClick = _a.onClick;
672
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-restore" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-restore", title: tooltip, onClick: onClick } });
765
+ var RestoreButton = function (props) {
766
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Restore }, props));
673
767
  };
674
768
 
675
- var UnlockButton = function (_a) {
676
- var tooltip = _a.tooltip, onClick = _a.onClick;
677
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-unlock" }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-unlock", title: tooltip, onClick: onClick } });
769
+ var UnlockButton = function (props) {
770
+ return React__default["default"].createElement(StandardButton, __assign({ buttonId: StandardButtons.Unlock }, props));
678
771
  };
679
772
 
680
773
  var CustomButton = function (_a) {
@@ -1613,7 +1706,7 @@
1613
1706
  * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
1614
1707
  * exposing only those methods and properties that are defined in the spec.
1615
1708
  */
1616
- var ResizeObserver = /** @class */ (function () {
1709
+ var ResizeObserver$1 = /** @class */ (function () {
1617
1710
  /**
1618
1711
  * Creates a new instance of ResizeObserver.
1619
1712
  *
@@ -1639,7 +1732,7 @@
1639
1732
  'unobserve',
1640
1733
  'disconnect'
1641
1734
  ].forEach(function (method) {
1642
- ResizeObserver.prototype[method] = function () {
1735
+ ResizeObserver$1.prototype[method] = function () {
1643
1736
  var _a;
1644
1737
  return (_a = observers.get(this))[method].apply(_a, arguments);
1645
1738
  };
@@ -1650,7 +1743,7 @@
1650
1743
  if (typeof global$1.ResizeObserver !== 'undefined') {
1651
1744
  return global$1.ResizeObserver;
1652
1745
  }
1653
- return ResizeObserver;
1746
+ return ResizeObserver$1;
1654
1747
  })();
1655
1748
 
1656
1749
  function useEditableCaption(ref, options) {
@@ -1673,11 +1766,76 @@
1673
1766
  }, [ref]);
1674
1767
  }
1675
1768
 
1769
+ function useDragMove(option) {
1770
+ var _a = (option || {}).threshold, threshold = _a === void 0 ? 3 : _a;
1771
+ var initialPos = React.useRef(null);
1772
+ var onMoveRef = React.useRef();
1773
+ var onUpRef = React.useRef();
1774
+ var cleanup = function () {
1775
+ document.removeEventListener("mousemove", onMoveRef.current, true);
1776
+ document.removeEventListener("mouseup", onUpRef.current, true);
1777
+ initialPos.current = null;
1778
+ document.body.style.pointerEvents = "auto";
1779
+ };
1780
+ if (!onMoveRef.current) {
1781
+ onMoveRef.current = function (ev) {
1782
+ if (!initialPos.current)
1783
+ return;
1784
+ var dx = ev.pageX - initialPos.current.x;
1785
+ var dy = ev.pageY - initialPos.current.y;
1786
+ if (Math.abs(dx) >= threshold || Math.abs(dy) >= threshold) {
1787
+ document.body.style.pointerEvents = "none";
1788
+ cleanup();
1789
+ webGroupsManager.startDragMove();
1790
+ }
1791
+ ev.stopPropagation();
1792
+ ev.preventDefault();
1793
+ };
1794
+ }
1795
+ if (!onUpRef.current) {
1796
+ onUpRef.current = function (ev) {
1797
+ cleanup();
1798
+ ev.stopPropagation();
1799
+ ev.preventDefault();
1800
+ };
1801
+ }
1802
+ var startDrag = function (ev) {
1803
+ if (ev.button !== 0)
1804
+ return;
1805
+ initialPos.current = { x: ev.pageX, y: ev.pageY };
1806
+ document.addEventListener("mousemove", onMoveRef.current, true);
1807
+ document.addEventListener("mouseup", onUpRef.current, true);
1808
+ ev.stopPropagation();
1809
+ ev.preventDefault();
1810
+ };
1811
+ React.useEffect(function () {
1812
+ return function () {
1813
+ if (onMoveRef.current)
1814
+ document.removeEventListener("mousemove", onMoveRef.current, true);
1815
+ if (onUpRef.current)
1816
+ document.removeEventListener("mouseup", onUpRef.current, true);
1817
+ document.body.style.pointerEvents = "auto";
1818
+ initialPos.current = null;
1819
+ };
1820
+ }, []);
1821
+ return { startDrag: startDrag };
1822
+ }
1823
+
1676
1824
  var FlatCaption = function (_a) {
1677
- var caption = _a.caption, notifyBoundsChanged = _a.notifyBoundsChanged;
1825
+ var showCaptionEditor = _a.showCaptionEditor, caption = _a.caption, notifyBoundsChanged = _a.notifyBoundsChanged;
1678
1826
  var ref = React.useRef(null);
1679
1827
  useEditableCaption(ref, { notifyBoundsChanged: notifyBoundsChanged });
1680
- return React__default["default"].createElement("div", { ref: ref, className: "t42-caption t42-title t42-frame-caption-bar-element" }, caption);
1828
+ var startDrag = useDragMove().startDrag;
1829
+ var handleMouseDown = function (e) {
1830
+ if (e.button !== 0)
1831
+ return;
1832
+ startDrag(e);
1833
+ };
1834
+ var handleDoubleClick = function (e) {
1835
+ showCaptionEditor(caption);
1836
+ e.stopPropagation();
1837
+ };
1838
+ return (React__default["default"].createElement("div", { ref: ref, className: "t42-caption t42-title t42-frame-caption-bar-element", onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick }, caption));
1681
1839
  };
1682
1840
 
1683
1841
  function useCaptionEditor(ref, options) {
@@ -1837,11 +1995,11 @@
1837
1995
  };
1838
1996
 
1839
1997
  var FlatCaptionBar = function (_a) {
1840
- var moveAreaId = _a.moveAreaId, caption = _a.caption, channels = _a.channels, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, rest = __rest(_a, ["moveAreaId", "caption", "channels", "captionEditor", "notifyCaptionBoundsChanged"]);
1998
+ var moveAreaId = _a.moveAreaId, caption = _a.caption, showCaptionEditor = _a.showCaptionEditor, channels = _a.channels, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, rest = __rest(_a, ["moveAreaId", "caption", "showCaptionEditor", "channels", "captionEditor", "notifyCaptionBoundsChanged"]);
1841
1999
  return (React__default["default"].createElement("div", { className: "t42-react-caption-bar" },
1842
2000
  (channels === null || channels === void 0 ? void 0 : channels.visible) && channels.channelsMode !== "multi" && React__default["default"].createElement(FlatChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannel: channels === null || channels === void 0 ? void 0 : channels.selectedChannel, selectedChannelColor: channels === null || channels === void 0 ? void 0 : channels.selectedChannelColor, channelRestrictions: channels === null || channels === void 0 ? void 0 : channels.channelRestrictions, channelLabel: channels === null || channels === void 0 ? void 0 : channels.channelLabel }),
1843
2001
  (channels === null || channels === void 0 ? void 0 : channels.visible) && channels.channelsMode === "multi" && React__default["default"].createElement(FlatMultiChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannels: channels === null || channels === void 0 ? void 0 : channels.selectedChannels, channelRestrictions: channels === null || channels === void 0 ? void 0 : channels.channelRestrictions, channelLabel: channels === null || channels === void 0 ? void 0 : channels.channelLabel }),
1844
- React__default["default"].createElement(FlatMoveArea, { moveAreaId: moveAreaId }, captionEditor.show ? React__default["default"].createElement(FlatCaptionEditor, __assign({}, captionEditor, { caption: captionEditor.text, frameId: rest.frameId })) : React__default["default"].createElement(FlatCaption, { notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
2002
+ React__default["default"].createElement(FlatMoveArea, { moveAreaId: moveAreaId }, captionEditor.show ? React__default["default"].createElement(FlatCaptionEditor, __assign({}, captionEditor, { caption: captionEditor.text, frameId: rest.frameId })) : React__default["default"].createElement(FlatCaption, { showCaptionEditor: showCaptionEditor, notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
1845
2003
  React__default["default"].createElement(FlatButtons, __assign({}, rest))));
1846
2004
  };
1847
2005
 
@@ -1861,10 +2019,20 @@
1861
2019
  };
1862
2020
 
1863
2021
  var GroupCaption = function (_a) {
1864
- var caption = _a.caption, notifyBoundsChanged = _a.notifyBoundsChanged;
2022
+ var showCaptionEditor = _a.showCaptionEditor, caption = _a.caption, notifyBoundsChanged = _a.notifyBoundsChanged;
1865
2023
  var ref = React.useRef(null);
1866
2024
  useEditableCaption(ref, { notifyBoundsChanged: notifyBoundsChanged });
1867
- return React__default["default"].createElement("div", { ref: ref, className: "t42-caption t42-title t42-group-caption-bar-element" }, caption);
2025
+ var startDrag = useDragMove().startDrag;
2026
+ var handleMouseDown = function (e) {
2027
+ if (e.button !== 0)
2028
+ return;
2029
+ startDrag(e);
2030
+ };
2031
+ var handleDoubleClick = function (e) {
2032
+ showCaptionEditor(caption);
2033
+ e.stopPropagation();
2034
+ };
2035
+ return (React__default["default"].createElement("div", { ref: ref, onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick, className: "t42-caption t42-title t42-group-caption-bar-element" }, caption));
1868
2036
  };
1869
2037
 
1870
2038
  var GroupCaptionEditor = function (props) {
@@ -1872,11 +2040,11 @@
1872
2040
  };
1873
2041
 
1874
2042
  var GroupCaptionBar = function (_a) {
1875
- var moveAreaId = _a.moveAreaId; _a.targetType; var targetId = _a.targetId, caption = _a.caption, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, rest = __rest(_a, ["moveAreaId", "targetType", "targetId", "caption", "captionEditor", "notifyCaptionBoundsChanged"]);
2043
+ var moveAreaId = _a.moveAreaId, showCaptionEditor = _a.showCaptionEditor; _a.targetType; var targetId = _a.targetId, caption = _a.caption, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, rest = __rest(_a, ["moveAreaId", "showCaptionEditor", "targetType", "targetId", "caption", "captionEditor", "notifyCaptionBoundsChanged"]);
1876
2044
  return React__default["default"].createElement("div", { className: "t42-react-caption-bar" },
1877
2045
  React__default["default"].createElement(GroupMoveArea, { moveAreaId: moveAreaId }, (captionEditor === null || captionEditor === void 0 ? void 0 : captionEditor.show) ?
1878
2046
  React__default["default"].createElement(GroupCaptionEditor, __assign({}, captionEditor, { groupId: targetId, caption: captionEditor.text })) :
1879
- React__default["default"].createElement(GroupCaption, { notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
2047
+ React__default["default"].createElement(GroupCaption, { showCaptionEditor: showCaptionEditor, notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
1880
2048
  React__default["default"].createElement(GroupButtons, __assign({}, rest)));
1881
2049
  };
1882
2050
 
@@ -1935,10 +2103,10 @@
1935
2103
 
1936
2104
  var OverflowButton = function (_a) {
1937
2105
  var onClick = _a.onClick, tooltip = _a.tooltip;
1938
- return React__default["default"].createElement(BaseButton, { innerElement: { className: "t42-standard-button t42-standard-button-overflow" }, outerElement: {
2106
+ return React__default["default"].createElement(BaseButton, { innerElement: { className: getStandardButtonInnerClassName(StandardButtons.Overflow) }, outerElement: {
1939
2107
  onMouseDown: function (e) { return e.stopPropagation(); },
1940
2108
  onPointerDown: function (e) { return e.stopPropagation(); },
1941
- className: "t42-button t42-caption-bar-button t42-tab-bar-button t42-caption-bar-button-overflow", title: tooltip,
2109
+ className: getStandardButtonOuterClassName(StandardButtons.Overflow), title: tooltip,
1942
2110
  onClick: onClick
1943
2111
  } });
1944
2112
  };
@@ -1977,246 +2145,156 @@
1977
2145
  throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
1978
2146
  }
1979
2147
 
1980
- function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=React__default["default"].useState,m=React__default["default"].useEffect,n=React__default["default"].useLayoutEffect,p=React__default["default"].useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c});},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c});})},[a]);p(d);return d}
1981
- function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f){return !0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;var useSyncExternalStore=void 0!==React__default["default"].useSyncExternalStore?React__default["default"].useSyncExternalStore:u;
1982
-
1983
- var useSyncExternalStoreShim_production_min = {
1984
- useSyncExternalStore: useSyncExternalStore
1985
- };
1986
-
1987
- var useSyncExternalStoreShim_development = createCommonjsModule(function (module, exports) {
1988
-
1989
- if (process.env.NODE_ENV !== "production") {
1990
- (function() {
1991
-
1992
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1993
- if (
1994
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
1995
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
1996
- 'function'
1997
- ) {
1998
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
1999
- }
2000
- var React = React__default["default"];
2001
-
2002
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2003
-
2004
- function error(format) {
2005
- {
2006
- {
2007
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2008
- args[_key2 - 1] = arguments[_key2];
2009
- }
2010
-
2011
- printWarning('error', format, args);
2012
- }
2013
- }
2148
+ function is$1(x, y) {
2149
+ return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
2014
2150
  }
2015
-
2016
- function printWarning(level, format, args) {
2017
- // When changing this logic, you might want to also
2018
- // update consoleWithStackDev.www.js as well.
2019
- {
2020
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
2021
- var stack = ReactDebugCurrentFrame.getStackAddendum();
2022
-
2023
- if (stack !== '') {
2024
- format += '%s';
2025
- args = args.concat([stack]);
2026
- } // eslint-disable-next-line react-internal/safe-string-coercion
2027
-
2028
-
2029
- var argsWithFormat = args.map(function (item) {
2030
- return String(item);
2031
- }); // Careful: RN currently depends on this prefix
2032
-
2033
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
2034
- // breaks IE9: https://github.com/facebook/react/issues/13610
2035
- // eslint-disable-next-line react-internal/no-production-logging
2036
-
2037
- Function.prototype.apply.call(console[level], console, argsWithFormat);
2038
- }
2039
- }
2040
-
2041
- /**
2042
- * inlined Object.is polyfill to avoid requiring consumers ship their own
2043
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
2044
- */
2045
- function is(x, y) {
2046
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
2047
- ;
2048
- }
2049
-
2050
- var objectIs = typeof Object.is === 'function' ? Object.is : is;
2051
-
2052
- // dispatch for CommonJS interop named imports.
2053
-
2054
- var useState = React.useState,
2055
- useEffect = React.useEffect,
2056
- useLayoutEffect = React.useLayoutEffect,
2057
- useDebugValue = React.useDebugValue;
2058
- var didWarnOld18Alpha = false;
2059
- var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
2060
- // because of a very particular set of implementation details and assumptions
2061
- // -- change any one of them and it will break. The most important assumption
2062
- // is that updates are always synchronous, because concurrent rendering is
2063
- // only available in versions of React that also have a built-in
2064
- // useSyncExternalStore API. And we only use this shim when the built-in API
2065
- // does not exist.
2066
- //
2067
- // Do not assume that the clever hacks used by this hook also work in general.
2068
- // The point of this shim is to replace the need for hacks by other libraries.
2069
-
2070
- function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
2071
- // React do not expose a way to check if we're hydrating. So users of the shim
2072
- // will need to track that themselves and return the correct value
2073
- // from `getSnapshot`.
2074
- getServerSnapshot) {
2075
- {
2076
- if (!didWarnOld18Alpha) {
2077
- if (React.startTransition !== undefined) {
2078
- didWarnOld18Alpha = true;
2079
-
2080
- error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
2081
- }
2082
- }
2083
- } // Read the current snapshot from the store on every render. Again, this
2084
- // breaks the rules of React, and only works here because of specific
2085
- // implementation details, most importantly that updates are
2086
- // always synchronous.
2087
-
2088
-
2089
- var value = getSnapshot();
2090
-
2091
- {
2092
- if (!didWarnUncachedGetSnapshot) {
2093
- var cachedValue = getSnapshot();
2094
-
2095
- if (!objectIs(value, cachedValue)) {
2096
- error('The result of getSnapshot should be cached to avoid an infinite loop');
2097
-
2098
- didWarnUncachedGetSnapshot = true;
2099
- }
2100
- }
2101
- } // Because updates are synchronous, we don't queue them. Instead we force a
2102
- // re-render whenever the subscribed state changes by updating an some
2103
- // arbitrary useState hook. Then, during render, we call getSnapshot to read
2104
- // the current value.
2105
- //
2106
- // Because we don't actually use the state returned by the useState hook, we
2107
- // can save a bit of memory by storing other stuff in that slot.
2108
- //
2109
- // To implement the early bailout, we need to track some things on a mutable
2110
- // object. Usually, we would put that in a useRef hook, but we can stash it in
2111
- // our useState hook instead.
2112
- //
2113
- // To force a re-render, we call forceUpdate({inst}). That works because the
2114
- // new object always fails an equality check.
2115
-
2116
-
2117
- var _useState = useState({
2118
- inst: {
2119
- value: value,
2120
- getSnapshot: getSnapshot
2121
- }
2122
- }),
2123
- inst = _useState[0].inst,
2124
- forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
2125
- // in the layout phase so we can access it during the tearing check that
2126
- // happens on subscribe.
2127
-
2128
-
2129
- useLayoutEffect(function () {
2130
- inst.value = value;
2131
- inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
2132
- // commit phase if there was an interleaved mutation. In concurrent mode
2133
- // this can happen all the time, but even in synchronous mode, an earlier
2134
- // effect may have mutated the store.
2135
-
2136
- if (checkIfSnapshotChanged(inst)) {
2137
- // Force a re-render.
2138
- forceUpdate({
2139
- inst: inst
2140
- });
2141
- }
2142
- }, [subscribe, value, getSnapshot]);
2143
- useEffect(function () {
2144
- // Check for changes right before subscribing. Subsequent changes will be
2145
- // detected in the subscription handler.
2146
- if (checkIfSnapshotChanged(inst)) {
2147
- // Force a re-render.
2148
- forceUpdate({
2149
- inst: inst
2151
+ var objectIs = "function" === typeof Object.is ? Object.is : is$1,
2152
+ useState = React__default["default"].useState,
2153
+ useEffect = React__default["default"].useEffect,
2154
+ useLayoutEffect = React__default["default"].useLayoutEffect,
2155
+ useDebugValue = React__default["default"].useDebugValue;
2156
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
2157
+ var value = getSnapshot(),
2158
+ _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
2159
+ inst = _useState[0].inst,
2160
+ forceUpdate = _useState[1];
2161
+ useLayoutEffect(
2162
+ function () {
2163
+ inst.value = value;
2164
+ inst.getSnapshot = getSnapshot;
2165
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
2166
+ },
2167
+ [subscribe, value, getSnapshot]
2168
+ );
2169
+ useEffect(
2170
+ function () {
2171
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
2172
+ return subscribe(function () {
2173
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
2150
2174
  });
2151
- }
2152
-
2153
- var handleStoreChange = function () {
2154
- // TODO: Because there is no cross-renderer API for batching updates, it's
2155
- // up to the consumer of this library to wrap their subscription event
2156
- // with unstable_batchedUpdates. Should we try to detect when this isn't
2157
- // the case and print a warning in development?
2158
- // The store changed. Check if the snapshot changed since the last time we
2159
- // read from the store.
2160
- if (checkIfSnapshotChanged(inst)) {
2161
- // Force a re-render.
2162
- forceUpdate({
2163
- inst: inst
2164
- });
2165
- }
2166
- }; // Subscribe to the store and return a clean-up function.
2167
-
2168
-
2169
- return subscribe(handleStoreChange);
2170
- }, [subscribe]);
2175
+ },
2176
+ [subscribe]
2177
+ );
2171
2178
  useDebugValue(value);
2172
2179
  return value;
2173
2180
  }
2174
-
2175
2181
  function checkIfSnapshotChanged(inst) {
2176
2182
  var latestGetSnapshot = inst.getSnapshot;
2177
- var prevValue = inst.value;
2178
-
2183
+ inst = inst.value;
2179
2184
  try {
2180
2185
  var nextValue = latestGetSnapshot();
2181
- return !objectIs(prevValue, nextValue);
2186
+ return !objectIs(inst, nextValue);
2182
2187
  } catch (error) {
2183
- return true;
2188
+ return !0;
2184
2189
  }
2185
2190
  }
2186
-
2187
- function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
2188
- // Note: The shim does not use getServerSnapshot, because pre-18 versions of
2189
- // React do not expose a way to check if we're hydrating. So users of the shim
2190
- // will need to track that themselves and return the correct value
2191
- // from `getSnapshot`.
2191
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
2192
2192
  return getSnapshot();
2193
2193
  }
2194
+ var shim$1 =
2195
+ "undefined" === typeof window ||
2196
+ "undefined" === typeof window.document ||
2197
+ "undefined" === typeof window.document.createElement
2198
+ ? useSyncExternalStore$1
2199
+ : useSyncExternalStore$2;
2200
+ var useSyncExternalStore =
2201
+ void 0 !== React__default["default"].useSyncExternalStore ? React__default["default"].useSyncExternalStore : shim$1;
2202
+
2203
+ var useSyncExternalStoreShim_production = {
2204
+ useSyncExternalStore: useSyncExternalStore
2205
+ };
2194
2206
 
2195
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
2196
-
2197
- var isServerEnvironment = !canUseDOM;
2198
-
2199
- var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
2200
- var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
2201
-
2202
- exports.useSyncExternalStore = useSyncExternalStore$2;
2203
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
2204
- if (
2205
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
2206
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
2207
- 'function'
2208
- ) {
2209
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
2210
- }
2211
-
2207
+ var useSyncExternalStoreShim_development = createCommonjsModule(function (module, exports) {
2208
+ "production" !== process.env.NODE_ENV &&
2209
+ (function () {
2210
+ function is(x, y) {
2211
+ return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
2212
+ }
2213
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
2214
+ didWarnOld18Alpha ||
2215
+ void 0 === React.startTransition ||
2216
+ ((didWarnOld18Alpha = !0),
2217
+ console.error(
2218
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
2219
+ ));
2220
+ var value = getSnapshot();
2221
+ if (!didWarnUncachedGetSnapshot) {
2222
+ var cachedValue = getSnapshot();
2223
+ objectIs(value, cachedValue) ||
2224
+ (console.error(
2225
+ "The result of getSnapshot should be cached to avoid an infinite loop"
2226
+ ),
2227
+ (didWarnUncachedGetSnapshot = !0));
2228
+ }
2229
+ cachedValue = useState({
2230
+ inst: { value: value, getSnapshot: getSnapshot }
2231
+ });
2232
+ var inst = cachedValue[0].inst,
2233
+ forceUpdate = cachedValue[1];
2234
+ useLayoutEffect(
2235
+ function () {
2236
+ inst.value = value;
2237
+ inst.getSnapshot = getSnapshot;
2238
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
2239
+ },
2240
+ [subscribe, value, getSnapshot]
2241
+ );
2242
+ useEffect(
2243
+ function () {
2244
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
2245
+ return subscribe(function () {
2246
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
2247
+ });
2248
+ },
2249
+ [subscribe]
2250
+ );
2251
+ useDebugValue(value);
2252
+ return value;
2253
+ }
2254
+ function checkIfSnapshotChanged(inst) {
2255
+ var latestGetSnapshot = inst.getSnapshot;
2256
+ inst = inst.value;
2257
+ try {
2258
+ var nextValue = latestGetSnapshot();
2259
+ return !objectIs(inst, nextValue);
2260
+ } catch (error) {
2261
+ return !0;
2262
+ }
2263
+ }
2264
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
2265
+ return getSnapshot();
2266
+ }
2267
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2268
+ "function" ===
2269
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
2270
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
2271
+ var React = React__default["default"],
2272
+ objectIs = "function" === typeof Object.is ? Object.is : is,
2273
+ useState = React.useState,
2274
+ useEffect = React.useEffect,
2275
+ useLayoutEffect = React.useLayoutEffect,
2276
+ useDebugValue = React.useDebugValue,
2277
+ didWarnOld18Alpha = !1,
2278
+ didWarnUncachedGetSnapshot = !1,
2279
+ shim =
2280
+ "undefined" === typeof window ||
2281
+ "undefined" === typeof window.document ||
2282
+ "undefined" === typeof window.document.createElement
2283
+ ? useSyncExternalStore$1
2284
+ : useSyncExternalStore$2;
2285
+ exports.useSyncExternalStore =
2286
+ void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
2287
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2288
+ "function" ===
2289
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
2290
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2212
2291
  })();
2213
- }
2214
2292
  });
2215
2293
 
2216
2294
  var shim = createCommonjsModule(function (module) {
2217
2295
 
2218
2296
  if (process.env.NODE_ENV === 'production') {
2219
- module.exports = useSyncExternalStoreShim_production_min;
2297
+ module.exports = useSyncExternalStoreShim_production;
2220
2298
  } else {
2221
2299
  module.exports = useSyncExternalStoreShim_development;
2222
2300
  }
@@ -2364,144 +2442,49 @@
2364
2442
  });
2365
2443
  };
2366
2444
  this.onCreateFrameCaptionBarRequested = function (options) {
2367
- if (options === _this.state.frameCaptionBars[options.targetId] || !options) {
2368
- return;
2369
- }
2370
- _this.setState(function (s) {
2371
- var _a;
2372
- return __assign(__assign({}, s), { frameCaptionBars: __assign(__assign({}, s.frameCaptionBars), (_a = {}, _a[options.targetId] = options, _a)) });
2373
- });
2445
+ _this.onCreateElementRequested("frameCaptionBars", options);
2374
2446
  };
2375
2447
  this.onCreateFrameWindowOverlayRequested = function (options) {
2376
- if (options === _this.state.frameWindowOverlays[options.targetId] || !options) {
2377
- return;
2378
- }
2379
- _this.setState(function (s) {
2380
- var _a;
2381
- return __assign(__assign({}, s), { frameWindowOverlays: __assign(__assign({}, s.frameWindowOverlays), (_a = {}, _a[options.targetId] = options, _a)) });
2382
- });
2448
+ _this.onCreateElementRequested("frameWindowOverlays", options);
2383
2449
  };
2384
2450
  this.onCreateAboveWindowRequested = function (options) {
2385
- if (options === _this.state.aboveWindowZones[options.targetId] || !options) {
2386
- return;
2387
- }
2388
- _this.setState(function (s) {
2389
- var _a;
2390
- return __assign(__assign({}, s), { aboveWindowZones: __assign(__assign({}, s.aboveWindowZones), (_a = {}, _a[options.targetId] = options, _a)) });
2391
- });
2451
+ _this.onCreateElementRequested("aboveWindowZones", options);
2392
2452
  };
2393
2453
  this.onCreateWindowContentOverlayRequested = function (options) {
2394
- if (options === _this.state.windowContentOverlays[options.targetId] || !options) {
2395
- return;
2396
- }
2397
- _this.setState(function (s) {
2398
- var _a;
2399
- return __assign(__assign({}, s), { windowContentOverlays: __assign(__assign({}, s.windowContentOverlays), (_a = {}, _a[options.targetId] = options, _a)) });
2400
- });
2454
+ _this.onCreateElementRequested("windowContentOverlays", options);
2401
2455
  };
2402
2456
  this.onCreateFrameLoadingAnimationRequested = function (options) {
2403
- if (options === _this.state.frameLoadingAnimations[options.targetId] || !options) {
2404
- return;
2405
- }
2406
- _this.setState(function (s) {
2407
- var _a;
2408
- return __assign(__assign({}, s), { frameLoadingAnimations: __assign(__assign({}, s.frameLoadingAnimations), (_a = {}, _a[options.targetId] = options, _a)) });
2409
- });
2457
+ _this.onCreateElementRequested("frameLoadingAnimations", options);
2410
2458
  };
2411
2459
  this.onCreateBelowWindowRequested = function (options) {
2412
- if (options === _this.state.belowWindowZones[options.targetId] || !options) {
2413
- return;
2414
- }
2415
- _this.setState(function (s) {
2416
- var _a;
2417
- return __assign(__assign({}, s), { belowWindowZones: __assign(__assign({}, s.belowWindowZones), (_a = {}, _a[options.targetId] = options, _a)) });
2418
- });
2460
+ _this.onCreateElementRequested("belowWindowZones", options);
2419
2461
  };
2420
2462
  this.onCreateAboveTabsComponentRequested = function (options) {
2421
- if (options === _this.state.aboveTabsZones[options.targetId] || !options) {
2422
- return;
2423
- }
2424
- _this.setState(function (s) {
2425
- var _a;
2426
- return __assign(__assign({}, s), { aboveTabsZones: __assign(__assign({}, s.aboveTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2427
- });
2463
+ _this.onCreateElementRequested("aboveTabsZones", options);
2428
2464
  };
2429
2465
  this.onCreateBeforeTabsComponentRequested = function (options) {
2430
- if (options === _this.state.beforeTabsZones[options.targetId] || !options) {
2431
- return;
2432
- }
2433
- _this.setState(function (s) {
2434
- var _a;
2435
- return __assign(__assign({}, s), { beforeTabsZones: __assign(__assign({}, s.beforeTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2436
- });
2466
+ _this.onCreateElementRequested("beforeTabsZones", options);
2437
2467
  };
2438
2468
  this.onCreateTabElementRequested = function (options) {
2439
- if (options === _this.state.tabElements[options.targetId] || !options) {
2440
- return;
2441
- }
2442
- _this.setState(function (s) {
2443
- var _a;
2444
- var newTabElementsObj = Object.keys(s.tabElements).reduce(function (acc, targetId) {
2445
- acc[targetId] = s.tabElements[targetId];
2446
- return acc;
2447
- }, {});
2448
- newTabElementsObj[options.targetId] = options;
2449
- return __assign(__assign({}, s), { tabElements: __assign(__assign({}, s.tabElements), (_a = {}, _a[options.targetId] = options, _a)) });
2450
- });
2469
+ _this.onCreateElementRequested("tabElements", options);
2451
2470
  };
2452
2471
  this.onCreateAfterTabsComponentRequested = function (options) {
2453
- if (options === _this.state.afterTabsZones[options.targetId] || !options) {
2454
- return;
2455
- }
2456
- _this.setState(function (s) {
2457
- var _a;
2458
- return __assign(__assign({}, s), { afterTabsZones: __assign(__assign({}, s.afterTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2459
- });
2472
+ _this.onCreateElementRequested("afterTabsZones", options);
2460
2473
  };
2461
2474
  this.onCreateTabHeaderButtonsRequested = function (options) {
2462
- if (options === _this.state.tabHeaderButtons[options.targetId] || !options) {
2463
- return;
2464
- }
2465
- _this.setState(function (s) {
2466
- var _a;
2467
- return __assign(__assign({}, s), { tabHeaderButtons: __assign(__assign({}, s.tabHeaderButtons), (_a = {}, _a[options.targetId] = options, _a)) });
2468
- });
2475
+ _this.onCreateElementRequested("tabHeaderButtons", options);
2469
2476
  };
2470
2477
  this.onCreateBelowTabsComponentRequested = function (options) {
2471
- if (options === _this.state.belowTabsZones[options.targetId] || !options) {
2472
- return;
2473
- }
2474
- _this.setState(function (s) {
2475
- var _a;
2476
- return __assign(__assign({}, s), { belowTabsZones: __assign(__assign({}, s.belowTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2477
- });
2478
+ _this.onCreateElementRequested("belowTabsZones", options);
2478
2479
  };
2479
2480
  this.onCreateHtmlButtonsRequested = function (options) {
2480
- if (options === _this.state.htmlButtons[options.targetId] || !options) {
2481
- return;
2482
- }
2483
- _this.setState(function (s) {
2484
- var _a;
2485
- return __assign(__assign({}, s), { htmlButtons: __assign(__assign({}, s.htmlButtons), (_a = {}, _a[options.targetId] = options, _a)) });
2486
- });
2481
+ _this.onCreateElementRequested("htmlButtons", options);
2487
2482
  };
2488
2483
  this.onCreateTabOverflowPopupRequested = function (options) {
2489
- if (options === _this.state.tabOverflowPopups[options.targetId] || !options) {
2490
- return;
2491
- }
2492
- _this.setState(function (s) {
2493
- var _a;
2494
- return __assign(__assign({}, s), { tabOverflowPopups: __assign(__assign({}, s.tabOverflowPopups), (_a = {}, _a[options.targetId] = options, _a)) });
2495
- });
2484
+ _this.onCreateElementRequested("tabOverflowPopups", options);
2496
2485
  };
2497
2486
  this.onUpdateHtmlButtonsRequested = function (options) {
2498
- if (options === _this.state.htmlButtons[options.targetId] || !options) {
2499
- return;
2500
- }
2501
- _this.setState(function (s) {
2502
- var _a;
2503
- return __assign(__assign({}, s), { htmlButtons: __assign(__assign({}, s.htmlButtons), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.htmlButtons[options.targetId]), options), _a)) });
2504
- });
2487
+ _this.onUpdateElementRequested("htmlButtons", options);
2505
2488
  };
2506
2489
  this.onUpdateGroupCaptionBarRequested = function (options) {
2507
2490
  if (options === _this.state.groupCaptionBar) {
@@ -2512,95 +2495,47 @@
2512
2495
  });
2513
2496
  };
2514
2497
  this.onUpdateFrameCaptionBarRequested = function (options) {
2515
- if (options === _this.state.frameCaptionBars[options.targetId] || !options) {
2516
- return;
2517
- }
2518
- _this.setState(function (s) {
2519
- var _a;
2520
- return __assign(__assign({}, s), { frameCaptionBars: __assign(__assign({}, s.frameCaptionBars), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.frameCaptionBars[options.targetId]), options), _a)) });
2521
- });
2498
+ _this.onUpdateElementRequested("frameCaptionBars", options);
2522
2499
  };
2523
2500
  this.onUpdateFrameWindowOverlayRequested = function (options) {
2524
- if (options === _this.state.frameWindowOverlays[options.targetId] || !options) {
2525
- return;
2526
- }
2527
- _this.setState(function (s) {
2528
- var _a;
2529
- return __assign(__assign({}, s), { frameWindowOverlays: __assign(__assign({}, s.frameWindowOverlays), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.frameWindowOverlays[options.targetId]), options), _a)) });
2530
- });
2501
+ _this.onUpdateElementRequested("frameWindowOverlays", options);
2531
2502
  };
2532
2503
  this.onUpdateAboveTabsRequested = function (options) {
2533
- if (options === _this.state.aboveTabsZones[options.targetId] || !options) {
2534
- return;
2535
- }
2536
- _this.setState(function (s) {
2537
- var _a;
2538
- return __assign(__assign({}, s), { aboveTabsZones: __assign(__assign({}, s.aboveTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.aboveTabsZones[options.targetId]), options), _a)) });
2539
- });
2504
+ _this.onUpdateElementRequested("aboveTabsZones", options);
2540
2505
  };
2541
2506
  this.onUpdateBeforeTabsRequested = function (options) {
2542
- if (options === _this.state.beforeTabsZones[options.targetId] || !options) {
2543
- return;
2544
- }
2545
- _this.setState(function (s) {
2546
- var _a;
2547
- return __assign(__assign({}, s), { beforeTabsZones: __assign(__assign({}, s.beforeTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.beforeTabsZones[options.targetId]), options), _a)) });
2548
- });
2507
+ _this.onUpdateElementRequested("beforeTabsZones", options);
2549
2508
  };
2550
2509
  this.onUpdateTabElementRequested = function (options) {
2551
- if (options === _this.state.tabElements[options.targetId] || !options) {
2552
- return;
2553
- }
2554
- _this.setState(function (s) {
2555
- var _a;
2556
- return __assign(__assign({}, s), { tabElements: __assign(__assign({}, s.tabElements), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.tabElements[options.targetId]), options), _a)) });
2557
- });
2510
+ _this.onUpdateElementRequested("tabElements", options);
2558
2511
  };
2559
2512
  this.onUpdateAfterTabsRequested = function (options) {
2560
- if (options === _this.state.afterTabsZones[options.targetId] || !options) {
2561
- return;
2562
- }
2563
- _this.setState(function (s) {
2564
- var _a;
2565
- return __assign(__assign({}, s), { afterTabsZones: __assign(__assign({}, s.afterTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.afterTabsZones[options.targetId]), options), _a)) });
2566
- });
2513
+ _this.onUpdateElementRequested("afterTabsZones", options);
2567
2514
  };
2568
2515
  this.onUpdateTabHeaderButtonsRequested = function (options) {
2569
- if (options === _this.state.tabHeaderButtons[options.targetId] || !options) {
2570
- return;
2571
- }
2572
- _this.setState(function (s) {
2573
- var _a;
2574
- return __assign(__assign({}, s), { tabHeaderButtons: __assign(__assign({}, s.tabHeaderButtons), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.tabHeaderButtons[options.targetId]), options), _a)) });
2575
- });
2516
+ _this.onUpdateElementRequested("tabHeaderButtons", options);
2576
2517
  };
2577
2518
  this.onUpdateBelowTabsRequested = function (options) {
2578
- if (options === _this.state.belowTabsZones[options.targetId] || !options) {
2579
- return;
2580
- }
2581
- _this.setState(function (s) {
2582
- var _a;
2583
- return __assign(__assign({}, s), { belowTabsZones: __assign(__assign({}, s.belowTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.belowTabsZones[options.targetId]), options), _a)) });
2584
- });
2519
+ _this.onUpdateElementRequested("belowTabsZones", options);
2585
2520
  };
2586
2521
  this.onUpdateFrame = function (options) {
2587
2522
  _this.setState(function (s) {
2588
2523
  var newState = __assign({}, s);
2589
2524
  var updateSelectionWindow = function (stateProp, targetId, selectedWindow) {
2590
2525
  var _a;
2591
- var _b;
2592
- if (stateProp === "groupOverlay" || stateProp === "groupCaptionBar" || stateProp === "tabElements") {
2526
+ if (stateProp === "tabElements") {
2593
2527
  return;
2594
2528
  }
2595
- if (newState[stateProp][targetId] && ((_b = newState[stateProp][targetId]) === null || _b === void 0 ? void 0 : _b.selectedWindow) !== selectedWindow) {
2529
+ var newStateRecord = newState[stateProp][targetId];
2530
+ if (newStateRecord && (newStateRecord === null || newStateRecord === void 0 ? void 0 : newStateRecord.selectedWindow) !== selectedWindow) {
2596
2531
  newState[stateProp] = __assign(__assign({}, newState[stateProp]), (_a = {}, _a[targetId] = __assign(__assign({}, newState[stateProp][targetId]), { selectedWindow: selectedWindow }), _a));
2597
2532
  }
2598
2533
  };
2599
2534
  var updateHiddenTabs = function (stateProp, targetId, hiddenTabsToTheLeft, hiddenTabsToTheRight) {
2600
2535
  var _a;
2601
- var _b, _c;
2602
- var oldHiddenToTheLeft = (_b = newState[stateProp][targetId]) === null || _b === void 0 ? void 0 : _b.hiddenTabsToTheLeft;
2603
- var oldHiddenToTheRight = (_c = newState[stateProp][targetId]) === null || _c === void 0 ? void 0 : _c.hiddenTabsToTheRight;
2536
+ var oldState = newState[stateProp][targetId];
2537
+ var oldHiddenToTheLeft = oldState === null || oldState === void 0 ? void 0 : oldState.hiddenTabsToTheLeft;
2538
+ var oldHiddenToTheRight = oldState === null || oldState === void 0 ? void 0 : oldState.hiddenTabsToTheRight;
2604
2539
  newState[stateProp] = __assign(__assign({}, newState[stateProp]), (_a = {}, _a[targetId] = __assign(__assign({}, newState[stateProp][targetId]), { hiddenTabsToTheLeft: hiddenTabsToTheLeft || oldHiddenToTheLeft, hiddenTabsToTheRight: hiddenTabsToTheRight || oldHiddenToTheRight }), _a));
2605
2540
  };
2606
2541
  updateSelectionWindow("frameCaptionBars", options.targetId, options.selectedWindow);
@@ -2665,200 +2600,46 @@
2665
2600
  }
2666
2601
  };
2667
2602
  this.onRemoveFrameCaptionBarRequested = function (options) {
2668
- if (!_this.state.frameCaptionBars[options.targetId]) {
2669
- return;
2670
- }
2671
- _this.setState(function (s) {
2672
- var newCaptionBarsObj = Object.keys(s.frameCaptionBars).reduce(function (acc, targetId) {
2673
- if (targetId !== options.targetId) {
2674
- acc[targetId] = s.frameCaptionBars[targetId];
2675
- }
2676
- return acc;
2677
- }, {});
2678
- return __assign(__assign({}, s), { frameCaptionBars: newCaptionBarsObj });
2679
- });
2603
+ _this.onRemoveElementRequested("frameCaptionBars", options);
2680
2604
  };
2681
2605
  this.onRemoveFrameWindowOverlayRequested = function (options) {
2682
- if (!_this.state.frameWindowOverlays[options.targetId]) {
2683
- return;
2684
- }
2685
- _this.setState(function (s) {
2686
- var newCaptionBarsObj = Object.keys(s.frameWindowOverlays).reduce(function (acc, targetId) {
2687
- if (targetId !== options.targetId) {
2688
- acc[targetId] = s.frameWindowOverlays[targetId];
2689
- }
2690
- return acc;
2691
- }, {});
2692
- return __assign(__assign({}, s), { frameWindowOverlays: newCaptionBarsObj });
2693
- });
2606
+ _this.onRemoveElementRequested("frameWindowOverlays", options);
2694
2607
  };
2695
2608
  this.onRemoveAboveWindowRequested = function (options) {
2696
- if (!_this.state.aboveWindowZones[options.targetId]) {
2697
- return;
2698
- }
2699
- _this.setState(function (s) {
2700
- var newCaptionBarsObj = Object.keys(s.aboveWindowZones).reduce(function (acc, targetId) {
2701
- if (targetId !== options.targetId) {
2702
- acc[targetId] = s.aboveWindowZones[targetId];
2703
- }
2704
- return acc;
2705
- }, {});
2706
- return __assign(__assign({}, s), { aboveWindowZones: newCaptionBarsObj });
2707
- });
2609
+ _this.onRemoveElementRequested("aboveWindowZones", options);
2708
2610
  };
2709
2611
  this.onRemoveWindowContentOverlayRequested = function (options) {
2710
- if (!_this.state.windowContentOverlays[options.targetId]) {
2711
- return;
2712
- }
2713
- _this.setState(function (s) {
2714
- var newOverlaysObj = Object.keys(s.windowContentOverlays).reduce(function (acc, targetId) {
2715
- if (targetId !== options.targetId) {
2716
- acc[targetId] = s.windowContentOverlays[targetId];
2717
- }
2718
- return acc;
2719
- }, {});
2720
- return __assign(__assign({}, s), { windowContentOverlays: newOverlaysObj });
2721
- });
2612
+ _this.onRemoveElementRequested("windowContentOverlays", options);
2722
2613
  };
2723
2614
  this.onRemoveFrameLoadingAnimationRequested = function (options) {
2724
- if (!_this.state.frameLoadingAnimations[options.targetId]) {
2725
- return;
2726
- }
2727
- _this.setState(function (s) {
2728
- var newLoadingAnimationObj = Object.keys(s.frameLoadingAnimations).reduce(function (acc, targetId) {
2729
- if (targetId !== options.targetId) {
2730
- acc[targetId] = s.frameLoadingAnimations[targetId];
2731
- }
2732
- return acc;
2733
- }, {});
2734
- return __assign(__assign({}, s), { frameLoadingAnimation: newLoadingAnimationObj });
2735
- });
2615
+ _this.onRemoveElementRequested("frameLoadingAnimations", options);
2736
2616
  };
2737
2617
  this.onRemoveBelowWindowRequested = function (options) {
2738
- if (!_this.state.belowWindowZones[options.targetId]) {
2739
- return;
2740
- }
2741
- _this.setState(function (s) {
2742
- var newCaptionBarsObj = Object.keys(s.belowWindowZones).reduce(function (acc, targetId) {
2743
- if (targetId !== options.targetId) {
2744
- acc[targetId] = s.belowWindowZones[targetId];
2745
- }
2746
- return acc;
2747
- }, {});
2748
- return __assign(__assign({}, s), { belowWindowZones: newCaptionBarsObj });
2749
- });
2618
+ _this.onRemoveElementRequested("belowWindowZones", options);
2750
2619
  };
2751
2620
  this.onRemoveAboveTabsRequested = function (options) {
2752
- if (!_this.state.aboveTabsZones[options.targetId]) {
2753
- return;
2754
- }
2755
- _this.setState(function (s) {
2756
- var newTabElementsObj = Object.keys(s.aboveTabsZones).reduce(function (acc, targetId) {
2757
- if (targetId != options.targetId) {
2758
- acc[targetId] = s.aboveTabsZones[targetId];
2759
- }
2760
- return acc;
2761
- }, {});
2762
- return __assign(__assign({}, s), { aboveTabsZones: newTabElementsObj });
2763
- });
2621
+ _this.onRemoveElementRequested("aboveTabsZones", options);
2764
2622
  };
2765
2623
  this.onRemoveBeforeTabsComponentRequested = function (options) {
2766
- if (!_this.state.beforeTabsZones[options.targetId]) {
2767
- return;
2768
- }
2769
- _this.setState(function (s) {
2770
- var newTabElementsObj = Object.keys(s.beforeTabsZones).reduce(function (acc, targetId) {
2771
- if (targetId != options.targetId) {
2772
- acc[targetId] = s.beforeTabsZones[targetId];
2773
- }
2774
- return acc;
2775
- }, {});
2776
- return __assign(__assign({}, s), { beforeTabsZones: newTabElementsObj });
2777
- });
2624
+ _this.onRemoveElementRequested("beforeTabsZones", options);
2778
2625
  };
2779
2626
  this.onRemoveTabElementRequested = function (options) {
2780
- if (!_this.state.tabElements[options.targetId]) {
2781
- return;
2782
- }
2783
- _this.setState(function (s) {
2784
- var newTabElementsObj = Object.keys(s.tabElements).reduce(function (acc, targetId) {
2785
- if (targetId != options.targetId) {
2786
- acc[targetId] = s.tabElements[targetId];
2787
- }
2788
- return acc;
2789
- }, {});
2790
- return __assign(__assign({}, s), { tabElements: newTabElementsObj });
2791
- });
2627
+ _this.onRemoveElementRequested("tabElements", options);
2792
2628
  };
2793
2629
  this.onRemoveAfterTabsComponentRequested = function (options) {
2794
- if (!_this.state.afterTabsZones[options.targetId]) {
2795
- return;
2796
- }
2797
- _this.setState(function (s) {
2798
- var newTabElementsObj = Object.keys(s.afterTabsZones).reduce(function (acc, targetId) {
2799
- if (targetId != options.targetId) {
2800
- acc[targetId] = s.afterTabsZones[targetId];
2801
- }
2802
- return acc;
2803
- }, {});
2804
- return __assign(__assign({}, s), { afterTabsZones: newTabElementsObj });
2805
- });
2630
+ _this.onRemoveElementRequested("afterTabsZones", options);
2806
2631
  };
2807
2632
  this.onRemoveTabHeaderButtonsRequested = function (options) {
2808
- if (!_this.state.tabHeaderButtons[options.targetId]) {
2809
- return;
2810
- }
2811
- _this.setState(function (s) {
2812
- var newTabElementsObj = Object.keys(s.tabHeaderButtons).reduce(function (acc, targetId) {
2813
- if (targetId != options.targetId) {
2814
- acc[targetId] = s.tabHeaderButtons[targetId];
2815
- }
2816
- return acc;
2817
- }, {});
2818
- return __assign(__assign({}, s), { tabHeaderButtons: newTabElementsObj });
2819
- });
2633
+ _this.onRemoveElementRequested("tabHeaderButtons", options);
2820
2634
  };
2821
2635
  this.onRemoveBelowTabsRequested = function (options) {
2822
- if (!_this.state.belowTabsZones[options.targetId]) {
2823
- return;
2824
- }
2825
- _this.setState(function (s) {
2826
- var newTabElementsObj = Object.keys(s.belowTabsZones).reduce(function (acc, targetId) {
2827
- if (targetId != options.targetId) {
2828
- acc[targetId] = s.belowTabsZones[targetId];
2829
- }
2830
- return acc;
2831
- }, {});
2832
- return __assign(__assign({}, s), { belowTabsZones: newTabElementsObj });
2833
- });
2636
+ _this.onRemoveElementRequested("belowTabsZones", options);
2834
2637
  };
2835
2638
  this.onRemoveHtmlButtonsRequested = function (options) {
2836
- if (!_this.state.htmlButtons[options.targetId]) {
2837
- return;
2838
- }
2839
- _this.setState(function (s) {
2840
- var newHtmlObj = Object.keys(s.htmlButtons).reduce(function (acc, targetId) {
2841
- if (targetId != options.targetId) {
2842
- acc[targetId] = s.htmlButtons[targetId];
2843
- }
2844
- return acc;
2845
- }, {});
2846
- return __assign(__assign({}, s), { htmlButtons: newHtmlObj });
2847
- });
2639
+ _this.onRemoveElementRequested("htmlButtons", options);
2848
2640
  };
2849
2641
  this.onRemoveTabOverflowPopupRequested = function (options) {
2850
- if (!_this.state.tabOverflowPopups[options.targetId]) {
2851
- return;
2852
- }
2853
- _this.setState(function (s) {
2854
- var newTabOverflowPopupsObj = Object.keys(s.tabOverflowPopups).reduce(function (acc, targetId) {
2855
- if (targetId != options.targetId) {
2856
- acc[targetId] = s.tabOverflowPopups[targetId];
2857
- }
2858
- return acc;
2859
- }, {});
2860
- return __assign(__assign({}, s), { tabOverflowPopups: newTabOverflowPopupsObj });
2861
- });
2642
+ _this.onRemoveElementRequested("tabOverflowPopups", options);
2862
2643
  };
2863
2644
  this.onShowCaptionEditorRequested = function (targetType, targetId, text) {
2864
2645
  if (targetType === TargetType.Group) {
@@ -2991,6 +2772,40 @@
2991
2772
  return newState;
2992
2773
  });
2993
2774
  };
2775
+ this.onCreateElementRequested = function (key, options) {
2776
+ if (options === _this.state[key][options.targetId] || !options) {
2777
+ return;
2778
+ }
2779
+ _this.setState(function (s) {
2780
+ var _a, _b;
2781
+ return __assign(__assign({}, s), (_a = {}, _a[key] = __assign(__assign({}, s[key]), (_b = {}, _b[options.targetId] = options, _b)), _a));
2782
+ });
2783
+ };
2784
+ this.onUpdateElementRequested = function (key, options) {
2785
+ if (options === _this.state[key][options.targetId] || !options) {
2786
+ return;
2787
+ }
2788
+ _this.setState(function (s) {
2789
+ var _a, _b;
2790
+ return __assign(__assign({}, s), (_a = {}, _a[key] = __assign(__assign({}, s[key]), (_b = {}, _b[options.targetId] = __assign(__assign({}, s[key][options.targetId]), options), _b)), _a));
2791
+ });
2792
+ };
2793
+ this.onRemoveElementRequested = function (key, options) {
2794
+ var stateValue = _this.state[key];
2795
+ if (!stateValue || !stateValue[options.targetId]) {
2796
+ return;
2797
+ }
2798
+ _this.setState(function (s) {
2799
+ var _a;
2800
+ var newRecordObj = Object.keys(s[key]).reduce(function (acc, targetId) {
2801
+ if (targetId != options.targetId) {
2802
+ acc[targetId] = s[key][targetId];
2803
+ }
2804
+ return acc;
2805
+ }, {});
2806
+ return __assign(__assign({}, s), (_a = {}, _a[key] = newRecordObj, _a));
2807
+ });
2808
+ };
2994
2809
  this.setState = function (cb) {
2995
2810
  _this.state = cb(_this.state);
2996
2811
  _this.listeners.forEach(function (l) { return l(); });
@@ -3020,6 +2835,9 @@
3020
2835
  return;
3021
2836
  }
3022
2837
  var _b = state.groupCaptionBar, parentElement = _b.parentElement, options = __rest(_b, ["parentElement"]);
2838
+ var showCaptionEditor = function (text) {
2839
+ webGroupsManager.showCaptionEditor(TargetType.Group, options.targetId, text);
2840
+ };
3023
2841
  var minimize = __assign({ onClick: function () {
3024
2842
  webGroupsManager.onMinimizeButtonClick(TargetType.Group, options.targetId);
3025
2843
  } }, options.minimize);
@@ -3043,7 +2861,7 @@
3043
2861
  } });
3044
2862
  var notifyCaptionBoundsChanged = function (bounds) { return webGroupsManager.onCaptionTextBoundsChanged(TargetType.Group, options.targetId, bounds); };
3045
2863
  return (React__default["default"].createElement(Portal, { parentElement: parentElement },
3046
- React__default["default"].createElement(GroupCaptionBarCustomElement, __assign({}, options, { minimize: minimize, maximize: maximize, restore: restore, close: close, captionEditor: captionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged }))));
2864
+ React__default["default"].createElement(GroupCaptionBarCustomElement, __assign({}, options, { minimize: minimize, maximize: maximize, restore: restore, close: close, captionEditor: captionEditor, showCaptionEditor: showCaptionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged }))));
3047
2865
  };
3048
2866
  var renderGroupOverlay = function () {
3049
2867
  var _a;
@@ -3064,6 +2882,9 @@
3064
2882
  return;
3065
2883
  }
3066
2884
  var parentElement = fcb.parentElement, options = __rest(fcb, ["parentElement"]);
2885
+ var showCaptionEditor = function (text) {
2886
+ webGroupsManager.showCaptionEditor(TargetType.Frame, options.targetId, text);
2887
+ };
3067
2888
  var feedback = __assign({ onClick: function () {
3068
2889
  webGroupsManager.onFeedbackButtonClick(TargetType.Frame, options.targetId);
3069
2890
  } }, options.feedback);
@@ -3132,7 +2953,7 @@
3132
2953
  } });
3133
2954
  var notifyCaptionBoundsChanged = function (bounds) { return webGroupsManager.onCaptionTextBoundsChanged(TargetType.Frame, options.targetId, bounds); };
3134
2955
  return React__default["default"].createElement(Portal, { key: options.targetId, parentElement: parentElement },
3135
- React__default["default"].createElement(FrameCaptionBarCustomElement, __assign({}, options, { feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, channels: channels, customButtons: customButtonsProps, frameId: options.targetId, captionEditor: captionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged })));
2956
+ React__default["default"].createElement(FrameCaptionBarCustomElement, __assign({}, options, { feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, channels: channels, customButtons: customButtonsProps, frameId: options.targetId, captionEditor: captionEditor, showCaptionEditor: showCaptionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged })));
3136
2957
  });
3137
2958
  };
3138
2959
  var renderFrameWindowOverlay = function () {
@@ -3345,11 +3166,14 @@
3345
3166
  var select = function (windowId) {
3346
3167
  webGroupsManager.selectTab(windowId);
3347
3168
  };
3169
+ var resize = function (bounds) {
3170
+ webGroupsManager.resizeTabOverflowPopup(options.targetId, bounds);
3171
+ };
3348
3172
  var close = function (windowId) {
3349
3173
  webGroupsManager.closeTab(windowId);
3350
3174
  };
3351
3175
  return React__default["default"].createElement(Portal, { key: options.targetId, parentElement: parentElement },
3352
- React__default["default"].createElement(TabOverflowCustomElement, __assign({}, options, { select: select, close: close, frameId: options.targetId })));
3176
+ React__default["default"].createElement(TabOverflowCustomElement, __assign({}, options, { resize: resize, select: select, close: close, frameId: options.targetId })));
3353
3177
  });
3354
3178
  };
3355
3179
  var renderBelowTabs = function () {
@@ -3503,7 +3327,16 @@
3503
3327
  };
3504
3328
 
3505
3329
  var TabOverflowPopup = function (_a) {
3506
- var hiddenTabsToTheLeft = _a.hiddenTabsToTheLeft, hiddenTabsToTheRight = _a.hiddenTabsToTheRight, close = _a.close, select = _a.select;
3330
+ var hiddenTabsToTheLeft = _a.hiddenTabsToTheLeft, hiddenTabsToTheRight = _a.hiddenTabsToTheRight, close = _a.close, resize = _a.resize, select = _a.select;
3331
+ var ref = React__default["default"].useRef(null);
3332
+ React.useEffect(function () {
3333
+ if (!ref.current)
3334
+ return;
3335
+ if (typeof resize !== "function")
3336
+ return;
3337
+ var bounds = getElementBounds(ref.current);
3338
+ resize(bounds);
3339
+ }, [ref]);
3507
3340
  var createSection = function (tabs, title) {
3508
3341
  return (React__default["default"].createElement("ul", null,
3509
3342
  React__default["default"].createElement("li", { className: "title" }, title),
@@ -3520,12 +3353,49 @@
3520
3353
  var handleTabClose = function (windowId) {
3521
3354
  close(windowId);
3522
3355
  };
3523
- return (React__default["default"].createElement("div", { className: "t42-wg-tab-overflow-popup" },
3356
+ return (React__default["default"].createElement("div", { ref: ref, className: "t42-wg-tab-overflow-popup" },
3524
3357
  hiddenTabsToTheLeft.length > 0 && createSection(hiddenTabsToTheLeft, "Open left"),
3525
3358
  hiddenTabsToTheLeft.length > 0 && hiddenTabsToTheRight.length > 0 && React__default["default"].createElement("hr", null),
3526
3359
  hiddenTabsToTheRight.length > 0 && createSection(hiddenTabsToTheRight, "Open right")));
3527
3360
  };
3528
3361
 
3362
+ function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C,k={exports:{}};
3363
+ /*!
3364
+ Copyright (c) 2018 Jed Watson.
3365
+ Licensed under the MIT License (MIT), see
3366
+ http://jedwatson.github.io/classnames
3367
+ */C=k,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=o(e,n(i)));}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return "";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var r in n)e.call(n,r)&&n[r]&&(i=o(i,r));return i}function o(e,t){return t?e?e+" "+t:e+t:e}C.exports?(t.default=t,C.exports=t):window.classNames=t;}();var N=b(k.exports);function S({className:t,size:n="16",variant:o="workspace",...i}){const r=N("icon",n&&[`icon-size-${n}`],t);return jsxRuntime.jsx("span",{className:r,"aria-label":`icon-${o}`,role:"presentation",...i,children:jsxRuntime.jsx("i",{className:`icon-${o}`})})}const D=React.forwardRef(({className:t,variant:n="default",icon:o="workspace",size:i="16",tooltip:r,iconSize:s="16",onClick:l,disabled:c,children:u,...d},f)=>{const m=N("io-btn-icon","default"!==n&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${i}`],t),p=React.useCallback(e=>{if(!c)return l?l(e):void 0;e.preventDefault();},[l,c]);return jsxRuntime.jsx("button",{className:m,type:"button",ref:f,"aria-label":"icon button","aria-disabled":c,title:r,onClick:p,disabled:c,...d,children:u??(o&&jsxRuntime.jsx(S,{variant:o,size:s}))})});D.displayName="ButtonIcon";function I({className:t,variant:n="default",children:o,...i}){const r=N("io-badge","default"!==n&&[`io-badge-${n}`],t);return jsxRuntime.jsx("div",{className:r,...i,children:o})}function M({className:t,tag:n="h2",size:o="normal",text:i="Title",...r}){const a=n,s=N("small"===o&&"io-title-semibold","normal"===o&&"io-title","large"===o&&"io-title-large",t);return jsxRuntime.jsx(a,{className:s,...r,children:i})}function P({className:n,title:o,titleSize:i="normal",tag:r,hint:a,children:s,...l}){const c=N("io-block",n),u=o?"block-title":void 0;return jsxRuntime.jsxs("section",{className:c,"aria-label":o?void 0:"Block","aria-labelledby":u,...l,children:[o&&jsxRuntime.jsx(M,{id:u,tag:r,text:o,size:i}),s,a&&jsxRuntime.jsx("p",{className:"io-text-smaller",children:a})]})}const A=e=>"Enter"===e.key||" "===e.key,T=React.forwardRef(({className:n,variant:o="default",size:i="normal",icon:r,iconSize:s="12",iconRight:l=!1,text:c,onClick:u,disabled:d,children:f,...m},p)=>{const h=N("io-btn",("primary"===o||"critical"===o||"outline"===o||"link"===o)&&[`io-btn-${o}`],"large"===i&&"io-btn-lg",n),g=React.useCallback(e=>{if(!d)return u?u(e):void 0;e.preventDefault();},[u,d]),v=React.useCallback(e=>{d||A(e)&&(e.preventDefault(),g(e));},[g,d]);return jsxRuntime.jsxs("button",{className:h,ref:p,type:"button","aria-disabled":d,onClick:g,onKeyDown:v,disabled:d,tabIndex:0,...m,children:[r&&!l&&jsxRuntime.jsx(S,{variant:r,size:s}),f??c,r&&l&&jsxRuntime.jsx(S,{variant:r,size:s})]})});T.displayName="Button";const O=React.createContext({}),F=React.forwardRef(({icon:t="chevron-down",onClick:n,onKeyDown:o,...i},r)=>{const{handleToggle:s,disabled:c,setTriggerRef:u}=React.useContext(O),d=React.useCallback(e=>{u?.(e),r&&("function"==typeof r?r(e):r.current=e);},[r,u]),f=React.useCallback(e=>{e.stopPropagation(),n?.(e),e.defaultPrevented||s?.();},[n,s]),m=React.useCallback(e=>{o?.(e),e.defaultPrevented||A(e)&&(e.preventDefault(),e.stopPropagation(),s?.());},[o,s]);return jsxRuntime.jsx(T,{icon:t,iconRight:!0,onClick:f,onKeyDown:m,disabled:c,ref:d,...i})});F.displayName="DropdownButton";const L=React.forwardRef(({size:t="32",onClick:n,onKeyDown:o,...i},r)=>{const{handleToggle:s,disabled:c,setTriggerRef:u}=React.useContext(O),d=React.useCallback(e=>{u?.(e),r&&("function"==typeof r?r(e):r.current=e);},[r,u]),f=React.useCallback(e=>{e.stopPropagation(),n?.(e),e.defaultPrevented||s?.();},[n,s]),m=React.useCallback(e=>{o?.(e),e.defaultPrevented||A(e)&&(e.preventDefault(),e.stopPropagation(),s?.());},[o,s]);return jsxRuntime.jsx(D,{size:t,onClick:f,onKeyDown:m,disabled:c,ref:d,...i})});function B({className:t,...n}){const o=N("io-dropdown-content",t);return jsxRuntime.jsx("div",{className:o,...n})}L.displayName="DropdownButtonIcon";const R=React.createContext({}),_=React.forwardRef((n,o)=>{const{className:i,prepend:r,append:a,isSelected:s,onClick:c,description:u,disabled:d=!1,children:f,tooltip:m,...p}=n,{variant:h="default",selected:g,checkIcon:v,handleItemClick:y}=React.useContext(R),w=s??g?.some(e=>e.children===f),b="default"!==h&&!!v,C=b||r,k=N("io-list-item",C&&"io-list-item-left",a&&"io-list-item-right","default"!==h&&w&&"selected",u&&"io-list-item-description",d&&"io-list-item-disabled",i);return jsxRuntime.jsxs("li",{className:k,ref:o,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:e=>{d?e.preventDefault():(y?.(e,{children:f}),c?.(e));},...p,children:[C&&jsxRuntime.jsxs("div",{className:"io-list-left-column",children:[b&&jsxRuntime.jsx(S,{variant:v.variant,title:w?v.tooltip:void 0,"data-testid":"list-item-check-icon"}),r]}),jsxRuntime.jsx("span",{className:"io-list-text",title:m,"data-testid":"list-item-title",children:f}),a&&jsxRuntime.jsx("div",{className:"io-list-right-column",children:a}),u&&jsxRuntime.jsx("div",{className:"io-list-text-description",children:u})]})});_.displayName="ListItem";const H=React.forwardRef(({className:n,prepend:o,append:i,children:r,tooltip:a,...s},l)=>{const c=N("io-list-item",o&&"io-list-item-left",i&&"io-list-item-right","io-list-item-title",n);return jsxRuntime.jsxs("li",{className:c,ref:l,...s,children:[o&&jsxRuntime.jsx("div",{className:"io-list-left-column",children:o}),jsxRuntime.jsx("span",{className:"io-list-text",title:a,"data-testid":"list-item-title",children:r}),i&&jsxRuntime.jsx("div",{className:"io-list-right-column",children:i})]})});H.displayName="ListItemTitle";const j=React.forwardRef(({className:n,prepend:o,append:i,children:r,tooltip:a,...s},l)=>{const c=N("io-list-item",o&&"io-list-item-left",i&&"io-list-item-right","io-list-item-section",n);return jsxRuntime.jsxs("li",{className:c,ref:l,...s,children:[o&&jsxRuntime.jsx("div",{className:"io-list-left-column",children:o}),jsxRuntime.jsx("span",{className:"io-list-text",title:a,children:r}),i&&jsxRuntime.jsx("div",{className:"io-list-right-column",children:i})]})});j.displayName="ListItemSection";const $=React.forwardRef(({className:n,prepend:o,append:i,children:r,tooltip:a,...s},l)=>{const c=N("io-list-item-header",n);return jsxRuntime.jsxs("div",{className:c,ref:l,...s,children:[o&&jsxRuntime.jsx("div",{className:"io-list-left-column",children:o}),jsxRuntime.jsx("span",{className:"io-list-text",title:a,children:r}),i&&jsxRuntime.jsx("div",{className:"io-list-right-column",children:i})]})});$.displayName="ListItemHeader";const z=React.forwardRef(({className:t,children:n,...o},i)=>{const r=N("io-list-item","io-list-with-sub-items",t);return jsxRuntime.jsx("li",{className:r,ref:i,...o,children:n})});z.displayName="ListItemWithSubItems";const W=React.forwardRef((t,n)=>{const{className:o,variant:i="default",checkIcon:r,children:s,...l}=t,[d,f]=React.useState([]),m=N("io-list","default"!==i&&"io-list-selectable",o),p=React.useMemo(()=>{if(r)return "object"==typeof r?r:{variant:r}},[r]),h=React.useCallback((e,t)=>{if("default"===i)return;const n=d.some(e=>e.children?.toString()===t.children?.toString());"single"===i?f([t]):(()=>{const e=n?d.filter(e=>e.children!==t.children):[...d,t];f(e);})();},[d,i]),g=React.useMemo(()=>({variant:i,selected:d,checkIcon:p,handleItemClick:h}),[i,d,p,h]);return jsxRuntime.jsx(R.Provider,{value:g,children:jsxRuntime.jsx("ul",{className:m,ref:n,...l,children:s})})});W.displayName="List";const V=W;V.Item=_,V.ItemTitle=H,V.ItemSection=j,V.ItemHeader=$,V.ItemWithSubItems=z;const Y=React.forwardRef((t,n)=>jsxRuntime.jsx(V,{...t,ref:n}));Y.displayName="DropdownList";const U=React.forwardRef((t,n)=>{const{handleClose:o}=React.useContext(O),{onClick:i,onKeyDown:r,...s}=t,c=React.useRef(null),u=React.useCallback(e=>{c.current=e,"function"==typeof n?n(e):n&&(n.current=e);},[n]);return jsxRuntime.jsx(_,{...s,ref:u,onClick:e=>{i?.(e),o?.();},onKeyDown:e=>{if(r?.(e),e.defaultPrevented||!A(e))return;e.preventDefault(),e.stopPropagation();const t=("function"==typeof n?null:n?.current)||c.current;t?.click();}})});U.displayName="DropdownItem";const K=React.forwardRef((t,n)=>jsxRuntime.jsx(H,{...t,ref:n}));K.displayName="DropdownItemTitle";const J=React.forwardRef((t,n)=>jsxRuntime.jsx(j,{...t,ref:n}));function q({className:t,...n}){const o=N("io-separator",t);return jsxRuntime.jsx("hr",{className:o,...n})}J.displayName="DropdownItemSection";const G=React.forwardRef((t,n)=>jsxRuntime.jsx(q,{...t}));G.displayName="DropdownSeparator";function Q(e,t,n){const o=React.useCallback(n=>{const o=t.some(e=>n.key===e);o&&(n.preventDefault(),e());},[e,t]);React.useEffect(()=>{const e=n?.current||document;return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o);}},[o,n]);}const X=React.forwardRef(({className:t,variant:n="outline",align:o="down",disabled:i,isOpen:r,onOpenChange:s,children:l,...p},h)=>{const g=React.useRef(null),v=React.useRef(null);React.useImperativeHandle(h,()=>v.current,[]);const{isOpen:y,handleOpen:w,handleClose:b}=((e,t)=>{const[n,o]=React.useState(!1),i=void 0!==e,r=i?e:n,s=React.useCallback(e=>{i||o(e),t?.(e);},[i,t]),l=React.useCallback(()=>s(!0),[s]),u=React.useCallback(()=>s(!1),[s]);return {isOpen:r,setOpen:s,handleOpen:l,handleClose:u}})(r,s);((e,t,n=!0)=>{React.useEffect(()=>{if(!n)return;const o=n=>{const o=n.target;o&&e.current&&!e.current.contains(o)&&(n.composedPath&&n.composedPath().some(t=>t===e.current||e.current&&t.nodeType===Node.ELEMENT_NODE&&e.current.contains(t))||t());},i=requestAnimationFrame(()=>{document.addEventListener("mousedown",o,!0);});return ()=>{cancelAnimationFrame(i),document.removeEventListener("mousedown",o,!0);}},[e,t,n]);})(v,b,y),Q(()=>{y&&b();},["Escape"],v),Q(()=>{y||i||g.current!==document.activeElement||w();},["ArrowDown","ArrowUp"],v);const C=React.useMemo(()=>({variant:n,align:o,disabled:i,isOpen:y,handleOpen:w,handleClose:b,handleToggle:y?b:w,setTriggerRef:e=>g.current=e}),[n,o,i,y,w,b]),k=N("io-dropdown",y&&"io-dropdown-open","default"!==n&&`io-dropdown-${n}`,t);return jsxRuntime.jsx(O.Provider,{value:C,children:jsxRuntime.jsx("div",{className:k,ref:v,...p,children:l})})});function Z({className:t,variant:n="default",align:o="left",children:i,...r}){const a=N("io-btn-group","default"!==n&&`io-btn-group-${n}`,"right"===o&&"io-btn-group-right",t);return jsxRuntime.jsx("div",{className:a,"data-testid":"button-group",...r,children:i})}function ee({className:t,draggable:n=!1,children:o,...i}){const r=N("io-header",n&&["draggable"],t);return jsxRuntime.jsx("header",{className:r,...i,children:o})}function te({className:t,children:n,...o}){const i=N("io-dialog-header",t);return jsxRuntime.jsx(ee,{"data-testid":"io-dialog-header",className:i,...o,children:n})}function ne({className:t,children:n,...o}){const i=N("io-dialog-body",t);return jsxRuntime.jsx("div",{"data-testid":"io-dialog-body",className:i,...o,children:n})}function oe({className:t,children:n,...o}){const i=N("io-footer",t);return jsxRuntime.jsx("footer",{className:i,...o,children:n})}function ie({className:t,...n}){const o=N("io-dialog-footer",t);return jsxRuntime.jsx(oe,{"data-testid":"io-dialog-footer",className:o,...n})}function re({className:n,variant:o="default",title:i="Dialog Title",isOpen:r=!1,draggable:a=!1,closeFn:s,children:l,...c}){const u=React.useRef(null),f=N("io-dialog","centered"===o&&"io-dialog-center",n);return React.useLayoutEffect(()=>{const e=u?.current;e&&(r?e.showModal():"function"==typeof e.close&&e.close());},[r]),jsxRuntime.jsxs("dialog",{"data-testid":"io-dialog",className:f,ref:u,"data-modal":!0,onClose:()=>{r&&s&&s();},onClick:e=>{r&&s&&"DIALOG"===e.target.nodeName&&s();},onKeyDown:e=>{const t=e.target instanceof HTMLDialogElement&&"DIALOG"===e.target.nodeName;r&&s&&" "===e.key&&t&&s();},...c,children:[jsxRuntime.jsxs(te,{draggable:a,children:[jsxRuntime.jsx("h3",{"data-testid":"io-dialog-title",children:i}),jsxRuntime.jsx(Z,{children:jsxRuntime.jsx(D,{className:"non-draggable","data-testid":"io-dialog-close-button",size:"24",icon:"close",iconSize:"12",onClick:s,tabIndex:-1})})]}),l]})}function ae(){return "undefined"!=typeof window}function se(e){return ue(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return (null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ce(e){var t;return null==(t=(ue(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ue(e){return !!ae()&&(e instanceof Node||e instanceof le(e).Node)}function de(e){return !!ae()&&(e instanceof Element||e instanceof le(e).Element)}function fe(e){return !!ae()&&(e instanceof HTMLElement||e instanceof le(e).HTMLElement)}function me(e){return !(!ae()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof le(e).ShadowRoot)}X.Button=F,X.ButtonIcon=L,X.Content=B,X.List=Y,X.Item=U,X.ItemTitle=K,X.ItemSection=J,X.Separator=G,Z.Button=T,Z.ButtonIcon=D,Z.Dropdown=X,ee.Title=M,ee.ButtonGroup=Z,ee.Button=T,ee.ButtonIcon=D,ee.Dropdown=X,te.Title=M,te.ButtonGroup=Z,te.Button=T,te.ButtonIcon=D,te.Dropdown=X,ne.Content=function({className:t,children:n,...o}){const i=N("io-dialog-content",t);return jsxRuntime.jsx("div",{className:i,...o,children:n})},oe.ButtonGroup=Z,oe.Button=T,oe.ButtonIcon=D,oe.Dropdown=X,ie.ButtonGroup=Z,ie.Button=T,ie.ButtonIcon=D,ie.Dropdown=X,re.Header=te,re.Body=ne,re.Footer=ie;const pe=new Set(["inline","contents"]);function he(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Ee(e);return /auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!pe.has(i)}const ge=new Set(["table","td","th"]);function ve(e){return ge.has(se(e))}const ye=[":popover-open",":modal"];function we(e){return ye.some(t=>{try{return e.matches(t)}catch(e){return !1}})}const be=["transform","translate","scale","rotate","perspective"],Ce=["transform","translate","scale","rotate","perspective","filter"],ke=["paint","layout","strict","content"];function Ne(e){const t=Se(),n=de(e)?Ee(e):e;return be.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Ce.some(e=>(n.willChange||"").includes(e))||ke.some(e=>(n.contain||"").includes(e))}function Se(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const De=new Set(["html","body","#document"]);function xe(e){return De.has(se(e))}function Ee(e){return le(e).getComputedStyle(e)}function Ie(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Me(e){if("html"===se(e))return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||ce(e);return me(t)?t.host:t}function Pe(e){const t=Me(e);return xe(t)?e.ownerDocument?e.ownerDocument.body:e.body:fe(t)&&he(t)?t:Pe(t)}function Ae(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=Pe(e),r=i===(null==(o=e.ownerDocument)?void 0:o.body),a=le(i);if(r){const e=Te(a);return t.concat(a,a.visualViewport||[],he(i)?i:[],e&&n?Ae(e):[])}return t.concat(i,Ae(i,[],n))}function Te(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Oe(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement;}return t}function Fe(e,t){if(!e||!t)return !1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return !0;if(n&&me(n)){let n=t;for(;n;){if(e===n)return !0;n=n.parentNode||n.host;}}return !1}function Le(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Be(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function Re(e){return !(0!==e.mozInputSource||!e.isTrusted)||(je()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function _e(e){return !Be().includes("jsdom/")&&(!je()&&0===e.width&&0===e.height||je()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function He(){return /apple/i.test(navigator.vendor)}function je(){const e=/android/i;return e.test(Le())||e.test(Be())}function $e(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function ze(e){return (null==e?void 0:e.ownerDocument)||document}function We(e,t){if(null==t)return !1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Ve(e){return "composedPath"in e?e.composedPath()[0]:e.target}function Ye(e){return fe(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ue(e){e.preventDefault(),e.stopPropagation();}function Ke(e){return !!e&&("combobox"===e.getAttribute("role")&&Ye(e))}const Je=Math.min,qe=Math.max,Ge=Math.round,Qe=Math.floor,Xe=e=>({x:e,y:e}),Ze={left:"right",right:"left",bottom:"top",top:"bottom"},et={start:"end",end:"start"};function tt(e,t,n){return qe(e,Je(t,n))}function nt(e,t){return "function"==typeof e?e(t):e}function ot(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function rt(e){return "x"===e?"y":"x"}function at(e){return "y"===e?"height":"width"}const st=new Set(["top","bottom"]);function lt(e){return st.has(ot(e))?"y":"x"}function ct(e){return rt(lt(e))}function ut(e){return e.replace(/start|end/g,e=>et[e])}const dt=["left","right"],ft=["right","left"],mt=["top","bottom"],pt=["bottom","top"];function ht(e,t,n,o){const i=it(e);let r=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ft:dt:t?dt:ft;case"left":case"right":return t?mt:pt;default:return []}}(ot(e),"start"===n,o);return i&&(r=r.map(e=>e+"-"+i),t&&(r=r.concat(r.map(ut)))),r}function gt(e){return e.replace(/left|right|bottom|top/g,e=>Ze[e])}function vt(e){const{x:t,y:n,width:o,height:i}=e;return {width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}
3368
+ /*!
3369
+ * tabbable 6.2.0
3370
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
3371
+ */var yt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),wt="undefined"==typeof Element,bt=wt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ct=!wt&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},kt=function e(t,n){var o;void 0===n&&(n=!0);var i=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return ""===i||"true"===i||n&&t&&e(t.parentNode)},Nt=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var a=r.shift();if(!kt(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,o);o.flatten?i.push.apply(i,l):i.push({scopeParent:a,candidates:l});}else {bt.call(a,yt)&&o.filter(a)&&(n||!t.includes(a))&&i.push(a);var c=a.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(a),u=!kt(c,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(c&&u){var d=e(!0===c?a.children:c.children,!0,o);o.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d});}else r.unshift.apply(r,a.children);}}return i},St=function(e){return !isNaN(parseInt(e.getAttribute("tabindex"),10))},Dt=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return ""===n||"true"===n}(e))&&!St(e)?0:e.tabIndex},xt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Et=function(e){return "INPUT"===e.tagName},It=function(e){return function(e){return Et(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return !0;var t,n=e.form||Ct(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name);}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return !i||i===e}(e)},Mt=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},Pt=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return !0;var i=bt.call(e,"details>summary:first-of-type")?e.parentElement:e;if(bt.call(i,"details:not([open]) *"))return !0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Mt(e)}else {if("function"==typeof o){for(var r=e;e;){var a=e.parentElement,s=Ct(e);if(a&&!a.shadowRoot&&!0===o(a))return Mt(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host;}e=r;}if(function(e){var t,n,o,i,r=e&&Ct(e),a=null===(t=r)||void 0===t?void 0:t.host,s=!1;if(r&&r!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(a)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!s&&a;){var l,c,u;s=!(null===(c=a=null===(l=r=Ct(a))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(a));}return s}(e))return !e.getClientRects().length;if("legacy-full"!==n)return !0}return !1},At=function(e,t){return !(t.disabled||kt(t)||function(e){return Et(e)&&"hidden"===e.type}(t)||Pt(t,e)||function(e){return "DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return "SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return !!bt.call(t,"fieldset[disabled] *")||!o.contains(e)}return !0}t=t.parentElement;}return !1}(t))},Tt=function(e,t){return !(It(t)||Dt(t)<0||!At(e,t))},Ot=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return !!(isNaN(t)||t>=0)},Ft=function e(t){var n=[],o=[];return t.forEach(function(t,i){var r=!!t.scopeParent,a=r?t.scopeParent:t,s=function(e,t){var n=Dt(e);return n<0&&t&&!St(e)?0:n}(a,r),l=r?e(t.candidates):a;0===s?r?n.push.apply(n,l):n.push(a):o.push({documentOrder:i,tabIndex:s,item:t,isScope:r,content:l});}),o.sort(xt).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Lt=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Nt([e],t.includeContainer,{filter:Tt.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ot}):function(e,t,n){if(kt(e))return [];var o=Array.prototype.slice.apply(e.querySelectorAll(yt));return t&&bt.call(e,yt)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,Tt.bind(null,t)),Ft(n)};function Bt(e,t,n){let{reference:o,floating:i}=e;const r=lt(t),a=ct(t),s=at(a),l=ot(t),c="y"===r,u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,f=o[s]/2-i[s]/2;let m;switch(l){case"top":m={x:u,y:o.y-i.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-i.width,y:d};break;default:m={x:o.x,y:o.y};}switch(it(t)){case"start":m[a]-=f*(n&&c?-1:1);break;case"end":m[a]+=f*(n&&c?-1:1);}return m}async function Rt(e,t){var n;void 0===t&&(t={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=nt(t,e),p=function(e){return "number"!=typeof e?function(e){return {top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(m),h=s[f?"floating"===d?"reference":"floating":d],g=vt(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(h)))||n?h:h.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),w=await(null==r.isElement?void 0:r.isElement(y))&&await(null==r.getScale?void 0:r.getScale(y))||{x:1,y:1},b=vt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return {top:(g.top-b.top+p.top)/w.y,bottom:(b.bottom-g.bottom+p.bottom)/w.y,left:(g.left-b.left+p.left)/w.x,right:(b.right-g.right+p.right)/w.x}}const _t=new Set(["left","top"]);function Ht(e){const t=Ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=fe(e),r=i?e.offsetWidth:n,a=i?e.offsetHeight:o,s=Ge(n)!==r||Ge(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function jt(e){return de(e)?e:e.contextElement}function $t(e){const t=jt(e);if(!fe(t))return Xe(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Ht(t);let a=(r?Ge(n.width):n.width)/o,s=(r?Ge(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const zt=Xe(0);function Wt(e){const t=le(e);return Se()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zt}function Vt(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),r=jt(e);let a=Xe(1);t&&(o?de(o)&&(a=$t(o)):a=$t(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==le(e))&&t}(r,n,o)?Wt(r):Xe(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(r){const e=le(r),t=o&&de(o)?le(o):o;let n=e,i=Te(n);for(;i&&o&&t!==n;){const e=$t(i),t=i.getBoundingClientRect(),o=Ee(i),r=t.left+(i.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=r,c+=a,n=le(i),i=Te(n);}}return vt({width:u,height:d,x:l,y:c})}function Yt(e,t){const n=Ie(e).scrollLeft;return t?t.left+n:Vt(ce(e)).left+n}function Ut(e,t,n){void 0===n&&(n=!1);const o=e.getBoundingClientRect();return {x:o.left+t.scrollLeft-(n?0:Yt(e,o)),y:o.top+t.scrollTop}}const Kt=new Set(["absolute","fixed"]);function Jt(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=le(e),o=ce(e),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const e=Se();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop);}return {width:r,height:a,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=ce(e),n=Ie(e),o=e.ownerDocument.body,i=qe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=qe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Yt(e);const s=-n.scrollTop;return "rtl"===Ee(o).direction&&(a+=qe(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(ce(e));else if(de(t))o=function(e,t){const n=Vt(e,!0,"fixed"===t),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=fe(e)?$t(e):Xe(1);return {width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:i*r.x,y:o*r.y}}(t,n);else {const n=Wt(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height};}return vt(o)}function qt(e,t){const n=Me(e);return !(n===t||!de(n)||xe(n))&&("fixed"===Ee(n).position||qt(n,t))}function Gt(e,t,n){const o=fe(t),i=ce(t),r="fixed"===n,a=Vt(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const l=Xe(0);function c(){l.x=Yt(i);}if(o||!o&&!r)if(("body"!==se(t)||he(i))&&(s=Ie(t)),o){const e=Vt(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop;}else i&&c();r&&!o&&i&&c();const u=!i||o||r?Xe(0):Ut(i,s);return {x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function Qt(e){return "static"===Ee(e).position}function Xt(e,t){if(!fe(e)||"fixed"===Ee(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ce(e)===n&&(n=n.ownerDocument.body),n}function Zt(e,t){const n=le(e);if(we(e))return n;if(!fe(e)){let t=Me(e);for(;t&&!xe(t);){if(de(t)&&!Qt(t))return t;t=Me(t);}return n}let o=Xt(e,t);for(;o&&ve(o)&&Qt(o);)o=Xt(o,t);return o&&xe(o)&&Qt(o)&&!Ne(o)?n:o||function(e){let t=Me(e);for(;fe(t)&&!xe(t);){if(Ne(t))return t;if(we(t))return null;t=Me(t);}return null}(e)||n}const en={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r="fixed"===i,a=ce(o),s=!!t&&we(t.floating);if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=Xe(1);const u=Xe(0),d=fe(o);if((d||!d&&!r)&&(("body"!==se(o)||he(a))&&(l=Ie(o)),fe(o))){const e=Vt(o);c=$t(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop;}const f=!a||d||r?Xe(0):Ut(a,l,!0);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:ce,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[..."clippingAncestors"===n?we(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Ae(e,[],!1).filter(e=>de(e)&&"body"!==se(e)),i=null;const r="fixed"===Ee(e).position;let a=r?Me(e):e;for(;de(a)&&!xe(a);){const t=Ee(a),n=Ne(a);n||"fixed"!==t.position||(i=null),(r?!n&&!i:!n&&"static"===t.position&&i&&Kt.has(i.position)||he(a)&&!n&&qt(e,a))?o=o.filter(e=>e!==a):i=t,a=Me(a);}return t.set(e,o),o}(t,this._c):[].concat(n),o],a=r[0],s=r.reduce((e,n)=>{const o=Jt(t,n,i);return e.top=qe(o.top,e.top),e.right=Je(o.right,e.right),e.bottom=Je(o.bottom,e.bottom),e.left=qe(o.left,e.left),e},Jt(t,a,i));return {width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Zt,getElementRects:async function(e){const t=this.getOffsetParent||Zt,n=this.getDimensions,o=await n(e.floating);return {reference:Gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ht(e);return {width:t,height:n}},getScale:$t,isElement:de,isRTL:function(e){return "rtl"===Ee(e).direction}};function tn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nn(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=jt(e),u=i||r?[...c?Ae(c):[],...Ae(t)]:[];u.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n);});const d=c&&s?function(e,t){let n,o=null;const i=ce(e);function r(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null;}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),r();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(s||t(),!f||!m)return;const p={rootMargin:-Qe(d)+"px "+-Qe(i.clientWidth-(u+f))+"px "+-Qe(i.clientHeight-(d+m))+"px "+-Qe(u)+"px",threshold:qe(0,Je(1,l))||1};let h=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!h)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7);},1e3);}1!==o||tn(c,e.getBoundingClientRect())||a(),h=!1;}try{o=new IntersectionObserver(g,{...p,root:i.ownerDocument});}catch(e){o=new IntersectionObserver(g,p);}o.observe(e);}(!0),r}(c,n):null;let f,m=-1,p=null;a&&(p=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t);})),n();}),c&&!l&&p.observe(c),p.observe(t));let h=l?Vt(e):null;return l&&function t(){const o=Vt(e);h&&!tn(h,o)&&n();h=o,f=requestAnimationFrame(t);}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n);}),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f);}}const on=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:i}=e,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=ot(n),s=it(n),l="y"===lt(n),c=_t.has(a)?-1:1,u=r&&l?-1:1,d=nt(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(m="end"===s?-1*p:p),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:a}}}}},rn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return {x:t,y:n}}},...l}=nt(e,t),c={x:n,y:o},u=await Rt(t,l),d=lt(ot(i)),f=rt(d);let m=c[f],p=c[d];if(r){const e="y"===f?"bottom":"right";m=tt(m+u["y"===f?"top":"left"],m,m-u[e]);}if(a){const e="y"===d?"bottom":"right";p=tt(p+u["y"===d?"top":"left"],p,p-u[e]);}const h=s.fn({...t,[f]:m,[d]:p});return {...h,data:{x:h.x-n,y:h.y-o,enabled:{[f]:r,[d]:a}}}}}},an=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=nt(e,t);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=ot(i),y=lt(s),w=ot(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),C=f||(w||!h?[gt(s)]:function(e){const t=gt(e);return [ut(e),t,ut(t)]}(s)),k="none"!==p;!f&&k&&C.push(...ht(s,h,p,b));const N=[s,...C],S=await Rt(t,g),D=[];let x=(null==(o=r.flip)?void 0:o.overflows)||[];if(u&&D.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=it(e),i=ct(e),r=at(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=gt(a)),[a,gt(a)]}(i,a,b);D.push(S[e[0]],S[e[1]]);}if(x=[...x,{placement:i,overflows:D}],!D.every(e=>e<=0)){var E,I;const e=((null==(E=r.flip)?void 0:E.index)||0)+1,t=N[e];if(t){if(!("alignment"===d&&y!==lt(t))||x.every(e=>lt(e.placement)!==y||e.overflows[0]>0))return {data:{index:e,overflows:x},reset:{placement:t}}}let n=null==(I=x.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(m){case"bestFit":{var M;const e=null==(M=x.filter(e=>{if(k){const t=lt(e.placement);return t===y||"y"===t}return !0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:M[0];e&&(n=e);break}case"initialPlacement":n=s;}if(i!==n)return {reset:{placement:n}}}return {}}}},sn=(e,t,n)=>{const o=new Map,i={platform:en,...n},r={...i.platform,_c:o};return (async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(c,o,l),f=o,m={},p=0;for(let n=0;n<s.length;n++){const{name:r,fn:h}=s[n],{x:g,y:v,data:y,reset:w}=await h({x:u,y:d,initialPlacement:o,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,m={...m,[r]:{...m[r],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):w.rects),({x:u,y:d}=Bt(c,f,l))),n=-1);}return {x:u,y:d,placement:f,strategy:i,middlewareData:m}})(e,t,{...i,platform:r})};var ln="undefined"!=typeof document?React.useLayoutEffect:function(){};function cn(e,t){if(e===t)return !0;if(typeof e!=typeof t)return !1;if("function"==typeof e&&e.toString()===t.toString())return !0;let n,o,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return !1;for(o=n;0!==o--;)if(!cn(e[o],t[o]))return !1;return !0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return !1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,i[o]))return !1;for(o=n;0!==o--;){const n=i[o];if(("_owner"!==n||!e.$$typeof)&&!cn(e[n],t[n]))return !1}return !0}return e!=e&&t!=t}function un(e){if("undefined"==typeof window)return 1;return (e.ownerDocument.defaultView||window).devicePixelRatio||1}function dn(e,t){const n=un(e);return Math.round(t*n)/n}function fn(e){const t=React__namespace.useRef(e);return ln(()=>{t.current=e;}),t}const mn=(e,t)=>({...rn(e),options:[e,t]}),pn=(e,t)=>({...an(e),options:[e,t]});function hn(e){return React__namespace.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t);});},e)}const gn={...React__namespace},vn=gn.useInsertionEffect||(e=>e());function yn(e){const t=React__namespace.useRef(()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")});return vn(()=>{t.current=e;}),React__namespace.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}const wn="ArrowUp",bn="ArrowDown",Cn="ArrowLeft",kn="ArrowRight";function Nn(e,t,n){return Math.floor(e/t)!==n}function Sn(e,t){return t<0||t>=e.current.length}function Dn(e,t){return En(e,{disabledIndices:t})}function xn(e,t){return En(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function En(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:i,amount:r=1}=void 0===t?{}:t;const a=e.current;let s=n;do{s+=o?-r:r;}while(s>=0&&s<=a.length-1&&Pn(a,s,i));return s}function In(e,t,n,o,i){if(-1===e)return -1;const r=n.indexOf(e),a=t[e];switch(i){case"tl":return r;case"tr":return a?r+a.width-1:r;case"bl":return a?r+(a.height-1)*o:r;case"br":return n.lastIndexOf(e)}}function Mn(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Pn(e,t,n){if(n)return n.includes(t);const o=e[t];return null==o||o.hasAttribute("disabled")||"true"===o.getAttribute("aria-disabled")}var An="undefined"!=typeof document?React.useLayoutEffect:React.useEffect;function Tn(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const On=React__namespace.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Fn(e){const{children:t,elementsRef:n,labelsRef:i}=e,[r,a]=React__namespace.useState(()=>new Map),s=React__namespace.useCallback(e=>{a(t=>new Map(t).set(e,null));},[]),l=React__namespace.useCallback(e=>{a(t=>{const n=new Map(t);return n.delete(e),n});},[]);return An(()=>{const e=new Map(r);Array.from(e.keys()).sort(Tn).forEach((t,n)=>{e.set(t,n);}),function(e,t){if(e.size!==t.size)return !1;for(const[n,o]of e.entries())if(o!==t.get(n))return !1;return !0}(r,e)||a(e);},[r]),React__namespace.createElement(On.Provider,{value:React__namespace.useMemo(()=>({register:s,unregister:l,map:r,elementsRef:n,labelsRef:i}),[s,l,r,n,i])},t)}function Ln(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:i,map:r,elementsRef:a,labelsRef:s}=React__namespace.useContext(On),[l,c]=React__namespace.useState(null),u=React__namespace.useRef(null),d=React__namespace.useCallback(e=>{if(u.current=e,null!==l&&(a.current[l]=e,s)){var n;const o=void 0!==t;s.current[l]=o?t:null!=(n=null==e?void 0:e.textContent)?n:null;}},[l,a,s,t]);return An(()=>{const e=u.current;if(e)return n(e),()=>{i(e);}},[n,i]),An(()=>{const e=u.current?r.get(u.current):null;null!=e&&c(e);},[r]),React__namespace.useMemo(()=>({ref:d,index:null==l?-1:l}),[l,d])}function Bn(){return Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);}return e},Bn.apply(this,arguments)}let Rn=!1,_n=0;const Hn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_n++;const jn=gn.useId||function(){const[e,t]=React__namespace.useState(()=>Rn?Hn():void 0);return An(()=>{null==e&&t(Hn());},[]),React__namespace.useEffect(()=>{Rn=!0;},[]),e};let $n;function zn(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const i="Floating UI: "+n.join(" ");var r;null!=(e=$n)&&e.has(i)||(null==(r=$n)||r.add(i),console.warn(i));}function Wn(){const e=new Map;return {emit(t,n){var o;null==(o=e.get(t))||o.forEach(e=>e(n));},on(t,n){e.set(t,[...e.get(t)||[],n]);},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter(e=>e!==n))||[]);}}}"production"!==process.env.NODE_ENV&&($n=new Set);const Vn=React__namespace.createContext(null),Yn=React__namespace.createContext(null),Un=()=>{var e;return (null==(e=React__namespace.useContext(Vn))?void 0:e.id)||null},Kn=()=>React__namespace.useContext(Yn);function Jn(e){const{children:t,id:n}=e,i=Un();return React__namespace.createElement(Vn.Provider,{value:React__namespace.useMemo(()=>({id:n,parentId:i}),[n,i])},t)}function qn(e){const{children:t}=e,n=React__namespace.useRef([]),i=React__namespace.useCallback(e=>{n.current=[...n.current,e];},[]),r=React__namespace.useCallback(e=>{n.current=n.current.filter(t=>t!==e);},[]),a=React__namespace.useState(()=>Wn())[0];return React__namespace.createElement(Yn.Provider,{value:React__namespace.useMemo(()=>({nodesRef:n,addNode:i,removeNode:r,events:a}),[i,r,a])},t)}function Gn(e){return "data-floating-ui-"+e}function Qn(e){const t=React.useRef(e);return An(()=>{t.current=e;}),t}const Xn=Gn("safe-polygon");function Zn(e,t,n){return n&&!$e(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let eo=0;function to(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(eo);const r=()=>null==e?void 0:e.focus({preventScroll:n});i?r():eo=requestAnimationFrame(r);}function no(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),o=n;for(;o.length;)o=e.filter(e=>{var t;return null==(t=o)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(o);return n}let oo=new WeakMap,io=new WeakSet,ro={},ao=0;const so=e=>e&&(e.host||so(e.parentNode));function lo(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,a=(s=t,e.map(e=>{if(s.contains(e))return e;const t=so(e);return s.contains(t)?t:null}).filter(e=>null!=e));var s;const l=new Set,c=new Set(a),u=[];ro[i]||(ro[i]=new WeakMap);const d=ro[i];return a.forEach(function e(t){if(!t||l.has(t))return;l.add(t),t.parentNode&&e(t.parentNode);}),function e(t){if(!t||c.has(t))return;[].forEach.call(t.children,t=>{if("script"!==se(t))if(l.has(t))e(t);else {const e=r?t.getAttribute(r):null,n=null!==e&&"false"!==e,o=(oo.get(t)||0)+1,a=(d.get(t)||0)+1;oo.set(t,o),d.set(t,a),u.push(t),1===o&&n&&io.add(t),1===a&&t.setAttribute(i,""),!n&&r&&t.setAttribute(r,"true");}});}(t),l.clear(),ao++,()=>{u.forEach(e=>{const t=(oo.get(e)||0)-1,n=(d.get(e)||0)-1;oo.set(e,t),d.set(e,n),t||(!io.has(e)&&r&&e.removeAttribute(r),io.delete(e)),n||e.removeAttribute(i);}),ao--,ao||(oo=new WeakMap,oo=new WeakMap,io=new WeakSet,ro={});}}function co(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=ze(e[0]).body;return lo(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const uo=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fo(e,t){const n=Lt(e,uo());"prev"===t&&n.reverse();const o=n.indexOf(Oe(ze(e)));return n.slice(o+1)[0]}function mo(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return !o||!Fe(n,o)}const po={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ho(e){"Tab"===e.key&&(e.target,clearTimeout(undefined));}const go=React__namespace.forwardRef(function(e,t){const[n,i]=React__namespace.useState();An(()=>(He()&&i("button"),document.addEventListener("keydown",ho),()=>{document.removeEventListener("keydown",ho);}),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Gn("focus-guard")]:"",style:po};return React__namespace.createElement("span",Bn({},e,r))}),vo=React__namespace.createContext(null),yo="data-floating-ui-focusable";function wo(e){return e?e.hasAttribute(yo)?e:e.querySelector("["+yo+"]")||e:null}let bo=[];function Co(e){bo=bo.filter(e=>e.isConnected);let t=e;if(t&&"body"!==se(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return !1!==bt.call(e,yt)&&Tt(t,e)}(t,uo())){const e=Lt(t,uo())[0];e&&(t=e);}bo.push(t),bo.length>20&&(bo=bo.slice(-20));}}function ko(){return bo.slice().reverse().find(e=>e.isConnected)}const No=React__namespace.forwardRef(function(e,t){return React__namespace.createElement("button",Bn({},e,{type:"button",ref:t,tabIndex:-1,style:po}))});function So(e){const{context:t,children:n,disabled:i=!1,order:r=["content"],guards:a=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:m,refs:p,nodeId:h,onOpenChange:g,events:v,dataRef:y,floatingId:w,elements:{domReference:b,floating:C}}=t,k="number"==typeof s&&s<0,N=Ke(b)&&k,S="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||a,D=Qn(r),x=Qn(s),E=Qn(l),I=Kn(),M=React__namespace.useContext(vo),P=React__namespace.useRef(null),A=React__namespace.useRef(null),T=React__namespace.useRef(!1),O=React__namespace.useRef(!1),F=React__namespace.useRef(-1),L=null!=M,B=wo(C),R=yn(function(e){return void 0===e&&(e=B),e?Lt(e,uo()):[]}),_=yn(e=>{const t=R(e);return D.current.map(e=>b&&"reference"===e?b:B&&"floating"===e?B:t).filter(Boolean).flat()});function H(e){return !i&&d&&u?React__namespace.createElement(No,{ref:"start"===e?P:A,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}React__namespace.useEffect(()=>{if(i)return;if(!u)return;function e(e){if("Tab"===e.key){Fe(B,Oe(ze(B)))&&0===R().length&&!N&&Ue(e);const t=_(),n=Ve(e);"reference"===D.current[0]&&n===b&&(Ue(e),e.shiftKey?to(t[t.length-1]):to(t[1])),"floating"===D.current[1]&&n===B&&e.shiftKey&&(Ue(e),to(t[0]));}}const t=ze(B);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e);}},[i,b,B,u,D,N,R,_]),React__namespace.useEffect(()=>{if(!i&&C)return C.addEventListener("focusin",e),()=>{C.removeEventListener("focusin",e);};function e(e){const t=Ve(e),n=R().indexOf(t);-1!==n&&(F.current=n);}},[i,C,R]),React__namespace.useEffect(()=>{if(!i&&f)return C&&fe(b)?(b.addEventListener("focusout",t),b.addEventListener("pointerdown",e),C.addEventListener("focusout",t),()=>{b.removeEventListener("focusout",t),b.removeEventListener("pointerdown",e),C.removeEventListener("focusout",t);}):void 0;function e(){O.current=!0,setTimeout(()=>{O.current=!1;});}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(Fe(b,t)||Fe(C,t)||Fe(t,C)||Fe(null==M?void 0:M.portalNode,t)||null!=t&&t.hasAttribute(Gn("focus-guard"))||I&&(no(I.nodesRef.current,h).find(e=>{var n,o;return Fe(null==(n=e.context)?void 0:n.elements.floating,t)||Fe(null==(o=e.context)?void 0:o.elements.domReference,t)})||function(e,t){var n;let o=[],i=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;i;){const t=e.find(e=>e.id===i);i=null==t?void 0:t.parentId,t&&(o=o.concat(t));}return o}(I.nodesRef.current,h).find(e=>{var n,o;return (null==(n=e.context)?void 0:n.elements.floating)===t||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(c&&n&&Oe(ze(B))===ze(B).body){fe(B)&&B.focus();const e=F.current,t=R(),n=t[e]||t[t.length-1]||B;fe(n)&&n.focus();}!N&&u||!t||!n||O.current||t===ko()||(T.current=!0,g(!1,e,"focus-out"));});}},[i,b,C,B,u,h,I,M,g,f,c,R,N]),React__namespace.useEffect(()=>{var e;if(i)return;const t=Array.from((null==M||null==(e=M.portalNode)?void 0:e.querySelectorAll("["+Gn("portal")+"]"))||[]);if(C){const e=[C,...t,P.current,A.current,D.current.includes("reference")||N?b:null].filter(e=>null!=e),n=u||N?co(e,S,!S):co(e);return ()=>{n();}}},[i,b,C,u,D,M,N,S]),An(()=>{if(i||!fe(B))return;const e=Oe(ze(B));queueMicrotask(()=>{const t=_(B),n=x.current,o=("number"==typeof n?t[n]:n.current)||B,i=Fe(B,e);k||i||!m||to(o,{preventScroll:o===B});});},[i,m,B,k,_,x]),An(()=>{if(i||!B)return;let e=!1;const t=ze(B),n=Oe(t);let o=y.current.openEvent;function r(t){let{open:n,reason:i,event:r,nested:a}=t;n&&(o=r),"escape-key"===i&&p.domReference.current&&Co(p.domReference.current),"hover"===i&&"mouseleave"===r.type&&(T.current=!0),"outside-press"===i&&(a?(T.current=!1,e=!0):T.current=!(Re(r)||_e(r)));}Co(n),v.on("openchange",r);const a=t.createElement("span");return a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),Object.assign(a.style,po),L&&b&&b.insertAdjacentElement("afterend",a),()=>{v.off("openchange",r);const n=Oe(t),i=Fe(C,n)||I&&no(I.nodesRef.current,h).some(e=>{var t;return Fe(null==(t=e.context)?void 0:t.elements.floating,n)});(i||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&Co(p.domReference.current);const s="boolean"==typeof E.current?ko()||a:E.current.current||a;queueMicrotask(()=>{E.current&&!T.current&&fe(s)&&(s===n||n===t.body||i)&&s.focus({preventScroll:e}),a.remove();});}},[i,C,B,E,y,p,v,I,h,L,b]),React__namespace.useEffect(()=>{queueMicrotask(()=>{T.current=!1;});},[i]),An(()=>{if(!i&&M)return M.setFocusManagerState({modal:u,closeOnFocusOut:f,open:m,onOpenChange:g,refs:p}),()=>{M.setFocusManagerState(null);}},[i,M,u,m,g,p,f]),An(()=>{if(i)return;if(!B)return;if("function"!=typeof MutationObserver)return;if(k)return;const e=()=>{const e=B.getAttribute("tabindex"),t=R(),n=Oe(ze(C)),o=t.indexOf(n);-1!==o&&(F.current=o),D.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&B.setAttribute("tabindex","0"):"-1"!==e&&B.setAttribute("tabindex","-1");};e();const t=new MutationObserver(e);return t.observe(B,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect();}},[i,C,B,p,D,R,k]);const j=!i&&S&&(!u||!N)&&(L||u);return React__namespace.createElement(React__namespace.Fragment,null,j&&React__namespace.createElement(go,{"data-type":"inside",ref:null==M?void 0:M.beforeInsideRef,onFocus:e=>{if(u){const e=_();to("reference"===r[0]?e[0]:e[e.length-1]);}else if(null!=M&&M.preserveTabOrder&&M.portalNode)if(T.current=!1,mo(e,M.portalNode)){const e=fo(document.body,"next")||b;null==e||e.focus();}else {var t;null==(t=M.beforeOutsideRef.current)||t.focus();}}}),!N&&H("start"),n,H("end"),j&&React__namespace.createElement(go,{"data-type":"inside",ref:null==M?void 0:M.afterInsideRef,onFocus:e=>{if(u)to(_()[0]);else if(null!=M&&M.preserveTabOrder&&M.portalNode)if(f&&(T.current=!0),mo(e,M.portalNode)){const e=fo(document.body,"prev")||b;null==e||e.focus();}else {var t;null==(t=M.afterOutsideRef.current)||t.focus();}}}))}function Do(e){return fe(e.target)&&"BUTTON"===e.target.tagName}function xo(e){return Ye(e)}const Eo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Io={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Mo=e=>{var t,n;return {escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Po(e){const{open:t=!1,onOpenChange:n,elements:i}=e,r=jn(),a=React__namespace.useRef({}),[s]=React__namespace.useState(()=>Wn()),l=null!=Un();if("production"!==process.env.NODE_ENV){const e=i.reference;e&&!de(e)&&function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const i="Floating UI: "+n.join(" ");var r;null!=(e=$n)&&e.has(i)||(null==(r=$n)||r.add(i),console.error(i));}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.");}const[c,u]=React__namespace.useState(i.reference),d=yn((e,t,o)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:o,nested:l}),null==n||n(e,t,o);}),f=React__namespace.useMemo(()=>({setPositionReference:u}),[]),m=React__namespace.useMemo(()=>({reference:c||i.reference||null,floating:i.floating||null,domReference:i.reference}),[c,i.reference,i.floating]);return React__namespace.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:m,events:s,floatingId:r,refs:f}),[t,d,m,s,r,f])}function Ao(e){void 0===e&&(e={});const{nodeId:t}=e,n=Po({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||n,r=i.elements,[a,s]=React__namespace.useState(null),[l,c]=React__namespace.useState(null),u=(null==r?void 0:r.domReference)||a,d=React__namespace.useRef(null),f=Kn();An(()=>{u&&(d.current=u);},[u]);const m=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=React__namespace.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=React__namespace.useState(i);cn(m,i)||p(i);const[h,g]=React__namespace.useState(null),[y,w]=React__namespace.useState(null),b=React__namespace.useCallback(e=>{e!==S.current&&(S.current=e,g(e));},[]),C=React__namespace.useCallback(e=>{e!==D.current&&(D.current=e,w(e));},[]),k=a||h,N=s||y,S=React__namespace.useRef(null),D=React__namespace.useRef(null),x=React__namespace.useRef(d),E=null!=c,I=fn(c),M=fn(r),P=fn(u),A=React__namespace.useCallback(()=>{if(!S.current||!D.current)return;const e={placement:t,strategy:n,middleware:m};M.current&&(e.platform=M.current),sn(S.current,D.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};T.current&&!cn(x.current,t)&&(x.current=t,ReactDOM__namespace.flushSync(()=>{f(t);}));});},[m,t,n,M,P]);ln(()=>{!1===u&&x.current.isPositioned&&(x.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})));},[u]);const T=React__namespace.useRef(!1);ln(()=>(T.current=!0,()=>{T.current=!1;}),[]),ln(()=>{if(k&&(S.current=k),N&&(D.current=N),k&&N){if(I.current)return I.current(k,N,A);A();}},[k,N,A,I,E]);const O=React__namespace.useMemo(()=>({reference:S,floating:D,setReference:b,setFloating:C}),[b,C]),F=React__namespace.useMemo(()=>({reference:k,floating:N}),[k,N]),L=React__namespace.useMemo(()=>{const e={position:n,left:0,top:0};if(!F.floating)return e;const t=dn(F.floating,d.x),o=dn(F.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+o+"px)",...un(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,l,F.floating,d.x,d.y]);return React__namespace.useMemo(()=>({...d,update:A,refs:O,elements:F,floatingStyles:L}),[d,A,O,F,L])}({...e,elements:{...r,...l&&{reference:l}}}),p=React__namespace.useCallback(e=>{const t=de(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),m.refs.setReference(t);},[m.refs]),h=React__namespace.useCallback(e=>{(de(e)||null===e)&&(d.current=e,s(e)),(de(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!de(e))&&m.refs.setReference(e);},[m.refs]),g=React__namespace.useMemo(()=>({...m.refs,setReference:h,setPositionReference:p,domReference:d}),[m.refs,h,p]),y=React__namespace.useMemo(()=>({...m.elements,domReference:u}),[m.elements,u]),w=React__namespace.useMemo(()=>({...m,...i,refs:g,elements:y,nodeId:t}),[m,g,y,t,i]);return An(()=>{i.dataRef.current.floatingContext=w;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=w);}),React__namespace.useMemo(()=>({...m,context:w,refs:g,elements:y}),[m,g,y,w])}const To="active",Oo="selected";function Fo(e,t,n){const o=new Map,i="item"===n;let r=e;if(i&&e){const{[To]:t,[Oo]:n,...o}=e;r=o;}return {..."floating"===n&&{tabIndex:-1,[yo]:""},...r,...t.map(t=>{const o=t?t[n]:null;return "function"==typeof o?e?o(e):null:o}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,r]=t;var a;i&&[To,Oo].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof r&&(null==(a=o.get(n))||a.push(r),e[n]=function(){for(var e,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return null==(e=o.get(n))?void 0:e.map(e=>e(...i)).find(e=>void 0!==e)})):e[n]=r);}),e):e,{})}}let Lo=!1;function Bo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ro(e,t){return Bo(t,e===wn||e===bn,e===Cn||e===kn)}function _o(e,t,n){return Bo(t,e===bn,n?e===Cn:e===kn)||"Enter"===e||" "===e||""===e}function Ho(e,t,n){return Bo(t,n?e===kn:e===Cn,e===wn)}function jo(e,t){const{open:n,onOpenChange:i,elements:r}=e,{listRef:a,activeIndex:s,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:m=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:w,orientation:b="vertical",cols:C=1,scrollItemIntoView:k=!0,virtualItemRef:N,itemSizes:S,dense:D=!1}=t;"production"!==process.env.NODE_ENV&&(d&&(f||zn("`useListNavigation` looping must be enabled to allow escaping."),h||zn("`useListNavigation` must be virtual to allow escaping.")),"vertical"===b&&C>1&&zn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const x=Qn(wo(r.floating)),E=Un(),I=Kn(),M=yn(l),P=Ke(r.domReference),A=React__namespace.useRef(g),T=React__namespace.useRef(null!=u?u:-1),O=React__namespace.useRef(null),F=React__namespace.useRef(!0),L=React__namespace.useRef(M),B=React__namespace.useRef(!!r.floating),R=React__namespace.useRef(n),_=React__namespace.useRef(!1),H=React__namespace.useRef(!1),j=Qn(w),$=Qn(n),z=Qn(k),W=Qn(u),[V,Y]=React__namespace.useState(),[U,K]=React__namespace.useState(),J=yn(function(e,t,n){function o(e){h?(Y(e.id),null==I||I.events.emit("virtualfocus",e),N&&(N.current=e)):to(e,{preventScroll:!0,sync:!(!Le().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!He())&&(Lo||_.current)});}void 0===n&&(n=!1);const i=e.current[t.current];i&&o(i),requestAnimationFrame(()=>{const r=e.current[t.current]||i;if(!r)return;i||o(r);const a=z.current;a&&G&&(n||!F.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof a?{block:"nearest",inline:"nearest"}:a));});});An(()=>{document.createElement("div").focus({get preventScroll(){return Lo=!0,!1}});},[]),An(()=>{c&&(n&&r.floating?A.current&&null!=u&&(H.current=!0,T.current=u,M(u)):B.current&&(T.current=-1,L.current(null)));},[c,n,r.floating,u,M]),An(()=>{if(c&&n&&r.floating)if(null==s){if(_.current=!1,null!=W.current)return;if(B.current&&(T.current=-1,J(a,T)),(!R.current||!B.current)&&A.current&&(null!=O.current||!0===A.current&&null==O.current)){let e=0;const t=()=>{if(null==a.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t);}e++;}else T.current=null==O.current||_o(O.current,b,p)||m?Dn(a,j.current):xn(a,j.current),O.current=null,M(T.current);};t();}}else Sn(a,s)||(T.current=s,J(a,T,H.current),H.current=!1);},[c,n,r.floating,s,W,m,a,b,p,M,J,j]),An(()=>{var e;if(!c||r.floating||!I||h||!B.current)return;const t=I.nodesRef.current,n=null==(e=t.find(e=>e.id===E))||null==(e=e.context)?void 0:e.elements.floating,o=Oe(ze(r.floating)),i=t.some(e=>e.context&&Fe(e.context.elements.floating,o));n&&!i&&F.current&&n.focus({preventScroll:!0});},[c,r.floating,I,E,h]),An(()=>{if(c&&I&&h&&!E)return I.events.on("virtualfocus",e),()=>{I.events.off("virtualfocus",e);};function e(e){K(e.id),N&&(N.current=e);}},[c,I,h,E,N]),An(()=>{L.current=M,B.current=!!r.floating;}),An(()=>{n||(O.current=null);},[n]),An(()=>{R.current=n;},[n]);const q=null!=s,G=React__namespace.useMemo(()=>{function e(e){if(!n)return;const t=a.current.indexOf(e);-1!==t&&M(t);}return {onFocus(t){let{currentTarget:n}=t;e(n);},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n);},onPointerLeave(e){let{pointerType:t}=e;F.current&&"touch"!==t&&(T.current=-1,J(a,T),M(null),h||to(x.current,{preventScroll:!0}));}}}},[n,x,J,v,a,M,h]),Q=yn(e=>{if(F.current=!1,_.current=!0,229===e.which)return;if(!$.current&&e.currentTarget===x.current)return;if(m&&Ho(e.key,b,p))return Ue(e),i(!1,e.nativeEvent,"list-navigation"),void(fe(r.domReference)&&(h?null==I||I.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const t=T.current,o=Dn(a,w),s=xn(a,w);if(P||("Home"===e.key&&(Ue(e),T.current=o,M(T.current)),"End"===e.key&&(Ue(e),T.current=s,M(T.current))),C>1){const t=S||Array.from({length:a.current.length},()=>({width:1,height:1})),n=function(e,t,n){const o=[];let i=0;return e.forEach((e,r)=>{let{width:a,height:s}=e;if(a>t&&"production"!==process.env.NODE_ENV)throw new Error("[Floating UI]: Invalid grid - item width at index "+r+" is greater than grid columns");let l=!1;for(n&&(i=0);!l;){const e=[];for(let n=0;n<a;n++)for(let o=0;o<s;o++)e.push(i+n+o*t);i%t+a<=t&&e.every(e=>null==o[e])?(e.forEach(e=>{o[e]=r;}),l=!0):i++;}}),[...o]}(t,C,D),i=n.findIndex(e=>null!=e&&!Pn(a.current,e,w)),r=n.reduce((e,t,n)=>null==t||Pn(a.current,t,w)?e:n,-1),l=n[function(e,t){let{event:n,orientation:o,loop:i,rtl:r,cols:a,disabledIndices:s,minIndex:l,maxIndex:c,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===wn){if(d&&Ue(n),-1===u)f=c;else if(f=En(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:s}),i&&(u-a<l||f<0)){const e=u%a,t=c%a,n=c-(t-e);f=t===e?c:t>e?n:n-a;}Sn(e,f)&&(f=u);}if(n.key===bn&&(d&&Ue(n),-1===u?f=l:(f=En(e,{startingIndex:u,amount:a,disabledIndices:s}),i&&u+a>c&&(f=En(e,{startingIndex:u%a-a,amount:a,disabledIndices:s}))),Sn(e,f)&&(f=u)),"both"===o){const t=Qe(u/a);n.key===(r?Cn:kn)&&(d&&Ue(n),u%a!==a-1?(f=En(e,{startingIndex:u,disabledIndices:s}),i&&Nn(f,a,t)&&(f=En(e,{startingIndex:u-u%a-1,disabledIndices:s}))):i&&(f=En(e,{startingIndex:u-u%a-1,disabledIndices:s})),Nn(f,a,t)&&(f=u)),n.key===(r?kn:Cn)&&(d&&Ue(n),u%a!==0?(f=En(e,{startingIndex:u,decrement:!0,disabledIndices:s}),i&&Nn(f,a,t)&&(f=En(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:s}))):i&&(f=En(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:s})),Nn(f,a,t)&&(f=u));const o=Qe(c/a)===t;Sn(e,f)&&(f=i&&o?n.key===(r?kn:Cn)?c:En(e,{startingIndex:u-u%a-1,disabledIndices:s}):u);}return f}({current:n.map(e=>null!=e?a.current[e]:null)},{event:e,orientation:b,loop:f,rtl:p,cols:C,disabledIndices:Mn([...w||a.current.map((e,t)=>Pn(a.current,t)?t:void 0),void 0],n),minIndex:i,maxIndex:r,prevIndex:In(T.current>s?o:T.current,t,n,C,e.key===bn?"bl":e.key===(p?Cn:kn)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(T.current=l,M(T.current)),"both"===b)return}if(Ro(e.key,b)){if(Ue(e),n&&!h&&Oe(e.currentTarget.ownerDocument)===e.currentTarget)return T.current=_o(e.key,b,p)?o:s,void M(T.current);_o(e.key,b,p)?T.current=f?t>=s?d&&t!==a.current.length?-1:o:En(a,{startingIndex:t,disabledIndices:w}):Math.min(s,En(a,{startingIndex:t,disabledIndices:w})):T.current=f?t<=o?d&&-1!==t?a.current.length:s:En(a,{startingIndex:t,decrement:!0,disabledIndices:w}):Math.max(o,En(a,{startingIndex:t,decrement:!0,disabledIndices:w})),Sn(a,T.current)?M(null):M(T.current);}}),X=React__namespace.useMemo(()=>h&&n&&q&&{"aria-activedescendant":U||V},[h,n,q,U,V]),Z=React__namespace.useMemo(()=>({"aria-orientation":"both"===b?void 0:b,...!Ke(r.domReference)&&X,onKeyDown:Q,onPointerMove(){F.current=!0;}}),[X,Q,r.domReference,b]),ee=React__namespace.useMemo(()=>{function e(e){"auto"===g&&Re(e.nativeEvent)&&(A.current=!0);}return {...X,onKeyDown(e){F.current=!1;const t=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),r=t||o,s=function(e,t,n){return Bo(t,n?e===Cn:e===kn,e===bn)}(e.key,b,p),l=Ho(e.key,b,p),c=Ro(e.key,b),d=(m?s:c)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==I?void 0:I.nodesRef.current.find(e=>null==e.parentId),n=I&&t?function(e,t){let n,o=-1;return function t(i,r){r>o&&(n=i,o=r),no(e,i).forEach(e=>{t(e.id,r+1);});}(t,0),e.find(e=>e.id===n)}(I.nodesRef.current,t.id):null;if(r&&n&&N){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||l){var f,g;const o=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,i=l&&!o?null==(g=n.context)?void 0:g.elements.domReference:s?a.current.find(e=>(null==e?void 0:e.id)===V):null;i&&(Ue(e),i.dispatchEvent(t),K(void 0));}var v;if((c||o)&&n.context)if(n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Ue(e),void(null==(v=n.context.elements.domReference)||v.dispatchEvent(t))}return Q(e)}(n||y||!t)&&(d&&(O.current=m&&c?null:e.key),m?s&&(Ue(e),n?(T.current=Dn(a,j.current),M(T.current)):i(!0,e.nativeEvent,"list-navigation")):c&&(null!=u&&(T.current=u),Ue(e),!n&&y?i(!0,e.nativeEvent,"list-navigation"):Q(e),n&&M(T.current)));},onFocus(){n&&!h&&M(null);},onPointerDown:function(e){A.current=g,"auto"===g&&_e(e.nativeEvent)&&(A.current=!0);},onMouseDown:e,onClick:e}},[V,X,Q,j,g,a,m,M,i,n,y,b,p,u,I,h,N]);return React__namespace.useMemo(()=>c?{reference:ee,floating:Z,item:G}:{},[c,ee,Z,G])}const $o=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function zo(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let e=0,a=r-1;e<r;a=e++){const[r,s]=t[e]||[0,0],[l,c]=t[a]||[0,0];s>=o!=c>=o&&n<=(l-r)*(o-s)/(c-s)+r&&(i=!i);}return i}function Wo(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let i,r=!1,a=null,s=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:m,tree:p}=e;return function(e){function h(){clearTimeout(i),f();}if(clearTimeout(i),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],w=Ve(e),b="mouseleave"===e.type,C=Fe(d.floating,w),k=Fe(d.domReference,w),N=d.domReference.getBoundingClientRect(),S=d.floating.getBoundingClientRect(),D=u.split("-")[0],x=n>S.right-S.width/2,E=c>S.bottom-S.height/2,I=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,N),M=S.width>N.width,P=S.height>N.height,A=(M?N:S).left,T=(M?N:S).right,O=(P?N:S).top,F=(P?N:S).bottom;if(C&&(r=!0,!b))return;if(k&&(r=!1),k&&!b)return void(r=!0);if(b&&de(e.relatedTarget)&&Fe(d.floating,e.relatedTarget))return;if(p&&no(p.nodesRef.current,m).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===D&&c>=N.bottom-1||"bottom"===D&&c<=N.top+1||"left"===D&&n>=N.right-1||"right"===D&&n<=N.left+1)return h();let L=[];switch(D){case"top":L=[[A,N.top+1],[A,S.bottom-1],[T,S.bottom-1],[T,N.top+1]];break;case"bottom":L=[[A,S.top+1],[A,N.bottom-1],[T,N.bottom-1],[T,S.top+1]];break;case"left":L=[[S.right-1,F],[S.right-1,O],[N.left+1,O],[N.left+1,F]];break;case"right":L=[[N.right-1,F],[N.right-1,O],[S.left+1,O],[S.left+1,F]];}if(!zo([g,v],L)){if(r&&!I)return h();if(!b&&o){const t=function(e,t){const n=performance.now(),o=n-l;if(null===a||null===s||0===o)return a=e,s=t,l=n,null;const i=e-a,r=t-s,c=Math.sqrt(i*i+r*r);return a=e,s=t,l=n,c/o}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}zo([g,v],function(e){let[n,o]=e;switch(D){case"top":return [[M?n+t/2:x?n+4*t:n-4*t,o+t+1],[M?n-t/2:x?n+4*t:n-4*t,o+t+1],...[[S.left,x||M?S.bottom-t:S.top],[S.right,x?M?S.bottom-t:S.top:S.bottom-t]]];case"bottom":return [[M?n+t/2:x?n+4*t:n-4*t,o-t],[M?n-t/2:x?n+4*t:n-4*t,o-t],...[[S.left,x||M?S.top+t:S.bottom],[S.right,x?M?S.top+t:S.bottom:S.top+t]]];case"left":{const e=[n+t+1,P?o+t/2:E?o+4*t:o-4*t],i=[n+t+1,P?o-t/2:E?o+4*t:o-4*t];return [...[[E||P?S.right-t:S.left,S.top],[E?P?S.right-t:S.left:S.right-t,S.bottom]],e,i]}case"right":return [[n-t,P?o+t/2:E?o+4*t:o-4*t],[n-t,P?o-t/2:E?o+4*t:o-4*t],...[[E||P?S.left+t:S.right,S.top],[E?P?S.left+t:S.right:S.left+t,S.bottom]]]}}([n,c]))?!r&&o&&(i=window.setTimeout(h,40)):h();}}};return c.__options={blockPointerEvents:n},c}const Vo=React.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Yo=React.forwardRef(({className:t,disabled:n,children:o,...i},r)=>{const a=React.useContext(Vo),s=Ln(),c=Kn(),u=s.index===a.activeIndex,d=N("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return jsxRuntime.jsx("div",{ref:hn([s.ref,r]),role:"menuitem",className:d,tabIndex:u?0:-1,"aria-disabled":n,...i,...a.getItemProps({onClick(e){if(n)return e.preventDefault(),void e.stopPropagation();i.onClick?.(e),a.setIsOpen(!1),c?.events.emit("click");},onFocus(e){n||(i.onFocus?.(e),a.setHasFocusInside(!0));}}),children:o})});Yo.displayName="DropdownMenuItem";const Uo=React.forwardRef(({className:n,variant:i="default",icon:r,iconRight:a,text:s="",disabled:m,children:p,...h},g)=>{const[v,y]=React.useState(!1),[w,b]=React.useState(!1),[C,k]=React.useState(null),S=React.useRef([]),D=React.useRef([]),x=React.useContext(Vo),E=Kn(),I=function(){const e=jn(),t=Kn(),n=Un();return An(()=>{const o={id:e,parentId:n};return null==t||t.addNode(o),()=>{null==t||t.removeNode(o);}},[t,e,n]),e}(),M=Un(),P=Ln(),A=null!=M,{floatingStyles:O,refs:F,context:L}=Ao({nodeId:I,open:v,onOpenChange:y,placement:A?"right-start":"bottom-start",middleware:[(B={mainAxis:A?0:4,alignmentAxis:A?-4:0},{...on(B),options:[B,R]}),pn(),mn()],whileElementsMounted:nn});var B,R;const _=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:i,dataRef:r,events:a,elements:s}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:m=!0}=t,p=Kn(),h=Un(),g=Qn(u),v=Qn(c),y=Qn(n),w=React__namespace.useRef(),b=React__namespace.useRef(-1),C=React__namespace.useRef(),k=React__namespace.useRef(-1),N=React__namespace.useRef(!0),S=React__namespace.useRef(!1),D=React__namespace.useRef(()=>{}),x=React__namespace.useRef(!1),E=React__namespace.useCallback(()=>{var e;const t=null==(e=r.current.openEvent)?void 0:e.type;return (null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[r]);React__namespace.useEffect(()=>{if(l)return a.on("openchange",e),()=>{a.off("openchange",e);};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(k.current),N.current=!0,x.current=!1);}},[l,a]),React__namespace.useEffect(()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){E()&&i(!1,e,"hover");}const t=ze(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e);}},[s.floating,n,i,l,g,E]);const I=React__namespace.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Zn(v.current,"close",w.current);o&&!C.current?(clearTimeout(b.current),b.current=window.setTimeout(()=>i(!1,e,n),o)):t&&(clearTimeout(b.current),i(!1,e,n));},[v,i]),M=yn(()=>{D.current(),C.current=void 0;}),P=yn(()=>{if(S.current){const e=ze(s.floating).body;e.style.pointerEvents="",e.removeAttribute(Xn),S.current=!1;}}),A=yn(()=>!!r.current.openEvent&&["click","mousedown"].includes(r.current.openEvent.type));React__namespace.useEffect(()=>{if(l&&de(s.domReference)){var e;const i=s.domReference;return n&&i.addEventListener("mouseleave",a),null==(e=s.floating)||e.addEventListener("mouseleave",a),m&&i.addEventListener("mousemove",t,{once:!0}),i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",o),()=>{var e;n&&i.removeEventListener("mouseleave",a),null==(e=s.floating)||e.removeEventListener("mouseleave",a),m&&i.removeEventListener("mousemove",t),i.removeEventListener("mouseenter",t),i.removeEventListener("mouseleave",o);}}function t(e){if(clearTimeout(b.current),N.current=!1,d&&!$e(w.current)||f>0&&!Zn(v.current,"open"))return;const t=Zn(v.current,"open",w.current);t?b.current=window.setTimeout(()=>{y.current||i(!0,e,"hover");},t):n||i(!0,e,"hover");}function o(e){if(A())return;D.current();const t=ze(s.floating);if(clearTimeout(k.current),x.current=!1,g.current&&r.current.floatingContext){n||clearTimeout(b.current),C.current=g.current({...r.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){P(),M(),A()||I(e,!0,"safe-polygon");}});const o=C.current;return t.addEventListener("mousemove",o),void(D.current=()=>{t.removeEventListener("mousemove",o);})}("touch"!==w.current||!Fe(s.floating,e.relatedTarget))&&I(e);}function a(e){A()||r.current.floatingContext&&(null==g.current||g.current({...r.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){P(),M(),A()||I(e);}})(e));}},[s,l,e,d,f,m,I,M,P,i,n,y,p,v,g,r,A]),An(()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&E()){S.current=!0;const e=s.floating;if(de(s.domReference)&&e){var t;const n=ze(s.floating).body;n.setAttribute(Xn,"");const o=s.domReference,i=null==p||null==(t=p.nodesRef.current.find(e=>e.id===h))||null==(t=t.context)?void 0:t.elements.floating;return i&&(i.style.pointerEvents=""),n.style.pointerEvents="none",o.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",o.style.pointerEvents="",e.style.pointerEvents="";}}}},[l,n,h,s,p,g,E]),An(()=>{n||(w.current=void 0,x.current=!1,M(),P());},[n,M,P]),React__namespace.useEffect(()=>()=>{M(),clearTimeout(b.current),clearTimeout(k.current),P();},[l,s.domReference,M,P]);const T=React__namespace.useMemo(()=>{function e(e){w.current=e.pointerType;}return {onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){N.current||y.current||i(!0,t,"hover");}d&&!$e(w.current)||n||0===f||x.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(k.current),"touch"===w.current?o():(x.current=!0,k.current=window.setTimeout(o,f)));}}},[d,i,n,y,f]),O=React__namespace.useMemo(()=>({onMouseEnter(){clearTimeout(b.current);},onMouseLeave(e){A()||I(e.nativeEvent,!1);}}),[I,A]);return React__namespace.useMemo(()=>l?{reference:T,floating:O}:{},[l,T,O])}(L,{enabled:A,delay:{open:75},handleClose:Wo({blockPointerEvents:!0})}),H=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:i,dataRef:r,elements:{domReference:a}}=e,{enabled:s=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,m=React__namespace.useRef(),p=React__namespace.useRef(!1),h=React__namespace.useMemo(()=>({onPointerDown(e){m.current=e.pointerType;},onMouseDown(e){const t=m.current;0===e.button&&"click"!==l&&($e(t,!0)&&u||(!n||!c||r.current.openEvent&&f&&"mousedown"!==r.current.openEvent.type?(e.preventDefault(),i(!0,e.nativeEvent,"click")):i(!1,e.nativeEvent,"click")));},onClick(e){const t=m.current;"mousedown"===l&&m.current?m.current=void 0:$e(t,!0)&&u||(!n||!c||r.current.openEvent&&f&&"click"!==r.current.openEvent.type?i(!0,e.nativeEvent,"click"):i(!1,e.nativeEvent,"click"));},onKeyDown(e){m.current=void 0,e.defaultPrevented||!d||Do(e)||(" "!==e.key||xo(a)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&i(!n||!c,e.nativeEvent,"click"));},onKeyUp(e){e.defaultPrevented||!d||Do(e)||xo(a)||" "===e.key&&p.current&&(p.current=!1,i(!n||!c,e.nativeEvent,"click"));}}),[r,a,l,u,d,i,n,f,c]);return React__namespace.useMemo(()=>s?{reference:h}:{},[s,h])}(L,{event:"mousedown",toggle:!A,ignoreMouse:A}),j=function(e,t){var n;void 0===t&&(t={});const{open:i,floatingId:r}=e,{enabled:a=!0,role:s="dialog"}=t,l=null!=(n=$o.get(s))?n:s,c=jn(),u=null!=Un(),d=React__namespace.useMemo(()=>"tooltip"===l||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:i?r:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":i?r:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[l,r,u,i,c,s]),f=React__namespace.useMemo(()=>{const e={id:r,...l&&{role:l}};return "tooltip"===l||"label"===s?e:{...e,..."menu"===l&&{"aria-labelledby":c}}},[l,r,c,s]),m=React__namespace.useCallback(e=>{let{active:t,selected:n}=e;const o={role:"option",...t&&{id:r+"-option"}};switch(s){case"select":return {...o,"aria-selected":t&&n};case"combobox":return {...o,...t&&{"aria-selected":!0}}}return {}},[r,s]);return React__namespace.useMemo(()=>a?{reference:d,floating:f,item:m}:{},[a,d,f,m])}(L,{role:"menu"}),$=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:i,elements:r,dataRef:a}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:m=!1,bubbles:p,capture:h}=t,g=Kn(),v=yn("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,w=React__namespace.useRef(!1),b=React__namespace.useRef(!1),{escapeKey:C,outsidePress:k}=Mo(p),{escapeKey:N,outsidePress:S}=Mo(h),D=React__namespace.useRef(!1),x=yn(e=>{var t;if(!n||!s||!l||"Escape"!==e.key)return;if(D.current)return;const o=null==(t=a.current.floatingContext)?void 0:t.nodeId,r=g?no(g.nodesRef.current,o):[];if(!C&&(e.stopPropagation(),r.length>0)){let e=!0;if(r.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1);}),!e)return}i(!1,function(e){return "nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key");}),E=yn(e=>{var t;const n=()=>{var t;x(e),null==(t=Ve(e))||t.removeEventListener("keydown",n);};null==(t=Ve(e))||t.addEventListener("keydown",n);}),I=yn(e=>{var t;const n=w.current;w.current=!1;const o=b.current;if(b.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const s=Ve(e),l="["+Gn("inert")+"]",c=ze(r.floating).querySelectorAll(l);let d=de(s)?s:null;for(;d&&!xe(d);){const e=Me(d);if(xe(e)||!de(e))break;d=e;}if(c.length&&de(s)&&!s.matches("html,body")&&!Fe(s,r.floating)&&Array.from(c).every(e=>!Fe(d,e)))return;if(fe(s)&&A){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let o=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===Ee(s).direction&&(o=e.offsetX<=s.offsetWidth-s.clientWidth),o||t&&e.offsetY>s.clientHeight)return}const f=null==(t=a.current.floatingContext)?void 0:t.nodeId,m=g&&no(g.nodesRef.current,f).some(t=>{var n;return We(e,null==(n=t.context)?void 0:n.elements.floating)});if(We(e,r.floating)||We(e,r.domReference)||m)return;const p=g?no(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1);}),!e)return}i(!1,e,"outside-press");}),M=yn(e=>{var t;const n=()=>{var t;I(e),null==(t=Ve(e))||t.removeEventListener(u,n);};null==(t=Ve(e))||t.addEventListener(u,n);});React__namespace.useEffect(()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=k;let e=-1;function t(e){i(!1,e,"ancestor-scroll");}function o(){window.clearTimeout(e),D.current=!0;}function c(){e=window.setTimeout(()=>{D.current=!1;},Se()?5:0);}const d=ze(r.floating);l&&(d.addEventListener("keydown",N?E:x,N),d.addEventListener("compositionstart",o),d.addEventListener("compositionend",c)),y&&d.addEventListener(u,S?M:I,S);let f=[];return m&&(de(r.domReference)&&(f=Ae(r.domReference)),de(r.floating)&&(f=f.concat(Ae(r.floating))),!de(r.reference)&&r.reference&&r.reference.contextElement&&(f=f.concat(Ae(r.reference.contextElement)))),f=f.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),f.forEach(e=>{e.addEventListener("scroll",t,{passive:!0});}),()=>{l&&(d.removeEventListener("keydown",N?E:x,N),d.removeEventListener("compositionstart",o),d.removeEventListener("compositionend",c)),y&&d.removeEventListener(u,S?M:I,S),f.forEach(e=>{e.removeEventListener("scroll",t);}),window.clearTimeout(e);}},[a,r,l,y,u,n,i,m,s,C,k,x,N,E,I,S,M]),React__namespace.useEffect(()=>{w.current=!1;},[y,u]);const P=React__namespace.useMemo(()=>({onKeyDown:x,[Eo[f]]:e=>{d&&i(!1,e.nativeEvent,"reference-press");}}),[x,i,d,f]),A=React__namespace.useMemo(()=>({onKeyDown:x,onMouseDown(){b.current=!0;},onMouseUp(){b.current=!0;},[Io[u]]:()=>{w.current=!0;}}),[x,u]);return React__namespace.useMemo(()=>s?{reference:P,floating:A}:{},[s,P,A])}(L,{bubbles:!0}),z=jo(L,{listRef:S,activeIndex:C,nested:A,onNavigate:k}),{getReferenceProps:W,getFloatingProps:V,getItemProps:Y}=function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),i=e.map(e=>null==e?void 0:e.item),r=React__namespace.useCallback(t=>Fo(t,e,"reference"),t),a=React__namespace.useCallback(t=>Fo(t,e,"floating"),n),s=React__namespace.useCallback(t=>Fo(t,e,"item"),i);return React__namespace.useMemo(()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:s}),[r,a,s])}([_,H,j,$,z]);React.useEffect(()=>{if(E)return E.events.on("click",e),E.events.on("menuopen",t),()=>{E.events.off("click",e),E.events.off("menuopen",t);};function e(){y(!1);}function t(e){e.nodeId!==I&&e.parentId===M&&y(!1);}},[E,I,M]),React.useEffect(()=>{v&&E&&E.events.emit("menuopen",{parentId:M,nodeId:I});},[E,v,I,M]);const U={activeIndex:C,setActiveIndex:k,getItemProps:Y,setHasFocusInside:b,isOpen:v,setIsOpen:y},K=React.useMemo(()=>U,[C,k,Y,b,v]),J=N("io-dropdown-menu-button",A&&"io-dropdown-menu-item",v&&!A&&"active",n),q=hn([F.setReference,P.ref,g]),G=x.activeIndex===P.index?0:-1;return jsxRuntime.jsxs(Jn,{id:I,children:[jsxRuntime.jsx(T,{className:J,ref:q,variant:A?"link":i,tabIndex:A?G:void 0,role:A?"menuitem":void 0,"data-open":v?"":void 0,"data-nested":A?"":void 0,"data-focus-inside":w?"":void 0,text:s,icon:A?"chevron-right":r,iconSize:"10",iconRight:!!A||a,disabled:m,...W(x.getItemProps({onFocus(e){h.onFocus?.(e),b(!1),x.setHasFocusInside(!0);},...h}))}),jsxRuntime.jsx(Vo.Provider,{value:K,children:jsxRuntime.jsx(Fn,{elementsRef:S,labelsRef:D,children:v&&jsxRuntime.jsx(So,{context:L,modal:!1,initialFocus:A?-1:0,returnFocus:!A,children:jsxRuntime.jsx("div",{ref:F.setFloating,className:"io-dropdown-menu",style:O,...V(),children:p})})})})]})});Uo.displayName="DropdownMenu";const Ko=React.forwardRef(({...t},n)=>null===Un()?jsxRuntime.jsx(qn,{children:jsxRuntime.jsx(Uo,{ref:n,...t})}):jsxRuntime.jsx(Uo,{ref:n,...t}));function qo({className:n,size:o="large",variant:i="default",align:r="up",text:a,...s}){const l=N("io-loader",{[`io-loader-${i}`]:"default"!==i},"normal"===o&&"io-loader-md","small"===o&&"io-loader-sm",r&&[`direction-${r}`],n);return jsxRuntime.jsxs("div",{className:l,role:"status","aria-live":"polite",...s,children:[jsxRuntime.jsx("div",{className:"io-loader-icon"}),a&&jsxRuntime.jsx("div",{className:"io-loader-text",children:a})]})}function Go({className:t,children:n,...o}){const i=N("io-panel-header",t);return jsxRuntime.jsx(ee,{className:i,...o,children:n})}Ko.displayName="DropdownMenu",Ko.Item=Yo,Ko.Separator=q,Go.Title=M,Go.ButtonGroup=Z,Go.Button=T,Go.ButtonIcon=D,Go.Dropdown=X;const Qo=React.forwardRef(({className:t,children:n,...o},i)=>{const r=N("io-panel-body",t);return jsxRuntime.jsx("div",{className:r,ref:i,"data-testid":"panel-body",...o,children:n})});function Xo({className:t,...n}){const o=N("io-panel-footer",t);return jsxRuntime.jsx(oe,{className:o,...n})}function Zo({className:t,children:n,...o}){const i=N("io-panel",t);return jsxRuntime.jsx("div",{className:i,"data-testid":"panel",...o,children:n})}function ei({className:t,variant:n="default",children:o,...i}){const r=N("io-pill","default"!==n&&[`io-pill-${n}`],t);return jsxRuntime.jsx("div",{className:r,role:"status",...i,children:o})}function ti({className:t,variant:n="active",value:o=0,...i}){const r=N("io-progress",n,t);let a;return a=o<0?0:o>100?100:o,jsxRuntime.jsx("div",{className:r,role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,...i,children:jsxRuntime.jsx("div",{className:"io-progress-bar",style:{width:`${a}%`}})})}function ni({text:t="Label",...n}){return jsxRuntime.jsx("label",{...n,children:t})}Qo.displayName="PanelBody",Xo.ButtonGroup=Z,Xo.Button=T,Xo.ButtonIcon=D,Xo.Dropdown=X,Zo.Header=Go,Zo.Body=Qo,Zo.Footer=Xo,ei.Icon=S;const oi=React.forwardRef(({id:n="input",className:o,type:i="text",name:r="input",align:s="up",label:l,iconPrepend:c,iconPrependOnClick:u,iconAppend:d,iconAppendOnClick:f,placeholder:m,disabled:p,readOnly:h,errorMessage:g,errorDataTestId:v,...y},w)=>{const b=N("io-control-input",c&&"io-control-leading-icon",d&&"io-control-trailing-icon",p&&"io-control-disabled",h&&"io-control-readonly",g&&"io-control-error",s&&[`direction-${s}`],o),C=React.useCallback(e=>{p?e.preventDefault():u&&u(e);},[u,p]),k=React.useCallback(e=>{p?e.preventDefault():f&&f(e);},[f,p]);return jsxRuntime.jsxs("div",{className:b,children:[l&&jsxRuntime.jsx(ni,{htmlFor:n,text:l}),c&&jsxRuntime.jsx(S,{variant:c,onClick:e=>C(e)}),jsxRuntime.jsx("input",{id:n,className:"io-input",ref:w,type:i,name:r,tabIndex:0,placeholder:m??(()=>{switch(i){case"email":return "Enter your email here...";case"number":return "Enter number here...";case"password":return "Enter your password here...";case"tel":return "Enter your phone number here...";case"file":return "Select a file...";default:return "Enter text here..."}})(),"aria-label":l,disabled:p,readOnly:h,...g?{"aria-invalid":!0,"aria-describedby":`${n}-error`}:{},...y}),d&&jsxRuntime.jsx(S,{variant:d,onClick:e=>k(e)}),g&&jsxRuntime.jsxs("div",{"data-testid":v,id:`${n}-error`,className:"io-input-error",children:[jsxRuntime.jsx(S,{variant:"close"}),g]})]})});oi.displayName="Input";const ii=React.forwardRef(({id:n="textarea",className:o,name:i="textarea",align:r="up",label:a,rows:s=4,placeholder:l="Enter text here...",disabled:c,readOnly:u,...d},f)=>{const m=N("io-control-textarea",c&&"io-control-disabled",u&&"io-control-readonly",r&&[`direction-${r}`],o);return jsxRuntime.jsxs("div",{className:m,children:[a&&jsxRuntime.jsx(ni,{htmlFor:n,text:a}),jsxRuntime.jsx("textarea",{id:n,className:"io-textarea",ref:f,name:i,tabIndex:0,placeholder:l,"aria-label":a,disabled:c,readOnly:u,rows:s,...d})]})});ii.displayName="Textarea";const ri=React.forwardRef(({id:n="checkbox",className:o,name:i="checkbox",align:r="left",label:a,checked:s,disabled:l,...c},u)=>{const d=N("io-control-checkbox",s&&"io-control-checked",l&&"io-control-disabled",r&&[`direction-${r}`],o);return jsxRuntime.jsxs("div",{className:d,children:[jsxRuntime.jsx("input",{type:"checkbox",id:n,className:"io-checkbox",ref:u,name:i,tabIndex:l?-1:0,checked:s,disabled:l,"aria-checked":s,...c}),a&&jsxRuntime.jsx(ni,{htmlFor:n,text:a,"data-testid":c["data-testid"]?`${c["data-testid"]}-label`:void 0})]})});ri.displayName="Checkbox";const ai=React.forwardRef(({id:n="radio",className:o,name:i="radio",align:r="left",label:a,checked:s,disabled:l,...c},u)=>{const d=N("io-control-radio",s&&"io-control-checked",l&&"io-control-disabled",r&&[`direction-${r}`],o);return jsxRuntime.jsxs("div",{className:d,children:[jsxRuntime.jsx("input",{type:"radio",id:n,className:"io-radio",ref:u,name:i,tabIndex:l?-1:0,checked:s,disabled:l,"aria-checked":s,...c}),a&&jsxRuntime.jsx(ni,{htmlFor:n,text:a})]})});ai.displayName="Radio";var si=React__default["default"]["undefined"!=typeof document&&void 0!==document.createElement?"useLayoutEffect":"useEffect"],li=0,ci=()=>li++,ui=0;const di="function"==typeof React.useId?React.useId:function(e,t){void 0===t&&(t="🅰");var[n,o]=React.useState(ui?ci:void 0);return si(()=>{void 0===n&&o(li++),ui=1;},[]),e||(void 0===n?n:t+n)},fi=React.forwardRef(({id:n,className:o,name:i="toggle",align:r="left",label:a,checked:s,disabled:l,onKeyDown:c,"data-testid":u="toggle",...d},f)=>{const m=di(),p=n||`toggle-${m}`,h=N("io-control-toggle",s&&"io-control-checked",l&&"io-control-disabled",r&&[`direction-${r}`],o);return jsxRuntime.jsx("div",{className:h,children:jsxRuntime.jsxs("label",{className:"io-toggle",htmlFor:p,tabIndex:l?-1:0,onKeyDown:c,"data-testid":`${u}-label`,children:[jsxRuntime.jsx("input",{type:"checkbox",id:p,className:"io-checkbox",ref:f,name:i,checked:s,disabled:l,"aria-checked":s,tabIndex:-1,"data-testid":u,...d}),jsxRuntime.jsx("span",{className:"slider","data-testid":`${u}-slider`}),a]})})});function pi(e){const[t,n]=React.useState(!1);function o({key:t}){t===e&&n(!0);}const i=({key:t})=>{t===e&&n(!1);};return React.useEffect(()=>(window.addEventListener("keydown",o),window.addEventListener("keyup",i),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i);}),[]),t}function hi(e,t=500){const[n,o]=React.useState(e);return React.useEffect(()=>{const n=setTimeout(()=>{o(e);},t);return ()=>clearTimeout(n)},[e,t]),n}function vi(e,t){React.useEffect(()=>{const n=n=>{n.code===e&&t();};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},[e,t]);}fi.displayName="Toggle";const wi=()=>void 0!==window.glue42gd||void 0!==window.iodesktop;function bi(){return React.useMemo(()=>"object"==typeof window&&wi(),[])}const Ci=()=>{const e=React.useContext(reactHooks.IOConnectContext),[t,n]=React.useState(null),o=React.useCallback(t=>e?.themes?.select(t),[e]);return React.useEffect(()=>{if(!e)return;let t=!1;const o=e=>{t||n(e);};return e.themes?.onChanged(o),e.themes?.getCurrent().then(o).catch(console.warn),()=>{t=!0;}},[e]),{currentTheme:t,selectTheme:o}};const ki=()=>{const e=React.useContext(reactHooks.IOConnectContext),t=e?.windows,n=e?.workspaces,o=React.useRef(null),[i,r]=React.useState(null),[s,u]=React.useState(null),[m,p]=React.useState(!1),[h,g]=React.useState(!1),[v,y]=React.useState(null),b=React.useRef(void 0),C=function(){const e=React.useRef(!1);return React.useEffect(()=>(e.current=!0,()=>{e.current=!1;}),[]),React.useCallback(()=>e.current,[])}(),{currentTheme:k}=Ci();React.useEffect(()=>{o.current=i;const e=i?.ioConnectWindow.onVisibilityChanged(()=>{i?.ioConnectWindow.isVisible||p(!1);});return ()=>{e?.();}},[i]);const N=React.useCallback(async(e,o)=>{const i={windowId:e?.ioConnectWindow.id,...o},r=window.glue42gd.windowId;if((()=>{const e=wi()&&!!window.workspacesManager,t=!wi()&&!!window.ioworkspaces;return e||t})()){if(!n)return;const e=(await(n?.getAllFrames())).find(e=>e.id===r);await(e?.showPopup(i));}else if(wi()&&window.webGroupsManager){const e=t.groups.list().find(e=>e.id===r);await(e?.showPopup(i));}else {const e=t.my();if(!e)return void console.warn("Cannot access my window to show popup");await e.showPopup({...i});}},[t,n]),S=React.useCallback(e=>{try{const t=e.document;k?.name&&(t.documentElement.className=k.name);const n=t.createElement("div");return n.id="io-popup-window-container",t.body.innerHTML="",t.body.appendChild(n),t}catch(e){const t=`Failed to setup popup document: ${String(e)}`;return console.error("usePopupWindow:",t,e),C()&&y(t),null}},[k,C]),D=React.useCallback(async e=>{if(!t){const e="io.Connect API not available";return console.error("usePopupWindow:",e),C()&&y(e),null}C()&&(g(!0),y(null));try{const n=new Promise((e,t)=>{setTimeout(()=>t(new Error("Popup creation timeout after 5 seconds")),5e3);}),o=t.createPopup({...e}),i=await Promise.race([o,n]);if(!C())return await i.ioConnectWindow.close().catch(()=>{}),console.warn("usePopupWindow: Component unmounted during popup creation, cleaned up popup"),null;r(i);const a=i.browserWindow;if(a?.document){const e=S(a);C()&&e&&u(e);}return i}catch(e){const t=`Failed to create popup: ${String(e)}`;return console.error("usePopupWindow:",t,e),C()&&(y(t),r(null),u(null)),null}finally{C()&&g(!1);}},[t,S,C]),x=React.useCallback(()=>{if(!i||!t)return !1;try{return t.list().some(e=>e.id===i.ioConnectWindow.id)}catch(e){return console.warn("usePopupWindow: Failed to verify popup existence",e),!1}},[i,t]),E=React.useCallback(async()=>{if(!i)return null;if(x())return i;console.warn("usePopupWindow: Popup window was destroyed, recreating...");const e=i.ioConnectWindow.bounds,t=await D({left:e.left,top:e.top,width:e.width,height:e.height});if(!t){const e="Failed to recreate destroyed popup window";console.error("usePopupWindow:",e),C()&&y(e);}return t},[i,x,D,C]),I=React.useCallback(async e=>{if(i)return await E();const t=await D(e);return t?C()?t:(await t.ioConnectWindow.close().catch(()=>{}),console.warn("usePopupWindow: Component unmounted during popup creation, cleaned up popup"),null):(console.warn("usePopupWindow: Failed to create popup, operation aborted"),null)},[i,E,D,C]);React.useEffect(()=>{if(i?.browserWindow&&s)try{k?.name&&(s.documentElement.className=k.name);}catch(e){console.warn("usePopupWindow: Failed to update popup theme",e);}},[i,s,k]);const M=React.useCallback(()=>{y(null);},[]),P=React.useCallback(async e=>{if(i){if(!t){const e="io.Connect API not available";return console.error("usePopupWindow:",e),void(C()&&y(e))}try{const t=e||b.current;if(!t)return void console.warn("usePopupWindow: No show options available");const n=await E();if(!n||!C())return;await N(n,t),C()&&p(!0);}catch(e){const t=`Failed to show popup: ${JSON.stringify(e)}`;console.error("usePopupWindow:",t,e),C()&&y(t);}}else console.warn("usePopupWindow: Cannot show popup - popup not created yet");},[i,t,N,C,E]),A=React.useCallback(async e=>{await(i?.ioConnectWindow.moveResize({...e}));},[i]),T=React.useCallback(async()=>{if(C()&&(p(!1),o.current))try{await o.current.ioConnectWindow.hide();}catch(e){console.error("usePopupWindow: Failed to hide popup",e);}},[o,C]);Q(()=>{m&&T().catch(e=>{console.error("Failed to hide popup on Escape key press in parent window",e);});},["Escape"]),React.useEffect(()=>{if(!i?.browserWindow||!m)return;const e=e=>{"Escape"===e.key&&(e.preventDefault(),T().catch(e=>{console.error("Failed to hide popup on Escape key press in popup window",e);}));};return i.browserWindow.document.addEventListener("keydown",e),()=>{i.browserWindow.document.removeEventListener("keydown",e);}},[i,m,T]);const O=React.useCallback(async()=>{if(o.current)try{await o.current.ioConnectWindow.close(),o.current=null;}catch(e){const t=`Failed to close popup: ${String(e)}`;console.error("usePopupWindow:",t,e),C()&&y(t);}finally{C()&&(r(null),u(null),p(!1),b.current=void 0);}},[o,C]),F=React.useCallback(async(e,n,o)=>{if(!t){const e="io.Connect API not available";return console.error("usePopupWindow:",e),void(C()&&y(e))}C()&&(g(!0),y(null));try{let e=await I(n);if(!e){const t=await D(n);if(!t)return void console.warn("usePopupWindow: Failed to create popup, operation aborted");if(!C())return await t.ioConnectWindow.close().catch(()=>{}),void console.warn("usePopupWindow: Component unmounted during popup creation, cleaned up popup");e=t;}o&&(b.current=o),await N(e,o),C()&&p(!0);}catch(e){const t=`Failed to create and show popup: ${String(e)}`;console.error("usePopupWindow:",t,e),C()&&y(t);}finally{C()&&g(!1);}},[D,t,N,C,I]);return {popup:i,loading:h,error:v,clearError:M,isOpen:!!i,isVisible:m,createPopup:D,showPopup:P,createAndShowPopup:F,hidePopup:T,closePopup:O,getContainer:()=>s?.getElementById("io-popup-window-container")||null,resizePopup:A}};React.createContext({theme:"dark"});const xi="___platform_prefs___",Ti="_launchpad_pinnedPosition",Oi="_launchpad_allowDocking",Fi="_launchpad_minimizeToTray",Li="_launchpad_autoCloseStartingAppsAndWorkspaces",Bi="_launchpad_showTutorialOnStartup",Ri="_layouts_restoreLastSaved",_i="_layouts_saveCurrentOnExit",Hi="_layouts_showUnsavedChangesPrompt",ji="_layouts_showDeletePrompt",$i="_downloads_askForEachDownload",Xi=e=>"string"==typeof e?e:e?.message?"string"==typeof e.message?e.message:JSON.stringify(e.message):JSON.stringify(e),Zi="warning",er={success:5e3,warning:1e4};var tr=function(e){return {ok:!0,result:e}},nr=function(e){return {ok:!1,error:e}},or=function(e,t,n){return !1===t.ok?t:!1===n.ok?n:tr(e(t.result,n.result))},ir=function(e,t){return !0===t.ok?t:nr(e(t.error))},rr=function(){return rr=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rr.apply(this,arguments)};function ar(e,t){if(e===t)return !0;if(null===e&&null===t)return !0;if(typeof e!=typeof t)return !1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return !1;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!ar(e[n],t[n]))return !1;return !0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return !1;for(n=0;n<o.length;n++){if(!t.hasOwnProperty(o[n]))return !1;if(!ar(e[o[n]],t[o[n]]))return !1}return !0}}var sr=function(e){return Array.isArray(e)},lr=function(e){return "object"==typeof e&&null!==e&&!sr(e)},cr=function(e,t){return "expected "+e+", got "+function(e){switch(typeof e){case"string":return "a string";case"number":return "a number";case"boolean":return "a boolean";case"undefined":return "undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}}(t)},ur=function(e){return e.map(function(e){return "string"==typeof e?"."+e:"["+e+"]"}).join("")},dr=function(e,t){var n=t.at,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]]);}return n}(t,["at"]);return rr({at:e+(n||"")},o)},fr=function(){function e(t){var n=this;this.decode=t,this.run=function(e){return ir(function(t){return {kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}},n.decode(e))},this.runPromise=function(e){return !0===(t=n.run(e)).ok?Promise.resolve(t.result):Promise.reject(t.error);var t;},this.runWithException=function(e){return function(e){if(!0===e.ok)return e.result;throw e.error}(n.run(e))},this.map=function(t){return new e(function(e){return function(e,t){return !0===t.ok?tr(e(t.result)):t}(t,n.decode(e))})},this.andThen=function(t){return new e(function(e){return function(e,t){return !0===t.ok?e(t.result):t}(function(n){return t(n).decode(e)},n.decode(e))})},this.where=function(t,o){return n.andThen(function(n){return t(n)?e.succeed(n):e.fail(o)})};}return e.string=function(){return new e(function(e){return "string"==typeof e?tr(e):nr({message:cr("a string",e)})})},e.number=function(){return new e(function(e){return "number"==typeof e?tr(e):nr({message:cr("a number",e)})})},e.boolean=function(){return new e(function(e){return "boolean"==typeof e?tr(e):nr({message:cr("a boolean",e)})})},e.constant=function(t){return new e(function(e){return ar(e,t)?tr(t):nr({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})})},e.object=function(t){return new e(function(e){if(lr(e)&&t){var n={};for(var o in t)if(t.hasOwnProperty(o)){var i=t[o].decode(e[o]);if(!0!==i.ok)return void 0===e[o]?nr({message:"the key '"+o+"' is required but was not present"}):nr(dr("."+o,i.error));void 0!==i.result&&(n[o]=i.result);}return tr(n)}return lr(e)?tr(e):nr({message:cr("an object",e)})})},e.array=function(t){return new e(function(e){if(sr(e)&&t){return e.reduce(function(e,n,o){return or(function(e,t){return e.concat([t])},e,function(e,n){return ir(function(e){return dr("["+n+"]",e)},t.decode(e))}(n,o))},tr([]))}return sr(e)?tr(e):nr({message:cr("an array",e)})})},e.tuple=function(t){return new e(function(e){if(sr(e)){if(e.length!==t.length)return nr({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e[o]);if(!i.ok)return nr(dr("["+o+"]",i.error));n[o]=i.result;}return tr(n)}return nr({message:cr("a tuple of length "+t.length,e)})})},e.union=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return new e(function(e){return [t,n].concat(o).reduce(function(t,n){return or(Object.assign,t,n.decode(e))},tr({}))})},e.anyJson=function(){return new e(function(e){return tr(e)})},e.unknownJson=function(){return new e(function(e){return tr(e)})},e.dict=function(t){return new e(function(e){if(lr(e)){var n={};for(var o in e)if(e.hasOwnProperty(o)){var i=t.decode(e[o]);if(!0!==i.ok)return nr(dr("."+o,i.error));n[o]=i.result;}return tr(n)}return nr({message:cr("an object",e)})})},e.optional=function(t){return new e(function(e){return null==e?tr(void 0):t.decode(e)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(e){for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e);if(!0===i.ok)return i;n[o]=i.error;}var r=n.map(function(e){return "at error"+(e.at||"")+": "+e.message}).join('", "');return nr({message:'expected a value matching one of the decoders, got the errors ["'+r+'"]'})})},e.withDefault=function(t,n){return new e(function(e){return tr(function(e,t){return !0===t.ok?t.result:e}(t,n.decode(e)))})},e.valueAt=function(t,n){return new e(function(e){for(var o=e,i=0;i<t.length;i++){if(void 0===o)return nr({at:ur(t.slice(0,i+1)),message:"path does not exist"});if("string"==typeof t[i]&&!lr(o))return nr({at:ur(t.slice(0,i+1)),message:cr("an object",o)});if("number"==typeof t[i]&&!sr(o))return nr({at:ur(t.slice(0,i+1)),message:cr("an array",o)});o=o[t[i]];}return ir(function(e){return void 0===o?{at:ur(t),message:"path does not exist"}:dr(ur(t),e)},n.decode(o))})},e.succeed=function(t){return new e(function(e){return tr(t)})},e.fail=function(t){return new e(function(e){return nr({message:t})})},e.lazy=function(t){return new e(function(e){return t().decode(e)})},e}(),mr=fr.string;fr.number;var pr=fr.boolean,hr=fr.anyJson;fr.unknownJson;var gr=fr.constant,vr=fr.object,yr=fr.array;fr.tuple,fr.dict;var wr=fr.optional,br=fr.oneOf;fr.union,fr.intersection,fr.withDefault,fr.valueAt,fr.succeed,fr.fail,fr.lazy;const Cr=["name","title","version","customProperties","icon","caption","type"],kr=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var Nr=function(e){return {ok:!0,result:e}},Sr=function(e){return {ok:!1,error:e}},Dr=function(e,t,n){return !1===t.ok?t:!1===n.ok?n:Nr(e(t.result,n.result))},xr=function(e,t){return !0===t.ok?t:Sr(e(t.error))},Er=function(){return Er=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Er.apply(this,arguments)};function Ir(e,t){if(e===t)return !0;if(null===e&&null===t)return !0;if(typeof e!=typeof t)return !1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return !1;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!Ir(e[n],t[n]))return !1;return !0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return !1;for(n=0;n<o.length;n++){if(!t.hasOwnProperty(o[n]))return !1;if(!Ir(e[o[n]],t[o[n]]))return !1}return !0}}var Mr=function(e){return Array.isArray(e)},Pr=function(e){return "object"==typeof e&&null!==e&&!Mr(e)},Ar=function(e,t){return "expected "+e+", got "+function(e){switch(typeof e){case"string":return "a string";case"number":return "a number";case"boolean":return "a boolean";case"undefined":return "undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}}(t)},Tr=function(e){return e.map(function(e){return "string"==typeof e?"."+e:"["+e+"]"}).join("")},Or=function(e,t){var n=t.at,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]]);}return n}(t,["at"]);return Er({at:e+(n||"")},o)},Fr=function(){function e(t){var n=this;this.decode=t,this.run=function(e){return xr(function(t){return {kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}},n.decode(e))},this.runPromise=function(e){return !0===(t=n.run(e)).ok?Promise.resolve(t.result):Promise.reject(t.error);var t;},this.runWithException=function(e){return function(e){if(!0===e.ok)return e.result;throw e.error}(n.run(e))},this.map=function(t){return new e(function(e){return function(e,t){return !0===t.ok?Nr(e(t.result)):t}(t,n.decode(e))})},this.andThen=function(t){return new e(function(e){return function(e,t){return !0===t.ok?e(t.result):t}(function(n){return t(n).decode(e)},n.decode(e))})},this.where=function(t,o){return n.andThen(function(n){return t(n)?e.succeed(n):e.fail(o)})};}return e.string=function(){return new e(function(e){return "string"==typeof e?Nr(e):Sr({message:Ar("a string",e)})})},e.number=function(){return new e(function(e){return "number"==typeof e?Nr(e):Sr({message:Ar("a number",e)})})},e.boolean=function(){return new e(function(e){return "boolean"==typeof e?Nr(e):Sr({message:Ar("a boolean",e)})})},e.constant=function(t){return new e(function(e){return Ir(e,t)?Nr(t):Sr({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})})},e.object=function(t){return new e(function(e){if(Pr(e)&&t){var n={};for(var o in t)if(t.hasOwnProperty(o)){var i=t[o].decode(e[o]);if(!0!==i.ok)return void 0===e[o]?Sr({message:"the key '"+o+"' is required but was not present"}):Sr(Or("."+o,i.error));void 0!==i.result&&(n[o]=i.result);}return Nr(n)}return Pr(e)?Nr(e):Sr({message:Ar("an object",e)})})},e.array=function(t){return new e(function(e){if(Mr(e)&&t){return e.reduce(function(e,n,o){return Dr(function(e,t){return e.concat([t])},e,function(e,n){return xr(function(e){return Or("["+n+"]",e)},t.decode(e))}(n,o))},Nr([]))}return Mr(e)?Nr(e):Sr({message:Ar("an array",e)})})},e.tuple=function(t){return new e(function(e){if(Mr(e)){if(e.length!==t.length)return Sr({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e[o]);if(!i.ok)return Sr(Or("["+o+"]",i.error));n[o]=i.result;}return Nr(n)}return Sr({message:Ar("a tuple of length "+t.length,e)})})},e.union=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return new e(function(e){return [t,n].concat(o).reduce(function(t,n){return Dr(Object.assign,t,n.decode(e))},Nr({}))})},e.anyJson=function(){return new e(function(e){return Nr(e)})},e.unknownJson=function(){return new e(function(e){return Nr(e)})},e.dict=function(t){return new e(function(e){if(Pr(e)){var n={};for(var o in e)if(e.hasOwnProperty(o)){var i=t.decode(e[o]);if(!0!==i.ok)return Sr(Or("."+o,i.error));n[o]=i.result;}return Nr(n)}return Sr({message:Ar("an object",e)})})},e.optional=function(t){return new e(function(e){return null==e?Nr(void 0):t.decode(e)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(e){for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e);if(!0===i.ok)return i;n[o]=i.error;}var r=n.map(function(e){return "at error"+(e.at||"")+": "+e.message}).join('", "');return Sr({message:'expected a value matching one of the decoders, got the errors ["'+r+'"]'})})},e.withDefault=function(t,n){return new e(function(e){return Nr(function(e,t){return !0===t.ok?t.result:e}(t,n.decode(e)))})},e.valueAt=function(t,n){return new e(function(e){for(var o=e,i=0;i<t.length;i++){if(void 0===o)return Sr({at:Tr(t.slice(0,i+1)),message:"path does not exist"});if("string"==typeof t[i]&&!Pr(o))return Sr({at:Tr(t.slice(0,i+1)),message:Ar("an object",o)});if("number"==typeof t[i]&&!Mr(o))return Sr({at:Tr(t.slice(0,i+1)),message:Ar("an array",o)});o=o[t[i]];}return xr(function(e){return void 0===o?{at:Tr(t),message:"path does not exist"}:Or(Tr(t),e)},n.decode(o))})},e.succeed=function(t){return new e(function(e){return Nr(t)})},e.fail=function(t){return new e(function(e){return Sr({message:t})})},e.lazy=function(t){return new e(function(e){return t().decode(e)})},e}(),Lr=Fr.string,Br=Fr.number,Rr=Fr.boolean,_r=Fr.anyJson;Fr.unknownJson;var Hr=Fr.constant,jr=Fr.object,$r=Fr.array;Fr.tuple;var zr=Fr.dict,Wr=Fr.optional,Vr=Fr.oneOf;Fr.union,Fr.intersection,Fr.withDefault,Fr.valueAt,Fr.succeed,Fr.fail,Fr.lazy;const Yr=Lr().where(e=>e.length>0,"Expected a non-empty string"),Ur=Br().where(e=>e>=0,"Expected a non-negative number"),Kr=jr({name:Yr,displayName:Wr(Lr()),contexts:Wr($r(Lr())),customConfig:Wr(jr())}),Jr=Vr(Hr("web"),Hr("native"),Hr("citrix"),Hr("onlineNative"),Hr("other")),qr=jr({url:Yr}),Gr=jr({src:Yr,size:Wr(Yr),type:Wr(Yr)}),Qr=jr({src:Yr,size:Wr(Yr),type:Wr(Yr),label:Wr(Yr)}),Xr=jr({contexts:$r(Yr),displayName:Wr(Yr),resultType:Wr(Yr),customConfig:Wr(_r())}),Zr=jr({listensFor:Wr(zr(Xr)),raises:Wr(zr($r(Yr)))}),ea=jr({broadcasts:Wr($r(Yr)),listensFor:Wr($r(Yr))}),ta=jr({name:Yr,description:Wr(Yr),broadcasts:Wr($r(Yr)),listensFor:Wr($r(Yr))}),na=jr({intents:Wr(Zr),userChannels:Wr(ea),appChannels:Wr($r(ta))}),oa=jr({url:Wr(Yr),top:Wr(Br()),left:Wr(Br()),width:Wr(Ur),height:Wr(Ur)}),ia=jr({name:Wr(Yr),type:Wr(Yr.where(e=>"window"===e,"Expected a value of window")),title:Wr(Yr),version:Wr(Yr),customProperties:Wr(_r()),icon:Wr(Lr()),caption:Wr(Lr()),details:Wr(oa),intents:Wr($r(Kr)),hidden:Wr(Rr())}),ra=jr({name:Yr,appId:Yr,title:Wr(Yr),version:Wr(Yr),manifest:Yr,manifestType:Yr,tooltip:Wr(Yr),description:Wr(Yr),contactEmail:Wr(Yr),supportEmail:Wr(Yr),publisher:Wr(Yr),images:Wr($r(jr({url:Wr(Yr)}))),icons:Wr($r(jr({icon:Wr(Yr)}))),customConfig:_r(),intents:Wr($r(Kr))}),aa=jr({appId:Wr(Yr),name:Wr(Yr),details:Wr(qr),version:Wr(Yr),title:Wr(Yr),tooltip:Wr(Yr),lang:Wr(Yr),description:Wr(Yr),categories:Wr($r(Yr)),icons:Wr($r(Gr)),screenshots:Wr($r(Qr)),contactEmail:Wr(Yr),supportEmail:Wr(Yr),moreInfo:Wr(Yr),publisher:Wr(Yr),customConfig:Wr($r(_r())),hostManifests:Wr(_r()),interop:Wr(na)}),sa=jr({appId:Yr,name:Wr(Yr),type:Jr,details:qr,version:Wr(Yr),title:Wr(Yr),tooltip:Wr(Yr),lang:Wr(Yr),description:Wr(Yr),categories:Wr($r(Yr)),icons:Wr($r(Gr)),screenshots:Wr($r(Qr)),contactEmail:Wr(Yr),supportEmail:Wr(Yr),moreInfo:Wr(Yr),publisher:Wr(Yr),customConfig:Wr($r(_r())),hostManifests:Wr(_r()),interop:Wr(na),localizedVersions:Wr(zr(aa))}),la=Vr(ra,sa),ca=e=>`${e.kind} at ${e.at}: ${JSON.stringify(e.input)}. Reason - ${e.message}`;class ua{fdc3ToDesktopDefinitionType={web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"};toApi(){return {isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(e){const t=la.run(e);return t.ok?e.appId&&e.details?{isFdc3:!0,version:"2.0"}:e.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:ca(t.error)}}parseToBrowserBaseAppData(e){const{isFdc3:t,version:n}=this.isFdc3Definition(e);if(!t)throw new Error("The passed definition is not FDC3");const o=la.run(e);if(!o.ok)throw new Error(`Invalid FDC3 ${n} definition. Error: ${ca(o.error)}`);const i=this.getUserPropertiesFromDefinition(e,n),r={url:this.getUrl(e,n)},a={name:e.appId,type:"window",createOptions:r,userProperties:{...i,intents:"1.2"===n?i.intents:this.getIntentsFromV2AppDefinition(e),details:r},title:e.title,version:e.version,icon:this.getIconFromDefinition(e,n),caption:e.description,fdc3:"2.0"===n?{...e,definitionVersion:"2.0"}:void 0},s=e.hostManifests?.ioConnect||e.hostManifests?.Glue42;if(!s)return a;const l=ia.run(s);if(!l.ok)throw new Error(`Invalid FDC3 ${n} definition. Error: ${ca(l.error)}`);return Object.keys(l.result).length?this.mergeBaseAppDataWithGlueManifest(a,l.result):a}parseToDesktopAppConfig(e){const{isFdc3:t,version:n}=this.isFdc3Definition(e);if(!t)throw new Error("The passed definition is not FDC3");const o=la.run(e);if(!o.ok)throw new Error(`Invalid FDC3 ${n} definition. Error: ${ca(o.error)}`);if("1.2"===n){const t=e;return {name:t.appId,type:"window",details:{url:this.getUrl(e,n)},version:t.version,title:t.title,tooltip:t.tooltip,caption:t.description,icon:t.icons?.[0].icon,intents:t.intents,customProperties:{manifestType:t.manifestType,images:t.images,contactEmail:t.contactEmail,supportEmail:t.supportEmail,publisher:t.publisher,icons:t.icons,customConfig:t.customConfig}}}const i=e,r={name:i.appId,type:this.fdc3ToDesktopDefinitionType[i.type],details:i.details,version:i.version,title:i.title,tooltip:i.tooltip,caption:i.description,icon:this.getIconFromDefinition(i,"2.0"),intents:this.getIntentsFromV2AppDefinition(i),fdc3:{...i,definitionVersion:"2.0"}},a=e.hostManifests?.ioConnect||e.hostManifests?.Glue42;if(!a)return r;if("object"!=typeof a||Array.isArray(a))throw new Error(`Invalid '${e.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(r,a)}getUserPropertiesFromDefinition(e,t){return "1.2"===t?Object.fromEntries(Object.entries(e).filter(([e])=>!Cr.includes(e))):Object.fromEntries(Object.entries(e).filter(([e])=>!Cr.includes(e)&&!kr.includes(e)))}getUrl(e,t){let n;if("1.2"===t){const t=JSON.parse(e.manifest);n=t.details?.url||t.url;}else n=e.details?.url;if(!n||"string"!=typeof n)throw new Error(`Invalid FDC3 ${t} definition. Provide valid 'url' under '${"1.2"===t?"manifest":"details"}' key`);return n}getIntentsFromV2AppDefinition(e){const t=e.interop?.intents?.listensFor;if(!t)return;return Object.entries(t).map(e=>{const[t,n]=e;return {name:t,...n}})}getIconFromDefinition(e,t){return "1.2"===t?e.icons?.find(e=>e.icon)?.icon||void 0:e.icons?.find(e=>e.src)?.src||void 0}mergeBaseAppDataWithGlueManifest(e,t){let n=e;if(t.customProperties&&(n.userProperties={...e.userProperties,...t.customProperties}),t.details){const o={...e.createOptions,...t.details};n.createOptions=o,n.userProperties.details=o;}return Array.isArray(t.intents)&&(n.userProperties.intents=(n.userProperties.intents||[]).concat(t.intents)),n={...n,...t},delete n.details,delete n.intents,n}mergeDesktopConfigWithGlueManifest(e,t){const n=Object.assign({},e,t,{details:{...e.details,...t.details}});return Array.isArray(t.intents)&&(n.intents=(e.intents||[]).concat(t.intents)),n}}const da={common:{nonEmptyStringDecoder:Yr,nonNegativeNumberDecoder:Ur},fdc3:{allDefinitionsDecoder:la,v1DefinitionDecoder:ra,v2DefinitionDecoder:sa}};var fa;!function(e){e.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",e.CALLER_NOT_DEFINED="Caller Id is not defined",e.TIMEOUT_HIT="Timeout hit",e.INTENT_NOT_FOUND="Cannot find Intent",e.HANDLER_NOT_FOUND="Cannot find Intent Handler",e.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",e.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",e.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",e.RESOLVER_TIMEOUT="User did not choose a handler",e.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",e.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned";}(fa||(fa={}));const ma=new class{_fdc3;_decoders=da;_errors={intents:fa};get fdc3(){return this._fdc3||(this._fdc3=(new ua).toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};ma.fdc3;const pa=ma.decoders;ma.errors;const ha=pa.common.nonEmptyStringDecoder,ga=br(gr("add"),gr("align-bottom"),gr("align-bottom-solid"),gr("align-left"),gr("align-left-bottom"),gr("align-left-bottom-solid"),gr("align-left-solid"),gr("align-left-top"),gr("align-left-top-solid"),gr("align-right"),gr("align-right-bottom"),gr("align-right-bottom-solid"),gr("align-right-solid"),gr("align-right-top"),gr("align-right-top-solid"),gr("align-top"),gr("align-top-solid"),gr("always-on-top"),gr("always-on-top-on"),gr("application"),gr("arrow-down-long"),gr("arrow-down-to-bracket"),gr("arrow-left-long"),gr("arrow-right-from-bracket"),gr("arrow-right-long"),gr("arrow-right"),gr("arrow-up"),gr("arrow-up-long"),gr("ban"),gr("bell"),gr("bell-solid"),gr("bookmark"),gr("bullseye-pointer"),gr("certificate"),gr("check"),gr("check-light"),gr("check-solid"),gr("chevron-down"),gr("chevron-left"),gr("chevron-right"),gr("chevron-up"),gr("circle-info"),gr("circle-xmark"),gr("circle-xmark-full"),gr("clock"),gr("clock-rotate-left"),gr("clone"),gr("close"),gr("cog"),gr("cog-solid"),gr("collapse"),gr("copy"),gr("download"),gr("delete-left"),gr("dev-tools"),gr("ellipsis"),gr("ellipsis-vertical"),gr("expand"),gr("envelope"),gr("envelope-open"),gr("exclamation-mark"),gr("expand"),gr("feedback"),gr("filter"),gr("floppy"),gr("floppy-disk-pen"),gr("folder"),gr("folder-open"),gr("globe"),gr("group"),gr("hidden"),gr("home"),gr("house"),gr("info"),gr("keyboard"),gr("layout"),gr("link"),gr("list-ul"),gr("lock"),gr("logo"),gr("minimize"),gr("minimize-down"),gr("paper-plane-top"),gr("paperclip"),gr("pause"),gr("pen-line"),gr("pen-to-square"),gr("pin"),gr("play"),gr("pop-in"),gr("pop-in-widget"),gr("pop-out"),gr("power-off"),gr("publish"),gr("refresh"),gr("resize"),gr("restore"),gr("rotate-right"),gr("search"),gr("search-filled"),gr("sleep"),gr("sliders"),gr("snooze"),gr("spinner"),gr("square"),gr("square-arrow-down"),gr("square-arrow-up"),gr("star"),gr("star-full"),gr("sticky-off"),gr("sticky-off-hover"),gr("sticky-on"),gr("sticky-on-hover"),gr("subscribe"),gr("system-close"),gr("system-maximize"),gr("system-minimize"),gr("thumbs-down"),gr("thumbs-up"),gr("trash"),gr("trash-can"),gr("triangle-exclamation"),gr("unlock"),gr("unpin"),gr("up-to-line"),gr("user"),gr("user-gear"),gr("visible"),gr("workspace")),va=vr({id:ha,title:ha,description:wr(mr()),icon:wr(ga),iconSrc:wr(ha),contextMenuActions:wr(yr(hr())),type:ha}),ya=br(gr("Left"),gr("Right")),wa=br(gr("daily"),gr("weekly")),ba=br(gr("Sunday"),gr("Monday"),gr("Tuesday"),gr("Wednesday"),gr("Thursday"),gr("Friday"),gr("Saturday")),Ca=vr({customPrefs:wr(hr()),_launchpad_collapsedSections:wr(yr(ha)),_launchpad_favorites:wr(yr(va)),_launchpad_isLayoutsPanelOpen:wr(pr()),_launchpad_isCollapsed:wr(pr()),_launchpad_isPinned:wr(pr()),_launchpad_pinnedPosition:wr(ya),_launchpad_allowDocking:wr(pr()),_launchpad_minimizeToTray:wr(pr()),_launchpad_autoCloseStartingAppsAndWorkspaces:wr(pr()),_launchpad_showTutorialOnStartup:wr(pr()),_layouts_restoreLastSaved:wr(pr()),_layouts_saveCurrentOnExit:wr(pr()),_layouts_showUnsavedChangesPrompt:wr(pr()),_layouts_showDeletePrompt:wr(pr()),_downloads_askForEachDownload:wr(pr()),_downloads_location:wr(mr()),_system_scheduleRestart:wr(pr()),_system_scheduleRestartTime:wr(ha),_system_scheduleRestartFrequency:wr(wa),_system_scheduleRestartDay:wr(ba),_system_scheduleShutdown:wr(pr()),_system_scheduleShutdownTime:wr(ha),_system_scheduleShutdownFrequency:wr(wa),_system_scheduleShutdownDay:wr(ba)}),ka=async e=>{const{io:t,variant:n,text:o,error:i}=e,r=Xi(i);try{if(n===Zi&&t.logger.warn(r?`${o} ${r}`:o),!("modals"in t)||!t.modals)throw new Error("Modals are not enabled.");const e={text:o,variant:n,ttl:er[n]};await t.modals.alerts.request(e);}catch(e){console.warn("Failed to request alert. ",{error:e});}},Na=React.createContext(void 0);function xa({prefKey:e}){const t=React.useContext(reactHooks.IOConnectContext),n=React.useContext(Na),o=n?.prefs?.[e],i=n?.isInitialSetupCompleted??!1,[r,s]=React.useState(!i),[u,m]=React.useState(),p=React.useRef(0);React.useEffect(()=>{i&&0===p.current&&s(!1);},[i]);const h=React.useCallback(async n=>{if(!t)return;const o=++p.current;s(!0),m(void 0);const i=async n=>{n&&await ka({io:t,variant:Zi,text:`Failed to update prefKey "${e}".`,error:n}),o===p.current&&(s(!1),n&&m({message:Xi(n)}));};let r;if(n instanceof Function)try{r=n((await t.contexts.get(xi))[e]);}catch(e){return i(e)}else r=n;try{const n=Ca.runWithException({[e]:r});await t.contexts.update(xi,n);}catch(e){return i(e)}await i();},[t,e]);if(void 0===n)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return {error:u,isLoading:r,update:h,value:o}}const Ea="var(--io-neutrals-0)",Ia="var(--io-neutrals-900)";function Ma(e){let t,n,o;if(e.startsWith("#")){let i=e.slice(1);3===i.length&&(i=i.split("").map(e=>e+e).join("")),t=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);}else {if(!e.startsWith("rgb")){const t=document.createElement("canvas").getContext("2d");if(!t)return Ia;t.fillStyle=e;return Ma(t.fillStyle)}{const i=e.match(/\d+/g)?.map(Number);if(!i||i.length<3)return Ia;[t,n,o]=i;}}return (.2126*t+.7152*n+.0722*o)/255>.5?Ia:Ea}function Pa({className:t,channel:n,...o}){const i=N("io-channel-selector-badge",t),r=React.useMemo(()=>Ma(n.color),[n.color]);return jsxRuntime.jsx("div",{className:i,style:{color:r,backgroundColor:n.color},"data-testid":`channel-selector-badge-${n.color}`,...o,children:jsxRuntime.jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:n.label})})}function Aa(){return jsxRuntime.jsx(S,{variant:"check","data-testid":"channel-selector-channel-selected"})}function Ta({channel:o,handleChannelRestricted:i,lockedChannelRestriction:r}){const a=(e,t)=>n=>{n.stopPropagation(),A(n)&&(n.preventDefault(),t||i({...o,[e]:!o[e]}));};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{children:o.isSelected&&jsxRuntime.jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),jsxRuntime.jsx("div",{role:"button",onClick:e=>e.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:jsxRuntime.jsx(fi,{label:"Publish",checked:o.write,onChange:()=>{i({...o,write:!o.write});},onKeyDown:a("write",!o.isSelected||r?.write),onClick:e=>e.stopPropagation(),disabled:!o.isSelected||r?.write})}),jsxRuntime.jsx("div",{role:"button",onClick:e=>e.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:jsxRuntime.jsx(fi,{label:"Subscribe",checked:o.read,onChange:()=>{i({...o,read:!o.read});},onKeyDown:a("read",!o.isSelected||r?.read),disabled:!o.isSelected||r?.read})})]})}const Oa=React.createContext({});function Fa({channel:t,isSelected:n,onChannelSelect:o,onChannelRestrict:i,...r}){const{variant:s,selectedChannels:c,lockedChannelRestrictions:u}=React.useContext(Oa),d=n||t.isSelected||c?.includes(t),f=u?.find(e=>e.name===t.name),m=React.useCallback(()=>o?.({...t,isSelected:!d}),[t,o,d]),p=React.useCallback(e=>{const n=e.target;n.closest(".io-toggle")||n.classList.contains("io-toggle")||A(e)&&(e.preventDefault(),o?.({...t,isSelected:!d}));},[t,o,d]),h=React.useCallback(e=>{i?.(e);},[i]);return jsxRuntime.jsx(_,{prepend:jsxRuntime.jsx(Pa,{channel:t}),append:"single"===s||"multi"===s?d&&jsxRuntime.jsx(Aa,{}):jsxRuntime.jsx(Ta,{channel:t,handleChannelRestricted:h,lockedChannelRestriction:f}),isSelected:d,onClick:m,onKeyDown:p,...r,children:t.name},t.name)}function La({variant:t,onVariantChange:n,disabled:o=!1}){const i="directionalSingle"===t||"directionalMulti"===t,r=React.useCallback(()=>{n?.(!i);},[i,n]),s=React.useCallback(e=>{e.stopPropagation();},[]),l=React.useCallback(e=>{e.stopPropagation(),A(e)&&(e.preventDefault(),o||r());},[o,r]);return jsxRuntime.jsx(fi,{label:"Directional",align:"right",checked:i,onChange:r,onClick:s,onKeyDown:l,disabled:o,"data-testid":`channel-selector-toggle-${t}`})}const Ba=React.forwardRef(({className:n,variant:o="single",variantToggle:i=!1,channels:r=[],lockedChannelRestrictions:a=[],onVariantChange:s,onChannelSelect:l,onChannelRestrict:c,...d},f)=>{const m=N("io-channel-selector-panel",("directionalSingle"===o||"directionalMulti"===o)&&"io-channel-selector-panel-directional",n),p=React.useMemo(()=>({variant:o,selectedChannels:r.filter(e=>e.isSelected),lockedChannelRestrictions:a,onVariantChange:s,onChannelSelect:l,onChannelRestrict:c}),[r,o,a,s,l,c]);return jsxRuntime.jsx(Oa.Provider,{value:p,children:jsxRuntime.jsx("div",{className:m,ref:f,children:jsxRuntime.jsxs(V,{...d,children:[jsxRuntime.jsx(V.ItemTitle,{"data-testid":"channel-selector-title",append:i&&jsxRuntime.jsx(La,{variant:o,onVariantChange:s}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[o]}),r?.map(t=>jsxRuntime.jsx(Fa,{channel:t,isSelected:t.isSelected,onChannelSelect:l,onChannelRestrict:c,"data-testid":`channel-selector-channel-${t.name}`},t.name))]})})})});Ba.displayName="ChannelSelector";const Ra=React.forwardRef(({className:t,title:n,ariaLabel:o,onClick:i,onKeyDown:r,children:a,disabled:s=!1,...l},c)=>jsxRuntime.jsx("div",{ref:c,className:N(t,{disabled:s}),title:n,role:"button",tabIndex:s?-1:0,"aria-label":o,"aria-disabled":s,onClick:e=>{!s&&i&&i(e);},onKeyDown:e=>{!s&&r&&r(e);},...l,children:a}));Ra.displayName="ChannelSelectorButtonWrapper";function _a(e,t){const n=React.useContext(reactHooks.IOConnectContext),o=n.windows,i=n.channels,[r,s]=React.useState({channels:[]});React.useEffect(()=>{if(!e)return;(async()=>{try{const t=await i.getRestrictions(e);s(t);}catch(e){console.error("Failed to fetch channel restrictions:",e);}})().catch(console.error);const t=o.findById(e);if(!t||"function"!=typeof t.onChannelRestrictionsChanged)return;return t.onChannelRestrictionsChanged(s)},[e,i,o]);const u=React.useCallback(({name:n,read:o,write:r})=>{e&&!["single","multi"].includes(t)&&void 0!==o&&void 0!==r&&i.restrict({name:n,read:o,write:r,windowId:e}).catch(console.error);},[e,t,i]),d=React.useCallback(e=>e.map(e=>{const t=r.channels.find(t=>t.name===e.name);return {...e,read:t?.read??!0,write:t?.write??!0}}),[r.channels]);return {channelRestrictions:r,onChannelRestricted:u,applyChannelRestrictions:d}}function Ha(e){const t=React.useContext(reactHooks.IOConnectContext).windows,[n,o]=React.useState([]);return React.useEffect(()=>{if(!e)return;(async()=>{try{const n=t.findById(e);if(!n)return void o([]);const i=await(n.application?.getConfiguration()),r=i?.details?.channelSelector?.preventModifyingRestrictionsFor;if(!r)return void o([]);o(r);}catch(e){console.error("Failed to fetch locked channel restrictions:",e);}})().catch(console.error);},[e,t]),{lockedChannelRestrictions:n}}Object.freeze({__proto__:null,Channel:Fa,ChannelBadge:Pa,ChannelDirectionalAppend:Ta,ChannelSelector:Ba,ChannelSelectorButton:function({channels:n,variant:o,className:i,onClick:r,onKeyDown:a,...s}){const c=React.useRef(null),u=React.useContext(Oa),f=n||u.selectedChannels||[],m=o||u.variant||"single",p=f.filter(e=>e.isSelected);if(("multi"===m||"directionalMulti"===m)&&p.length>1){const t=`io-channel-selector-button io-channel-selector-multi-${Math.min(p.length,4)}`,n=p.map(e=>e.name).join(", "),o=function(e){const t={},n=Math.min(e.length,4);return e.slice(0,n).forEach((e,o)=>{t[`--io-channel-selector-multi-${n}-color-${o+1}`]=e.color;}),t}(p);return jsxRuntime.jsx(Ra,{ref:c,className:i,title:n,ariaLabel:`Selected channels - ${n}`,onClick:r,onKeyDown:a,...s,children:jsxRuntime.jsx("div",{className:t,style:o})})}const h=p[0];if(!h)return jsxRuntime.jsx(Ra,{ref:c,className:i,title:"No channel selected",ariaLabel:"No channel selected",onClick:r,onKeyDown:a,...s,children:jsxRuntime.jsx(S,{variant:"link"})});const g="directionalSingle"===m||"directionalMulti"===m,v=g?(y=h).isSelected?y.read&&y.write?"readwrite":y.read?"read":y.write?"write":null:null:null;var y;return jsxRuntime.jsxs(Ra,{ref:c,className:N(g?"io-channel-selector-button io-channel-selector-button-directional":"io-channel-selector-button",i),title:h.name,ariaLabel:`Selected channel - ${h.name}`,onClick:r,onKeyDown:a,style:{color:Ma(h.color),backgroundColor:h.color},...s,children:[jsxRuntime.jsx("span",{children:h.label}),v&&"readwrite"!==v&&jsxRuntime.jsx(S,{variant:"read"===v?"subscribe":"publish"})]})},ChannelSingleAppend:Aa,useChannelRestrictionLocks:Ha,useChannelRestrictions:_a,useIOCDChannels:function(e){const t="T42.ChannelSelector.Execute",n=React.useContext(reactHooks.IOConnectContext),o=n?.windows,i=n?.channels,r=n?.interop,s=bi(),u=o?.my(),m=React.useRef(),[h,g]=React.useState(""),[v,y]=React.useState("single"),[b,C]=React.useState(null),[k,N]=React.useState(!1),[S,D]=React.useState(),{channelRestrictions:x,onChannelRestricted:E,applyChannelRestrictions:I}=_a(h,v),{lockedChannelRestrictions:M}=Ha(h),P=React.useCallback(async(e,t,n)=>{if("will-show"===e.command)try{N(!0),m.current=n;const{windowId:t,channels:i,variant:r}=e;y(r),g(t);const a=await(o?.findById(t)?.getChannel())??"",s=I(function(e,t){return e.map((e,n)=>{const o=!!t&&t.split("+++").includes(e.name);return {...e,color:e.meta?.color,label:e.meta?.label??String.fromCharCode(n+65),isSelected:o,read:e.read??!0,write:e.write??!0}})}(i,a));C(s);}catch(e){console.error("Error in channel selector handler:",e),D(e);}finally{N(!1);}},[o,I]),A=React.useCallback(async({name:e,isSelected:t})=>{if(i){C(n=>n?n.map(n=>"single"===v||"directionalSingle"===v?{...n,isSelected:n.name===e&&t}:n.name===e?{...n,isSelected:t}:n):[]);try{t?await i.join(e,h):await i.leave({windowId:h,channel:e});}catch(e){D(e),console.error("Error selecting channel:",e);}"single"===v&&s&&u&&u?.hide().catch(console.error);}},[i,v,u,h,s]);return Q(()=>{s&&u&&u?.hide().catch(console.error);},["Escape"]),React.useEffect(()=>{if(null===s||!s)return;const e=u?.onClosing(async e=>(e({showDialog:!1}),Promise.resolve()));return e},[u,s]),React.useEffect(()=>{if(!r)return;return r.registerAsync(t,(e,t,n)=>{P(e,t,n).catch(e=>{console.error("Error in channel selector handler:",e),D(e);});}).catch(console.error),()=>{r.unregister(t);}},[r,P]),React.useEffect(()=>{C(e=>e?I(e):null);},[x,I]),React.useLayoutEffect(()=>{if(e?.current&&b?.length){const{height:t,width:n,x:o,y:i}=e.current.getBoundingClientRect();m.current&&t>0&&m.current({height:t,width:n,x:o,y:i});}},[b,e]),{windowId:h,error:S,variant:v,channels:b,channelRestrictions:x,lockedChannelRestrictions:M,onChannelSelected:A,onChannelRestricted:E,isLoading:k}}});function $a({className:n,draggable:o,title:i,children:r,...a}){const s=N("io-dialog-header",o&&"draggable",n);return jsxRuntime.jsxs(te,{className:s,...a,children:[jsxRuntime.jsx("h3",{children:i}),r]})}function za({children:t,...n}){return jsxRuntime.jsx(ne,{...n,children:jsxRuntime.jsx(ne.Content,{children:t})})}function Wa({children:t,...n}){return jsxRuntime.jsx(ie,{...n,children:t})}const Va=React.createContext({config:{message:""},theme:"dark",setResult:()=>{}}),Ya=()=>React.useContext(Va),Ua=t=>{const{id:n,onButtonFocused:o,...i}=t,{config:r}=Ya();return jsxRuntime.jsx(T,{variant:"outline",onFocus:()=>o&&o(n),autoFocus:(a=n,a===r.defaultAction),...i});var a;},Ka=({timerDuration:t,callback:n})=>{const[o,i]=React.useState(t);React.useEffect(()=>{if(o<=0)return n();{const e=setInterval(()=>{i(e=>e-1);},1e3);return ()=>{clearInterval(e);}}},[o,n]);return jsxRuntime.jsx("p",{children:`This dialog will close in: ${o} seconds`})};function Ja({children:t}){return jsxRuntime.jsx("div",{className:"io-dialog",role:"dialog",children:t})}function qa({className:n,placeHolder:o,maxInputLength:i,errorMessage:r,onInput:a,onEnterKeyDown:s}){const[l,u]=React.useState(""),m=React.useRef(null),p=N("io-control-input",n);React.useEffect(()=>{m.current&&m.current.focus();},[]);return jsxRuntime.jsxs("div",{className:p,children:[jsxRuntime.jsx("input",{className:"io-input",ref:m,type:"text",maxLength:i,placeholder:o,tabIndex:0,value:l,onChange:e=>{const t=e.target.value,n=e.target.parentElement;u(t);const o=a(t);n&&(0===t.length?n.className="":(n.className="was-validated",o?e.target.setCustomValidity(""):e.target.setCustomValidity("Invalid input pattern")));},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s());}}),r&&l.length>0?jsxRuntime.jsx("small",{children:jsxRuntime.jsx("strong",{children:r})}):null]})}function Ga({children:t}){return jsxRuntime.jsx("div",{className:"io-dialog",role:"dialog",children:t})}Object.freeze({__proto__:null,Dialog:function({config:n,setResult:o,header:i,body:r,footer:s}){if(!n)throw new Error("Please provide a config prop to Dialog Component");if(!o)throw new Error("Please provide a setResult prop to Dialog Component");const[l,u]=React.useState(!1),d=pi("Escape"),m=pi("Enter"),[p,h]=React.useState(n.defaultAction),{theme:g}=Ya();React.useEffect(()=>{u("SingleInputDialog"===n?.type);},[n]);const v=React.useCallback(()=>{o({action:"expired"});},[o]);React.useEffect(()=>{document.documentElement.classList.remove("dark","light"),document.documentElement.classList.add(g);},[g]),React.useEffect(()=>{d&&o({action:"closed"});},[d,o]),React.useEffect(()=>{m&&!p&&o({action:"clicked",button:n.defaultAction});},[m,p,n.defaultAction,o]);const y=e=>{e.preventDefault(),o({action:"clicked",button:p});},w=()=>{b("");},b=e=>{h(e);};return n.timerDuration&&!1===n.showTimer&&setTimeout(()=>{o({action:"expired"});},1e3*n.timerDuration),jsxRuntime.jsxs(Ja,{children:[i??jsxRuntime.jsx($a,{title:n?.title,draggable:!0,children:jsxRuntime.jsx("div",{className:"non-draggable",children:jsxRuntime.jsx(Z,{children:jsxRuntime.jsx(D,{id:"close",icon:"close",iconSize:"12",size:"24",onClick:()=>o({action:"closed"}),onBlur:w,tabIndex:-1})})})}),r??jsxRuntime.jsx(za,{children:jsxRuntime.jsxs("div",{children:[n?.messageTitle&&jsxRuntime.jsx("h1",{children:n?.messageTitle}),jsxRuntime.jsx("p",{children:n.message}),n?.showTimer&&n?.timerDuration&&jsxRuntime.jsx(Ka,{timerDuration:n.timerDuration,callback:v})]})}),s??jsxRuntime.jsx(Wa,{children:jsxRuntime.jsxs(Z,{align:"right",children:[n.showAffirmativeButton&&jsxRuntime.jsx(Ua,{id:"affirmative",variant:"primary",onClick:y,onButtonFocused:b,onBlur:w,disabled:l,children:n.affirmativeButtonName}),n.showNegativeButton&&jsxRuntime.jsx(Ua,{id:"negative",onClick:y,onButtonFocused:b,onBlur:w,children:n.negativeButtonName}),n.showCancelButton&&jsxRuntime.jsx(Ua,{id:"cancel",onClick:y,onButtonFocused:b,onBlur:w,children:n.cancelButtonName})]})})]})},DialogBody:za,DialogButton:Ua,DialogFooter:Wa,DialogHeader:$a,DialogsProvider:({children:t})=>{const[n,o]=React.useState({message:"",messageTitle:"",operation:"systemShutdown",type:""}),[i,r]=React.useState("dark");React.useEffect(()=>{(async()=>{const e=await a();o(e);})();},[]);const a=()=>window.glue42dialog.getConfig(),s=e=>{window.glue42dialog.setResult(e);};React.useEffect(()=>{window.glue42dialog.onThemeChanged(e=>{r(e);}),r(window.glue42dialog.getTheme());},[]);const l=React.useMemo(()=>({theme:i,config:n,setResult:s}),[n,i]);return jsxRuntime.jsx(Va.Provider,{value:l,children:t})},SingleInputDialog:({config:n,setResult:o,header:i,body:r,footer:s})=>{if(!n)throw new Error("Please provide a config prop to Dialog Component");if(!o)throw new Error("Please provide a setResult prop to Dialog Component");const l=pi("Escape"),u=pi("Enter"),[d,m]=React.useState(n.defaultAction),{theme:p}=Ya(),[h,g]=React.useState(""),[v,y]=React.useState(""),[w,b]=React.useState(!1),C=React.useCallback(()=>{o({action:"expired"});},[o]),k=React.useCallback(()=>{"affirmative"===n?.defaultAction?w&&h.length>0&&o({action:"clicked",button:n.defaultAction,value:h}):o({action:"clicked",button:n.defaultAction});},[n.defaultAction,h,o,w]);React.useEffect(()=>{document.documentElement.classList.remove("dark","light"),document.documentElement.classList.add(p);},[p]),React.useEffect(()=>{l&&o({action:"closed"});},[l,o]),React.useEffect(()=>{u&&!d&&k();},[u,k,d]);const N=e=>{e.preventDefault(),o("affirmative"===d&&h?{action:"clicked",button:d,value:h}:{action:"clicked",button:d});},S=()=>{x("");},x=e=>{m(e);};n.timerDuration&&!1===n.showTimer&&setTimeout(()=>{o({action:"expired"});},1e3*n.timerDuration);return jsxRuntime.jsxs(Ga,{children:[i??jsxRuntime.jsx($a,{title:n?.title,draggable:!0,children:jsxRuntime.jsx("div",{className:"non-draggable",children:jsxRuntime.jsx(Z,{children:jsxRuntime.jsx(D,{id:"close",icon:"close",size:"24",onClick:()=>o({action:"closed"}),onBlur:S})})})}),r??jsxRuntime.jsx(za,{children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[n.message&&jsxRuntime.jsx("p",{children:n.message}),jsxRuntime.jsx(qa,{onInput:e=>{let t=!0;try{t=!!e.match(n.inputPattern??""),b(t);}catch(e){console.log(`Failed to validate regular expression pattern: ${n.inputPattern??""}`);}return t?(g(e),y("")):y(n.inputPatternErrorMessage??"Invalid input pattern"),t},errorMessage:v,onEnterKeyDown:k,maxInputLength:n.inputMaxLength,placeHolder:n.inputPlaceholder}),n?.showTimer&&n?.timerDuration&&jsxRuntime.jsx(Ka,{timerDuration:n.timerDuration,callback:C})]})}),s??jsxRuntime.jsx(Wa,{children:jsxRuntime.jsxs(Z,{align:"right",children:[n.showAffirmativeButton&&jsxRuntime.jsx(Ua,{id:"affirmative",variant:"primary",onClick:N,onButtonFocused:x,onBlur:S,disabled:!w,children:n.affirmativeButtonName}),n.showNegativeButton&&jsxRuntime.jsx(Ua,{id:"negative",onClick:N,onButtonFocused:x,onBlur:S,children:n.negativeButtonName}),n.showCancelButton&&jsxRuntime.jsx(Ua,{id:"cancel",onClick:N,onButtonFocused:x,onBlur:S,children:n.cancelButtonName})]})})]})},useDialogsContext:Ya});function Xa({title:n="Downloads"}){const{ItemSearch:o,HeaderButtons:i}=Ns();return jsxRuntime.jsxs("div",{className:"io-dm-header",children:[jsxRuntime.jsxs(ee,{draggable:!0,children:[jsxRuntime.jsx(ee.Title,{tag:"h1",text:n,size:"large"}),jsxRuntime.jsx(i,{className:"non-draggable"})]}),jsxRuntime.jsx(o,{})]})}const Za=window.glue42gd;const es=React.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),ts=()=>React.useContext(es);function ns({className:n,placeholder:o="Search",iconPrepend:i="search",iconAppend:r="close",...s}){const l=N("io-header-search",n),c=React.useRef(null),{searchQuery:u,setSearch:f,itemsCount:m}=ts(),p=u.length>0,h=React.useCallback(()=>{f(""),c.current&&c.current.focus();},[f]);return jsxRuntime.jsxs("div",{className:l,children:[jsxRuntime.jsx(oi,{ref:c,value:u,iconPrepend:i,iconAppend:p?r:void 0,iconAppendOnClick:p?h:void 0,placeholder:o,onChange:e=>f(e.target.value),...s}),p&&jsxRuntime.jsx("p",{className:"io-header-search-count",children:`${m} results`})]})}function os({className:n,...o}){const{MoreButton:i,CloseButton:r}=Ns();return jsxRuntime.jsxs(Z,{className:n,align:"right",...o,children:[jsxRuntime.jsx(i,{}),jsxRuntime.jsx(r,{})]})}function is({icon:n="ellipsis-vertical",...o}){const{items:i,clearItems:r,showSettings:a}=ts(),s=0===i.length;return jsxRuntime.jsxs(X,{variant:"light",...o,children:[jsxRuntime.jsx(X.ButtonIcon,{icon:n,variant:"circle",size:"32"}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsxs(X.List,{children:[jsxRuntime.jsx(X.Item,{onClick:e=>(e=>{s?e.stopPropagation():r();})(e),disabled:s,children:"Clear All"}),jsxRuntime.jsx(X.Item,{onClick:a,children:"Settings"})]})})]})}const rs={minimizeWindow:async function(e){if(e)try{const t=e.windows?.my();await(t?.minimize());}catch(e){console.error("Failed to minimize window",e);}},closeWindow:async function(e,t){if(e)try{const n=e.windows?.my();await(n?.close(t));}catch(e){console.error("Failed to close window",e);}},restartPlatform:async function(e,t=!0){if(e)try{await e.appManager.restart({autoSave:t,showDialog:!0});}catch(e){console.error("Failed to restart io.Connect Desktop",e);}},shutdownPlatform:async function(e,t=!0){if(e)try{await e.appManager.exit({autoSave:t,showDialog:!0});}catch(e){console.error("Failed to shutdown io.Connect Desktop",e);}}};function as({icon:t="close",size:n="32",variant:o="circle",onClick:i,...r}){const a=React.useContext(reactHooks.IOConnectContext);return jsxRuntime.jsx(D,{icon:t,size:n,variant:o,onClick:e=>{i?i(e):rs.closeWindow(a).catch(e=>{console.error("Failed to close window:",e);});},...r})}function ss(e,t=!1,n=!1,o=!1){const i=e.getDate(),r=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],a=e.getFullYear(),s=e.getHours(),l=e.getMinutes();let c="";return c=l<10?`0${l}`:`${l}`,t?"Today"===t?n?"Today":`Today at ${s}:${c}`:"Yesterday"===t?n?"Yesterday":`Yesterday at ${s}:${c}`:`${s}:${c}`:o?n?`${r} ${i}`:`${r} ${i} at ${s}:${c}`:n?`${r} ${i}, ${a}`:`${r} ${i}, ${a} at ${s}:${c}`}function ls(e,t={showTime:!0}){const n=new Date(1e3*e),o=new Date,i=Math.round((o-n)/1e3),r=Math.round(i/60),a=o.toDateString()===n.toDateString(),s=new Date(o.setDate(o.getDate()-1)).toDateString()===n.toDateString(),l=o.getFullYear()===n.getFullYear();return t.showTime?i<5?"Just Now":i<60?`${i} seconds ago`:i<90?"about a minute ago":r<60?`${r} minutes ago`:a?ss(n,"Today",!1,!0):s?ss(n,"Yesterday",!1,!0):l?ss(n,!1,!1,!0):ss(n):a?"Today":s?"Yesterday":l?ss(n,!1,!0,!0):ss(n,!1,!0)}function cs({className:t,...n}){const o=N("io-dm-body",t),{DownloadListEmpty:i,ItemGroup:r,Item:a}=Ns(),{items:s,searchQuery:l,setCount:c,sortItems:d}=ts(),m=d(s),p=hi(l),h=React.useMemo(()=>m.filter(e=>e.displayInfo.filename.toLowerCase().includes(p.toLowerCase())||e.displayInfo.url.toLowerCase().includes(p.toLowerCase())),[m,p]),g=React.useMemo(()=>h.map(e=>({...e,displayInfo:{...e.displayInfo,startTime:ls(e.displayInfo.startTime,{showTime:!1})}})),[h]),v=React.useMemo(()=>Object.values(g.reduce((e={},t)=>(e[t.displayInfo.startTime]=e[t.displayInfo.startTime]?.concat([])??[],e[t.displayInfo.startTime].push(t),e),{})),[g]);return React.useEffect(()=>{c(h.length);},[h,c]),jsxRuntime.jsx("div",{className:o,...n,children:v&&0!==v.length?v.map(t=>jsxRuntime.jsx(r,{title:String(t[0].displayInfo.startTime)??null,children:t.map(t=>jsxRuntime.jsx(a,{item:t},t.id))},t[0].id??"")):jsxRuntime.jsx(i,{})})}function us({className:n,icon:o="download",text:i="No downloads to display.",...r}){const a=N("io-dm-no-items",n);return jsxRuntime.jsxs("div",{className:a,...r,children:[jsxRuntime.jsx(S,{variant:o}),jsxRuntime.jsx("p",{children:i})]})}function ds({className:n,title:o,children:i,...r}){const a=N("io-dm-item-group",n);return jsxRuntime.jsxs("div",{className:a,...r,children:[o&&jsxRuntime.jsx("p",{children:o}),i]})}function fs({className:o,item:i,...r}){const{ItemHeader:a,ItemBody:s,ItemFooter:l}=Ns(),{state:c,url:u,filename:d,receivedBytes:f,totalBytes:m,speed:p,timeRemaining:h}=i.displayInfo;if(!i)return jsxRuntime.jsx(jsxRuntime.Fragment,{});const g=N("io-dm-item",i.displayInfo.state&&[c],o);return jsxRuntime.jsxs("div",{className:g,...r,children:[jsxRuntime.jsx(a,{itemID:i.id,filename:d,state:c}),jsxRuntime.jsx(s,{state:c,url:u,bytesReceived:f,bytesTotal:m,speed:p,timeRemaining:h}),jsxRuntime.jsx(l,{itemID:i.id,state:c})]})}function ms({bytesReceived:t=0,bytesTotal:n=0,...o}){const i=React.useCallback(()=>t&&n?Math.round(t/n*100):0,[t,n]);return jsxRuntime.jsx(ti,{value:i(),...o})}function ps({className:n,itemID:o,filename:i,state:r,cancel:s,remove:l,...c}){const u=N("io-dm-item-header",n),{cancelItem:d,removeItem:f}=ts(),m=React.useCallback(e=>{s?s(e):d(e);},[s,d]),p=React.useCallback(e=>{l?l(e):f(e);},[l,f]);return jsxRuntime.jsxs("div",{className:u,...c,children:[jsxRuntime.jsx(M,{text:i,style:{textDecoration:"interrupted"===r||"cancelled"===r?"line-through":"none"}}),jsxRuntime.jsx(D,{icon:"close",iconSize:"12",onClick:()=>{"progressing"===r||"paused"===r?m(o):p(o);}})]})}function hs({className:n,state:o,url:i,bytesReceived:r=0,bytesTotal:a=0,speed:s=0,timeRemaining:l=0,...c}){const u=N("io-dm-item-body",n),d=e=>{const t=["Bytes","KB","MB","GB","TB"];if(0===e)return "0";const n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e}${t[n]}`:`${(e/1024**n).toFixed(1)}${t[n]}`};return jsxRuntime.jsxs("div",{className:u,...c,children:[jsxRuntime.jsx("p",{className:"io-text-small",children:i}),(m=o,"cancelled"===m||"interrupted"===m||"completed"===m?null:jsxRuntime.jsx(ms,{variant:"paused"===m?"paused":"active",bytesReceived:r,bytesTotal:a})),jsxRuntime.jsx("p",{className:"io-text-default-lh16",children:"completed"===o?`${d(r??0)} - Done`:"cancelled"===o||"interrupted"===o?`${d(r??0)}/${d(a??0)} - Failed`:`${d(r??0)}/${d(a??0)} (${f=s,(f?`${(f/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60);let o="";return t>0&&(o+=`${t} hour${t>1?"s":""}, `),n>0&&(o+=`${n} min${n>1?"s":""}, `),((e=Math.floor(e%60))>0||""===o)&&(o+=`${e} sec${1!==e?"s":""}`),`${o.trim()} left`})(l)??0}`})]});var f,m;}const gs={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function vs({className:n,variant:o,text:i}){const r=N("io-dm-item-status",`io-dm-item-status-${o}`,n);return jsxRuntime.jsxs("div",{className:r,children:[o&&jsxRuntime.jsx(S,{variant:gs[o],className:"icon-severity",size:"10"}),i&&jsxRuntime.jsx("p",{className:"io-text-smaller",children:i})]})}function ys({className:o,itemID:i,state:r,pauseResume:s,showInFolder:l,cancel:c,...u}){const d=N("io-dm-item-footer",o),{pauseResumeItem:f,showItemInFolder:m,cancelItem:p}=ts(),h=React.useCallback(e=>{s?s(e):f(e);},[s,f]),g=React.useCallback(e=>{l?l(e):m(e);},[l,m]),v=React.useCallback(e=>{c?c(e):p(e);},[c,p]);return jsxRuntime.jsx("div",{className:d,...u,children:(()=>{switch(r){case"progressing":return jsxRuntime.jsxs(Z,{align:"right",children:[jsxRuntime.jsx(Z.Button,{variant:"primary",text:"Pause",onClick:()=>h(i)}),jsxRuntime.jsx(Z.Button,{variant:"link",text:"Cancel",onClick:()=>v(i)})]});case"paused":return jsxRuntime.jsx(Z,{align:"right",children:jsxRuntime.jsx(Z.Button,{variant:"primary",text:"Resume",onClick:()=>h(i)})});case"completed":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(vs,{variant:"success",text:"Complete"}),jsxRuntime.jsx(Z,{align:"right",children:jsxRuntime.jsx(Z.Button,{variant:"primary",text:"Show in Folder",onClick:()=>g(i)})})]});case"cancelled":return jsxRuntime.jsx(vs,{variant:"warning",text:"Cancelled"});case"interrupted":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(vs,{variant:"critical",text:"Failed"}),jsxRuntime.jsx(Z,{align:"right",children:jsxRuntime.jsx(Z.Button,{variant:"primary",text:"Retry",onClick:()=>h(i)})})]});default:return null}})()})}function ws({className:n,title:o="Download Settings",...i}){const r=N("io-dm-settings-panel",n),{configuration:{downloadFolder:a},hideSettings:s,setDownloadLocation:l,setDownloadLocationWithDialog:c,isDownloadLocationDialogVisible:u,downloadLocationList:d}=ts();return jsxRuntime.jsxs(Zo,{className:r,...i,children:[jsxRuntime.jsxs(Zo.Header,{children:[jsxRuntime.jsx(Zo.Header.Title,{size:"large",text:o,tag:"h1"}),jsxRuntime.jsx(Zo.Header.ButtonGroup,{children:jsxRuntime.jsx(D,{variant:"circle",icon:"close",size:"32",onClick:()=>{s();},disabled:u})})]}),jsxRuntime.jsx(Zo.Body,{children:jsxRuntime.jsxs(Z,{children:[jsxRuntime.jsxs(X,{variant:"light",disabled:u,children:[jsxRuntime.jsx(X.Button,{children:jsxRuntime.jsx("span",{className:"io-dm-settings-panel-download-location",children:a??d[0]})}),d.length>1&&jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{children:d.map((t,n)=>!t||0===n||n>3?null:jsxRuntime.jsx(X.Item,{onClick:()=>{l(t);},children:t},t))})})]}),jsxRuntime.jsx(T,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{c();},disabled:u})]})})]})}const bs={Header:Xa,ItemSearch:ns,HeaderButtons:os,MoreButton:is,CloseButton:as,Body:cs,DownloadListEmpty:us,ItemGroup:ds,Item:fs,ItemProgress:ms,ItemHeader:ps,ItemBody:hs,ItemFooter:ys,Settings:ws},Cs=React.createContext(bs),ks=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...bs,...n}),[n]);return jsxRuntime.jsx(Cs.Provider,{value:o,children:t})});ks.displayName="ComponentsStore";const Ns=()=>React.useContext(Cs);function Ss({className:n,...o}){const i=N("io-dm",n),{Header:r,Body:a,Settings:s}=Ns(),{isSettingsVisible:l}=ts();return jsxRuntime.jsxs(Zo,{className:i,...o,children:[jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{}),l&&jsxRuntime.jsx(s,{})]})}Object.freeze({__proto__:null,Body:cs,CloseButton:as,DownloadListEmpty:us,DownloadManager:function({components:t,...n}){return jsxRuntime.jsx(ks,{components:t,children:jsxRuntime.jsx(Ss,{...n})})},DownloadManagerProvider:({children:t})=>{const{configuration:n,items:o,removeItem:i,pauseResumeItem:r,cancelItem:a,clearItems:s,showItemInFolder:l,isSettingsVisible:d,showSettings:m,hideSettings:p,searchQuery:h,setSearch:g,itemsCount:v,setCount:y,setDownloadLocation:w,setDownloadLocationWithDialog:b,sortItems:C,isDownloadLocationDialogVisible:k,downloadLocationList:N}=function(){const[e,t]=React.useState({}),[n,o]=React.useState([]),[i,r]=React.useState(0),[a,s]=React.useState([]),[l,u]=React.useState(""),[d,m]=React.useState(!1),[p,h]=React.useState(!1),[g,v]=React.useState({filePaths:[],canceled:!1});React.useEffect(()=>{if(!Za)return;const e=Za.downloads.onUpdate(e=>o(t=>y(t,e))),n=Za.downloads.onConfigurationChanged(e=>{t(e);});return Za.downloads.list().then(o).catch(console.error),Za.downloads.getSavePathList().then(e=>{e.pathList&&s(e.pathList);}).catch(console.error),()=>{e(),n();}},[]),React.useEffect(()=>{h(!1);},[g]);const y=(e,t)=>{const n=e.findIndex(e=>e.id===t.id);if(-1===n)return [t,...e];const o=[...e];return o[n]=t,o};return {items:n,setCount:e=>{r(e);},sortItems:(e,t=!0)=>e.sort((e,n)=>t?e.displayInfo.startTime<n.displayInfo.startTime?1:-1:e.displayInfo.startTime>n.displayInfo.startTime?1:-1),setSearch:e=>{u(e);},cancelItem:async e=>{try{await Za.downloads.cancel(e);}catch(e){console.error(e);}},removeItem:async e=>{try{o(t=>t.filter(t=>t.id!==e)),await Za.downloads.removeItem(e);}catch(e){console.error(e);}},clearItems:async()=>{try{o([]),await Za.downloads.clearDownloadList();}catch(e){console.error(e);}},itemsCount:i,searchQuery:l,showSettings:()=>{m(!0);},hideSettings:()=>{m(!1);},configuration:e,isSettingsVisible:d,pauseResumeItem:async e=>{try{await Za.downloads.pauseResume(e);}catch(e){console.error(e);}},showItemInFolder:async e=>{try{await Za.downloads.showInFolder(e);}catch(e){console.error(e);}},setDownloadLocation:async e=>{try{await Za.downloads.setSavePath(e),s(t=>{if(t.includes(e)){const n=t.filter(t=>t!==e);return [e,...n]}return [e,...t]});}catch(e){console.error(e);}},downloadLocationList:a,isDownloadLocationDialogVisible:p,setDownloadLocationWithDialog:async()=>{h(!0);try{const e=await Za.downloads.showOpenDialog();if(v(e),!e?.filePaths||0===e.filePaths.length)return;await Za.downloads.setSavePath(e.filePaths[0]),s(t=>{if(t.includes(e.filePaths[0])){const n=t.filter(t=>t!==e.filePaths[0]);return [e.filePaths[0],...n]}return [e.filePaths[0],...t]});}catch(e){console.error(e);}}}}(),S=React.useMemo(()=>({configuration:n,items:o,removeItem:i,pauseResumeItem:r,cancelItem:a,clearItems:s,showItemInFolder:l,isSettingsVisible:d,showSettings:m,hideSettings:p,searchQuery:h,setSearch:g,itemsCount:v,setCount:y,setDownloadLocation:w,setDownloadLocationWithDialog:b,sortItems:C,isDownloadLocationDialogVisible:k,downloadLocationList:N}),[n,o,i,r,a,l,s,d,m,p,h,g,v,y,w,b,C,k,N]);return jsxRuntime.jsx(es.Provider,{value:S,children:t})},Header:Xa,HeaderButtons:os,Item:fs,ItemBody:hs,ItemFooter:ys,ItemGroup:ds,ItemHeader:ps,ItemProgress:ms,ItemSearch:ns,MoreButton:is,Settings:ws,useDownloadManagerContext:ts});function xs(e){if(e&&e.errorHandling&&"function"!=typeof e.errorHandling&&"log"!==e.errorHandling&&"silent"!==e.errorHandling&&"throw"!==e.errorHandling)throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof e.errorHandling+" was passed");var t=e&&"function"==typeof e.errorHandling&&e.errorHandling,n={};function o(n,o){var i=n instanceof Error?n:new Error(n);if(t)t(i);else {var r='[ERROR] callback-registry: User callback for key "'+o+'" failed: '+i.stack;if(e)switch(e.errorHandling){case"log":return console.error(r);case"silent":return;case"throw":throw new Error(r)}console.error(r);}}return {add:function(e,t,i){var r=n[e];return r||(r=[],n[e]=r),r.push(t),i&&setTimeout(function(){i.forEach(function(i){var r;if(null===(r=n[e])||void 0===r?void 0:r.includes(t))try{Array.isArray(i)?t.apply(void 0,i):t.apply(void 0,[i]);}catch(t){o(t,e);}});},0),function(){var o=n[e];o&&(o=o.reduce(function(e,n,o){return n===t&&e.length===o||e.push(n),e},[]),0===o.length?delete n[e]:n[e]=o);}},execute:function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];var r=n[e];if(!r||0===r.length)return [];var a=[];return r.forEach(function(n){try{var i=n.apply(void 0,t);a.push(i);}catch(t){a.push(void 0),o(t,e);}}),a},clear:function(){n={};},clearKey:function(e){n[e]&&delete n[e];}}}xs.default=xs;var Es=b(xs);var Is=new class{feedback=window.issueReporting;registry=Es();config;subscribed=!1;init(){this.subscribed||(this.subscribed=!0,window.onerror=(e,t,n,o,i)=>{this.feedback.send("error",e,t,n,o,i);},this.feedback.on("setTheme",e=>{const t=e.newTheme;this.registry.execute("on-theme-changed",t);}),this.feedback.on("submitEnded",e=>{const t=this.convertSubmitResultToPublic(e);this.registry.execute("on-submit-finished",t);}));}async getConfig(){return this.config=await this.feedback.invoke("config"),this.convertConfigToPublic(this.config)}onThemeChanged(e){return this.registry.add("on-theme-changed",e)}onSubmitFinished(e){return this.registry.add("on-submit-finished",e)}submitReport(e){return new Promise(t=>{const n=this.convertFeedbackToInternal(e),o=this.onSubmitFinished(e=>{o(),t(e);});this.feedback.send("submit",n);})}closeReport(e){return this.feedback.send("cancel",e)}setBounds(e,t,n,o){return this.feedback.send("setBounds",e,t,n,o)}openUrl(e){return this.feedback.send("openUrl",e)}convertConfigToPublic(e){return {version:e.version,buildVersion:e.buildVersion,region:e.region,env:e.env,theme:e.theme,isError:e.isError,errorMessage:e.errorMessage,mailingList:e.mailList,createJiraTicket:e.jiraEnabled,sendEmail:e.mailEnabled,attachments:e.attachments,applicationTitle:e.applicationTitle,allowEditRecipients:e.allowEditRecipients,attachmentsViewMode:e.attachmentsViewMode,selectedCategories:e.selectedCategories,technicalInfo:e.technicalInfo,environmentInfo:e.environmentDetails,showEnvironmentInfo:e.showEnvironmentInfo,context:e.context,sendEmailClient:e.mailClientConfig?.type??"Outlook"}}convertSubmitResultToPublic(e){return {description:e.description,jiraProcessed:e.jiraProcessed,jiraSucceeded:e.jiraSucceeded,jiraDetails:e.jiraDetails,jiraTicketUrl:e.jiraTicketUrl,emailProcessed:e.mailProcessed,emailSucceeded:e.mailSucceeded,emailDetails:e.mailDetails}}convertFeedbackToInternal(e){return {createTicket:e?.createJiraTicket,description:e?.description,summary:e?.summary,sendMail:e?.sendEmail,appendEnvironmentInfo:e?.appendEnvironmentInfo,appendTechnicalInfo:e?.appendTechnicalInfo,mailingList:e?.mailingList,attachments:e?.attachments,attachmentsMode:e?.attachmentsViewMode}}};const Ms=React.createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:e=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:e=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Ps=()=>React.useContext(Ms);function As({...n}){const{config:o,close:i}=Ps(),{applicationTitle:r}=o;return jsxRuntime.jsxs(ee,{draggable:!0,...n,children:[jsxRuntime.jsx(ee.Title,{tag:"h1",text:r?`Feedback Form - ${r}`:"Feedback Form",size:"large"}),jsxRuntime.jsx(ee.ButtonGroup,{className:"non-draggable",children:jsxRuntime.jsx(ee.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>i()})})]})}function Ts({className:n,handleSubmit:o,...i}){const r=N("io-panel-body",n),{config:a,submitFeedback:s}=Ps(),{IntroField:l,DescriptionField:c,TechInfoField:u,EnvInfoField:d,FileAttachmentsField:f,CategoryAttachmentsField:m,SettingsField:p,MailListField:h}=Gs(),g=o??s,v=`Your feedback will be submitted to the ${a.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return jsxRuntime.jsxs("form",{className:r,id:"feedback",onSubmit:e=>g(e),...i,children:[jsxRuntime.jsx(l,{children:jsxRuntime.jsx("p",{children:v})}),jsxRuntime.jsx(p,{}),jsxRuntime.jsx(h,{}),jsxRuntime.jsx(c,{}),jsxRuntime.jsx(u,{readOnly:!0}),jsxRuntime.jsx(d,{readOnly:!0}),"file"===a.attachmentsViewMode?jsxRuntime.jsx(f,{}):jsxRuntime.jsx(m,{})]})}function Os({...n}){const{FooterButtons:o}=Gs(),{openUrl:i,submitInProgress:r,submitStatus:a,jiraTicketURL:s}=Ps();return jsxRuntime.jsx(oe,{...n,children:jsxRuntime.jsxs("div",r?{className:"flex ai-center jc-between",children:[jsxRuntime.jsx(P,{children:jsxRuntime.jsx("p",{children:a.title})}),jsxRuntime.jsx(qo,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[jsxRuntime.jsxs(P,{children:[jsxRuntime.jsx("p",{className:"error"===a.type?"io-text-error":"",children:a.title}),s&&jsxRuntime.jsx("a",{href:s,onClick:e=>{e.preventDefault(),i(s);},children:s})]}),jsxRuntime.jsx(o,{})]})})}function Fs({className:t,...n}){const{CloseButton:o}=Gs(),{close:i}=Ps();return jsxRuntime.jsx(Z,{className:t,...n,children:jsxRuntime.jsx(o,{onClick:()=>i()})})}function Ls({className:n,...o}){const{SubmitButton:i,CancelButton:r,CloseButton:a}=Gs(),{close:s,submitCompleted:l}=Ps();return l?jsxRuntime.jsx(Z,{className:n,...o,children:jsxRuntime.jsx(a,{text:"Close",onClick:()=>s()})}):jsxRuntime.jsxs(Z,{className:n,...o,children:[jsxRuntime.jsx(i,{}),jsxRuntime.jsx(r,{onClick:()=>s()})]})}function Bs({text:t="Submit",...n}){return jsxRuntime.jsx(T,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function Rs({text:t="Cancel",...n}){return jsxRuntime.jsx(T,{variant:"link",text:t,...n})}function _s({...t}){return jsxRuntime.jsx(T,{variant:"primary",...t})}function Hs({showField:t=!0,className:n,title:o,hint:i,children:r,...a}){return t?jsxRuntime.jsx(P,{className:n,title:o,hint:i,...a,children:r}):null}function js({showField:t=!0,className:n,title:o="Description",hint:i,readOnly:r=!1,disabled:a,...s}){return t?jsxRuntime.jsx(P,{className:n,hint:i,title:"",...s,children:jsxRuntime.jsx(ii,{id:"description",name:"description",label:o,readOnly:r,disabled:a})}):null}function $s({showField:t,className:n,title:o="Technical Information",hint:i,fieldValue:r,readOnly:a=!1,disabled:s,...l}){const{config:c}=Ps(),u=t??c.errorMessage,d=r??c.errorMessage;return u&&d?jsxRuntime.jsx(P,{className:n,hint:i,...l,children:jsxRuntime.jsx(ii,{id:"errorMessage",name:"errorMessage",label:o,value:d,readOnly:a,disabled:s})}):null}function zs({showField:t,className:n,title:o="Environment Information",hint:i,fieldValue:r,readOnly:a=!1,disabled:s,...l}){const{config:c}=Ps(),u=t??c.showEnvironmentInfo,d=r??c.environmentInfo;return u&&d?jsxRuntime.jsx(P,{className:n,hint:i,...l,children:jsxRuntime.jsx(ii,{id:"environmentInfo",name:"environmentInfo",label:o,value:d,readOnly:a,disabled:s})}):null}function Ws({showField:t=!0,className:n,title:o="Attachments",hint:i,readOnly:r=!1,disabled:s,attachments:l,selectedCategories:c,...u}){const d=N("io-block-list-gap",n),{config:f}=Ps(),m=l??f.attachments,p=c??f.selectedCategories,h=React.useCallback(e=>!!p&&-1!==p.indexOf(e),[p]);return t?!m||m.length<=0?jsxRuntime.jsx(P,{title:"Attachments",children:jsxRuntime.jsx("p",{children:"No Attachments"})}):jsxRuntime.jsx(P,{className:d,title:o,hint:i,...u,children:jsxRuntime.jsx("div",{className:"file-attachments",children:m.map(t=>jsxRuntime.jsx(ri,{id:t.id,name:t.id,label:t.name,readOnly:r,disabled:s,defaultChecked:h(t.category)},t.id))})}):null}function Vs({showField:t=!0,className:n,title:o="Attachments",hint:i,readOnly:r=!1,disabled:s,categories:l,selectedCategories:c,...u}){const{config:d,attachmentCategories:f}=Ps(),m=l??f,p=c??d.selectedCategories,h=React.useCallback(e=>!!p&&-1!==p.indexOf(e),[p]);return t?!m||m.length<=0?jsxRuntime.jsx("p",{children:"No Attachments"}):jsxRuntime.jsx(P,{className:n,title:o,hint:i,...u,children:jsxRuntime.jsx("div",{className:"category-attachments",children:m.map(t=>jsxRuntime.jsx(fi,{id:t,name:t,align:"right",label:t,readOnly:r,disabled:s,defaultChecked:h(t)},t))})}):null}function Ys({className:n,title:o,hint:i,showField:r=!0,showJiraTicketField:a,jiraTicketLabel:s="Create Jira Ticket",showSendEmailField:l,sendEmailLabel:c="Send Email",readOnly:u=!1,disabled:d,...f}){const m=N("io-block-list-gap",n),{config:p,showMailingList:h,setShowMailingList:g}=Ps();if(!r)return null;const v=a??p.createJiraTicket,y=l??p.sendEmail;return jsxRuntime.jsxs(P,{className:m,hint:i,title:o,...f,children:[v&&jsxRuntime.jsx(fi,{id:"createJiraTicket",name:"createJiraTicket",label:s,align:"right",readOnly:u,disabled:d,defaultChecked:v}),y&&jsxRuntime.jsx(fi,{onChange:()=>{g(!h);},id:"sendEmail",name:"sendEmail",label:c,align:"right",readOnly:u,disabled:d,defaultChecked:y})]})}function Us({showField:t=!0,className:n,title:o="Email List",hint:i="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:a,disabled:s,...l}){const{config:c,showMailingList:u}=Ps(),d=t??c.sendEmail,f=a??!1===c.allowEditRecipients;return d&&u?jsxRuntime.jsx(P,{className:n,hint:i,...l,children:jsxRuntime.jsx(oi,{id:"mailingList",name:"mailingList",label:o,placeholder:r,readOnly:f,disabled:s,defaultValue:c.mailingList??""})}):null}const Ks={Header:As,Body:Ts,Footer:Os,HeaderButtons:Fs,FooterButtons:Ls,SubmitButton:Bs,CancelButton:Rs,CloseButton:_s,IntroField:Hs,DescriptionField:js,TechInfoField:$s,EnvInfoField:zs,FileAttachmentsField:Ws,CategoryAttachmentsField:Vs,SettingsField:Ys,MailListField:Us},Js=React.createContext(Ks),qs=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...Ks,...n}),[n]);return jsxRuntime.jsx(Js.Provider,{value:o,children:t})});function Gs(e){return {...React.useContext(Js),...e}}function Qs({className:n,...o}){const i=N("io-feedback",n),{Header:r,Body:a,Footer:s}=Gs();return jsxRuntime.jsxs(Zo,{className:i,...o,children:[jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{}),jsxRuntime.jsx(s,{})]})}qs.displayName="ComponentsStore";Object.freeze({__proto__:null,Body:Ts,CancelButton:Rs,CategoryAttachmentsField:Vs,CloseButton:_s,DescriptionField:js,EnvInfoField:zs,Feedback:function({components:t,...n}){return jsxRuntime.jsx(qs,{components:t,children:jsxRuntime.jsx(Qs,{...n})})},FeedbackProvider:({children:t})=>{const{config:n,onThemeChanged:o,openUrl:i,submit:r,setBounds:s,close:l,showMailingList:m,setShowMailingList:p,attachmentCategories:h,submitInProgress:g,setSubmitInProgress:v,submitStatus:y,setSubmitStatus:w,submitCompleted:b,setSubmitCompleted:C,jiraTicketURL:k,setJiraTicketURL:N,submitFeedback:S}=function(){const[e,t]=React.useState({env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"}),[n,o]=React.useState(!1),[i,r]=React.useState(!1),[s,l]=React.useState(!1),[u,m]=React.useState(""),[p,h]=React.useState([]),[g,v]=React.useState({type:"primary",title:"",text:""}),y=React.useRef();Is.init();const w=React.useCallback(e=>{const t=document.documentElement;return t.className="",t.classList.add(e),()=>{t.classList.remove(e);}},[]),b=React.useCallback(e=>{const t=new Set;e.filter(e=>{const n=t.has(e.category);return t.add(e.category),!n}),h(Array.from(t));},[]);React.useEffect(()=>{Is.getConfig().then(e=>{t(e),b(e.attachments),e.theme?w(e.theme):w("dark");}).catch(e=>{throw new Error("Failed to get Feedback Config:",e)}),Is.onThemeChanged(e=>{w(e);});},[b,w]),React.useEffect(()=>{o(e.sendEmail);},[e.sendEmail]),React.useEffect(()=>(i&&"Outlook"===e.sendEmailClient&&(y.current=setTimeout(()=>{v({title:"Sending an email. Go to Outlook to allow access.",type:"primary"});},100)),()=>clearTimeout(y.current)),[i,e.sendEmailClient]);const C=React.useCallback(e=>Is.onThemeChanged(e),[]),k=React.useCallback(e=>{e.jiraProcessed&&(v({title:e.jiraDetails,type:"success"}),m(e.jiraTicketUrl)),e.emailProcessed&&v({title:e.emailDetails,type:"success"});},[]),N=React.useCallback(async t=>{const n={createJiraTicket:e.createJiraTicket,sendEmail:e.sendEmail,mailingList:e.mailingList,attachments:e.attachments,attachmentsViewMode:e.attachmentsViewMode,...t};if(!n.createJiraTicket&&!n.sendEmail){const e="Can't send feedback. Feedback via Jira and email has been disabled.";throw v({title:e,type:"error"}),new Error(e)}if(n.sendEmail&&!n.mailingList){const e="No email recipient. Provide at least one valid email address in the Email List field.";throw v({title:e,type:"error"}),new Error(e)}n.createJiraTicket&&n.sendEmail&&(v({title:"Submitting an issue to Jira and sending an email...",type:"primary"}),r(!0)),n.createJiraTicket?(v({title:"Submitting an issue to Jira...",type:"primary"}),r(!0)):(v({title:"Sending an email...",type:"primary"}),r(!0));try{const e=await Is.submitReport(t);return k(e),r(!1),l(!0),clearTimeout(y.current),e}catch(e){throw console.log("An error occurred while submitting your feedback:",e),e}},[e.attachments,e.attachmentsViewMode,e.createJiraTicket,e.mailingList,e.sendEmail,k]),S=React.useCallback(e=>{Is.openUrl(e);},[]),D=React.useCallback(e=>{Is.closeReport(e);},[]),x=React.useCallback((e,t,n,o)=>{Is.setBounds(e,t,n,o);},[]),E=React.useCallback(t=>{t.preventDefault();const n=new FormData(t.currentTarget),o=[],i=[...e.attachments];if("file"===e.attachmentsViewMode)i.filter(e=>"on"===n.get(e.id)).map(e=>o.push(e.id));else {const e=p?.filter(e=>"on"===n.get(e)),t=i.reduce((t,n)=>(-1!==e.indexOf(n.category)&&t.push(n.id),t),[]);o.push(...t);}const r={createJiraTicket:"on"===n.get("createJiraTicket"),sendEmail:"on"===n.get("sendEmail"),description:n.get("description"),mailingList:n.get("mailingList"),attachments:o,attachmentsViewMode:e.attachmentsViewMode};return N(r)},[p,e.attachments,e.attachmentsViewMode,N]);return {config:e,onThemeChanged:C,openUrl:S,submit:N,setBounds:x,close:D,showMailingList:n,setShowMailingList:o,attachmentCategories:p,submitInProgress:i,setSubmitInProgress:r,submitStatus:g,setSubmitStatus:v,submitCompleted:s,setSubmitCompleted:l,jiraTicketURL:u,setJiraTicketURL:m,submitFeedback:E}}(),D=React.useMemo(()=>({config:n,onThemeChanged:o,openUrl:i,submit:r,setBounds:s,close:l,showMailingList:m,setShowMailingList:p,attachmentCategories:h,submitInProgress:g,setSubmitInProgress:v,submitStatus:y,setSubmitStatus:w,submitCompleted:b,setSubmitCompleted:C,jiraTicketURL:k,setJiraTicketURL:N,submitFeedback:S}),[n,o,i,r,s,l,m,h,g,y,b,k,S,N,v,w,C,p]);return jsxRuntime.jsx(Ms.Provider,{value:D,children:t})},FileAttachmentsField:Ws,Footer:Os,FooterButtons:Ls,Header:As,HeaderButtons:Fs,IntroField:Hs,MailListField:Us,SettingsField:Ys,SubmitButton:Bs,TechInfoField:$s,useFeedbackContext:Ps});function Zs({className:n,title:o="General",...i}){const r=N("io-notifications-settings-panel-general",n),{AllowNotifications:a,AllowNotificationToasts:s,ShowNotificationBadge:l,CloseNotificationOnClick:c,PanelAutoHide:u,HideToastsAfter:d}=Bl(),f=bi();return jsxRuntime.jsx("div",{className:r,...i,children:jsxRuntime.jsxs(P,{title:o,children:[f&&jsxRuntime.jsx(a,{}),f&&jsxRuntime.jsx(s,{}),jsxRuntime.jsx(l,{}),f&&jsxRuntime.jsx(u,{}),f&&jsxRuntime.jsx(c,{}),f&&jsxRuntime.jsx(d,{})]})})}var el=new class{subscribed=!1;io=void 0;registry=Es();logger=void 0;isPanelVisible=void 0;notifications=[];bulkActionsSupported=!1;init(e){if(this.subscribed)return;this.subscribed=!0,this.io=e,this.logger=this.io.logger.subLogger("notifications");const t=this.io.appManager.myApplication,n=t?.userProperties?.logger?.publishLevel??"error",o=t?.userProperties?.logger?.consoleLevel??"info";this.logger.publishLevel(n),this.logger.consoleLevel(o),this.logger.info("===== IO Notifications v.0.8.2 ====="),this.getBulkActionsSupport(),this.subscribe();}onPanelVisibilityChanged(e){return this.registry.add("on-panel-visibility-changed",e)}onConfigurationChanged(e){return this.registry.add("on-configuration-changed",e)}onNotificationsChanged(e){return this.registry.add("on-notifications-changed",e)}onCounterChanged(e){return this.registry.add("on-counter-changed",e)}async getNotificationsList(){const e=await(this.io?.notifications.list());if(!e)throw new Error("io.notifications.list is not supported in this environment.");return e.map(e=>this.attachHandlers(e))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){if(this.isDesktopEnvironment())return this.io?.notifications.panel.show()}hidePanel(){if(this.isDesktopEnvironment())return this.io?.notifications.panel.hide()}clearAll(){return this.logger?.trace("clearing all notifications"),this.io?.notifications.clearAll()}clearAllOld(){return this.logger?.trace("clearing all old notifications"),this.io?.notifications.clearOld()}clearMany(e){return "function"==typeof(this.io?.notifications).clearMany?e.length<1?(this.logger?.trace("no ids provided to clear notifications"),Promise.resolve()):(this.logger?.trace(`clearing notifications with ids ${JSON.stringify(e.join(", "))}`),(this.io?.notifications).clearMany(e)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(e){return this.logger?.trace(`closing notification with id ${e}`),this.io?.notifications.clear(e)}snooze(e,t){return this.logger?.trace(`snoozing notification with id ${e} for ${t}ms`),this.io?.notifications.snooze(e,t)}snoozeMany(e,t){return "function"==typeof(this.io?.notifications).snoozeMany?e.length<1?(this.logger?.trace("no ids provided to snooze notifications"),Promise.resolve()):(this.logger?.trace(`snoozing notifications with ids ${JSON.stringify(e.join(", "))} for ${t}ms`),(this.io?.notifications).snoozeMany(e,t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(e,t){return this.logger?.trace(`setting state of ${e} to ${t}`),this.io?.notifications.setState(e,t)}setStates(e,t){return "function"==typeof(this.io?.notifications).setStates?e.length<1?(this.logger?.trace(`no ids provided to change state to ${t} for notifications`),Promise.resolve()):(this.logger?.trace(`setting state of ${JSON.stringify(e.join(", "))} to ${t}`),(this.io?.notifications).setStates(e,t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){const e="function"==typeof(this.io?.notifications).clearMany&&"function"==typeof(this.io?.notifications).setStates&&"function"==typeof(this.io?.notifications).snoozeMany;this.bulkActionsSupported=e;}setFilter(e){return this.logger?.trace(`setting filter to ${JSON.stringify(e)}`),this.io?.notifications.setFilter(e)}configure(e){return this.io?.notifications.configure(e)}subscribe(){this.io?.notifications.onRaised(e=>{this.logger?.trace(`received event indicating notification raise: ${JSON.stringify(e)}`),this.attachHandlers(e),this.notifications.unshift(e),this.registry.execute("on-notifications-changed",[...this.notifications]);}),this.io?.notifications.onStateChanged(({id:e},t)=>{this.logger?.trace(`received event for notification state is changed - "${e}" - "${t?.toString()}"`),this.notifications=this.notifications.map(n=>n.id===e?(this.logger?.trace(`${n.id} - the state is changed from "${n.state}" to "${t?.toString()}"`),Object.assign(n,{state:t})):n),this.registry.execute("on-notifications-changed",this.notifications);}),this.io?.notifications&&"onDataChanged"in this.io.notifications&&"function"==typeof this.io.notifications.onDataChanged&&this.io?.notifications.onDataChanged((e,t)=>{const n=e.id;this.logger?.trace(`received event for notification data is changed - "${n}" - "${JSON.stringify(t)}"`),this.notifications=this.notifications.map(e=>e.id===n?(this.logger?.trace(`${e.id} - the data is changed from "${JSON.stringify(e.data)}" to "${JSON.stringify(t)}"`),Object.assign(e,{data:t})):e),this.registry.execute("on-notifications-changed",this.notifications);}),this.io?.notifications.onClosed(({id:e})=>{this.logger?.trace(`received event for notification is closed - "${e}".`),this.notifications=this.notifications.filter(t=>t.id!==e),this.registry.execute("on-notifications-changed",this.notifications);}),this.io?.notifications.onConfigurationChanged(e=>{this.logger?.trace(`received event for configuration changed - ${JSON.stringify(e)}.`),this.registry.execute("on-configuration-changed",e);}),this.isDesktopEnvironment()&&this.io?.notifications.panel.onVisibilityChanged(e=>{this.logger?.trace(`received event for panel visibility changed to "${e}".`),this.isPanelVisible=e,this.registry.execute("on-panel-visibility-changed",e);});}isDesktopEnvironment(){return "object"==typeof window&&(Boolean(window.iodesktop)||Boolean(window.glue42gd))}attachHandlers(e){e.actions?.forEach(t=>{Object.assign(t,{onClick:async n=>{try{this.logger?.info(`${e.id}/${t.action} - was clicked.`),await(this.io?.notifications.click(e.id,t.action,n));}catch(e){this.logger?.error("Error while clicking on action:",e);}}});});const t={snooze:async(t=1e4)=>{this.logger?.trace(`${e.id} - request to change the state from ${e.state} to Snoozed with duration ${t}ms`),await(this.io?.notifications.snooze(e.id,t));},updateState:async t=>(this.logger?.trace(`${e.id} - request to change the state from ${e.state} to ${t}`),this.io?.notifications.setState(e.id,t)),updateData:async t=>{this.logger?.trace(`${e.id} - request to change the data to ${JSON.stringify(t)}`),this.io?.notifications&&"updateData"in this.io.notifications&&"function"==typeof this.io.notifications.updateData?await this.io.notifications.updateData(e.id,t):console.log("'updateData' method is not supported");},onClick:async t=>{try{this.logger?.info(`${e.id} - was clicked.`),await(this.io?.notifications.click(e.id,void 0,t));}catch(t){this.logger?.error(`Error while clicking on Notification: ${e.id}`,t);}},onShow:()=>{},close:async()=>(this.logger?.info(`${e.id} - was closed.`),this.close(e.id))};return Object.assign(e,t)}};function tl(e){const t=React.useContext(reactHooks.IOConnectContext),n=t?.appManager,o=bi(),[i,r]=React.useState([]),[s,d]=React.useState(0),m="Platform",p=React.useCallback((e="asc")=>{if(null===o)return [];const t=[...i].sort((t,n)=>{const o=(t.title??t.name).toLowerCase(),i=(n.title??n.name).toLowerCase();return "asc"===e?o.localeCompare(i):i.localeCompare(o)});if(!o){const e=t.findIndex(e=>e.name===m);if(-1!==e){const[n]=t.splice(e,1);t.unshift(n);}}return t},[i,o]),h=React.useMemo(()=>p("asc"),[p]),g=React.useMemo(()=>p("desc"),[p]);React.useEffect(()=>{if(null===o||o)return;const e={title:"System",name:m,hidden:!1,userProperties:{hidden:!1}};r(t=>t.some(t=>t.name===e.name)?t:[...t,e]);},[o]),React.useEffect(()=>{if(!n)return;const e=n.onAppAdded(e=>{r(t=>[...t,{title:e.title,name:e.name,hidden:e.hidden,userProperties:e.userProperties}]);}),t=n.onAppRemoved(e=>{r(t=>t.filter(t=>t.name!==e.name));}),o=n.onAppChanged(e=>{r(t=>{const n=t.find(t=>t.name===e.name);return [...t.filter(t=>t.name!==e.name),{title:e.title,name:n?.name,hidden:n?.hidden,allowed:n?.allowed,userProperties:n?.userProperties}]});});return ()=>{e(),t(),o();}},[n]);return {apps:React.useMemo(()=>{if(!e?.sourceFilter||!Array.isArray(i))return i;const{allowed:t=[],blocked:n=[]}=e.sourceFilter,o=t.includes("*"),r=n.includes("*");let a=0;const s=i.map(e=>{const n=o||t.includes(e.name),i=!r&&n;return i&&a++,{...e,allowed:i}});return d(a),s},[e,i]),allowedApps:s,sortedAppsAsc:h,sortedAppsDesc:g,sortAppsAlphabetically:p}}function nl(e,t,n){const o=React.useMemo(()=>{if(!t.toastStacking)return [];const o="application"===(i=t.stackBy)?"source":"severity"===i?"severity":"source";var i;const r=e.filter(e=>"Active"===e.state),a=new Map;for(const e of r){const t=e[o]??"";if(e.source&&n?.sourceFilter?.muted?.includes(e.source)||n?.sourceFilter?.muted?.includes("*"))continue;a.has(t)||a.set(t,{key:t,items:[]});const i=a.get(t);i&&i.items.unshift(e);}return Array.from(a.values()).filter(e=>e.items.some(e=>"Active"===e.state||"Stale"===e.state))},[e,t.toastStacking,t.stackBy,n?.sourceFilter?.muted]);return {notificationStacks:o}}function ol(e){const[t,n]=React.useState([]);return {selectedNotifications:t,selectNotification:(e,o)=>{const i=t;n(o?[...i,e]:i.filter(t=>t!==e));},selectAllNotifications:(t,o)=>{if(o){let o=[];switch(t){case"read":o=e.filter(e=>"Acknowledged"===e.state||"Seen"===e.state).map(e=>e.id);break;case"unread":o=e.filter(e=>"Active"===e.state||"Stale"===e.state).map(e=>e.id);break;case"snoozed":o=e.filter(e=>"Snoozed"===e.state).map(e=>e.id);break;default:o=e.map(e=>e.id);}n(o);}else n([]);}}}const il=e=>({enabledNotifications:e.enable,enabledToasts:e.enableToasts,toastStacking:"stacked"===e.toasts?.mode,stackBy:e.toasts?.stackBy,toastExpiry:e.toastExpiry,showNotificationBadge:e.showNotificationBadge,placement:e.placement,snooze:e.snooze,closeNotificationOnClick:e.closeNotificationOnClick,autoHidePanel:e.autoHidePanel}),rl=e=>Array.from(e.reduce((e,t)=>e.set(t.id,t),new Map).values());function al(){const e=React.useContext(reactHooks.IOConnectContext),[t,n]=React.useState({}),[o,i]=React.useState({}),[r,a]=React.useState([]),[s,u]=React.useState(0),[d,m]=React.useState(!0),{apps:p,allowedApps:h}=tl(t),{notificationStacks:g}=nl(r,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:t.sourceFilter}),{selectedNotifications:v,selectNotification:y,selectAllNotifications:b}=ol(r);el.init(e),React.useEffect(()=>{(async()=>{await(async()=>{try{const e=await el.getConfiguration();n(e),i(t=>({...t,...il(e)}));}catch(e){console.error("Error fetching configuration:",e);}})(),await(async()=>{try{const e=await el.getNotificationsList();a(rl(e));}catch(e){console.error("Error fetching notifications:",e);}})();})().catch(e=>{console.error("Error in useNotifications fetch:",e);}),C();},[]),React.useEffect(()=>{const e=el.onNotificationsChanged(e=>{a(rl(e));}),t=el.onConfigurationChanged(e=>{const t=il(e);n(t=>({...t,...e})),i(e=>({...e,...t}));}),o=el.onCounterChanged(e=>{u(e);});return ()=>{e(),t(),o();}},[]);const C=()=>{m(el.bulkActionsSupported);},k=async e=>{await el.setFilter(e);};return {close:e=>el.close(e),clearAll:()=>el.clearAll(),settings:o,hidePanel:async()=>{await el.hidePanel();},showPanel:async()=>{await el.showPanel();},saveFilter:k,clearAllOld:()=>el.clearAllOld(),saveSetting:async e=>{const n=((e,t)=>{const n=(e=>({enabledNotifications:e=>({enable:e}),enabledToasts:e=>({enableToasts:e}),toastStacking:t=>({toasts:{mode:t?"stacked":"single",stackBy:e.toasts?.stackBy}}),stackBy:t=>({toasts:{mode:e.toasts?.mode,stackBy:t}}),showNotificationBadge:e=>({showNotificationBadge:e}),toastExpiry:e=>({toastExpiry:e}),placement:e=>({placement:e}),snooze:e=>({snooze:e}),closeNotificationOnClick:e=>({closeNotificationOnClick:e}),autoHidePanel:e=>({autoHidePanel:e})}))(t),o=Object.keys(e)[0],i=e[o];return o&&void 0!==i&&n[o]?n[o](i):{}})(e,t);n&&await el.configure(n);},allApps:p,saveAllFilter:async e=>{"subscribe"in e?await k({allowed:e.subscribe?["*"]:[],blocked:e.subscribe?[]:["*"]}):"mute"in e&&await k({muted:e.mute?["*"]:[]});},configuration:t,notifications:r,notificationStacks:g,notificationsCount:s,allApplications:t.allApplications??0,allowedApplications:h,isBulkActionsSupported:d,selectedNotifications:v,selectNotification:y,selectAllNotifications:b,clearMany:async e=>{await el.clearMany(e);},snooze:async(e,t)=>{await el.snooze(e,t);},snoozeMany:async(e,t)=>{await el.snoozeMany(e,t);},setState:async(e,t)=>{await el.setState(e,t);},setStates:async(e,t)=>{await el.setStates(e,t);},setCount:e=>{u(e);},getNotificationsList:async()=>await el.getNotificationsList()}}const sl=React.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),ll=()=>React.useContext(sl);function cl({label:t="Allow notifications",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=React.useCallback(e=>{r({enabledNotifications:e.target.checked});},[r]);return s?jsxRuntime.jsx(fi,{label:t,align:n,onChange:l,checked:i.enabledNotifications??!1,...o}):null}function ul({label:t="Allow notification toasts",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=s&&!i.enabledNotifications,c=React.useCallback(e=>{r({enabledToasts:e.target.checked});},[r]);return s?jsxRuntime.jsx(fi,{label:t,align:n,onChange:c,checked:i.enabledToasts??!1,disabled:l,...o}):null}function dl({label:t="Show notification badge",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi()&&!i.enabledNotifications,l=React.useCallback(e=>{r({showNotificationBadge:e.target.checked});},[r]);return jsxRuntime.jsx(fi,{label:t,align:n,onChange:l,checked:i.showNotificationBadge??!1,disabled:s,...o})}function fl({label:t="Close notification on click",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=s&&!i.enabledNotifications,c=React.useCallback(e=>{r({closeNotificationOnClick:e.target.checked});},[r]);return s?jsxRuntime.jsx(fi,{label:t,align:n,onChange:c,checked:i.closeNotificationOnClick??!1,disabled:l,...o}):null}function ml({label:t="Auto hide panel",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=React.useCallback(e=>{r({autoHidePanel:e.target.checked});},[r]);return s?jsxRuntime.jsx(fi,{label:t,align:n,onChange:l,checked:i.autoHidePanel??!1,...o}):null}const pl=(e,t)=>e?`${e} ${t}${1!==e?"s":""}`:"",hl=e=>{const t=Math.floor(e/60),n=e%60,o=pl(t,"minute"),i=pl(n,"second");return o+(o&&i?" ":"")+i};function gl({className:n,title:o="Hide toasts after",items:i=[15,30,45,60],...r}){const s=N("flex","jc-between","ai-center",n),{settings:l,saveSetting:c}=ll(),u=bi(),d=u&&!l.enabledNotifications,f=React.useCallback((e=15e3)=>{l.toastExpiry!==e&&c({toastExpiry:1e3*e});},[l.toastExpiry,c]);return u?jsxRuntime.jsxs("div",{className:s,...r,children:[jsxRuntime.jsx("div",{className:"io-text-clipper "+(d?"io-text-disabled":""),children:jsxRuntime.jsx("span",{children:o})}),jsxRuntime.jsxs(X,{variant:"light",disabled:d,children:[jsxRuntime.jsx(X.Button,{text:hl((l.toastExpiry??0)/1e3)}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{variant:"single",children:i.map(t=>jsxRuntime.jsx(X.Item,{onClick:()=>{f(t);},children:hl(t)},t))})})]})]}):null}function vl({className:n,title:o="Stacking",...i}){const r=N("io-notifications-settings-panel-stacking",n),{ToastStacking:a,ToastStackBy:s}=Bl();return bi()?jsxRuntime.jsx("div",{className:r,...i,children:jsxRuntime.jsxs(P,{title:o,children:[jsxRuntime.jsx(a,{}),jsxRuntime.jsx(s,{})]})}):null}function yl({label:t="Allow toast stacking",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=s&&!i.enabledNotifications,c=React.useCallback(e=>{r({toastStacking:e.target.checked});},[r]);return s?jsxRuntime.jsx(fi,{label:t,align:n,onChange:c,checked:i.toastStacking??!1,disabled:l,...o}):null}const wl={application:"Application",severity:"Priority"},bl=Object.fromEntries(Object.entries(wl).map(([e,t])=>[t,e]));function Cl({className:n,title:o="Group by",...i}){const r=N("flex","jc-between","ai-center",n),{settings:s,saveSetting:l}=ll(),c=bi(),u=c&&!s.enabledNotifications,d=React.useCallback((e="severity")=>{s.stackBy!==e&&l({stackBy:e.toLowerCase()});},[s.stackBy,l]);if(!c)return null;const f=Object.values(wl);return jsxRuntime.jsxs("div",{className:r,...i,children:[jsxRuntime.jsx("div",{className:N("io-text-clipper",{"io-text-disabled":u}),children:jsxRuntime.jsx("span",{children:o})}),jsxRuntime.jsxs(X,{variant:"light",disabled:u,children:[jsxRuntime.jsx(X.Button,{text:wl[s.stackBy??"severity"]}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{variant:"single",children:f.map(t=>jsxRuntime.jsx(X.Item,{onClick:()=>{const e=bl[t];d(e);},children:t},t))})})]})]})}function kl({className:n,title:o="Placement",...i}){const r=N("io-notifications-settings-panel-placement",n),{PlacementPanel:a,PlacementToasts:s}=Bl();return bi()?jsxRuntime.jsx("div",{className:r,...i,children:jsxRuntime.jsxs(P,{title:o,children:[jsxRuntime.jsx(a,{}),jsxRuntime.jsx(s,{})]})}):null}const Nl=e=>e.replace(/(^|-)\w/g,e=>e.toUpperCase().replace("-"," "));function Sl({className:n,title:o="Panel position",...i}){const r=N("flex","jc-between","ai-center",n),{settings:s,saveSetting:l}=ll(),c=bi(),u=React.useCallback(e=>{e||(e="right"),s.placement?.panel!==e&&l({placement:{...s.placement,panel:e.toLowerCase()}});},[s.placement,l]);if(!c)return null;return jsxRuntime.jsxs("div",{className:r,...i,children:[jsxRuntime.jsx("div",{className:"io-text-clipper",children:jsxRuntime.jsx("span",{children:o})}),jsxRuntime.jsxs(X,{variant:"light",children:[jsxRuntime.jsx(X.Button,{text:s.placement?.panel?Nl(s.placement?.panel):"Right"}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{variant:"single",children:["Right","Left"].map(t=>jsxRuntime.jsx(X.Item,{onClick:()=>{u(t);},children:t},t))})})]})]})}function Dl({className:n,title:o="Toasts position",...i}){const r=N("flex","jc-between","ai-center",n),{settings:s,saveSetting:l}=ll(),c=bi(),u=React.useCallback(e=>{if(e||(e="bottom-right"),s.placement?.toasts===e)return;const t=e.replace(/\s+/g,"-").toLowerCase();l({placement:{...s.placement,toasts:t}});},[s.placement,l]);if(!c)return null;return jsxRuntime.jsxs("div",{className:r,...i,children:[jsxRuntime.jsx("div",{className:"io-text-clipper",children:jsxRuntime.jsx("span",{children:o})}),jsxRuntime.jsxs(X,{variant:"light",children:[jsxRuntime.jsx(X.Button,{text:s.placement?.toasts?Nl(s.placement?.toasts):"Bottom Right"}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(t=>jsxRuntime.jsx(X.Item,{onClick:()=>{u(t);},children:t},t))})})]})]})}function xl({className:t,title:n="Snooze",...o}){const i=N("io-notifications-settings-panel-snooze",t),{SnoozeDuration:r}=Bl(),{settings:a}=ll();return bi()&&a.snooze?.enabled?jsxRuntime.jsx("div",{className:i,...o,children:jsxRuntime.jsx(P,{title:n,children:jsxRuntime.jsx(r,{})})}):null}function El({className:n,title:o="Default duration",items:i=[60,120,180,300],...r}){const s=N("flex","jc-between","ai-center",n),{settings:l,saveSetting:c}=ll(),u=bi(),d=u&&!l.enabledNotifications,f=React.useCallback((e=6e4)=>{l.snooze&&l.snooze?.duration!==e&&c({snooze:{...l.snooze,duration:1e3*e}});},[l.snooze,c]);return u&&l.snooze?.enabled?jsxRuntime.jsxs("div",{className:s,...r,children:[jsxRuntime.jsx("div",{className:N("io-text-clipper",{"io-text-disabled":d}),children:jsxRuntime.jsx("span",{children:o})}),jsxRuntime.jsxs(X,{variant:"light",disabled:d,children:[jsxRuntime.jsx(X.Button,{text:hl((l.snooze?.duration??0)/1e3)}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{variant:"single",children:i.map(t=>jsxRuntime.jsx(X.Item,{onClick:()=>{f(t);},children:hl(t)},t))})})]})]}):null}function Il({className:n,title:o,...i}){const r=N("io-notifications-settings-panel-subscriptions",n),{SubscribeAll:a,SubscribeApp:s,SubscribeMuteAll:l,SubscribeMuteApp:c}=Bl(),{sortAppsAlphabetically:u}=tl(),d=bi(),f=u(),m="io-notifications-subscriptions-grid "+(d?"with-three-columns":"with-two-columns");return jsxRuntime.jsx("div",{className:r,...i,children:jsxRuntime.jsxs(P,{title:o??(d?"Subscribe & Mute":"Subscribe"),children:[jsxRuntime.jsxs("div",{className:m,children:[jsxRuntime.jsx("p",{className:"io-text-section",children:"Sources"}),jsxRuntime.jsx("p",{className:"io-text-section",children:"Subscribe"}),d&&jsxRuntime.jsx("p",{className:"io-text-section",children:"Mute"})]}),jsxRuntime.jsxs("div",{className:m,children:[jsxRuntime.jsx("p",{children:"All Sources"}),jsxRuntime.jsx(a,{label:""}),d&&jsxRuntime.jsx(l,{label:""})]}),f.map(n=>!n||n.hidden||n?.userProperties?.hidden?null:jsxRuntime.jsxs("div",{className:m,children:[jsxRuntime.jsx("p",{children:n.title??n.name}),jsxRuntime.jsx(s,{app:n,label:""}),d&&jsxRuntime.jsx(c,{app:n,label:""})]},n.name))]})})}function Ml({label:t="All apps",align:n="right",...o}){const{settings:i,configuration:r,saveAllFilter:s}=ll(),l=bi()&&!i.enabledNotifications,c=React.useCallback(e=>{s({subscribe:e.target.checked});},[s]);return jsxRuntime.jsx(fi,{align:n,label:t,onChange:c,checked:(r.sourceFilter?.allowed?.includes("*")&&0===r.sourceFilter?.blocked?.length)??!1,disabled:l,...o})}function Pl({label:t="App",align:n="right",app:o,...i}){const{allApps:r,settings:s,configuration:l,saveFilter:c}=ll(),u=bi()&&!s.enabledNotifications,d=React.useCallback((e,t)=>{const n={...l.sourceFilter},o=n.allowed?.indexOf("*");"number"==typeof o&&o>-1&&(n.allowed?.splice(o,1),r.forEach(e=>{e.name!==t.name&&n.allowed?.push(e.name);})),e?(n.allowed=[...new Set([...n.allowed??[],t.name])],n.blocked=n.blocked?.filter(e=>e!==t.name)):(n.allowed=n.allowed?.filter(e=>e!==t.name),n.blocked=[...new Set([...n.blocked??[],t.name])]),n.allowed?.length&&n.blocked?.includes("*")&&n.blocked.splice(n.blocked.indexOf("*"),1),c(n);},[r,l.sourceFilter,c]);return jsxRuntime.jsx(fi,{id:o.name,label:t,align:n,onChange:e=>d(e.target.checked,o),checked:(l.sourceFilter?.allowed?.includes("*")&&!l.sourceFilter?.blocked?.includes(o.name)||l.sourceFilter?.allowed?.includes(o.name))??!1,disabled:u,...i})}function Al({label:t="Mute all",align:n="right",...o}){const{settings:i,configuration:r,saveAllFilter:s}=ll(),l=bi(),c=l&&(!i.enabledNotifications||-1===r.sourceFilter?.allowed?.indexOf("*")),u=React.useCallback(e=>{s({mute:e.target.checked});},[s]);return l?jsxRuntime.jsx(fi,{align:n,label:t,onChange:u,checked:r.sourceFilter?.muted?.includes("*")??!1,disabled:c??!1,...o}):null}function Tl({label:t="App",align:n="right",app:o,...i}){const{allApps:r,settings:s,configuration:l,saveFilter:c}=ll(),u=bi(),d=u&&(!s.enabledNotifications||l.sourceFilter?.blocked?.includes("*")||l.sourceFilter?.blocked?.includes(o.name)||0===l.sourceFilter?.allowed?.length||-1===l.sourceFilter?.allowed?.indexOf(o.name)&&-1===l.sourceFilter?.allowed?.indexOf("*")&&0===l.sourceFilter?.blocked?.length),f=React.useCallback((e,t)=>{const n={...l.sourceFilter},o=n?.muted?.indexOf("*");"number"==typeof o&&o>-1&&(n.muted?.splice(o,1),r.forEach(e=>{e.name===t.name||e.hidden||n.muted?.push(e.name);})),e?n.muted?.push(t.name):n.muted=n.muted?.filter(e=>e!==t.name),c(n);},[r,l.sourceFilter,c]);return !u||o.hidden?null:jsxRuntime.jsx(fi,{id:o.name,label:t,align:n,onChange:e=>f(e.target.checked,o),checked:(l.sourceFilter?.muted?.includes("*")||l.sourceFilter?.muted?.includes(o.name))??!1,disabled:d??!1,...i})}const Ol={Body:n=>{const{General:o,Placement:i,Stacking:r,Snooze:a,Subscriptions:s}=Bl();return jsxRuntime.jsxs(Qo,{...n,children:[jsxRuntime.jsx(o,{}),jsxRuntime.jsx(r,{}),jsxRuntime.jsx(i,{}),jsxRuntime.jsx(a,{}),jsxRuntime.jsx(s,{})]})},General:Zs,AllowNotifications:cl,AllowNotificationToasts:ul,ShowNotificationBadge:dl,CloseNotificationOnClick:fl,PanelAutoHide:ml,HideToastsAfter:gl,Stacking:vl,ToastStacking:yl,ToastStackBy:Cl,Placement:kl,PlacementPanel:Sl,PlacementToasts:Dl,Snooze:xl,SnoozeDuration:El,Subscriptions:Il,SubscribeAll:Ml,SubscribeApp:Pl,SubscribeMuteAll:Al,SubscribeMuteApp:Tl},Fl=React.createContext(Ol),Ll=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...Ol,...n}),[n]);return jsxRuntime.jsx(Fl.Provider,{value:o,children:t})});Ll.displayName="NotificationsSettingsPanelComponentsStoreProvider";const Bl=()=>React.useContext(Fl),Rl=({className:n,onClose:o,title:i="Notification Settings",...r})=>{const{Body:a}=Bl();return jsxRuntime.jsxs(Zo,{className:N("io-notifications-settings-panel",n),"data-testid":"notifications-settings-panel",...r,children:[jsxRuntime.jsxs(Zo.Header,{children:[jsxRuntime.jsx(Zo.Header.Title,{size:"large",text:i,tag:"h1"}),jsxRuntime.jsx(Zo.Header.ButtonGroup,{children:jsxRuntime.jsx(Zo.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:o})})]}),jsxRuntime.jsx(a,{})]})},_l=({components:t,...n})=>jsxRuntime.jsx(Ll,{components:t,children:jsxRuntime.jsx(Rl,{...n})});function Hl({isOpen:t,onClose:n,container:o}){return t?ReactDOM.createPortal(jsxRuntime.jsx(_l,{onClose:n}),o??document.querySelector("#root")??document.body):null}const jl=React.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),$l=()=>React.useContext(jl);function zl({title:n,onClose:o,onOpenSettings:i,...r}){const{HeaderCaptionTitle:a,HeaderCaptionCount:s,HeaderCaptionButtonSettings:l,HeaderCaptionButtonClose:c,HeaderActions:u,HeaderBulkActions:d,HeaderSearch:f}=Oc(),{isBulkActionsSupported:m,notificationsCount:p}=ll(),{isBulkActionsVisible:h}=$l(),g=bi();return jsxRuntime.jsxs(Go,{...r,children:[jsxRuntime.jsxs("div",{className:"io-panel-header-caption",children:[jsxRuntime.jsx(a,{title:n}),jsxRuntime.jsx(s,{}),jsxRuntime.jsxs(Go.ButtonGroup,{children:[g&&jsxRuntime.jsx(l,{onClick:i}),jsxRuntime.jsx(c,{onClick:o})]})]}),jsxRuntime.jsx(f,{}),m?jsxRuntime.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&p>0?"io-panel-header-bulk-actions-opened":""} `,children:[jsxRuntime.jsx(u,{}),jsxRuntime.jsx(d,{})]}):jsxRuntime.jsx(u,{})]})}function Wl({text:n="Notifications",counter:o,...i}){const{notificationsCount:r}=ll();return jsxRuntime.jsx(M,{text:n,size:"large",...i,children:(o??!0)&&jsxRuntime.jsxs("span",{children:["(",r,")"]})})}const Vl="newest",Yl="oldest",Ul="severity",Kl=["None","Low","Medium","High","Critical"],Jl={key:Vl,descending:!0},ql=e=>[...e].sort((e,t)=>(t.timestamp||0)-(e.timestamp||0)),Gl=e=>[...e].sort((e,t)=>(e.timestamp||0)-(t.timestamp||0)),Ql=(e,t)=>{const n=Kl[0];return [...e].sort((e,o)=>{const i=Kl.indexOf(e.severity||n),r=Kl.indexOf(o.severity||n);return (t?-1:1)*(i-r)})},Xl={[Vl]:ql,[Yl]:Gl,[Ul]:Ql},Zl={severity:"Priority",newest:"Newest",oldest:"Oldest"};function ec({...t}){const[n,o]=React.useState([]),{NotificationsList:i,Notification:r}=Oc(),{notifications:a,setCount:s,notificationsCount:l}=ll(),{sortNotificationsBy:m,viewNotificationsBy:p,searchQuery:h}=$l(),g=React.useRef(null),v=hi(h),y=React.useMemo(()=>{const e=((e,t)=>{if(!e)return [];switch(t){case"all":default:return e;case"unread":return e.filter(e=>"Active"===e.state||"Stale"===e.state);case"read":return e.filter(e=>"Acknowledged"===e.state||"Seen"===e.state);case"snoozed":return e.filter(e=>"Snoozed"===e.state)}})(a,p);return e.filter(e=>e.title.toLowerCase().includes(v.toLowerCase())||e.source?.toLowerCase().includes(v.toLowerCase())||e.body?.toLowerCase().includes(v.toLowerCase()))},[v,a,p]);return React.useEffect(()=>{switch(m){case"newest":o(ql(y));break;case"oldest":o(Gl(y));break;case"severity":o(Ql(y,!0));break;default:o(y);}s(y.length);},[y,m,s]),React.useEffect(()=>{g.current&&g.current?.scrollTo({top:0,behavior:"smooth"});},[v,l,m,p]),jsxRuntime.jsx(Qo,{ref:g,...t,children:jsxRuntime.jsx(i,{notifications:n,Notification:r})})}function tc({...t}){const{FooterButtons:n}=Oc();return jsxRuntime.jsx(Xo,{...t,children:jsxRuntime.jsx(n,{})})}function nc({className:n,...o}){const{FooterButtonClearAll:i,FooterButtonClearAllOld:r}=Oc(),{notifications:a}=ll(),[s,l]=React.useState(!1);return React.useEffect(()=>{a.filter(e=>"Stale"===e.state||"Acknowledged"===e.state).length>0?l(!0):l(!1);},[a]),jsxRuntime.jsxs(Z,{className:n,align:"right",...o,children:[jsxRuntime.jsx(r,{disabled:!s}),jsxRuntime.jsx(i,{disabled:a.length<=0})]})}function oc({text:t="Clear All",...n}){const{clearAll:o}=ll();return jsxRuntime.jsx(T,{text:t,onClick:()=>{o();},...n})}function ic({text:t="Clear Old",...n}){const{clearAllOld:o}=ll();return jsxRuntime.jsx(T,{text:t,onClick:()=>{o();},...n})}function rc(e){const t=bi(),{onClose:n,settings:o}=ll(),{isPanelVisible:i}=$l(),{id:r,onClick:s,updateState:l}=e,c=React.useCallback(async()=>{if(!s)return;if(!t){try{await s({close:!0});}catch(e){console.error(e);}return void n(r)}const e=o?.toastStacking??!1;let a;a=i?o?.closeNotificationOnClick??!0:!e&&null;try{null!==a?await s({close:a}):(await s({close:!1}),await l("Acknowledged"));}catch(e){console.error(e);}},[t,r,i,s,n,l,o?.closeNotificationOnClick,o?.toastStacking]),u=React.useCallback(async e=>{const t=e.target;t.closest("button")||t.closest("[role='button']")||t.closest("a")||t.closest(".io-dropdown-menu")||await c();},[c]);return {handleClick:c,handleWrapperClick:u}}function ac({className:n,notification:o,onClick:i,...r}){const a=N("io-notification-header",n),{HeaderCount:s,HeaderBadge:l,HeaderTitle:c,HeaderTimestamp:u,HeaderButtonSnooze:d,HeaderButtonClose:f}=Nc(),{handleWrapperClick:m}=rc(o);return jsxRuntime.jsxs("div",{className:a,onClick:async e=>{await m(e),i?.(e);},...r,children:[jsxRuntime.jsx(l,{notification:o}),jsxRuntime.jsx(s,{notification:o}),jsxRuntime.jsx(c,{notification:o}),jsxRuntime.jsx(u,{notification:o}),jsxRuntime.jsxs(Z,{children:[jsxRuntime.jsx(d,{notification:o}),jsxRuntime.jsx(f,{notification:o})]})]})}function sc({notification:t,...n}){const{settings:o,notificationStacks:i}=ll(),{isPanelVisible:r}=$l(),{toastStacking:a,stackBy:s}=o,l="application"===s?"source":s??"source";let c=0;if(a){const e=i.find(e=>e.key===t[l]);c=e?.items.length??0;}return r||!a||c<=1?null:jsxRuntime.jsx(ei,{...n,children:c>9?"9+":c})}function lc({className:t,notification:n,...o}){if(!n?.severity||"None"===n.severity)return null;const i=N("io-notification-header-badge",t);return jsxRuntime.jsx(ei,{className:i,...o,children:n.severity})}function cc({className:n,state:o,severity:i="None",icon:r,...a}){const s=N("io-notification-header-icon",n),{isPanelVisible:l}=$l();return jsxRuntime.jsxs("div",{className:s,...a,children:[r&&jsxRuntime.jsx("span",{className:"io-notification-header-icon-image",children:jsxRuntime.jsx("img",{src:r,alt:`io-notification-header-icon-${r}`})}),jsxRuntime.jsx("span",{className:`io-notification-header-icon-badge color-${i.toLowerCase()}`,children:l&&"Acknowledged"!==o&&"New"})]})}function uc({className:t,notification:{appTitle:n},...o}){const i=N("io-notification-header-title",t);return jsxRuntime.jsx("div",{className:i,...o,children:n})}function dc({className:t,notification:{timestamp:n,state:o,snooze:i},...r}){const a=N("io-notification-timestamp",t);return jsxRuntime.jsx("small",i&&"Snoozed"===o?{className:a,...r,children:"Snoozed"}:{className:a,...r,children:ls(n??0)??"Just Now"})}function fc({notification:{id:t,state:n},...o}){const{settings:i,snooze:r}=ll(),s=React.useCallback(e=>{e.stopPropagation(),r&&r(t,i.snooze?.duration??0);},[t,r,i.snooze?.duration]);return r&&"Snoozed"!==n&&i.snooze?.enabled?jsxRuntime.jsx(T,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:s,...o}):null}function mc({notification:{id:t,updateState:n},...o}){const i=bi(),{onClose:r}=ll(),{isPanelVisible:s}=$l(),l=React.useCallback(e=>{e.stopPropagation(),!i||s?r(t):n("Acknowledged").catch(console.error);},[i,t,r,s,n]);return jsxRuntime.jsx(D,{icon:"close",iconSize:"10",tabIndex:-1,onClick:l,...o})}function pc({className:n,notification:o,...i}){const r=N("io-notification-body",n),{BodyIcon:a,BodyTitle:s,BodyDescription:l}=Nc(),{icon:c,title:u,body:d}=o,{handleClick:f}=rc(o);return jsxRuntime.jsxs("div",{className:r,role:"button",tabIndex:0,onKeyDown:async e=>{A(e)&&await f();},onClick:f,...i,children:[jsxRuntime.jsx(a,{icon:c}),jsxRuntime.jsxs("div",{className:"io-notification-body-content",children:[jsxRuntime.jsx(s,{text:u}),jsxRuntime.jsx(l,{text:d})]})]})}function hc({className:t,icon:n,altText:o="notification icon",...i}){if(!n)return null;const r=N("io-notification-body-icon",t);return jsxRuntime.jsx("div",{className:r,...i,children:jsxRuntime.jsx("img",{src:n,alt:o})})}function gc({text:t,...n}){return jsxRuntime.jsx(M,{text:t,...n})}function vc({className:t,text:n,...o}){const i=N("io-notification-body-description",t);return jsxRuntime.jsx("p",{className:i,...o,children:n})}function yc({className:n,notification:o}){const i=N("io-notification-footer",n),{FooterButton:r}=Nc(),{handleWrapperClick:a}=rc(o),s=React.useMemo(()=>function(e){const t=[],n={};if(!e)return;e.forEach(e=>{const{displayId:o,displayPath:i}=e,r={...e,children:[]};if(i&&i.length>0){let e;i.forEach((t,o)=>{0===o?e=n[t]:e&&(e=e.children?.find(e=>e.displayId===t));}),e&&e.children?.push(r);}else o?(t.push(r),n[o]=r):t.push(r);o&&(n[o]=r);});const o=e=>{e.forEach(e=>{0===e.children?.length?delete e.children:e.children&&o(e.children);});};return o(t),t}(o.actions),[o.actions]),l=(t,n)=>t.children?jsxRuntime.jsx(Ko,{text:t.title,children:t.children.map(l)},`${t.title}-${n}`):((t,n)=>jsxRuntime.jsx(Ko.Item,{children:jsxRuntime.jsx(r,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:t})},`${t.title}-${n}`))(t,n);return jsxRuntime.jsx("div",{className:i,onClick:a,children:jsxRuntime.jsx(Z,{align:"right",children:s?.map((n,o)=>n.children?jsxRuntime.jsxs(Z,{variant:"append",children:[jsxRuntime.jsx(r,{notificationAction:n,variant:0===o?"primary":"default"}),jsxRuntime.jsx(Ko,{variant:0===o?"primary":"default",icon:"ellipsis",children:n.children.map(l)})]},`${n.title}-${o}`):jsxRuntime.jsx(r,{notificationAction:n,variant:0===o?"primary":"link"},`${n.title}-${o}`))})})}function wc({notificationAction:t,...n}){const o=React.useCallback(e=>{e.stopPropagation(),t.onClick({close:!0});},[t]);return jsxRuntime.jsx(T,{text:t.title,onClick:o,...n})}const bc={Header:ac,HeaderCount:sc,HeaderBadge:lc,HeaderIcon:cc,HeaderTitle:uc,HeaderTimestamp:dc,HeaderButtonSnooze:fc,HeaderButtonClose:mc,Body:pc,BodyIcon:hc,BodyTitle:gc,BodyDescription:vc,Footer:yc,FooterButton:wc},Cc=React.createContext(bc),kc=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...bc,...n}),[n]);return jsxRuntime.jsx(Cc.Provider,{value:o,children:t})});function Nc(e){return {...React.useContext(Cc),...e}}function Sc({className:n,notification:o,...i}){const{Header:r,Body:a,Footer:s}=Nc(),{severity:l}=o,c=N("io-notification",`severity-${l?.toLowerCase()??"none"}`,"Acknowledged"!==o.state&&"state-new",n);return jsxRuntime.jsxs("div",{className:c,...i,children:[jsxRuntime.jsx(r,{notification:o}),jsxRuntime.jsx(a,{notification:o}),jsxRuntime.jsx(s,{notification:o})]})}function Dc({components:t,notification:n,...o}){return jsxRuntime.jsx(kc,{components:t,children:jsxRuntime.jsx(Sc,{notification:n,...o})})}function xc({className:n,notifications:o,...i}){const[r,s]=React.useState(!1),l=o.length>=3?"large":"normal",u=2===o.length?"small":l,d=o[0].severity,f=N("io-notification-stack",r&&"io-notification-stack-open","normal"!==u&&[`io-notification-stack-${u}`],d&&"None"!==d&&[`io-notification-stack-${d.toLowerCase()}`],n),m=React.useCallback(()=>{s(!0);},[]),p=React.useCallback(e=>{e.stopPropagation(),o.forEach(e=>{e.close();});},[o]);return jsxRuntime.jsxs("div",{className:f,onClick:m,...i,children:[r&&"normal"!==u&&jsxRuntime.jsx("div",{className:"io-notification-stack-btn",children:jsxRuntime.jsx(T,{icon:"close",onClick:e=>p(e),children:jsxRuntime.jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),o.map(t=>jsxRuntime.jsx(Dc,{notification:t},t.id))]})}function Ec({...t}){const{notificationStacks:o}=ll();return jsxRuntime.jsx(jsxRuntime.Fragment,{children:o.map(n=>jsxRuntime.jsx(xc,{notifications:n.items,...t},n.key))})}kc.displayName="ComponentsStoreProvider";const Ic=({notification:n,Notification:o,...i})=>{const{configuration:r,isBulkActionsSupported:a,selectedNotifications:s,selectNotification:l}=ll(),{isPanelVisible:c,isBulkActionsVisible:u}=$l(),d=r.sourceFilter?.muted??[],f=n.source&&d.includes(n.source)||d.includes("*");if(!c&&f)return null;const m=c&&a&&u,p=s.includes(n.id);return m?jsxRuntime.jsxs("div",{className:N("io-notification-list-bulk-action-item",{selected:p}),children:[jsxRuntime.jsx(ri,{checked:p,onChange:e=>l(n.id,e.target.checked)}),jsxRuntime.jsx(o,{notification:n,...i})]}):jsxRuntime.jsx(o,{notification:n,...i})};function Mc({className:n,Notification:o,notifications:i=[],noNotificationText:r="No notifications to display",...a}){const s=N("io-notification-list",n),{settings:l}=ll(),{isPanelVisible:c}=$l(),{toastStacking:u}=l,d=u&&!c,f=i.length>0;return jsxRuntime.jsxs("div",{className:s,...a,children:[d&&jsxRuntime.jsx(Ec,{}),!d&&(f?i.map(t=>jsxRuntime.jsx(Ic,{notification:t,Notification:o,...a},t.id)):jsxRuntime.jsx("div",{className:"flex jc-center mt-8",children:r}))]})}const Pc={Header:zl,HeaderCaptionTitle:Wl,HeaderCaptionCount:function({variant:t="primary",...n}){const{notificationsCount:o=0}=ll();return 0===o?null:jsxRuntime.jsx(I,{variant:t,...n,children:o>99?"99+":o})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:o="circle",...i}){return bi()?jsxRuntime.jsx(D,{icon:t,size:n,variant:o,...i}):null},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:o="circle",onClick:i,...r}){const{hidePanel:a}=ll(),s=bi();return jsxRuntime.jsx(D,{icon:t,size:n,variant:o,onClick:e=>{i?i(e):s&&a();},...r})},HeaderActions:function({className:n,...o}){const i=N("io-panel-header-actions",n),{HeaderActionSort:r,HeaderActionView:a,HeaderActionClear:s,HeaderActionEdit:l}=Oc();return jsxRuntime.jsxs("div",{className:i,...o,children:[jsxRuntime.jsxs(Z,{children:[jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{})]}),jsxRuntime.jsxs(Z,{children:[jsxRuntime.jsx(s,{}),jsxRuntime.jsx(l,{})]})]})},HeaderActionSort:function({text:n="Sort by",...o}){const{sortNotificationsBy:i,setSortBy:r}=$l(),{onNotificationsSort:s}=(()=>{const{notifications:e}=ll(),[t,n]=React.useState(Jl),{key:o,descending:i}=t,r=React.useMemo(()=>Xl[o](e,i),[e,o,i]),s=React.useCallback(e=>{n(t=>({key:e,descending:t.key!==e?Jl.descending:!t.descending}));},[]);return {onNotificationsSort:s,sortedNotifications:r}})();return jsxRuntime.jsxs(X,{variant:"light",...o,children:[jsxRuntime.jsxs(X.Button,{variant:"link",children:[n," ",jsxRuntime.jsx("strong",{children:Zl[i].toLowerCase()})]}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(t=>{const n="Priority"===t?"severity":t.toLowerCase();return jsxRuntime.jsx(X.Item,{isSelected:i===n,onClick:()=>{r(n),s(n);},children:t},t)})})})]})},HeaderActionView:function({text:n="View",...o}){const{settings:i}=ll(),{viewNotificationsBy:r,setViewBy:a}=$l(),s=i.snooze?.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return jsxRuntime.jsxs(X,{variant:"light",...o,children:[jsxRuntime.jsxs(X.Button,{variant:"link",children:[n," ",jsxRuntime.jsx("strong",{children:r})]}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{variant:"single",checkIcon:"check",children:s.map(t=>jsxRuntime.jsx(X.Item,{isSelected:r===t.toLowerCase(),onClick:()=>a(t.toLowerCase()),children:t},t))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:o,notificationsCount:i}=ll();return jsxRuntime.jsx(T,{variant:"link",text:t,onClick:o,disabled:0===i,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:o,notificationsCount:i}=ll(),{showBulkActions:r}=$l();return o?jsxRuntime.jsx(D,{icon:"pen-to-square",title:t,size:"32",onClick:r,disabled:0===i,...n}):null},HeaderBulkActions:function({className:n,...o}){const i=N("io-panel-header-bulk-actions",n),{HeaderBulkActionSelect:r,HeaderBulkActionSelectDropdown:a,HeaderBulkActionMarkAsRead:s,HeaderBulkActionMarkAsUnread:l,HeaderBulkActionSnooze:c,HeaderBulkActionClear:u,HeaderBulkActionClose:d}=Oc(),{isBulkActionsSupported:f}=ll();return f?jsxRuntime.jsx("div",{className:i,...o,children:jsxRuntime.jsxs(Z,{children:[jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{}),jsxRuntime.jsx(s,{}),jsxRuntime.jsx(l,{}),jsxRuntime.jsx(c,{}),jsxRuntime.jsx(u,{}),jsxRuntime.jsx(d,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:o,selectAllNotifications:i,notificationsCount:r}=ll();return n?jsxRuntime.jsx(ri,{checked:r===o.length&&r>0,onChange:e=>i("all",e.target.checked),disabled:0===r,...t}):null},HeaderBulkActionSelectDropdown:function({...n}){const{isBulkActionsSupported:o,selectAllNotifications:i,notificationsCount:r}=ll();return o?jsxRuntime.jsxs(X,{variant:"light",...n,children:[jsxRuntime.jsx(X.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:0===r}),jsxRuntime.jsx(B,{children:jsxRuntime.jsxs(X.List,{variant:"single",checkIcon:"check",children:[jsxRuntime.jsx(X.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(t=>jsxRuntime.jsx(X.Item,{onClick:()=>i(t.toLowerCase(),!0),children:t},t))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:o="circle",tooltip:i="Mark as read",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,setStates:c,notificationsCount:u}=ll(),d=React.useCallback(()=>{c(l,"Seen");},[l,c]);return s?jsxRuntime.jsx(D,{icon:t,size:n,variant:o,title:i,onClick:d,disabled:0===u,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:o="circle",tooltip:i="Mark as unread",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,setStates:c,notificationsCount:u}=ll(),d=React.useCallback(()=>{c(l,"Active");},[l,c]);return s?jsxRuntime.jsx(D,{icon:t,size:n,variant:o,title:i,onClick:d,disabled:0===u,...r}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:o="circle",tooltip:i="Snooze",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,snoozeMany:c,settings:u,notificationsCount:d}=ll(),f=React.useCallback(()=>{c(l,u.snooze?.duration??0);},[l,c,u.snooze?.duration]);return s&&u.snooze?.enabled?jsxRuntime.jsx(D,{icon:t,size:n,variant:o,title:i,onClick:f,disabled:0===d,...r}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:o="circle",tooltip:i="Clear",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,clearMany:c,notificationsCount:u}=ll(),d=React.useCallback(()=>{c(l);},[l,c]);return s?jsxRuntime.jsx(D,{icon:t,size:n,variant:o,title:i,onClick:d,disabled:0===u,...r}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...o}){const{isBulkActionsSupported:i,notificationsCount:r}=ll(),{hideBulkActions:a}=$l();return i?jsxRuntime.jsx(T,{variant:n,text:t,onClick:a,disabled:0===r,...o}):null},HeaderSearch:function({className:n,placeholder:o="Search",iconPrepend:i="search",iconAppend:r="close",...s}){const l=N("io-panel-header-search",n),c=React.useRef(null),{notificationsCount:u}=ll(),{searchQuery:f,setSearch:m}=$l(),p=f.length>0,h=React.useCallback(()=>{m(""),c.current&&c.current.focus();},[m]);return jsxRuntime.jsxs("div",{className:l,children:[jsxRuntime.jsx(oi,{ref:c,value:f,iconPrepend:i,iconAppend:p?r:void 0,iconAppendOnClick:p?h:void 0,placeholder:o,onChange:e=>m(e.target.value),...s}),p&&jsxRuntime.jsx("p",{className:"io-panel-header-search-count",children:`${u} results`})]})},Body:ec,Footer:tc,FooterButtons:nc,FooterButtonClearAll:oc,FooterButtonClearAllOld:ic,Notification:Dc,NotificationsList:Mc},Ac=React.createContext(Pc),Tc=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...Pc,...n}),[n]);return jsxRuntime.jsx(Ac.Provider,{value:o,children:t})});function Oc(e){return {...React.useContext(Ac),...e}}function Fc(){const e=React.useContext(reactHooks.IOConnectContext),{settings:t}=ll(),n=bi(),o=React.useCallback(async()=>{const o=e.windows.my();if(!e||!o||!n)return;const i=o.placementSettings;await o.place({...i,horizontalAlignment:t.placement?.panel});},[e,n,t.placement?.panel]);React.useEffect(()=>{e&&t.placement?.panel&&n&&o().catch(console.error);},[e,n,o,t.placement?.panel]);}function Lc({className:o,onClose:i,title:r="Notifications",...a}){const{Header:s,Body:l}=Oc(),{settings:u}=ll(),{isPanelVisible:d}=$l(),[m,p]=React.useState(!1),h=bi(),g=N("io-notifications-panel","left"===u.placement?.panel&&"io-panel-left","right"===u.placement?.panel&&"io-panel-right",o);return Fc(),React.useEffect(()=>{d||p(!1);},[d]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Zo,{className:g,...a,children:[jsxRuntime.jsx(s,{title:r,onClose:i,onOpenSettings:()=>p(!0)}),jsxRuntime.jsx(l,{})]}),h&&d&&jsxRuntime.jsx(Hl,{isOpen:m,onClose:()=>p(!1)})]})}Tc.displayName="ComponentsStoreProvider";const Bc={Body:function({className:t,notifications:n,maxToasts:o=1,...i}){const r=N("io-toasts-body",t),{NotificationsList:a,Notification:s}=Hc(),[l,u]=React.useState([]);return React.useEffect(()=>{const e=o<0?n.length:o,t=n.filter(e=>"Active"===e.state).slice(0,e);for(const e of t)e.onShow();u(t);},[n,o]),jsxRuntime.jsx("div",{className:r,...i,children:jsxRuntime.jsx(a,{Notification:s,notifications:l,noNotificationText:""})})},Notification:Dc,NotificationsList:Mc},Rc=React.createContext(Bc),_c=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...Bc,...n}),[n]);return jsxRuntime.jsx(Rc.Provider,{value:o,children:t})});function Hc(e){return {...React.useContext(Rc),...e}}function jc(){const e=React.useContext(reactHooks.IOConnectContext),{settings:t}=ll(),n=React.useCallback(async()=>{const n=e.windows.my();if(!e||!n)return;const o=n.placementSettings;await n.place({...o,horizontalAlignment:"top-right"===t.placement?.toasts||"bottom-right"===t.placement?.toasts?"right":"left"});},[e,t.placement?.toasts]);React.useEffect(()=>{e&&t.placement?.toasts&&n().catch(console.error);},[e,n,t.placement?.toasts]);}function $c({className:n,maxToasts:o=10,...i}){const{Header:r,Body:a,Footer:s}=Hc(),{notifications:l,settings:c}=ll(),u=N("io-toasts",("top-left"===c.placement?.toasts||"top-right"===c.placement?.toasts)&&"io-toasts-top",("top-right"===c.placement?.toasts||"bottom-right"===c.placement?.toasts)&&"io-toasts-right",("bottom-left"===c.placement?.toasts||"bottom-right"===c.placement?.toasts)&&"io-toasts-bottom",("top-left"===c.placement?.toasts||"bottom-left"===c.placement?.toasts)&&"io-toasts-left",n);return jc(),jsxRuntime.jsxs("div",{className:u,...i,children:[r&&jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{notifications:l,maxToasts:o}),s&&jsxRuntime.jsx(s,{})]})}_c.displayName="ComponentsStoreProvider";Object.freeze({__proto__:null,Notification:Dc,NotificationBody:pc,NotificationBodyDescription:vc,NotificationBodyIcon:hc,NotificationBodyTitle:gc,NotificationFooter:yc,NotificationFooterButton:wc,NotificationHeader:ac,NotificationHeaderBadge:lc,NotificationHeaderButtonClose:mc,NotificationHeaderButtonSnooze:fc,NotificationHeaderCount:sc,NotificationHeaderIcon:cc,NotificationHeaderTimestamp:dc,NotificationHeaderTitle:uc,NotificationStack:xc,NotificationsList:Mc,NotificationsPanelProvider:({children:t})=>{const{searchQuery:n,setSearch:o,isPanelVisible:i,sortNotificationsBy:r,setSortBy:a,viewNotificationsBy:s,setViewBy:d,isBulkActionsVisible:m,showBulkActions:p,hideBulkActions:h}=function(){const e=React.useContext(reactHooks.IOConnectContext),[t,n]=React.useState(!1),[o,i]=React.useState("newest"),[r,a]=React.useState("all"),[s,u]=React.useState(""),[d,m]=React.useState(!1),p=bi(),{isBulkActionsSupported:h}=ll();return React.useEffect(()=>{const e=el.onPanelVisibilityChanged(e=>n(e));return ()=>{e();}},[]),React.useEffect(()=>{null!==p&&p&&(async()=>{const t=await e.notifications.panel.isVisible();n(t);})();},[e.notifications.panel,p]),React.useEffect(()=>{t||(m(!1),a("all"));},[t]),{isPanelVisible:t,sortNotificationsBy:o,setSortBy:e=>{i(e);},viewNotificationsBy:r,setViewBy:e=>{a(e);},searchQuery:s,setSearch:e=>{u(e);},isBulkActionsVisible:d,showBulkActions:()=>{h&&m(!0);},hideBulkActions:()=>{h&&m(!1);}}}(),g=React.useMemo(()=>({searchQuery:n,setSearch:o,isPanelVisible:i,sortNotificationsBy:r,setSortBy:a,viewNotificationsBy:s,setViewBy:d,isBulkActionsVisible:m,showBulkActions:p,hideBulkActions:h}),[n,o,i,r,a,s,d,m,p,h]);return jsxRuntime.jsx(jl.Provider,{value:g,children:t})},NotificationsProvider:({children:t})=>{const{notifications:n,notificationStacks:o,notificationsCount:i,configuration:r,settings:a,allApplications:s,allApps:l,allowedApplications:c,clearAll:d,clearAllOld:f,close:m,hidePanel:p,showPanel:h,saveSetting:g,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:b,selectNotification:C,selectAllNotifications:k,clearMany:N,snooze:S,snoozeMany:D,setState:x,setStates:E,setCount:I}=al(),M=React.useMemo(()=>({notifications:n,notificationStacks:o,notificationsCount:i,configuration:r,settings:a,allApplications:s,allApps:l,allowedApplications:c,clearAll:d,clearAllOld:f,onClose:m,hidePanel:p,showPanel:h,saveSetting:g,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:b,selectNotification:C,selectAllNotifications:k,clearMany:N,snooze:S,snoozeMany:D,setState:x,setStates:E,setCount:I}),[n,o,i,r,a,s,l,c,d,f,m,p,h,g,v,y,w,b,C,k,N,S,D,x,E,I]);return jsxRuntime.jsx(sl.Provider,{value:M,children:t})},Panel:function({components:t,settings:n,...o}){return jsxRuntime.jsx(Ll,{components:n,children:jsxRuntime.jsx(Tc,{components:t,children:jsxRuntime.jsx(Lc,{...o})})})},PanelBody:ec,PanelFooter:tc,PanelFooterButtonClearAll:oc,PanelFooterButtonClearAllOld:ic,PanelFooterButtons:nc,PanelHeader:zl,PanelHeaderCaptionTitle:Wl,SettingsAllowNotificationToasts:ul,SettingsAllowNotifications:cl,SettingsCloseNotificationOnClick:fl,SettingsGeneral:Zs,SettingsHideToastsAfter:gl,SettingsPanel:_l,SettingsPanelAutoHide:ml,SettingsPlacement:kl,SettingsPlacementPanel:Sl,SettingsPlacementToasts:Dl,SettingsShowNotificationBadge:dl,SettingsSnooze:xl,SettingsSnoozeDuration:El,SettingsStacking:vl,SettingsSubscribeAll:Ml,SettingsSubscribeApp:Pl,SettingsSubscribeMuteAll:Al,SettingsSubscribeMuteApp:Tl,SettingsSubscriptions:Il,SettingsToastStackBy:Cl,SettingsToastStacking:yl,Toasts:function({components:t,...n}){return jsxRuntime.jsx(_c,{components:t,children:jsxRuntime.jsx($c,{...n})})},useAddRemoveApps:tl,useHidePanelOnFocusLost:function(e=!0){const t=React.useContext(reactHooks.IOConnectContext),n=bi();return React.useEffect(()=>{if(!t||!e||null===n||!n)return;const o=t.windows.my()?.onFocusChanged(e=>{e.isFocused||t.notifications.panel.hide().catch(e=>{console.error("Error hiding panel:",e);});});return ()=>o?.()},[t,n,e]),t},useHidePanelOnKeyUp:function(e="Escape"){const{hidePanel:t}=ll();vi(e,t);},useNotificationStacking:nl,useNotificationsContext:ll,useNotificationsPanelContext:$l,usePanelWindowPlacement:Fc,useSelectNotifications:ol,useShowHidePanelWindow:function(e=!0){const t=React.useContext(reactHooks.IOConnectContext),n=t?.windows.my(),o=bi(),{isPanelVisible:i}=$l();return React.useEffect(()=>{t&&n&&o&&(i?n.show().then(()=>{e&&n.focus().catch(e=>{console.error("Error focusing window:",e);});}).catch(e=>console.error("Error showing window:",e)):n.hide().catch(e=>console.error("Error hiding window:",e)));},[t,n,o,i,e]),{myWindow:n}},useToastsWindowPlacement:jc});const Wc=n=>{const{General:o,Layouts:i,Downloads:r,System:a}=Zu();return jsxRuntime.jsxs(Qo,{...n,children:[jsxRuntime.jsx(o,{}),jsxRuntime.jsx(i,{}),jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{})]})},Vc=({title:n="General",...o})=>{const{Theme:i,PinnedPosition:r,MinimizeToTray:a,ShowTutorialOnStartup:s}=Zu();return jsxRuntime.jsxs(P,{title:n,...o,children:[jsxRuntime.jsx(i,{}),jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{}),jsxRuntime.jsx(s,{})]})},Yc=(e="dark")=>{switch(e){case"dark":return "Dark";case"light":return "Light";default:return e}},Uc=({className:n,title:o="Theme",...i})=>{const{currentTheme:r,selectTheme:a}=Ci(),s=(()=>{const e=React.useContext(reactHooks.IOConnectContext),[t,n]=React.useState([]);return React.useEffect(()=>{e&&e.themes?.list().then(n).catch(console.warn);},[e]),t})();return jsxRuntime.jsxs("div",{className:N("flex jc-between ai-center",n),"data-testid":"theme-container",...i,children:[jsxRuntime.jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:o}),jsxRuntime.jsxs(X,{variant:"light","data-testid":"theme-dropdown",children:[jsxRuntime.jsx(X.Button,{text:Yc(r?.name),"data-testid":"theme-dropdown-button"}),jsxRuntime.jsx(X.Content,{"data-testid":"theme-dropdown-content",children:jsxRuntime.jsx(X.List,{children:s.map(({name:t})=>jsxRuntime.jsx(X.Item,{onClick:()=>a(t),"data-testid":`theme-dropdown-item-${t}`,children:Yc(t)},t))})})]})]})},Kc=({prefKey:n,options:o,disabled:i,...r})=>{const{isLoading:a,value:s="Select option",update:l}=xa({prefKey:n});return jsxRuntime.jsxs(X,{variant:"light",disabled:a||i,...r,children:[jsxRuntime.jsx(X.Button,{children:s}),jsxRuntime.jsx(X.Content,{children:jsxRuntime.jsx(X.List,{children:o.map(t=>jsxRuntime.jsx(X.Item,{onClick:()=>(async e=>{if(e!==s)try{await l(e);}catch(e){console.error("Failed to update platform preference:",e);}})(t),children:t},t))})})]})},Jc=({className:n,label:o="Pinned position",...i})=>jsxRuntime.jsx(P,{className:N("io-block-list-gap",n),...i,children:jsxRuntime.jsxs("div",{className:"flex jc-between ai-center",children:[jsxRuntime.jsx("label",{className:"io-text-clipper",children:o}),jsxRuntime.jsx(Kc,{className:n,prefKey:Ti,options:["Left","Right"],...i})]})}),qc=({prefKey:t,...n})=>{const{isLoading:o,value:i=!1,update:r}=xa({prefKey:t});return jsxRuntime.jsx(fi,{checked:i,disabled:o,onChange:e=>r(e.target.checked),...n})},Gc=({align:t="right",label:n="Allow docking",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:Oi,...o}),Qc=({align:t="right",label:n="Minimize to tray",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:Fi,...o}),Xc=({align:t="right",label:n="Auto-close on starting apps and workspaces",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:Li,disabled:!0,...o}),Zc=({align:t="right",label:n="Show tutorial on startup",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:Bi,...o}),eu=({title:n="Layouts",...o})=>{const{LayoutsSaveCurrentOnExit:i,LayoutsShowDeletePrompt:r,LayoutsShowUnsavedChangesPrompt:a}=Zu();return jsxRuntime.jsxs(P,{title:n,...o,children:[jsxRuntime.jsx(i,{}),jsxRuntime.jsx(a,{}),jsxRuntime.jsx(r,{})]})},tu=({align:t="right",label:n="Restore last saved on startup",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:Ri,...o}),nu=({align:t="right",label:n="Save current on exit",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:_i,...o}),ou=({align:t="right",label:n="Show prompt for unsaved changes",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:Hi,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...o}),iu=({align:t="right",label:n="Show prompt for deleting",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:ji,"data-testid":"layouts-show-delete-prompt-toggle",...o}),ru=({className:t,title:n="Downloads",...o})=>{const{DownloadsLocation:i}=Zu();return jsxRuntime.jsx(P,{className:N("io-block-list-gap",t),title:n,...o,children:jsxRuntime.jsx(i,{})})},au=({align:t="right",label:n="Ask where to save each file before downloading",...o})=>jsxRuntime.jsx(qc,{align:t,label:n,prefKey:$i,...o}),su=({className:n,label:o="Location",...i})=>{const{configuration:{downloadFolder:r},setDownloadLocationWithDialog:a,isDownloadLocationDialogVisible:s,downloadLocationList:l}=ts();return jsxRuntime.jsxs(P,{className:N("io-preferences-download-section",n),...i,children:[jsxRuntime.jsxs("div",{className:"flex jc-between ai-center",children:[jsxRuntime.jsx("label",{className:"io-text-clipper",children:o}),jsxRuntime.jsx(T,{text:"Change",onClick:a,disabled:s})]}),jsxRuntime.jsx("p",{children:r??l?.[0]??"Not set"})]})},lu=({className:n,title:o="System",...i})=>{const{SystemRestartSection:r,SystemShutdownSection:a}=Zu();return jsxRuntime.jsxs(P,{className:N("io-block-list-gap",n),title:o,...i,children:[jsxRuntime.jsx(r,{}),jsxRuntime.jsx(a,{})]})};var cu=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],uu={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return "undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},du={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return "th";switch(t%10){case 1:return "st";case 2:return "nd";case 3:return "rd";default:return "th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},fu=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},mu=function(e){return !0===e?1:0};function pu(e,t){var n;return function(){var o=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(o,i)},t);}}var hu=function(e){return e instanceof Array?e:[e]};function gu(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t);}function vu(e,t,n){var o=window.document.createElement(e);return t=t||"",n=n||"",o.className=t,void 0!==n&&(o.textContent=n),o}function yu(e){for(;e.firstChild;)e.removeChild(e.firstChild);}function wu(e,t){return t(e)?e:e.parentNode?wu(e.parentNode,t):void 0}function bu(e,t){var n=vu("div","numInputWrapper"),o=vu("input","numInput "+e),i=vu("span","arrowUp"),r=vu("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?o.type="number":(o.type="text",o.pattern="\\d*"),void 0!==t)for(var a in t)o.setAttribute(a,t[a]);return n.appendChild(o),n.appendChild(i),n.appendChild(r),n}function Cu(e){try{return "function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var ku=function(){},Nu=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},Su={D:ku,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t));},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t));},H:function(e,t){e.setHours(parseFloat(t));},J:function(e,t){e.setDate(parseFloat(t));},K:function(e,t,n){e.setHours(e.getHours()%12+12*mu(new RegExp(n.amPM[1],"i").test(t)));},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t));},S:function(e,t){e.setSeconds(parseFloat(t));},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var o=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(o-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t));},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t));},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t));},i:function(e,t){e.setMinutes(parseFloat(t));},j:function(e,t){e.setDate(parseFloat(t));},l:ku,m:function(e,t){e.setMonth(parseFloat(t)-1);},n:function(e,t){e.setMonth(parseFloat(t)-1);},s:function(e,t){e.setSeconds(parseFloat(t));},u:function(e,t){return new Date(parseFloat(t))},w:ku,y:function(e,t){e.setFullYear(2e3+parseFloat(t));}},Du={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},xu={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[xu.w(e,t,n)]},F:function(e,t,n){return Nu(xu.n(e,t,n)-1,!1,t)},G:function(e,t,n){return fu(xu.h(e,t,n))},H:function(e){return fu(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[mu(e.getHours()>11)]},M:function(e,t){return Nu(e.getMonth(),!0,t)},S:function(e){return fu(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return fu(e.getFullYear(),4)},d:function(e){return fu(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return fu(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return fu(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},Eu=function(e){var t=e.config,n=void 0===t?uu:t,o=e.l10n,i=void 0===o?du:o,r=e.isMobile,a=void 0!==r&&r;return function(e,t,o){var r=o||i;return void 0===n.formatDate||a?t.split("").map(function(t,o,i){return xu[t]&&"\\"!==i[o-1]?xu[t](e,r,n):"\\"!==t?t:""}).join(""):n.formatDate(e,t,r)}},Iu=function(e){var t=e.config,n=void 0===t?uu:t,o=e.l10n,i=void 0===o?du:o;return function(e,t,o,r){if(0===e||e){var a,s=r||i,l=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var c=t||(n||uu).dateFormat,u=String(e).trim();if("today"===u)a=new Date,o=!0;else if(n&&n.parseDate)a=n.parseDate(e,c);else if(/Z$/.test(u)||/GMT$/.test(u))a=new Date(e);else {for(var d=void 0,f=[],m=0,p=0,h="";m<c.length;m++){var g=c[m],v="\\"===g,y="\\"===c[m-1]||v;if(Du[g]&&!y){h+=Du[g];var w=new RegExp(h).exec(e);w&&(d=!0)&&f["Y"!==g?"push":"unshift"]({fn:Su[g],val:w[++p]});}else v||(h+=".");}a=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),f.forEach(function(e){var t=e.fn,n=e.val;return a=t(a,n,s)||a}),a=d?a:void 0;}}if(a instanceof Date&&!isNaN(a.getTime()))return !0===o&&a.setHours(0,0,0,0),a;n.errorHandler(new Error("Invalid date provided: "+l));}}};function Mu(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var Pu=function(e,t,n){return 3600*e+60*t+n},Au=864e5;function Tu(e){var t=e.defaultHour,n=e.defaultMinute,o=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),r=e.minDate.getMinutes(),a=e.minDate.getSeconds();t<i&&(t=i),t===i&&n<r&&(n=r),t===i&&n===r&&o<a&&(o=e.minDate.getSeconds());}if(void 0!==e.maxDate){var s=e.maxDate.getHours(),l=e.maxDate.getMinutes();(t=Math.min(t,s))===s&&(n=Math.min(l,n)),t===s&&n===l&&(o=e.maxDate.getSeconds());}return {hours:t,minutes:n,seconds:o}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var o=function(t){t&&Object.keys(t).forEach(function(n){return e[n]=t[n]});},i=0,r=t;i<r.length;i++){o(r[i]);}return e});var Ou=function(){return Ou=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ou.apply(this,arguments)},Fu=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),i=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,i++)o[i]=r[a];return o};function Lu(e,t){var n={config:Ou(Ou({},uu),Ru.defaultConfig),l10n:du};function o(){var e;return (null===(e=n.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function i(e){return e.bind(n)}function r(){var e=n.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==n.calendarContainer&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),void 0!==n.daysContainer){var t=(n.days.offsetWidth+1)*e.showMonths;n.daysContainer.style.width=t+"px",n.calendarContainer.style.width=t+(void 0!==n.weekWrapper?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display");}});}function a(e){if(0===n.selectedDates.length){var t=void 0===n.config.minDate||Mu(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),o=Tu(n.config);t.setHours(o.hours,o.minutes,o.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t;}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,o=Cu(e),i=o;void 0!==n.amPM&&o===n.amPM&&(n.amPM.textContent=n.l10n.amPM[mu(n.amPM.textContent===n.l10n.amPM[0])]);var r=parseFloat(i.getAttribute("min")),a=parseFloat(i.getAttribute("max")),s=parseFloat(i.getAttribute("step")),l=parseInt(i.value,10),c=e.delta||(t?38===e.which?1:-1:0),u=l+s*c;if(void 0!==i.value&&2===i.value.length){var d=i===n.hourElement,f=i===n.minuteElement;u<r?(u=a+u+mu(!d)+(mu(d)&&mu(!n.amPM)),f&&h(void 0,-1,n.hourElement)):u>a&&(u=i===n.hourElement?u-a-mu(!n.amPM):r,f&&h(void 0,1,n.hourElement)),n.amPM&&d&&(1===s?u+l===23:Math.abs(u-l)>s)&&(n.amPM.textContent=n.l10n.amPM[mu(n.amPM.textContent===n.l10n.amPM[0])]),i.value=fu(u);}}(e);var i=n._input.value;s(),Z(),n._input.value!==i&&n._debouncedChange();}function s(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,o=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(n.minuteElement.value,10)||0)%60,r=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=o,t=n.amPM.textContent,o=e%12+12*mu(t===n.l10n.amPM[1]));var a=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===Mu(n.latestSelectedDateObj,n.config.minDate,!0),s=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===Mu(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var l=Pu(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),u=Pu(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),d=Pu(o,i,r);if(d>u&&d<l){var f=function(e){var t=Math.floor(e/3600),n=(e-3600*t)/60;return [t,n,e-3600*t-60*n]}(l);o=f[0],i=f[1],r=f[2];}}else {if(s){var m=void 0!==n.config.maxTime?n.config.maxTime:n.config.maxDate;(o=Math.min(o,m.getHours()))===m.getHours()&&(i=Math.min(i,m.getMinutes())),i===m.getMinutes()&&(r=Math.min(r,m.getSeconds()));}if(a){var p=void 0!==n.config.minTime?n.config.minTime:n.config.minDate;(o=Math.max(o,p.getHours()))===p.getHours()&&i<p.getMinutes()&&(i=p.getMinutes()),i===p.getMinutes()&&(r=Math.max(r,p.getSeconds()));}}c(o,i,r);}}function l(e){var t=e||n.latestSelectedDateObj;t&&t instanceof Date&&c(t.getHours(),t.getMinutes(),t.getSeconds());}function c(e,t,o){void 0!==n.latestSelectedDateObj&&n.latestSelectedDateObj.setHours(e%24,t,o||0,0),n.hourElement&&n.minuteElement&&!n.isMobile&&(n.hourElement.value=fu(n.config.time_24hr?e:(12+e)%12+12*mu(e%12==0)),n.minuteElement.value=fu(t),void 0!==n.amPM&&(n.amPM.textContent=n.l10n.amPM[mu(e>=12)]),void 0!==n.secondElement&&(n.secondElement.value=fu(o)));}function u(e){var t=Cu(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&P(n);}function d(e,t,o,i){return t instanceof Array?t.forEach(function(t){return d(e,t,o,i)}):e instanceof Array?e.forEach(function(e){return d(e,t,o,i)}):(e.addEventListener(t,o,i),void n._handlers.push({remove:function(){return e.removeEventListener(t,o,i)}}))}function f(){J("onChange");}function m(e,t){var o=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),i=n.currentYear,r=n.currentMonth;try{void 0!==o&&(n.currentYear=o.getFullYear(),n.currentMonth=o.getMonth());}catch(e){e.message="Invalid date supplied: "+o,n.config.errorHandler(e);}t&&n.currentYear!==i&&(J("onYearChange"),k()),!t||n.currentYear===i&&n.currentMonth===r||J("onMonthChange"),n.redraw();}function p(e){var t=Cu(e);~t.className.indexOf("arrow")&&h(e,t.classList.contains("arrowUp")?1:-1);}function h(e,t,n){var o=e&&Cu(e),i=n||o&&o.parentNode&&o.parentNode.firstChild,r=q("increment");r.delta=t,i&&i.dispatchEvent(r);}function g(e,t,o,i){var r=A(t,!0),a=vu("span",e,t.getDate().toString());return a.dateObj=t,a.$i=i,a.setAttribute("aria-label",n.formatDate(t,n.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===Mu(t,n.now)&&(n.todayDateElem=a,a.classList.add("today"),a.setAttribute("aria-current","date")),r?(a.tabIndex=-1,G(t)&&(a.classList.add("selected"),n.selectedDateElem=a,"range"===n.config.mode&&(gu(a,"startRange",n.selectedDates[0]&&0===Mu(t,n.selectedDates[0],!0)),gu(a,"endRange",n.selectedDates[1]&&0===Mu(t,n.selectedDates[1],!0)),"nextMonthDay"===e&&a.classList.add("inRange")))):a.classList.add("flatpickr-disabled"),"range"===n.config.mode&&function(e){return !("range"!==n.config.mode||n.selectedDates.length<2)&&(Mu(e,n.selectedDates[0])>=0&&Mu(e,n.selectedDates[1])<=0)}(t)&&!G(t)&&a.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(t)+"</span>"),J("onDayCreate",a),a}function v(e){e.focus(),"range"===n.config.mode&&L(e);}function y(e){for(var t=e>0?0:n.config.showMonths-1,o=e>0?n.config.showMonths:-1,i=t;i!=o;i+=e)for(var r=n.daysContainer.children[i],a=e>0?0:r.children.length-1,s=e>0?r.children.length:-1,l=a;l!=s;l+=e){var c=r.children[l];if(-1===c.className.indexOf("hidden")&&A(c.dateObj))return c}}function w(e,t){var i=o(),r=T(i||document.body),a=void 0!==e?e:r?i:void 0!==n.selectedDateElem&&T(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&T(n.todayDateElem)?n.todayDateElem:y(t>0?1:-1);void 0===a?n._input.focus():r?function(e,t){for(var o=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,i=t>0?n.config.showMonths:-1,r=t>0?1:-1,a=o-n.currentMonth;a!=i;a+=r)for(var s=n.daysContainer.children[a],l=o-n.currentMonth===a?e.$i+t:t<0?s.children.length-1:0,c=s.children.length,u=l;u>=0&&u<c&&u!=(t>0?c:-1);u+=r){var d=s.children[u];if(-1===d.className.indexOf("hidden")&&A(d.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return v(d)}n.changeMonth(r),w(y(r),0);}(a,t):v(a);}function b(e,t){for(var o=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,i=n.utils.getDaysInMonth((t-1+12)%12,e),r=n.utils.getDaysInMonth(t,e),a=window.document.createDocumentFragment(),s=n.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay",u=i+1-o,d=0;u<=i;u++,d++)a.appendChild(g("flatpickr-day "+l,new Date(e,t-1,u),0,d));for(u=1;u<=r;u++,d++)a.appendChild(g("flatpickr-day",new Date(e,t,u),0,d));for(var f=r+1;f<=42-o&&(1===n.config.showMonths||d%7!=0);f++,d++)a.appendChild(g("flatpickr-day "+c,new Date(e,t+1,f%r),0,d));var m=vu("div","dayContainer");return m.appendChild(a),m}function C(){if(void 0!==n.daysContainer){yu(n.daysContainer),n.weekNumbers&&yu(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<n.config.showMonths;t++){var o=new Date(n.currentYear,n.currentMonth,1);o.setMonth(n.currentMonth+t),e.appendChild(b(o.getFullYear(),o.getMonth()));}n.daysContainer.appendChild(e),n.days=n.daysContainer.firstChild,"range"===n.config.mode&&1===n.selectedDates.length&&L();}}function k(){if(!(n.config.showMonths>1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return !(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&e<n.config.minDate.getMonth())&&!(void 0!==n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()&&e>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var o=vu("option","flatpickr-monthDropdown-month");o.value=new Date(n.currentYear,t).getMonth().toString(),o.textContent=Nu(t,n.config.shorthandCurrentMonth,n.l10n),o.tabIndex=-1,n.currentMonth===t&&(o.selected=!0),n.monthsDropdownContainer.appendChild(o);}}}function N(){var e,t=vu("div","flatpickr-month"),o=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=vu("span","cur-month"):(n.monthsDropdownContainer=vu("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),d(n.monthsDropdownContainer,"change",function(e){var t=Cu(e),o=parseInt(t.value,10);n.changeMonth(o-n.currentMonth),J("onMonthChange");}),k(),e=n.monthsDropdownContainer);var i=bu("cur-year",{tabindex:"-1"}),r=i.getElementsByTagName("input")[0];r.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&r.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(r.setAttribute("max",n.config.maxDate.getFullYear().toString()),r.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var a=vu("div","flatpickr-current-month");return a.appendChild(e),a.appendChild(i),o.appendChild(a),t.appendChild(o),{container:t,yearElement:r,monthElement:e}}function S(){yu(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=N();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container);}n.monthNav.appendChild(n.nextMonthNav);}function D(){n.weekdayContainer?yu(n.weekdayContainer):n.weekdayContainer=vu("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=vu("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t);}return x(),n.weekdayContainer}function x(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=Fu(n.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=Fu(t.splice(e,t.length),t.splice(0,e)));for(var o=n.config.showMonths;o--;)n.weekdayContainer.children[o].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n ";}}function E(e,t){void 0===t&&(t=!0);var o=t?e:e-n.currentMonth;o<0&&!0===n._hidePrevMonthArrow||o>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=o,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,J("onYearChange"),k()),C(),J("onMonthChange"),Q());}function I(e){return n.calendarContainer.contains(e)}function M(e){if(n.isOpen&&!n.config.inline){var t=Cu(e),o=I(t),i=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput)))&&!o&&!I(e.relatedTarget),r=!n.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&r&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&a(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1));}}function P(e){if(!(!e||n.config.minDate&&e<n.config.minDate.getFullYear()||n.config.maxDate&&e>n.config.maxDate.getFullYear())){var t=e,o=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),o&&(n.redraw(),J("onYearChange"),k());}}function A(e,t){var o;void 0===t&&(t=!0);var i=n.parseDate(e,void 0,t);if(n.config.minDate&&i&&Mu(i,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&i&&Mu(i,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return !1;if(!n.config.enable&&0===n.config.disable.length)return !0;if(void 0===i)return !1;for(var r=!!n.config.enable,a=null!==(o=n.config.enable)&&void 0!==o?o:n.config.disable,s=0,l=void 0;s<a.length;s++){if("function"==typeof(l=a[s])&&l(i))return r;if(l instanceof Date&&void 0!==i&&l.getTime()===i.getTime())return r;if("string"==typeof l){var c=n.parseDate(l,void 0,!0);return c&&c.getTime()===i.getTime()?r:!r}if("object"==typeof l&&void 0!==i&&l.from&&l.to&&i.getTime()>=l.from.getTime()&&i.getTime()<=l.to.getTime())return r}return !r}function T(e){return void 0!==n.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e))}function O(e){var t=e.target===n._input,o=n._input.value.trimEnd()!==X();!t||!o||e.relatedTarget&&I(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat);}function F(t){var i=Cu(t),r=n.config.wrap?e.contains(i):i===n._input,l=n.config.allowInput,c=n.isOpen&&(!l||!r),u=n.config.inline&&r&&!l;if(13===t.keyCode&&r){if(l)return n.setDate(n._input.value,!0,i===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),i.blur();n.open();}else if(I(i)||c||u){var d=!!n.timeContainer&&n.timeContainer.contains(i);switch(t.keyCode){case 13:d?(t.preventDefault(),a(),z()):W(t);break;case 27:t.preventDefault(),z();break;case 8:case 46:r&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(d||r)n.hourElement&&n.hourElement.focus();else {t.preventDefault();var f=o();if(void 0!==n.daysContainer&&(!1===l||f&&T(f))){var m=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),E(m),w(y(1),0)):w(void 0,m);}}break;case 38:case 40:t.preventDefault();var p=40===t.keyCode?1:-1;n.daysContainer&&void 0!==i.$i||i===n.input||i===n.altInput?t.ctrlKey?(t.stopPropagation(),P(n.currentYear-p),w(y(1),0)):d||w(void 0,7*p):i===n.currentYearElement?P(n.currentYear-p):n.config.enableTime&&(!d&&n.hourElement&&n.hourElement.focus(),a(t),n._debouncedChange());break;case 9:if(d){var h=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(e){return e}),g=h.indexOf(i);if(-1!==g){var v=h[g+(t.shiftKey?-1:1)];t.preventDefault(),(v||n._input).focus();}}else !n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(i)&&t.shiftKey&&(t.preventDefault(),n._input.focus());}}if(void 0!==n.amPM&&i===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],s(),Z();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],s(),Z();}(r||I(i))&&J("onKeyDown",t);}function L(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var o=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),i=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),r=Math.min(o,n.selectedDates[0].getTime()),a=Math.max(o,n.selectedDates[0].getTime()),s=!1,l=0,c=0,u=r;u<a;u+=Au)A(new Date(u),!0)||(s=s||u>r&&u<a,u<i&&(!l||u>l)?l=u:u>i&&(!c||u<c)&&(c=u));Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+t)).forEach(function(t){var r,a,u,d=t.dateObj.getTime(),f=l>0&&d<l||c>0&&d>c;if(f)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e);});s&&!f||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e);}),void 0!==e&&(e.classList.add(o<=n.selectedDates[0].getTime()?"startRange":"endRange"),i<o&&d===i?t.classList.add("startRange"):i>o&&d===i&&t.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(a=i,u=o,(r=d)>Math.min(a,u)&&r<Math.max(a,u))&&t.classList.add("inRange")));});}}function B(){!n.isOpen||n.config.static||n.config.inline||j();}function R(e){return function(t){var o=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),i=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==o&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=o.getHours()>0||o.getMinutes()>0||o.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(e){return A(e)}),n.selectedDates.length||"min"!==e||l(o),Z()),n.daysContainer&&($(),void 0!==o?n.currentYearElement[e]=o.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!i&&void 0!==o&&i.getFullYear()===o.getFullYear());}}function _(){return n.config.wrap?e.querySelector("[data-input]"):e}function H(){"object"!=typeof n.config.locale&&void 0===Ru.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=Ou(Ou({},Ru.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?Ru.l10ns[n.config.locale]:void 0),Du.D="("+n.l10n.weekdays.shorthand.join("|")+")",Du.l="("+n.l10n.weekdays.longhand.join("|")+")",Du.M="("+n.l10n.months.shorthand.join("|")+")",Du.F="("+n.l10n.months.longhand.join("|")+")",Du.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===Ou(Ou({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===Ru.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=Eu(n),n.parseDate=Iu({config:n.config,l10n:n.l10n});}function j(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){J("onPreCalendarPosition");var t=e||n._positionElement,o=Array.prototype.reduce.call(n.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),i=n.calendarContainer.offsetWidth,r=n.config.position.split(" "),a=r[0],s=r.length>1?r[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===a||"below"!==a&&c<o&&l.top>o,d=window.pageYOffset+l.top+(u?-o-2:t.offsetHeight+2);if(gu(n.calendarContainer,"arrowTop",!u),gu(n.calendarContainer,"arrowBottom",u),!n.config.inline){var f=window.pageXOffset+l.left,m=!1,p=!1;"center"===s?(f-=(i-l.width)/2,m=!0):"right"===s&&(f-=i-l.width,p=!0),gu(n.calendarContainer,"arrowLeft",!m&&!p),gu(n.calendarContainer,"arrowCenter",m),gu(n.calendarContainer,"arrowRight",p);var h=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=f+i>window.document.body.offsetWidth,v=h+i>window.document.body.offsetWidth;if(gu(n.calendarContainer,"rightMost",g),!n.config.static)if(n.calendarContainer.style.top=d+"px",g)if(v){var y=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];if(n.cssRules){try{n.cssRules;}catch(e){continue}e=n;break}}return null!=e?e:(o=document.createElement("style"),document.head.appendChild(o),o.sheet);var o;}();if(void 0===y)return;var w=window.document.body.offsetWidth,b=Math.max(0,w/2-i/2),C=y.cssRules.length,k="{left:"+l.left+"px;right:auto;}";gu(n.calendarContainer,"rightMost",!1),gu(n.calendarContainer,"centerMost",!0),y.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+k,C),n.calendarContainer.style.left=b+"px",n.calendarContainer.style.right="auto";}else n.calendarContainer.style.left="auto",n.calendarContainer.style.right=h+"px";else n.calendarContainer.style.left=f+"px",n.calendarContainer.style.right="auto";}}}else n.config.position(n,e);}function $(){n.config.noCalendar||n.isMobile||(k(),Q(),C());}function z(){n._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(n.close,0):n.close();}function W(e){e.preventDefault(),e.stopPropagation();var t=wu(Cu(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var o=t,i=n.latestSelectedDateObj=new Date(o.dateObj.getTime()),r=(i.getMonth()<n.currentMonth||i.getMonth()>n.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=o,"single"===n.config.mode)n.selectedDates=[i];else if("multiple"===n.config.mode){var a=G(i);a?n.selectedDates.splice(parseInt(a),1):n.selectedDates.push(i);}else "range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=i,n.selectedDates.push(i),0!==Mu(i,n.selectedDates[0],!0)&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(s(),r){var l=n.currentYear!==i.getFullYear();n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth(),l&&(J("onYearChange"),k()),J("onMonthChange");}if(Q(),C(),Z(),r||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():v(o),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var c="single"===n.config.mode&&!n.config.enableTime,u="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(c||u)&&z();}f();}}n.parseDate=Iu({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=d,n._setHoursFromDate=l,n._positionCalendar=j,n.changeMonth=E,n.changeYear=P,n.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);n.input.value="",void 0!==n.altInput&&(n.altInput.value="");void 0!==n.mobileInput&&(n.mobileInput.value="");n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth());if(!0===n.config.enableTime){var o=Tu(n.config);c(o.hours,o.minutes,o.seconds);}n.redraw(),e&&J("onChange");},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active"));J("onClose");},n.onMouseOver=L,n._createElement=vu,n.createDay=g,n.destroy=function(){void 0!==n.config&&J("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t);}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput);n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete n[e];}catch(e){}});},n.isEnabled=A,n.jumpToDate=m,n.updateValue=Z,n.open=function(e,t){void 0===t&&(t=n._positionElement);if(!0===n.isMobile){if(e){e.preventDefault();var o=Cu(e);o&&o.blur();}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void J("onOpen")}if(n._input.disabled||n.config.inline)return;var i=n.isOpen;n.isOpen=!0,i||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),J("onOpen"),j(t));!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return n.hourElement.select()},50));},n.redraw=$,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var o in Object.assign(n.config,e),e)void 0!==V[o]&&V[o].forEach(function(e){return e()});else n.config[e]=t,void 0!==V[e]?V[e].forEach(function(e){return e()}):cu.indexOf(e)>-1&&(n.config[e]=hu(t));n.redraw(),Z(!0);},n.setDate=function(e,t,o){void 0===t&&(t=!1);void 0===o&&(o=n.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);Y(e,o),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),m(void 0,t),l(),0===n.selectedDates.length&&n.clear(!1);Z(t),t&&J("onChange");},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e);};var V={locale:[H,x],showMonths:[S,r,D],minDate:[m],maxDate:[m],positionElement:[K],clickOpens:[function(){!0===n.config.clickOpens?(d(n._input,"focus",n.open),d(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open));}]};function Y(e,t){var o=[];if(e instanceof Array)o=e.map(function(e){return n.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)o=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":o=[n.parseDate(e,t)];break;case"multiple":o=e.split(n.config.conjunction).map(function(e){return n.parseDate(e,t)});break;case"range":o=e.split(n.l10n.rangeSeparator).map(function(e){return n.parseDate(e,t)});}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?o:o.filter(function(e){return e instanceof Date&&A(e,!1)}),"range"===n.config.mode&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()});}function U(e){return e.slice().map(function(e){return "string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function K(){n._positionElement=n.config.positionElement||n._input;}function J(e,t){if(void 0!==n.config){var o=n.config[e];if(void 0!==o&&o.length>0)for(var i=0;o[i]&&i<o.length;i++)o[i](n.selectedDates,n.input.value,n,t);"onChange"===e&&(n.input.dispatchEvent(q("change")),n.input.dispatchEvent(q("input")));}}function q(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function G(e){for(var t=0;t<n.selectedDates.length;t++){var o=n.selectedDates[t];if(o instanceof Date&&0===Mu(o,e))return ""+t}return !1}function Q(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(e,t){var o=new Date(n.currentYear,n.currentMonth,1);o.setMonth(n.currentMonth+t),n.config.showMonths>1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=Nu(o.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=o.getMonth().toString(),e.value=o.getFullYear().toString();}),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=void 0!==n.config.maxDate&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()));}function X(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(e){return n.formatDate(e,t)}).filter(function(e,t,o){return "range"!==n.config.mode||n.config.enableTime||o.indexOf(e)===t}).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function Z(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=X(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=X(n.config.altFormat)),!1!==e&&J("onValueUpdate");}function ee(e){var t=Cu(e),o=n.prevMonthNav.contains(t),i=n.nextMonthNav.contains(t);o||i?E(o?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1);}return function(){n.element=n.input=e,n.isOpen=!1,function(){var o=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=Ou(Ou({},JSON.parse(JSON.stringify(e.dataset||{}))),t),a={};n.config.parseDate=r.parseDate,n.config.formatDate=r.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=U(e);}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=U(e);}});var s="time"===r.mode;if(!r.dateFormat&&(r.enableTime||s)){var l=Ru.defaultConfig.dateFormat||uu.dateFormat;a.dateFormat=r.noCalendar||s?"H:i"+(r.enableSeconds?":S":""):l+" H:i"+(r.enableSeconds?":S":"");}if(r.altInput&&(r.enableTime||s)&&!r.altFormat){var c=Ru.defaultConfig.altFormat||uu.altFormat;a.altFormat=r.noCalendar||s?"h:i"+(r.enableSeconds?":S K":" K"):c+" h:i"+(r.enableSeconds?":S":"")+" K";}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:R("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:R("max")});var u=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S");}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:u("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:u("max")}),"time"===r.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0);Object.assign(n.config,a,r);for(var d=0;d<o.length;d++)n.config[o[d]]=!0===n.config[o[d]]||"true"===n.config[o[d]];cu.filter(function(e){return void 0!==n.config[e]}).forEach(function(e){n.config[e]=hu(n.config[e]||[]).map(i);}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&"single"===n.config.mode&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(d=0;d<n.config.plugins.length;d++){var f=n.config.plugins[d](n)||{};for(var m in f)cu.indexOf(m)>-1?n.config[m]=hu(f[m]).map(i).concat(n.config[m]):void 0===r[m]&&(n.config[m]=f[m]);}r.altInputClass||(n.config.altInputClass=_().className+" "+n.config.altInputClass);J("onParseConfig");}(),H(),function(){if(n.input=_(),!n.input)return void n.config.errorHandler(new Error("Invalid input element specified"));n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=vu(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling));n.config.allowInput||n._input.setAttribute("readonly","readonly");K();}(),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&Y(e,n.config.dateFormat);n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]);void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i"));void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i"));n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0);}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=vu("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=vu("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=vu("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=vu("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,S(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(gu(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e);}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(gu(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e);}}),n.currentYearElement=n.yearElements[0],Q(),n.monthNav)),n.innerContainer=vu("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=vu("div","flatpickr-weekwrapper");e.appendChild(vu("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=vu("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),o=t.weekWrapper,i=t.weekNumbers;n.innerContainer.appendChild(o),n.weekNumbers=i,n.weekWrapper=o;}n.rContainer=vu("div","flatpickr-rContainer"),n.rContainer.appendChild(D()),n.daysContainer||(n.daysContainer=vu("div","flatpickr-days"),n.daysContainer.tabIndex=-1),C(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer);}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=Tu(n.config);n.timeContainer=vu("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=vu("span","flatpickr-time-separator",":"),o=bu("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=o.getElementsByTagName("input")[0];var i=bu("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});n.minuteElement=i.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=fu(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=fu(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(o),n.timeContainer.appendChild(t),n.timeContainer.appendChild(i),n.config.time_24hr&&n.timeContainer.classList.add("time24hr");if(n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var r=bu("flatpickr-second");n.secondElement=r.getElementsByTagName("input")[0],n.secondElement.value=fu(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(vu("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(r);}n.config.time_24hr||(n.amPM=vu("span","flatpickr-am-pm",n.l10n.amPM[mu((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM));return n.timeContainer}());gu(n.calendarContainer,"rangeMode","range"===n.config.mode),gu(n.calendarContainer,"animate",!0===n.config.animate),gu(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var r=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!r&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var a=vu("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(a,n.element),a.appendChild(n.element),n.altInput&&a.appendChild(n.altInput),a.appendChild(n.calendarContainer);}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer);}(),function(){n.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),function(t){return d(t,"click",n[e])});});if(n.isMobile)return void function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=vu("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr));n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d"));n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d"));n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step")));n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling);}catch(e){}d(n.mobileInput,"change",function(e){n.setDate(Cu(e).value,!1,n.mobileFormatStr),J("onChange"),J("onClose");});}();var e=pu(B,50);n._debouncedChange=pu(f,300),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&d(n.daysContainer,"mouseover",function(e){"range"===n.config.mode&&L(Cu(e));});d(n._input,"keydown",F),void 0!==n.calendarContainer&&d(n.calendarContainer,"keydown",F);n.config.inline||n.config.static||d(window,"resize",e);void 0!==window.ontouchstart?d(window.document,"touchstart",M):d(window.document,"mousedown",M);d(window.document,"focus",M,{capture:!0}),!0===n.config.clickOpens&&(d(n._input,"focus",n.open),d(n._input,"click",n.open));void 0!==n.daysContainer&&(d(n.monthNav,"click",ee),d(n.monthNav,["keyup","increment"],u),d(n.daysContainer,"click",W));if(void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){var t=function(e){return Cu(e).select()};d(n.timeContainer,["increment"],a),d(n.timeContainer,"blur",a,{capture:!0}),d(n.timeContainer,"click",p),d([n.hourElement,n.minuteElement],["focus","click"],t),void 0!==n.secondElement&&d(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),void 0!==n.amPM&&d(n.amPM,"click",function(e){a(e);});}n.config.allowInput&&d(n._input,"blur",O);}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&l(n.config.noCalendar?n.latestSelectedDateObj:void 0),Z(!1)),r();var o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&o&&j(),J("onReady");}(),n}function Bu(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),o=[],i=0;i<n.length;i++){var r=n[i];try{if(null!==r.getAttribute("data-fp-omit"))continue;void 0!==r._flatpickr&&(r._flatpickr.destroy(),r._flatpickr=void 0),r._flatpickr=Lu(r,t||{}),o.push(r._flatpickr);}catch(e){console.error(e);}}return 1===o.length?o[0]:o}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return Bu(this,e)},HTMLElement.prototype.flatpickr=function(e){return Bu([this],e)});var Ru=function(e,t){return "string"==typeof e?Bu(window.document.querySelectorAll(e),t):e instanceof Node?Bu([e],t):Bu(e,t)};Ru.defaultConfig={},Ru.l10ns={en:Ou({},du),default:Ou({},du)},Ru.localize=function(e){Ru.l10ns.default=Ou(Ou({},Ru.l10ns.default),e);},Ru.setDefaults=function(e){Ru.defaultConfig=Ou(Ou({},Ru.defaultConfig),e);},Ru.parseDate=Iu({}),Ru.formatDate=Eu({}),Ru.compareDates=Mu,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return Bu(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=Ru);const _u=["onCreate","onDestroy"],Hu=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],ju=t=>{const n=React.useMemo(()=>({...t}),[t]),{defaultValue:o,options:i={},value:r,children:s,render:l,onCreate:c,onDestroy:p}=n,h=React.useMemo(()=>((e,t)=>(Hu.forEach(n=>{const o=t[n],i=e[n];if(o){i&&!Array.isArray(i)?e[n]=[e[n]]:e[n]||(e[n]=[]);const t=Array.isArray(o)?o:[o];0===e[n].length?e[n]=t:e[n].push(...t);}}),Hu.forEach(e=>{delete t[e];}),_u.forEach(e=>{delete t[e];}),e))(i,n),[i,n]),g=React.useRef(null),v=React.useRef(void 0);React.useImperativeHandle(t.ref,()=>({get flatpickr(){return v.current}}),[]),React.useEffect(()=>{return h.onClose=h.onClose||(()=>{var e;null!=(e=g.current)&&e.blur&&g.current.blur();}),v.current=((null==(e=Ru)?void 0:e.default)||Ru)(g.current,h),null==c||c(v.current),()=>{null==p||p(v.current),v.current&&v.current.destroy(),v.current=void 0;};var e;},[h,c,p]),React.useEffect(()=>{var e;if(v.current){const t=Object.getOwnPropertyNames(h);for(let n=t.length-1;n>=0;n--){const o=t[n];let i=h[o];(null==i?void 0:i.toString())!==(null==(e=v.current.config[o])?void 0:e.toString())&&(Hu.includes(o)&&!Array.isArray(i)&&(i=[i]),v.current.set(o,i));}void 0!==r&&r!==v.current.input.value&&v.current.setDate(r,!1);}},[h,r]);const y=React.useCallback(e=>{g.current=e;},[]);if(l)return l({...n,defaultValue:o,value:r},y);const w=React.useCallback(e=>{var n,o;t&&t.onChange&&(Array.isArray(null==t?void 0:t.onChange)?null==(n=null==t?void 0:t.onChange)||n.forEach(()=>[new Date(e.target.value)],(null==r?void 0:r.toString())||""):"function"==typeof t.onChange&&(null==(o=null==t?void 0:t.onChange)||o.call(t,[new Date(e.target.value)],(null==r?void 0:r.toString())||"",v.current)));},[t,r]);return i.wrap?jsxRuntime.jsx("div",{className:"flatpickr",ref:y,children:s}):jsxRuntime.jsx("input",{onChange:w,...n,value:null==r?void 0:r.toString(),defaultValue:o,ref:y})},$u="T42.GD.Execute",zu=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Wu=(e,t)=>e in t;function Vu({time:e,frequency:t,day:n}){const o=new Date(`01/01/2000 ${e}`),i=o.getMinutes(),r=o.getHours();let a="*";return "weekly"===t&&n&&(a=function(e){const t={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!Wu(e,t))throw new Error(`Invalid day: ${e}`);return t[e]}(n).toString()),`${i} ${r} * * ${a}`}function Yu(e){const t=React.useContext(reactHooks.IOConnectContext),{value:n,update:o}=xa({prefKey:Uu(e)}),{value:i,update:r}=xa({prefKey:Uu(e,"Time")}),{value:s,update:c}=xa({prefKey:Uu(e,"Frequency")}),{value:u,update:d}=xa({prefKey:Uu(e,"Day")}),m=React.useCallback(async()=>{try{await t.interop.invoke($u,{command:`cancel-${e}`});}catch(e){console.error(e);}},[t,e]),p=React.useCallback(async()=>{try{const n=Vu({time:i??"12:00 AM",frequency:s??"daily",day:"weekly"===s?u:"*"});await t.interop.invoke($u,{command:`schedule-${e}`,args:{cronTime:n,discardUnsavedLayoutChanges:!1}});}catch(t){console.error(`Failed to update cron job for ${e}:`,t);}},[t,e,i,s,u]);React.useEffect(()=>{t&&n&&p();},[t,n,p]);return {enabled:n??!1,time:i??"12:00 AM",frequency:s??"daily",day:u??"Monday",setEnabled:async e=>{e||await m();try{await o(e);}catch(e){console.error("Failed to update enabled state:",e);}},setTime:async e=>{try{await r(e);}catch(e){console.error("Failed to update time:",e);}},setFrequency:async e=>{try{await c(e),"daily"===e&&await d(void 0);}catch(e){console.error("Failed to update frequency:",e);}},setDay:async e=>{var t;if(t=e,zu.includes(t))try{await d(e);}catch(e){console.error("Failed to update day:",e);}else console.error("Invalid day provided");}}}function Uu(e,t){const n="restart"===e?"_system_scheduleRestart":"_system_scheduleShutdown";return t?`${n}${t}`:n}function Ku({className:n,variant:o,...i}){const r=N("io-block-list-gap",o,n),{enabled:a,time:s,frequency:l,day:c,setEnabled:u,setTime:d,setFrequency:f,setDay:m}=Yu(o);return jsxRuntime.jsxs(P,{className:r,...i,children:[jsxRuntime.jsx(fi,{label:`Schedule ${o}`,align:"right",onChange:e=>u(e.target.checked),checked:a}),jsxRuntime.jsxs("div",{className:"scheduler-controls",children:[jsxRuntime.jsxs("div",{className:"io-control-input io-control-leading-icon direction-up",children:[jsxRuntime.jsx(S,{variant:"clock"}),jsxRuntime.jsx(ju,{className:"io-input",options:{enableTime:!0,noCalendar:!0,dateFormat:"h:i K",defaultDate:s,clickOpens:!0},value:s,onClose:async([e])=>{const t=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0});await d(t);}})]}),jsxRuntime.jsxs(Ko,{text:l.charAt(0).toUpperCase()+l.slice(1),icon:"chevron-down",iconRight:!0,children:[jsxRuntime.jsx(Ko.Item,{onClick:()=>f("daily"),children:"Daily"}),jsxRuntime.jsx(Ko.Item,{onClick:()=>f("weekly"),children:"Weekly"})]}),"weekly"===l&&jsxRuntime.jsx(Ko,{text:c,icon:"chevron-down",iconRight:!0,children:zu.map(t=>jsxRuntime.jsx(Ko.Item,{onClick:()=>m(t),children:t},t))})]})]})}function Ju({className:t,...n}){return jsxRuntime.jsx(Ku,{...n,className:t,variant:"restart"})}function qu({className:t,...n}){return jsxRuntime.jsx(Ku,{...n,className:t,variant:"shutdown"})}const Gu={Body:Wc,General:Vc,Theme:Uc,PinnedPosition:Jc,AllowDocking:Gc,MinimizeToTray:Qc,AutoClose:Xc,ShowTutorialOnStartup:Zc,Layouts:eu,LayoutsRestoreLastSaved:tu,LayoutsSaveCurrentOnExit:nu,LayoutsShowUnsavedChangesPrompt:ou,LayoutsShowDeletePrompt:iu,Downloads:ru,DownloadsAskForEachDownload:au,DownloadsLocation:su,System:lu,SystemRestartSection:Ju,SystemShutdownSection:qu},Qu=React.createContext(Gu),Xu=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...Gu,...n}),[n]);return jsxRuntime.jsx(Qu.Provider,{value:o,children:t})});Xu.displayName="PreferencesPanelComponentsStoreProvider";const Zu=()=>React.useContext(Qu),ed=({className:n,onClose:o,title:i="Platform Preferences",children:r,...a})=>jsxRuntime.jsxs(Zo,{className:N("io-preferences-panel",n),"data-testid":"preferences-panel",...a,children:[jsxRuntime.jsxs(Zo.Header,{"data-testid":"preferences-panel-header",children:[jsxRuntime.jsx(Zo.Header.Title,{size:"large",text:i,tag:"h1","data-testid":"preferences-panel-title"}),jsxRuntime.jsx(Zo.Header.ButtonGroup,{children:jsxRuntime.jsx(Zo.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:o,"data-testid":"preferences-panel-close-button"})})]}),r]}),td=({onClose:t,title:n="Platform Preferences",...o})=>{const{Body:i}=Zu();return jsxRuntime.jsx(ed,{title:n,onClose:t,...o,children:jsxRuntime.jsx(i,{})})},nd=({components:t,...n})=>jsxRuntime.jsx(Xu,{components:t,children:jsxRuntime.jsx(td,{...n})});Object.freeze({__proto__:null,AllowDocking:Gc,AutoClose:Xc,Downloads:ru,DownloadsAskForEachDownload:au,DownloadsLocation:su,General:Vc,Layouts:eu,LayoutsRestoreLastSaved:tu,LayoutsSaveCurrentOnExit:nu,LayoutsShowDeletePrompt:iu,LayoutsShowUnsavedChangesPrompt:ou,MinimizeToTray:Qc,Panel:nd,PanelBody:Wc,PinnedPosition:Jc,ShowTutorialOnStartup:Zc,System:lu,SystemRestartSection:Ju,SystemShutdownSection:qu,Theme:Uc});const id=n=>{const{General:o,Layouts:i}=ud();return jsxRuntime.jsxs(Qo,{...n,children:[jsxRuntime.jsx(o,{}),jsxRuntime.jsx(i,{})]})},rd=({title:t="General",...n})=>{const{Theme:o}=ud();return jsxRuntime.jsx(P,{title:t,"data-testid":"preferences-panel-general-block",...n,children:jsxRuntime.jsx(o,{})})},ad=({title:t="Layouts",...n})=>{const{LayoutsShowDeletePrompt:o}=ud();return jsxRuntime.jsx(P,{title:t,"data-testid":"preferences-panel-layouts-block",...n,children:jsxRuntime.jsx(o,{})})},sd={Body:id,General:rd,Theme:Uc,Layouts:ad,LayoutsShowUnsavedChangesPrompt:ou,LayoutsShowDeletePrompt:iu},ld=React.createContext(sd),cd=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...sd,...n}),[n]);return jsxRuntime.jsx(ld.Provider,{value:o,children:t})});cd.displayName="PreferencesPanelComponentsStoreProvider";const ud=()=>React.useContext(ld),dd=({onClose:t,title:n="Platform Preferences",...o})=>{const{Body:i}=ud();return jsxRuntime.jsx(ed,{title:n,onClose:t,...o,children:jsxRuntime.jsx(i,{})})};Object.freeze({__proto__:null,General:rd,Layouts:ad,LayoutsShowDeletePrompt:iu,LayoutsShowUnsavedChangesPrompt:ou,Panel:({components:t,...n})=>jsxRuntime.jsx(cd,{components:t,children:jsxRuntime.jsx(dd,{...n})}),PanelBody:id,Theme:Uc});const md=({actionButtons:t,actionButtonElementsRefs:n,isAutofocusButton:o,isButtonDisabled:i,onButtonClick:r})=>jsxRuntime.jsx(Z,{"data-testid":"io-dialog-action-buttons-group",align:"right",children:t.map((t,a)=>{const{id:s,text:l,variant:c}=t,u=o(s);return jsxRuntime.jsx(T,{"data-testid":`io-dialog-action-button-${s}`,id:s,ref:e=>{0===a&&(n.current=[]),n.current[a]=e;},className:u?"io-focus-button":void 0,disabled:i(s),onClick:()=>r(t),variant:c,children:l},s)})}),pd=({actionButtons:n,children:o,onCompletion:i,size:r,title:a=(wi()?"io.Connect Desktop":"io.Connect Browser"),validationErrors:s=[]})=>{const{actionButtonElementsRefs:l,autofocusButtonId:f,hasAutofocusButtonLostInitialFocus:m}=(e=>{const t=React.useRef([]),n=React.useMemo(()=>e.find(e=>e.autofocus)?.id??null,[e]),o=React.useRef(n),[i,r]=React.useState(!o.current);return React.useLayoutEffect(()=>{if(i)return;if(n!==o.current)return void r(!0);const e=t.current.find(e=>e?.id===n);if(!e)return;e.focus();const a=()=>{r(!0);};return e.addEventListener("blur",a),()=>{e.removeEventListener("blur",a);}},[n,i]),{actionButtonElementsRefs:t,autofocusButtonId:n,hasAutofocusButtonLostInitialFocus:i}})(n),h=()=>{i({isClosed:!0});},g={...r};return jsxRuntime.jsxs(re,{className:"io-dialog-template",closeFn:h,isOpen:!0,onCancel:e=>{e.preventDefault(),h();},onKeyDown:e=>{!A(e)||s.length||e.target instanceof HTMLButtonElement||" "===e.key&&e.target instanceof HTMLInputElement||i({isEnterPressed:!0});},style:g,title:a,children:[jsxRuntime.jsx(re.Body,{children:o}),jsxRuntime.jsx(re.Footer,{children:jsxRuntime.jsx(md,{actionButtonElementsRefs:l,actionButtons:n,isAutofocusButton:e=>f===e&&!m,isButtonDisabled:e=>s.some(t=>t.disabledButtonIds.some(t=>t===e)),onButtonClick:({id:e,text:t})=>{i({responseButtonClicked:{id:e,text:t}});}})})]})},hd=({children:t})=>jsxRuntime.jsx("h3",{"data-testid":"io-dialog-heading",className:"io-dialog-template-heading",children:t});Object.freeze({__proto__:null,NoInputsConfirmationDialog:({onCompletion:n,size:o,variables:i})=>{const{actionButtons:r,heading:a,text:s,title:l}=i;return jsxRuntime.jsx(pd,{actionButtons:r,onCompletion:n,size:o,title:l,children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(hd,{children:a}),jsxRuntime.jsx("p",{"data-testid":"io-dialog-text",children:s})]})})},SingleCheckboxDialog:({onCompletion:n,size:o,variables:i})=>{const{actionButtons:r,checkbox:s,heading:l,text:u,title:d}=i,[f,m]=React.useState(s.initialValue),p=React.useCallback(()=>m(e=>!e),[]),h=[{id:s.id,type:"checkbox",checked:f}];return jsxRuntime.jsxs(pd,{actionButtons:r,onCompletion:e=>n({...e,inputs:h}),size:o,title:d,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(hd,{children:l}),jsxRuntime.jsx("p",{"data-testid":"io-dialog-text",children:u})]}),jsxRuntime.jsx(ri,{"data-testid":`io-dialog-checkbox-${s.id}`,checked:f,id:s.id,label:s.label,name:s.id,onChange:p})]})},SingleTextInputDialog:({onCompletion:n,size:o,variables:i})=>{const{actionButtons:r,heading:a,input:s,title:l}=i,[u,f]=React.useState(s.initialValue??""),m=React.useRef(null),h=(g=u,!(v=s.validation)||new RegExp(v.regexPattern).test(g)?null:{disabledButtonIds:v.disabledButtonIds,message:v.errorMessage});var g,v;const y=[{id:s.id,type:"text",value:u}];return React.useLayoutEffect(()=>{m.current?.select();},[]),jsxRuntime.jsxs(pd,{actionButtons:r,onCompletion:e=>n({...e,inputs:y}),size:o,title:l,validationErrors:h?[h]:[],children:[jsxRuntime.jsx(hd,{children:a}),jsxRuntime.jsx(oi,{"data-testid":`io-dialog-input-${s.id}`,ref:m,errorDataTestId:`io-dialog-input-${s.id}-error-message`,errorMessage:h?.message,id:s.id,label:s.label,name:s.id,onChange:e=>f(e.target.value),placeholder:s.placeholder,type:"text",value:u})]})}});const vd=({name:n,value:o})=>jsxRuntime.jsxs("div",{className:"io-profile-section-item",children:[jsxRuntime.jsx("div",{className:"io-profile-section-item-name",children:n}),jsxRuntime.jsx("div",{className:"io-profile-section-item-value",children:o})]}),yd=({className:n,items:o,title:i})=>jsxRuntime.jsxs("div",{className:N("io-profile-section-body",n),children:[i&&jsxRuntime.jsx(M,{className:"io-profile-section-title",text:i}),o.map(({name:t,value:n})=>jsxRuntime.jsx(vd,{name:t,value:n},t))]}),wd=({className:n,items:o,title:i})=>jsxRuntime.jsxs("section",{className:N("io-profile-section",n),children:[jsxRuntime.jsx(yd,{items:o,title:i}),jsxRuntime.jsx(q,{className:"mt-8"})]}),bd=({title:t="License",...n})=>jsxRuntime.jsx(wd,{title:t,...n}),Cd=({title:t="Version",...n})=>jsxRuntime.jsx(wd,{title:t,...n}),kd=({title:t="Plugins",...n})=>jsxRuntime.jsx(wd,{title:t,...n}),Nd=({className:n})=>{const o=wi()?"io.Connect Desktop":"io.Connect Browser";return jsxRuntime.jsxs("div",{className:N("io-trademark-container",n),children:[jsxRuntime.jsx("h4",{className:"io-trademark-title",children:o}),jsxRuntime.jsxs("p",{className:"io-trademark-text",children:[o,"® is a registered trademark of"," ",jsxRuntime.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",(new Date).getFullYear(),". All rights reserved."]})]})},Sd=({avatarInitials:n=(wi()?"CD":"CB"),className:o,items:i,onLogout:r,title:a})=>jsxRuntime.jsxs("section",{className:N("io-profile-section",o),children:[jsxRuntime.jsxs("div",{className:"io-user-details-container",children:[jsxRuntime.jsx("div",{className:"io-user-avatar",children:n}),jsxRuntime.jsx(yd,{className:"mt-12",items:i,title:a})]}),r&&jsxRuntime.jsx(T,{className:"io-log-out-button",onClick:r,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),jsxRuntime.jsx(q,{className:"mt-8"})]}),Dd={LicenseSection:bd,ProductsInfoSection:Cd,PluginsSection:kd,Trademark:Nd,UserSection:Sd},xd=React.createContext(Dd),Ed=React.memo(({children:t,components:n})=>{const o=React.useMemo(()=>({...Dd,...n}),[n]);return jsxRuntime.jsx(xd.Provider,{value:o,children:t})});Ed.displayName="ProfilePanelComponentsStoreProvider";const Id=e=>{const t=new Date(e);return [{day:"numeric"},{month:"short"},{year:"numeric"}].map(e=>t.toLocaleDateString("en",e)).join(" ")},Md=e=>{if(!e)return {items:[]};const t=[...e.email?[{name:"Email",value:e.email}]:[],...e.type?[{name:"User Type",value:e.type}]:[],...e.role?[{name:"User Role",value:e.role}]:[],{name:"User ID",value:e.id}];if(e.firstName||e.lastName){const n=[e.firstName,e.lastName].filter(e=>!!e);return {avatarInitials:n.map(e=>e.charAt(0)).join(""),items:t,title:n.join(" ")}}return e.username?{avatarInitials:e.username.charAt(0),items:t,title:e.username}:e.email?{avatarInitials:e.email.charAt(0),items:t}:{items:t}},Pd=e=>{const t=new Date(2023,5,6),n=e.expiration<t.getTime()?1e3:1;return {items:[{name:"Type",value:e.type},{name:"Expiration Date",value:Id(e.expiration*n)}]}},Ad=e=>({items:e.map(e=>({name:e.name,value:e.version}))}),Td=e=>{const t={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return {items:[{name:"io.Connect Browser platform",value:e.platform.apiVersion},{name:"io.Connect Browser client",value:e.client.apiVersion},...e.workspaces?[{name:"Workspaces API",value:e.workspaces.apiVersion}]:[],...e.workspaces?.container&&Wu(e.workspaces.container.type,t)?[{name:t[e.workspaces.container.type],value:e.workspaces.container.version}]:[],...e.home?[{name:"Home UI",value:e.home.version}]:[],...e.search?[{name:"Search API",value:e.search.apiVersion}]:[],...e.modals?[{name:"Modals API",value:e.modals.apiVersion}]:[]]}},Od=()=>{const e=window.glue42gd??window.iodesktop;if(!e)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:t,env:n}=e,o=[{name:"Environment",value:n.env},{name:"Region",value:n.region}];return t?{avatarInitials:t.charAt(0),items:o,title:t}:{items:o}},Fd=e=>{const t=Object.entries(e??{}).map(([e,t])=>({name:e,value:t}));return {items:t}},Ld=e=>{const t=e.map(({product:e,version:t})=>({name:e,value:t}));return {items:t}},Bd=e=>wi()?(async e=>{const{licInfo:t,productInfo:n}=(await e.interop.invoke("T42.GD.GetInfo")).returned;return {user:Od(),license:Fd(t),productsInfo:Ld(n)}})(e):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const e=await window.iobrowser.system.getProfileData();return {user:Md(e.user),license:Pd(e.license),plugins:Ad(e.plugins),productsInfo:Td(e.productsInfo)}})(),Rd=({className:n,onClose:o,onLogout:i,title:r="Profile",...a})=>{const{LicenseSection:s,ProductsInfoSection:u,PluginsSection:d,Trademark:m,UserSection:p}=React.useContext(xd),h=React.useContext(reactHooks.IOConnectContext),[g,v]=React.useState(null);return React.useEffect(()=>{if(!h)return;(async()=>{const e=await Bd(h);v(e);})().catch(console.error);},[h]),jsxRuntime.jsxs(Zo,{className:N("io-profile-panel",n),"data-testid":"profile-panel",...a,children:[jsxRuntime.jsxs(Zo.Header,{children:[jsxRuntime.jsx(Zo.Header.Title,{size:"large",text:r}),jsxRuntime.jsx(Zo.Header.ButtonGroup,{children:jsxRuntime.jsx(Zo.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:o})})]}),jsxRuntime.jsxs(Zo.Body,{children:[g?.user.items.length||g?.user.title?jsxRuntime.jsx(p,{avatarInitials:g.user.avatarInitials,items:g.user.items,onLogout:i,title:g.user.title}):null,jsxRuntime.jsxs("div",{className:"io-scrollable-profile-sections-container",children:[g?.license.items.length?jsxRuntime.jsx(s,{items:g.license.items}):null,g?.productsInfo.items.length?jsxRuntime.jsx(u,{items:g.productsInfo.items}):null,g?.plugins?.items.length?jsxRuntime.jsx(d,{items:g.plugins.items}):null]}),jsxRuntime.jsx(m,{className:"mt-auto"})]})]})},_d=({components:t,...n})=>jsxRuntime.jsx(Ed,{components:t,children:jsxRuntime.jsx(Rd,{...n})});Object.freeze({__proto__:null,LicenseSection:bd,Panel:_d,PluginsSection:kd,ProductsInfoSection:Cd,Trademark:Nd,UserSection:Sd});const jd=React.createContext(void 0),$d=()=>{const e=React.useContext(jd);if(!e)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return e},zd=document.querySelector("#root")??document.body,Wd={preferences:nd,"notification-settings":_l,profile:_d};Object.freeze({__proto__:null,ActivePanelRenderer:()=>{const{panel:t,deselectPanel:n}=$d();Q(()=>{t&&n();},["Escape"]);const o=t?Wd[t]:null;return o?ReactDOM.createPortal(jsxRuntime.jsx("div",{className:"io-panel-overlay",children:jsxRuntime.jsx(o,{onClose:n})}),zd):null},PanelManagerProvider:({children:t})=>{const[n,o]=React.useState(null),i=React.useCallback(e=>{o(e);},[]),r=React.useCallback(()=>{o(null);},[]),s=React.useMemo(()=>({panel:n,selectPanel:i,deselectPanel:r}),[n,i,r]);return jsxRuntime.jsx(jd.Provider,{value:s,children:t})},usePanelManagerContext:$d});
3372
+
3373
+ function useExternalWindowPopup() {
3374
+ var _this = this;
3375
+ var _a = ki(), getContainer = _a.getContainer, closePopup = _a.closePopup, createPopup = _a.createPopup, hidePopup = _a.hidePopup, showPopup = _a.showPopup, isOpen = _a.isOpen, isVisible = _a.isVisible, popup = _a.popup;
3376
+ var resizePopup = React.useCallback(function (size) { return __awaiter(_this, void 0, void 0, function () {
3377
+ return __generator(this, function (_a) {
3378
+ switch (_a.label) {
3379
+ case 0: return [4 /*yield*/, (popup === null || popup === void 0 ? void 0 : popup.ioConnectWindow.moveResize(__assign({}, size)))];
3380
+ case 1:
3381
+ _a.sent();
3382
+ return [2 /*return*/];
3383
+ }
3384
+ });
3385
+ }); }, [popup]);
3386
+ return {
3387
+ getContainer: getContainer,
3388
+ closePopup: closePopup,
3389
+ createPopup: createPopup,
3390
+ hidePopup: hidePopup,
3391
+ showPopup: showPopup,
3392
+ isOpen: isOpen,
3393
+ isVisible: isVisible,
3394
+ resizePopup: resizePopup,
3395
+ popup: popup
3396
+ };
3397
+ }
3398
+
3529
3399
  var getGroupId = function () { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.getGroupId(); };
3530
3400
  var requestPageFocus = function () { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.requestPageFocus(); };
3531
3401
  var requestFrameFocus = function (frameId) { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.requestFrameFocus(frameId); };
@@ -3585,7 +3455,9 @@
3585
3455
  exports.useCommitFlatCaptionEditingRequested = useCommitFlatCaptionEditingRequested;
3586
3456
  exports.useCommitGroupCaptionEditingRequested = useCommitGroupCaptionEditingRequested;
3587
3457
  exports.useCommitTabCaptionEditingRequested = useCommitTabCaptionEditingRequested;
3458
+ exports.useDragMove = useDragMove;
3588
3459
  exports.useEditableCaption = useEditableCaption;
3460
+ exports.useExternalWindowPopup = useExternalWindowPopup;
3589
3461
  exports.useGroupComponentVisibility = useGroupComponentVisibility;
3590
3462
  exports.useIOConnectWindow = useIOConnectWindow;
3591
3463
  exports.waitForWindow = waitForWindow;