@appquality/unguess-design-system 3.1.89-beta-attachments → 3.1.89-tooltip

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 (33) hide show
  1. package/CHANGELOG.md +253 -0
  2. package/build/index.d.ts +1 -0
  3. package/build/index.js +720 -369
  4. package/build/stories/buttons/button/index.stories.d.ts +1 -0
  5. package/build/stories/buttons/utils.d.ts +27 -27
  6. package/build/stories/chat/_types.d.ts +2 -1
  7. package/build/stories/chat/context/chatContext.d.ts +10 -6
  8. package/build/stories/chat/index.stories.d.ts +3 -2
  9. package/build/stories/chat/parts/ThumbnailContainer/index.d.ts +2 -1
  10. package/build/stories/dropdowns/select/index.stories.d.ts +1 -0
  11. package/build/stories/editor/index.stories.d.ts +1 -0
  12. package/build/stories/highlight/_types.d.ts +37 -0
  13. package/build/stories/highlight/demo-parts/data.d.ts +49 -0
  14. package/build/stories/highlight/demo-parts/transcript-base.d.ts +5 -0
  15. package/build/stories/highlight/demo-parts/transcript-diarization.d.ts +5 -0
  16. package/build/stories/highlight/demo-parts/transcript-paragraph.d.ts +5 -0
  17. package/build/stories/highlight/highlightContext.d.ts +10 -0
  18. package/build/stories/highlight/index.d.ts +10 -0
  19. package/build/stories/highlight/index.stories.d.ts +17 -0
  20. package/build/stories/highlight/searchable.d.ts +4 -0
  21. package/build/stories/player/_types.d.ts +18 -0
  22. package/build/stories/player/index.stories.d.ts +1 -1
  23. package/build/stories/player/parts/bookmark.d.ts +2 -0
  24. package/build/stories/player/parts/controls.d.ts +7 -2
  25. package/build/stories/player/parts/controlsCenterGroup.d.ts +2 -1
  26. package/build/stories/player/parts/cutterButton.d.ts +6 -0
  27. package/build/stories/player/parts/progress.d.ts +11 -0
  28. package/build/stories/player/parts/progressContext.d.ts +16 -0
  29. package/build/stories/player/parts/timeLabel.d.ts +2 -2
  30. package/build/stories/tooltip/_types.d.ts +1 -0
  31. package/build/stories/tooltip/index.d.ts +1 -0
  32. package/build/stories/tooltip/index.stories.d.ts +1 -0
  33. package/package.json +4 -2
package/build/index.js CHANGED
@@ -25,6 +25,7 @@ var sunburst = require('@nivo/sunburst');
25
25
  var waffle = require('@nivo/waffle');
26
26
  var line = require('@nivo/line');
27
27
  var reactForms = require('@zendeskgarden/react-forms');
28
+ var uuid = require('uuid');
28
29
  var react = require('@tiptap/react');
29
30
  var reactTooltips = require('@zendeskgarden/react-tooltips');
30
31
  var Typography = require('@tiptap/extension-typography');
@@ -333,8 +334,8 @@ const UgContainerCard = styled__default["default"](reactNotifications.Well) `
333
334
  `;
334
335
  const ContainerCard = (props) => jsxRuntime.jsx(UgContainerCard, Object.assign({}, props));
335
336
 
336
- var _a, _b, _c, _d, _e, _f, _g$c, _h;
337
- const components = Object.assign(Object.assign(Object.assign(Object.assign({}, reactTheming.DEFAULT_THEME.components), { chrome: Object.assign(Object.assign({}, (_a = reactTheming.DEFAULT_THEME.components) === null || _a === void 0 ? void 0 : _a.chrome), { header: Object.assign(Object.assign({}, (_c = (_b = reactTheming.DEFAULT_THEME.components) === null || _b === void 0 ? void 0 : _b.chrome) === null || _c === void 0 ? void 0 : _c.header), { height: "64px" }), nav: Object.assign(Object.assign({}, (_e = (_d = reactTheming.DEFAULT_THEME.components) === null || _d === void 0 ? void 0 : _d.chrome) === null || _e === void 0 ? void 0 : _e.nav), { openWidth: 240, closedWidth: 36, workspaceDropdownWidth: 192 }) }), notification: Object.assign(Object.assign({}, (_f = reactTheming.DEFAULT_THEME.components) === null || _f === void 0 ? void 0 : _f.notification), { card: Object.assign(Object.assign({}, (_h = (_g$c = reactTheming.DEFAULT_THEME.components) === null || _g$c === void 0 ? void 0 : _g$c.notification) === null || _h === void 0 ? void 0 : _h.well), { padding: "16px" }) }) }), cardCmponentStyle), { "text.primary": () => ({
337
+ var _a, _b, _c, _d, _e, _f, _g$d, _h;
338
+ const components = Object.assign(Object.assign(Object.assign(Object.assign({}, reactTheming.DEFAULT_THEME.components), { chrome: Object.assign(Object.assign({}, (_a = reactTheming.DEFAULT_THEME.components) === null || _a === void 0 ? void 0 : _a.chrome), { header: Object.assign(Object.assign({}, (_c = (_b = reactTheming.DEFAULT_THEME.components) === null || _b === void 0 ? void 0 : _b.chrome) === null || _c === void 0 ? void 0 : _c.header), { height: "64px" }), nav: Object.assign(Object.assign({}, (_e = (_d = reactTheming.DEFAULT_THEME.components) === null || _d === void 0 ? void 0 : _d.chrome) === null || _e === void 0 ? void 0 : _e.nav), { openWidth: 240, closedWidth: 36, workspaceDropdownWidth: 192 }) }), notification: Object.assign(Object.assign({}, (_f = reactTheming.DEFAULT_THEME.components) === null || _f === void 0 ? void 0 : _f.notification), { card: Object.assign(Object.assign({}, (_h = (_g$d = reactTheming.DEFAULT_THEME.components) === null || _g$d === void 0 ? void 0 : _g$d.notification) === null || _h === void 0 ? void 0 : _h.well), { padding: "16px" }) }) }), cardCmponentStyle), { "text.primary": () => ({
338
339
  color: getColor(colors.primaryHue, 600),
339
340
  }), "text.success": () => ({
340
341
  color: getColor(colors.successHue, 700),
@@ -842,8 +843,8 @@ Tag.Close = StyledClose;
842
843
  Tag.SecondaryText = StyledSpan;
843
844
 
844
845
  var _path$F;
845
- 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); }
846
- const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$R({
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({
847
848
  width: 24,
848
849
  height: 24,
849
850
  viewBox: "0 0 24 24",
@@ -855,8 +856,8 @@ const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg",
855
856
  })));
856
857
 
857
858
  var _path$E;
858
- 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); }
859
- const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$Q({
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({
860
861
  width: 24,
861
862
  height: 24,
862
863
  viewBox: "0 0 24 24",
@@ -868,8 +869,8 @@ const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg",
868
869
  })));
869
870
 
870
871
  var _path$D;
871
- 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); }
872
- const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$P({
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({
873
874
  width: 24,
874
875
  height: 24,
875
876
  viewBox: "0 0 24 24",
@@ -881,8 +882,8 @@ const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg"
881
882
  })));
882
883
 
883
884
  var _rect$4, _path$C, _path2$c, _path3$4;
884
- 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); }
885
- const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$O({
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({
886
887
  width: 24,
887
888
  height: 24,
888
889
  viewBox: "0 0 24 24",
@@ -905,8 +906,8 @@ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElemen
905
906
  })));
906
907
 
907
908
  var _rect$3, _path$B, _path2$b;
908
- 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); }
909
- const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$N({
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({
910
911
  width: 24,
911
912
  height: 24,
912
913
  viewBox: "0 0 24 24",
@@ -930,8 +931,8 @@ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("
930
931
  })));
931
932
 
932
933
  var _rect$2, _path$A, _path2$a;
933
- 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); }
934
- const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$M({
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({
935
936
  width: 24,
936
937
  height: 24,
937
938
  viewBox: "0 0 24 24",
@@ -957,8 +958,8 @@ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement
957
958
  })));
958
959
 
959
960
  var _rect$1, _path$z, _path2$9, _path3$3, _path4$1, _path5$1, _path6$1, _path7$1, _path8$1, _path9$1, _path10$1;
960
- 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); }
961
- const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$L({
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({
962
963
  width: 24,
963
964
  height: 24,
964
965
  viewBox: "0 0 24 24",
@@ -1001,15 +1002,15 @@ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement
1001
1002
  fill: "#FFB65A"
1002
1003
  })));
1003
1004
 
1004
- var _g$b, _path$y, _path2$8, _path3$2, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11;
1005
- 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); }
1006
- const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$K({
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({
1007
1008
  width: 24,
1008
1009
  height: 24,
1009
1010
  viewBox: "0 0 24 24",
1010
1011
  fill: "none",
1011
1012
  xmlns: "http://www.w3.org/2000/svg"
1012
- }, props), _g$b || (_g$b = /*#__PURE__*/React__namespace.createElement("g", {
1013
+ }, props), _g$c || (_g$c = /*#__PURE__*/React__namespace.createElement("g", {
1013
1014
  opacity: 0.3
1014
1015
  }, /*#__PURE__*/React__namespace.createElement("path", {
1015
1016
  opacity: 0.3,
@@ -1071,15 +1072,15 @@ const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createEle
1071
1072
  fill: "#ECF4F2"
1072
1073
  })));
1073
1074
 
1074
- var _g$a, _path$x;
1075
- 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); }
1076
- const SvgCampaignFunctional = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$J({
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({
1077
1078
  width: 24,
1078
1079
  height: 24,
1079
1080
  viewBox: "0 0 24 24",
1080
1081
  fill: "none",
1081
1082
  xmlns: "http://www.w3.org/2000/svg"
1082
- }, props), _g$a || (_g$a = /*#__PURE__*/React__namespace.createElement("g", {
1083
+ }, props), _g$b || (_g$b = /*#__PURE__*/React__namespace.createElement("g", {
1083
1084
  opacity: 0.3
1084
1085
  }, /*#__PURE__*/React__namespace.createElement("path", {
1085
1086
  opacity: 0.3,
@@ -1946,15 +1947,15 @@ const WaffleChart = ({ height, width, data, total, tooltip, }) => {
1946
1947
  } }) })));
1947
1948
  };
1948
1949
 
1949
- var _g$9, _defs$4;
1950
- 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); }
1951
- const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$I({
1950
+ 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({
1952
1953
  width: 27,
1953
1954
  height: 26,
1954
1955
  viewBox: "0 0 27 26",
1955
1956
  fill: "none",
1956
1957
  xmlns: "http://www.w3.org/2000/svg"
1957
- }, props), _g$9 || (_g$9 = /*#__PURE__*/React__namespace.createElement("g", {
1958
+ }, props), _g$a || (_g$a = /*#__PURE__*/React__namespace.createElement("g", {
1958
1959
  clipPath: "url(#clip0_21_19131)"
1959
1960
  }, /*#__PURE__*/React__namespace.createElement("path", {
1960
1961
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -1970,15 +1971,15 @@ const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg"
1970
1971
  fill: "white"
1971
1972
  })))));
1972
1973
 
1973
- var _g$8, _defs$3;
1974
- 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); }
1975
- const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$H({
1974
+ 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({
1976
1977
  width: 27,
1977
1978
  height: 26,
1978
1979
  viewBox: "0 0 27 26",
1979
1980
  fill: "none",
1980
1981
  xmlns: "http://www.w3.org/2000/svg"
1981
- }, props), _g$8 || (_g$8 = /*#__PURE__*/React__namespace.createElement("g", {
1982
+ }, props), _g$9 || (_g$9 = /*#__PURE__*/React__namespace.createElement("g", {
1982
1983
  clipPath: "url(#clip0_21_19130)"
1983
1984
  }, /*#__PURE__*/React__namespace.createElement("path", {
1984
1985
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -1994,15 +1995,15 @@ const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg"
1994
1995
  fill: "white"
1995
1996
  })))));
1996
1997
 
1997
- var _g$7, _defs$2;
1998
- 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); }
1999
- const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$G({
1998
+ 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({
2000
2001
  width: 27,
2001
2002
  height: 26,
2002
2003
  viewBox: "0 0 27 26",
2003
2004
  fill: "none",
2004
2005
  xmlns: "http://www.w3.org/2000/svg"
2005
- }, props), _g$7 || (_g$7 = /*#__PURE__*/React__namespace.createElement("g", {
2006
+ }, props), _g$8 || (_g$8 = /*#__PURE__*/React__namespace.createElement("g", {
2006
2007
  clipPath: "url(#clip0_21_19129)"
2007
2008
  }, /*#__PURE__*/React__namespace.createElement("path", {
2008
2009
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -2024,15 +2025,15 @@ const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg"
2024
2025
  fill: "white"
2025
2026
  })))));
2026
2027
 
2027
- var _g$6, _defs$1;
2028
- 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); }
2029
- const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$F({
2028
+ 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({
2030
2031
  width: 27,
2031
2032
  height: 26,
2032
2033
  viewBox: "0 0 27 26",
2033
2034
  fill: "none",
2034
2035
  xmlns: "http://www.w3.org/2000/svg"
2035
- }, props), _g$6 || (_g$6 = /*#__PURE__*/React__namespace.createElement("g", {
2036
+ }, props), _g$7 || (_g$7 = /*#__PURE__*/React__namespace.createElement("g", {
2036
2037
  clipPath: "url(#clip0_21_19127)"
2037
2038
  }, /*#__PURE__*/React__namespace.createElement("path", {
2038
2039
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -2054,15 +2055,15 @@ const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg"
2054
2055
  fill: "white"
2055
2056
  })))));
2056
2057
 
2057
- var _g$5, _defs;
2058
- 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); }
2059
- const SvgSentiment5 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
2058
+ 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({
2060
2061
  width: 26,
2061
2062
  height: 26,
2062
2063
  viewBox: "0 0 26 26",
2063
2064
  fill: "none",
2064
2065
  xmlns: "http://www.w3.org/2000/svg"
2065
- }, props), _g$5 || (_g$5 = /*#__PURE__*/React__namespace.createElement("g", {
2066
+ }, props), _g$6 || (_g$6 = /*#__PURE__*/React__namespace.createElement("g", {
2066
2067
  clipPath: "url(#clip0_21_19125)"
2067
2068
  }, /*#__PURE__*/React__namespace.createElement("path", {
2068
2069
  d: "M25.2051 13C25.2051 20.1796 19.5626 26 12.6025 26C5.64314 26 0 20.1796 0 13C0 5.82111 5.64314 0 12.6025 0C19.5626 0 25.2051 5.82111 25.2051 13Z",
@@ -2313,7 +2314,7 @@ const ChatFooter = ({ saveText, children, showShortcut, }) => {
2313
2314
  };
2314
2315
 
2315
2316
  const ChatContext = React.createContext(null);
2316
- const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, children, }) => {
2317
+ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMentionableUsers, children, }) => {
2317
2318
  const [editor, setEditor] = React.useState();
2318
2319
  const [thumbnails, setThumbnails] = React.useState([]);
2319
2320
  const getMentions = (editor) => {
@@ -2335,6 +2336,7 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2335
2336
  editor,
2336
2337
  setEditor,
2337
2338
  thumbnails,
2339
+ setThumbnails,
2338
2340
  afterUploadCallback: (failed) => {
2339
2341
  setThumbnails(thumbnails.map((file) => {
2340
2342
  if (failed.includes(file.name)) {
@@ -2348,13 +2350,13 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2348
2350
  return file;
2349
2351
  }));
2350
2352
  },
2351
- addThumbnails: ({ files, }) => {
2353
+ addThumbnails: ({ files }) => {
2352
2354
  files.forEach((file) => (file.isLoadingMedia = true));
2353
2355
  setThumbnails((prev) => [...prev, ...files]);
2354
2356
  if (onFileUpload) {
2355
2357
  onFileUpload(files).then((data) => {
2356
2358
  var _a;
2357
- const failed = (_a = data.failed) === null || _a === void 0 ? void 0 : _a.map(f => f.name);
2359
+ const failed = (_a = data.failed) === null || _a === void 0 ? void 0 : _a.map((f) => f.name);
2358
2360
  setThumbnails((prev) => {
2359
2361
  return prev.map((file) => {
2360
2362
  file.isLoadingMedia = false;
@@ -2370,10 +2372,19 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2370
2372
  });
2371
2373
  }
2372
2374
  },
2373
- clearThumbnails: () => {
2374
- setThumbnails([]);
2375
+ clearInput: () => {
2376
+ if (editor && !editor.isEmpty) {
2377
+ editor.commands.clearContent();
2378
+ }
2379
+ if (thumbnails.length > 0)
2380
+ setThumbnails([]);
2381
+ },
2382
+ onDeleteThumbnail: (id) => {
2383
+ onDeleteThumbnail(id);
2384
+ },
2385
+ removeThumbnail: (index) => {
2386
+ setThumbnails(thumbnails.filter((_, i) => i !== index));
2375
2387
  },
2376
- removeThumbnail: (index) => setThumbnails(thumbnails.filter((_, i) => i !== index)),
2377
2388
  triggerSave: () => {
2378
2389
  if (editor && onSave && !editor.isEmpty) {
2379
2390
  onSave(editor, getMentions(editor));
@@ -2389,7 +2400,8 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2389
2400
  setMentionableUsers,
2390
2401
  thumbnails,
2391
2402
  setThumbnails,
2392
- onFileUpload
2403
+ onFileUpload,
2404
+ onDeleteThumbnail,
2393
2405
  ]);
2394
2406
  return (jsxRuntime.jsx(ChatContext.Provider, Object.assign({ value: chatContextValue }, { children: children })));
2395
2407
  };
@@ -2794,8 +2806,8 @@ const ToastProvider = (props) => (jsxRuntime.jsx(reactNotifications.ToastProvide
2794
2806
  const useToast = reactNotifications.useToast;
2795
2807
 
2796
2808
  var _path$w;
2797
- 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); }
2798
- const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$D({
2809
+ 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); }
2810
+ const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
2799
2811
  xmlns: "http://www.w3.org/2000/svg",
2800
2812
  width: 16,
2801
2813
  height: 16,
@@ -2807,8 +2819,8 @@ const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg",
2807
2819
  })));
2808
2820
 
2809
2821
  var _path$v;
2810
- 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); }
2811
- const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
2822
+ 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); }
2823
+ const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$D({
2812
2824
  xmlns: "http://www.w3.org/2000/svg",
2813
2825
  width: 16,
2814
2826
  height: 16,
@@ -2823,8 +2835,8 @@ const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg"
2823
2835
  })));
2824
2836
 
2825
2837
  var _path$u, _path2$7;
2826
- 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); }
2827
- const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$B({
2838
+ 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); }
2839
+ const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
2828
2840
  xmlns: "http://www.w3.org/2000/svg",
2829
2841
  width: 16,
2830
2842
  height: 16,
@@ -2841,15 +2853,15 @@ const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg",
2841
2853
  d: "M5.5 12C6.5 11 7 9.5 7 8V6m4.5 6c1-1 1.5-2.5 1.5-4V6"
2842
2854
  })));
2843
2855
 
2844
- var _g$4;
2845
- 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); }
2846
- const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
2856
+ var _g$5;
2857
+ 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); }
2858
+ const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$B({
2847
2859
  xmlns: "http://www.w3.org/2000/svg",
2848
2860
  width: 16,
2849
2861
  height: 16,
2850
2862
  focusable: "false",
2851
2863
  viewBox: "0 0 16 16"
2852
- }, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
2864
+ }, props), _g$5 || (_g$5 = /*#__PURE__*/React__namespace.createElement("g", {
2853
2865
  transform: "translate(-464 -332)"
2854
2866
  }, /*#__PURE__*/React__namespace.createElement("rect", {
2855
2867
  width: 16,
@@ -2869,15 +2881,15 @@ const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2869
2881
  transform: "translate(474.469 331)"
2870
2882
  }))));
2871
2883
 
2872
- var _g$3;
2873
- 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); }
2874
- const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
2884
+ var _g$4;
2885
+ 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); }
2886
+ const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
2875
2887
  xmlns: "http://www.w3.org/2000/svg",
2876
2888
  width: 16,
2877
2889
  height: 16,
2878
2890
  focusable: "false",
2879
2891
  viewBox: "0 0 16 16"
2880
- }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
2892
+ }, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
2881
2893
  transform: "translate(-464 -332)"
2882
2894
  }, /*#__PURE__*/React__namespace.createElement("rect", {
2883
2895
  width: 16,
@@ -2897,15 +2909,15 @@ const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2897
2909
  transform: "translate(469.359 331)"
2898
2910
  }))));
2899
2911
 
2900
- var _g$2;
2901
- 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); }
2902
- const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
2912
+ var _g$3;
2913
+ 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); }
2914
+ const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
2903
2915
  xmlns: "http://www.w3.org/2000/svg",
2904
2916
  width: 16,
2905
2917
  height: 16,
2906
2918
  focusable: "false",
2907
2919
  viewBox: "0 0 16 16"
2908
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
2920
+ }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
2909
2921
  transform: "translate(-464 -332)"
2910
2922
  }, /*#__PURE__*/React__namespace.createElement("rect", {
2911
2923
  width: 16,
@@ -2966,15 +2978,22 @@ const FloatingMenu = (props) => {
2966
2978
  const TooltipComponent = (props) => {
2967
2979
  var _a;
2968
2980
  const theme = React.useContext(styled.ThemeContext);
2969
- return jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front }));
2981
+ return (jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front })));
2970
2982
  };
2971
2983
  const Tooltip = styled__default["default"](TooltipComponent) `
2972
2984
  box-shadow: ${({ theme }) => theme.shadows.lg(`${theme.space.base * 3}px`, `${theme.space.base * 5}px`, getColor("neutralHue", 600, theme, 0.15))};
2985
+
2986
+ ${({ isTransparent }) => isTransparent &&
2987
+ `
2988
+ box-shadow: none;
2989
+ background-color: transparent;
2990
+ border: none;
2991
+ `};
2973
2992
  `;
2974
2993
 
2975
2994
  var _path$t;
2976
- 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); }
2977
- const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
2995
+ 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); }
2996
+ const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
2978
2997
  xmlns: "http://www.w3.org/2000/svg",
2979
2998
  width: 16,
2980
2999
  height: 16,
@@ -2986,8 +3005,8 @@ const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg"
2986
3005
  })));
2987
3006
 
2988
3007
  var _path$s;
2989
- 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); }
2990
- const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
3008
+ 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); }
3009
+ const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
2991
3010
  xmlns: "http://www.w3.org/2000/svg",
2992
3011
  width: 16,
2993
3012
  height: 16,
@@ -3001,8 +3020,8 @@ const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("sv
3001
3020
  })));
3002
3021
 
3003
3022
  var _path$r;
3004
- 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); }
3005
- const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
3023
+ 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); }
3024
+ const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
3006
3025
  xmlns: "http://www.w3.org/2000/svg",
3007
3026
  width: 16,
3008
3027
  height: 16,
@@ -3016,8 +3035,8 @@ const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg",
3016
3035
  })));
3017
3036
 
3018
3037
  var _path$q;
3019
- 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); }
3020
- const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
3038
+ 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); }
3039
+ const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
3021
3040
  xmlns: "http://www.w3.org/2000/svg",
3022
3041
  width: 16,
3023
3042
  height: 16,
@@ -3084,7 +3103,10 @@ const CommentBar = ({ editor, i18n, }) => {
3084
3103
  const files = fileInput.files;
3085
3104
  if (files) {
3086
3105
  const mediaFiles = Array.from(files).map((file) => {
3087
- return Object.assign(file, { isLoadingMedia: false });
3106
+ return Object.assign(file, {
3107
+ isLoadingMedia: false,
3108
+ internal_id: uuid.v4(),
3109
+ });
3088
3110
  });
3089
3111
  if (mediaFiles.length === 0)
3090
3112
  return;
@@ -3273,7 +3295,7 @@ const editorExtensions = ({ placeholderOptions, mentionableUsers, }) => {
3273
3295
  },
3274
3296
  }),
3275
3297
  Dropcursor__default["default"].configure({
3276
- color: "#ff0000",
3298
+ color: getColor(colors.accentHue, 700),
3277
3299
  width: 3,
3278
3300
  }),
3279
3301
  Placeholder__default["default"].configure(Object.assign({ placeholder: ({ node }) => {
@@ -3345,15 +3367,15 @@ const editorExtensions = ({ placeholderOptions, mentionableUsers, }) => {
3345
3367
  ];
3346
3368
  };
3347
3369
 
3348
- var _circle$2, _path$p, _path2$6;
3349
- 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); }
3350
- const SvgRemoveMediaIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
3370
+ var _circle$3, _path$p, _path2$6;
3371
+ 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); }
3372
+ const SvgRemoveMediaIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
3351
3373
  width: 56,
3352
3374
  height: 56,
3353
3375
  viewBox: "0 0 56 56",
3354
3376
  fill: "#68737d",
3355
3377
  xmlns: "http://www.w3.org/2000/svg"
3356
- }, props), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
3378
+ }, props), _circle$3 || (_circle$3 = /*#__PURE__*/React__namespace.createElement("circle", {
3357
3379
  cx: 28,
3358
3380
  cy: 28,
3359
3381
  r: 28,
@@ -3401,7 +3423,7 @@ const Preview$1 = styled__default["default"].div `
3401
3423
  background-position: center;
3402
3424
  background-repeat: no-repeat;
3403
3425
  `;
3404
- const ImageThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = false, isError = false, }) => {
3426
+ const ImageThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = true, isError = false, }) => {
3405
3427
  const handleCancel = (e) => {
3406
3428
  e.stopPropagation();
3407
3429
  if (removeThumbnail)
@@ -3416,15 +3438,15 @@ const ImageThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX
3416
3438
  jsxRuntime.jsx("span", { children: "error uploading media" })), !isLoadingMedia && (jsxRuntime.jsx(Preview$1, Object.assign({ url: src }, { children: showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })) })))] })));
3417
3439
  };
3418
3440
 
3419
- var _circle$1, _path$o;
3420
- 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); }
3421
- const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
3441
+ var _circle$2, _path$o;
3442
+ 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); }
3443
+ const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
3422
3444
  width: 56,
3423
3445
  height: 56,
3424
3446
  viewBox: "0 0 56 56",
3425
3447
  fill: "none",
3426
3448
  xmlns: "http://www.w3.org/2000/svg"
3427
- }, props), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
3449
+ }, props), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
3428
3450
  cx: 28,
3429
3451
  cy: 28,
3430
3452
  r: 28,
@@ -3479,7 +3501,7 @@ const Preview = styled__default["default"].div `
3479
3501
  height: 100%;
3480
3502
  }
3481
3503
  `;
3482
- const VideoThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = false, isError = false, }) => {
3504
+ const VideoThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = true, isError = false, }) => {
3483
3505
  const handleCancel = (e) => {
3484
3506
  e.stopPropagation();
3485
3507
  if (removeThumbnail)
@@ -3518,28 +3540,33 @@ const StyledCol$1 = styled__default["default"](reactGrid.Col) `
3518
3540
  const Col = (props) => jsxRuntime.jsx(StyledCol$1, Object.assign({}, props));
3519
3541
 
3520
3542
  const ThumbnailContainer = ({ openLightbox }) => {
3521
- const { thumbnails, removeThumbnail } = useChatContext();
3522
- if (!thumbnails || thumbnails.length === 0) {
3523
- return null;
3524
- }
3525
- const mediaFiles = [];
3526
- thumbnails.forEach((file) => {
3527
- mediaFiles.push({
3543
+ const { thumbnails, removeThumbnail, onDeleteThumbnail } = useChatContext();
3544
+ const mediaFiles = React.useMemo(() => {
3545
+ return thumbnails.map((file) => ({
3528
3546
  fileName: file.name,
3529
3547
  fileType: file.type,
3530
- status: file.isLoadingMedia ? "uploading" : "success",
3531
3548
  previewUrl: URL.createObjectURL(file),
3532
- });
3533
- });
3534
- console.log("mediafiles", mediaFiles);
3549
+ internal_id: file.internal_id,
3550
+ isLoadingMedia: file.isLoadingMedia,
3551
+ }));
3552
+ }, [thumbnails]);
3553
+ if (!mediaFiles || mediaFiles.length === 0) {
3554
+ return null;
3555
+ }
3535
3556
  return (jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: mediaFiles.map((file, index) => {
3536
3557
  // Check if item is an image or a video
3537
- if (file.fileType.includes('image'))
3538
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.status === "uploading", removeThumbnail: () => removeThumbnail(index), clickThumbnail: () => {
3558
+ if (file.fileType.includes("image"))
3559
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, xl: 3, lg: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.isLoadingMedia, removeThumbnail: () => {
3560
+ removeThumbnail(index);
3561
+ onDeleteThumbnail(file.internal_id);
3562
+ }, clickThumbnail: () => {
3539
3563
  openLightbox(thumbnails[index], index);
3540
3564
  } }, index) })));
3541
- if (file.fileType.includes('video'))
3542
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.status === "uploading", removeThumbnail: () => removeThumbnail(index), clickThumbnail: () => {
3565
+ if (file.fileType.includes("video"))
3566
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.isLoadingMedia, removeThumbnail: () => {
3567
+ removeThumbnail(index);
3568
+ onDeleteThumbnail(file.internal_id);
3569
+ }, clickThumbnail: () => {
3543
3570
  openLightbox(thumbnails[index], index);
3544
3571
  } }, index) })));
3545
3572
  return null;
@@ -3613,8 +3640,8 @@ Lightbox.Footer = Footer$3;
3613
3640
  Lightbox.Close = reactModals.Close;
3614
3641
 
3615
3642
  var _path$n;
3616
- 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); }
3617
- const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
3643
+ 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); }
3644
+ const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
3618
3645
  xmlns: "http://www.w3.org/2000/svg",
3619
3646
  width: 16,
3620
3647
  height: 16,
@@ -3626,8 +3653,8 @@ const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElemen
3626
3653
  })));
3627
3654
 
3628
3655
  var _path$m;
3629
- 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); }
3630
- const SvgChevronRightStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
3656
+ 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); }
3657
+ const SvgChevronRightStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
3631
3658
  xmlns: "http://www.w3.org/2000/svg",
3632
3659
  width: 16,
3633
3660
  height: 16,
@@ -3856,94 +3883,270 @@ Slider.Slide = Slide;
3856
3883
  Slider.PrevButton = PrevButton;
3857
3884
  Slider.NextButton = NextButton;
3858
3885
 
3859
- const UgProgress = styled__default["default"](reactLoaders.Progress) ``;
3860
- /**
3861
- * A Progress loader communicates progress when downloading or uploading content.
3862
- * <hr>
3863
- * Used for this:
3864
- * - To communicate the amount of time left when downloading or uploading content
3865
- *
3866
- Not for this:
3867
- - When the loading time is unknown, use a Spinner instead
3868
- - When loading page content, use a Skeleton loader instead
3869
- */
3870
- const Progress = React.forwardRef((props, ref) => (jsxRuntime.jsx(UgProgress, Object.assign({ ref: ref }, props))));
3871
-
3872
- const Wrapper$1 = styled__default["default"].div `
3873
- position: absolute;
3874
- bottom: ${({ theme }) => theme.space.sm};
3875
- z-index: 1;
3876
- `;
3877
- const Content$1 = styled__default["default"].div `
3878
- display: flex;
3879
- background-color: ${({ theme }) => theme.palette.grey[800]};
3880
- border-radius: 2px;
3881
- width: auto;
3882
- padding: 2px 4px;
3883
- display: inline-flex;
3884
- color: white;
3885
- align-items: center;
3886
- justify-content: center;
3887
- min-height: 16px;
3888
- `;
3889
- const PlayerTooltip = (_a) => {
3890
- var { children } = _a, props = __rest(_a, ["children"]);
3891
- return (jsxRuntime.jsx(Wrapper$1, Object.assign({}, props, { children: jsxRuntime.jsx(Content$1, { children: children }) })));
3892
- };
3886
+ var _path$l, _path2$5;
3887
+ 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); }
3888
+ const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
3889
+ xmlns: "http://www.w3.org/2000/svg",
3890
+ width: 16,
3891
+ height: 16,
3892
+ focusable: "false",
3893
+ viewBox: "0 0 16 16"
3894
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
3895
+ stroke: "currentColor",
3896
+ strokeLinecap: "round",
3897
+ d: "M11.5 10l4-4m-4 0l4 4"
3898
+ })), _path2$5 || (_path2$5 = /*#__PURE__*/React__namespace.createElement("path", {
3899
+ fill: "currentColor",
3900
+ 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"
3901
+ })));
3893
3902
 
3894
- var _path$l;
3903
+ var _path$k, _path2$4;
3895
3904
  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); }
3896
- const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
3905
+ const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
3897
3906
  xmlns: "http://www.w3.org/2000/svg",
3898
3907
  width: 16,
3899
3908
  height: 16,
3900
3909
  focusable: "false",
3901
3910
  viewBox: "0 0 16 16"
3902
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
3911
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
3903
3912
  fill: "currentColor",
3904
- 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"
3913
+ 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"
3914
+ })), _path2$4 || (_path2$4 = /*#__PURE__*/React__namespace.createElement("path", {
3915
+ fill: "none",
3916
+ stroke: "currentColor",
3917
+ strokeLinecap: "round",
3918
+ 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"
3905
3919
  })));
3906
3920
 
3907
- var _g$1;
3921
+ const AudioButton = () => {
3922
+ const [hasAudio, setHasAudio] = React.useState(false);
3923
+ const { isMuted, setMuted, context } = Video.useVideoContext();
3924
+ const { player } = context;
3925
+ const checkAudio = (video) => {
3926
+ if (!video) {
3927
+ return false;
3928
+ }
3929
+ const videohasAudio = video.mozHasAudio ||
3930
+ Boolean(video.webkitAudioDecodedByteCount) ||
3931
+ Boolean(video.audioTracks && video.audioTracks.length);
3932
+ setHasAudio(videohasAudio);
3933
+ };
3934
+ const hasVolume = (video) => {
3935
+ if (!video) {
3936
+ return false;
3937
+ }
3938
+ return video.volume > 0;
3939
+ };
3940
+ React.useEffect(() => {
3941
+ if (player && (player === null || player === void 0 ? void 0 : player.ref)) {
3942
+ setMuted(!hasVolume(player.ref.current));
3943
+ checkAudio(player.ref.current);
3944
+ }
3945
+ }, [context.isPlaying, isMuted]);
3946
+ return (jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, disabled: !hasAudio, onClick: () => {
3947
+ if (player === null || player === void 0 ? void 0 : player.ref.current) {
3948
+ player.ref.current.volume = player.ref.current.volume > 0 ? 0 : 1;
3949
+ setMuted(!player.ref.current.volume);
3950
+ }
3951
+ } }, { children: isMuted || !hasAudio ? jsxRuntime.jsx(SvgVolumeMutedFill, {}) : jsxRuntime.jsx(SvgVolumeUnmutedFill, {}) })));
3952
+ };
3953
+
3954
+ const ProgressContext = React.createContext(null);
3955
+ const ProgressContextProvider = ({ children, }) => {
3956
+ const [isGrabbing, setIsGrabbing] = React.useState(false);
3957
+ const [fromEnd, setFromEnd] = React.useState(false);
3958
+ const [activeBookmark, setactiveBookmark] = React.useState(undefined);
3959
+ const progressContextValue = React.useMemo(() => ({
3960
+ isGrabbing,
3961
+ fromEnd,
3962
+ activeBookmark,
3963
+ setIsGrabbing,
3964
+ setFromEnd,
3965
+ setactiveBookmark,
3966
+ reset: () => {
3967
+ setIsGrabbing(false);
3968
+ setFromEnd(false);
3969
+ setactiveBookmark(undefined);
3970
+ },
3971
+ }), [isGrabbing, fromEnd, activeBookmark]);
3972
+ return (jsxRuntime.jsx(ProgressContext.Provider, Object.assign({ value: progressContextValue }, { children: children })));
3973
+ };
3974
+ const useProgressContext = () => {
3975
+ const context = React.useContext(ProgressContext);
3976
+ if (!context)
3977
+ throw new Error("Provider not found for ProgressContextProvider");
3978
+ return context; // Now we can use the context in the component, SAFELY.
3979
+ };
3980
+
3981
+ var _g$2;
3908
3982
  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); }
3909
- const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
3983
+ const SvgGrip = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
3910
3984
  xmlns: "http://www.w3.org/2000/svg",
3911
3985
  width: 16,
3912
3986
  height: 16,
3913
3987
  focusable: "false",
3914
3988
  viewBox: "0 0 16 16"
3915
- }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
3989
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
3916
3990
  fill: "currentColor"
3917
3991
  }, /*#__PURE__*/React__namespace.createElement("rect", {
3918
- width: 4,
3919
- height: 14,
3920
- x: 3,
3992
+ width: 2,
3993
+ height: 2,
3994
+ x: 5,
3921
3995
  y: 1,
3922
- rx: 1,
3923
- ry: 1
3996
+ rx: 0.5,
3997
+ ry: 0.5
3924
3998
  }), /*#__PURE__*/React__namespace.createElement("rect", {
3925
- width: 4,
3926
- height: 14,
3999
+ width: 2,
4000
+ height: 2,
3927
4001
  x: 9,
3928
4002
  y: 1,
3929
- rx: 1,
3930
- ry: 1
4003
+ rx: 0.5,
4004
+ ry: 0.5
4005
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4006
+ width: 2,
4007
+ height: 2,
4008
+ x: 5,
4009
+ y: 5,
4010
+ rx: 0.5,
4011
+ ry: 0.5
4012
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4013
+ width: 2,
4014
+ height: 2,
4015
+ x: 9,
4016
+ y: 5,
4017
+ rx: 0.5,
4018
+ ry: 0.5
4019
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4020
+ width: 2,
4021
+ height: 2,
4022
+ x: 5,
4023
+ y: 9,
4024
+ rx: 0.5,
4025
+ ry: 0.5
4026
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4027
+ width: 2,
4028
+ height: 2,
4029
+ x: 9,
4030
+ y: 9,
4031
+ rx: 0.5,
4032
+ ry: 0.5
4033
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4034
+ width: 2,
4035
+ height: 2,
4036
+ x: 5,
4037
+ y: 13,
4038
+ rx: 0.5,
4039
+ ry: 0.5
4040
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4041
+ width: 2,
4042
+ height: 2,
4043
+ x: 9,
4044
+ y: 13,
4045
+ rx: 0.5,
4046
+ ry: 0.5
3931
4047
  }))));
3932
4048
 
3933
- var _path$k, _path2$5, _path3$1;
4049
+ const StyledGrabber = styled.styled.div `
4050
+ position: absolute;
4051
+ display: none;
4052
+ ${({ isEnd }) => isEnd
4053
+ ? `
4054
+ right: 0;
4055
+ border-top-right-radius: 2px;
4056
+ border-bottom-right-radius: 2px;
4057
+ `
4058
+ : `
4059
+ left: 0;
4060
+ border-top-left-radius: 2px;
4061
+ border-bottom-left-radius: 2px;
4062
+ `}
4063
+ height: 100%;
4064
+ width: 8px;
4065
+ background-color: white;
4066
+ z-index: 2;
4067
+ cursor: ew-resize;
4068
+
4069
+ div {
4070
+ display: flex;
4071
+ justify-content: center;
4072
+ align-items: center;
4073
+ height: 100%;
4074
+ width: 100%;
4075
+ color: ${({ theme }) => theme.palette.grey[500]};
4076
+ svg {
4077
+ width: auto;
4078
+ height: 50%;
4079
+ }
4080
+ }
4081
+ `;
4082
+ const activeBookMark = styled.css `
4083
+ height: 250%;
4084
+ transform: translateY(-30%);
4085
+
4086
+ ${StyledGrabber} {
4087
+ display: block;
4088
+ }
4089
+ `;
4090
+ const Rect = styled.styled.div `
4091
+ position: absolute;
4092
+ height: 110%;
4093
+ background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
4094
+ z-index: 1;
4095
+ border-radius: 2px;
4096
+ &:hover {
4097
+ ${activeBookMark}
4098
+ border-radius: 4px;
4099
+ }
4100
+ color: white;
4101
+ ${({ isActive }) => isActive && activeBookMark}
4102
+
4103
+ transition: width 0.1s ease;
4104
+ `;
4105
+ const Grabber = (props) => {
4106
+ const { observation } = props;
4107
+ const { setIsGrabbing, setactiveBookmark, setFromEnd } = useProgressContext();
4108
+ const handleDragStart = (e) => {
4109
+ setIsGrabbing(true);
4110
+ setactiveBookmark(observation);
4111
+ setFromEnd(!!props.isEnd);
4112
+ e.preventDefault();
4113
+ e.stopPropagation();
4114
+ };
4115
+ return (jsxRuntime.jsx(StyledGrabber, Object.assign({ isEnd: props.isEnd, onMouseDown: handleDragStart, onMouseMove: props.handleMouseMove }, { children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(SvgGrip, {}) }) })));
4116
+ };
4117
+ const Bookmark = (props) => {
4118
+ var _a, _b;
4119
+ const { start, end, hue, label } = props;
4120
+ const { context } = Video.useVideoContext();
4121
+ const videoStart = context.part.start || 0;
4122
+ const videoEnd = context.part.end || ((_a = context.player) === null || _a === void 0 ? void 0 : _a.totalTime) || 0;
4123
+ const duration = videoEnd - videoStart || ((_b = context.player) === null || _b === void 0 ? void 0 : _b.totalTime) || 0; //relative
4124
+ const { activeBookmark } = useProgressContext();
4125
+ if (!context.player || !context.player.ref) {
4126
+ return null;
4127
+ }
4128
+ if (start > videoEnd || start < videoStart)
4129
+ return null;
4130
+ 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: {
4131
+ left: `${((start - videoStart) / duration) * 100}%`,
4132
+ width: `${((end - start) / duration) * 100}%`,
4133
+ }, onClick: props.onClick }, { children: [jsxRuntime.jsx(Grabber, { observation: props }), jsxRuntime.jsx(Grabber, { isEnd: true, observation: props })] })) })));
4134
+ };
4135
+
4136
+ var _path$j, _path2$3, _path3$1;
3934
4137
  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); }
3935
- const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
4138
+ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
3936
4139
  width: 16,
3937
4140
  height: 16,
3938
4141
  viewBox: "0 0 16 16",
3939
4142
  fill: "none",
3940
4143
  xmlns: "http://www.w3.org/2000/svg"
3941
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
4144
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
3942
4145
  fillRule: "evenodd",
3943
4146
  clipRule: "evenodd",
3944
- 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",
4147
+ 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",
3945
4148
  fill: "currentColor"
3946
- })), _path2$5 || (_path2$5 = /*#__PURE__*/React__namespace.createElement("path", {
4149
+ })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
3947
4150
  d: "M5.5 7.63073V7.07008H6.67566V11H6.02566V7.63073H5.5Z",
3948
4151
  fill: "currentColor"
3949
4152
  })), _path3$1 || (_path3$1 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -3951,20 +4154,20 @@ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createEleme
3951
4154
  fill: "currentColor"
3952
4155
  })));
3953
4156
 
3954
- var _path$j, _path2$4, _path3;
4157
+ var _path$i, _path2$2, _path3;
3955
4158
  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); }
3956
- const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
4159
+ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
3957
4160
  width: 16,
3958
4161
  height: 16,
3959
4162
  viewBox: "0 0 16 16",
3960
4163
  fill: "none",
3961
4164
  xmlns: "http://www.w3.org/2000/svg"
3962
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
4165
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
3963
4166
  fillRule: "evenodd",
3964
4167
  clipRule: "evenodd",
3965
- 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",
4168
+ 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",
3966
4169
  fill: "currentColor"
3967
- })), _path2$4 || (_path2$4 = /*#__PURE__*/React__namespace.createElement("path", {
4170
+ })), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
3968
4171
  d: "M5.5 7.63073V7.07008H6.67566V11H6.02566V7.63073H5.5Z",
3969
4172
  fill: "currentColor"
3970
4173
  })), _path3 || (_path3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -3972,18 +4175,57 @@ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement(
3972
4175
  fill: "currentColor"
3973
4176
  })));
3974
4177
 
3975
- var _path$i, _path2$3;
4178
+ var _g$1;
3976
4179
  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); }
3977
- const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
4180
+ const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
4181
+ xmlns: "http://www.w3.org/2000/svg",
4182
+ width: 16,
4183
+ height: 16,
4184
+ focusable: "false",
4185
+ viewBox: "0 0 16 16"
4186
+ }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
4187
+ fill: "currentColor"
4188
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
4189
+ width: 4,
4190
+ height: 14,
4191
+ x: 3,
4192
+ y: 1,
4193
+ rx: 1,
4194
+ ry: 1
4195
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4196
+ width: 4,
4197
+ height: 14,
4198
+ x: 9,
4199
+ y: 1,
4200
+ rx: 1,
4201
+ ry: 1
4202
+ }))));
4203
+
4204
+ var _path$h;
4205
+ 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); }
4206
+ const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
4207
+ xmlns: "http://www.w3.org/2000/svg",
4208
+ width: 16,
4209
+ height: 16,
4210
+ focusable: "false",
4211
+ viewBox: "0 0 16 16"
4212
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
4213
+ fill: "currentColor",
4214
+ 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"
4215
+ })));
4216
+
4217
+ var _path$g, _path2$1;
4218
+ 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); }
4219
+ const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
3978
4220
  xmlns: "http://www.w3.org/2000/svg",
3979
4221
  width: 16,
3980
4222
  height: 16,
3981
4223
  focusable: "false",
3982
4224
  viewBox: "0 0 24 24"
3983
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
4225
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
3984
4226
  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",
3985
4227
  fill: "currentColor"
3986
- })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
4228
+ })), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
3987
4229
  d: "M20.75 19.0526C20.75 20.4774 19.1383 21.305 17.9803 20.4748L7.51062 12.9682C6.50574 12.2477 6.54467 10.7407 7.5854 10.073L18.0551 3.35665C19.2198 2.60946 20.75 3.44583 20.75 4.82961L20.75 19.0526Z",
3988
4230
  fill: "currentColor"
3989
4231
  })));
@@ -4013,8 +4255,9 @@ const getNextPlaybackRate = (rate = 1) => {
4013
4255
  const StyledDiv$3 = styled__default["default"].div `
4014
4256
  display: flex;
4015
4257
  align-items: center;
4258
+ justify-content: center;
4016
4259
  `;
4017
- const ControlsGroupCenter = () => {
4260
+ const ControlsGroupCenter = (props) => {
4018
4261
  var _a;
4019
4262
  const [playBackRate, setPlayBackRate] = React.useState(1);
4020
4263
  const { context, togglePlay } = Video.useVideoContext();
@@ -4037,7 +4280,7 @@ const ControlsGroupCenter = () => {
4037
4280
  const nextTime = videoRef.currentTime + 10;
4038
4281
  videoRef.currentTime = nextTime;
4039
4282
  };
4040
- return (jsxRuntime.jsxs(StyledDiv$3, { children: [jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4283
+ return (jsxRuntime.jsxs(StyledDiv$3, Object.assign({}, props, { children: [jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4041
4284
  if (videoRef) {
4042
4285
  videoRef.currentTime = 0;
4043
4286
  }
@@ -4055,89 +4298,7 @@ const ControlsGroupCenter = () => {
4055
4298
  videoRef.playbackRate = newSpeed;
4056
4299
  }
4057
4300
  e.stopPropagation();
4058
- } }, { children: jsxRuntime.jsxs(SM, Object.assign({ isBold: true, style: { lineHeight: "16px" } }, { children: [playBackRate, "x"] })) }))] }));
4059
- };
4060
-
4061
- const StyledDiv$2 = styled__default["default"].div `
4062
- position: absolute;
4063
- bottom: ${({ theme }) => theme.space.sm};
4064
- right: 0;
4065
-
4066
- padding: 0 ${({ theme }) => theme.space.xs};
4067
-
4068
- span {
4069
- color: ${({ theme }) => theme.palette.grey[300]};
4070
- }
4071
- `;
4072
- const TimeLabel = ({ current, duration, }) => (jsxRuntime.jsx(StyledDiv$2, { children: jsxRuntime.jsxs(SM, Object.assign({ tag: "span" }, { children: [current, "/", duration] })) }));
4073
-
4074
- var _path$h, _path2$2;
4075
- 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); }
4076
- const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
4077
- xmlns: "http://www.w3.org/2000/svg",
4078
- width: 16,
4079
- height: 16,
4080
- focusable: "false",
4081
- viewBox: "0 0 16 16"
4082
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
4083
- stroke: "currentColor",
4084
- strokeLinecap: "round",
4085
- d: "M11.5 10l4-4m-4 0l4 4"
4086
- })), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
4087
- fill: "currentColor",
4088
- 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"
4089
- })));
4090
-
4091
- var _path$g, _path2$1;
4092
- 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); }
4093
- const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
4094
- xmlns: "http://www.w3.org/2000/svg",
4095
- width: 16,
4096
- height: 16,
4097
- focusable: "false",
4098
- viewBox: "0 0 16 16"
4099
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
4100
- fill: "currentColor",
4101
- 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"
4102
- })), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
4103
- fill: "none",
4104
- stroke: "currentColor",
4105
- strokeLinecap: "round",
4106
- 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"
4107
- })));
4108
-
4109
- const AudioButton = () => {
4110
- const [hasAudio, setHasAudio] = React.useState(false);
4111
- const { isMuted, setMuted, context } = Video.useVideoContext();
4112
- const { player } = context;
4113
- const checkAudio = (video) => {
4114
- if (!video) {
4115
- return false;
4116
- }
4117
- console.log("hasAudio?", video);
4118
- const videohasAudio = video.mozHasAudio ||
4119
- Boolean(video.webkitAudioDecodedByteCount) ||
4120
- Boolean(video.audioTracks && video.audioTracks.length);
4121
- setHasAudio(videohasAudio);
4122
- };
4123
- const hasVolume = (video) => {
4124
- if (!video) {
4125
- return false;
4126
- }
4127
- return video.volume > 0;
4128
- };
4129
- React.useEffect(() => {
4130
- if (player && (player === null || player === void 0 ? void 0 : player.ref)) {
4131
- setMuted(!hasVolume(player.ref.current));
4132
- checkAudio(player.ref.current);
4133
- }
4134
- }, [context.isPlaying, isMuted]);
4135
- return (jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, disabled: !hasAudio, onClick: () => {
4136
- if (player === null || player === void 0 ? void 0 : player.ref.current) {
4137
- player.ref.current.volume = player.ref.current.volume > 0 ? 0 : 1;
4138
- setMuted(!player.ref.current.volume);
4139
- }
4140
- } }, { children: isMuted || !hasAudio ? jsxRuntime.jsx(SvgVolumeMutedFill, {}) : jsxRuntime.jsx(SvgVolumeUnmutedFill, {}) })));
4301
+ } }, { children: jsxRuntime.jsxs(SM, Object.assign({ isBold: true, style: { lineHeight: "16px" } }, { children: [playBackRate, "x"] })) }))] })));
4141
4302
  };
4142
4303
 
4143
4304
  var _path$f;
@@ -4237,6 +4398,96 @@ const FullScreenButton = ({ container, }) => {
4237
4398
  }, disabled: !canGoFullScreen() }, { children: document.fullscreenElement || isFullScreen ? (jsxRuntime.jsx(SvgMinimizeStroke, {})) : (jsxRuntime.jsx(SvgMaximizeStroke, {})) })));
4238
4399
  };
4239
4400
 
4401
+ const UgProgress = styled__default["default"](reactLoaders.Progress) ``;
4402
+ /**
4403
+ * A Progress loader communicates progress when downloading or uploading content.
4404
+ * <hr>
4405
+ * Used for this:
4406
+ * - To communicate the amount of time left when downloading or uploading content
4407
+ *
4408
+ Not for this:
4409
+ - When the loading time is unknown, use a Spinner instead
4410
+ - When loading page content, use a Skeleton loader instead
4411
+ */
4412
+ const Progress = React.forwardRef((props, ref) => (jsxRuntime.jsx(UgProgress, Object.assign({ ref: ref }, props))));
4413
+
4414
+ const StyledProgress = styled.styled(Progress) `
4415
+ width: 100%;
4416
+ border-radius: 0;
4417
+ color: ${({ theme }) => theme.palette.grey[700]};
4418
+ cursor: pointer;
4419
+ > div {
4420
+ border-radius: 0;
4421
+ }
4422
+ `;
4423
+ const ProgressBar = React.forwardRef((props, ref) => {
4424
+ const { progress, handleSkipAhead } = props;
4425
+ return (jsxRuntime.jsx(StyledProgress, { className: "progress-bar-1", ref: ref, value: progress, onClick: (e) => handleSkipAhead(e.clientX) }));
4426
+ });
4427
+
4428
+ const StyledDiv$2 = styled__default["default"].div `
4429
+ display: flex;
4430
+ color: ${({ theme }) => theme.palette.grey[300]};
4431
+ `;
4432
+ const TimeLabel = ({ current, duration, }) => (jsxRuntime.jsx(StyledDiv$2, { children: jsxRuntime.jsxs(SM, Object.assign({ tag: "span" }, { children: [formatDuration(current), "/", formatDuration(duration)] })) }));
4433
+
4434
+ const Wrapper$1 = styled__default["default"].div `
4435
+ position: absolute;
4436
+ bottom: ${({ theme }) => theme.space.sm};
4437
+ z-index: 1;
4438
+ `;
4439
+ const Content$1 = styled__default["default"].div `
4440
+ display: flex;
4441
+ background-color: ${({ theme }) => theme.palette.grey[800]};
4442
+ border-radius: 2px;
4443
+ width: auto;
4444
+ padding: 2px 4px;
4445
+ display: inline-flex;
4446
+ color: white;
4447
+ align-items: center;
4448
+ justify-content: center;
4449
+ min-height: 16px;
4450
+ `;
4451
+ const PlayerTooltip = (_a) => {
4452
+ var { children } = _a, props = __rest(_a, ["children"]);
4453
+ return (jsxRuntime.jsx(Wrapper$1, Object.assign({}, props, { children: jsxRuntime.jsx(Content$1, { children: children }) })));
4454
+ };
4455
+
4456
+ var _path$d, _circle$1;
4457
+ 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); }
4458
+ const SvgTagStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
4459
+ xmlns: "http://www.w3.org/2000/svg",
4460
+ width: 16,
4461
+ height: 16,
4462
+ focusable: "false",
4463
+ viewBox: "0 0 16 16"
4464
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
4465
+ fill: "none",
4466
+ stroke: "currentColor",
4467
+ 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"
4468
+ })), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
4469
+ cx: 4,
4470
+ cy: 4,
4471
+ r: 1,
4472
+ fill: "currentColor"
4473
+ })));
4474
+
4475
+ const Cutter = ({ onCutHandler, isCutting, i18n, }) => {
4476
+ var _a;
4477
+ const { context } = Video.useVideoContext();
4478
+ const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4479
+ if (!onCutHandler)
4480
+ return null;
4481
+ return (jsxRuntime.jsxs(Button, Object.assign({ isPrimary: true, isAccent: true, size: "small", onClick: (e) => {
4482
+ if (videoRef) {
4483
+ onCutHandler(videoRef.currentTime);
4484
+ }
4485
+ e.stopPropagation();
4486
+ } }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), isCutting
4487
+ ? (i18n === null || i18n === void 0 ? void 0 : i18n.onHighlight) || "Click again to stop"
4488
+ : (i18n === null || i18n === void 0 ? void 0 : i18n.beforeHighlight) || "New highlight"] })));
4489
+ };
4490
+
4240
4491
  const ControlsWrapper = styled__default["default"].div `
4241
4492
  position: absolute;
4242
4493
  bottom: 0;
@@ -4247,15 +4498,6 @@ const ControlsWrapper = styled__default["default"].div `
4247
4498
  ${({ isPlaying }) => isPlaying && "display: none;"}
4248
4499
  z-index: 2;
4249
4500
  `;
4250
- const StyledProgress = styled__default["default"](Progress) `
4251
- width: 100%;
4252
- border-radius: 0;
4253
- color: ${({ theme }) => theme.palette.kale[700]};
4254
- cursor: pointer;
4255
- > div {
4256
- border-radius: 0;
4257
- }
4258
- `;
4259
4501
  const StyledTooltip = styled__default["default"](PlayerTooltip) `
4260
4502
  display: none;
4261
4503
  `;
@@ -4274,18 +4516,23 @@ const StyledDiv$1 = styled__default["default"].div `
4274
4516
  display: flex;
4275
4517
  align-items: center;
4276
4518
  `;
4277
- const Controls = ({ container, }) => {
4519
+ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, }) => {
4278
4520
  var _a, _b, _c;
4279
4521
  const [progress, setProgress] = React.useState(0);
4280
4522
  const [tooltipMargin, setTooltipMargin] = React.useState(0);
4281
4523
  const [tooltipLabel, setTooltipLabel] = React.useState("00:00");
4524
+ const [marks, setMarks] = React.useState(bookmarks);
4282
4525
  const progressRef = React.useRef(null);
4283
4526
  const { context, setCurrentTime } = Video.useVideoContext();
4527
+ const { reset, isGrabbing, activeBookmark, fromEnd } = useProgressContext();
4528
+ React.useEffect(() => {
4529
+ setMarks(bookmarks);
4530
+ }, [bookmarks]);
4284
4531
  const relCurrentTime = ((_a = context.player) === null || _a === void 0 ? void 0 : _a.currentTime)
4285
4532
  ? ((_b = context.player) === null || _b === void 0 ? void 0 : _b.currentTime) - context.part.start
4286
4533
  : 0;
4287
4534
  const duration = context.part.end - context.part.start || ((_c = context.player) === null || _c === void 0 ? void 0 : _c.totalTime) || 0; //relative
4288
- const getVideoPositionFromEvent = (clientX) => {
4535
+ const getVideoPositionFromEvent = React.useCallback((clientX) => {
4289
4536
  if (progressRef && progressRef.current && duration) {
4290
4537
  const bounds = progressRef.current.getBoundingClientRect();
4291
4538
  const x = clientX - bounds.left;
@@ -4293,12 +4540,18 @@ const Controls = ({ container, }) => {
4293
4540
  return videoPositionSecs;
4294
4541
  }
4295
4542
  return 0;
4296
- };
4543
+ }, [progressRef, duration]);
4544
+ const getProgress = React.useCallback((currentTime) => {
4545
+ const current = currentTime - (context.part.start || 0);
4546
+ if (duration === 0)
4547
+ return 0;
4548
+ return (current / duration) * 100;
4549
+ }, [context.part.start, duration]);
4297
4550
  const handleSkipAhead = React.useCallback((pageX) => {
4298
4551
  const time = getVideoPositionFromEvent(pageX) + (context.part.start || 0);
4299
4552
  setCurrentTime(time);
4300
4553
  setProgress(getProgress(time));
4301
- }, [context.player, context.part]);
4554
+ }, [getVideoPositionFromEvent, context.part.start, setCurrentTime, getProgress]);
4302
4555
  const onMouseEvent = (e) => {
4303
4556
  if (progressRef && progressRef.current) {
4304
4557
  const tooltipWidth = 40;
@@ -4309,31 +4562,58 @@ const Controls = ({ container, }) => {
4309
4562
  const videoTargetDuration = getVideoPositionFromEvent(e.clientX);
4310
4563
  setTooltipMargin(newTooltipMargin);
4311
4564
  setTooltipLabel(formatDuration(videoTargetDuration));
4565
+ if (isGrabbing) {
4566
+ handleBookmarkUpdate(marginX, progressRef.current.clientWidth);
4567
+ }
4312
4568
  }
4313
4569
  };
4570
+ const handleBookmarkUpdate = React.useCallback((newX, clientW) => {
4571
+ if (!activeBookmark || !marks)
4572
+ return;
4573
+ const currentObsIndex = marks.findIndex((mark) => mark.id === activeBookmark.id);
4574
+ const value = (newX / clientW) * duration + context.part.start;
4575
+ const updatedMark = Object.assign(Object.assign({}, marks[currentObsIndex]), (!!fromEnd ? { end: value } : { start: value }));
4576
+ const newMarks = [
4577
+ ...marks.slice(0, currentObsIndex),
4578
+ updatedMark,
4579
+ ...marks.slice(currentObsIndex + 1),
4580
+ ];
4581
+ setMarks(newMarks);
4582
+ onBookMarkUpdated === null || onBookMarkUpdated === void 0 ? void 0 : onBookMarkUpdated(updatedMark);
4583
+ }, [
4584
+ activeBookmark,
4585
+ context.part.start,
4586
+ duration,
4587
+ fromEnd,
4588
+ onBookMarkUpdated,
4589
+ marks,
4590
+ ]);
4314
4591
  React.useEffect(() => {
4315
4592
  var _a;
4316
4593
  const currentTime = ((_a = context.player) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;
4317
4594
  setProgress(getProgress(currentTime));
4318
- }, [context.player]);
4319
- const getProgress = React.useCallback((currentTime) => {
4320
- const current = currentTime - (context.part.start || 0);
4321
- if (duration === 0)
4322
- return 0;
4323
- return (current / duration) * 100;
4324
- }, [context.player]);
4325
- 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 })), jsxRuntime.jsx(TimeLabel, { current: formatDuration(relCurrentTime), duration: formatDuration(duration) }), jsxRuntime.jsx(StyledProgress, { ref: progressRef, value: progress, onClick: (e) => handleSkipAhead(e.clientX) })] })), jsxRuntime.jsxs(ControlsBar, { children: [jsxRuntime.jsx(StyledDiv$1, { children: jsxRuntime.jsx(AudioButton, {}) }), jsxRuntime.jsx(ControlsGroupCenter, {}), jsxRuntime.jsx(StyledDiv$1, { children: jsxRuntime.jsx(FullScreenButton, { container: container }) })] })] })));
4595
+ }, [context.player, getProgress]);
4596
+ React.useEffect(() => {
4597
+ if (!marks)
4598
+ return;
4599
+ document.addEventListener("mouseup", reset);
4600
+ return () => {
4601
+ document.removeEventListener("mouseup", reset);
4602
+ };
4603
+ }, [reset, marks]);
4604
+ 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 &&
4605
+ (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 })] }))] })] })));
4326
4606
  };
4327
4607
 
4328
- var _path$d;
4329
- 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); }
4330
- const SvgPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
4608
+ var _path$c;
4609
+ 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); }
4610
+ const SvgPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
4331
4611
  width: 70,
4332
4612
  height: 70,
4333
4613
  viewBox: "0 0 70 70",
4334
4614
  fill: "none",
4335
4615
  xmlns: "http://www.w3.org/2000/svg"
4336
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
4616
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
4337
4617
  d: "M60 35L17 62L17 8L60 35Z",
4338
4618
  fill: "#003A57"
4339
4619
  })));
@@ -4449,18 +4729,15 @@ const VideoSpinner = () => (jsxRuntime.jsx(StyledDiv, { children: jsxRuntime.jsx
4449
4729
  * Used for this:
4450
4730
  - To display a video
4451
4731
  */
4452
- const Player = React.forwardRef((props, forwardRef) => {
4453
- const videoRef = React.useRef(null);
4454
- React.useImperativeHandle(forwardRef, () => videoRef.current);
4455
- return (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: videoRef }, props)) })));
4456
- });
4732
+ const Player = React.forwardRef((props, forwardRef) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: forwardRef }, props)) }))));
4457
4733
  const PlayerCore = React.forwardRef((props, forwardRef) => {
4458
4734
  var _a;
4459
4735
  const { context, togglePlay, setIsPlaying } = Video.useVideoContext();
4736
+ const { onCutHandler, bookmarks, isCutting } = props;
4460
4737
  const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4461
4738
  const isLoaded = !!videoRef;
4462
4739
  const containerRef = React.useRef(null);
4463
- React.useImperativeHandle(forwardRef, () => videoRef);
4740
+ React.useImperativeHandle(forwardRef, () => videoRef, [videoRef]);
4464
4741
  React.useEffect(() => {
4465
4742
  if (videoRef) {
4466
4743
  videoRef.addEventListener("pause", () => {
@@ -4474,8 +4751,8 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
4474
4751
  });
4475
4752
  }
4476
4753
  };
4477
- }, [videoRef]);
4478
- 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(Controls, { container: containerRef.current })] })));
4754
+ }, [setIsPlaying, videoRef]);
4755
+ 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 }) })] })));
4479
4756
  });
4480
4757
 
4481
4758
  const ChatBoxContainer = styled__default["default"].div `
@@ -4499,7 +4776,7 @@ const ChatBoxContainer = styled__default["default"].div `
4499
4776
  const CommentBox = (_a) => {
4500
4777
  var { placeholderOptions } = _a, props = __rest(_a, ["placeholderOptions"]);
4501
4778
  const { children, hasFloatingMenu, hasButtonsMenu, bubbleOptions, i18n } = props;
4502
- const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails } = useChatContext();
4779
+ const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails, } = useChatContext();
4503
4780
  const { addToast } = useToast();
4504
4781
  const [isOpen, setIsOpen] = React.useState(false);
4505
4782
  const [selectedImage, setSelectedImage] = React.useState({});
@@ -4536,12 +4813,15 @@ const CommentBox = (_a) => {
4536
4813
  return false;
4537
4814
  event.preventDefault();
4538
4815
  const files = Array.from(event.dataTransfer.files).map((file) => {
4539
- return Object.assign(file, { isLoadingMedia: false });
4816
+ return Object.assign(file, {
4817
+ isLoadingMedia: false,
4818
+ internal_id: uuid.v4(),
4819
+ });
4540
4820
  });
4541
- const wronfFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
4542
- if (wronfFiles.length > 0) {
4543
- for (const file of wronfFiles) {
4544
- addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: 'top' });
4821
+ const wrongFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
4822
+ if (wrongFiles.length > 0) {
4823
+ for (const file of wrongFiles) {
4824
+ addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
4545
4825
  }
4546
4826
  }
4547
4827
  const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
@@ -4550,41 +4830,28 @@ const CommentBox = (_a) => {
4550
4830
  addThumbnails({ files: mediaFiles });
4551
4831
  return false;
4552
4832
  },
4553
- /*handlePaste: (view, event, slice) => {
4554
- if (!event.clipboardData || !event.clipboardData.items) return false;
4555
-
4556
- event.preventDefault();
4557
-
4558
- const items = Array.from(event.clipboardData.items);
4559
-
4560
- const imageItems = items.filter(
4561
- (item) => item.type && item.type.startsWith("image/")
4562
- );
4563
- const textItem = items.find((item) => item.type === "text/plain");
4564
-
4565
- if (imageItems.length > 0) {
4566
- imageItems.forEach((imageItem) => {
4567
- const file = imageItem.getAsFile();
4568
- if (file) {
4569
- const imageUrl = URL.createObjectURL(file);
4570
- const node = view.state.schema.nodes.image.create({
4571
- src: imageUrl,
4833
+ handlePaste: (view, event, slice) => {
4834
+ if (!event.clipboardData || !event.clipboardData.items)
4835
+ return false;
4836
+ event.preventDefault();
4837
+ const files = Array.from(event.clipboardData.files).map((file) => {
4838
+ return Object.assign(file, {
4839
+ isLoadingMedia: false,
4840
+ internal_id: uuid.v4(),
4572
4841
  });
4573
- const transaction = view.state.tr.replaceSelectionWith(node);
4574
- view.dispatch(transaction);
4575
- }
4576
- });
4577
- } else if (textItem) {
4578
- textItem.getAsString(async (text) => {
4579
- const node = view.state.schema.text(text);
4580
- const tr = view.state.tr;
4581
- tr.replaceSelectionWith(node);
4582
- view.dispatch(tr);
4583
4842
  });
4584
- }
4585
-
4586
- return true;
4587
- },*/
4843
+ const wrongFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
4844
+ if (wrongFiles.length > 0) {
4845
+ for (const file of wrongFiles) {
4846
+ addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
4847
+ }
4848
+ }
4849
+ const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
4850
+ if (mediaFiles.length === 0)
4851
+ return false;
4852
+ addThumbnails({ files: mediaFiles });
4853
+ return false;
4854
+ },
4588
4855
  } }, props));
4589
4856
  const onKeyDown = (event) => {
4590
4857
  if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
@@ -4599,26 +4866,11 @@ const CommentBox = (_a) => {
4599
4866
  const mediaFiles = thumbnails.map((file) => {
4600
4867
  return Object.assign(file, { isLoadingMedia: file.isLoadingMedia });
4601
4868
  });
4602
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isOpen && selectedImage && (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: closeLightbox }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: selectedImage.name }), jsxRuntime.jsx(Lightbox.Body, { children: jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: 3 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: mediaFiles.map((item, index) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type.includes("image") && (jsxRuntime.jsx("img", { src: URL.createObjectURL(thumbnails[index]), alt: `media ${item.name}` })), item.type.includes("video") && (jsxRuntime.jsx(Player, { ref: (ref) => {
4869
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isOpen && selectedImage && (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: closeLightbox }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: selectedImage.name }), jsxRuntime.jsx(Lightbox.Body, { children: jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: 3 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: mediaFiles.map((item, index) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type.includes("image") && (jsxRuntime.jsx("img", { src: URL.createObjectURL(item), alt: `media ${item.name}` })), item.type.includes("video") && (jsxRuntime.jsx(Player, { ref: (ref) => {
4603
4870
  videoRefs.current.push(ref);
4604
- }, url: URL.createObjectURL(thumbnails[index]) }))] }))) })) })) }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), 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 })] }));
4871
+ }, url: URL.createObjectURL(item) }))] }))) })) })) }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), 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 })] }));
4605
4872
  };
4606
4873
 
4607
- var _path$c;
4608
- 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); }
4609
- const SvgDownloadStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
4610
- xmlns: "http://www.w3.org/2000/svg",
4611
- width: 16,
4612
- height: 16,
4613
- focusable: "false",
4614
- viewBox: "0 0 16 16"
4615
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
4616
- fill: "none",
4617
- stroke: "currentColor",
4618
- strokeLinecap: "round",
4619
- d: "M1.5 15.5h13m-11-7l4.1 4.1c.2.2.5.2.7 0l4.1-4.1m-4.4 4V.5"
4620
- })));
4621
-
4622
4874
  const CommentCard = styled.styled(Card) `
4623
4875
  padding: ${({ theme }) => `${theme.space.base * 3}px ${theme.space.sm}`};
4624
4876
  background-color: ${({ theme }) => theme.palette.grey[100]};
@@ -4694,30 +4946,14 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4694
4946
  ed.setOptions({
4695
4947
  editable: false,
4696
4948
  });
4697
- const dowloadSelectedMedia = () => __awaiter(void 0, void 0, void 0, function* () {
4698
- try {
4699
- const response = yield fetch(selectedImage.url);
4700
- const blob = yield response.blob();
4701
- const link = document.createElement('a');
4702
- link.href = window.URL.createObjectURL(blob);
4703
- link.download = "media_" + selectedImage.id.toString() || 'downloadedFile';
4704
- document.body.appendChild(link);
4705
- link.click();
4706
- window.URL.revokeObjectURL(link.href);
4707
- document.body.removeChild(link);
4708
- }
4709
- catch (error) {
4710
- console.error('An error occurred while downloading: ', error);
4711
- }
4712
- });
4713
- return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsxs(AuthorContainer, { children: [jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_a = author.avatarType) !== null && _a !== void 0 ? _a : "text", style: { flexShrink: 0 } }, { children: author.avatar })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(CommentTitle, { children: [(_b = author.name) !== null && _b !== void 0 ? _b : "User", jsxRuntime.jsx(CommentDate, { children: date })] }), jsxRuntime.jsx(ReadOnly, { children: jsxRuntime.jsx(EditorContainer$1, Object.assign({ editable: false }, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed }) })) })] })] }), jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: media.map((file, index) => {
4949
+ return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsxs(AuthorContainer, { children: [jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_a = author.avatarType) !== null && _a !== void 0 ? _a : "text", style: { flexShrink: 0 } }, { children: author.avatar })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(CommentTitle, { children: [(_b = author.name) !== null && _b !== void 0 ? _b : "User", " ", jsxRuntime.jsx(CommentDate, { children: date })] }), jsxRuntime.jsx(ReadOnly, { children: jsxRuntime.jsx(EditorContainer$1, Object.assign({ editable: false }, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed }) })) })] })] }), jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: media.map((file, index) => {
4714
4950
  // Check if item is an image or a video
4715
- if (file.type.includes('image'))
4716
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.url, index: index, showX: true, isLoadingMedia: false, clickThumbnail: () => {
4951
+ if (file.type.includes("image"))
4952
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.url, index: index, showX: false, isLoadingMedia: false, clickThumbnail: () => {
4717
4953
  handleClickThumbnail(file, index);
4718
4954
  } }, index) })));
4719
- if (file.type.includes('video'))
4720
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.url, index: index, showX: true, isLoadingMedia: false, clickThumbnail: () => {
4955
+ if (file.type.includes("video"))
4956
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.url, index: index, showX: false, isLoadingMedia: false, clickThumbnail: () => {
4721
4957
  handleClickThumbnail(file, index);
4722
4958
  } }, index) })));
4723
4959
  return null;
@@ -4726,7 +4962,7 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4726
4962
  }, url: item.url }))] }))) })) })), jsxRuntime.jsx(Lightbox.Body.Details, Object.assign({ style: { flex: 1 } }, { children: jsxRuntime.jsx(Comment, Object.assign({ header: header, author: {
4727
4963
  avatar: author.avatar,
4728
4964
  name: author.name,
4729
- }, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }))] }), jsxRuntime.jsx(Lightbox.Footer, { children: jsxRuntime.jsxs(Button, Object.assign({ isBasic: true, onClick: dowloadSelectedMedia }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgDownloadStroke, {}) }), "Download"] })) }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), jsxRuntime.jsx(Footer$2, { children: children })] }));
4965
+ }, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }))] }), jsxRuntime.jsx(Lightbox.Footer, {}), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), jsxRuntime.jsx(Footer$2, { children: children })] }));
4730
4966
  };
4731
4967
 
4732
4968
  /**
@@ -5365,6 +5601,120 @@ const UgToggle = styled__default["default"](reactForms.Toggle) ``;
5365
5601
  **/
5366
5602
  const Toggle = (props) => jsxRuntime.jsx(UgToggle, Object.assign({}, props));
5367
5603
 
5604
+ const HighlightContext = React.createContext(null);
5605
+ const HighlightContextProvider = ({ term, children, }) => {
5606
+ const [searchTerm, setsearchTerm] = React.useState(term !== null && term !== void 0 ? term : "");
5607
+ React.useEffect(() => {
5608
+ setsearchTerm(term !== null && term !== void 0 ? term : "");
5609
+ }, [term]);
5610
+ const HighlightContextValue = React.useMemo(() => ({
5611
+ searchTerm,
5612
+ }), [searchTerm]);
5613
+ return (jsxRuntime.jsx(HighlightContext.Provider, Object.assign({ value: HighlightContextValue }, { children: children })));
5614
+ };
5615
+ const useHighlightContext = () => {
5616
+ const context = React.useContext(HighlightContext);
5617
+ if (!context)
5618
+ throw new Error("Provider not found for HighlightContextProvider");
5619
+ return context; // Now we can use the context in the component, SAFELY.
5620
+ };
5621
+
5622
+ const StyledSearchWord = styled__default["default"].span `
5623
+ background-color: ${({ theme }) => theme.palette.product.talk};
5624
+ color: ${({ theme }) => theme.palette.grey[700]};`;
5625
+ const Searchable = ({ start, text, }) => {
5626
+ const { searchTerm } = useHighlightContext();
5627
+ if (searchTerm) {
5628
+ const parts = text.split(new RegExp(`(${searchTerm})`, "gi"));
5629
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.map((part, index) => part.toLowerCase() === searchTerm.toLowerCase() ? (jsxRuntime.jsx(StyledSearchWord, { children: part }, index)) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: part }))) }));
5630
+ }
5631
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: text });
5632
+ };
5633
+
5634
+ const StyledWord = styled__default["default"](reactTypography.Span) `
5635
+ font-size: ${({ theme, size }) => theme.fontSizes[size !== null && size !== void 0 ? size : "md"]};
5636
+ padding: ${({ theme }) => theme.space.xxs} 0;
5637
+
5638
+ ${({ observation, theme }) => {
5639
+ var _a, _b;
5640
+ return observation &&
5641
+ ` user-select: none;
5642
+ padding: 0;
5643
+ background-color: ${(_a = observation.hue) !== null && _a !== void 0 ? _a : getColor(theme.palette.azure, 700, undefined, 0.5)};
5644
+ color: ${(_b = observation.color) !== null && _b !== void 0 ? _b : "white"};
5645
+ box-sizing: border-box;
5646
+ &:focus {
5647
+ outline: none;
5648
+ }
5649
+
5650
+ + span:not([observation]) {
5651
+ margin-left: 2px;
5652
+ }
5653
+ `;
5654
+ }}
5655
+ `;
5656
+ const ActiveWord = styled__default["default"].span `
5657
+ background-color: ${({ theme }) => getColor(theme.palette.fuschia, 700, undefined, 0.5)};
5658
+ padding: 0 2px;
5659
+ `;
5660
+ const WordsContainer = styled__default["default"].div `
5661
+ box-sizing: border-box;
5662
+ ${StyledWord}, span {
5663
+ &::selection {
5664
+ background-color: ${({ theme }) => getColor(theme.palette.kale, 700, undefined, 0.5)};
5665
+ }
5666
+ }
5667
+ `;
5668
+ /**
5669
+ * Use Highlight to use highlight interation on any text element
5670
+ */
5671
+ const Highlight = (props) => {
5672
+ const ref = React.useRef(null);
5673
+ const handleSelectionChange = React.useCallback(() => {
5674
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5675
+ const activeSelection = document.getSelection();
5676
+ const text = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.toString();
5677
+ if (!activeSelection || !text) {
5678
+ return;
5679
+ }
5680
+ const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
5681
+ const focusNode = (_b = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
5682
+ if (anchorNode &&
5683
+ focusNode &&
5684
+ ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.contains(anchorNode)) && // Selection starts inside the ref
5685
+ ((_d = ref.current) === null || _d === void 0 ? void 0 : _d.contains(focusNode)) // Selection ends inside the ref
5686
+ ) {
5687
+ const selectionPart = {
5688
+ 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")),
5689
+ 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")),
5690
+ };
5691
+ (_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 }));
5692
+ }
5693
+ }, [props]);
5694
+ React.useEffect(() => {
5695
+ if (ref.current === null)
5696
+ return;
5697
+ document.addEventListener("selectionchange", handleSelectionChange);
5698
+ return () => {
5699
+ document.removeEventListener("selectionchange", handleSelectionChange);
5700
+ };
5701
+ }, [ref, props, handleSelectionChange]);
5702
+ return (jsxRuntime.jsx(HighlightContextProvider, Object.assign({ term: props.search }, { children: jsxRuntime.jsx(WordsContainer, Object.assign({ ref: ref }, { children: props.children })) })));
5703
+ };
5704
+ const Word = (props) => {
5705
+ var _a;
5706
+ const isActive = props.currentTime &&
5707
+ props.currentTime >= props.start &&
5708
+ props.currentTime < props.end;
5709
+ // Is there an observation that contains this word?
5710
+ const observation = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.find((obs) => props.start >= obs.start && props.end <= obs.end);
5711
+ if (props.tooltipContent !== undefined && !!observation) {
5712
+ return (jsxRuntime.jsx(Tooltip, Object.assign({ content: props.tooltipContent(observation), isTransparent: true }, { children: 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 })), " "] })) })));
5713
+ }
5714
+ 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 })), " "] })));
5715
+ };
5716
+ Highlight.Word = Word;
5717
+
5368
5718
  /**
5369
5719
  * The Dots loader communicates ongoing activity after a user takes an action.
5370
5720
  * It tells them that something is taking place.
@@ -6841,6 +7191,7 @@ exports.HeaderItem = HeaderItem;
6841
7191
  exports.HeaderItemIcon = HeaderItemIcon;
6842
7192
  exports.HeaderItemText = HeaderItemText;
6843
7193
  exports.HeaderRow = HeaderRow;
7194
+ exports.Highlight = Highlight;
6844
7195
  exports.Hint = Hint;
6845
7196
  exports.Icon = Icon;
6846
7197
  exports.IconButton = IconButton;