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

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 (30) hide show
  1. package/CHANGELOG.md +281 -0
  2. package/build/index.d.ts +1 -0
  3. package/build/index.js +731 -373
  4. package/build/stories/chat/_types.d.ts +2 -1
  5. package/build/stories/chat/context/chatContext.d.ts +10 -6
  6. package/build/stories/chat/index.stories.d.ts +2 -2
  7. package/build/stories/chat/parts/ThumbnailContainer/index.d.ts +2 -1
  8. package/build/stories/highlight/_types.d.ts +37 -0
  9. package/build/stories/highlight/demo-parts/data.d.ts +49 -0
  10. package/build/stories/highlight/demo-parts/transcript-base.d.ts +5 -0
  11. package/build/stories/highlight/demo-parts/transcript-diarization.d.ts +5 -0
  12. package/build/stories/highlight/demo-parts/transcript-paragraph.d.ts +5 -0
  13. package/build/stories/highlight/highlightContext.d.ts +10 -0
  14. package/build/stories/highlight/index.d.ts +10 -0
  15. package/build/stories/highlight/index.stories.d.ts +17 -0
  16. package/build/stories/highlight/searchable.d.ts +4 -0
  17. package/build/stories/player/_types.d.ts +18 -0
  18. package/build/stories/player/index.stories.d.ts +1 -2
  19. package/build/stories/player/parts/bookmark.d.ts +2 -0
  20. package/build/stories/player/parts/controlButton.d.ts +289 -0
  21. package/build/stories/player/parts/controls.d.ts +7 -2
  22. package/build/stories/player/parts/controlsCenterGroup.d.ts +2 -1
  23. package/build/stories/player/parts/cutterButton.d.ts +6 -0
  24. package/build/stories/player/parts/progress.d.ts +11 -0
  25. package/build/stories/player/parts/progressContext.d.ts +16 -0
  26. package/build/stories/player/parts/timeLabel.d.ts +2 -2
  27. package/build/stories/tooltip/_types.d.ts +1 -0
  28. package/build/stories/tooltip/index.d.ts +1 -0
  29. package/build/stories/tooltip/index.stories.d.ts +1 -0
  30. 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,274 @@ 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 ControlButton = styled__default["default"](IconButton) `
3922
+ color: ${({ theme }) => theme.palette.grey[700]};
3923
+ `;
3924
+
3925
+ const AudioButton = () => {
3926
+ const [hasAudio, setHasAudio] = React.useState(false);
3927
+ const { isMuted, setMuted, context } = Video.useVideoContext();
3928
+ const { player } = context;
3929
+ const checkAudio = (video) => {
3930
+ if (!video) {
3931
+ return false;
3932
+ }
3933
+ const videohasAudio = video.mozHasAudio ||
3934
+ Boolean(video.webkitAudioDecodedByteCount) ||
3935
+ Boolean(video.audioTracks && video.audioTracks.length);
3936
+ setHasAudio(videohasAudio);
3937
+ };
3938
+ const hasVolume = (video) => {
3939
+ if (!video) {
3940
+ return false;
3941
+ }
3942
+ return video.volume > 0;
3943
+ };
3944
+ React.useEffect(() => {
3945
+ if (player && (player === null || player === void 0 ? void 0 : player.ref)) {
3946
+ setMuted(!hasVolume(player.ref.current));
3947
+ checkAudio(player.ref.current);
3948
+ }
3949
+ }, [context.isPlaying, isMuted, player, setMuted]);
3950
+ return (jsxRuntime.jsx(ControlButton, Object.assign({ disabled: !hasAudio, onClick: () => {
3951
+ if (player === null || player === void 0 ? void 0 : player.ref.current) {
3952
+ player.ref.current.volume = player.ref.current.volume > 0 ? 0 : 1;
3953
+ setMuted(!player.ref.current.volume);
3954
+ }
3955
+ } }, { children: isMuted || !hasAudio ? jsxRuntime.jsx(SvgVolumeMutedFill, {}) : jsxRuntime.jsx(SvgVolumeUnmutedFill, {}) })));
3956
+ };
3957
+
3958
+ const ProgressContext = React.createContext(null);
3959
+ const ProgressContextProvider = ({ children, }) => {
3960
+ const [isGrabbing, setIsGrabbing] = React.useState(false);
3961
+ const [fromEnd, setFromEnd] = React.useState(false);
3962
+ const [activeBookmark, setactiveBookmark] = React.useState(undefined);
3963
+ const progressContextValue = React.useMemo(() => ({
3964
+ isGrabbing,
3965
+ fromEnd,
3966
+ activeBookmark,
3967
+ setIsGrabbing,
3968
+ setFromEnd,
3969
+ setactiveBookmark,
3970
+ reset: () => {
3971
+ setIsGrabbing(false);
3972
+ setFromEnd(false);
3973
+ setactiveBookmark(undefined);
3974
+ },
3975
+ }), [isGrabbing, fromEnd, activeBookmark]);
3976
+ return (jsxRuntime.jsx(ProgressContext.Provider, Object.assign({ value: progressContextValue }, { children: children })));
3977
+ };
3978
+ const useProgressContext = () => {
3979
+ const context = React.useContext(ProgressContext);
3980
+ if (!context)
3981
+ throw new Error("Provider not found for ProgressContextProvider");
3982
+ return context; // Now we can use the context in the component, SAFELY.
3983
+ };
3984
+
3985
+ var _g$2;
3908
3986
  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({
3987
+ const SvgGrip = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
3910
3988
  xmlns: "http://www.w3.org/2000/svg",
3911
3989
  width: 16,
3912
3990
  height: 16,
3913
3991
  focusable: "false",
3914
3992
  viewBox: "0 0 16 16"
3915
- }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
3993
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
3916
3994
  fill: "currentColor"
3917
3995
  }, /*#__PURE__*/React__namespace.createElement("rect", {
3918
- width: 4,
3919
- height: 14,
3920
- x: 3,
3996
+ width: 2,
3997
+ height: 2,
3998
+ x: 5,
3921
3999
  y: 1,
3922
- rx: 1,
3923
- ry: 1
4000
+ rx: 0.5,
4001
+ ry: 0.5
3924
4002
  }), /*#__PURE__*/React__namespace.createElement("rect", {
3925
- width: 4,
3926
- height: 14,
4003
+ width: 2,
4004
+ height: 2,
3927
4005
  x: 9,
3928
4006
  y: 1,
3929
- rx: 1,
3930
- ry: 1
4007
+ rx: 0.5,
4008
+ ry: 0.5
4009
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4010
+ width: 2,
4011
+ height: 2,
4012
+ x: 5,
4013
+ y: 5,
4014
+ rx: 0.5,
4015
+ ry: 0.5
4016
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4017
+ width: 2,
4018
+ height: 2,
4019
+ x: 9,
4020
+ y: 5,
4021
+ rx: 0.5,
4022
+ ry: 0.5
4023
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4024
+ width: 2,
4025
+ height: 2,
4026
+ x: 5,
4027
+ y: 9,
4028
+ rx: 0.5,
4029
+ ry: 0.5
4030
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4031
+ width: 2,
4032
+ height: 2,
4033
+ x: 9,
4034
+ y: 9,
4035
+ rx: 0.5,
4036
+ ry: 0.5
4037
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4038
+ width: 2,
4039
+ height: 2,
4040
+ x: 5,
4041
+ y: 13,
4042
+ rx: 0.5,
4043
+ ry: 0.5
4044
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4045
+ width: 2,
4046
+ height: 2,
4047
+ x: 9,
4048
+ y: 13,
4049
+ rx: 0.5,
4050
+ ry: 0.5
3931
4051
  }))));
3932
4052
 
3933
- var _path$k, _path2$5, _path3$1;
4053
+ const StyledGrabber = styled.styled.div `
4054
+ position: absolute;
4055
+ display: none;
4056
+ ${({ isEnd }) => isEnd
4057
+ ? `
4058
+ right: 0;
4059
+ border-top-right-radius: 2px;
4060
+ border-bottom-right-radius: 2px;
4061
+ `
4062
+ : `
4063
+ left: 0;
4064
+ border-top-left-radius: 2px;
4065
+ border-bottom-left-radius: 2px;
4066
+ `}
4067
+ height: 100%;
4068
+ width: 8px;
4069
+ background-color: white;
4070
+ z-index: 2;
4071
+ cursor: ew-resize;
4072
+
4073
+ div {
4074
+ display: flex;
4075
+ justify-content: center;
4076
+ align-items: center;
4077
+ height: 100%;
4078
+ width: 100%;
4079
+ color: ${({ theme }) => theme.palette.grey[500]};
4080
+ svg {
4081
+ width: auto;
4082
+ height: 50%;
4083
+ }
4084
+ }
4085
+ `;
4086
+ const activeBookMark = styled.css `
4087
+ height: 250%;
4088
+ transform: translateY(-30%);
4089
+
4090
+ ${StyledGrabber} {
4091
+ display: block;
4092
+ }
4093
+ `;
4094
+ const Rect = styled.styled.div `
4095
+ position: absolute;
4096
+ height: 110%;
4097
+ background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
4098
+ z-index: 1;
4099
+ border-radius: 2px;
4100
+ &:hover {
4101
+ ${activeBookMark}
4102
+ border-radius: 4px;
4103
+ }
4104
+ color: white;
4105
+ ${({ isActive }) => isActive && activeBookMark}
4106
+
4107
+ transition: width 0.1s ease;
4108
+ `;
4109
+ const Grabber = (props) => {
4110
+ const { observation } = props;
4111
+ const { setIsGrabbing, setactiveBookmark, setFromEnd } = useProgressContext();
4112
+ const handleDragStart = (e) => {
4113
+ setIsGrabbing(true);
4114
+ setactiveBookmark(observation);
4115
+ setFromEnd(!!props.isEnd);
4116
+ e.preventDefault();
4117
+ e.stopPropagation();
4118
+ };
4119
+ return (jsxRuntime.jsx(StyledGrabber, Object.assign({ isEnd: props.isEnd, onMouseDown: handleDragStart, onMouseMove: props.handleMouseMove }, { children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(SvgGrip, {}) }) })));
4120
+ };
4121
+ const Bookmark = (props) => {
4122
+ var _a, _b;
4123
+ const { start, end, hue, label } = props;
4124
+ const { context } = Video.useVideoContext();
4125
+ const videoStart = context.part.start || 0;
4126
+ const videoEnd = context.part.end || ((_a = context.player) === null || _a === void 0 ? void 0 : _a.totalTime) || 0;
4127
+ const duration = videoEnd - videoStart || ((_b = context.player) === null || _b === void 0 ? void 0 : _b.totalTime) || 0; //relative
4128
+ const { activeBookmark } = useProgressContext();
4129
+ if (!context.player || !context.player.ref) {
4130
+ return null;
4131
+ }
4132
+ if (start > videoEnd || start < videoStart)
4133
+ return null;
4134
+ 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: {
4135
+ left: `${((start - videoStart) / duration) * 100}%`,
4136
+ width: `${((end - start) / duration) * 100}%`,
4137
+ }, onClick: props.onClick }, { children: [jsxRuntime.jsx(Grabber, { observation: props }), jsxRuntime.jsx(Grabber, { isEnd: true, observation: props })] })) })));
4138
+ };
4139
+
4140
+ var _path$j, _path2$3, _path3$1;
3934
4141
  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({
4142
+ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
3936
4143
  width: 16,
3937
4144
  height: 16,
3938
4145
  viewBox: "0 0 16 16",
3939
4146
  fill: "none",
3940
4147
  xmlns: "http://www.w3.org/2000/svg"
3941
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
4148
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
3942
4149
  fillRule: "evenodd",
3943
4150
  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",
4151
+ 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
4152
  fill: "currentColor"
3946
- })), _path2$5 || (_path2$5 = /*#__PURE__*/React__namespace.createElement("path", {
4153
+ })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
3947
4154
  d: "M5.5 7.63073V7.07008H6.67566V11H6.02566V7.63073H5.5Z",
3948
4155
  fill: "currentColor"
3949
4156
  })), _path3$1 || (_path3$1 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -3951,20 +4158,20 @@ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createEleme
3951
4158
  fill: "currentColor"
3952
4159
  })));
3953
4160
 
3954
- var _path$j, _path2$4, _path3;
4161
+ var _path$i, _path2$2, _path3;
3955
4162
  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({
4163
+ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
3957
4164
  width: 16,
3958
4165
  height: 16,
3959
4166
  viewBox: "0 0 16 16",
3960
4167
  fill: "none",
3961
4168
  xmlns: "http://www.w3.org/2000/svg"
3962
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
4169
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
3963
4170
  fillRule: "evenodd",
3964
4171
  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",
4172
+ 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
4173
  fill: "currentColor"
3967
- })), _path2$4 || (_path2$4 = /*#__PURE__*/React__namespace.createElement("path", {
4174
+ })), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
3968
4175
  d: "M5.5 7.63073V7.07008H6.67566V11H6.02566V7.63073H5.5Z",
3969
4176
  fill: "currentColor"
3970
4177
  })), _path3 || (_path3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -3972,18 +4179,57 @@ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement(
3972
4179
  fill: "currentColor"
3973
4180
  })));
3974
4181
 
3975
- var _path$i, _path2$3;
4182
+ var _g$1;
3976
4183
  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({
4184
+ const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
4185
+ xmlns: "http://www.w3.org/2000/svg",
4186
+ width: 16,
4187
+ height: 16,
4188
+ focusable: "false",
4189
+ viewBox: "0 0 16 16"
4190
+ }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
4191
+ fill: "currentColor"
4192
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
4193
+ width: 4,
4194
+ height: 14,
4195
+ x: 3,
4196
+ y: 1,
4197
+ rx: 1,
4198
+ ry: 1
4199
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4200
+ width: 4,
4201
+ height: 14,
4202
+ x: 9,
4203
+ y: 1,
4204
+ rx: 1,
4205
+ ry: 1
4206
+ }))));
4207
+
4208
+ var _path$h;
4209
+ 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); }
4210
+ const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
4211
+ xmlns: "http://www.w3.org/2000/svg",
4212
+ width: 16,
4213
+ height: 16,
4214
+ focusable: "false",
4215
+ viewBox: "0 0 16 16"
4216
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
4217
+ fill: "currentColor",
4218
+ 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"
4219
+ })));
4220
+
4221
+ var _path$g, _path2$1;
4222
+ 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); }
4223
+ const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
3978
4224
  xmlns: "http://www.w3.org/2000/svg",
3979
4225
  width: 16,
3980
4226
  height: 16,
3981
4227
  focusable: "false",
3982
4228
  viewBox: "0 0 24 24"
3983
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
4229
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
3984
4230
  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
4231
  fill: "currentColor"
3986
- })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
4232
+ })), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
3987
4233
  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
4234
  fill: "currentColor"
3989
4235
  })));
@@ -4013,8 +4259,9 @@ const getNextPlaybackRate = (rate = 1) => {
4013
4259
  const StyledDiv$3 = styled__default["default"].div `
4014
4260
  display: flex;
4015
4261
  align-items: center;
4262
+ justify-content: center;
4016
4263
  `;
4017
- const ControlsGroupCenter = () => {
4264
+ const ControlsGroupCenter = (props) => {
4018
4265
  var _a;
4019
4266
  const [playBackRate, setPlayBackRate] = React.useState(1);
4020
4267
  const { context, togglePlay } = Video.useVideoContext();
@@ -4037,133 +4284,86 @@ const ControlsGroupCenter = () => {
4037
4284
  const nextTime = videoRef.currentTime + 10;
4038
4285
  videoRef.currentTime = nextTime;
4039
4286
  };
4040
- return (jsxRuntime.jsxs(StyledDiv$3, { children: [jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4287
+ return (jsxRuntime.jsxs(StyledDiv$3, Object.assign({}, props, { children: [jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4041
4288
  if (videoRef) {
4042
4289
  videoRef.currentTime = 0;
4043
4290
  }
4044
4291
  e.stopPropagation();
4045
- } }, { children: jsxRuntime.jsx(SvgPreviousFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4292
+ } }, { children: jsxRuntime.jsx(SvgPreviousFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4046
4293
  onRewind();
4047
4294
  e.stopPropagation();
4048
- } }, { children: jsxRuntime.jsx(SvgBackSecondsFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, size: "large", onClick: togglePlay }, { children: isPlaying ? (jsxRuntime.jsx(SvgPauseFill, { style: { width: "24px", height: "24px" } })) : (jsxRuntime.jsx(SvgPlayFill, { style: { width: "24px", height: "24px" } })) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4295
+ } }, { children: jsxRuntime.jsx(SvgBackSecondsFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ size: "large", onClick: togglePlay }, { children: isPlaying ? (jsxRuntime.jsx(SvgPauseFill, { style: { width: "24px", height: "24px" } })) : (jsxRuntime.jsx(SvgPlayFill, { style: { width: "24px", height: "24px" } })) })), jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4049
4296
  onForward();
4050
4297
  e.stopPropagation();
4051
- } }, { children: jsxRuntime.jsx(SvgForwardSecondsFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, isPill: true, onClick: (e) => {
4298
+ } }, { children: jsxRuntime.jsx(SvgForwardSecondsFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ isPill: true, onClick: (e) => {
4052
4299
  const newSpeed = getNextPlaybackRate(playBackRate);
4053
4300
  if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.playbackRate) {
4054
4301
  setPlayBackRate(newSpeed);
4055
4302
  videoRef.playbackRate = newSpeed;
4056
4303
  }
4057
4304
  e.stopPropagation();
4058
- } }, { children: jsxRuntime.jsxs(SM, Object.assign({ isBold: true, style: { lineHeight: "16px" } }, { children: [playBackRate, "x"] })) }))] }));
4305
+ } }, { children: jsxRuntime.jsxs(SM, Object.assign({ isBold: true, style: { lineHeight: "16px" } }, { children: [playBackRate, "x"] })) }))] })));
4059
4306
  };
4060
4307
 
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({
4308
+ var _path$f, _circle$1;
4309
+ 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); }
4310
+ const SvgTagStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
4094
4311
  xmlns: "http://www.w3.org/2000/svg",
4095
4312
  width: 16,
4096
4313
  height: 16,
4097
4314
  focusable: "false",
4098
4315
  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", {
4316
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
4103
4317
  fill: "none",
4104
4318
  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"
4319
+ 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"
4320
+ })), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
4321
+ cx: 4,
4322
+ cy: 4,
4323
+ r: 1,
4324
+ fill: "currentColor"
4107
4325
  })));
4108
4326
 
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);
4327
+ const Cutter = ({ onCutHandler, isCutting, i18n, }) => {
4328
+ var _a;
4329
+ const { context } = Video.useVideoContext();
4330
+ const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4331
+ if (!onCutHandler)
4332
+ return null;
4333
+ return (jsxRuntime.jsxs(Button, Object.assign({ isPrimary: true, isAccent: true, size: "small", onClick: (e) => {
4334
+ if (videoRef) {
4335
+ onCutHandler(videoRef.currentTime);
4139
4336
  }
4140
- } }, { children: isMuted || !hasAudio ? jsxRuntime.jsx(SvgVolumeMutedFill, {}) : jsxRuntime.jsx(SvgVolumeUnmutedFill, {}) })));
4337
+ e.stopPropagation();
4338
+ } }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), isCutting
4339
+ ? (i18n === null || i18n === void 0 ? void 0 : i18n.onHighlight) || "Click again to stop"
4340
+ : (i18n === null || i18n === void 0 ? void 0 : i18n.beforeHighlight) || "New highlight"] })));
4141
4341
  };
4142
4342
 
4143
- var _path$f;
4144
- 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); }
4145
- const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
4343
+ var _path$e;
4344
+ 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); }
4345
+ const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
4146
4346
  xmlns: "http://www.w3.org/2000/svg",
4147
4347
  width: 16,
4148
4348
  height: 16,
4149
4349
  focusable: "false",
4150
4350
  viewBox: "0 0 16 16"
4151
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
4351
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
4152
4352
  fill: "none",
4153
4353
  stroke: "currentColor",
4154
4354
  strokeLinecap: "round",
4155
4355
  d: "M4.5.5H1C.72.5.5.72.5 1v3.5m15 0V1c0-.28-.22-.5-.5-.5h-3.5m-11 11V15c0 .28.22.5.5.5h3.5m11-4V15c0 .28-.22.5-.5.5h-3.5m-7-11L1 1m10.5 3.5L15 1M4.5 11.5L1 15m10.5-3.5L15 15"
4156
4356
  })));
4157
4357
 
4158
- var _path$e;
4159
- 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); }
4160
- const SvgMinimizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
4358
+ var _path$d;
4359
+ 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); }
4360
+ const SvgMinimizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
4161
4361
  xmlns: "http://www.w3.org/2000/svg",
4162
4362
  width: 16,
4163
4363
  height: 16,
4164
4364
  focusable: "false",
4165
4365
  viewBox: "0 0 16 16"
4166
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
4366
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
4167
4367
  fill: "none",
4168
4368
  stroke: "currentColor",
4169
4369
  strokeLinecap: "round",
@@ -4206,7 +4406,7 @@ const FullScreenButton = ({ container, }) => {
4206
4406
  setFullScreen(false);
4207
4407
  }
4208
4408
  }
4209
- }), [ref, isFullScreen]);
4409
+ }), [ref, isFullScreen, setFullScreen]);
4210
4410
  const canGoFullScreen = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
4211
4411
  if (ref) {
4212
4412
  return (requestFullscreen ||
@@ -4231,31 +4431,77 @@ const FullScreenButton = ({ container, }) => {
4231
4431
  }
4232
4432
  };
4233
4433
  }, [ref]);
4234
- return (jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4434
+ return (jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4235
4435
  handleFullScreen();
4236
4436
  e.stopPropagation();
4237
4437
  }, disabled: !canGoFullScreen() }, { children: document.fullscreenElement || isFullScreen ? (jsxRuntime.jsx(SvgMinimizeStroke, {})) : (jsxRuntime.jsx(SvgMaximizeStroke, {})) })));
4238
4438
  };
4239
4439
 
4440
+ const UgProgress = styled__default["default"](reactLoaders.Progress) ``;
4441
+ /**
4442
+ * A Progress loader communicates progress when downloading or uploading content.
4443
+ * <hr>
4444
+ * Used for this:
4445
+ * - To communicate the amount of time left when downloading or uploading content
4446
+ *
4447
+ Not for this:
4448
+ - When the loading time is unknown, use a Spinner instead
4449
+ - When loading page content, use a Skeleton loader instead
4450
+ */
4451
+ const Progress = React.forwardRef((props, ref) => (jsxRuntime.jsx(UgProgress, Object.assign({ ref: ref }, props))));
4452
+
4453
+ const StyledProgress = styled.styled(Progress) `
4454
+ width: 100%;
4455
+ border-radius: 0;
4456
+ color: ${({ theme }) => theme.palette.grey[700]};
4457
+ cursor: pointer;
4458
+ > div {
4459
+ border-radius: 0;
4460
+ }
4461
+ `;
4462
+ const ProgressBar = React.forwardRef((props, ref) => {
4463
+ const { progress, handleSkipAhead } = props;
4464
+ return (jsxRuntime.jsx(StyledProgress, { className: "progress-bar-1", ref: ref, value: progress, onClick: (e) => handleSkipAhead(e.clientX) }));
4465
+ });
4466
+
4467
+ const StyledDiv$2 = styled__default["default"].div `
4468
+ display: flex;
4469
+ color: ${({ theme }) => theme.palette.grey[700]};
4470
+ `;
4471
+ const TimeLabel = ({ current, duration, }) => (jsxRuntime.jsx(StyledDiv$2, { children: jsxRuntime.jsxs(SM, Object.assign({ tag: "span" }, { children: [formatDuration(current), "/", formatDuration(duration)] })) }));
4472
+
4473
+ const Wrapper$1 = styled__default["default"].div `
4474
+ position: absolute;
4475
+ bottom: ${({ theme }) => theme.space.sm};
4476
+ z-index: 1;
4477
+ `;
4478
+ const Content$1 = styled__default["default"].div `
4479
+ display: flex;
4480
+ background-color: ${({ theme }) => theme.palette.grey[800]};
4481
+ border-radius: 2px;
4482
+ width: auto;
4483
+ padding: 2px 4px;
4484
+ display: inline-flex;
4485
+ color: white;
4486
+ align-items: center;
4487
+ justify-content: center;
4488
+ min-height: 16px;
4489
+ `;
4490
+ const PlayerTooltip = (_a) => {
4491
+ var { children } = _a, props = __rest(_a, ["children"]);
4492
+ return (jsxRuntime.jsx(Wrapper$1, Object.assign({}, props, { children: jsxRuntime.jsx(Content$1, { children: children }) })));
4493
+ };
4494
+
4240
4495
  const ControlsWrapper = styled__default["default"].div `
4241
4496
  position: absolute;
4242
4497
  bottom: 0;
4243
4498
  left: 0;
4244
4499
  right: 0;
4245
4500
  padding: ${({ theme }) => theme.space.xxs} 0;
4246
- background-color: ${({ theme }) => reactTheming.getColor(theme.palette.grey, 700, undefined, 0.8)};
4501
+ background-color: ${({ theme }) => theme.palette.grey[100]};
4247
4502
  ${({ isPlaying }) => isPlaying && "display: none;"}
4248
4503
  z-index: 2;
4249
4504
  `;
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
4505
  const StyledTooltip = styled__default["default"](PlayerTooltip) `
4260
4506
  display: none;
4261
4507
  `;
@@ -4274,18 +4520,23 @@ const StyledDiv$1 = styled__default["default"].div `
4274
4520
  display: flex;
4275
4521
  align-items: center;
4276
4522
  `;
4277
- const Controls = ({ container, }) => {
4523
+ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, }) => {
4278
4524
  var _a, _b, _c;
4279
4525
  const [progress, setProgress] = React.useState(0);
4280
4526
  const [tooltipMargin, setTooltipMargin] = React.useState(0);
4281
4527
  const [tooltipLabel, setTooltipLabel] = React.useState("00:00");
4528
+ const [marks, setMarks] = React.useState(bookmarks);
4282
4529
  const progressRef = React.useRef(null);
4283
4530
  const { context, setCurrentTime } = Video.useVideoContext();
4531
+ const { reset, isGrabbing, activeBookmark, fromEnd } = useProgressContext();
4532
+ React.useEffect(() => {
4533
+ setMarks(bookmarks);
4534
+ }, [bookmarks]);
4284
4535
  const relCurrentTime = ((_a = context.player) === null || _a === void 0 ? void 0 : _a.currentTime)
4285
4536
  ? ((_b = context.player) === null || _b === void 0 ? void 0 : _b.currentTime) - context.part.start
4286
4537
  : 0;
4287
4538
  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) => {
4539
+ const getVideoPositionFromEvent = React.useCallback((clientX) => {
4289
4540
  if (progressRef && progressRef.current && duration) {
4290
4541
  const bounds = progressRef.current.getBoundingClientRect();
4291
4542
  const x = clientX - bounds.left;
@@ -4293,12 +4544,18 @@ const Controls = ({ container, }) => {
4293
4544
  return videoPositionSecs;
4294
4545
  }
4295
4546
  return 0;
4296
- };
4547
+ }, [progressRef, duration]);
4548
+ const getProgress = React.useCallback((currentTime) => {
4549
+ const current = currentTime - (context.part.start || 0);
4550
+ if (duration === 0)
4551
+ return 0;
4552
+ return (current / duration) * 100;
4553
+ }, [context.part.start, duration]);
4297
4554
  const handleSkipAhead = React.useCallback((pageX) => {
4298
4555
  const time = getVideoPositionFromEvent(pageX) + (context.part.start || 0);
4299
4556
  setCurrentTime(time);
4300
4557
  setProgress(getProgress(time));
4301
- }, [context.player, context.part]);
4558
+ }, [getVideoPositionFromEvent, context.part.start, setCurrentTime, getProgress]);
4302
4559
  const onMouseEvent = (e) => {
4303
4560
  if (progressRef && progressRef.current) {
4304
4561
  const tooltipWidth = 40;
@@ -4309,31 +4566,58 @@ const Controls = ({ container, }) => {
4309
4566
  const videoTargetDuration = getVideoPositionFromEvent(e.clientX);
4310
4567
  setTooltipMargin(newTooltipMargin);
4311
4568
  setTooltipLabel(formatDuration(videoTargetDuration));
4569
+ if (isGrabbing) {
4570
+ handleBookmarkUpdate(marginX, progressRef.current.clientWidth);
4571
+ }
4312
4572
  }
4313
4573
  };
4574
+ const handleBookmarkUpdate = React.useCallback((newX, clientW) => {
4575
+ if (!activeBookmark || !marks)
4576
+ return;
4577
+ const currentObsIndex = marks.findIndex((mark) => mark.id === activeBookmark.id);
4578
+ const value = (newX / clientW) * duration + context.part.start;
4579
+ const updatedMark = Object.assign(Object.assign({}, marks[currentObsIndex]), (!!fromEnd ? { end: value } : { start: value }));
4580
+ const newMarks = [
4581
+ ...marks.slice(0, currentObsIndex),
4582
+ updatedMark,
4583
+ ...marks.slice(currentObsIndex + 1),
4584
+ ];
4585
+ setMarks(newMarks);
4586
+ onBookMarkUpdated === null || onBookMarkUpdated === void 0 ? void 0 : onBookMarkUpdated(updatedMark);
4587
+ }, [
4588
+ activeBookmark,
4589
+ context.part.start,
4590
+ duration,
4591
+ fromEnd,
4592
+ onBookMarkUpdated,
4593
+ marks,
4594
+ ]);
4314
4595
  React.useEffect(() => {
4315
4596
  var _a;
4316
4597
  const currentTime = ((_a = context.player) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;
4317
4598
  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 }) })] })] })));
4599
+ }, [context.player, getProgress]);
4600
+ React.useEffect(() => {
4601
+ if (!marks)
4602
+ return;
4603
+ document.addEventListener("mouseup", reset);
4604
+ return () => {
4605
+ document.removeEventListener("mouseup", reset);
4606
+ };
4607
+ }, [reset, marks]);
4608
+ 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 &&
4609
+ (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
4610
  };
4327
4611
 
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({
4612
+ var _path$c;
4613
+ 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); }
4614
+ const SvgPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
4331
4615
  width: 70,
4332
4616
  height: 70,
4333
4617
  viewBox: "0 0 70 70",
4334
4618
  fill: "none",
4335
4619
  xmlns: "http://www.w3.org/2000/svg"
4336
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
4620
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
4337
4621
  d: "M60 35L17 62L17 8L60 35Z",
4338
4622
  fill: "#003A57"
4339
4623
  })));
@@ -4354,6 +4638,10 @@ const BigButton = styled__default["default"](IconButton) `
4354
4638
  min-width: ${({ theme }) => theme.space.base * 15}px;
4355
4639
  width: 80px;
4356
4640
  height: 80px;
4641
+
4642
+ box-shadow: ${({ theme }) => theme.shadows.boxShadow(theme)};
4643
+
4644
+
4357
4645
  ${PlayIcon} {
4358
4646
  width: 60%;
4359
4647
  height: 60%;
@@ -4420,8 +4708,7 @@ const Container$1 = styled__default["default"].div `
4420
4708
  }
4421
4709
  }
4422
4710
  }
4423
-
4424
- background-color: ${({ theme }) => theme.palette.grey[700]};
4711
+ background: ${({ theme }) => theme.palette.grey[100]};
4425
4712
  `;
4426
4713
 
4427
4714
  const UgSpinner = styled__default["default"](reactLoaders.Spinner) ``;
@@ -4449,18 +4736,15 @@ const VideoSpinner = () => (jsxRuntime.jsx(StyledDiv, { children: jsxRuntime.jsx
4449
4736
  * Used for this:
4450
4737
  - To display a video
4451
4738
  */
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
- });
4739
+ 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
4740
  const PlayerCore = React.forwardRef((props, forwardRef) => {
4458
4741
  var _a;
4459
4742
  const { context, togglePlay, setIsPlaying } = Video.useVideoContext();
4743
+ const { onCutHandler, bookmarks, isCutting } = props;
4460
4744
  const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4461
4745
  const isLoaded = !!videoRef;
4462
4746
  const containerRef = React.useRef(null);
4463
- React.useImperativeHandle(forwardRef, () => videoRef);
4747
+ React.useImperativeHandle(forwardRef, () => videoRef, [videoRef]);
4464
4748
  React.useEffect(() => {
4465
4749
  if (videoRef) {
4466
4750
  videoRef.addEventListener("pause", () => {
@@ -4474,8 +4758,8 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
4474
4758
  });
4475
4759
  }
4476
4760
  };
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 })] })));
4761
+ }, [setIsPlaying, videoRef]);
4762
+ 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
4763
  });
4480
4764
 
4481
4765
  const ChatBoxContainer = styled__default["default"].div `
@@ -4499,7 +4783,7 @@ const ChatBoxContainer = styled__default["default"].div `
4499
4783
  const CommentBox = (_a) => {
4500
4784
  var { placeholderOptions } = _a, props = __rest(_a, ["placeholderOptions"]);
4501
4785
  const { children, hasFloatingMenu, hasButtonsMenu, bubbleOptions, i18n } = props;
4502
- const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails } = useChatContext();
4786
+ const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails, } = useChatContext();
4503
4787
  const { addToast } = useToast();
4504
4788
  const [isOpen, setIsOpen] = React.useState(false);
4505
4789
  const [selectedImage, setSelectedImage] = React.useState({});
@@ -4536,12 +4820,15 @@ const CommentBox = (_a) => {
4536
4820
  return false;
4537
4821
  event.preventDefault();
4538
4822
  const files = Array.from(event.dataTransfer.files).map((file) => {
4539
- return Object.assign(file, { isLoadingMedia: false });
4823
+ return Object.assign(file, {
4824
+ isLoadingMedia: false,
4825
+ internal_id: uuid.v4(),
4826
+ });
4540
4827
  });
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' });
4828
+ const wrongFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
4829
+ if (wrongFiles.length > 0) {
4830
+ for (const file of wrongFiles) {
4831
+ addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
4545
4832
  }
4546
4833
  }
4547
4834
  const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
@@ -4550,41 +4837,28 @@ const CommentBox = (_a) => {
4550
4837
  addThumbnails({ files: mediaFiles });
4551
4838
  return false;
4552
4839
  },
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,
4840
+ handlePaste: (view, event, slice) => {
4841
+ if (!event.clipboardData || !event.clipboardData.items)
4842
+ return false;
4843
+ event.preventDefault();
4844
+ const files = Array.from(event.clipboardData.files).map((file) => {
4845
+ return Object.assign(file, {
4846
+ isLoadingMedia: false,
4847
+ internal_id: uuid.v4(),
4572
4848
  });
4573
- const transaction = view.state.tr.replaceSelectionWith(node);
4574
- view.dispatch(transaction);
4575
- }
4576
4849
  });
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
- });
4584
- }
4585
-
4586
- return true;
4587
- },*/
4850
+ const wrongFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
4851
+ if (wrongFiles.length > 0) {
4852
+ for (const file of wrongFiles) {
4853
+ addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
4854
+ }
4855
+ }
4856
+ const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
4857
+ if (mediaFiles.length === 0)
4858
+ return false;
4859
+ addThumbnails({ files: mediaFiles });
4860
+ return false;
4861
+ },
4588
4862
  } }, props));
4589
4863
  const onKeyDown = (event) => {
4590
4864
  if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
@@ -4599,26 +4873,11 @@ const CommentBox = (_a) => {
4599
4873
  const mediaFiles = thumbnails.map((file) => {
4600
4874
  return Object.assign(file, { isLoadingMedia: file.isLoadingMedia });
4601
4875
  });
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) => {
4876
+ 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
4877
  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 })] }));
4878
+ }, 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
4879
  };
4606
4880
 
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
4881
  const CommentCard = styled.styled(Card) `
4623
4882
  padding: ${({ theme }) => `${theme.space.base * 3}px ${theme.space.sm}`};
4624
4883
  background-color: ${({ theme }) => theme.palette.grey[100]};
@@ -4694,30 +4953,14 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4694
4953
  ed.setOptions({
4695
4954
  editable: false,
4696
4955
  });
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) => {
4956
+ 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
4957
  // 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: () => {
4958
+ if (file.type.includes("image"))
4959
+ 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
4960
  handleClickThumbnail(file, index);
4718
4961
  } }, 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: () => {
4962
+ if (file.type.includes("video"))
4963
+ 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
4964
  handleClickThumbnail(file, index);
4722
4965
  } }, index) })));
4723
4966
  return null;
@@ -4726,7 +4969,7 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4726
4969
  }, url: item.url }))] }))) })) })), jsxRuntime.jsx(Lightbox.Body.Details, Object.assign({ style: { flex: 1 } }, { children: jsxRuntime.jsx(Comment, Object.assign({ header: header, author: {
4727
4970
  avatar: author.avatar,
4728
4971
  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 })] }));
4972
+ }, 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
4973
  };
4731
4974
 
4732
4975
  /**
@@ -5365,6 +5608,120 @@ const UgToggle = styled__default["default"](reactForms.Toggle) ``;
5365
5608
  **/
5366
5609
  const Toggle = (props) => jsxRuntime.jsx(UgToggle, Object.assign({}, props));
5367
5610
 
5611
+ const HighlightContext = React.createContext(null);
5612
+ const HighlightContextProvider = ({ term, children, }) => {
5613
+ const [searchTerm, setsearchTerm] = React.useState(term !== null && term !== void 0 ? term : "");
5614
+ React.useEffect(() => {
5615
+ setsearchTerm(term !== null && term !== void 0 ? term : "");
5616
+ }, [term]);
5617
+ const HighlightContextValue = React.useMemo(() => ({
5618
+ searchTerm,
5619
+ }), [searchTerm]);
5620
+ return (jsxRuntime.jsx(HighlightContext.Provider, Object.assign({ value: HighlightContextValue }, { children: children })));
5621
+ };
5622
+ const useHighlightContext = () => {
5623
+ const context = React.useContext(HighlightContext);
5624
+ if (!context)
5625
+ throw new Error("Provider not found for HighlightContextProvider");
5626
+ return context; // Now we can use the context in the component, SAFELY.
5627
+ };
5628
+
5629
+ const StyledSearchWord = styled__default["default"].span `
5630
+ background-color: ${({ theme }) => theme.palette.product.talk};
5631
+ color: ${({ theme }) => theme.palette.grey[700]};`;
5632
+ const Searchable = ({ start, text, }) => {
5633
+ const { searchTerm } = useHighlightContext();
5634
+ if (searchTerm) {
5635
+ const parts = text.split(new RegExp(`(${searchTerm})`, "gi"));
5636
+ 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 }))) }));
5637
+ }
5638
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: text });
5639
+ };
5640
+
5641
+ const StyledWord = styled__default["default"](reactTypography.Span) `
5642
+ font-size: ${({ theme, size }) => theme.fontSizes[size !== null && size !== void 0 ? size : "md"]};
5643
+ padding: ${({ theme }) => theme.space.xxs} 0;
5644
+
5645
+ ${({ observation, theme }) => {
5646
+ var _a, _b;
5647
+ return observation &&
5648
+ ` user-select: none;
5649
+ padding: 0;
5650
+ background-color: ${(_a = observation.hue) !== null && _a !== void 0 ? _a : getColor(theme.palette.azure, 700, undefined, 0.5)};
5651
+ color: ${(_b = observation.color) !== null && _b !== void 0 ? _b : "white"};
5652
+ box-sizing: border-box;
5653
+ &:focus {
5654
+ outline: none;
5655
+ }
5656
+
5657
+ + span:not([observation]) {
5658
+ margin-left: 2px;
5659
+ }
5660
+ `;
5661
+ }}
5662
+ `;
5663
+ const ActiveWord = styled__default["default"].span `
5664
+ background-color: ${({ theme }) => getColor(theme.palette.fuschia, 700, undefined, 0.5)};
5665
+ padding: 0 2px;
5666
+ `;
5667
+ const WordsContainer = styled__default["default"].div `
5668
+ box-sizing: border-box;
5669
+ ${StyledWord}, span {
5670
+ &::selection {
5671
+ background-color: ${({ theme }) => getColor(theme.palette.kale, 700, undefined, 0.5)};
5672
+ }
5673
+ }
5674
+ `;
5675
+ /**
5676
+ * Use Highlight to use highlight interation on any text element
5677
+ */
5678
+ const Highlight = (props) => {
5679
+ const ref = React.useRef(null);
5680
+ const handleSelectionChange = React.useCallback(() => {
5681
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5682
+ const activeSelection = document.getSelection();
5683
+ const text = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.toString();
5684
+ if (!activeSelection || !text) {
5685
+ return;
5686
+ }
5687
+ const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
5688
+ const focusNode = (_b = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
5689
+ if (anchorNode &&
5690
+ focusNode &&
5691
+ ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.contains(anchorNode)) && // Selection starts inside the ref
5692
+ ((_d = ref.current) === null || _d === void 0 ? void 0 : _d.contains(focusNode)) // Selection ends inside the ref
5693
+ ) {
5694
+ const selectionPart = {
5695
+ 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")),
5696
+ 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")),
5697
+ };
5698
+ (_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 }));
5699
+ }
5700
+ }, [props]);
5701
+ React.useEffect(() => {
5702
+ if (ref.current === null)
5703
+ return;
5704
+ document.addEventListener("selectionchange", handleSelectionChange);
5705
+ return () => {
5706
+ document.removeEventListener("selectionchange", handleSelectionChange);
5707
+ };
5708
+ }, [ref, props, handleSelectionChange]);
5709
+ return (jsxRuntime.jsx(HighlightContextProvider, Object.assign({ term: props.search }, { children: jsxRuntime.jsx(WordsContainer, Object.assign({ ref: ref }, { children: props.children })) })));
5710
+ };
5711
+ const Word = (props) => {
5712
+ var _a;
5713
+ const isActive = props.currentTime &&
5714
+ props.currentTime >= props.start &&
5715
+ props.currentTime < props.end;
5716
+ // Is there an observation that contains this word?
5717
+ const observation = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.find((obs) => props.start >= obs.start && props.end <= obs.end);
5718
+ if (props.tooltipContent !== undefined && !!observation) {
5719
+ 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 })), " "] })) })));
5720
+ }
5721
+ 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 })), " "] })));
5722
+ };
5723
+ Highlight.Word = Word;
5724
+
5368
5725
  /**
5369
5726
  * The Dots loader communicates ongoing activity after a user takes an action.
5370
5727
  * It tells them that something is taking place.
@@ -6841,6 +7198,7 @@ exports.HeaderItem = HeaderItem;
6841
7198
  exports.HeaderItemIcon = HeaderItemIcon;
6842
7199
  exports.HeaderItemText = HeaderItemText;
6843
7200
  exports.HeaderRow = HeaderRow;
7201
+ exports.Highlight = Highlight;
6844
7202
  exports.Hint = Hint;
6845
7203
  exports.Icon = Icon;
6846
7204
  exports.IconButton = IconButton;