@appquality/unguess-design-system 3.1.109-attachments → 3.1.110

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 (161) hide show
  1. package/.github/workflows/release.yml +7 -0
  2. package/.github/workflows/storybook.yml +2 -2
  3. package/CHANGELOG.md +322 -0
  4. package/build/index.d.ts +11 -10
  5. package/build/index.js +1640 -728
  6. package/build/stories/accordions/index.stories.d.ts +5 -5
  7. package/build/stories/alerts/index.d.ts +12 -7
  8. package/build/stories/alerts/index.stories.d.ts +2 -2
  9. package/build/stories/avatar/InternalAvatar.d.ts +2 -0
  10. package/build/stories/avatar/index.stories.d.ts +4 -4
  11. package/build/stories/breadcrumbs/index.stories.d.ts +2 -2
  12. package/build/stories/buttons/anchor/index.stories.d.ts +4 -4
  13. package/build/stories/buttons/button/index.d.ts +14 -9
  14. package/build/stories/buttons/button/index.stories.d.ts +6 -7
  15. package/build/stories/buttons/button-group/index.stories.d.ts +4 -4
  16. package/build/stories/buttons/icon-button/index.stories.d.ts +5 -5
  17. package/build/stories/buttons/split-button/index.stories.d.ts +2 -2
  18. package/build/stories/buttons/utils.d.ts +120 -111
  19. package/build/stories/campaign-cards/index.stories.d.ts +3 -3
  20. package/build/stories/cards/container.stories.d.ts +2 -2
  21. package/build/stories/cards/index.stories.d.ts +3 -3
  22. package/build/stories/charts/bar/index.stories.d.ts +3 -3
  23. package/build/stories/charts/bullet/index.stories.d.ts +3 -3
  24. package/build/stories/charts/halfPie/index.stories.d.ts +2 -2
  25. package/build/stories/charts/pie/index.stories.d.ts +4 -4
  26. package/build/stories/charts/sentiment/index.stories.d.ts +3 -3
  27. package/build/stories/charts/sunburst/index.stories.d.ts +3 -3
  28. package/build/stories/charts/waffle/index.stories.d.ts +3 -3
  29. package/build/stories/chat/_types.d.ts +2 -2
  30. package/build/stories/chat/index.d.ts +8 -4
  31. package/build/stories/chat/index.stories.d.ts +6 -6
  32. package/build/stories/chat/parts/ThumbnailContainer/Thumbnail.d.ts +2 -2
  33. package/build/stories/chat/parts/ThumbnailContainer/index.d.ts +0 -8
  34. package/build/stories/chat/parts/containers.d.ts +13 -6
  35. package/build/stories/chat/parts/header.d.ts +10 -5
  36. package/build/stories/color-swatch/index.stories.d.ts +3 -3
  37. package/build/stories/drawers/index.stories.d.ts +2 -2
  38. package/build/stories/dropdowns/autocomplete/index.stories.d.ts +3 -3
  39. package/build/stories/dropdowns/countermultiselect/index.stories.d.ts +2 -2
  40. package/build/stories/dropdowns/field/index.d.ts +12 -7
  41. package/build/stories/dropdowns/menu/index.stories.d.ts +3 -3
  42. package/build/stories/dropdowns/select/index.d.ts +8 -4
  43. package/build/stories/dropdowns/select/index.stories.d.ts +3 -4
  44. package/build/stories/editor/index.stories.d.ts +6 -7
  45. package/build/stories/forms/checkbox/cards/index.stories.d.ts +3 -3
  46. package/build/stories/forms/checkbox/index.stories.d.ts +2 -2
  47. package/build/stories/forms/input/index.d.ts +13 -8
  48. package/build/stories/forms/input/index.stories.d.ts +5 -5
  49. package/build/stories/forms/input-toggle/index.d.ts +10 -7
  50. package/build/stories/forms/input-toggle/index.stories.d.ts +6 -6
  51. package/build/stories/forms/mediaInput/index.stories.d.ts +5 -5
  52. package/build/stories/forms/radio/cards/index.stories.d.ts +3 -3
  53. package/build/stories/forms/radio/index.stories.d.ts +3 -3
  54. package/build/stories/forms/textarea/index.stories.d.ts +4 -4
  55. package/build/stories/forms/toggle/index.stories.d.ts +2 -2
  56. package/build/stories/grid/col/index.stories.d.ts +4 -4
  57. package/build/stories/grid/grid/index.stories.d.ts +4 -4
  58. package/build/stories/grid/row/index.stories.d.ts +2 -2
  59. package/build/stories/highlight/CreateObservationButton.d.ts +19 -0
  60. package/build/stories/highlight/_types.d.ts +9 -8
  61. package/build/stories/highlight/demo-parts/data.d.ts +55 -0
  62. package/build/stories/highlight/demo-parts/sentiment-tag.d.ts +7 -0
  63. package/build/stories/highlight/demo-parts/transcript-base.d.ts +5 -0
  64. package/build/stories/highlight/demo-parts/transcript-diarization.d.ts +5 -0
  65. package/build/stories/highlight/demo-parts/transcript-paragraph.d.ts +5 -0
  66. package/build/stories/highlight/demo-parts/transcript-sentiment.d.ts +5 -0
  67. package/build/stories/highlight/index.stories.d.ts +11 -12
  68. package/build/stories/highlight/searchable.d.ts +1 -2
  69. package/build/stories/icons/index.stories.d.ts +2 -2
  70. package/build/stories/info-cards/index.stories.d.ts +3 -3
  71. package/build/stories/label/index.d.ts +12 -9
  72. package/build/stories/label/index.stories.d.ts +3 -3
  73. package/build/stories/lightbox/index.stories.d.ts +2 -2
  74. package/build/stories/lightbox/parts/body.d.ts +26 -15
  75. package/build/stories/lightbox/parts/footer.d.ts +11 -6
  76. package/build/stories/loaders/dots/index.stories.d.ts +2 -2
  77. package/build/stories/loaders/progress/index.stories.d.ts +2 -2
  78. package/build/stories/loaders/skeleton/index.stories.d.ts +3 -3
  79. package/build/stories/loaders/spinner/index.stories.d.ts +2 -2
  80. package/build/stories/login-form/index.stories.d.ts +3 -3
  81. package/build/stories/logo/index.stories.d.ts +2 -2
  82. package/build/stories/modals/fullscreen/index.d.ts +46 -32
  83. package/build/stories/modals/fullscreen/index.stories.d.ts +2 -2
  84. package/build/stories/modals/index.d.ts +11 -6
  85. package/build/stories/modals/index.stories.d.ts +5 -5
  86. package/build/stories/multiselect/index.stories.d.ts +3 -3
  87. package/build/stories/navigation/app-header/index.stories.d.ts +3 -3
  88. package/build/stories/navigation/header/header-item/brandItem.d.ts +12 -7
  89. package/build/stories/navigation/nav/nav-item/accordionItem.d.ts +3 -1
  90. package/build/stories/navigation/page-header/index.d.ts +43 -26
  91. package/build/stories/navigation/page-header/index.stories.d.ts +5 -5
  92. package/build/stories/navigation/page-header/styled/main.d.ts +46 -28
  93. package/build/stories/notifications/index.stories.d.ts +3 -3
  94. package/build/stories/pagination/index.stories.d.ts +3 -3
  95. package/build/stories/player/_types.d.ts +21 -2
  96. package/build/stories/player/hooks/usePictureInPicture.d.ts +4 -0
  97. package/build/stories/player/index.d.ts +7 -2
  98. package/build/stories/player/index.stories.d.ts +7 -5
  99. package/build/stories/player/parts/CutStart.d.ts +4 -0
  100. package/build/stories/player/parts/controlButton.d.ts +294 -0
  101. package/build/stories/player/parts/controls.d.ts +11 -5
  102. package/build/stories/player/parts/floatingControls.d.ts +1 -0
  103. package/build/stories/product-cards/index.stories.d.ts +3 -3
  104. package/build/stories/profile-modal/_types.d.ts +3 -2
  105. package/build/stories/profile-modal/components/menuItem.d.ts +9 -4
  106. package/build/stories/profile-modal/index.stories.d.ts +2 -2
  107. package/build/stories/profile-modal/items/languageMenuItem.d.ts +2 -1
  108. package/build/stories/profile-modal/items/settingsMenuItem.d.ts +2 -2
  109. package/build/stories/service-cards/index.stories.d.ts +3 -3
  110. package/build/stories/slider/index.stories.d.ts +3 -3
  111. package/build/stories/slider/parts/container.d.ts +10 -5
  112. package/build/stories/special-cards/index.d.ts +47 -30
  113. package/build/stories/special-cards/index.stories.d.ts +2 -2
  114. package/build/stories/special-cards/styled/header.d.ts +38 -21
  115. package/build/stories/stepper/index.d.ts +32 -21
  116. package/build/stories/stepper/index.stories.d.ts +3 -3
  117. package/build/stories/table/index.stories.d.ts +11 -11
  118. package/build/stories/tabs/index.stories.d.ts +3 -3
  119. package/build/stories/tags/index.d.ts +28 -20
  120. package/build/stories/tags/index.stories.d.ts +6 -6
  121. package/build/stories/theme/colors.stories.d.ts +20 -0
  122. package/build/stories/theme/palette.stories.d.ts +1 -1
  123. package/build/stories/tiles/index.stories.d.ts +4 -4
  124. package/build/stories/timeline/index.d.ts +14 -7
  125. package/build/stories/timeline/index.stories.d.ts +4 -4
  126. package/build/stories/title/index.stories.d.ts +2 -2
  127. package/build/stories/tooltip/_types.d.ts +1 -0
  128. package/build/stories/tooltip/index.d.ts +1 -278
  129. package/build/stories/tooltip/index.stories.d.ts +3 -2
  130. package/build/stories/tooltip-modal/index.stories.d.ts +2 -2
  131. package/build/stories/transcript/_data.d.ts +17 -0
  132. package/build/stories/transcript/extensions/theme/index.d.ts +347 -0
  133. package/build/stories/transcript/findActiveWord.d.ts +2 -0
  134. package/build/stories/transcript/floatingMenu.d.ts +8 -0
  135. package/build/stories/transcript/getParsedContent.d.ts +26 -0
  136. package/build/stories/transcript/index.d.ts +53 -0
  137. package/build/stories/transcript/index.stories.d.ts +23 -0
  138. package/build/stories/transcript/nodes/active/Component.d.ts +6 -0
  139. package/build/stories/transcript/nodes/active/index.d.ts +4 -0
  140. package/build/stories/transcript/nodes/observation/Component.d.ts +6 -0
  141. package/build/stories/transcript/nodes/observation/index.d.ts +2 -0
  142. package/build/stories/transcript/nodes/paragraph/Component.d.ts +6 -0
  143. package/build/stories/transcript/nodes/paragraph/index.d.ts +2 -0
  144. package/build/stories/transcript/nodes/word/Component.d.ts +6 -0
  145. package/build/stories/transcript/nodes/word/index.d.ts +2 -0
  146. package/build/stories/transcript/search.d.ts +9 -0
  147. package/build/stories/transcript/useEditor.d.ts +11 -0
  148. package/build/stories/typography/block-quote/index.stories.d.ts +2 -2
  149. package/build/stories/typography/code/index.stories.d.ts +4 -4
  150. package/build/stories/typography/ellipsis/index.stories.d.ts +2 -2
  151. package/build/stories/typography/lists/ordered.stories.d.ts +2 -2
  152. package/build/stories/typography/lists/unordered.stories.d.ts +2 -2
  153. package/build/stories/typography/paragraph/index.stories.d.ts +2 -2
  154. package/build/stories/typography/span/index.stories.d.ts +2 -2
  155. package/build/stories/typography/typescale/anchortag/index.stories.d.ts +2 -2
  156. package/build/stories/typography/typescale/index.d.ts +29 -12
  157. package/build/stories/typography/typescale/index.stories.d.ts +2 -2
  158. package/package.json +30 -20
  159. package/yarn-error.log +0 -17994
  160. /package/build/stories/player/{parts → context}/progressContext.d.ts +0 -0
  161. /package/build/stories/player/{parts/utils.d.ts → utils.d.ts} +0 -0
package/build/index.js CHANGED
@@ -21,9 +21,9 @@ var bullet = require('@nivo/bullet');
21
21
  var web = require('@react-spring/web');
22
22
  var tooltip = require('@nivo/tooltip');
23
23
  var pie = require('@nivo/pie');
24
+ var line = require('@nivo/line');
24
25
  var sunburst = require('@nivo/sunburst');
25
26
  var waffle = require('@nivo/waffle');
26
- var line = require('@nivo/line');
27
27
  var reactForms = require('@zendeskgarden/react-forms');
28
28
  var react = require('@tiptap/react');
29
29
  var reactTooltips = require('@zendeskgarden/react-tooltips');
@@ -38,10 +38,10 @@ var Mention = require('@tiptap/extension-mention');
38
38
  var tippy = require('tippy.js');
39
39
  var Image$2 = require('@tiptap/extension-image');
40
40
  var Dropcursor = require('@tiptap/extension-dropcursor');
41
- var reactGrid = require('@zendeskgarden/react-grid');
42
41
  var reactModals = require('@zendeskgarden/react-modals');
43
42
  var SlickSlider = require('react-slick');
44
43
  var Video = require('@appquality/stream-player');
44
+ var reactGrid = require('@zendeskgarden/react-grid');
45
45
  var containerUtilities = require('@zendeskgarden/container-utilities');
46
46
  var reactColorpickers = require('@zendeskgarden/react-colorpickers');
47
47
  var reactDropdowns = require('@zendeskgarden/react-dropdowns');
@@ -49,6 +49,10 @@ var formik = require('formik');
49
49
  var reactChrome = require('@zendeskgarden/react-chrome');
50
50
  var reactPagination = require('@zendeskgarden/react-pagination');
51
51
  var reactTables = require('@zendeskgarden/react-tables');
52
+ var SearchAndReplace = require('@sereneinserenade/tiptap-search-and-replace');
53
+ var Document = require('@tiptap/extension-document');
54
+ var Text$2 = require('@tiptap/extension-text');
55
+ var model = require('@tiptap/pm/model');
52
56
 
53
57
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
54
58
 
@@ -85,6 +89,9 @@ var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image$2);
85
89
  var Dropcursor__default = /*#__PURE__*/_interopDefaultLegacy(Dropcursor);
86
90
  var SlickSlider__default = /*#__PURE__*/_interopDefaultLegacy(SlickSlider);
87
91
  var Video__default = /*#__PURE__*/_interopDefaultLegacy(Video);
92
+ var SearchAndReplace__default = /*#__PURE__*/_interopDefaultLegacy(SearchAndReplace);
93
+ var Document__default = /*#__PURE__*/_interopDefaultLegacy(Document);
94
+ var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text$2);
88
95
 
89
96
  /*
90
97
  * Design principles https://garden.zendesk.com/design/color (accessed 28 apr 2023)
@@ -291,7 +298,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
291
298
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
292
299
  step((generator = generator.apply(thisArg, _arguments || [])).next());
293
300
  });
294
- }
301
+ }
302
+
303
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
304
+ var e = new Error(message);
305
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
306
+ };
295
307
 
296
308
  const fontWeights = Object.assign(Object.assign({}, reactTheming.DEFAULT_THEME.fontWeights), { semibold: 500 });
297
309
 
@@ -642,6 +654,15 @@ Alert.Close = reactNotifications.Close;
642
654
 
643
655
  var img$2 = "data:image/svg+xml,%3csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.2597 12.9199V14.767H17.2367C17.075 17.4452 15.5974 18.969 13.127 18.969C10.4949 18.969 8.92496 17.4452 8.76335 14.767H8.74026V12.9199H5V14.767V14.7901C5.20779 19.4538 8.34777 22.4322 13.1039 22.4322C17.8139 22.4322 20.7922 19.5231 21 14.7901V12.9199H17.2597Z' fill='%23003A57'/%3e%3cpath d='M8.78629 3.5H5.02295V7.26335H8.78629V3.5Z' fill='%2370C38A'/%3e%3cpath d='M20.9768 3.5H17.1672V7.30952H20.9768V3.5Z' fill='%23003A57'/%3e%3c/svg%3e";
644
656
 
657
+ const StyledInternalAvatar = styled__default["default"].div `
658
+ display: flex;
659
+ align-items: center;
660
+ justify-content: center;
661
+ `;
662
+ const InternalAvatar = () => {
663
+ return (jsxRuntime.jsx(StyledInternalAvatar, { children: jsxRuntime.jsx("img", { alt: "avatar", src: img$2 }) }));
664
+ };
665
+
645
666
  const UgAvatar = styled__default["default"](reactAvatars.Avatar) `
646
667
  text-transform: uppercase;
647
668
 
@@ -673,7 +694,7 @@ const Avatar = (_a) => {
673
694
  if (type === "text")
674
695
  return jsxRuntime.jsx(Avatar.Text, { children: props.children });
675
696
  if (type === "system")
676
- return jsxRuntime.jsx("img", { alt: "avatar", src: img$2 });
697
+ return jsxRuntime.jsx(InternalAvatar, {});
677
698
  };
678
699
  return (jsxRuntime.jsx(UgAvatar, Object.assign({}, props, { badge: fixedBadge, isSystem: props.avatarType === "system" || isSystem, children: wrapChildren(props.avatarType || "text"), size: props.size || "small" })));
679
700
  };
@@ -842,48 +863,48 @@ Tag.Avatar = StyledAvatar;
842
863
  Tag.Close = StyledClose;
843
864
  Tag.SecondaryText = StyledSpan;
844
865
 
845
- var _path$F;
846
- function _extends$S() { _extends$S = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$S.apply(this, arguments); }
847
- const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$S({
866
+ var _path$H;
867
+ function _extends$U() { return _extends$U = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$U.apply(null, arguments); }
868
+ const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$U({
848
869
  width: 24,
849
870
  height: 24,
850
871
  viewBox: "0 0 24 24",
851
872
  fill: "none",
852
873
  xmlns: "http://www.w3.org/2000/svg"
853
- }, props), _path$F || (_path$F = /*#__PURE__*/React__namespace.createElement("path", {
874
+ }, props), _path$H || (_path$H = /*#__PURE__*/React__namespace.createElement("path", {
854
875
  d: "M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19Z",
855
876
  fill: "#E80C7A"
856
877
  })));
857
878
 
858
- var _path$E;
859
- function _extends$R() { _extends$R = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$R.apply(this, arguments); }
860
- const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$R({
879
+ var _path$G;
880
+ function _extends$T() { return _extends$T = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$T.apply(null, arguments); }
881
+ const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$T({
861
882
  width: 24,
862
883
  height: 24,
863
884
  viewBox: "0 0 24 24",
864
885
  fill: "none",
865
886
  xmlns: "http://www.w3.org/2000/svg"
866
- }, props), _path$E || (_path$E = /*#__PURE__*/React__namespace.createElement("path", {
887
+ }, props), _path$G || (_path$G = /*#__PURE__*/React__namespace.createElement("path", {
867
888
  d: "M12 2C6.47 2 2 6.47 2 12C2 17.53 6.47 22 12 22C17.53 22 22 17.53 22 12C22 6.47 17.53 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",
868
889
  fill: "#FFCD1A"
869
890
  })));
870
891
 
871
- var _path$D;
872
- function _extends$Q() { _extends$Q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Q.apply(this, arguments); }
873
- const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$Q({
892
+ var _path$F;
893
+ function _extends$S() { return _extends$S = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$S.apply(null, arguments); }
894
+ const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$S({
874
895
  width: 24,
875
896
  height: 24,
876
897
  viewBox: "0 0 24 24",
877
898
  fill: "none",
878
899
  xmlns: "http://www.w3.org/2000/svg"
879
- }, props), _path$D || (_path$D = /*#__PURE__*/React__namespace.createElement("path", {
900
+ }, props), _path$F || (_path$F = /*#__PURE__*/React__namespace.createElement("path", {
880
901
  d: "M11.9993 7.32625L18.3893 17.5563H5.60929L11.9993 7.32625ZM11.1493 4.91625L2.94929 18.0262C2.53929 18.6962 3.01929 19.5563 3.79929 19.5563H20.1993C20.9893 19.5563 21.4593 18.6962 21.0493 18.0262L12.8493 4.91625C12.4593 4.28625 11.5393 4.28625 11.1493 4.91625Z",
881
902
  fill: "#7B0DFF"
882
903
  })));
883
904
 
884
- var _rect$4, _path$C, _path2$c, _path3$4;
885
- function _extends$P() { _extends$P = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$P.apply(this, arguments); }
886
- const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$P({
905
+ var _rect$4, _path$E, _path2$c, _path3$4;
906
+ function _extends$R() { return _extends$R = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$R.apply(null, arguments); }
907
+ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$R({
887
908
  width: 24,
888
909
  height: 24,
889
910
  viewBox: "0 0 24 24",
@@ -894,7 +915,7 @@ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElemen
894
915
  height: 24,
895
916
  rx: 12,
896
917
  fill: "#F6F6F8"
897
- })), _path$C || (_path$C = /*#__PURE__*/React__namespace.createElement("path", {
918
+ })), _path$E || (_path$E = /*#__PURE__*/React__namespace.createElement("path", {
898
919
  d: "M20.6953 5.73905C21.0148 5.41953 21.0148 4.90149 20.6953 4.58197C20.3758 4.26245 19.8577 4.26245 19.5382 4.58197L11.88 12.2402L10.0849 9.95981C9.80539 9.60476 9.29098 9.54352 8.93593 9.82303C8.58088 10.1025 8.51963 10.6169 8.79914 10.972L11.1642 13.9763C11.3089 14.16 11.5252 14.2731 11.7586 14.2869C11.9921 14.3008 12.2203 14.2141 12.3856 14.0487L20.6953 5.73905Z",
899
920
  fill: "#50BF95"
900
921
  })), _path2$c || (_path2$c = /*#__PURE__*/React__namespace.createElement("path", {
@@ -905,9 +926,9 @@ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElemen
905
926
  fill: "#007345"
906
927
  })));
907
928
 
908
- var _rect$3, _path$B, _path2$b;
909
- function _extends$O() { _extends$O = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$O.apply(this, arguments); }
910
- const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$O({
929
+ var _rect$3, _path$D, _path2$b;
930
+ function _extends$Q() { return _extends$Q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$Q.apply(null, arguments); }
931
+ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$Q({
911
932
  width: 24,
912
933
  height: 24,
913
934
  viewBox: "0 0 24 24",
@@ -918,7 +939,7 @@ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("
918
939
  height: 24,
919
940
  rx: 12,
920
941
  fill: "#F6F6F8"
921
- })), _path$B || (_path$B = /*#__PURE__*/React__namespace.createElement("path", {
942
+ })), _path$D || (_path$D = /*#__PURE__*/React__namespace.createElement("path", {
922
943
  fillRule: "evenodd",
923
944
  clipRule: "evenodd",
924
945
  d: "M13.55 19.0875C14.25 19.7875 15.1063 20.1375 16.1188 20.1375C17.1313 20.1375 17.9875 19.7875 18.6875 19.0875C19.3875 18.3875 19.7375 17.5312 19.7375 16.5187C19.7375 15.5062 19.3875 14.65 18.6875 13.95C17.9875 13.25 17.1313 12.9 16.1188 12.9C15.1063 12.9 14.25 13.25 13.55 13.95C12.85 14.65 12.5 15.5062 12.5 16.5187C12.5 17.5312 12.85 18.3875 13.55 19.0875ZM17.5062 18.2812C17.4187 18.2812 17.3375 18.25 17.2625 18.1875L15.7438 16.7812C15.6813 16.6687 15.65 16.6 15.65 16.575V14.55C15.65 14.4375 15.6875 14.3437 15.7625 14.2687C15.8375 14.1937 15.9313 14.1562 16.0438 14.1562C16.1563 14.1562 16.25 14.1937 16.325 14.2687C16.4 14.3437 16.4375 14.4375 16.4375 14.55V16.4813L17.7313 17.6625C17.8063 17.725 17.8469 17.8062 17.8531 17.9062C17.8594 18.0063 17.825 18.0938 17.75 18.1688C17.675 18.2438 17.5937 18.2812 17.5062 18.2812Z",
@@ -930,9 +951,9 @@ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("
930
951
  fill: "#F4AC1A"
931
952
  })));
932
953
 
933
- var _rect$2, _path$A, _path2$a;
934
- function _extends$N() { _extends$N = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$N.apply(this, arguments); }
935
- const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$N({
954
+ var _rect$2, _path$C, _path2$a;
955
+ function _extends$P() { return _extends$P = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$P.apply(null, arguments); }
956
+ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$P({
936
957
  width: 24,
937
958
  height: 24,
938
959
  viewBox: "0 0 24 24",
@@ -943,7 +964,7 @@ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement
943
964
  height: 24,
944
965
  rx: 12,
945
966
  fill: "#F6F6F8"
946
- })), _path$A || (_path$A = /*#__PURE__*/React__namespace.createElement("path", {
967
+ })), _path$C || (_path$C = /*#__PURE__*/React__namespace.createElement("path", {
947
968
  d: "M11.2266 13.0313H14.997M11.2266 9.26075V13.0313V9.26075ZM11.2266 13.0313L20.121 5.03906L11.2266 13.0313Z",
948
969
  stroke: "#024780",
949
970
  strokeWidth: 1.5,
@@ -957,9 +978,9 @@ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement
957
978
  strokeLinejoin: "round"
958
979
  })));
959
980
 
960
- var _rect$1, _path$z, _path2$9, _path3$3, _path4$1, _path5$1, _path6$1, _path7$1, _path8$1, _path9$1, _path10$1;
961
- function _extends$M() { _extends$M = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$M.apply(this, arguments); }
962
- const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$M({
981
+ var _rect$1, _path$B, _path2$9, _path3$3, _path4$1, _path5$1, _path6$1, _path7$1, _path8$1, _path9$1, _path10$1;
982
+ function _extends$O() { return _extends$O = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$O.apply(null, arguments); }
983
+ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$O({
963
984
  width: 24,
964
985
  height: 24,
965
986
  viewBox: "0 0 24 24",
@@ -970,7 +991,7 @@ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement
970
991
  height: 24,
971
992
  rx: 12,
972
993
  fill: "#F6F6F8"
973
- })), _path$z || (_path$z = /*#__PURE__*/React__namespace.createElement("path", {
994
+ })), _path$B || (_path$B = /*#__PURE__*/React__namespace.createElement("path", {
974
995
  d: "M13.059 16.7647C13.059 16.1799 12.585 15.7059 12.0002 15.7059C11.4154 15.7059 10.9414 16.1799 10.9414 16.7647V19.9412C10.9414 20.5259 11.4154 21 12.0002 21C12.585 21 13.059 20.5259 13.059 19.9412V16.7647Z",
975
996
  fill: "#D1820A"
976
997
  })), _path2$9 || (_path2$9 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -1002,9 +1023,9 @@ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement
1002
1023
  fill: "#FFB65A"
1003
1024
  })));
1004
1025
 
1005
- var _g$c, _path$y, _path2$8, _path3$2, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11;
1006
- function _extends$L() { _extends$L = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$L.apply(this, arguments); }
1007
- const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$L({
1026
+ var _g$c, _path$A, _path2$8, _path3$2, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11;
1027
+ function _extends$N() { return _extends$N = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$N.apply(null, arguments); }
1028
+ const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$N({
1008
1029
  width: 24,
1009
1030
  height: 24,
1010
1031
  viewBox: "0 0 24 24",
@@ -1016,7 +1037,7 @@ const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createEle
1016
1037
  opacity: 0.3,
1017
1038
  d: "M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",
1018
1039
  fill: "#50BF95"
1019
- }))), _path$y || (_path$y = /*#__PURE__*/React__namespace.createElement("path", {
1040
+ }))), _path$A || (_path$A = /*#__PURE__*/React__namespace.createElement("path", {
1020
1041
  d: "M12.487 3.19652C8.68003 3.19652 5.59895 6.27761 5.59895 10.0846C5.59895 10.2597 5.59895 10.4348 5.62438 10.5855C5.29857 11.1863 4.82307 12.013 4.24678 12.514C3.82117 12.8897 3.92096 13.2908 3.97085 13.4405C4.09609 13.7663 4.44635 14.0413 5.02265 14.2418C5.22322 14.3172 5.44825 14.3671 5.64883 14.417L5.67427 16.8464C5.67427 17.7984 6.47559 18.6251 7.45304 18.6251L8.93044 18.1496L9.08111 19.0263C9.18091 19.6026 9.68185 20.0282 10.2836 20.0282C10.3589 20.0282 10.4343 20.0282 10.5086 20.0028L15.1424 19.177C15.8185 19.0517 16.2441 18.4256 16.1443 17.7495L15.8185 16.1214C17.9974 14.9189 19.375 12.5892 19.375 10.0845C19.375 6.30279 16.2696 3.19641 12.4869 3.19641L12.487 3.19652Z",
1021
1042
  fill: "#2B8473",
1022
1043
  stroke: "#2B8473"
@@ -1072,9 +1093,9 @@ const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createEle
1072
1093
  fill: "#ECF4F2"
1073
1094
  })));
1074
1095
 
1075
- var _g$b, _path$x;
1076
- function _extends$K() { _extends$K = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$K.apply(this, arguments); }
1077
- const SvgCampaignFunctional = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$K({
1096
+ var _g$b, _path$z;
1097
+ function _extends$M() { return _extends$M = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$M.apply(null, arguments); }
1098
+ const SvgCampaignFunctional = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$M({
1078
1099
  width: 24,
1079
1100
  height: 24,
1080
1101
  viewBox: "0 0 24 24",
@@ -1086,7 +1107,7 @@ const SvgCampaignFunctional = props => /*#__PURE__*/React__namespace.createEleme
1086
1107
  opacity: 0.3,
1087
1108
  d: "M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",
1088
1109
  fill: "#003A57"
1089
- }))), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
1110
+ }))), _path$z || (_path$z = /*#__PURE__*/React__namespace.createElement("path", {
1090
1111
  d: "M17.9983 7.16705C17.5188 6.58566 17.1422 6.73039 17.1422 6.73039C17.1422 6.73039 16.406 7.02453 16.0401 7.16303C15.6742 7.30153 15.2408 7.17357 15.2408 7.17357L14.7579 6.8851C14.7579 6.8851 14.4296 6.56554 14.3656 6.18067C14.3123 5.78958 14.1888 5.00269 14.1888 5.00269C14.1888 5.00269 14.1356 4.61159 13.3938 4.47257C12.652 4.33356 12.4678 4.68715 12.4678 4.68715C12.4678 4.68715 12.0932 5.38344 11.9091 5.73703C11.7249 6.09062 11.3114 6.27118 11.3114 6.27118L10.7639 6.36908C10.7639 6.36908 10.3144 6.33771 10.0176 6.07271L9.12712 5.27769C9.12712 5.27769 8.8303 5.01268 8.18313 5.38632C7.53595 5.75997 7.61705 6.14953 7.61705 6.14953L7.86033 7.3182C7.94143 7.70776 7.74381 8.11275 7.74381 8.11275L7.38528 8.53794C7.38528 8.53794 7.02217 8.80577 6.62387 8.78845C6.22557 8.77114 5.43527 8.7474 5.43527 8.7474C5.43527 8.7474 5.03697 8.73009 4.78646 9.44201C4.53595 10.1539 4.84804 10.3956 4.84804 10.3956C4.84804 10.3956 5.46774 10.896 5.77983 11.1376C6.09192 11.3793 6.19373 11.8296 6.19373 11.8296L6.20207 12.3921C6.20207 12.3921 6.09618 12.8314 5.79331 13.079C5.49043 13.3266 4.86759 13.8171 4.86759 13.8171C4.86759 13.8171 4.56471 14.0647 4.81769 14.7769C5.08144 15.4828 5.46713 15.4783 5.46713 15.4783C5.46713 15.4783 6.26012 15.4569 6.64582 15.4524C7.03152 15.4479 7.40116 15.7145 7.40116 15.7145L7.76458 16.1447C7.76458 16.1447 7.96976 16.5499 7.89441 16.9425C7.81907 17.3351 7.66208 18.1094 7.66208 18.1094C7.66208 18.1094 7.58674 18.502 8.23785 18.8824C8.88895 19.2629 9.18553 19.0044 9.18553 19.0044C9.18553 19.0044 9.7724 18.4765 10.069 18.218C10.3655 17.9595 10.8115 17.9347 10.8115 17.9347L11.3609 18.0394C11.3609 18.0394 11.77 18.225 11.9608 18.5803C12.1516 18.9356 12.5268 19.6354 12.5268 19.6354C12.5268 19.6354 12.7176 19.9907 13.4583 19.8539C14.1946 19.7343 14.2529 19.337 14.2529 19.337C14.2529 19.337 14.3586 18.5487 14.4232 18.1623C14.4814 17.765 14.8086 17.4598 14.8086 17.4598L15.2939 17.1796C15.2939 17.1796 15.7281 17.0598 16.095 17.1971C16.4682 17.3453 17.1975 17.637 17.1975 17.637C17.1975 17.637 17.5707 17.7851 18.0424 17.2073C18.5142 16.6295 18.3189 16.2913 18.3189 16.2913C18.3189 16.2913 17.9006 15.6164 17.6882 15.2736C17.4759 14.9307 17.5197 14.4836 17.5197 14.4836L17.7038 13.9555C17.7038 13.9555 17.9482 13.5816 18.3203 13.454C18.6925 13.3264 19.4431 13.0822 19.4431 13.0822C19.4431 13.0822 19.8153 12.9546 19.8113 12.2005C19.8074 11.4464 19.4297 11.3153 19.4297 11.3153C19.4297 11.3153 18.6807 11.0641 18.303 10.9331C17.9253 10.802 17.677 10.4217 17.677 10.4217L17.4861 9.8919C17.4861 9.8919 17.4293 9.4447 17.6368 9.1067C17.8443 8.7687 18.2486 8.09891 18.2486 8.09891C18.2486 8.09891 18.4778 7.74844 17.9983 7.16707L17.9983 7.16705ZM9.33902 8.38466L10.6176 10.5992C10.0433 11.149 9.82793 11.9715 10.0567 12.7413L7.86713 14.0054C6.98868 12.0106 7.60355 9.66286 9.33905 8.38457L9.33902 8.38466ZM13.9748 16.414C11.9998 17.2778 9.65918 16.6363 8.37099 14.8783L10.5605 13.6141C11.1128 14.1971 11.9329 14.4219 12.6961 14.1994L13.9748 16.414ZM12.6552 13.132C12.1159 13.4434 11.4325 13.2561 11.1176 12.7107C10.8027 12.1652 10.9822 11.4797 11.5215 11.1684C12.0608 10.857 12.7441 11.0443 13.0591 11.5897C13.374 12.1352 13.1945 12.8207 12.6552 13.132ZM14.8376 15.9158L13.5591 13.7012C14.1333 13.1515 14.3487 12.3289 14.12 11.5591L16.3095 10.295C17.188 12.2898 16.5731 14.6376 14.8376 15.9159L14.8376 15.9158ZM13.6161 10.6863C13.0638 10.1034 12.2437 9.87862 11.4805 10.1011L10.2019 7.88652C12.1769 7.02266 14.5112 7.65314 15.8057 9.42223L13.6161 10.6863Z",
1091
1112
  fill: "#003A57"
1092
1113
  })));
@@ -1728,59 +1749,6 @@ const BulletChart = ({ width, height, ranges, values }) => {
1728
1749
  }, tooltip: CustomTooltip, rangeColors: theme.palette.grey[200], rangeBorderColor: "white", rangeBorderWidth: 2, margin: { top: 0, right: 5, bottom: -1, left: 0 } }) })) })));
1729
1750
  };
1730
1751
 
1731
- const CenteredItem = ({ centerX, centerY, theme, radius, label, value, fontSizeMultiplier, }) => {
1732
- const parameter = 6;
1733
- const fontSizeFactor = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) / (14 * parameter);
1734
- const spacing = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) /
1735
- (parameter * 0.9);
1736
- const shift = -radius / (parameter * 2.5);
1737
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift + (value ? spacing : spacing / 2), fill: theme.palette.grey[600], style: {
1738
- fontSize: parseInt(theme.fontSizes.md.replace("px", "")) * fontSizeFactor,
1739
- } }, { children: label })) }))), value && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift - (label ? spacing : spacing / 2), fill: theme.palette.blue[600], style: {
1740
- fontSize: parseInt(theme.fontSizes.xxl.replace("px", "")) *
1741
- fontSizeFactor,
1742
- fontWeight: theme.fontWeights.semibold,
1743
- } }, { children: value })) })))] }));
1744
- };
1745
-
1746
- const PieChart = ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }) => {
1747
- var _a;
1748
- const themeContext = React.useContext(styled.ThemeContext);
1749
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: Object.assign({}, Object.assign(Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), theme), { labels: Object.assign(Object.assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: Object.assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_a = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _a === void 0 ? void 0 : _a.text) }) })), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, enableArcLabels: false, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsSkipAngle: arcLinkLabelsSkipAngle !== null && arcLinkLabelsSkipAngle !== void 0 ? arcLinkLabelsSkipAngle : 10, arcLinkLabelsThickness: 2, arcLinkLabel: (d) => labelFormatter
1750
- ? labelFormatter({
1751
- label: d.label,
1752
- id: d.id,
1753
- value: d.value,
1754
- data: d.data,
1755
- labelPosition: "arclink",
1756
- })
1757
- : (d.label || d.id).toString(), arcLinkLabelsDiagonalLength: 8, arcLinkLabelsStraightLength: 12, arcLinkLabelsTextOffset: 4, padAngle: 2, data: data, margin: Object.assign({ top: 40, bottom: 40 }, margin), tooltip: tooltip
1758
- ? (node) => {
1759
- const data = node.datum.data;
1760
- const label = (data === null || data === void 0 ? void 0 : data.label) || data.id;
1761
- const value = data.value;
1762
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({ label, value, data }) });
1763
- }
1764
- : undefined, cornerRadius: 2, innerRadius: 0.8, layers: [
1765
- "arcs",
1766
- "arcLabels",
1767
- "arcLinkLabels",
1768
- ...(centerItem
1769
- ? [
1770
- (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { theme: themeContext, label: centerItem.label, value: centerItem.value, fontSizeMultiplier: centerItem.fontSizeMultiplier }))),
1771
- ]
1772
- : []),
1773
- ], activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.map((d) => labelFormatter
1774
- ? labelFormatter({
1775
- label: d.label,
1776
- id: d.id,
1777
- value: d.value,
1778
- data: d,
1779
- labelPosition: "legend",
1780
- })
1781
- : d.id.toString()) }, (typeof legend === "object" && legend)))) : undefined }))] }));
1782
- };
1783
-
1784
1752
  const AbsoluteChartContainer = styled__default["default"](ChartContainer) `
1785
1753
  position: absolute;
1786
1754
  left: 0;
@@ -1824,132 +1792,62 @@ const HalfPieChart = ({ theme, colors, width, height, data, margin, showArcLinks
1824
1792
  }, mode: "back" })] })));
1825
1793
  };
1826
1794
 
1827
- const flatten = (data) => data.reduce((acc, item) => {
1828
- if (item.children) {
1829
- return [...acc, item, ...flatten(item.children)];
1830
- }
1831
- return [...acc, item];
1832
- }, []);
1833
- const findChildrenByName = (data, name) => {
1834
- if (!data.children)
1835
- return undefined;
1836
- return flatten(data.children).find((searchedName) => searchedName.name === name);
1837
- };
1838
-
1839
- const getChildrenValue = (data) => {
1840
- if (data.value) {
1841
- return data.value;
1842
- }
1843
- if (data.children) {
1844
- return data.children.reduce((acc, item) => {
1845
- return acc + getChildrenValue(item);
1846
- }, 0);
1847
- }
1848
- return 0;
1795
+ const CenteredItem = ({ centerX, centerY, theme, radius, label, value, fontSizeMultiplier, }) => {
1796
+ const parameter = 6;
1797
+ const fontSizeFactor = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) / (14 * parameter);
1798
+ const spacing = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) /
1799
+ (parameter * 0.9);
1800
+ const shift = -radius / (parameter * 2.5);
1801
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift + (value ? spacing : spacing / 2), fill: theme.palette.grey[600], style: {
1802
+ fontSize: parseInt(theme.fontSizes.md.replace("px", "")) * fontSizeFactor,
1803
+ } }, { children: label })) }))), value && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift - (label ? spacing : spacing / 2), fill: theme.palette.blue[600], style: {
1804
+ fontSize: parseInt(theme.fontSizes.xxl.replace("px", "")) *
1805
+ fontSizeFactor,
1806
+ fontWeight: theme.fontWeights.semibold,
1807
+ } }, { children: value })) })))] }));
1849
1808
  };
1850
1809
 
1851
- const ResetText = styled__default["default"].text `
1852
- font-size: ${({ radius, theme }) => (parseInt(theme.fontSizes.md.replace("px", "")) * radius) / 130}px;
1853
- cursor: pointer;
1854
-
1855
- fill: ${({ theme }) => theme.palette.blue[500]};
1856
- &:hover {
1857
- fill: ${({ theme }) => theme.palette.blue[700]};
1858
- }
1859
- `;
1860
- const ResetButton = ({ centerX, centerY, radius, theme, onClick, }) => (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX - radius},${centerY - radius})` }, { children: jsxRuntime.jsx(ResetText, Object.assign({ onClick: onClick, radius: radius }, { children: `< Reset` })) })));
1861
-
1862
- const SunburstChart = ({ colors, width, height, data, centerItem, margin, onChange, tooltip, legend, }) => {
1810
+ const PieChart = ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }) => {
1811
+ var _a;
1863
1812
  const themeContext = React.useContext(styled.ThemeContext);
1864
- const [currentData, setCurrentData] = React.useState(data);
1865
- const [currentColor, setCurrentColor] = React.useState();
1866
- const [isHovering, setIsHovering] = React.useState(false);
1867
- const changeDataSlice = ({ data, color, }) => {
1868
- setCurrentData(data);
1869
- setCurrentColor(color);
1870
- };
1871
- React.useEffect(() => {
1872
- if (onChange)
1873
- onChange(currentData);
1874
- }, [currentData]);
1875
- if (!data.children)
1876
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: "No data" });
1877
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height, style: isHovering ? { cursor: "pointer" } : undefined }, { children: jsxRuntime.jsx(sunburst.ResponsiveSunburst, { theme: tooltip
1878
- ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
1879
- padding: 0,
1880
- } }) }) : DEFAULT_CHARTS_THEME, colors: currentColor
1881
- ? () => currentColor
1882
- : colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, borderWidth: 4, cornerRadius: 4, onMouseEnter: (node) => {
1883
- if (node.data.children) {
1884
- setIsHovering(true);
1885
- }
1886
- }, onMouseLeave: (node) => {
1887
- if (node.data.children) {
1888
- setIsHovering(false);
1813
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: Object.assign({}, Object.assign(Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), theme), { labels: Object.assign(Object.assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: Object.assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_a = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _a === void 0 ? void 0 : _a.text) }) })), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, enableArcLabels: false, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsSkipAngle: arcLinkLabelsSkipAngle !== null && arcLinkLabelsSkipAngle !== void 0 ? arcLinkLabelsSkipAngle : 10, arcLinkLabelsThickness: 2, arcLinkLabel: (d) => labelFormatter
1814
+ ? labelFormatter({
1815
+ label: d.label,
1816
+ id: d.id,
1817
+ value: d.value,
1818
+ data: d.data,
1819
+ labelPosition: "arclink",
1820
+ })
1821
+ : (d.label || d.id).toString(), arcLinkLabelsDiagonalLength: 8, arcLinkLabelsStraightLength: 12, arcLinkLabelsTextOffset: 4, padAngle: 2, data: data, margin: Object.assign({ top: 40, bottom: 40 }, margin), tooltip: tooltip
1822
+ ? (node) => {
1823
+ const data = node.datum.data;
1824
+ const label = (data === null || data === void 0 ? void 0 : data.label) || data.id;
1825
+ const value = data.value;
1826
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({ label, value, data }) });
1889
1827
  }
1890
- }, tooltip: tooltip
1891
- ? (node) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({
1892
- label: node.data.label || node.data.name,
1893
- value: getChildrenValue(node.data),
1894
- data: Object.assign(Object.assign({}, node.data), { children: undefined }),
1895
- }) }))
1896
- : undefined, layers: [
1828
+ : undefined, cornerRadius: 2, innerRadius: 0.8, layers: [
1897
1829
  "arcs",
1830
+ "arcLabels",
1831
+ "arcLinkLabels",
1898
1832
  ...(centerItem
1899
1833
  ? [
1900
- (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { fontSizeMultiplier: centerItem.fontSizeMultiplier, theme: themeContext, label: centerItem.label, value: centerItem.value }))),
1901
- ]
1902
- : []),
1903
- ...(currentColor
1904
- ? [
1905
- (props) => (jsxRuntime.jsx(ResetButton, { centerX: props.centerX, centerY: props.centerY, radius: props.radius, theme: themeContext, onClick: () => {
1906
- changeDataSlice({
1907
- data,
1908
- });
1909
- } })),
1834
+ (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { theme: themeContext, label: centerItem.label, value: centerItem.value, fontSizeMultiplier: centerItem.fontSizeMultiplier }))),
1910
1835
  ]
1911
1836
  : []),
1912
- ], id: "name", value: "value", margin: Object.assign({ top: 40, bottom: 40 }, margin), data: currentData, childColor: { from: "color", modifiers: [["brighter", 0.6]] }, onClick: (clickedData) => {
1913
- const foundObject = findChildrenByName(currentData, clickedData.id.toString());
1914
- if (foundObject && foundObject.children) {
1915
- changeDataSlice({
1916
- data: foundObject,
1917
- color: clickedData.color,
1918
- });
1919
- }
1920
- } }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.children.map((d) => d.label || d.name) }, (typeof legend === "object" && legend)))) : undefined }))] }));
1921
- };
1922
-
1923
- const CustomCell = ({ position, size, x, y, color, fill, opacity, borderWidth, borderColor, data, onHover, onLeave, onClick, }) => (jsxRuntime.jsx("circle", { r: size / 2, cx: x + size / 2, cy: y + size / 2, fill: fill || color, strokeWidth: borderWidth, stroke: borderColor, opacity: opacity, onMouseEnter: onHover, onMouseMove: onHover, onMouseLeave: onLeave, onClick: event => {
1924
- onClick({ position, color, x, y, data }, event);
1925
- } }));
1926
-
1927
- const WaffleChart = ({ height, width, data, total, tooltip, }) => {
1928
- return (jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, { theme: tooltip
1929
- ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
1930
- padding: 0,
1931
- } }) }) : DEFAULT_CHARTS_THEME, data: [
1932
- {
1933
- id: "green-circles",
1934
- label: data.label,
1935
- value: data.value,
1936
- },
1937
- {
1938
- id: "grey-circles",
1939
- label: total.label,
1940
- value: total.value,
1941
- },
1942
- ], tooltip: ({ value, label }) => tooltip ? tooltip({ label, value }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: `${label}: ${value}` }), fillDirection: "bottom", total: total.value, rows: 6, columns: 8, colors: CHARTS_COLOR_SCHEME_MONO,
1943
- // @ts-ignore property cellComponent does not exist, but it does
1944
- cellComponent: (_a) => {
1945
- var rest = __rest(_a, ["borderWidth", "borderColor"]);
1946
- return (jsxRuntime.jsx(CustomCell, Object.assign({ borderWidth: 2, borderColor: "white" }, rest)));
1947
- } }) })));
1837
+ ], activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.map((d) => labelFormatter
1838
+ ? labelFormatter({
1839
+ label: d.label,
1840
+ id: d.id,
1841
+ value: d.value,
1842
+ data: d,
1843
+ labelPosition: "legend",
1844
+ })
1845
+ : d.id.toString()) }, (typeof legend === "object" && legend)))) : undefined }))] }));
1948
1846
  };
1949
1847
 
1950
1848
  var _g$a, _defs$4;
1951
- function _extends$J() { _extends$J = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$J.apply(this, arguments); }
1952
- const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$J({
1849
+ function _extends$L() { return _extends$L = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$L.apply(null, arguments); }
1850
+ const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$L({
1953
1851
  width: 27,
1954
1852
  height: 26,
1955
1853
  viewBox: "0 0 27 26",
@@ -1972,8 +1870,8 @@ const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg"
1972
1870
  })))));
1973
1871
 
1974
1872
  var _g$9, _defs$3;
1975
- function _extends$I() { _extends$I = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$I.apply(this, arguments); }
1976
- const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$I({
1873
+ function _extends$K() { return _extends$K = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$K.apply(null, arguments); }
1874
+ const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$K({
1977
1875
  width: 27,
1978
1876
  height: 26,
1979
1877
  viewBox: "0 0 27 26",
@@ -1996,8 +1894,8 @@ const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg"
1996
1894
  })))));
1997
1895
 
1998
1896
  var _g$8, _defs$2;
1999
- function _extends$H() { _extends$H = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$H.apply(this, arguments); }
2000
- const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$H({
1897
+ function _extends$J() { return _extends$J = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$J.apply(null, arguments); }
1898
+ const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$J({
2001
1899
  width: 27,
2002
1900
  height: 26,
2003
1901
  viewBox: "0 0 27 26",
@@ -2026,8 +1924,8 @@ const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg"
2026
1924
  })))));
2027
1925
 
2028
1926
  var _g$7, _defs$1;
2029
- function _extends$G() { _extends$G = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$G.apply(this, arguments); }
2030
- const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$G({
1927
+ function _extends$I() { return _extends$I = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$I.apply(null, arguments); }
1928
+ const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$I({
2031
1929
  width: 27,
2032
1930
  height: 26,
2033
1931
  viewBox: "0 0 27 26",
@@ -2056,8 +1954,8 @@ const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg"
2056
1954
  })))));
2057
1955
 
2058
1956
  var _g$6, _defs;
2059
- function _extends$F() { _extends$F = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$F.apply(this, arguments); }
2060
- const SvgSentiment5 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$F({
1957
+ function _extends$H() { return _extends$H = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$H.apply(null, arguments); }
1958
+ const SvgSentiment5 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$H({
2061
1959
  width: 26,
2062
1960
  height: 26,
2063
1961
  viewBox: "0 0 26 26",
@@ -2285,25 +2183,148 @@ const SentimentChart = ({ data, width, height, margin, tooltip, i18n, }) => {
2285
2183
  ], enableCrosshair: false, isInteractive: true, enableSlices: "x" }) })) }));
2286
2184
  };
2287
2185
 
2288
- const ShortcutContainer = styled__default["default"].div `
2289
- display: flex;
2290
- flex-direction: row;
2291
- padding: ${({ theme }) => `0 ${theme.space.base * 4}px`};
2292
- background-color: ${({ theme }) => theme.palette.grey[100]};
2293
- font-size: ${({ theme }) => theme.fontSizes.sm};
2294
- `;
2295
- const Text$1 = styled__default["default"](reactTypography.SM) `
2296
- line-height: 1.7;
2297
- `;
2298
- const SendShortcut = ({ saveText }) => {
2299
- return (jsxRuntime.jsxs(ShortcutContainer, { children: [jsxRuntime.jsxs(reactTags.Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text$1, { children: saveText || "to save" })] }));
2186
+ const flatten = (data) => data.reduce((acc, item) => {
2187
+ if (item.children) {
2188
+ return [...acc, item, ...flatten(item.children)];
2189
+ }
2190
+ return [...acc, item];
2191
+ }, []);
2192
+ const findChildrenByName = (data, name) => {
2193
+ if (!data.children)
2194
+ return undefined;
2195
+ return flatten(data.children).find((searchedName) => searchedName.name === name);
2300
2196
  };
2301
2197
 
2302
- const Footer$4 = styled__default["default"].div `
2303
- display: flex;
2304
- flex-direction: row;
2305
- padding: ${({ theme }) => `${theme.space.xs} 0px ${theme.space.sm}`};
2306
- align-items: center;
2198
+ const getChildrenValue = (data) => {
2199
+ if (data.value) {
2200
+ return data.value;
2201
+ }
2202
+ if (data.children) {
2203
+ return data.children.reduce((acc, item) => {
2204
+ return acc + getChildrenValue(item);
2205
+ }, 0);
2206
+ }
2207
+ return 0;
2208
+ };
2209
+
2210
+ const ResetText = styled__default["default"].text `
2211
+ font-size: ${({ radius, theme }) => (parseInt(theme.fontSizes.md.replace("px", "")) * radius) / 130}px;
2212
+ cursor: pointer;
2213
+
2214
+ fill: ${({ theme }) => theme.palette.blue[500]};
2215
+ &:hover {
2216
+ fill: ${({ theme }) => theme.palette.blue[700]};
2217
+ }
2218
+ `;
2219
+ const ResetButton = ({ centerX, centerY, radius, theme, onClick, }) => (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX - radius},${centerY - radius})` }, { children: jsxRuntime.jsx(ResetText, Object.assign({ onClick: onClick, radius: radius }, { children: `< Reset` })) })));
2220
+
2221
+ const SunburstChart = ({ colors, width, height, data, centerItem, margin, onChange, tooltip, legend, }) => {
2222
+ const themeContext = React.useContext(styled.ThemeContext);
2223
+ const [currentData, setCurrentData] = React.useState(data);
2224
+ const [currentColor, setCurrentColor] = React.useState();
2225
+ const [isHovering, setIsHovering] = React.useState(false);
2226
+ const changeDataSlice = ({ data, color, }) => {
2227
+ setCurrentData(data);
2228
+ setCurrentColor(color);
2229
+ };
2230
+ React.useEffect(() => {
2231
+ if (onChange)
2232
+ onChange(currentData);
2233
+ }, [currentData]);
2234
+ if (!data.children)
2235
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: "No data" });
2236
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height, style: isHovering ? { cursor: "pointer" } : undefined }, { children: jsxRuntime.jsx(sunburst.ResponsiveSunburst, { theme: tooltip
2237
+ ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
2238
+ padding: 0,
2239
+ } }) }) : DEFAULT_CHARTS_THEME, colors: currentColor
2240
+ ? () => currentColor
2241
+ : colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, borderWidth: 4, cornerRadius: 4, onMouseEnter: (node) => {
2242
+ if (node.data.children) {
2243
+ setIsHovering(true);
2244
+ }
2245
+ }, onMouseLeave: (node) => {
2246
+ if (node.data.children) {
2247
+ setIsHovering(false);
2248
+ }
2249
+ }, tooltip: tooltip
2250
+ ? (node) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({
2251
+ label: node.data.label || node.data.name,
2252
+ value: getChildrenValue(node.data),
2253
+ data: Object.assign(Object.assign({}, node.data), { children: undefined }),
2254
+ }) }))
2255
+ : undefined, layers: [
2256
+ "arcs",
2257
+ ...(centerItem
2258
+ ? [
2259
+ (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { fontSizeMultiplier: centerItem.fontSizeMultiplier, theme: themeContext, label: centerItem.label, value: centerItem.value }))),
2260
+ ]
2261
+ : []),
2262
+ ...(currentColor
2263
+ ? [
2264
+ (props) => (jsxRuntime.jsx(ResetButton, { centerX: props.centerX, centerY: props.centerY, radius: props.radius, theme: themeContext, onClick: () => {
2265
+ changeDataSlice({
2266
+ data,
2267
+ });
2268
+ } })),
2269
+ ]
2270
+ : []),
2271
+ ], id: "name", value: "value", margin: Object.assign({ top: 40, bottom: 40 }, margin), data: currentData, childColor: { from: "color", modifiers: [["brighter", 0.6]] }, onClick: (clickedData) => {
2272
+ const foundObject = findChildrenByName(currentData, clickedData.id.toString());
2273
+ if (foundObject && foundObject.children) {
2274
+ changeDataSlice({
2275
+ data: foundObject,
2276
+ color: clickedData.color,
2277
+ });
2278
+ }
2279
+ } }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.children.map((d) => d.label || d.name) }, (typeof legend === "object" && legend)))) : undefined }))] }));
2280
+ };
2281
+
2282
+ const CustomCell = ({ position, size, x, y, color, fill, opacity, borderWidth, borderColor, data, onHover, onLeave, onClick, }) => (jsxRuntime.jsx("circle", { r: size / 2, cx: x + size / 2, cy: y + size / 2, fill: fill || color, strokeWidth: borderWidth, stroke: borderColor, opacity: opacity, onMouseEnter: onHover, onMouseMove: onHover, onMouseLeave: onLeave, onClick: event => {
2283
+ onClick({ position, color, x, y, data }, event);
2284
+ } }));
2285
+
2286
+ const WaffleChart = ({ height, width, data, total, tooltip, }) => {
2287
+ return (jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, { theme: tooltip
2288
+ ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
2289
+ padding: 0,
2290
+ } }) }) : DEFAULT_CHARTS_THEME, data: [
2291
+ {
2292
+ id: "green-circles",
2293
+ label: data.label,
2294
+ value: data.value,
2295
+ },
2296
+ {
2297
+ id: "grey-circles",
2298
+ label: total.label,
2299
+ value: total.value,
2300
+ },
2301
+ ], tooltip: ({ value, label }) => tooltip ? tooltip({ label, value }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: `${label}: ${value}` }), fillDirection: "bottom", total: total.value, rows: 6, columns: 8, colors: CHARTS_COLOR_SCHEME_MONO,
2302
+ // @ts-ignore property cellComponent does not exist, but it does
2303
+ cellComponent: (_a) => {
2304
+ var rest = __rest(_a, ["borderWidth", "borderColor"]);
2305
+ return (jsxRuntime.jsx(CustomCell, Object.assign({ borderWidth: 2, borderColor: "white" }, rest)));
2306
+ } }) })));
2307
+ };
2308
+
2309
+ const ShortcutContainer = styled__default["default"].div `
2310
+ display: flex;
2311
+ flex-direction: row;
2312
+ padding: ${({ theme }) => `0 ${theme.space.base * 4}px`};
2313
+ background-color: ${({ theme }) => theme.palette.grey[100]};
2314
+ font-size: ${({ theme }) => theme.fontSizes.sm};
2315
+ `;
2316
+ const Text$1 = styled__default["default"](reactTypography.SM) `
2317
+ line-height: 1.7;
2318
+ `;
2319
+ const SendShortcut = ({ saveText }) => {
2320
+ return (jsxRuntime.jsxs(ShortcutContainer, { children: [jsxRuntime.jsxs(reactTags.Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text$1, { children: saveText || "to save" })] }));
2321
+ };
2322
+
2323
+ const Footer$4 = styled__default["default"].div `
2324
+ display: flex;
2325
+ flex-direction: row;
2326
+ padding: ${({ theme }) => `${theme.space.xs} 0px ${theme.space.sm}`};
2327
+ align-items: center;
2307
2328
  margin: ${({ theme }) => `0 -${theme.space.base * 4}px`};
2308
2329
  justify-content: ${({ showShortcut }) => showShortcut ? "space-between" : "flex-end"};
2309
2330
  gap: ${({ theme }) => theme.space.xs};
@@ -2337,40 +2358,26 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
2337
2358
  setEditor,
2338
2359
  thumbnails,
2339
2360
  setThumbnails,
2340
- afterUploadCallback: (failed) => {
2341
- setThumbnails(thumbnails.map((file) => {
2342
- if (failed.includes(file.id)) {
2343
- file.isLoadingMedia = false;
2344
- //file.isError = true;
2345
- }
2346
- else {
2347
- file.isLoadingMedia = false;
2348
- //file.isError = false
2349
- }
2350
- return file;
2351
- }));
2352
- },
2353
- addThumbnails: ({ files }) => {
2361
+ afterUploadCallback: (failed) => { },
2362
+ addThumbnails: ({ files }) => __awaiter(void 0, void 0, void 0, function* () {
2354
2363
  setThumbnails((prev) => [...prev, ...files]);
2355
- if (onFileUpload) {
2356
- onFileUpload(files).then((data) => {
2357
- var _a;
2358
- const failed = (_a = data.failed) === null || _a === void 0 ? void 0 : _a.map((f) => f.name);
2359
- setThumbnails((prev) => {
2360
- return prev.map((file) => {
2361
- file.isLoadingMedia = false;
2362
- if ((failed === null || failed === void 0 ? void 0 : failed.length) && failed.includes(file.id)) {
2363
- file.isError = true;
2364
- }
2365
- else {
2366
- file.isError = false;
2367
- }
2368
- return file;
2369
- });
2364
+ if (!onFileUpload)
2365
+ return;
2366
+ try {
2367
+ const data = yield onFileUpload(files);
2368
+ setThumbnails((prev) => {
2369
+ return prev.map(file => {
2370
+ var _a, _b;
2371
+ file.isLoadingMedia = false;
2372
+ file.error = (_b = (_a = data.failed) === null || _a === void 0 ? void 0 : _a.find(f => f.name === file.name)) === null || _b === void 0 ? void 0 : _b.errorCode;
2373
+ return file;
2370
2374
  });
2371
2375
  });
2372
2376
  }
2373
- },
2377
+ catch (e) {
2378
+ console.log("Error uploading files", e);
2379
+ }
2380
+ }),
2374
2381
  clearInput: () => {
2375
2382
  if (editor && !editor.isEmpty) {
2376
2383
  editor.commands.clearContent();
@@ -2736,28 +2743,28 @@ const ChatTitle = styled__default["default"](Title$1) `
2736
2743
  padding: ${({ theme }) => `${theme.space.sm} ${theme.space.md}`};
2737
2744
  `;
2738
2745
 
2739
- var _path$w;
2740
- function _extends$E() { _extends$E = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$E.apply(this, arguments); }
2741
- const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
2746
+ var _path$y;
2747
+ function _extends$G() { return _extends$G = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$G.apply(null, arguments); }
2748
+ const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$G({
2742
2749
  xmlns: "http://www.w3.org/2000/svg",
2743
2750
  width: 16,
2744
2751
  height: 16,
2745
2752
  focusable: "false",
2746
2753
  viewBox: "0 0 16 16"
2747
- }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
2754
+ }, props), _path$y || (_path$y = /*#__PURE__*/React__namespace.createElement("path", {
2748
2755
  fill: "currentColor",
2749
2756
  d: "M7.5 0C9.952 0 12 2.048 12 4.5a4.483 4.483 0 01-1.27 3.108C12.078 8.39 13 9.855 13 11.5c0 2.452-2.048 4.5-4.5 4.5H4a1 1 0 01-1-1V1a1 1 0 011-1h3.5zM5 14h3.5c1.348 0 2.5-1.152 2.5-2.5S9.848 9 8.5 9H5v5zM7.5 2H5v5h2.5C8.848 7 10 5.848 10 4.5S8.848 2 7.5 2z"
2750
2757
  })));
2751
2758
 
2752
- var _path$v;
2753
- function _extends$D() { _extends$D = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$D.apply(this, arguments); }
2754
- const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$D({
2759
+ var _path$x;
2760
+ function _extends$F() { return _extends$F = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$F.apply(null, arguments); }
2761
+ const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$F({
2755
2762
  xmlns: "http://www.w3.org/2000/svg",
2756
2763
  width: 16,
2757
2764
  height: 16,
2758
2765
  focusable: "false",
2759
2766
  viewBox: "0 0 16 16"
2760
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
2767
+ }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
2761
2768
  fill: "none",
2762
2769
  stroke: "currentColor",
2763
2770
  strokeLinecap: "round",
@@ -2765,15 +2772,15 @@ const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg"
2765
2772
  d: "M8 1h3M9.5 1l-3 14M5 15h3"
2766
2773
  })));
2767
2774
 
2768
- var _path$u, _path2$7;
2769
- function _extends$C() { _extends$C = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$C.apply(this, arguments); }
2770
- const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
2775
+ var _path$w, _path2$7;
2776
+ function _extends$E() { return _extends$E = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$E.apply(null, arguments); }
2777
+ const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
2771
2778
  xmlns: "http://www.w3.org/2000/svg",
2772
2779
  width: 16,
2773
2780
  height: 16,
2774
2781
  focusable: "false",
2775
2782
  viewBox: "0 0 16 16"
2776
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
2783
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
2777
2784
  fill: "currentColor",
2778
2785
  d: "M7 8H4c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1zm6 0h-3c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1z"
2779
2786
  })), _path2$7 || (_path2$7 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -2785,8 +2792,8 @@ const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg",
2785
2792
  })));
2786
2793
 
2787
2794
  var _g$5;
2788
- function _extends$B() { _extends$B = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$B.apply(this, arguments); }
2789
- const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$B({
2795
+ function _extends$D() { return _extends$D = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$D.apply(null, arguments); }
2796
+ const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$D({
2790
2797
  xmlns: "http://www.w3.org/2000/svg",
2791
2798
  width: 16,
2792
2799
  height: 16,
@@ -2813,8 +2820,8 @@ const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2813
2820
  }))));
2814
2821
 
2815
2822
  var _g$4;
2816
- function _extends$A() { _extends$A = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$A.apply(this, arguments); }
2817
- const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
2823
+ function _extends$C() { return _extends$C = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$C.apply(null, arguments); }
2824
+ const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
2818
2825
  xmlns: "http://www.w3.org/2000/svg",
2819
2826
  width: 16,
2820
2827
  height: 16,
@@ -2841,8 +2848,8 @@ const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2841
2848
  }))));
2842
2849
 
2843
2850
  var _g$3;
2844
- function _extends$z() { _extends$z = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
2845
- const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
2851
+ function _extends$B() { return _extends$B = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$B.apply(null, arguments); }
2852
+ const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$B({
2846
2853
  xmlns: "http://www.w3.org/2000/svg",
2847
2854
  width: 16,
2848
2855
  height: 16,
@@ -2869,7 +2876,7 @@ const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2869
2876
  }))));
2870
2877
 
2871
2878
  const StyledIconButton = styled__default["default"](IconButton) ``;
2872
- const MenuContainer$1 = styled__default["default"](Card) `
2879
+ const MenuContainer$2 = styled__default["default"](Card) `
2873
2880
  padding: ${({ theme }) => theme.space.xxs};
2874
2881
 
2875
2882
  ${StyledIconButton} {
@@ -2888,12 +2895,12 @@ const MenuContainer$1 = styled__default["default"](Card) `
2888
2895
  }
2889
2896
  }
2890
2897
  `;
2891
- const FloatingMenu = (props) => {
2898
+ const FloatingMenu$1 = (props) => {
2892
2899
  const { editor } = props;
2893
2900
  if (!editor) {
2894
2901
  return null;
2895
2902
  }
2896
- return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer$1, Object.assign({ isFloating: true }, { children: [jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(), isBasic: !editor.isActive("heading", { level: 1 }), isPrimary: editor.isActive("heading", { level: 1 }), isPill: false }, { children: jsxRuntime.jsx(SvgH1Fill, {}, "ug-h1-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), isBasic: !editor.isActive("heading", { level: 2 }), isPrimary: editor.isActive("heading", { level: 2 }), isPill: false }, { children: jsxRuntime.jsx(SvgH2Fill, {}, "ug-h2-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(), isBasic: !editor.isActive("heading", { level: 3 }), isPrimary: editor.isActive("heading", { level: 3 }), isPill: false }, { children: jsxRuntime.jsx(SvgH3Fill, {}, "ug-h3-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBold().run(), isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false }, { children: jsxRuntime.jsx(SvgBoldFill, {}, "ug-bold-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleItalic().run(), isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false }, { children: jsxRuntime.jsx(SvgItalicFill, {}, "ug-italic-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBlockquote().run(), isBasic: !editor.isActive("blockquote"), isPrimary: editor.isActive("blockquote"), isPill: false }, { children: jsxRuntime.jsx(SvgQuoteFill, {}, "ug-quote-button-bubble-menu") }))] })) })));
2903
+ return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer$2, Object.assign({ isFloating: true }, { children: [jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(), isBasic: !editor.isActive("heading", { level: 1 }), isPrimary: editor.isActive("heading", { level: 1 }), isPill: false }, { children: jsxRuntime.jsx(SvgH1Fill, {}, "ug-h1-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), isBasic: !editor.isActive("heading", { level: 2 }), isPrimary: editor.isActive("heading", { level: 2 }), isPill: false }, { children: jsxRuntime.jsx(SvgH2Fill, {}, "ug-h2-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(), isBasic: !editor.isActive("heading", { level: 3 }), isPrimary: editor.isActive("heading", { level: 3 }), isPill: false }, { children: jsxRuntime.jsx(SvgH3Fill, {}, "ug-h3-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBold().run(), isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false }, { children: jsxRuntime.jsx(SvgBoldFill, {}, "ug-bold-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleItalic().run(), isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false }, { children: jsxRuntime.jsx(SvgItalicFill, {}, "ug-italic-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBlockquote().run(), isBasic: !editor.isActive("blockquote"), isPrimary: editor.isActive("blockquote"), isPill: false }, { children: jsxRuntime.jsx(SvgQuoteFill, {}, "ug-quote-button-bubble-menu") }))] })) })));
2897
2904
  };
2898
2905
 
2899
2906
  /**
@@ -2909,64 +2916,72 @@ const FloatingMenu = (props) => {
2909
2916
  const TooltipComponent = (props) => {
2910
2917
  var _a;
2911
2918
  const theme = React.useContext(styled.ThemeContext);
2912
- return jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front }));
2919
+ return (jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front })));
2913
2920
  };
2914
- const Tooltip = styled__default["default"](TooltipComponent) `
2921
+ const StyledTooltip$2 = styled__default["default"](TooltipComponent) `
2915
2922
  box-shadow: ${({ theme }) => theme.shadows.lg(`${theme.space.base * 3}px`, `${theme.space.base * 5}px`, getColor("neutralHue", 600, theme, 0.15))};
2916
- `;
2917
2923
 
2918
- var _path$t;
2919
- function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
2920
- const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
2924
+ ${({ isTransparent }) => isTransparent &&
2925
+ `
2926
+ box-shadow: none;
2927
+ background-color: transparent;
2928
+ border: none;
2929
+ `};
2930
+ `;
2931
+ const Tooltip = (props) => jsxRuntime.jsx(StyledTooltip$2, Object.assign({}, props));
2932
+
2933
+ var _path$v;
2934
+ function _extends$A() { return _extends$A = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$A.apply(null, arguments); }
2935
+ const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
2921
2936
  xmlns: "http://www.w3.org/2000/svg",
2922
2937
  width: 16,
2923
2938
  height: 16,
2924
2939
  focusable: "false",
2925
2940
  viewBox: "0 0 16 16"
2926
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
2941
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
2927
2942
  fill: "currentColor",
2928
2943
  d: "M7 1c2.176 0 4 1.824 4 4 0 1.315-.666 2.501-1.673 3.234C10.869 8.792 12 10.287 12 12c0 2.176-1.824 4-4 4H3.5a.5.5 0 01-.5-.5v-14a.5.5 0 01.5-.5H7zM4 15h4c1.624 0 3-1.376 3-3S9.624 9 8 9H4v6zM7 2H4v6h3c1.624 0 3-1.376 3-3S8.624 2 7 2z"
2929
2944
  })));
2930
2945
 
2931
- var _path$s;
2932
- function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
2933
- const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
2946
+ var _path$u;
2947
+ function _extends$z() { return _extends$z = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$z.apply(null, arguments); }
2948
+ const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
2934
2949
  xmlns: "http://www.w3.org/2000/svg",
2935
2950
  width: 16,
2936
2951
  height: 16,
2937
2952
  focusable: "false",
2938
2953
  viewBox: "0 0 16 16"
2939
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
2954
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
2940
2955
  fill: "none",
2941
2956
  stroke: "currentColor",
2942
2957
  strokeLinecap: "round",
2943
2958
  d: "M7.5 1.5h3M9 1.5l-3 14m-1.5 0h3"
2944
2959
  })));
2945
2960
 
2946
- var _path$r;
2947
- function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
2948
- const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
2961
+ var _path$t;
2962
+ function _extends$y() { return _extends$y = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$y.apply(null, arguments); }
2963
+ const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
2949
2964
  xmlns: "http://www.w3.org/2000/svg",
2950
2965
  width: 16,
2951
2966
  height: 16,
2952
2967
  focusable: "false",
2953
2968
  role: "presentation"
2954
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
2969
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
2955
2970
  fill: "none",
2956
2971
  stroke: "currentColor",
2957
2972
  strokeLinecap: "round",
2958
2973
  d: "M11.5 4.5V8h0A3.5 3.5 0 018 11.5h0A3.5 3.5 0 014.5 8h0A3.5 3.5 0 018 4.5h0A3.5 3.5 0 0111.5 8h0v1.5a2 2 0 002 2h0a2 2 0 002-2V8h0A7.5 7.5 0 008 .5h0A7.5 7.5 0 00.5 8h0A7.5 7.5 0 008 15.5h3.41"
2959
2974
  })));
2960
2975
 
2961
- var _path$q;
2962
- function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
2963
- const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
2976
+ var _path$s;
2977
+ function _extends$x() { return _extends$x = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$x.apply(null, arguments); }
2978
+ const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
2964
2979
  xmlns: "http://www.w3.org/2000/svg",
2965
2980
  width: 16,
2966
2981
  height: 16,
2967
2982
  focusable: "false",
2968
2983
  role: "presentation"
2969
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
2984
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
2970
2985
  fill: "none",
2971
2986
  stroke: "currentColor",
2972
2987
  strokeLinecap: "round",
@@ -3065,7 +3080,7 @@ function useMedia() {
3065
3080
  return { getMedia };
3066
3081
  }
3067
3082
 
3068
- const MenuContainer = styled__default["default"].div `
3083
+ const MenuContainer$1 = styled__default["default"].div `
3069
3084
  padding: ${({ theme }) => theme.space.xs} 0;
3070
3085
  display: flex;
3071
3086
  flex-direction: row;
@@ -3108,7 +3123,7 @@ const CommentBar = ({ editor, i18n, }) => {
3108
3123
  }
3109
3124
  };
3110
3125
  };
3111
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: handleBoldClick }, { children: jsxRuntime.jsx(SvgBoldStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: handleItalicClick }, { children: jsxRuntime.jsx(SvgItalicStroke, {}) })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: handleMentionClick }, { children: jsxRuntime.jsx(SvgAtStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : "Upload images and video. Max size: 5GB", placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: handleAttachmentClick }, { children: jsxRuntime.jsx(SvgClipboard, {}) })) }))] })) }));
3126
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer$1, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: handleBoldClick }, { children: jsxRuntime.jsx(SvgBoldStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: handleItalicClick }, { children: jsxRuntime.jsx(SvgItalicStroke, {}) })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: handleMentionClick }, { children: jsxRuntime.jsx(SvgAtStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ style: { textAlign: "center" }, content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : (jsxRuntime.jsxs("span", { children: ["Upload images and video.", " ", jsxRuntime.jsxs("span", Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [" ", jsxRuntime.jsx("br", {}), " Max size: 5GB", " "] }))] })), placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: handleAttachmentClick }, { children: jsxRuntime.jsx(SvgClipboard, {}) })) }))] })) }));
3112
3127
  };
3113
3128
 
3114
3129
  const CustomMention = Mention__default["default"].extend({
@@ -3357,20 +3372,20 @@ const editorExtensions = ({ placeholderOptions, mentionableUsers, }) => {
3357
3372
  ];
3358
3373
  };
3359
3374
 
3360
- var _circle$3, _path$p, _path2$6;
3361
- function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
3362
- const SvgRemoveMediaIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
3375
+ var _circle$4, _path$r, _path2$6;
3376
+ function _extends$w() { return _extends$w = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$w.apply(null, arguments); }
3377
+ const SvgRemoveMediaIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
3363
3378
  width: 56,
3364
3379
  height: 56,
3365
3380
  viewBox: "0 0 56 56",
3366
3381
  fill: "#68737d",
3367
3382
  xmlns: "http://www.w3.org/2000/svg"
3368
- }, props), _circle$3 || (_circle$3 = /*#__PURE__*/React__namespace.createElement("circle", {
3383
+ }, props), _circle$4 || (_circle$4 = /*#__PURE__*/React__namespace.createElement("circle", {
3369
3384
  cx: 28,
3370
3385
  cy: 28,
3371
3386
  r: 28,
3372
3387
  fill: "#edf7ff"
3373
- })), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
3388
+ })), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
3374
3389
  d: "M16.929 16.929L39.071 39.071",
3375
3390
  stroke: "currentColor",
3376
3391
  strokeWidth: 4
@@ -3391,25 +3406,26 @@ const StyledDeleteThumbnailX = styled__default["default"].div `
3391
3406
  opacity: 0;
3392
3407
  transition: opacity 0.2s;
3393
3408
  z-index: 2;
3409
+ color: ${({ theme }) => theme.palette.grey[800]};
3394
3410
  `;
3395
3411
  const DeleteThumbnailX = ({ deleteThumbnail }) => {
3396
3412
  return (jsxRuntime.jsx(StyledDeleteThumbnailX, Object.assign({ className: "deleteThumbnail" }, { children: jsxRuntime.jsx(SvgRemoveMediaIcon, { onClick: (e) => deleteThumbnail(e) }) })));
3397
3413
  };
3398
3414
 
3399
- var _circle$2, _path$o;
3400
- function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
3401
- const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
3415
+ var _circle$3, _path$q;
3416
+ function _extends$v() { return _extends$v = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$v.apply(null, arguments); }
3417
+ const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
3402
3418
  width: 56,
3403
3419
  height: 56,
3404
3420
  viewBox: "0 0 56 56",
3405
3421
  fill: "none",
3406
3422
  xmlns: "http://www.w3.org/2000/svg"
3407
- }, props), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
3423
+ }, props), _circle$3 || (_circle$3 = /*#__PURE__*/React__namespace.createElement("circle", {
3408
3424
  cx: 28,
3409
3425
  cy: 28,
3410
3426
  r: 28,
3411
3427
  fill: "white"
3412
- })), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
3428
+ })), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
3413
3429
  d: "M47 28L18.5 44.4545L18.5 11.5455L47 28Z",
3414
3430
  fill: "currentColor"
3415
3431
  })));
@@ -3418,18 +3434,19 @@ const ImageCard = styled__default["default"](SpecialCard) `
3418
3434
  padding: 0;
3419
3435
  position: relative;
3420
3436
  overflow: hidden;
3421
-
3437
+ width: 90px;
3438
+
3422
3439
  &:before {
3423
3440
  content: "";
3441
+ font-size: ${({ theme }) => theme.fontSizes.xs};
3424
3442
  position: absolute;
3443
+ padding: ${({ theme }) => theme.space.xs};
3425
3444
  top: 0;
3426
3445
  left: 0;
3427
3446
  width: 100%;
3428
3447
  height: 100%;
3429
- background-color: ${({ theme }) => theme.palette.grey[800]};
3430
- opacity: 0;
3448
+ background-color: ${({ theme }) => theme.palette.grey[800]}00; // 0% opacity
3431
3449
  transition: opacity 0.2s;
3432
- z-index: 1;
3433
3450
  }
3434
3451
 
3435
3452
  &:hover {
@@ -3437,13 +3454,26 @@ const ImageCard = styled__default["default"](SpecialCard) `
3437
3454
  opacity: 1;
3438
3455
  }
3439
3456
  &:before {
3440
- opacity: 0.3;
3457
+ background-color: ${({ theme }) => theme.palette.grey[800]}4d; // 30% opacity
3441
3458
  }
3442
3459
  }
3443
-
3444
- &.video{
3445
-
3460
+ ${(p) => p.error &&
3461
+ `
3462
+ &:before{
3463
+ content: "Error: ${p.error}";
3464
+ color: ${p.theme.palette.white};
3465
+ background-color: ${p.theme.palette.grey[800]}b3; // 0.7 opacity
3466
+ }
3467
+ `}
3468
+ ${(p) => p.isLoading &&
3469
+ `
3470
+ &:before{
3471
+ background-color: ${p.theme.palette.grey[800]}b3; // 0.7 opacity
3472
+ }
3473
+ `}
3474
+ &.video {
3446
3475
  svg {
3476
+ color: ${({ theme }) => theme.palette.grey[800]};
3447
3477
  position: absolute;
3448
3478
  top: 50%;
3449
3479
  left: 50%;
@@ -3458,13 +3488,15 @@ const Preview = styled__default["default"].div `
3458
3488
  display: flex;
3459
3489
  justify-content: center;
3460
3490
  align-items: center;
3461
- height: 150px;
3491
+ height: 100px;
3462
3492
  width: 100%;
3463
-
3464
- ${p => p.url && `
3493
+ color: ${({ theme }) => theme.palette.white};
3494
+
3495
+ ${p => p.url &&
3496
+ `
3465
3497
  background-image: url(${p.url});
3466
3498
  background-color: ${p.theme.palette.grey[100]};
3467
- background-size: contain;
3499
+ background-size: cover;
3468
3500
  background-position: center;
3469
3501
  background-repeat: no-repeat;
3470
3502
  `}
@@ -3474,44 +3506,26 @@ const Preview = styled__default["default"].div `
3474
3506
  height: 100%;
3475
3507
  }
3476
3508
  `;
3477
- const Thumbnail = ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia = true, isError = false, }) => {
3509
+ const Thumbnail = ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia, error = "", }) => {
3478
3510
  const handleCancel = (e) => {
3479
3511
  e.stopPropagation();
3480
3512
  if (removeThumbnail)
3481
3513
  removeThumbnail();
3482
3514
  };
3483
- return (jsxRuntime.jsxs(ImageCard, Object.assign({ onClick: clickThumbnail, className: type.includes('video') ? 'video' : 'image' }, { children: [isError && (
3484
- // todo: add error icon
3485
- jsxRuntime.jsx("span", { children: "error uploading media" })), isLoadingMedia ? (jsxRuntime.jsx(Preview, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
3486
- display: "flex",
3487
- alignItems: "center",
3488
- justifyContent: "center",
3489
- }, size: "large" }) })) : (jsxRuntime.jsxs(Preview, Object.assign({ url: src }, { children: [showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })), type.includes('video') && jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("video", Object.assign({ src: src }, { children: jsxRuntime.jsx("track", { kind: "captions" }) })), jsxRuntime.jsx(SvgVideoPlayIcon, {})] })] })))] })));
3515
+ return (jsxRuntime.jsx(ImageCard, Object.assign({ onClick: clickThumbnail, className: type.includes("video") ? "video" : "image", error: error, isLoading: isLoadingMedia }, { children: isLoadingMedia ? (jsxRuntime.jsx(Preview, Object.assign({ url: src }, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
3516
+ display: "flex",
3517
+ position: "absolute",
3518
+ color: "white",
3519
+ alignItems: "center",
3520
+ justifyContent: "center",
3521
+ }, size: "large" }) }))) : (jsxRuntime.jsxs(Preview, Object.assign({ url: src }, { children: [showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })), type.includes("video") && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("video", Object.assign({ src: src }, { children: jsxRuntime.jsx("track", { kind: "captions" }) })), jsxRuntime.jsx(SvgVideoPlayIcon, { opacity: error ? "0.3" : "1" })] }))] }))) })));
3490
3522
  };
3491
3523
 
3492
- const UgGrid = styled__default["default"](reactGrid.Grid) `
3493
- padding-left: 0;
3494
- padding-right: 0;
3495
- `;
3496
- /**
3497
- * The Grid component is a framework for building modular layouts.
3498
- * <hr>
3499
- * Used for this:
3500
- - To structure the layout of a page
3501
- */
3502
- const Grid = (props) => jsxRuntime.jsx(UgGrid, Object.assign({}, props));
3503
-
3504
- const Row$1 = (props) => jsxRuntime.jsx(reactGrid.Row, Object.assign({}, props));
3505
-
3506
- const StyledCol$1 = styled__default["default"](reactGrid.Col) `
3507
- margin-bottom: ${theme.space.lg};
3508
-
3509
- @media screen and (max-width: ${theme.breakpoints.sm}) {
3510
- margin-bottom: ${theme.space.md};
3511
- }
3524
+ const FlexContainer = styled.styled.div `
3525
+ display: flex;
3526
+ gap: ${({ theme }) => theme.space.xs};
3527
+ flex-wrap: wrap;
3512
3528
  `;
3513
- const Col = (props) => jsxRuntime.jsx(StyledCol$1, Object.assign({}, props));
3514
-
3515
3529
  const ThumbnailContainer = ({ openLightbox }) => {
3516
3530
  const { thumbnails, removeThumbnail, onDeleteThumbnail } = useChatContext();
3517
3531
  const mediaFiles = React.useMemo(() => {
@@ -3521,17 +3535,18 @@ const ThumbnailContainer = ({ openLightbox }) => {
3521
3535
  previewUrl: file.url,
3522
3536
  id: file.id,
3523
3537
  isLoadingMedia: file.isLoadingMedia,
3538
+ error: file.error,
3524
3539
  }));
3525
3540
  }, [thumbnails]);
3526
3541
  if (!mediaFiles || mediaFiles.length === 0) {
3527
3542
  return null;
3528
3543
  }
3529
- return (jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: mediaFiles.map((file, index) => (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(Thumbnail, { src: file.previewUrl, showX: true, type: file.fileType, isLoadingMedia: file.isLoadingMedia, removeThumbnail: () => {
3530
- removeThumbnail(index);
3531
- onDeleteThumbnail(file.id);
3532
- }, clickThumbnail: () => {
3533
- openLightbox(index);
3534
- } }, file.id) })))) })) }));
3544
+ return (jsxRuntime.jsx(FlexContainer, { children: mediaFiles.map((file, index) => (jsxRuntime.jsx(Thumbnail, { src: file.previewUrl, showX: true, type: file.fileType, isLoadingMedia: file.isLoadingMedia, error: file.error, removeThumbnail: () => {
3545
+ removeThumbnail(index);
3546
+ onDeleteThumbnail(file.id);
3547
+ }, clickThumbnail: () => {
3548
+ openLightbox(index);
3549
+ } }, file.id))) }));
3535
3550
  };
3536
3551
 
3537
3552
  const UgModalBody = styled__default["default"](reactModals.Body) `
@@ -3600,28 +3615,28 @@ Lightbox.Body = ModalBody; // Includes Main and Details
3600
3615
  Lightbox.Footer = Footer$3;
3601
3616
  Lightbox.Close = reactModals.Close;
3602
3617
 
3603
- var _path$n;
3604
- function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
3605
- const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
3618
+ var _path$p;
3619
+ function _extends$u() { return _extends$u = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$u.apply(null, arguments); }
3620
+ const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
3606
3621
  xmlns: "http://www.w3.org/2000/svg",
3607
3622
  width: 16,
3608
3623
  height: 16,
3609
3624
  focusable: "false",
3610
3625
  viewBox: "0 0 16 16"
3611
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
3626
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
3612
3627
  fill: "currentColor",
3613
3628
  d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
3614
3629
  })));
3615
3630
 
3616
- var _path$m;
3617
- function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
3618
- const SvgChevronRightStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
3631
+ var _path$o;
3632
+ function _extends$t() { return _extends$t = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$t.apply(null, arguments); }
3633
+ const SvgChevronRightStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
3619
3634
  xmlns: "http://www.w3.org/2000/svg",
3620
3635
  width: 16,
3621
3636
  height: 16,
3622
3637
  focusable: "false",
3623
3638
  viewBox: "0 0 16 16"
3624
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
3639
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
3625
3640
  fill: "currentColor",
3626
3641
  d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
3627
3642
  })));
@@ -3844,15 +3859,15 @@ Slider.Slide = Slide;
3844
3859
  Slider.PrevButton = PrevButton;
3845
3860
  Slider.NextButton = NextButton;
3846
3861
 
3847
- var _path$l, _path2$5;
3848
- function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
3849
- const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
3862
+ var _path$n, _path2$5;
3863
+ function _extends$s() { return _extends$s = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$s.apply(null, arguments); }
3864
+ const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
3850
3865
  xmlns: "http://www.w3.org/2000/svg",
3851
3866
  width: 16,
3852
3867
  height: 16,
3853
3868
  focusable: "false",
3854
3869
  viewBox: "0 0 16 16"
3855
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
3870
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
3856
3871
  stroke: "currentColor",
3857
3872
  strokeLinecap: "round",
3858
3873
  d: "M11.5 10l4-4m-4 0l4 4"
@@ -3861,15 +3876,15 @@ const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement(
3861
3876
  d: "M9 15.29c-.26 0-.51-.1-.71-.29l-4-4H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3.29l4-4a1.002 1.002 0 011.71.71V14.3a.986.986 0 01-1 .99z"
3862
3877
  })));
3863
3878
 
3864
- var _path$k, _path2$4;
3865
- function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
3866
- const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
3879
+ var _path$m, _path2$4;
3880
+ function _extends$r() { return _extends$r = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$r.apply(null, arguments); }
3881
+ const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
3867
3882
  xmlns: "http://www.w3.org/2000/svg",
3868
3883
  width: 16,
3869
3884
  height: 16,
3870
3885
  focusable: "false",
3871
3886
  viewBox: "0 0 16 16"
3872
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
3887
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
3873
3888
  fill: "currentColor",
3874
3889
  d: "M9 15.29c-.26 0-.51-.1-.71-.29l-4-4H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3.29l4-4a1.002 1.002 0 011.71.71V14.3a.986.986 0 01-1 .99z"
3875
3890
  })), _path2$4 || (_path2$4 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -3879,6 +3894,10 @@ const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElemen
3879
3894
  d: "M11.77 9.77c.45-.45.73-1.08.73-1.77s-.28-1.31-.73-1.77m2.17 5.6c.97-.99 1.56-2.34 1.56-3.83 0-1.52-.62-2.89-1.61-3.89"
3880
3895
  })));
3881
3896
 
3897
+ const ControlButton = styled__default["default"](IconButton) `
3898
+ color: ${({ theme }) => theme.palette.grey[700]};
3899
+ `;
3900
+
3882
3901
  const AudioButton = () => {
3883
3902
  const [hasAudio, setHasAudio] = React.useState(false);
3884
3903
  const { isMuted, setMuted, context } = Video.useVideoContext();
@@ -3903,8 +3922,8 @@ const AudioButton = () => {
3903
3922
  setMuted(!hasVolume(player.ref.current));
3904
3923
  checkAudio(player.ref.current);
3905
3924
  }
3906
- }, [context.isPlaying, isMuted]);
3907
- return (jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, disabled: !hasAudio, onClick: () => {
3925
+ }, [context.isPlaying, isMuted, player, setMuted]);
3926
+ return (jsxRuntime.jsx(ControlButton, Object.assign({ disabled: !hasAudio, onClick: () => {
3908
3927
  if (player === null || player === void 0 ? void 0 : player.ref.current) {
3909
3928
  player.ref.current.volume = player.ref.current.volume > 0 ? 0 : 1;
3910
3929
  setMuted(!player.ref.current.volume);
@@ -3940,8 +3959,8 @@ const useProgressContext = () => {
3940
3959
  };
3941
3960
 
3942
3961
  var _g$2;
3943
- function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
3944
- const SvgGrip = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
3962
+ function _extends$q() { return _extends$q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$q.apply(null, arguments); }
3963
+ const SvgGrip = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
3945
3964
  xmlns: "http://www.w3.org/2000/svg",
3946
3965
  width: 16,
3947
3966
  height: 16,
@@ -4043,6 +4062,9 @@ const StyledGrabber = styled.styled.div `
4043
4062
  const activeBookMark = styled.css `
4044
4063
  height: 250%;
4045
4064
  transform: translateY(-30%);
4065
+ cursor: pointer;
4066
+ z-index: 2;
4067
+ border-radius: 4px;
4046
4068
 
4047
4069
  ${StyledGrabber} {
4048
4070
  display: block;
@@ -4051,17 +4073,22 @@ const activeBookMark = styled.css `
4051
4073
  const Rect = styled.styled.div `
4052
4074
  position: absolute;
4053
4075
  height: 110%;
4054
- background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
4076
+ background-color: ${({ hue, theme }) => getColor(hue || theme.palette.grey[800], undefined, undefined, 0.8)};
4055
4077
  z-index: 1;
4056
4078
  border-radius: 2px;
4079
+ color: white;
4080
+ transition: width 0.1s ease;
4081
+
4057
4082
  &:hover {
4083
+ background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
4058
4084
  ${activeBookMark}
4059
- border-radius: 4px;
4060
4085
  }
4061
- color: white;
4062
- ${({ isActive }) => isActive && activeBookMark}
4063
4086
 
4064
- transition: width 0.1s ease;
4087
+ ${({ isActive }) => isActive && activeBookMark}
4088
+ ${({ isFocused }) => isFocused && activeBookMark}
4089
+ `;
4090
+ const StyledTooltip$1 = styled.styled(Tooltip) `
4091
+ margin-bottom: ${({ theme }) => theme.space.sm};
4065
4092
  `;
4066
4093
  const Grabber = (props) => {
4067
4094
  const { observation } = props;
@@ -4077,7 +4104,7 @@ const Grabber = (props) => {
4077
4104
  };
4078
4105
  const Bookmark = (props) => {
4079
4106
  var _a, _b;
4080
- const { start, end, hue, label } = props;
4107
+ const { start, end, hue, tooltipContent } = props;
4081
4108
  const { context } = Video.useVideoContext();
4082
4109
  const videoStart = context.part.start || 0;
4083
4110
  const videoEnd = context.part.end || ((_a = context.player) === null || _a === void 0 ? void 0 : _a.totalTime) || 0;
@@ -4088,21 +4115,21 @@ const Bookmark = (props) => {
4088
4115
  }
4089
4116
  if (start > videoEnd || start < videoStart)
4090
4117
  return null;
4091
- return (jsxRuntime.jsx(Tooltip, Object.assign({ content: label, type: "light", size: "large" }, { children: jsxRuntime.jsxs(Rect, Object.assign({ isActive: activeBookmark && activeBookmark.id === props.id, hue: hue, style: {
4118
+ return (jsxRuntime.jsx(StyledTooltip$1, Object.assign({ content: tooltipContent, type: "light", size: "large", isTransparent: true }, { children: jsxRuntime.jsxs(Rect, Object.assign({ isActive: activeBookmark && activeBookmark.id === props.id, hue: hue, isFocused: props.isFocused, style: {
4092
4119
  left: `${((start - videoStart) / duration) * 100}%`,
4093
4120
  width: `${((end - start) / duration) * 100}%`,
4094
4121
  }, onClick: props.onClick }, { children: [jsxRuntime.jsx(Grabber, { observation: props }), jsxRuntime.jsx(Grabber, { isEnd: true, observation: props })] })) })));
4095
4122
  };
4096
4123
 
4097
- var _path$j, _path2$3, _path3$1;
4098
- function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
4099
- const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
4124
+ var _path$l, _path2$3, _path3$1;
4125
+ function _extends$p() { return _extends$p = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$p.apply(null, arguments); }
4126
+ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
4100
4127
  width: 16,
4101
4128
  height: 16,
4102
4129
  viewBox: "0 0 16 16",
4103
4130
  fill: "none",
4104
4131
  xmlns: "http://www.w3.org/2000/svg"
4105
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
4132
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
4106
4133
  fillRule: "evenodd",
4107
4134
  clipRule: "evenodd",
4108
4135
  d: "M4.34099 3.5C5.25886 2.85974 6.34919 2.5 7.5 2.5C10.5477 2.5 13 4.95228 13 8C13 11.0477 10.5477 13.5 7.5 13.5C5.79771 13.5 4.25432 12.7171 3.18087 11.3753C2.83586 10.944 2.20657 10.8741 1.7753 11.2191C1.34404 11.5641 1.27412 12.1934 1.61913 12.6247C3.06275 14.4292 5.17372 15.5 7.5 15.5C11.6523 15.5 15 12.1523 15 8C15 3.84772 11.6523 0.5 7.5 0.5C5.84359 0.5 4.28318 1.04496 3 2.00147V1C3 0.447715 2.55229 0 2 0C1.44771 0 1 0.447715 1 1V4C1 4.85228 1.64772 5.5 2.5 5.5H5.5C6.05229 5.5 6.5 5.05228 6.5 4.5C6.5 3.94772 6.05229 3.5 5.5 3.5H4.34099Z",
@@ -4115,15 +4142,15 @@ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement(
4115
4142
  fill: "currentColor"
4116
4143
  })));
4117
4144
 
4118
- var _path$i, _path2$2, _path3;
4119
- function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
4120
- const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
4145
+ var _path$k, _path2$2, _path3;
4146
+ function _extends$o() { return _extends$o = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$o.apply(null, arguments); }
4147
+ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
4121
4148
  width: 16,
4122
4149
  height: 16,
4123
4150
  viewBox: "0 0 16 16",
4124
4151
  fill: "none",
4125
4152
  xmlns: "http://www.w3.org/2000/svg"
4126
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
4153
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
4127
4154
  fillRule: "evenodd",
4128
4155
  clipRule: "evenodd",
4129
4156
  d: "M11.659 3.5C10.7411 2.85974 9.65081 2.5 8.5 2.5C5.45228 2.5 3 4.95228 3 8C3 11.0477 5.45228 13.5 8.5 13.5C10.2023 13.5 11.7457 12.7171 12.8191 11.3753C13.1641 10.944 13.7934 10.8741 14.2247 11.2191C14.656 11.5641 14.7259 12.1934 14.3809 12.6247C12.9372 14.4292 10.8263 15.5 8.5 15.5C4.34772 15.5 1 12.1523 1 8C1 3.84772 4.34772 0.5 8.5 0.5C10.1564 0.5 11.7168 1.04496 13 2.00147V1C13 0.447715 13.4477 0 14 0C14.5523 0 15 0.447715 15 1V4C15 4.85228 14.3523 5.5 13.5 5.5H10.5C9.94771 5.5 9.5 5.05228 9.5 4.5C9.5 3.94772 9.94771 3.5 10.5 3.5H11.659Z",
@@ -4137,8 +4164,8 @@ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createEleme
4137
4164
  })));
4138
4165
 
4139
4166
  var _g$1;
4140
- function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
4141
- const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
4167
+ function _extends$n() { return _extends$n = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$n.apply(null, arguments); }
4168
+ const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
4142
4169
  xmlns: "http://www.w3.org/2000/svg",
4143
4170
  width: 16,
4144
4171
  height: 16,
@@ -4162,28 +4189,28 @@ const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg",
4162
4189
  ry: 1
4163
4190
  }))));
4164
4191
 
4165
- var _path$h;
4166
- function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
4167
- const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
4192
+ var _path$j;
4193
+ function _extends$m() { return _extends$m = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$m.apply(null, arguments); }
4194
+ const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
4168
4195
  xmlns: "http://www.w3.org/2000/svg",
4169
4196
  width: 16,
4170
4197
  height: 16,
4171
4198
  focusable: "false",
4172
4199
  viewBox: "0 0 16 16"
4173
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
4200
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
4174
4201
  fill: "currentColor",
4175
4202
  d: "M6 15.79c-.13 0-.26-.03-.38-.08a.977.977 0 01-.62-.92V1.21a1 1 0 01.62-.93C6 .12 6.42.21 6.71.5l6.44 6.44c.58.58.58 1.54 0 2.12L6.71 15.5c-.19.19-.45.29-.71.29z"
4176
4203
  })));
4177
4204
 
4178
- var _path$g, _path2$1;
4179
- function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
4180
- const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
4205
+ var _path$i, _path2$1;
4206
+ function _extends$l() { return _extends$l = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$l.apply(null, arguments); }
4207
+ const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
4181
4208
  xmlns: "http://www.w3.org/2000/svg",
4182
4209
  width: 16,
4183
4210
  height: 16,
4184
4211
  focusable: "false",
4185
4212
  viewBox: "0 0 24 24"
4186
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
4213
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
4187
4214
  d: "M2.75 20C2.75 20.5523 3.19772 21 3.75 21C4.30228 21 4.75 20.5523 4.75 20L4.75 4C4.75 3.44772 4.30229 3 3.75 3C3.19772 3 2.75 3.44772 2.75 4V20Z",
4188
4215
  fill: "currentColor"
4189
4216
  })), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -4241,18 +4268,18 @@ const ControlsGroupCenter = (props) => {
4241
4268
  const nextTime = videoRef.currentTime + 10;
4242
4269
  videoRef.currentTime = nextTime;
4243
4270
  };
4244
- return (jsxRuntime.jsxs(StyledDiv$3, Object.assign({}, props, { children: [jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4271
+ return (jsxRuntime.jsxs(StyledDiv$3, Object.assign({}, props, { children: [jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4245
4272
  if (videoRef) {
4246
4273
  videoRef.currentTime = 0;
4247
4274
  }
4248
4275
  e.stopPropagation();
4249
- } }, { children: jsxRuntime.jsx(SvgPreviousFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4276
+ } }, { children: jsxRuntime.jsx(SvgPreviousFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4250
4277
  onRewind();
4251
4278
  e.stopPropagation();
4252
- } }, { children: jsxRuntime.jsx(SvgBackSecondsFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, size: "large", onClick: togglePlay }, { children: isPlaying ? (jsxRuntime.jsx(SvgPauseFill, { style: { width: "24px", height: "24px" } })) : (jsxRuntime.jsx(SvgPlayFill, { style: { width: "24px", height: "24px" } })) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4279
+ } }, { children: jsxRuntime.jsx(SvgBackSecondsFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ size: "large", onClick: togglePlay }, { children: isPlaying ? (jsxRuntime.jsx(SvgPauseFill, { style: { width: "24px", height: "24px" } })) : (jsxRuntime.jsx(SvgPlayFill, { style: { width: "24px", height: "24px" } })) })), jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4253
4280
  onForward();
4254
4281
  e.stopPropagation();
4255
- } }, { children: jsxRuntime.jsx(SvgForwardSecondsFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, isPill: true, onClick: (e) => {
4282
+ } }, { children: jsxRuntime.jsx(SvgForwardSecondsFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ isPill: true, onClick: (e) => {
4256
4283
  const newSpeed = getNextPlaybackRate(playBackRate);
4257
4284
  if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.playbackRate) {
4258
4285
  setPlayBackRate(newSpeed);
@@ -4262,30 +4289,82 @@ const ControlsGroupCenter = (props) => {
4262
4289
  } }, { children: jsxRuntime.jsxs(SM, Object.assign({ isBold: true, style: { lineHeight: "16px" } }, { children: [playBackRate, "x"] })) }))] })));
4263
4290
  };
4264
4291
 
4265
- var _path$f;
4266
- function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
4267
- const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
4292
+ var _path$h, _circle$2;
4293
+ function _extends$k() { return _extends$k = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$k.apply(null, arguments); }
4294
+ const SvgTagStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
4268
4295
  xmlns: "http://www.w3.org/2000/svg",
4269
4296
  width: 16,
4270
4297
  height: 16,
4271
4298
  focusable: "false",
4272
4299
  viewBox: "0 0 16 16"
4273
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
4300
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
4274
4301
  fill: "none",
4275
4302
  stroke: "currentColor",
4276
- strokeLinecap: "round",
4277
- d: "M4.5.5H1C.72.5.5.72.5 1v3.5m15 0V1c0-.28-.22-.5-.5-.5h-3.5m-11 11V15c0 .28.22.5.5.5h3.5m11-4V15c0 .28-.22.5-.5.5h-3.5m-7-11L1 1m10.5 3.5L15 1M4.5 11.5L1 15m10.5-3.5L15 15"
4303
+ d: "M.5 1v5.3c0 .1.1.3.1.4l8.5 8.5c.2.2.5.2.7 0l5.3-5.3c.2-.2.2-.5 0-.7L6.6.6S6.4.5 6.3.5H1C.7.5.5.7.5 1z"
4304
+ })), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
4305
+ cx: 4,
4306
+ cy: 4,
4307
+ r: 1,
4308
+ fill: "currentColor"
4278
4309
  })));
4279
4310
 
4280
- var _path$e;
4281
- function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
4282
- const SvgMinimizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
4283
- xmlns: "http://www.w3.org/2000/svg",
4284
- width: 16,
4285
- height: 16,
4286
- focusable: "false",
4287
- viewBox: "0 0 16 16"
4288
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
4311
+ var _path$g;
4312
+ function _extends$j() { return _extends$j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$j.apply(null, arguments); }
4313
+ const SvgPlus$1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
4314
+ width: 12,
4315
+ height: 12,
4316
+ viewBox: "0 0 12 12",
4317
+ fill: "none",
4318
+ xmlns: "http://www.w3.org/2000/svg"
4319
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
4320
+ fillRule: "evenodd",
4321
+ clipRule: "evenodd",
4322
+ d: "M6.5 1C6.19318 1 5.94444 1.24873 5.94444 1.55556V5.44444H2.05556C1.74873 5.44444 1.5 5.69318 1.5 6C1.5 6.30683 1.74873 6.55556 2.05556 6.55556H5.94444V10.4444C5.94444 10.7513 6.19318 11 6.5 11C6.80683 11 7.05556 10.7513 7.05556 10.4444V6.55556H10.9444C11.2513 6.55556 11.5 6.30683 11.5 6C11.5 5.69318 11.2513 5.44444 10.9444 5.44444H7.05556V1.55556C7.05556 1.24873 6.80683 1 6.5 1Z",
4323
+ fill: "currentColor"
4324
+ })));
4325
+
4326
+ // Prevent button from breaking on smaller screens
4327
+ const StyledButton$2 = styled.styled(Button) `
4328
+ overflow: visible;
4329
+ `;
4330
+ const Cutter = ({ onCutHandler, isCutting, i18n, }) => {
4331
+ var _a;
4332
+ const { context } = Video.useVideoContext();
4333
+ const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4334
+ if (!onCutHandler)
4335
+ return null;
4336
+ return (jsxRuntime.jsx(StyledButton$2, Object.assign({ isPrimary: true, isAccent: !isCutting, size: "small", onClick: (e) => {
4337
+ if (videoRef) {
4338
+ onCutHandler(videoRef.currentTime);
4339
+ }
4340
+ e.stopPropagation();
4341
+ } }, { children: isCutting ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), jsxRuntime.jsx(Span, { children: (i18n === null || i18n === void 0 ? void 0 : i18n.onHighlight) || "End observation" })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgPlus$1, {}) }), jsxRuntime.jsx(Span, { children: (i18n === null || i18n === void 0 ? void 0 : i18n.beforeHighlight) || "Start observation" })] })) })));
4342
+ };
4343
+
4344
+ var _path$f;
4345
+ function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
4346
+ const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
4347
+ xmlns: "http://www.w3.org/2000/svg",
4348
+ width: 16,
4349
+ height: 16,
4350
+ focusable: "false",
4351
+ viewBox: "0 0 16 16"
4352
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
4353
+ fill: "none",
4354
+ stroke: "currentColor",
4355
+ strokeLinecap: "round",
4356
+ d: "M4.5.5H1C.72.5.5.72.5 1v3.5m15 0V1c0-.28-.22-.5-.5-.5h-3.5m-11 11V15c0 .28.22.5.5.5h3.5m11-4V15c0 .28-.22.5-.5.5h-3.5m-7-11L1 1m10.5 3.5L15 1M4.5 11.5L1 15m10.5-3.5L15 15"
4357
+ })));
4358
+
4359
+ var _path$e;
4360
+ function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
4361
+ const SvgMinimizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
4362
+ xmlns: "http://www.w3.org/2000/svg",
4363
+ width: 16,
4364
+ height: 16,
4365
+ focusable: "false",
4366
+ viewBox: "0 0 16 16"
4367
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
4289
4368
  fill: "none",
4290
4369
  stroke: "currentColor",
4291
4370
  strokeLinecap: "round",
@@ -4328,7 +4407,7 @@ const FullScreenButton = ({ container, }) => {
4328
4407
  setFullScreen(false);
4329
4408
  }
4330
4409
  }
4331
- }), [ref, isFullScreen]);
4410
+ }), [ref, isFullScreen, setFullScreen]);
4332
4411
  const canGoFullScreen = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
4333
4412
  if (ref) {
4334
4413
  return (requestFullscreen ||
@@ -4353,7 +4432,7 @@ const FullScreenButton = ({ container, }) => {
4353
4432
  }
4354
4433
  };
4355
4434
  }, [ref]);
4356
- return (jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4435
+ return (jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4357
4436
  handleFullScreen();
4358
4437
  e.stopPropagation();
4359
4438
  }, disabled: !canGoFullScreen() }, { children: document.fullscreenElement || isFullScreen ? (jsxRuntime.jsx(SvgMinimizeStroke, {})) : (jsxRuntime.jsx(SvgMaximizeStroke, {})) })));
@@ -4375,7 +4454,7 @@ const Progress = React.forwardRef((props, ref) => (jsxRuntime.jsx(UgProgress, Ob
4375
4454
  const StyledProgress = styled.styled(Progress) `
4376
4455
  width: 100%;
4377
4456
  border-radius: 0;
4378
- color: ${({ theme }) => theme.palette.grey[700]};
4457
+ color: ${({ theme }) => theme.palette.grey[400]};
4379
4458
  cursor: pointer;
4380
4459
  > div {
4381
4460
  border-radius: 0;
@@ -4388,7 +4467,7 @@ const ProgressBar = React.forwardRef((props, ref) => {
4388
4467
 
4389
4468
  const StyledDiv$2 = styled__default["default"].div `
4390
4469
  display: flex;
4391
- color: ${({ theme }) => theme.palette.grey[300]};
4470
+ color: ${({ theme }) => theme.palette.grey[700]};
4392
4471
  `;
4393
4472
  const TimeLabel = ({ current, duration, }) => (jsxRuntime.jsx(StyledDiv$2, { children: jsxRuntime.jsxs(SM, Object.assign({ tag: "span" }, { children: [formatDuration(current), "/", formatDuration(duration)] })) }));
4394
4473
 
@@ -4397,7 +4476,7 @@ const Wrapper$1 = styled__default["default"].div `
4397
4476
  bottom: ${({ theme }) => theme.space.sm};
4398
4477
  z-index: 1;
4399
4478
  `;
4400
- const Content$1 = styled__default["default"].div `
4479
+ const Content$2 = styled__default["default"].div `
4401
4480
  display: flex;
4402
4481
  background-color: ${({ theme }) => theme.palette.grey[800]};
4403
4482
  border-radius: 2px;
@@ -4405,57 +4484,61 @@ const Content$1 = styled__default["default"].div `
4405
4484
  padding: 2px 4px;
4406
4485
  display: inline-flex;
4407
4486
  color: white;
4487
+ font-size: ${({ theme }) => theme.fontSizes.sm};
4408
4488
  align-items: center;
4409
4489
  justify-content: center;
4410
- min-height: 16px;
4490
+ min-height: 14px;
4411
4491
  `;
4412
4492
  const PlayerTooltip = (_a) => {
4413
4493
  var { children } = _a, props = __rest(_a, ["children"]);
4414
- return (jsxRuntime.jsx(Wrapper$1, Object.assign({}, props, { children: jsxRuntime.jsx(Content$1, { children: children }) })));
4494
+ return (jsxRuntime.jsx(Wrapper$1, Object.assign({}, props, { children: jsxRuntime.jsx(Content$2, { children: children }) })));
4415
4495
  };
4416
4496
 
4417
- var _path$d, _circle$1;
4418
- function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
4419
- const SvgTagStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
4420
- xmlns: "http://www.w3.org/2000/svg",
4421
- width: 16,
4422
- height: 16,
4423
- focusable: "false",
4424
- viewBox: "0 0 16 16"
4425
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
4426
- fill: "none",
4427
- stroke: "currentColor",
4428
- d: "M.5 1v5.3c0 .1.1.3.1.4l8.5 8.5c.2.2.5.2.7 0l5.3-5.3c.2-.2.2-.5 0-.7L6.6.6S6.4.5 6.3.5H1C.7.5.5.7.5 1z"
4429
- })), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
4430
- cx: 4,
4431
- cy: 4,
4432
- r: 1,
4433
- fill: "currentColor"
4434
- })));
4497
+ function useDebounce(value, delay) {
4498
+ const [debouncedValue, setDebouncedValue] = React.useState(value);
4499
+ React.useEffect(() => {
4500
+ const timer = setTimeout(() => setDebouncedValue(value), delay || 500);
4501
+ return () => {
4502
+ clearTimeout(timer);
4503
+ };
4504
+ }, [value, delay]);
4505
+ return debouncedValue;
4506
+ }
4435
4507
 
4436
- const Cutter = ({ onCutHandler, isCutting, i18n, }) => {
4437
- var _a;
4438
- const { context } = Video.useVideoContext();
4439
- const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4440
- if (!onCutHandler)
4441
- return null;
4442
- return (jsxRuntime.jsxs(Button, Object.assign({ isPrimary: true, isAccent: true, size: "small", onClick: (e) => {
4443
- if (videoRef) {
4444
- onCutHandler(videoRef.currentTime);
4445
- }
4446
- e.stopPropagation();
4447
- } }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), isCutting
4448
- ? (i18n === null || i18n === void 0 ? void 0 : i18n.onHighlight) || "Click again to stop"
4449
- : (i18n === null || i18n === void 0 ? void 0 : i18n.beforeHighlight) || "New highlight"] })));
4508
+ const Pin = styled.styled.div `
4509
+ width: 2px;
4510
+ bottom: 0;
4511
+ left: ${({ left }) => `${left}%`};
4512
+ position: absolute;
4513
+ height: 250%;
4514
+ z-index: 2;
4515
+ background-color: ${({ theme }) => theme.palette.grey[600]};
4516
+ margin-left: -2px; // To not override the current time marker
4517
+
4518
+ &:after {
4519
+ content: "";
4520
+ position: absolute;
4521
+ bottom: 100%;
4522
+ left: 50%;
4523
+ width: 10px;
4524
+ height: 10px;
4525
+ border-radius: 50%;
4526
+ transform: translate(-50%, 0);
4527
+ background-color: ${({ theme }) => theme.palette.grey[600]};
4528
+ }
4529
+ `;
4530
+ const CutStart = ({ left }) => {
4531
+ return jsxRuntime.jsx(Pin, { id: "obs-start-pin", left: left });
4450
4532
  };
4451
4533
 
4452
4534
  const ControlsWrapper = styled__default["default"].div `
4453
- position: absolute;
4535
+ ${({ showControls }) => showControls ? "position: relative;" : "position: absolute;"}
4454
4536
  bottom: 0;
4455
4537
  left: 0;
4456
4538
  right: 0;
4457
4539
  padding: ${({ theme }) => theme.space.xxs} 0;
4458
- background-color: ${({ theme }) => reactTheming.getColor(theme.palette.grey, 700, undefined, 0.8)};
4540
+ background-color: ${({ theme }) => theme.palette.grey[100]};
4541
+ height: 80px;
4459
4542
  ${({ isPlaying }) => isPlaying && "display: none;"}
4460
4543
  z-index: 2;
4461
4544
  `;
@@ -4477,14 +4560,26 @@ const StyledDiv$1 = styled__default["default"].div `
4477
4560
  display: flex;
4478
4561
  align-items: center;
4479
4562
  `;
4480
- const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, }) => {
4563
+ const CurrentTimeMarker = styled__default["default"].div `
4564
+ width: 2px;
4565
+ top: 0;
4566
+ left: ${({ left }) => `${left}%`};
4567
+ position: absolute;
4568
+ height: 110%;
4569
+ z-index: 1;
4570
+ background-color: white;
4571
+ `;
4572
+ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, showControls = false, }) => {
4481
4573
  var _a, _b, _c;
4482
4574
  const [progress, setProgress] = React.useState(0);
4483
4575
  const [tooltipMargin, setTooltipMargin] = React.useState(0);
4484
4576
  const [tooltipLabel, setTooltipLabel] = React.useState("00:00");
4485
4577
  const [marks, setMarks] = React.useState(bookmarks);
4578
+ const [updatedMark, setUpdatedMark] = React.useState();
4486
4579
  const progressRef = React.useRef(null);
4487
4580
  const { context, setCurrentTime } = Video.useVideoContext();
4581
+ const debouncedMark = useDebounce(updatedMark, 500);
4582
+ const [cutStart, setCutStart] = React.useState(0);
4488
4583
  const { reset, isGrabbing, activeBookmark, fromEnd } = useProgressContext();
4489
4584
  React.useEffect(() => {
4490
4585
  setMarks(bookmarks);
@@ -4540,15 +4635,8 @@ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpd
4540
4635
  ...marks.slice(currentObsIndex + 1),
4541
4636
  ];
4542
4637
  setMarks(newMarks);
4543
- onBookMarkUpdated === null || onBookMarkUpdated === void 0 ? void 0 : onBookMarkUpdated(updatedMark);
4544
- }, [
4545
- activeBookmark,
4546
- context.part.start,
4547
- duration,
4548
- fromEnd,
4549
- onBookMarkUpdated,
4550
- marks,
4551
- ]);
4638
+ setUpdatedMark(updatedMark);
4639
+ }, [activeBookmark, context.part.start, duration, fromEnd, marks]);
4552
4640
  React.useEffect(() => {
4553
4641
  var _a;
4554
4642
  const currentTime = ((_a = context.player) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;
@@ -4562,19 +4650,30 @@ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpd
4562
4650
  document.removeEventListener("mouseup", reset);
4563
4651
  };
4564
4652
  }, [reset, marks]);
4565
- return (jsxRuntime.jsxs(ControlsWrapper, Object.assign({ isPlaying: context.isPlaying }, { children: [jsxRuntime.jsxs(ProgressContainer, Object.assign({ onMouseEnter: onMouseEvent, onMouseMove: onMouseEvent, onMouseLeave: onMouseEvent }, { children: [jsxRuntime.jsx(StyledTooltip, Object.assign({ style: { marginLeft: `${tooltipMargin}px` } }, { children: tooltipLabel })), !!duration &&
4566
- (marks === null || marks === void 0 ? void 0 : marks.map((bookmark, index) => (jsxRuntime.jsx(Bookmark, Object.assign({}, bookmark), `${index}${bookmark.start}`)))), jsxRuntime.jsx(ProgressBar, { ref: progressRef, progress: progress, handleSkipAhead: handleSkipAhead, duration: duration })] })), jsxRuntime.jsxs(ControlsBar, { children: [jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "start" } }, { children: [jsxRuntime.jsx(AudioButton, {}), jsxRuntime.jsx(TimeLabel, { current: relCurrentTime, duration: duration })] })), jsxRuntime.jsx(ControlsGroupCenter, { style: { width: "60%" } }), jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "end" } }, { children: [jsxRuntime.jsx(Cutter, { onCutHandler: onCutHandler, isCutting: isCutting, i18n: i18n }), jsxRuntime.jsx(FullScreenButton, { container: container })] }))] })] })));
4653
+ React.useEffect(() => {
4654
+ if (debouncedMark) {
4655
+ onBookMarkUpdated === null || onBookMarkUpdated === void 0 ? void 0 : onBookMarkUpdated(debouncedMark);
4656
+ }
4657
+ }, [debouncedMark, onBookMarkUpdated]);
4658
+ React.useEffect(() => {
4659
+ if (isCutting) {
4660
+ setCutStart(progress);
4661
+ }
4662
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4663
+ }, [isCutting]);
4664
+ return (jsxRuntime.jsxs(ControlsWrapper, Object.assign({ showControls: showControls }, (!showControls && { isPlaying: context.isPlaying }), { children: [jsxRuntime.jsxs(ProgressContainer, Object.assign({ onMouseEnter: onMouseEvent, onMouseMove: onMouseEvent, onMouseLeave: onMouseEvent }, { children: [jsxRuntime.jsx(StyledTooltip, Object.assign({ style: { marginLeft: `${tooltipMargin}px` } }, { children: tooltipLabel })), !!duration &&
4665
+ (marks === null || marks === void 0 ? void 0 : marks.map((bookmark, index) => (jsxRuntime.jsx(Bookmark, Object.assign({}, bookmark), `${index}${bookmark.start}`)))), jsxRuntime.jsx(ProgressBar, { ref: progressRef, progress: progress, handleSkipAhead: handleSkipAhead, duration: duration }), isCutting && jsxRuntime.jsx(CutStart, { left: cutStart }), jsxRuntime.jsx(CurrentTimeMarker, { left: progress })] })), jsxRuntime.jsxs(ControlsBar, { children: [jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "start" } }, { children: [jsxRuntime.jsx(AudioButton, {}), jsxRuntime.jsx(TimeLabel, { current: relCurrentTime, duration: duration })] })), jsxRuntime.jsx(ControlsGroupCenter, { style: { width: "60%" } }), jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "end" } }, { children: [jsxRuntime.jsx(Cutter, { onCutHandler: onCutHandler, isCutting: isCutting, i18n: i18n }), jsxRuntime.jsx(FullScreenButton, { container: container })] }))] })] })));
4567
4666
  };
4568
4667
 
4569
- var _path$c;
4570
- function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
4571
- const SvgPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
4668
+ var _path$d;
4669
+ function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
4670
+ const SvgPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
4572
4671
  width: 70,
4573
4672
  height: 70,
4574
4673
  viewBox: "0 0 70 70",
4575
4674
  fill: "none",
4576
4675
  xmlns: "http://www.w3.org/2000/svg"
4577
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
4676
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
4578
4677
  d: "M60 35L17 62L17 8L60 35Z",
4579
4678
  fill: "#003A57"
4580
4679
  })));
@@ -4585,8 +4684,9 @@ const FloatingContainer = styled__default["default"].div `
4585
4684
  top: 0;
4586
4685
  left: 0;
4587
4686
  right: 0;
4588
- ${({ isPlaying }) => isPlaying && "display: none;"}
4589
4687
  z-index: 1;
4688
+ ${({ isPlaying }) => isPlaying && "display: none;"}
4689
+ ${({ showControls }) => showControls ? "height: 100%" : "height: calc(100% - 80px)"};
4590
4690
  `;
4591
4691
  const PlayIcon = styled__default["default"](SvgPlayIcon) ``;
4592
4692
  const BigButton = styled__default["default"](IconButton) `
@@ -4595,6 +4695,10 @@ const BigButton = styled__default["default"](IconButton) `
4595
4695
  min-width: ${({ theme }) => theme.space.base * 15}px;
4596
4696
  width: 80px;
4597
4697
  height: 80px;
4698
+
4699
+ box-shadow: ${({ theme }) => theme.shadows.boxShadow(theme)};
4700
+
4701
+
4598
4702
  ${PlayIcon} {
4599
4703
  width: 60%;
4600
4704
  height: 60%;
@@ -4607,8 +4711,8 @@ const ButtonsContainer = styled__default["default"].div `
4607
4711
  height: 100%;
4608
4712
  `;
4609
4713
  const FloatingControls = (props) => {
4610
- const { isPlaying, onClick } = props;
4611
- return (jsxRuntime.jsx(FloatingContainer, Object.assign({ isPlaying: isPlaying, onClick: onClick }, { children: jsxRuntime.jsx(ButtonsContainer, { children: !isPlaying && (jsxRuntime.jsx(BigButton, Object.assign({ isPrimary: true, size: "large" }, { children: jsxRuntime.jsx(PlayIcon, { color: "red" }) }))) }) })));
4714
+ const { isPlaying, showControls, onClick } = props;
4715
+ return (jsxRuntime.jsx(FloatingContainer, Object.assign({ isPlaying: isPlaying, showControls: showControls, onClick: onClick }, { children: jsxRuntime.jsx(ButtonsContainer, { children: !isPlaying && (jsxRuntime.jsx(BigButton, Object.assign({ isPrimary: true, size: "large" }, { children: jsxRuntime.jsx(PlayIcon, { color: "red" }) }))) }) })));
4612
4716
  };
4613
4717
 
4614
4718
  const VideoStyle = styled.css `
@@ -4634,9 +4738,13 @@ const VideoStyle = styled.css `
4634
4738
 
4635
4739
  const Container$1 = styled__default["default"].div `
4636
4740
  position: relative;
4637
- display: flex;
4638
- flex-direction: column;
4639
- justify-content: center;
4741
+ ${({ showControls }) => !showControls ? `
4742
+ display: flex;
4743
+ flex-direction: column;
4744
+ justify-content: center;
4745
+ ` : `
4746
+ margin-bottom: 80px;
4747
+ `}
4640
4748
  height: 100%;
4641
4749
  width: 100%;
4642
4750
  video {
@@ -4661,8 +4769,7 @@ const Container$1 = styled__default["default"].div `
4661
4769
  }
4662
4770
  }
4663
4771
  }
4664
-
4665
- background-color: ${({ theme }) => theme.palette.grey[700]};
4772
+ background: ${({ theme }) => theme.palette.grey[400]};
4666
4773
  `;
4667
4774
 
4668
4775
  const UgSpinner = styled__default["default"](reactLoaders.Spinner) ``;
@@ -4684,6 +4791,79 @@ const StyledDiv = styled__default["default"].div `
4684
4791
  `;
4685
4792
  const VideoSpinner = () => (jsxRuntime.jsx(StyledDiv, { children: jsxRuntime.jsx(Spinner, { size: "50", color: "white" }) }));
4686
4793
 
4794
+ const usePictureInPicture = (videoRef, pipMode, onPipChange) => {
4795
+ const getObserver = (videoRef, isVideoPlaying) => {
4796
+ return new IntersectionObserver((entries) => {
4797
+ entries.forEach((entry) => {
4798
+ if (!entry.isIntersecting && isVideoPlaying()) {
4799
+ videoRef.requestPictureInPicture();
4800
+ }
4801
+ if (document.pictureInPictureElement &&
4802
+ entry.isIntersecting &&
4803
+ !isVideoPlaying()) {
4804
+ document.exitPictureInPicture();
4805
+ }
4806
+ });
4807
+ }, { threshold: 0.5 });
4808
+ };
4809
+ const handleManualPipMode = (videoRef, pipMode) => {
4810
+ if (pipMode) {
4811
+ videoRef.requestPictureInPicture();
4812
+ }
4813
+ if (!pipMode && document.pictureInPictureElement) {
4814
+ document.exitPictureInPicture();
4815
+ }
4816
+ };
4817
+ React.useEffect(() => {
4818
+ // bail out if pipMode is not defined or videoRef is not defined or pip is not supported
4819
+ if (typeof pipMode === "undefined")
4820
+ return;
4821
+ if (!document.pictureInPictureEnabled) {
4822
+ console.warn("Picture-in-Picture is not supported in this browser");
4823
+ return;
4824
+ }
4825
+ if (!videoRef)
4826
+ return;
4827
+ // if pipMode is auto, we will enter picture in picture mode when the video is not in view
4828
+ if (pipMode === "auto") {
4829
+ const isVideoPlaying = () => videoRef.currentTime > 0 &&
4830
+ !videoRef.paused &&
4831
+ !videoRef.ended &&
4832
+ videoRef.readyState > 2;
4833
+ const observer = getObserver(videoRef, isVideoPlaying);
4834
+ observer.observe(videoRef);
4835
+ return () => {
4836
+ observer.disconnect();
4837
+ };
4838
+ }
4839
+ else if (typeof pipMode === "boolean") {
4840
+ handleManualPipMode(videoRef, pipMode);
4841
+ }
4842
+ else {
4843
+ handleManualPipMode(videoRef, pipMode());
4844
+ }
4845
+ }, [pipMode, videoRef]);
4846
+ React.useEffect(() => {
4847
+ if (!document.pictureInPictureEnabled) {
4848
+ return;
4849
+ }
4850
+ document.addEventListener("enterpictureinpicture", () => {
4851
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(true);
4852
+ });
4853
+ document.addEventListener("leavepictureinpicture", () => {
4854
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(false);
4855
+ });
4856
+ return () => {
4857
+ document.removeEventListener("enterpictureinpicture", () => {
4858
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(true);
4859
+ });
4860
+ document.removeEventListener("leavepictureinpicture", () => {
4861
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(false);
4862
+ });
4863
+ };
4864
+ }, [onPipChange]);
4865
+ };
4866
+
4687
4867
  /**
4688
4868
  * The Player is a styled media tag with custom controls
4689
4869
  * <hr>
@@ -4694,11 +4874,14 @@ const Player = React.forwardRef((props, forwardRef) => (jsxRuntime.jsx(Video__de
4694
4874
  const PlayerCore = React.forwardRef((props, forwardRef) => {
4695
4875
  var _a;
4696
4876
  const { context, togglePlay, setIsPlaying } = Video.useVideoContext();
4697
- const { onCutHandler, bookmarks, isCutting } = props;
4877
+ const { onCutHandler, bookmarks, isCutting, pipMode, onPipChange } = props;
4698
4878
  const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4699
4879
  const isLoaded = !!videoRef;
4700
4880
  const containerRef = React.useRef(null);
4701
- React.useImperativeHandle(forwardRef, () => videoRef, [videoRef]);
4881
+ React.useImperativeHandle(forwardRef, () => videoRef, [
4882
+ videoRef,
4883
+ ]);
4884
+ usePictureInPicture(videoRef, pipMode, onPipChange);
4702
4885
  React.useEffect(() => {
4703
4886
  if (videoRef) {
4704
4887
  videoRef.addEventListener("pause", () => {
@@ -4714,7 +4897,9 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
4714
4897
  };
4715
4898
  }, [setIsPlaying, videoRef]);
4716
4899
  return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: context.isPlaying, onClick: togglePlay })), jsxRuntime.jsx(Video__default["default"].Player, { className: "player-container" }), jsxRuntime.jsx(ProgressContextProvider, { children: jsxRuntime.jsx(Controls, { container: containerRef.current, onCutHandler: onCutHandler, bookmarks: bookmarks, isCutting: isCutting, onBookMarkUpdated: props.handleBookmarkUpdate, i18n: props.i18n }) })] })));
4717
- });
4900
+ });
4901
+ const PlayerProvider = (props) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: props.children })));
4902
+ PlayerProvider.Core = PlayerCore;
4718
4903
 
4719
4904
  const MediaLightBox = ({ header, onClose, slideChange, selectedImageIndex, thumbnails, videoRefs, isOpen, details }) => {
4720
4905
  if (!isOpen) {
@@ -4799,9 +4984,32 @@ const CommentBox = (_a) => {
4799
4984
  return null;
4800
4985
  ed.on("create", ({ editor }) => setEditor(editor));
4801
4986
  ed.on("update", ({ editor }) => setEditor(editor));
4802
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: (_b = thumbnails[selectedImageIndex]) === null || _b === void 0 ? void 0 : _b.name, onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: thumbnails, videoRefs: videoRefs }), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0, paddingBottom: 12 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { openLightbox: handleOpenLightbox })] })) }), hasButtonsMenu && jsxRuntime.jsx(CommentBar, { editor: ed, i18n: i18n })] }));
4987
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: (_b = thumbnails[selectedImageIndex]) === null || _b === void 0 ? void 0 : _b.name, onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: thumbnails, videoRefs: videoRefs }), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0, paddingBottom: 12 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu$1, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { openLightbox: handleOpenLightbox })] })) }), hasButtonsMenu && jsxRuntime.jsx(CommentBar, { editor: ed, i18n: i18n })] }));
4803
4988
  };
4804
4989
 
4990
+ const UgGrid = styled__default["default"](reactGrid.Grid) `
4991
+ padding-left: 0;
4992
+ padding-right: 0;
4993
+ `;
4994
+ /**
4995
+ * The Grid component is a framework for building modular layouts.
4996
+ * <hr>
4997
+ * Used for this:
4998
+ - To structure the layout of a page
4999
+ */
5000
+ const Grid = (props) => jsxRuntime.jsx(UgGrid, Object.assign({}, props));
5001
+
5002
+ const Row$1 = (props) => jsxRuntime.jsx(reactGrid.Row, Object.assign({}, props));
5003
+
5004
+ const StyledCol$1 = styled__default["default"](reactGrid.Col) `
5005
+ margin-bottom: ${theme.space.lg};
5006
+
5007
+ @media screen and (max-width: ${theme.breakpoints.sm}) {
5008
+ margin-bottom: ${theme.space.md};
5009
+ }
5010
+ `;
5011
+ const Col = (props) => jsxRuntime.jsx(StyledCol$1, Object.assign({}, props));
5012
+
4805
5013
  const CommentCard = styled.styled(Card) `
4806
5014
  padding: ${({ theme }) => `${theme.space.base * 3}px ${theme.space.sm}`};
4807
5015
  background-color: ${({ theme }) => theme.palette.grey[100]};
@@ -4876,6 +5084,7 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4876
5084
  handleClickThumbnail(index);
4877
5085
  } }) }), index))) })) }), jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: jsxRuntime.jsxs(reactTypography.MD, Object.assign({ isBold: true }, { children: [jsxRuntime.jsx(Grey600Span, { children: header && header.title }), header && header.message && (jsxRuntime.jsxs(Grey800Span, { children: [" | ", header.message] }))] })), onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: media, videoRefs: videoRefs, details: jsxRuntime.jsx(Comment, Object.assign({ header: header, author: {
4878
5086
  avatar: author.avatar,
5087
+ avatarType: author.avatarType,
4879
5088
  name: author.name,
4880
5089
  }, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }), jsxRuntime.jsx(Footer$2, { children: children })] }));
4881
5090
  };
@@ -4898,15 +5107,15 @@ Chat.Comments = MessagesContainer;
4898
5107
  Chat.Input = CommentBox;
4899
5108
  Chat.Footer = ChatFooter;
4900
5109
 
4901
- var _circle;
4902
- function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
4903
- const SvgCircleFullFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
5110
+ var _circle$1;
5111
+ function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
5112
+ const SvgCircleFullFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
4904
5113
  xmlns: "http://www.w3.org/2000/svg",
4905
5114
  width: 16,
4906
5115
  height: 16,
4907
5116
  focusable: "false",
4908
5117
  viewBox: "0 0 16 16"
4909
- }, props), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
5118
+ }, props), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
4910
5119
  cx: 8,
4911
5120
  cy: 8,
4912
5121
  r: 8,
@@ -4982,77 +5191,19 @@ Drawer.Footer = reactModals.DrawerModal.Footer;
4982
5191
  Drawer.FooterItem = reactModals.DrawerModal.FooterItem;
4983
5192
  Drawer.Close = reactModals.DrawerModal.Close;
4984
5193
 
4985
- const Field$1 = styled__default["default"](reactDropdowns.Field) ``;
4986
-
4987
- var index$1 = /*#__PURE__*/Object.freeze({
4988
- __proto__: null,
4989
- Field: Field$1
4990
- });
4991
-
4992
- const UgItem = styled__default["default"](reactDropdowns.Item) `
4993
- display: flex;
4994
- flex-direction: row;
4995
- align-items: center;
4996
- justify-content: flex-start;
4997
-
4998
- > div {
4999
- height: 100%;
5000
- }
5001
-
5002
- &[disabled] * {
5003
- opacity: 0.85;
5004
- }
5005
-
5006
- &[disabled] svg {
5007
- opacity: 0.5;
5008
- }
5009
-
5010
- &[disabled]:hover {
5011
- background-color: transparent;
5012
- }
5013
- `;
5014
- const Item$1 = (props) => jsxRuntime.jsx(UgItem, Object.assign({}, props));
5015
-
5016
- const Container = styled__default["default"].div `
5017
- display: flex;
5018
- flex-direction: row;
5019
- align-items: center;
5020
- justify-content: flex-start;
5021
- width: 100%;
5022
- `;
5023
- const MetaContainer$1 = styled__default["default"].div `
5024
- display: flex;
5025
- flex-direction: column;
5026
- align-items: flex-start;
5027
- justify-content: center;
5028
- `;
5029
- const ThumbContainer = styled__default["default"].div `
5030
- display: flex;
5031
- flex-direction: row;
5032
- align-items: center;
5033
- justify-content: center;
5034
- margin-right: ${({ theme }) => theme.space.sm};
5194
+ const StyledAutocomplete$1 = styled__default["default"](reactDropdowns.Autocomplete) `
5035
5195
  width: 100%;
5036
- max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
5037
-
5038
- > div {
5039
- height: 100%;
5040
- }
5041
- `;
5042
- const Label$1 = styled__default["default"](MD) `
5043
- font-weight: ${({ theme }) => theme.fontWeights.medium};
5044
- color: ${({ theme }) => theme.palette.grey[800]};
5045
- `;
5046
- const Description$1 = styled__default["default"](SM) `
5047
- color: ${({ theme }) => theme.palette.grey[600]};
5048
5196
  `;
5049
- const Image$1 = React.memo(({ src }) => {
5050
- return jsxRuntime.jsx("img", { src: src });
5051
- });
5052
- const ItemContent = (props) => {
5053
- const { thumbSrc, description, label } = props;
5054
- return (jsxRuntime.jsxs(Container, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label$1, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
5055
- };
5197
+ /**
5198
+ * Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
5199
+ * <hr>
5200
+ * Used for this:
5201
+ - To filter down a large list of options
5202
+ - To quickly find a known option
5203
+ * Not for this:
5204
+ - To make more than one selection, use Multiselect instead
5205
+ */
5206
+ const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
5056
5207
 
5057
5208
  const StyledMenu = styled__default["default"](reactDropdowns.Menu) `
5058
5209
  width: auto !important;
@@ -5070,26 +5221,12 @@ const MediaBody = (props) => (jsxRuntime.jsx(reactDropdowns.MediaBody, Object.as
5070
5221
  const MediaFigure = (props) => (jsxRuntime.jsx(reactDropdowns.MediaFigure, Object.assign({}, props)));
5071
5222
  const MediaItem = (props) => (jsxRuntime.jsx(reactDropdowns.MediaItem, Object.assign({}, props)));
5072
5223
 
5073
- const StyledAutocomplete$1 = styled__default["default"](reactDropdowns.Autocomplete) `
5074
- width: 100%;
5075
- `;
5076
- /**
5077
- * Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
5078
- * <hr>
5079
- * Used for this:
5080
- - To filter down a large list of options
5081
- - To quickly find a known option
5082
- * Not for this:
5083
- - To make more than one selection, use Multiselect instead
5084
- */
5085
- const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
5086
-
5087
5224
  const StyledLabel$2 = styled__default["default"](reactForms.Label) ``;
5088
5225
  /**
5089
5226
  * A Label is used to specify a title for an input.
5090
5227
  * <hr>
5091
5228
  **/
5092
- const Label = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
5229
+ const Label$1 = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
5093
5230
 
5094
5231
  const MenuHeaderItem = (props) => (jsxRuntime.jsx(reactDropdowns.HeaderItem, Object.assign({}, props)));
5095
5232
 
@@ -5127,6 +5264,37 @@ const Message = (props) => jsxRuntime.jsx(reactDropdowns.Message, Object.assign(
5127
5264
  Dropdown.HeaderItem = StyledMenuHeaderItem;
5128
5265
  Dropdown.Separator = Separator;
5129
5266
 
5267
+ const Field$1 = styled__default["default"](reactDropdowns.Field) ``;
5268
+
5269
+ var index$1 = /*#__PURE__*/Object.freeze({
5270
+ __proto__: null,
5271
+ Field: Field$1
5272
+ });
5273
+
5274
+ const UgItem = styled__default["default"](reactDropdowns.Item) `
5275
+ display: flex;
5276
+ flex-direction: row;
5277
+ align-items: center;
5278
+ justify-content: flex-start;
5279
+
5280
+ > div {
5281
+ height: 100%;
5282
+ }
5283
+
5284
+ &[disabled] * {
5285
+ opacity: 0.85;
5286
+ }
5287
+
5288
+ &[disabled] svg {
5289
+ opacity: 0.5;
5290
+ }
5291
+
5292
+ &[disabled]:hover {
5293
+ background-color: transparent;
5294
+ }
5295
+ `;
5296
+ const Item$1 = (props) => jsxRuntime.jsx(UgItem, Object.assign({}, props));
5297
+
5130
5298
  const StyledAutocomplete = styled__default["default"](Autocomplete) `
5131
5299
  ${(props) => props.hasSelectedItems &&
5132
5300
  `
@@ -5164,13 +5332,54 @@ const CounterMultiselect = ({ options, label, i18n, onChange, isCompact, }) => {
5164
5332
  }, onStateChange: (changes) => {
5165
5333
  if (changes.isOpen === false)
5166
5334
  setInputValue("");
5167
- }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
5335
+ }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label$1, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
5168
5336
  ? (i18n === null || i18n === void 0 ? void 0 : i18n.counterText)
5169
5337
  ? i18n.counterText(selectedItems.length)
5170
5338
  : `Items (${selectedItems.length})`
5171
5339
  : (_a = i18n === null || i18n === void 0 ? void 0 : i18n.noItems) !== null && _a !== void 0 ? _a : "No items" }))] }), jsxRuntime.jsx(Menu, Object.assign({ isCompact: isCompact }, { children: matchingOptions.length === 0 ? (jsxRuntime.jsx(Item$1, Object.assign({ disabled: true }, { children: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.noMatches) !== null && _b !== void 0 ? _b : "No matches found" }))) : (matchingOptions.map((option) => (jsxRuntime.jsx(Item$1, Object.assign({ value: option }, option, { children: jsxRuntime.jsx("span", { children: option.label }) }), option.itemId)))) }))] })) }));
5172
5340
  };
5173
5341
 
5342
+ const Container = styled__default["default"].div `
5343
+ display: flex;
5344
+ flex-direction: row;
5345
+ align-items: center;
5346
+ justify-content: flex-start;
5347
+ width: 100%;
5348
+ `;
5349
+ const MetaContainer$1 = styled__default["default"].div `
5350
+ display: flex;
5351
+ flex-direction: column;
5352
+ align-items: flex-start;
5353
+ justify-content: center;
5354
+ `;
5355
+ const ThumbContainer = styled__default["default"].div `
5356
+ display: flex;
5357
+ flex-direction: row;
5358
+ align-items: center;
5359
+ justify-content: center;
5360
+ margin-right: ${({ theme }) => theme.space.sm};
5361
+ width: 100%;
5362
+ max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
5363
+
5364
+ > div {
5365
+ height: 100%;
5366
+ }
5367
+ `;
5368
+ const Label = styled__default["default"](MD) `
5369
+ font-weight: ${({ theme }) => theme.fontWeights.medium};
5370
+ color: ${({ theme }) => theme.palette.grey[800]};
5371
+ `;
5372
+ const Description$1 = styled__default["default"](SM) `
5373
+ color: ${({ theme }) => theme.palette.grey[600]};
5374
+ `;
5375
+ const Image$1 = React.memo(({ src }) => {
5376
+ return jsxRuntime.jsx("img", { src: src });
5377
+ });
5378
+ const ItemContent = (props) => {
5379
+ const { thumbSrc, description, label } = props;
5380
+ return (jsxRuntime.jsxs(Container, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
5381
+ };
5382
+
5174
5383
  const Header$1 = styled__default["default"].div `
5175
5384
  display: flex;
5176
5385
  flex-direction: column;
@@ -5274,7 +5483,7 @@ const Editor = (_a) => {
5274
5483
  }
5275
5484
  // Add here because we want to keep also the listener from the props.
5276
5485
  ed.on("update", ({ editor }) => setActiveEditor(editor));
5277
- return (jsxRuntime.jsxs(EditorContainer, Object.assign({ editable: isEditable, validation: props.validation }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle, validation: props.validation }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
5486
+ return (jsxRuntime.jsxs(EditorContainer, Object.assign({ editable: isEditable, validation: props.validation }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle, validation: props.validation }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu$1, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
5278
5487
  };
5279
5488
 
5280
5489
  const UgCheckbox = styled__default["default"](reactForms.Checkbox) ``;
@@ -5290,7 +5499,7 @@ const UgCheckbox = styled__default["default"](reactForms.Checkbox) ``;
5290
5499
  **/
5291
5500
  const Checkbox = (props) => jsxRuntime.jsx(UgCheckbox, Object.assign({}, props));
5292
5501
 
5293
- const StyledLabel$1 = styled__default["default"](Label) `
5502
+ const StyledLabel$1 = styled__default["default"](Label$1) `
5294
5503
  margin: ${({ theme }) => theme.space.base}px auto;
5295
5504
  `;
5296
5505
  const CheckboxCard = (props) => {
@@ -5327,8 +5536,8 @@ const Hint = styled__default["default"](reactForms.Hint) ``;
5327
5536
  const Input = React.forwardRef((props, ref) => jsxRuntime.jsx(UgInput, Object.assign({ ref: ref }, props)));
5328
5537
 
5329
5538
  var _g;
5330
- function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
5331
- const SvgNotesStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
5539
+ function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
5540
+ const SvgNotesStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
5332
5541
  xmlns: "http://www.w3.org/2000/svg",
5333
5542
  width: 16,
5334
5543
  height: 16,
@@ -5360,7 +5569,7 @@ const StyledInput = styled__default["default"](Input) `
5360
5569
  transition: border-color 0.2s ease-in-out 0.1s;
5361
5570
  }
5362
5571
  `;
5363
- const StyledLabel = styled__default["default"](Label) `
5572
+ const StyledLabel = styled__default["default"](Label$1) `
5364
5573
  padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xxs} 0`};
5365
5574
  transition: opacity 0.2s ease-in-out;
5366
5575
  `;
@@ -5446,15 +5655,15 @@ const UgRadio = styled__default["default"](reactForms.Radio) ``;
5446
5655
  **/
5447
5656
  const Radio = (props) => jsxRuntime.jsx(UgRadio, Object.assign({}, props));
5448
5657
 
5449
- var _path$b;
5450
- function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
5451
- const SvgCheckLg = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
5658
+ var _path$c;
5659
+ function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
5660
+ const SvgCheckLg = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
5452
5661
  width: 16,
5453
5662
  height: 16,
5454
5663
  viewBox: "0 0 16 16",
5455
5664
  fill: "#68737D",
5456
5665
  xmlns: "http://www.w3.org/2000/svg"
5457
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
5666
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
5458
5667
  fillRule: "evenodd",
5459
5668
  clipRule: "evenodd",
5460
5669
  d: "M14.6464 2.64645C14.8417 2.45118 15.1583 2.45118 15.3536 2.64645C15.5488 2.84171 15.5488 3.15829 15.3536 3.35355L5.35355 13.3536C5.15829 13.5488 4.84171 13.5488 4.64645 13.3536L0.646447 9.35355C0.451184 9.15829 0.451184 8.84171 0.646447 8.64645C0.841709 8.45118 1.15829 8.45118 1.35355 8.64645L5 12.2929L14.6464 2.64645Z"
@@ -5535,9 +5744,10 @@ const useHighlightContext = () => {
5535
5744
  };
5536
5745
 
5537
5746
  const StyledSearchWord = styled__default["default"].span `
5538
- background-color: ${({ theme }) => theme.palette.product.talk};
5539
- color: ${({ theme }) => theme.palette.grey[700]};`;
5540
- const Searchable = ({ start, text, }) => {
5747
+ background-color: ${({ theme }) => theme.palette.product.talk};
5748
+ color: ${({ theme }) => theme.palette.grey[700]};
5749
+ `;
5750
+ const Searchable = ({ text, }) => {
5541
5751
  const { searchTerm } = useHighlightContext();
5542
5752
  if (searchTerm) {
5543
5753
  const parts = text.split(new RegExp(`(${searchTerm})`, "gi"));
@@ -5546,66 +5756,143 @@ const Searchable = ({ start, text, }) => {
5546
5756
  return jsxRuntime.jsx(jsxRuntime.Fragment, { children: text });
5547
5757
  };
5548
5758
 
5549
- const StyledWord = styled__default["default"](reactTypography.Span) `
5759
+ const CreateObservationButton = styled.styled(Button) `
5760
+ user-select: none;
5761
+ position: absolute;
5762
+ left: ${({ position: { x } }) => x}px;
5763
+ top: ${({ position: { y } }) => y}px;
5764
+ transform: translate(-50%, 0);
5765
+ z-index: ${({ theme }) => theme.levels.front};
5766
+ `;
5767
+
5768
+ const getFocusedObs = (observations) => {
5769
+ return observations.find((obs) => obs.isFocused);
5770
+ };
5771
+ const StyledWord = styled__default["default"].div `
5772
+ display: inline-block;
5550
5773
  font-size: ${({ theme, size }) => theme.fontSizes[size !== null && size !== void 0 ? size : "md"]};
5551
5774
  padding: ${({ theme }) => theme.space.xxs} 0;
5775
+ position: relative;
5776
+ color: ${({ theme }) => theme.palette.grey[700]};
5777
+ white-space: pre;
5552
5778
 
5553
- ${({ observation, theme }) => {
5554
- var _a, _b;
5555
- return observation &&
5556
- ` user-select: none;
5557
- padding: 0;
5558
- background-color: ${(_a = observation.backgroundColor) !== null && _a !== void 0 ? _a : getColor(theme.palette.azure, 700, undefined, 0.5)};
5559
- color: ${(_b = observation.color) !== null && _b !== void 0 ? _b : "white"};
5779
+ ${({ observations, theme }) => {
5780
+ var _a;
5781
+ return observations &&
5782
+ observations.length > 0 &&
5783
+ `
5784
+ color: ${(_a = observations[observations.length - 1].color) !== null && _a !== void 0 ? _a : theme.palette.grey[600]};
5560
5785
  box-sizing: border-box;
5786
+ font-weight: ${getFocusedObs(observations)
5787
+ ? theme.fontWeights.extrabold
5788
+ : theme.fontWeights.semibold};
5789
+ font-style: ${getFocusedObs(observations) ? "italic" : "normal"};
5790
+ z-index: 1;
5561
5791
  &:focus {
5562
5792
  outline: none;
5563
5793
  }
5564
-
5565
- + span:not([observation]) {
5566
- margin-left: 2px;
5567
- }
5568
5794
  `;
5569
5795
  }}
5570
5796
  `;
5571
5797
  const ActiveWord = styled__default["default"].span `
5572
- background-color: ${({ theme }) => getColor(theme.palette.fuschia, 700, undefined, 0.5)};
5573
- padding: 0 2px;
5798
+ position: relative;
5799
+ z-index: 2;
5800
+ background-color: ${({ theme }) => getColor(theme.palette.fuschia, 400, undefined, 0.4)};
5574
5801
  `;
5575
5802
  const WordsContainer = styled__default["default"].div `
5576
5803
  box-sizing: border-box;
5577
5804
  ${StyledWord}, span {
5578
5805
  &::selection {
5579
- background-color: ${({ theme }) => getColor(theme.palette.kale, 700, undefined, 0.5)};
5806
+ background-color: ${({ theme }) => getColor(theme.palette.grey, 400, undefined, 0.5)};
5580
5807
  }
5581
5808
  }
5582
5809
  `;
5810
+ const Layer = styled__default["default"].div `
5811
+ position: absolute;
5812
+ top: 0;
5813
+ left: 0;
5814
+ width: 100%;
5815
+ height: 100%;
5816
+ z-index: 0;
5817
+ background-color: ${({ color }) => getColor(color, undefined, undefined, 0.2)};
5818
+ `;
5819
+ const textFromSelection = (selection) => {
5820
+ if (!selection || !selection.toString().length)
5821
+ return "";
5822
+ if (selection.anchorNode === null || selection.focusNode === null)
5823
+ return "";
5824
+ var range = selection.getRangeAt(0);
5825
+ var tempDiv = document.createElement("div");
5826
+ tempDiv.appendChild(range.cloneContents());
5827
+ var items = tempDiv.querySelectorAll("div");
5828
+ items.forEach(function (item) {
5829
+ if (item.getAttribute("data-unselectable")) {
5830
+ item.remove();
5831
+ }
5832
+ });
5833
+ var filteredText = tempDiv.textContent || tempDiv.innerText;
5834
+ return filteredText.length ? filteredText.trim() : selection.toString();
5835
+ };
5583
5836
  /**
5584
5837
  * Use Highlight to use highlight interation on any text element
5585
5838
  */
5586
5839
  const Highlight = (props) => {
5840
+ var _a;
5841
+ const { onSelectionButtonClick, search, i18n, children } = props;
5587
5842
  const ref = React.useRef(null);
5843
+ const [isSelecting, setIsSelecting] = React.useState(false);
5844
+ const [position, setPosition] = React.useState();
5845
+ const [selection, setSelection] = React.useState();
5846
+ const activeSelection = document.getSelection();
5847
+ const extractText = React.useMemo(() => textFromSelection(activeSelection), [activeSelection]);
5588
5848
  const handleSelectionChange = React.useCallback(() => {
5589
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5590
- const activeSelection = document.getSelection();
5591
- const text = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.toString();
5592
- if (!activeSelection || !text) {
5593
- return;
5849
+ var _a, _b, _c, _d, _e, _f, _g, _h;
5850
+ if (activeSelection && activeSelection.toString().length > 0) {
5851
+ // Extract the text from the selection cleaning unselectable items
5852
+ const text = extractText;
5853
+ if (!text)
5854
+ return;
5855
+ const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
5856
+ const focusNode = (_b = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
5857
+ if (anchorNode &&
5858
+ focusNode &&
5859
+ ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.contains(anchorNode)) && // Selection starts inside the ref
5860
+ ((_d = ref.current) === null || _d === void 0 ? void 0 : _d.contains(focusNode)) // Selection ends inside the ref
5861
+ ) {
5862
+ if (onSelectionButtonClick) {
5863
+ setIsSelecting(true);
5864
+ const range = activeSelection.getRangeAt(0);
5865
+ const rects = range.getClientRects();
5866
+ const lastRect = rects[rects.length - 1];
5867
+ const containerRect = ref && ref.current ? ref.current.getBoundingClientRect() : null;
5868
+ if (!lastRect || !containerRect)
5869
+ return;
5870
+ const relativeY = lastRect.bottom - containerRect.top + ref.current.scrollTop;
5871
+ const relativeX = lastRect.right - containerRect.left + ref.current.scrollLeft;
5872
+ if (relativeY > 0 || relativeX > 0)
5873
+ // Fix to avoid the button to be placed sometimes at the top left corner of the screen (X: 0, Y: 0)
5874
+ setPosition({
5875
+ x: relativeX,
5876
+ y: relativeY + 15,
5877
+ });
5878
+ }
5879
+ else {
5880
+ setIsSelecting(false);
5881
+ }
5882
+ const selectionPart = {
5883
+ from: Math.min(Number.parseFloat((_e = anchorNode.getAttribute("data-start")) !== null && _e !== void 0 ? _e : "0"), Number.parseFloat((_f = focusNode.getAttribute("data-start")) !== null && _f !== void 0 ? _f : "0")),
5884
+ to: Math.max(Number.parseFloat((_g = anchorNode.getAttribute("data-end")) !== null && _g !== void 0 ? _g : "0"), Number.parseFloat((_h = focusNode.getAttribute("data-end")) !== null && _h !== void 0 ? _h : "0")),
5885
+ };
5886
+ setSelection(Object.assign(Object.assign({}, selectionPart), { text }));
5887
+ }
5888
+ else {
5889
+ setIsSelecting(false);
5890
+ }
5594
5891
  }
5595
- const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
5596
- const focusNode = (_b = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
5597
- if (anchorNode &&
5598
- focusNode &&
5599
- ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.contains(anchorNode)) && // Selection starts inside the ref
5600
- ((_d = ref.current) === null || _d === void 0 ? void 0 : _d.contains(focusNode)) // Selection ends inside the ref
5601
- ) {
5602
- const selectionPart = {
5603
- from: Math.min(Number.parseFloat((_e = anchorNode.getAttribute("data-start")) !== null && _e !== void 0 ? _e : "0"), Number.parseFloat((_f = focusNode.getAttribute("data-start")) !== null && _f !== void 0 ? _f : "0")),
5604
- to: Math.max(Number.parseFloat((_g = anchorNode.getAttribute("data-end")) !== null && _g !== void 0 ? _g : "0"), Number.parseFloat((_h = focusNode.getAttribute("data-end")) !== null && _h !== void 0 ? _h : "0")),
5605
- };
5606
- (_j = props === null || props === void 0 ? void 0 : props.handleSelection) === null || _j === void 0 ? void 0 : _j.call(props, Object.assign(Object.assign({}, selectionPart), { text }));
5892
+ else {
5893
+ setIsSelecting(false);
5607
5894
  }
5608
- }, [props]);
5895
+ }, [activeSelection, extractText, onSelectionButtonClick]);
5609
5896
  React.useEffect(() => {
5610
5897
  if (ref.current === null)
5611
5898
  return;
@@ -5614,18 +5901,31 @@ const Highlight = (props) => {
5614
5901
  document.removeEventListener("selectionchange", handleSelectionChange);
5615
5902
  };
5616
5903
  }, [ref, props, handleSelectionChange]);
5617
- return (jsxRuntime.jsx(HighlightContextProvider, Object.assign({ term: props.search }, { children: jsxRuntime.jsx(WordsContainer, Object.assign({ ref: ref }, { children: props.children })) })));
5904
+ return (jsxRuntime.jsxs(HighlightContextProvider, Object.assign({ term: search }, { children: [jsxRuntime.jsx(WordsContainer, Object.assign({ ref: ref }, { children: children })), onSelectionButtonClick && isSelecting && selection && (jsxRuntime.jsxs(CreateObservationButton, Object.assign({ isAccent: true, isPrimary: true, position: position !== null && position !== void 0 ? position : {
5905
+ x: 0,
5906
+ y: 0,
5907
+ }, onClick: () => onSelectionButtonClick(selection) }, { children: [jsxRuntime.jsx(CreateObservationButton.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), (_a = i18n === null || i18n === void 0 ? void 0 : i18n.selectionButtonLabel) !== null && _a !== void 0 ? _a : "Create observation"] })))] })));
5618
5908
  };
5619
- const Word = (props) => {
5620
- var _a;
5909
+ const Word$1 = (props) => {
5621
5910
  const isActive = props.currentTime &&
5622
5911
  props.currentTime >= props.start &&
5623
5912
  props.currentTime < props.end;
5624
- // Is there an observation that contains this word?
5625
- const observation = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.find((obs) => props.start >= obs.start && props.end <= obs.end);
5626
- return (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { observation: observation, "data-start": props.start, "data-end": props.end, className: !!observation ? "highlighted" : "" }, (!!observation ? { tag: "observation" } : {}), { children: [isActive ? (jsxRuntime.jsx(ActiveWord, { children: jsxRuntime.jsx(Searchable, { start: props.start, text: props.text }) })) : (jsxRuntime.jsx(Searchable, { start: props.start, text: props.text })), " "] })));
5913
+ // Are there any observations containing this word?
5914
+ const foundObservations = React.useMemo(() => {
5915
+ var _a, _b;
5916
+ return (_b = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.filter((obs) => props.start >= obs.start && props.end <= obs.end)) !== null && _b !== void 0 ? _b : [];
5917
+ }, [props.observations, props.start, props.end]);
5918
+ const ObsWord = React.useMemo(() => (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { "data-start": props.start, "data-end": props.end, className: foundObservations.length > 0 ? "highlighted" : "" }, (foundObservations && { observations: foundObservations }), { children: [foundObservations.length > 0 &&
5919
+ foundObservations.map((obs) => {
5920
+ var _a;
5921
+ return (jsxRuntime.jsx(Layer, { color: (_a = obs.hue) !== null && _a !== void 0 ? _a : theme.palette.grey[600] }, obs.id));
5922
+ }), isActive ? (jsxRuntime.jsx(ActiveWord, Object.assign({ "data-start": props.start, "data-end": props.end }, { children: jsxRuntime.jsx(Searchable, { text: props.text }) }))) : (jsxRuntime.jsx(Searchable, { text: props.text })), " "] }))), [props, foundObservations, isActive]);
5923
+ if (props.tooltipContent !== undefined && foundObservations.length > 0) {
5924
+ return (jsxRuntime.jsx(Tooltip, Object.assign({ content: props.tooltipContent(foundObservations), isTransparent: true }, { children: ObsWord })));
5925
+ }
5926
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: ObsWord });
5627
5927
  };
5628
- Highlight.Word = Word;
5928
+ Highlight.Word = Word$1;
5629
5929
 
5630
5930
  /**
5631
5931
  * The Dots loader communicates ongoing activity after a user takes an action.
@@ -5699,15 +5999,15 @@ const Logo = (props) => {
5699
5999
  }[props.type] })));
5700
6000
  };
5701
6001
 
5702
- var _path$a;
5703
- function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
5704
- const SvgPlus = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
6002
+ var _path$b;
6003
+ function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
6004
+ const SvgPlus = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
5705
6005
  width: 16,
5706
6006
  height: 16,
5707
6007
  viewBox: "0 0 16 16",
5708
6008
  fill: "none",
5709
6009
  xmlns: "http://www.w3.org/2000/svg"
5710
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
6010
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
5711
6011
  fillRule: "evenodd",
5712
6012
  clipRule: "evenodd",
5713
6013
  d: "M7.5 2C7.22386 2 7 2.22386 7 2.5V8H1.5C1.22386 8 1 8.22386 1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V9H13.5C13.7761 9 14 8.77614 14 8.5C14 8.22386 13.7761 8 13.5 8H8V2.5C8 2.22386 7.77614 2 7.5 2Z",
@@ -5748,7 +6048,7 @@ const MultiSelect = ({ options, onChange, creatable, i18n, maxItems, size, menuH
5748
6048
  setMatchingOptions(matchedOptions);
5749
6049
  }, [inputValue, options]);
5750
6050
  return (jsxRuntime.jsxs(Dropdown, Object.assign({ inputValue: inputValue, selectedItems: options.filter((option) => option.selected), onSelect: (items) => onChange &&
5751
- onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(Label, Object.assign({ hidden: true }, { children: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.label) !== null && _a !== void 0 ? _a : "Multiselect" })), jsxRuntime.jsx(reactDropdowns.Multiselect, { placeholder: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.placeholder) !== null && _b !== void 0 ? _b : "Select Items", renderShowMore: i18n === null || i18n === void 0 ? void 0 : i18n.showMore, isCompact: size !== "medium", maxItems: maxItems, renderItem: ({ value }) => (jsxRuntime.jsxs(reactTags.Tag, Object.assign({ isPill: true }, { children: [jsxRuntime.jsx("span", { children: value.label }), jsxRuntime.jsx(reactTags.Tag.Close, { onClick: () => onChange &&
6051
+ onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(Label$1, Object.assign({ hidden: true }, { children: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.label) !== null && _a !== void 0 ? _a : "Multiselect" })), jsxRuntime.jsx(reactDropdowns.Multiselect, { placeholder: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.placeholder) !== null && _b !== void 0 ? _b : "Select Items", renderShowMore: i18n === null || i18n === void 0 ? void 0 : i18n.showMore, isCompact: size !== "medium", maxItems: maxItems, renderItem: ({ value }) => (jsxRuntime.jsxs(reactTags.Tag, Object.assign({ isPill: true }, { children: [jsxRuntime.jsx("span", { children: value.label }), jsxRuntime.jsx(reactTags.Tag.Close, { onClick: () => onChange &&
5752
6052
  onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: o.selected && o.id !== value.id })))) })] }))) })] }), jsxRuntime.jsxs(Menu, { children: [jsxRuntime.jsxs("div", Object.assign({ style: { maxHeight: menuHeight !== null && menuHeight !== void 0 ? menuHeight : "200px" } }, { children: [matchingOptions.map((option) => {
5753
6053
  const items = options
5754
6054
  .filter((o) => o.selected)
@@ -5809,18 +6109,18 @@ ModalFullScreen.Footer = StyledFooter$1;
5809
6109
  ModalFullScreen.Close = StyledModalClose;
5810
6110
  ModalFullScreen.FooterItem = FooterItem;
5811
6111
 
5812
- const UgBody = styled__default["default"](reactChrome.Body) `
5813
- background-color: ${({ theme }) => theme.palette.white};
5814
- `;
5815
- /**
5816
- * A Body defines the main content of an HTML document which displays on the browser
5817
- */
5818
- const Body$1 = (props) => jsxRuntime.jsx(UgBody, Object.assign({}, props));
5819
-
5820
- /**
5821
- * A Content defines the main content of an HTML document which displays on the browser
5822
- */
5823
- const Content = (props) => jsxRuntime.jsx(reactChrome.Content, Object.assign({}, props));
6112
+ var _path$a;
6113
+ function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
6114
+ const SvgChevronDownStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
6115
+ xmlns: "http://www.w3.org/2000/svg",
6116
+ width: 16,
6117
+ height: 16,
6118
+ focusable: "false",
6119
+ viewBox: "0 0 16 16"
6120
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
6121
+ fill: "currentColor",
6122
+ d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
6123
+ })));
5824
6124
 
5825
6125
  const UgHeaderItem = styled__default["default"](reactChrome.HeaderItem) `
5826
6126
  ${(props) => props.hasLogo && `border-right: none`};
@@ -5839,7 +6139,7 @@ const HeaderItemText = (props) => jsxRuntime.jsx(UgHeaderItemText, Object.assign
5839
6139
  const HeaderItemIcon = (props) => (jsxRuntime.jsx(reactChrome.HeaderItemIcon, Object.assign({}, props)));
5840
6140
 
5841
6141
  var _path$9;
5842
- function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
6142
+ function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
5843
6143
  const SvgMenuStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
5844
6144
  xmlns: "http://www.w3.org/2000/svg",
5845
6145
  width: 16,
@@ -5928,19 +6228,6 @@ Header.HeaderItem = HeaderItem;
5928
6228
  Header.HeaderItemText = HeaderItemText;
5929
6229
  Header.HeaderItemIcon = HeaderItemIcon;
5930
6230
 
5931
- var _path$8;
5932
- function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
5933
- const SvgChevronDownStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
5934
- xmlns: "http://www.w3.org/2000/svg",
5935
- width: 16,
5936
- height: 16,
5937
- focusable: "false",
5938
- viewBox: "0 0 16 16"
5939
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
5940
- fill: "currentColor",
5941
- d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
5942
- })));
5943
-
5944
6231
  const HeaderSkeleton = () => {
5945
6232
  return (jsxRuntime.jsxs(Header, Object.assign({ isStandalone: true }, { children: [jsxRuntime.jsx(LogoIconContainer, Object.assign({ hasLogo: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(Logo, { type: "icon", size: 150 }) }) })), jsxRuntime.jsx(HeaderItem, Object.assign({ style: { marginRight: "auto", marginLeft: "-4px" } }, { children: window.matchMedia(`only screen and (min-width: 576px)`).matches ? (jsxRuntime.jsx(Skeleton, { width: "200px", height: theme.space.sm })) : (jsxRuntime.jsx(Skeleton, { width: "80px", height: theme.space.sm, style: { marginLeft: theme.space.sm } })) })), jsxRuntime.jsx(HeaderItem, Object.assign({ isRound: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Skeleton, { width: "32px", height: "32px", style: { borderRadius: "100%" } }) }) }) }))] })));
5946
6233
  };
@@ -5959,6 +6246,27 @@ const AppHeader = (_a) => {
5959
6246
  return isLoading ? (jsxRuntime.jsx(HeaderSkeleton, {})) : (jsxRuntime.jsxs(Header, Object.assign({}, args, { style: Object.assign(Object.assign({}, style), { zIndex: (style === null || style === void 0 ? void 0 : style.zIndex) || theme.levels.front }) }, { children: [jsxRuntime.jsx(BrandItem, Object.assign({}, brand, { toggleMenu: args.onSidebarMenuToggle })), args.hasChangelog && args.changelogItem && (jsxRuntime.jsx(HeaderItem, Object.assign({ style: { marginRight: "-" + theme.space.xs } }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: args.changelogItem }) }))), jsxRuntime.jsx(HeaderItem, Object.assign({ isRound: true, onClick: args.onProfileModalToggle }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Avatar, Object.assign({}, avatar)), jsxRuntime.jsx(ChevronButton, Object.assign({ size: "small", isRotated: args.isProfileModalOpen }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] }) }) }))] })));
5960
6247
  };
5961
6248
 
6249
+ const UgBody = styled__default["default"](reactChrome.Body) `
6250
+ background-color: ${({ theme }) => theme.palette.white};
6251
+ `;
6252
+ /**
6253
+ * A Body defines the main content of an HTML document which displays on the browser
6254
+ */
6255
+ const Body$1 = (props) => jsxRuntime.jsx(UgBody, Object.assign({}, props));
6256
+
6257
+ /**
6258
+ * The Chrome component provides a high-level layout structure and sets a framework for navigating around Zendesk products.
6259
+ * <br>
6260
+ * Used for this:
6261
+ - To give a consistent dashboard and navigation experience
6262
+ */
6263
+ const Chrome = (props) => jsxRuntime.jsx(reactChrome.Chrome, Object.assign({}, props));
6264
+
6265
+ /**
6266
+ * A Content defines the main content of an HTML document which displays on the browser
6267
+ */
6268
+ const Content$1 = (props) => jsxRuntime.jsx(reactChrome.Content, Object.assign({}, props));
6269
+
5962
6270
  const UgMain = styled__default["default"](reactChrome.Main) `
5963
6271
  @media (min-width: ${({ theme }) => theme.breakpoints.sm}) {
5964
6272
  margin: ${({ theme }) => theme.space.xxl}
@@ -6082,7 +6390,7 @@ NavItemProject.SubTitle = UgProjectSubtitle;
6082
6390
 
6083
6391
  const NavAccordionItem = styled__default["default"](Accordion) `
6084
6392
  ${sidebarNavItemExpanded}
6085
- ${props => !props.isExpanded && sidebarNavItemHidden}
6393
+ ${(props) => !props.isExpanded && sidebarNavItemHidden}
6086
6394
  order: 1;
6087
6395
  margin: ${({ theme }) => theme.space.xs} 0;
6088
6396
  padding-left: 8.5px;
@@ -6090,18 +6398,24 @@ const NavAccordionItem = styled__default["default"](Accordion) `
6090
6398
  const AccordionItemHeader = styled__default["default"](Accordion.Header) `
6091
6399
  > svg {
6092
6400
  flex-shrink: 0;
6093
-
6401
+
6094
6402
  &:first-of-type {
6095
6403
  margin: 0 8.5px;
6096
6404
  }
6097
6405
  }
6098
6406
  `;
6099
- const AccordionItemPanel = styled__default["default"](Accordion.Panel) `
6100
- max-height: 180px;
6101
- overflow-y: auto;
6407
+ const CustomPanel = (_a) => {
6408
+ var { children } = _a, props = __rest(_a, ["children"]);
6409
+ return (jsxRuntime.jsx(Accordion.Panel, Object.assign({}, props, { children: jsxRuntime.jsx("div", Object.assign({ className: "panelContainer" }, { children: children })) })));
6410
+ };
6411
+ const AccordionItemPanel = styled__default["default"](CustomPanel) `
6412
+ .panelContainer {
6413
+ height: 100%;
6414
+ overflow-y: auto;
6415
+ }
6102
6416
  `;
6103
6417
  const AccordionItemLabel = styled__default["default"](Accordion.Label) `
6104
- ${props => reactTheming.retrieveComponentStyles("text.primary", props)}
6418
+ ${(props) => reactTheming.retrieveComponentStyles("text.primary", props)}
6105
6419
  font-weight: ${({ theme }) => theme.fontWeights.regular};
6106
6420
  padding: 0;
6107
6421
  margin: 0 8.5px;
@@ -6110,14 +6424,6 @@ NavAccordionItem.Panel = AccordionItemPanel;
6110
6424
  NavAccordionItem.Header = AccordionItemHeader;
6111
6425
  NavAccordionItem.Label = AccordionItemLabel;
6112
6426
 
6113
- /**
6114
- * The Chrome component provides a high-level layout structure and sets a framework for navigating around Zendesk products.
6115
- * <br>
6116
- * Used for this:
6117
- - To give a consistent dashboard and navigation experience
6118
- */
6119
- const Chrome = (props) => jsxRuntime.jsx(reactChrome.Chrome, Object.assign({}, props));
6120
-
6121
6427
  const UgPagination = styled__default["default"](reactPagination.Pagination) ``;
6122
6428
  /**
6123
6429
  * Pagination separates content into pages and allows users to navigate between those pages.
@@ -6243,15 +6549,15 @@ PageHeader.Description = MainDescription;
6243
6549
  PageHeader.Meta = MainMeta;
6244
6550
  PageHeader.Footer = StyledFooter;
6245
6551
 
6246
- var _path$7, _path2;
6247
- function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
6248
- const SvgExit = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
6552
+ var _path$8, _path2;
6553
+ function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
6554
+ const SvgExit = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
6249
6555
  xmlns: "http://www.w3.org/2000/svg",
6250
6556
  width: 16,
6251
6557
  height: 16,
6252
6558
  focusable: "false",
6253
6559
  viewBox: "0 0 16 16"
6254
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
6560
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
6255
6561
  fill: "currentColor",
6256
6562
  d: "M3 15.93c-.23 0-.45-.08-.64-.23l-2-1.67a.987.987 0 01-.36-.76V2.73c0-.3.13-.58.36-.77l2-1.67c.3-.24.71-.29 1.06-.13a1 1 0 01.58.91v13.87a1 1 0 01-.58.91c-.13.05-.28.08-.42.08zM12 11V5c0-.45.54-.67.85-.35L15.5 7.3c.39.39.39 1.02 0 1.41l-2.65 2.65A.5.5 0 0112 11z"
6257
6563
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -6261,24 +6567,24 @@ const SvgExit = props => /*#__PURE__*/React__namespace.createElement("svg", _ext
6261
6567
  d: "M3.5 2.5H9c.28 0 .5.22.5.5v2.5m-6 8H9c.28 0 .5-.22.5-.5v-2.5M15 8H7"
6262
6568
  })));
6263
6569
 
6264
- var _path$6;
6265
- function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
6266
- const SvgThumbsUp = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
6570
+ var _path$7;
6571
+ function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
6572
+ const SvgThumbsUp = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
6267
6573
  width: 16,
6268
6574
  height: 16,
6269
6575
  viewBox: "0 0 16 16",
6270
6576
  fill: "none",
6271
6577
  xmlns: "http://www.w3.org/2000/svg"
6272
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
6578
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
6273
6579
  fillRule: "evenodd",
6274
6580
  clipRule: "evenodd",
6275
6581
  d: "M13.5 15C14.2828 15 14.8192 11.8284 15 7.5C15 7.22386 14.7761 7 14.5 7H9.5C9.22386 7 9 6.77614 9 6.5V2C9 1.44772 8.55229 1 8 1C7.44772 1 7 1.44772 7 2C7 4.97341 6.19918 6.46065 5.02719 6.8454C5.01015 6.85409 4.99957 6.87174 5 6.9L4.99891 15C4.99927 15 13.5 15 13.5 15ZM10 6H14.5C15.3284 6 16 6.67157 15.9996 7.52082C15.7692 13.0486 15.2701 16 13.5 16L5.03301 15.9989C4.75408 16.0174 4.48075 15.9146 4.28308 15.7169C4.08542 15.5193 3.98264 15.2459 4 15L4.00008 6.90914C3.99274 6.50762 4.21507 6.13707 4.64189 5.92566C5.41645 5.66747 6 4.58373 6 2C6 0.89543 6.89543 0 8 0C9.10457 0 10 0.89543 10 2V6ZM1 7V15H2V7H1ZM1 6H2C2.55228 6 3 6.44772 3 7V15C3 15.5523 2.55228 16 2 16H1C0.447715 16 0 15.5523 0 15V7C0 6.44772 0.447715 6 1 6Z",
6276
6582
  fill: "#68737D"
6277
6583
  })));
6278
6584
 
6279
- var _rect, _path$5;
6280
- function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
6281
- const SvgLockLockedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
6585
+ var _rect, _path$6;
6586
+ function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
6587
+ const SvgLockLockedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
6282
6588
  xmlns: "http://www.w3.org/2000/svg",
6283
6589
  width: 16,
6284
6590
  height: 16,
@@ -6292,7 +6598,7 @@ const SvgLockLockedFill = props => /*#__PURE__*/React__namespace.createElement("
6292
6598
  fill: "currentColor",
6293
6599
  rx: 1,
6294
6600
  ry: 1
6295
- })), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
6601
+ })), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
6296
6602
  fill: "none",
6297
6603
  stroke: "currentColor",
6298
6604
  d: "M4.5 7.5V4a3.5 3.5 0 017 0v3.5"
@@ -6403,44 +6709,44 @@ const MenuItem = (_a) => {
6403
6709
  return isActive && content ? (jsxRuntime.jsx(StyledBody$4, { children: content }, props.value)) : (jsxRuntime.jsxs(StyledItem, Object.assign({}, props, { onClick: () => props.setActive(props.value) }, { children: [props.icon && jsxRuntime.jsx(IconContainer, { children: props.icon }), children, content && jsxRuntime.jsx(MenuItemIcon, {})] }), props.value));
6404
6710
  };
6405
6711
 
6406
- var _path$4;
6407
- function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
6408
- const SvgQuestionMark = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
6712
+ var _path$5;
6713
+ function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
6714
+ const SvgQuestionMark = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
6409
6715
  width: 16,
6410
6716
  height: 16,
6411
6717
  viewBox: "0 0 16 16",
6412
6718
  fill: "currentColor",
6413
6719
  xmlns: "http://www.w3.org/2000/svg"
6414
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
6720
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
6415
6721
  fillRule: "evenodd",
6416
6722
  clipRule: "evenodd",
6417
6723
  d: "M7.99997 11.5C8.55226 11.5 8.99997 11.0523 8.99997 10.5V9.4C8.99997 8.83787 9.33361 8.32072 9.92997 7.948C11.3791 7.15957 12.2479 5.53522 11.9883 3.84794C11.7161 2.21413 10.3858 0.883851 8.76437 0.613605C6.74482 0.234732 4.81137 1.36258 4.24419 3.20591C4.08177 3.73378 4.37802 4.29336 4.90589 4.45578C5.43375 4.6182 5.99333 4.32195 6.15575 3.79409C6.41982 2.93586 7.36323 2.38554 8.41568 2.58287C9.2141 2.71615 9.88382 3.38587 10.0136 4.1644C10.139 4.98036 9.70294 5.79565 8.92112 6.2221C7.72579 6.96712 6.99997 8.09213 6.99997 9.4V10.5C6.99997 11.0523 7.44769 11.5 7.99997 11.5ZM7.99997 15.5C8.8284 15.5 9.49997 14.8284 9.49997 14C9.49997 13.1716 8.8284 12.5 7.99997 12.5C7.17155 12.5 6.49997 13.1716 6.49997 14C6.49997 14.8284 7.17155 15.5 7.99997 15.5Z"
6418
6724
  })));
6419
6725
 
6420
- var _path$3;
6421
- function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
6422
- const SvgCopy = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
6726
+ var _path$4;
6727
+ function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
6728
+ const SvgCopy = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
6423
6729
  width: 12,
6424
6730
  height: 16,
6425
6731
  viewBox: "0 0 12 16",
6426
6732
  fill: "none",
6427
6733
  xmlns: "http://www.w3.org/2000/svg"
6428
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
6734
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
6429
6735
  fillRule: "evenodd",
6430
6736
  clipRule: "evenodd",
6431
6737
  d: "M2.625 10C2.83211 10 3 10.2239 3 10.5C3 10.7761 2.83211 11 2.625 11H0.75C0.335786 11 0 10.5523 0 10V1C0 0.447715 0.335786 0 0.75 0H7.5C7.91421 0 8.25 0.447715 8.25 1V3.5C8.25 3.77614 8.08211 4 7.875 4C7.66789 4 7.5 3.77614 7.5 3.5V1H0.75V10H2.625ZM4.5 6V15H11.25V6H4.5ZM4.5 5H11.25C11.6642 5 12 5.44772 12 6V15C12 15.5523 11.6642 16 11.25 16H4.5C4.08579 16 3.75 15.5523 3.75 15V6C3.75 5.44772 4.08579 5 4.5 5Z",
6432
6738
  fill: "#003A57"
6433
6739
  })));
6434
6740
 
6435
- var _path$2;
6436
- function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
6437
- const SvgInfoFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
6741
+ var _path$3;
6742
+ function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
6743
+ const SvgInfoFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
6438
6744
  width: 16,
6439
6745
  height: 16,
6440
6746
  viewBox: "0 0 16 16",
6441
6747
  fill: "currentColor",
6442
6748
  xmlns: "http://www.w3.org/2000/svg"
6443
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
6749
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
6444
6750
  fillRule: "evenodd",
6445
6751
  clipRule: "evenodd",
6446
6752
  d: "M7.5 16C3.36 16 0 12.64 0 8.5C0 4.36 3.36 1 7.5 1C11.64 1 15 4.36 15 8.5C15 12.64 11.64 16 7.5 16ZM7 12.5C7 12.78 7.22 13 7.5 13C7.78 13 8 12.78 8 12.5V8C8 7.72 7.78 7.5 7.5 7.5C7.22 7.5 7 7.72 7 8V12.5ZM7.5 4C6.95 4 6.5 4.45 6.5 5C6.5 5.55 6.95 6 7.5 6C8.05 6 8.5 5.55 8.5 5C8.5 4.45 8.05 4 7.5 4Z"
@@ -6465,7 +6771,7 @@ const UgParagraph = styled__default["default"](reactTypography.Paragraph) `
6465
6771
  /**
6466
6772
  * Use Paragraph to render blocks of text with Garden styling.
6467
6773
  */
6468
- const Paragraph = (props) => jsxRuntime.jsx(UgParagraph, Object.assign({}, props));
6774
+ const Paragraph$1 = (props) => jsxRuntime.jsx(UgParagraph, Object.assign({}, props));
6469
6775
 
6470
6776
  const getInitials = (name) => {
6471
6777
  const names = name.split(" ");
@@ -6493,7 +6799,7 @@ const StyledBody$3 = styled__default["default"].div `
6493
6799
  margin: ${({ theme }) => theme.space.base * 6}px
6494
6800
  ${({ theme }) => theme.space.base * 4}px;
6495
6801
  `;
6496
- const StyledParagraph = styled__default["default"](Paragraph) `
6802
+ const StyledParagraph = styled__default["default"](Paragraph$1) `
6497
6803
  margin-top: ${({ theme }) => theme.space.base * 4}px;
6498
6804
  `;
6499
6805
  const Footer = styled__default["default"].div `
@@ -6521,16 +6827,16 @@ const HelpItem = (props) => {
6521
6827
  if (email.length > 24) {
6522
6828
  csmEmailCut = `${email.substring(0, 21)}...`;
6523
6829
  }
6524
- const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$3, { children: [jsxRuntime.jsx(Paragraph, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: jsxRuntime.jsx(SM, { children: props.contactLabel }) })), jsxRuntime.jsx(StyledParagraph, { children: jsxRuntime.jsx(Avatar, { children: (_a = props.csm.picture) !== null && _a !== void 0 ? _a : getInitials(props.csm.name), avatarType: props.csm.picture ? "image" : "text", size: "large" }) }), jsxRuntime.jsxs(StyledParagraph, { children: [jsxRuntime.jsx(MD, Object.assign({ isBold: true }, { children: props.csm.name })), jsxRuntime.jsxs(Description, { children: [jsxRuntime.jsx(Anchor, Object.assign({ href: `mailto:${props.csm.email}`, style: { color: theme.palette.grey[600] } }, { children: csmEmailCut })), jsxRuntime.jsxs(StyledButton, Object.assign({ isBasic: true, onClick: () => {
6830
+ const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$3, { children: [jsxRuntime.jsx(Paragraph$1, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: jsxRuntime.jsx(SM, { children: props.contactLabel }) })), jsxRuntime.jsx(StyledParagraph, { children: jsxRuntime.jsx(Avatar, { children: (_a = props.csm.picture) !== null && _a !== void 0 ? _a : getInitials(props.csm.name), avatarType: props.csm.picture ? "image" : "text", size: "large" }) }), jsxRuntime.jsxs(StyledParagraph, { children: [jsxRuntime.jsx(MD, Object.assign({ isBold: true }, { children: props.csm.name })), jsxRuntime.jsxs(Description, { children: [jsxRuntime.jsx(Anchor, Object.assign({ href: `mailto:${props.csm.email}`, style: { color: theme.palette.grey[600] } }, { children: csmEmailCut })), jsxRuntime.jsxs(StyledButton, Object.assign({ isBasic: true, onClick: () => {
6525
6831
  var _a;
6526
6832
  copyToClipBoard();
6527
6833
  (_a = props.onCopyEmail) === null || _a === void 0 ? void 0 : _a.call(props);
6528
- }, size: "small" }, { children: [jsxRuntime.jsx(StyledButton.StartIcon, { children: jsxRuntime.jsx(SvgCopy, {}) }), (_b = props.copyLabel) !== null && _b !== void 0 ? _b : "Copy"] }))] })] })] }), props.chatSupport && (jsxRuntime.jsxs(Footer, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledFooterButton, Object.assign({ isStretched: true, isBasic: true, onClick: props.toggleChat, style: { paddingLeft: theme.space.xxs } }, { children: [jsxRuntime.jsx(StyledFooterButton.StartIcon, { children: jsxRuntime.jsx(SvgInfoFill, { color: theme.palette.blue[600] }) }), (_c = props.chatSupportLabel) !== null && _c !== void 0 ? _c : "Report a technical issue"] }))] }))] }));
6834
+ }, size: "small" }, { children: [jsxRuntime.jsx(StyledButton.StartIcon, { children: jsxRuntime.jsx(SvgCopy, {}) }), (_b = props.copyLabel) !== null && _b !== void 0 ? _b : "Copy"] }))] })] })] }), props.chatSupport && (jsxRuntime.jsxs(Footer, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledFooterButton, Object.assign({ isStretched: true, isBasic: true, onClick: props.toggleChat, style: { paddingLeft: theme.space.xxs } }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgInfoFill, { color: theme.palette.blue[600] }) }), (_c = props.chatSupportLabel) !== null && _c !== void 0 ? _c : "Report a technical issue"] }))] }))] }));
6529
6835
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgQuestionMark, { color: theme.palette.blue[600] }) }, { children: props.title })) }));
6530
6836
  };
6531
6837
 
6532
- function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
6533
- const SvgEmpty = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
6838
+ function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
6839
+ const SvgEmpty = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
6534
6840
  width: 16,
6535
6841
  height: 16,
6536
6842
  viewBox: "0 0 16 16",
@@ -6538,15 +6844,15 @@ const SvgEmpty = props => /*#__PURE__*/React__namespace.createElement("svg", _ex
6538
6844
  xmlns: "http://www.w3.org/2000/svg"
6539
6845
  }, props));
6540
6846
 
6541
- var _path$1;
6542
- function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
6543
- const SvgTranslationExists = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
6847
+ var _path$2;
6848
+ function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
6849
+ const SvgTranslationExists = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
6544
6850
  width: 16,
6545
6851
  height: 16,
6546
6852
  viewBox: "0 0 16 16",
6547
6853
  fill: "#68737D",
6548
6854
  xmlns: "http://www.w3.org/2000/svg"
6549
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
6855
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
6550
6856
  fillRule: "evenodd",
6551
6857
  clipRule: "evenodd",
6552
6858
  d: "M6 8.31C6.0087 8.47711 5.93254 8.63735 5.79747 8.73613C5.6624 8.83491 5.48662 8.85893 5.33 8.8C5 8.68 4.71 8.5 4.45 8.31C3.9 8.73 3.26 9 2.5 9C2.22 9 2 8.78 2 8.5C2 8.22 2.22 8 2.5 8C2.94 8 3.34 7.86 3.69 7.63C2.9 6.73 2.55 5.72 2.53 5.66C2.44 5.4 2.58 5.11 2.84 5.03C3.1 4.94 3.39 5.08 3.47 5.34C3.47 5.35 3.78 6.21 4.43 6.95C5.19 6.04 5.64 4.75 5.86 4H2.5C2.22 4 2 3.78 2 3.5C2 3.22 2.22 3 2.5 3H4V2.5C4 2.22 4.22 2 4.5 2C4.78 2 5 2.22 5 2.5V3H6.5C6.65 3 6.79 3.07 6.89 3.18C6.98 3.3 7.02 3.45 6.99 3.6C6.98 3.65 6.91 3.98 6.77 4.43C7.11 4.17 7.53 4 8 4H9V1C9 0.45 8.55 0 8 0H1C0.45 0 0 0.45 0 1V10C0 10.55 0.45 11 1 11H6V8.31ZM5.67 7.86C5.86 7.93 5.99 8.1 6 8.29V6.35C5.77 6.79 5.5 7.22 5.18 7.61C5.33 7.71 5.49 7.79 5.67 7.86ZM15 5H8C7.45 5 7 5.45 7 6V15C7 15.55 7.45 16 8 16H15C15.55 16 16 15.55 16 15V6C16 5.45 15.55 5 15 5ZM13.7 12.96C13.4459 13.0656 13.1538 12.9505 13.04 12.7L12.73 12H10.27L9.96 12.7C9.85 12.95 9.55 13.07 9.3 12.95C9.05 12.83 8.93 12.54 9.05 12.29L11.05 7.79C11.21 7.43 11.8 7.43 11.96 7.79L13.96 12.29C14.07 12.55 13.96 12.84 13.7 12.96ZM10.71 11H12.29L11.5 9.23L10.71 11Z"
@@ -6558,14 +6864,14 @@ const StyledBody$2 = styled__default["default"].div `
6558
6864
  `;
6559
6865
  const StyledButtonContainer = styled__default["default"].div `
6560
6866
  ${flexStart}
6561
- & button {
6867
+ & button {
6562
6868
  justify-content: flex-start;
6563
6869
  }
6564
6870
  `;
6565
6871
  const LanguageItem = (props) => {
6566
6872
  var _a;
6567
6873
  const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsx(StyledBody$2, { children: jsxRuntime.jsx(StyledButtonContainer, { children: Object.keys(props.languages).map((key) => (jsxRuntime.jsxs(Button, Object.assign({ isBasic: true, isStretched: true, value: key, onClick: () => props.onSelectLanguage(key) }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: props.currentLanguage === key ? jsxRuntime.jsx(SvgCheckLg, {}) : jsxRuntime.jsx(SvgEmpty, {}) }), jsxRuntime.jsx(Span, Object.assign({ isBold: props.currentLanguage === key }, { children: props.languages[key].label }))] })))) }) })] }));
6568
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgTranslationExists, { fill: theme.palette.blue[600] }) }, { children: jsxRuntime.jsxs(MenuItemBody, { children: [props.title, jsxRuntime.jsxs(MD, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [(_a = props.currentLanguageLabel) !== null && _a !== void 0 ? _a : "Now:", " " + props.languages[props.currentLanguage].label] }))] }) })) }));
6874
+ return props.disabled ? null : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgTranslationExists, { fill: theme.palette.blue[600] }) }, { children: jsxRuntime.jsxs(MenuItemBody, { children: [props.title, jsxRuntime.jsxs(MD, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [(_a = props.currentLanguageLabel) !== null && _a !== void 0 ? _a : "Now:", " " + props.languages[props.currentLanguage].label] }))] }) })) }));
6569
6875
  };
6570
6876
 
6571
6877
  const ProfileContainer = styled__default["default"].div `
@@ -6589,15 +6895,15 @@ const UserContainer = (props) => {
6589
6895
  return (jsxRuntime.jsxs(ProfileContainer, { children: [props.company && jsxRuntime.jsx(CompanyHolder, Object.assign({ isBold: true }, { children: props.company })), jsxRuntime.jsx(Avatar, { children: (_a = props.picture) !== null && _a !== void 0 ? _a : getInitials(props.name), avatarType: props.picture ? "image" : "text", size: "large" }), jsxRuntime.jsxs(UserDetails, { children: [jsxRuntime.jsx(MD, Object.assign({ isBold: true, style: { color: theme.palette.blue[600] } }, { children: props.name })), jsxRuntime.jsx(SM, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: props.email }))] })] }));
6590
6896
  };
6591
6897
 
6592
- var _path;
6593
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6594
- const SvgGearFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends({
6898
+ var _path$1;
6899
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
6900
+ const SvgGearFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
6595
6901
  width: 16,
6596
6902
  height: 16,
6597
6903
  viewBox: "0 0 16 16",
6598
6904
  fill: "none",
6599
6905
  xmlns: "http://www.w3.org/2000/svg"
6600
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
6906
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
6601
6907
  fillRule: "evenodd",
6602
6908
  clipRule: "evenodd",
6603
6909
  d: "M14 8C14 7.58667 13.96 7.17333 13.88 6.77333L15.2933 5.73333C15.48 5.6 15.5466 5.36 15.4666 5.14667C15.16 4.34667 14.7333 3.61333 14.2 2.96C14.057 2.78808 13.8165 2.73342 13.6133 2.82667L12 3.53333C11.3866 2.98667 10.6666 2.56 9.87996 2.30667L9.67996 0.546667C9.66789 0.32368 9.50079 0.139869 9.27996 0.106667C8.85329 0.04 8.43996 0 7.99996 0C7.57329 0 7.14662 0.04 6.73329 0.0933333C6.51996 0.133333 6.35996 0.32 6.33329 0.546667L6.13329 2.29333C5.33329 2.56 4.61329 2.98667 4.01329 3.53333L2.39996 2.81333C2.1969 2.71861 1.95546 2.77348 1.81329 2.94667C1.26662 3.6 0.839956 4.34667 0.533289 5.13333C0.453289 5.34667 0.533289 5.58667 0.706623 5.72L2.13329 6.76C2.03996 7.16 1.99996 7.57333 1.99996 8C1.99996 8.41333 2.03996 8.82667 2.11996 9.22667L0.706623 10.2667C0.519956 10.4 0.453289 10.64 0.533289 10.8533C0.839956 11.6533 1.26662 12.3867 1.79996 13.04C1.94662 13.2133 2.18662 13.2667 2.38662 13.1733L3.99996 12.4667C4.61329 13.0133 5.33329 13.44 6.11996 13.6933L6.30662 15.4533C6.33329 15.68 6.49329 15.8533 6.71996 15.8933C7.14662 15.96 7.55996 16 7.99996 16C8.42662 16 8.85329 15.96 9.26662 15.9067C9.47996 15.8667 9.65329 15.6933 9.67996 15.4667L9.87996 13.7067C10.68 13.44 11.4 13.0267 12 12.48L13.6133 13.1867C13.8133 13.28 14.0666 13.2267 14.2 13.0533C14.7333 12.4 15.16 11.6667 15.4666 10.8667C15.5421 10.6542 15.4721 10.4173 15.2933 10.28L13.8666 9.24C13.96 8.84 14 8.42667 14 8ZM7.99996 10C6.89329 10 5.99996 9.10667 5.99996 8C5.99996 6.89333 6.89329 6 7.99996 6C9.10662 6 9.99996 6.89333 9.99996 8C9.99996 9.10667 9.10662 10 7.99996 10Z",
@@ -6622,12 +6928,12 @@ const SettingsOutroText = styled__default["default"](reactNotifications.Paragrap
6622
6928
  `;
6623
6929
  const SettingsItem = (props) => {
6624
6930
  var _a, _b, _c, _d, _e, _f, _g, _h;
6625
- const [value, setValue] = React.useState(props.settingValue || 0);
6931
+ const [value, setValue] = React.useState(props.settingValue || "0");
6626
6932
  const onToggleSettings = (value) => {
6627
6933
  setValue(value);
6628
6934
  props.onSetSettings && props.onSetSettings(value);
6629
6935
  };
6630
- const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === 1, onChange: () => onToggleSettings(value === 1 ? 0 : 1) }, { children: jsxRuntime.jsx(Label, { children: value === 1
6936
+ const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === "1", onChange: () => onToggleSettings(value === "1" ? "0" : "1") }, { children: jsxRuntime.jsx(Label$1, { children: value === "1"
6631
6937
  ? (_e = (_d = props.i18n) === null || _d === void 0 ? void 0 : _d.settingsToggle) === null || _e === void 0 ? void 0 : _e.on
6632
6938
  : (_g = (_f = props.i18n) === null || _f === void 0 ? void 0 : _f.settingsToggle) === null || _g === void 0 ? void 0 : _g.off }) }))] }), props.i18n && props.i18n.settingsOutroText && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(SettingsOutroText, { children: [jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_1 }), jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_2 })] }), jsxRuntime.jsx(SettingsOutroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_3 }) })] }))] })] }));
6633
6939
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgGearFill, { color: theme.palette.blue[600] }) }, { children: (_h = props.i18n) === null || _h === void 0 ? void 0 : _h.settingsTitle })) }));
@@ -6640,6 +6946,7 @@ const StyledList = styled__default["default"].ul `
6640
6946
  const UserMenu = (props) => {
6641
6947
  var _a, _b, _c, _d, _e, _f;
6642
6948
  const [item, setActiveItem] = React.useState("");
6949
+ const disableMenuLanguageSettings = props.disableMenuLanguageSettings || false;
6643
6950
  const toggleItem = (item) => {
6644
6951
  setActiveItem(item);
6645
6952
  };
@@ -6650,7 +6957,7 @@ const UserMenu = (props) => {
6650
6957
  settingsIntroText: (_c = props.i18n) === null || _c === void 0 ? void 0 : _c.settingsIntroText,
6651
6958
  settingsOutroText: (_d = props.i18n) === null || _d === void 0 ? void 0 : _d.settingsOutroText,
6652
6959
  settingsToggle: (_e = props.i18n) === null || _e === void 0 ? void 0 : _e.settingsToggle,
6653
- }, onSetSettings: props.onSetSettings }), jsxRuntime.jsx(LanguageItem, { title: props.languageTitle || "Change Language", value: "language-selector", selectedItem: item, setActive: (i) => toggleItem(i), languages: props.languages, currentLanguage: props.currentLanguage, currentLanguageLabel: props.currentLanguageLabel, onSelectLanguage: (lang) => props.onSelectLanguage(lang) }), jsxRuntime.jsx(MenuItem, Object.assign({ selectedItem: item, icon: jsxRuntime.jsx(SvgLockLockedFill, { color: theme.palette.blue[600] }), setActive: () => {
6960
+ }, onSetSettings: props.onSetSettings }), jsxRuntime.jsx(LanguageItem, { disabled: disableMenuLanguageSettings, title: props.languageTitle || "Change Language", value: "language-selector", selectedItem: item, setActive: (i) => toggleItem(i), languages: props.languages, currentLanguage: props.currentLanguage, currentLanguageLabel: props.currentLanguageLabel, onSelectLanguage: (lang) => props.onSelectLanguage(lang) }), jsxRuntime.jsx(MenuItem, Object.assign({ selectedItem: item, icon: jsxRuntime.jsx(SvgLockLockedFill, { color: theme.palette.blue[600] }), setActive: () => {
6654
6961
  if (document.querySelector(".iubenda-cs-preferences-link")) {
6655
6962
  const iubendaBtn = document.querySelector(".iubenda-cs-preferences-link");
6656
6963
  if (iubendaBtn) {
@@ -6841,7 +7148,7 @@ const UgGroupRow = styled__default["default"](reactTables.GroupRow) `
6841
7148
  const GroupRow = (props) => jsxRuntime.jsx(UgGroupRow, Object.assign({}, props));
6842
7149
  const GroupRowComponent = (props) => {
6843
7150
  return (jsxRuntime.jsx(GroupRow, Object.assign({}, (props && props.group.items.length === 0 && { className: "empty" }), (props &&
6844
- props.group.items.length > 0 && { onClick: props.handleToggle }), props, { children: jsxRuntime.jsxs(Cell, Object.assign({ colSpan: props.colSpan, className: props.open ? "open" : "closed" }, { children: [props.group.groupIcon && (jsxRuntime.jsx(StyledUgIcon, { size: 12, type: props.group.groupIcon })), jsxRuntime.jsxs(Label, Object.assign({ isRegular: true, className: "title" }, { children: [props.group.groupName, " ", jsxRuntime.jsxs("b", { children: ["(", props.group.items.length, ")"] })] })), jsxRuntime.jsx(StyledAnimatedToggle, Object.assign({ style: { transform: props.open ? "rotate(180deg)" : "none" } }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] })) })));
7151
+ props.group.items.length > 0 && { onClick: props.handleToggle }), props, { children: jsxRuntime.jsxs(Cell, Object.assign({ colSpan: props.colSpan, className: props.open ? "open" : "closed" }, { children: [props.group.groupIcon && (jsxRuntime.jsx(StyledUgIcon, { size: 12, type: props.group.groupIcon })), jsxRuntime.jsxs(Label$1, Object.assign({ isRegular: true, className: "title" }, { children: [props.group.groupName, " ", jsxRuntime.jsxs("b", { children: ["(", props.group.items.length, ")"] })] })), jsxRuntime.jsx(StyledAnimatedToggle, Object.assign({ style: { transform: props.open ? "rotate(180deg)" : "none" } }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] })) })));
6845
7152
  };
6846
7153
  const AnimatedRow = styled__default["default"](Row) `
6847
7154
  &.render {
@@ -7045,10 +7352,612 @@ OrderedList.Item = UgOrderedList.Item;
7045
7352
  const UnorderedList = (props) => jsxRuntime.jsx(UgUnorderedList, Object.assign({}, props));
7046
7353
  UnorderedList.Item = UgUnorderedList.Item;
7047
7354
 
7355
+ const DefaultActiveWrapper = ({ children }) => {
7356
+ return jsxRuntime.jsx("span", Object.assign({ style: { background: "#ff0000" } }, { children: children }));
7357
+ };
7358
+ const DefaultWordWrapper = ({ children }) => {
7359
+ return jsxRuntime.jsx("span", { children: children });
7360
+ };
7361
+ const DefaultObservationWrapper = ({ title, color, children, observations, }) => {
7362
+ const background = color + "50";
7363
+ return (jsxRuntime.jsx("span", Object.assign({ "data-title": title, style: { background } }, { children: jsxRuntime.jsx(Tooltip, Object.assign({ content: observations.map((o) => o.title).join(" and ") }, { children: jsxRuntime.jsx("span", { children: children }) })) })));
7364
+ };
7365
+ const DefaultParagraphWrapper = ({ children }) => {
7366
+ return jsxRuntime.jsx("p", Object.assign({ style: { marginBottom: "20px" } }, { children: children }));
7367
+ };
7368
+ const formatTime = (seconds) => {
7369
+ const date = new Date(0);
7370
+ date.setSeconds(seconds);
7371
+ if (seconds < 3600)
7372
+ return date.toISOString().substring(14, 19);
7373
+ return date.toISOString().substring(11, 19);
7374
+ };
7375
+ const DefaultSpeakerWrapper = ({ start, end, setCurrentTime, speaker, }) => {
7376
+ return (jsxRuntime.jsxs("p", Object.assign({ style: {
7377
+ marginBottom: "10px",
7378
+ userSelect: "none",
7379
+ }, onClick: () => {
7380
+ setCurrentTime && setCurrentTime({ start, end });
7381
+ }, contentEditable: false }, { children: [speaker, " (", formatTime(start), " - ", formatTime(end), ")"] })));
7382
+ };
7383
+ const DefaultSentencesWrapper = ({ children }) => {
7384
+ return jsxRuntime.jsx("div", Object.assign({ style: { paddingTop: "30px" } }, { children: children }));
7385
+ };
7386
+ const DefaultSentenceWrapper = ({ setCurrentTime, children, start, end, isActive, }) => {
7387
+ return (jsxRuntime.jsx("span", Object.assign({ onClick: () => {
7388
+ setCurrentTime && setCurrentTime({ start, end });
7389
+ }, style: isActive
7390
+ ? {
7391
+ backgroundColor: "yellow",
7392
+ }
7393
+ : {} }, { children: children })));
7394
+ };
7395
+ const DefaultTranslationWrapper = ({ content, translations, }) => {
7396
+ return (jsxRuntime.jsxs("div", Object.assign({ style: { display: "flex" } }, { children: [jsxRuntime.jsx("div", Object.assign({ style: { width: "50%" } }, { children: content })), jsxRuntime.jsx("div", Object.assign({ style: { width: "50%" } }, { children: translations }))] })));
7397
+ };
7398
+ const SearchStyleWrapper = styled.styled.span `
7399
+ .search-result {
7400
+ background-color: rgba(255, 217, 0, 0.5);
7401
+
7402
+ &-current {
7403
+ background-color: rgba(13, 255, 0, 0.5);
7404
+ }
7405
+ }
7406
+ `;
7407
+ const Theme = react.Extension.create({
7408
+ name: "theme",
7409
+ addOptions() {
7410
+ return {
7411
+ activeWrapper: DefaultActiveWrapper,
7412
+ wordWrapper: DefaultWordWrapper,
7413
+ observationWrapper: DefaultObservationWrapper,
7414
+ paragraphWrapper: DefaultParagraphWrapper,
7415
+ speakerWrapper: DefaultSpeakerWrapper,
7416
+ sentencesWrapper: DefaultSentencesWrapper,
7417
+ sentenceWrapper: DefaultSentenceWrapper,
7418
+ translationWrapper: DefaultTranslationWrapper,
7419
+ searchStyleWrapper: SearchStyleWrapper,
7420
+ };
7421
+ },
7422
+ });
7423
+ const getTheme = (editor) => {
7424
+ const themeExtension = editor.extensionManager.extensions.find((ext) => ext.name === "theme");
7425
+ if (!themeExtension) {
7426
+ throw new Error("Theme extension not found");
7427
+ }
7428
+ return themeExtension;
7429
+ };
7430
+
7431
+ const MenuContainer = styled__default["default"].div `
7432
+ box-shadow: ${({ theme }) => theme.shadows.boxShadow(theme)};
7433
+ display: flex;
7434
+ `;
7435
+ const FloatingMenu = (props) => {
7436
+ const { editor, onClick } = props;
7437
+ const shouldShow = (props) => {
7438
+ // At least a word selected?", props.from !== props.to);
7439
+ return props.from !== props.to;
7440
+ };
7441
+ if (!editor) {
7442
+ return null;
7443
+ }
7444
+ return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({ editor: editor, shouldShow: shouldShow }, { children: jsxRuntime.jsx(MenuContainer, Object.assign({ className: "bubble-menu" }, { children: jsxRuntime.jsxs(Button, Object.assign({ isAccent: true, isPrimary: true, onClick: () => {
7445
+ const { from, to } = editor.state.selection;
7446
+ let start = 0;
7447
+ let end = 0;
7448
+ editor.state.doc.nodesBetween(from, to, (node) => {
7449
+ if (node.type.name === "Word") {
7450
+ if (!start)
7451
+ start = node.attrs["data-start"];
7452
+ end = node.attrs["data-end"];
7453
+ }
7454
+ });
7455
+ if (start === end)
7456
+ return;
7457
+ onClick(editor, { start, end });
7458
+ } }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), "Create Observation"] })) })) })));
7459
+ };
7460
+
7461
+ var _circle, _path;
7462
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
7463
+ const SvgSearchStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends({
7464
+ xmlns: "http://www.w3.org/2000/svg",
7465
+ width: 16,
7466
+ height: 16,
7467
+ focusable: "false",
7468
+ viewBox: "0 0 16 16"
7469
+ }, props), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
7470
+ cx: 6,
7471
+ cy: 6,
7472
+ r: 5.5,
7473
+ fill: "none",
7474
+ stroke: "currentColor"
7475
+ })), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
7476
+ stroke: "currentColor",
7477
+ strokeLinecap: "round",
7478
+ d: "M15 15l-5-5"
7479
+ })));
7480
+
7481
+ const Search = ({ editor, placeholder, }) => {
7482
+ const [search, setSearch] = React.useState("");
7483
+ const debouncedValue = useDebounce(search, 300);
7484
+ const setSearchTerm = React.useCallback((term) => {
7485
+ editor.commands.setSearchTerm(term);
7486
+ }, [editor]);
7487
+ React.useEffect(() => {
7488
+ setSearchTerm(debouncedValue);
7489
+ }, [debouncedValue, setSearchTerm]);
7490
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MediaInput, { isCompact: true, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "Search", type: "text", start: jsxRuntime.jsx(SvgSearchStroke, {}), onChange: (e) => {
7491
+ setSearch(e.target.value);
7492
+ } }) }));
7493
+ };
7494
+ const SearchStyle = styled.css `
7495
+ .search-result {
7496
+ background-color: rgba(255, 217, 0, 0.5);
7497
+
7498
+ &-current {
7499
+ background-color: rgba(13, 255, 0, 0.5);
7500
+ }
7501
+ }
7502
+ `;
7503
+ Search.Style = SearchStyle;
7504
+
7505
+ class ContentParser {
7506
+ constructor(observations, sentences) {
7507
+ this.observations = observations;
7508
+ this.sentences = sentences;
7509
+ }
7510
+ wrapWordInObservations(word) {
7511
+ var _a;
7512
+ const observationsInThisWord = (_a = this.observations) === null || _a === void 0 ? void 0 : _a.filter((observation) => observation.start <= word.start && observation.end >= word.end);
7513
+ const textContent = [{ type: "text", text: `${word.word} ` }];
7514
+ if (!observationsInThisWord || observationsInThisWord.length === 0) {
7515
+ return textContent;
7516
+ }
7517
+ return observationsInThisWord.reduce((acc, observation) => [
7518
+ {
7519
+ type: "Observation",
7520
+ attrs: {
7521
+ id: observation.id,
7522
+ title: observation.text,
7523
+ color: observation.color,
7524
+ },
7525
+ content: acc,
7526
+ },
7527
+ ], textContent);
7528
+ }
7529
+ getParsedWord(word) {
7530
+ return {
7531
+ type: "Word",
7532
+ attrs: {
7533
+ "data-start": word.start,
7534
+ "data-end": word.end,
7535
+ },
7536
+ content: this.wrapWordInObservations(word),
7537
+ };
7538
+ }
7539
+ getParsedParagraph(paragraph) {
7540
+ var _a;
7541
+ const s = (_a = this.sentences) === null || _a === void 0 ? void 0 : _a.filter((sentence) => sentence.start >= paragraph.start && sentence.end <= paragraph.end);
7542
+ return {
7543
+ type: "Paragraph",
7544
+ attrs: {
7545
+ speakername: `Speaker ${paragraph.speaker}`,
7546
+ start: paragraph.start,
7547
+ end: paragraph.end,
7548
+ sentences: s,
7549
+ },
7550
+ content: paragraph.words.map((word) => this.getParsedWord(word)),
7551
+ };
7552
+ }
7553
+ getParsedContent(content) {
7554
+ if (!content)
7555
+ return undefined;
7556
+ return {
7557
+ type: "doc",
7558
+ content: content.map((paragraph) => this.getParsedParagraph(paragraph)),
7559
+ };
7560
+ }
7561
+ }
7562
+ function getParsedContent(content, observations, sentences) {
7563
+ return new ContentParser(observations, sentences).getParsedContent(content);
7564
+ }
7565
+
7566
+ const Component$3 = ({ node, editor, }) => {
7567
+ const themeExtension = getTheme(editor);
7568
+ const ActiveWrapper = themeExtension.options.activeWrapper;
7569
+ return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({ as: "div", style: { display: "inline" } }, { children: jsxRuntime.jsx(ActiveWrapper, { children: jsxRuntime.jsx(react.NodeViewContent, { as: "span", className: "content is-editable" }) }) })));
7570
+ };
7571
+
7572
+ const Active = ({ onSetCurrentTime, }) => core.Node.create({
7573
+ name: "Active",
7574
+ content: "inline*",
7575
+ inline: true,
7576
+ parseHTML() {
7577
+ return [
7578
+ {
7579
+ tag: "span",
7580
+ },
7581
+ ];
7582
+ },
7583
+ renderHTML({ node }) {
7584
+ return [
7585
+ "active",
7586
+ {
7587
+ style: "background-color: #ff0000;",
7588
+ },
7589
+ 0,
7590
+ ];
7591
+ },
7592
+ addCommands() {
7593
+ return {
7594
+ setCurrentTime: (start) => () => {
7595
+ if (onSetCurrentTime)
7596
+ onSetCurrentTime(start);
7597
+ return true;
7598
+ },
7599
+ updateCurrentActive: ({ currentWord }) => ({ state, view }) => {
7600
+ const { tr } = state;
7601
+ // trova il nodo "active"
7602
+ state.doc.descendants((node, pos) => {
7603
+ if (node.type.name === "Word") {
7604
+ // check if the node has an "active" descendant
7605
+ let hasActiveDescendant = false;
7606
+ node.descendants((child) => {
7607
+ hasActiveDescendant =
7608
+ hasActiveDescendant || child.type.name === "Active";
7609
+ });
7610
+ if (hasActiveDescendant) {
7611
+ // remove the "active" descendant
7612
+ function removeActiveDescendant(n) {
7613
+ var _a;
7614
+ if (((_a = n.firstChild) === null || _a === void 0 ? void 0 : _a.type.name) === "Active") {
7615
+ const textContent = n.textContent;
7616
+ const textNode = state.schema.text(textContent);
7617
+ return n.copy(model.Fragment.from(textNode));
7618
+ }
7619
+ let updatedContent = model.Fragment.empty;
7620
+ n.content.forEach((child) => {
7621
+ updatedContent = updatedContent.addToEnd(removeActiveDescendant(child));
7622
+ });
7623
+ return n.copy(updatedContent);
7624
+ }
7625
+ tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), removeActiveDescendant(node));
7626
+ }
7627
+ }
7628
+ if (node.type.name === "Word" &&
7629
+ node.attrs["data-start"] === currentWord.start &&
7630
+ node.attrs["data-end"] === currentWord.end) {
7631
+ function getUpdatedNode(n) {
7632
+ var _a;
7633
+ if (((_a = n.firstChild) === null || _a === void 0 ? void 0 : _a.type.name) === "text" &&
7634
+ n.type.name !== "Active") {
7635
+ return n.copy(model.Fragment.from(state.schema.nodes.Active.create({}, n.content.firstChild)));
7636
+ }
7637
+ let updatedContent = model.Fragment.empty;
7638
+ n.content.forEach((child, index) => {
7639
+ updatedContent = updatedContent.addToEnd(getUpdatedNode(child));
7640
+ });
7641
+ return n.copy(updatedContent);
7642
+ }
7643
+ tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), getUpdatedNode(node));
7644
+ }
7645
+ });
7646
+ view.updateState(view.state.apply(view.state.tr));
7647
+ return true;
7648
+ },
7649
+ };
7650
+ },
7651
+ addNodeView() {
7652
+ return react.ReactNodeViewRenderer(Component$3);
7653
+ },
7654
+ });
7655
+
7656
+ function findNodePosition(doc, targetNode) {
7657
+ let foundPos = null;
7658
+ doc.descendants((node, pos) => {
7659
+ if (node === targetNode) {
7660
+ foundPos = pos;
7661
+ return false; // Interrompe la ricerca
7662
+ }
7663
+ return true;
7664
+ });
7665
+ return foundPos;
7666
+ }
7667
+ function findAllAncestorsOfType(state, pos, nodeType) {
7668
+ const ancestors = [];
7669
+ let { doc } = state;
7670
+ let currentPos = pos;
7671
+ while (currentPos > 0) {
7672
+ const resolvedPos = doc.resolve(currentPos);
7673
+ const parent = resolvedPos.node(resolvedPos.depth);
7674
+ if (parent.type === nodeType) {
7675
+ ancestors.push(parent);
7676
+ }
7677
+ if (resolvedPos.depth === 0) {
7678
+ break;
7679
+ }
7680
+ currentPos = resolvedPos.before(); // Move to the previous depth level
7681
+ }
7682
+ return ancestors;
7683
+ }
7684
+ const Component$2 = ({ node, editor, }) => {
7685
+ const themeExtension = getTheme(editor);
7686
+ const ObservationWrapper = themeExtension.options.observationWrapper;
7687
+ const nodePos = findNodePosition(editor.state.doc, node);
7688
+ if (!nodePos)
7689
+ return null;
7690
+ const ancestors = findAllAncestorsOfType(editor.state, nodePos, editor.state.schema.nodes.Observation);
7691
+ const observationsNodes = ancestors.length ? [node, ...ancestors] : [node];
7692
+ return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({ as: "div", style: { display: "inline" } }, { children: jsxRuntime.jsx(ObservationWrapper, Object.assign({ title: node.attrs["title"], color: node.attrs["color"], observations: observationsNodes.map((o) => ({
7693
+ id: o.attrs["id"],
7694
+ title: o.attrs["title"],
7695
+ color: o.attrs["color"],
7696
+ })) }, { children: jsxRuntime.jsx(react.NodeViewContent, { as: "span", className: "content is-editable" }) })) })));
7697
+ };
7698
+
7699
+ const Observation = core.Node.create({
7700
+ name: "Observation",
7701
+ content: "inline*",
7702
+ inline: true,
7703
+ addAttributes() {
7704
+ return {
7705
+ id: {
7706
+ default: 0,
7707
+ },
7708
+ color: {
7709
+ default: "#909090",
7710
+ },
7711
+ title: {
7712
+ default: "",
7713
+ },
7714
+ };
7715
+ },
7716
+ parseHTML() {
7717
+ return [
7718
+ {
7719
+ tag: "observation",
7720
+ },
7721
+ ];
7722
+ },
7723
+ addCommands() {
7724
+ return {
7725
+ addObservation: ({ id, title, color }) => ({ tr, state, view }) => {
7726
+ const { from, to } = state.selection;
7727
+ state.doc.nodesBetween(from, to, (node, pos) => {
7728
+ if (node.type.name === "Word") {
7729
+ const annotationNode = state.schema.nodes.Observation.create({
7730
+ id,
7731
+ title,
7732
+ color,
7733
+ }, node.content);
7734
+ // Crea il nodo "word" aggiornato con "active" come figlio
7735
+ const updatedNode = node.copy(model.Fragment.from(annotationNode));
7736
+ // Sostituisci il nodo originale con quello aggiornato
7737
+ tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), updatedNode);
7738
+ }
7739
+ });
7740
+ view.updateState(view.state.apply(view.state.tr));
7741
+ return true;
7742
+ },
7743
+ };
7744
+ },
7745
+ renderHTML({ HTMLAttributes }) {
7746
+ return ["observation", react.mergeAttributes(HTMLAttributes), 0];
7747
+ },
7748
+ addNodeView() {
7749
+ return react.ReactNodeViewRenderer(Component$2);
7750
+ },
7751
+ });
7752
+
7753
+ const findActiveWord = (node) => {
7754
+ let activeWord = null;
7755
+ node.descendants((child) => {
7756
+ if (activeWord !== null)
7757
+ return false;
7758
+ if (child.type.name === "Word") {
7759
+ child.descendants((grandchild) => {
7760
+ if (activeWord !== null)
7761
+ return false;
7762
+ if (grandchild.type.name === "Active") {
7763
+ activeWord = child;
7764
+ }
7765
+ });
7766
+ }
7767
+ });
7768
+ return activeWord;
7769
+ };
7770
+
7771
+ const Content = ({ node, editor }) => {
7772
+ const themeExtension = getTheme(editor);
7773
+ const ParagraphWrapper = themeExtension.options.paragraphWrapper;
7774
+ const SpeakerWrapper = themeExtension.options.speakerWrapper;
7775
+ return (jsxRuntime.jsxs(ParagraphWrapper, { children: [jsxRuntime.jsx(SpeakerWrapper, { setCurrentTime: ({ start }) => {
7776
+ editor.commands.setCurrentTime(start);
7777
+ }, start: node.attrs.start, end: node.attrs.end, speaker: node.attrs.speakername }), jsxRuntime.jsx(react.NodeViewContent, { className: "content is-editable" })] }));
7778
+ };
7779
+ const Component$1 = ({ node, editor, }) => {
7780
+ if (!node.attrs.sentences || node.attrs.sentences.length === 0) {
7781
+ return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({ as: "div", style: { display: "inline" } }, { children: jsxRuntime.jsx(Content, { node: node, editor: editor }) })));
7782
+ }
7783
+ const themeExtension = getTheme(editor);
7784
+ const SentencesWrapper = themeExtension.options.sentencesWrapper;
7785
+ const SentenceWrapper = themeExtension.options.sentenceWrapper;
7786
+ const TranslationWrapper = themeExtension.options.translationWrapper;
7787
+ const activeWord = findActiveWord(node);
7788
+ return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({ className: "react-component" }, { children: jsxRuntime.jsx(TranslationWrapper, { content: jsxRuntime.jsx(Content, { node: node, editor: editor }), translations: jsxRuntime.jsx(SentencesWrapper, { children: node.attrs.sentences.map((sentence, index) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(SentenceWrapper, Object.assign({ start: sentence.start, end: sentence.end, setCurrentTime: ({ start, end }) => {
7789
+ editor.commands.setCurrentTime(start);
7790
+ }, isActive: activeWord
7791
+ ? activeWord.attrs["data-start"] >= sentence.start &&
7792
+ activeWord.attrs["data-end"] <= sentence.end
7793
+ : false }, { children: [sentence.text, " "] }), index) }))) }) }) })));
7794
+ };
7795
+
7796
+ const Paragraph = core.Node.create({
7797
+ name: "Paragraph",
7798
+ group: "block",
7799
+ atom: false,
7800
+ content: "inline*",
7801
+ addAttributes() {
7802
+ return {
7803
+ speakername: {
7804
+ default: "Speaker",
7805
+ },
7806
+ start: {
7807
+ default: 0,
7808
+ },
7809
+ end: {
7810
+ default: 0,
7811
+ },
7812
+ sentences: {
7813
+ default: [],
7814
+ },
7815
+ };
7816
+ },
7817
+ parseHTML() {
7818
+ return [
7819
+ {
7820
+ tag: "speaker-paragraph",
7821
+ },
7822
+ ];
7823
+ },
7824
+ renderHTML({ HTMLAttributes }) {
7825
+ return ["speaker-paragraph", core.mergeAttributes(HTMLAttributes), 0];
7826
+ },
7827
+ addNodeView() {
7828
+ return react.ReactNodeViewRenderer(Component$1);
7829
+ },
7830
+ });
7831
+
7832
+ const Component = ({ node, editor }) => {
7833
+ const themeExtension = getTheme(editor);
7834
+ const WordWrapper = themeExtension.options.wordWrapper;
7835
+ return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({}, node.attrs, { as: "div", style: { display: "inline" } }, { children: jsxRuntime.jsx(WordWrapper, { children: jsxRuntime.jsx("span", Object.assign({ onClick: () => {
7836
+ editor.commands.setCurrentTime(node.attrs["data-start"]);
7837
+ } }, { children: jsxRuntime.jsx(react.NodeViewContent, { as: "span", className: "content is-editable" }) })) }) })));
7838
+ };
7839
+
7840
+ const Word = core.Node.create({
7841
+ name: "Word",
7842
+ group: "inline",
7843
+ content: "inline*",
7844
+ inline: true,
7845
+ addAttributes() {
7846
+ return {
7847
+ "data-start": {
7848
+ default: null,
7849
+ },
7850
+ "data-end": {
7851
+ default: null,
7852
+ },
7853
+ };
7854
+ },
7855
+ parseHTML() {
7856
+ return [
7857
+ {
7858
+ tag: "span[data-start][data-end]",
7859
+ },
7860
+ ];
7861
+ },
7862
+ renderHTML({ node }) {
7863
+ return [
7864
+ "span",
7865
+ {
7866
+ "data-start": node.attrs["data-start"],
7867
+ "data-end": node.attrs["data-end"],
7868
+ style: "",
7869
+ },
7870
+ 0,
7871
+ ];
7872
+ },
7873
+ addNodeView() {
7874
+ return react.ReactNodeViewRenderer(Component, {
7875
+ as: "span",
7876
+ });
7877
+ },
7878
+ });
7879
+
7880
+ const useEditor = ({ content, observations, translations, currentTime, onSetCurrentTime, themeExtension, isEditable, }, deps) => {
7881
+ const ed = react.useEditor({
7882
+ editable: isEditable ? isEditable : false,
7883
+ extensions: [
7884
+ Document__default["default"],
7885
+ Paragraph,
7886
+ Text__default["default"],
7887
+ themeExtension ? themeExtension : Theme.configure(),
7888
+ Word,
7889
+ SearchAndReplace__default["default"].configure(),
7890
+ Active({
7891
+ onSetCurrentTime,
7892
+ }),
7893
+ Observation,
7894
+ ],
7895
+ editorProps: {
7896
+ handlePaste: () => true,
7897
+ },
7898
+ content: getParsedContent(content, observations, translations),
7899
+ }, deps);
7900
+ React.useEffect(() => {
7901
+ if (!currentTime)
7902
+ return;
7903
+ if (!ed)
7904
+ return;
7905
+ const currentParagraph = content === null || content === void 0 ? void 0 : content.find((paragraph) => paragraph.words.some((word) => word.start * 1000 <= currentTime && word.end * 1000 >= currentTime));
7906
+ if (!currentParagraph)
7907
+ return;
7908
+ const currentWord = currentParagraph.words.find((word) => word.start * 1000 <= currentTime && word.end * 1000 > currentTime);
7909
+ if (!currentWord)
7910
+ return;
7911
+ ed.commands.updateCurrentActive({ currentWord });
7912
+ }, [currentTime, content, ed]);
7913
+ return ed;
7914
+ };
7915
+
7916
+ const EditorWrapper = styled__default["default"].div `
7917
+ border: none;
7918
+ .ProseMirror {
7919
+ background: transparent;
7920
+ border: none;
7921
+ outline: none;
7922
+ padding: 0;
7923
+ min-height: 0;
7924
+ }
7925
+ `;
7926
+ const Transcript = ({ editor }) => {
7927
+ const ref = React.useRef(null);
7928
+ const handleDragStart = React.useCallback((event) => {
7929
+ const selection = window.getSelection();
7930
+ if (selection && selection.toString()) {
7931
+ event.preventDefault();
7932
+ }
7933
+ }, []);
7934
+ React.useEffect(() => {
7935
+ const currentRef = ref.current;
7936
+ if (!currentRef)
7937
+ return;
7938
+ currentRef.addEventListener("dragstart", handleDragStart);
7939
+ return () => {
7940
+ currentRef.removeEventListener("dragstart", handleDragStart);
7941
+ };
7942
+ }, [handleDragStart]);
7943
+ if (!editor)
7944
+ return null;
7945
+ const theme = getTheme(editor);
7946
+ const SearchStyleWrapper = theme.options.searchStyleWrapper;
7947
+ return (jsxRuntime.jsx(SearchStyleWrapper, { children: jsxRuntime.jsx(EditorWrapper, { children: jsxRuntime.jsx(react.EditorContent, { ref: ref, editor: editor }) }) }));
7948
+ };
7949
+ Transcript.useEditor = useEditor;
7950
+ Transcript.Search = Search;
7951
+ Transcript.FloatingMenu = FloatingMenu;
7952
+
7048
7953
  Object.defineProperty(exports, 'ModalClose', {
7049
7954
  enumerable: true,
7050
7955
  get: function () { return reactModals.Close; }
7051
7956
  });
7957
+ Object.defineProperty(exports, 'useVideoContext', {
7958
+ enumerable: true,
7959
+ get: function () { return Video.useVideoContext; }
7960
+ });
7052
7961
  exports.Accordion = Accordion;
7053
7962
  exports.Alert = Alert;
7054
7963
  exports.Anchor = Anchor;
@@ -7081,7 +7990,7 @@ exports.Col = Col;
7081
7990
  exports.ColorSwatch = ColorSwatch;
7082
7991
  exports.Comment = Comment;
7083
7992
  exports.ContainerCard = ContainerCard;
7084
- exports.Content = Content;
7993
+ exports.Content = Content$1;
7085
7994
  exports.CounterMultiselect = CounterMultiselect;
7086
7995
  exports.CursorPagination = CursorPagination;
7087
7996
  exports.Dots = Dots;
@@ -7114,7 +8023,7 @@ exports.Item = Item$1;
7114
8023
  exports.ItemContent = ItemContent;
7115
8024
  exports.ItemMeta = ItemMeta;
7116
8025
  exports.LG = LG;
7117
- exports.Label = Label;
8026
+ exports.Label = Label$1;
7118
8027
  exports.Lightbox = Lightbox;
7119
8028
  exports.LoginForm = LoginForm;
7120
8029
  exports.Logo = Logo;
@@ -7143,9 +8052,10 @@ exports.Notification = Notification;
7143
8052
  exports.OrderedList = OrderedList;
7144
8053
  exports.PageHeader = PageHeader;
7145
8054
  exports.Pagination = Pagination;
7146
- exports.Paragraph = Paragraph;
8055
+ exports.Paragraph = Paragraph$1;
7147
8056
  exports.PieChart = PieChart;
7148
8057
  exports.Player = Player;
8058
+ exports.PlayerProvider = PlayerProvider;
7149
8059
  exports.PreviousItem = PreviousItem;
7150
8060
  exports.ProductCard = ProductCard;
7151
8061
  exports.ProfileModal = ProfileModal;
@@ -7181,6 +8091,7 @@ exports.Tag = Tag;
7181
8091
  exports.TextDescription = TextDescription;
7182
8092
  exports.TextLabel = TextLabel;
7183
8093
  exports.Textarea = Textarea;
8094
+ exports.Theme = Theme;
7184
8095
  exports.Tiles = Tiles;
7185
8096
  exports.Timeline = Timeline;
7186
8097
  exports.Title = Title$1;
@@ -7188,6 +8099,7 @@ exports.ToastProvider = ToastProvider;
7188
8099
  exports.Toggle = Toggle;
7189
8100
  exports.Tooltip = Tooltip;
7190
8101
  exports.TooltipModal = TooltipModal;
8102
+ exports.Transcript = Transcript;
7191
8103
  exports.Trigger = Trigger;
7192
8104
  exports.UnorderedList = UnorderedList;
7193
8105
  exports.WaffleChart = WaffleChart;